Skip to content

Commit 25875ee

Browse files
author
Uttam Rabadiya
committed
Bumped Version & Fixed Lint Errors.
1 parent 2e935ea commit 25875ee

File tree

3 files changed

+16
-155
lines changed

3 files changed

+16
-155
lines changed

src/components/PToast/components/PToast.vue

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ type position = 'top-right' | 'top' | 'top-left' | 'bottom-right' | 'bottom' | '
4141
4242
const removeElement = (el) => {
4343
if (typeof el.remove !== 'undefined') {
44-
el.remove()
44+
el.remove();
4545
} else {
46-
el.parentNode.removeChild(el)
46+
el.parentNode.removeChild(el);
4747
}
4848
};
4949
@@ -97,18 +97,12 @@ export default class PToast extends Vue {
9797
/**
9898
* Do something when user clicks
9999
*/
100-
@Prop({
101-
type: Function, default: () => {
102-
}
103-
}) public onClick!: any;
100+
@Prop({ type: Function, default: ({})}) public onClick!: any;
104101
105102
/**
106103
* Do something after toast gets dismissed
107104
*/
108-
@Prop({
109-
type: Function, default: () => {
110-
}
111-
}) public onDismiss!: any;
105+
@Prop({type: Function, default: ({})}) public onDismiss!: any;
112106
113107
public isActive = false;
114108
public parentTop: any = null;
@@ -125,8 +119,8 @@ export default class PToast extends Vue {
125119
eventBus.on('toast-clear', this.dismiss);
126120
}
127121
128-
beforeDestroy() {
129-
eventBus.off('toast-clear', this.dismiss)
122+
public beforeDestroy() {
123+
eventBus.off('toast-clear', this.dismiss);
130124
}
131125
132126
public setupContainer() {
@@ -156,7 +150,7 @@ export default class PToast extends Vue {
156150
if (this.shouldQueue()) {
157151
// Call recursively if should queue
158152
this.queueTimer = setTimeout(this.showNotice, 250);
159-
return
153+
return;
160154
}
161155
this.correctParent.insertAdjacentElement('afterbegin', this.$el);
162156
this.isActive = true;
@@ -167,34 +161,34 @@ export default class PToast extends Vue {
167161
}
168162
169163
public shouldQueue() {
170-
if (!this.queue) return false;
164+
if (!this.queue) { return false; }
171165
172166
return (
173167
this.parentTop.childElementCount > 0 ||
174168
this.parentBottom.childElementCount > 0
175-
)
169+
);
176170
}
177171
178172
public dismiss() {
179-
if (this.timer) this.timer.stop();
173+
if (this.timer) { this.timer.stop(); }
180174
clearTimeout(this.queueTimer);
181175
this.isActive = false;
182176
183177
// Timeout for the animation complete before destroying
184178
setTimeout(() => {
185179
this.onDismiss.apply(null, arguments);
186180
this.$destroy();
187-
removeElement(this.$el)
188-
}, 150)
181+
removeElement(this.$el);
182+
}, 150);
189183
}
190184
191185
public toggleTimer(newVal) {
192-
if (!this.pauseOnHover || !this.timer) return;
186+
if (!this.pauseOnHover || !this.timer) { return; }
193187
newVal ? this.timer.pause() : this.timer.resume();
194188
}
195189
196190
public whenClicked() {
197-
if (!this.dismissible) return;
191+
if (!this.dismissible) { return; }
198192
this.onClick.apply(null, arguments);
199193
this.dismiss();
200194
}
@@ -222,15 +216,15 @@ export default class PToast extends Vue {
222216
case Positions.TOP_LEFT:
223217
return {
224218
enter: 'Polaris-Frame-Toast-Fade-In-Down',
225-
leave: 'Polaris-Frame-Toast-Fade-Out'
219+
leave: 'Polaris-Frame-Toast-Fade-Out',
226220
};
227221
228222
case Positions.BOTTOM:
229223
case Positions.BOTTOM_RIGHT:
230224
case Positions.BOTTOM_LEFT:
231225
return {
232226
enter: 'Polaris-Frame-Toast-Fade-In-Up',
233-
leave: 'Polaris-Frame-Toast-Fade-Out'
227+
leave: 'Polaris-Frame-Toast-Fade-Out',
234228
};
235229
}
236230
}

src/components/PTooltip/components/PTooltipOverlay.vue

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/components/PTooltip/components/geometry.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)