@finqu/cool 1.2.29 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +680 -1
  2. package/dist/css/cool.css +23575 -16644
  3. package/dist/css/cool.css.map +1 -154
  4. package/dist/css/cool.min.css +89 -3
  5. package/dist/css/cool.min.css.map +1 -1
  6. package/dist/js/cool.bundle.js +15402 -3800
  7. package/dist/js/cool.bundle.js.map +1 -1
  8. package/dist/js/cool.bundle.min.js +20 -8
  9. package/dist/js/cool.bundle.min.js.map +1 -1
  10. package/dist/js/cool.esm.js +4269 -3360
  11. package/dist/js/cool.esm.js.map +1 -1
  12. package/dist/js/cool.esm.min.js +9 -8
  13. package/dist/js/cool.esm.min.js.map +1 -1
  14. package/dist/js/cool.js +4271 -3362
  15. package/dist/js/cool.js.map +1 -1
  16. package/dist/js/cool.min.js +9 -8
  17. package/dist/js/cool.min.js.map +1 -1
  18. package/package.json +94 -61
  19. package/.babelrc.js +0 -20
  20. package/.browserslistrc +0 -13
  21. package/build/.eslintrc.json +0 -10
  22. package/build/banner.js +0 -14
  23. package/build/build-plugins.js +0 -92
  24. package/build/rollup.config.js +0 -46
  25. package/dist/css/cool-grid.css +0 -4390
  26. package/dist/css/cool-grid.css.map +0 -30
  27. package/dist/css/cool-grid.min.css +0 -7
  28. package/dist/css/cool-grid.min.css.map +0 -1
  29. package/dist/css/cool-reboot.css +0 -286
  30. package/dist/css/cool-reboot.css.map +0 -62
  31. package/dist/css/cool-reboot.min.css +0 -7
  32. package/dist/css/cool-reboot.min.css.map +0 -1
  33. package/html/index.html +0 -2703
  34. package/js/dist/collapse.js +0 -5535
  35. package/js/dist/collapse.js.map +0 -1
  36. package/js/dist/common.js +0 -21996
  37. package/js/dist/common.js.map +0 -1
  38. package/js/dist/cooldropdown.js +0 -467
  39. package/js/dist/cooldropdown.js.map +0 -1
  40. package/js/dist/coolpopover.js +0 -391
  41. package/js/dist/coolpopover.js.map +0 -1
  42. package/js/dist/coolsectiontabs.js +0 -256
  43. package/js/dist/coolsectiontabs.js.map +0 -1
  44. package/js/dist/coolselect.js +0 -796
  45. package/js/dist/coolselect.js.map +0 -1
  46. package/js/dist/cooltooltip.js +0 -360
  47. package/js/dist/cooltooltip.js.map +0 -1
  48. package/js/dist/coolui.js +0 -73
  49. package/js/dist/coolui.js.map +0 -1
  50. package/js/dist/dropdown.js +0 -27421
  51. package/js/dist/dropdown.js.map +0 -1
  52. package/js/dist/popover.js +0 -9472
  53. package/js/dist/popover.js.map +0 -1
  54. package/js/dist/sectiontabs.js +0 -4483
  55. package/js/dist/sectiontabs.js.map +0 -1
  56. package/js/dist/select.js +0 -37080
  57. package/js/dist/select.js.map +0 -1
  58. package/js/dist/tooltip.js +0 -8786
  59. package/js/dist/tooltip.js.map +0 -1
  60. package/js/index.esm.js +0 -21
  61. package/js/index.umd.js +0 -21
  62. package/js/src/abstract-ui-component.js +0 -81
  63. package/js/src/collapse.js +0 -286
  64. package/js/src/common.js +0 -296
  65. package/js/src/dialog.js +0 -579
  66. package/js/src/dropdown.js +0 -525
  67. package/js/src/popover.js +0 -632
  68. package/js/src/section-tabs.js +0 -215
  69. package/js/src/select.js +0 -1342
  70. package/js/src/toast.js +0 -581
  71. package/js/src/tooltip.js +0 -591
  72. package/js/src/util/animate-css.js +0 -22
  73. package/js/src/util/index.js +0 -122
  74. package/js/src/util/perfect-scrollbar.js +0 -1316
  75. package/less/alert.less +0 -345
  76. package/less/badge.less +0 -38
  77. package/less/bootstrap-noconflict.less +0 -23
  78. package/less/bootstrap.less +0 -23
  79. package/less/button-group.less +0 -153
  80. package/less/buttons.less +0 -287
  81. package/less/dialog-noconflict.less +0 -174
  82. package/less/dialog.less +0 -203
  83. package/less/dropdown.less +0 -209
  84. package/less/forms.less +0 -770
  85. package/less/images.less +0 -242
  86. package/less/input-group.less +0 -163
  87. package/less/list-group.less +0 -73
  88. package/less/mixins/aspect-ratio.less +0 -23
  89. package/less/mixins/border-radius.less +0 -24
  90. package/less/mixins/box-shadow.less +0 -4
  91. package/less/mixins/buttons.less +0 -17
  92. package/less/mixins/caret.less +0 -51
  93. package/less/mixins/clearfix.less +0 -10
  94. package/less/mixins/gradients.less +0 -34
  95. package/less/mixins/nav-divider.less +0 -7
  96. package/less/mixins/object-fit.less +0 -13
  97. package/less/mixins/reset-text.less +0 -16
  98. package/less/mixins.less +0 -11
  99. package/less/package.json +0 -11
  100. package/less/pagination.less +0 -69
  101. package/less/popover.less +0 -143
  102. package/less/project.sublime-workspace +0 -774
  103. package/less/reboot.less +0 -235
  104. package/less/section.less +0 -793
  105. package/less/select.less +0 -150
  106. package/less/tables.less +0 -737
  107. package/less/tabs.less +0 -162
  108. package/less/tooltip.less +0 -87
  109. package/less/type.less +0 -71
  110. package/less/utilities/align.less +0 -27
  111. package/less/utilities/animate.less +0 -3512
  112. package/less/utilities/background.less +0 -70
  113. package/less/utilities/borders.less +0 -16
  114. package/less/utilities/color.less +0 -70
  115. package/less/utilities/cursor.less +0 -8
  116. package/less/utilities/display.less +0 -38
  117. package/less/utilities/embed.less +0 -61
  118. package/less/utilities/flex.less +0 -76
  119. package/less/utilities/jquery-ui.less +0 -116
  120. package/less/utilities/lazyload.less +0 -29
  121. package/less/utilities/overflow.less +0 -11
  122. package/less/utilities/pace.less +0 -25
  123. package/less/utilities/placeholder.less +0 -60
  124. package/less/utilities/position.less +0 -42
  125. package/less/utilities/scrollbar.less +0 -152
  126. package/less/utilities/spacing.less +0 -197
  127. package/less/utilities/text.less +0 -68
  128. package/less/utilities/transform.less +0 -7
  129. package/less/utilities.less +0 -21
  130. package/less/variables.less +0 -343
  131. package/scss/LISENCE +0 -15
  132. package/scss/_alert.scss +0 -102
  133. package/scss/_badge.scss +0 -102
  134. package/scss/_button-group.scss +0 -129
  135. package/scss/_buttons.scss +0 -248
  136. package/scss/_custom-forms.scss +0 -444
  137. package/scss/_dialog.scss +0 -160
  138. package/scss/_dropdown.scss +0 -233
  139. package/scss/_forms.scss +0 -258
  140. package/scss/_frame.scss +0 -627
  141. package/scss/_functions.scss +0 -124
  142. package/scss/_grid.scss +0 -35
  143. package/scss/_images.scss +0 -361
  144. package/scss/_input-group.scss +0 -285
  145. package/scss/_list-group.scss +0 -82
  146. package/scss/_mixins.scss +0 -34
  147. package/scss/_navbar.scss +0 -290
  148. package/scss/_notification.scss +0 -13
  149. package/scss/_pagination.scss +0 -88
  150. package/scss/_popover.scss +0 -167
  151. package/scss/_reboot.scss +0 -284
  152. package/scss/_root.scss +0 -15
  153. package/scss/_section.scss +0 -977
  154. package/scss/_select.scss +0 -187
  155. package/scss/_tables.scss +0 -735
  156. package/scss/_tabs.scss +0 -178
  157. package/scss/_toast.scss +0 -182
  158. package/scss/_tooltip.scss +0 -101
  159. package/scss/_type.scss +0 -129
  160. package/scss/_utilities.scss +0 -23
  161. package/scss/_variables.scss +0 -823
  162. package/scss/cool-grid.scss +0 -29
  163. package/scss/cool-reboot.scss +0 -11
  164. package/scss/cool.scss +0 -37
  165. package/scss/mixins/_alert-variant.scss +0 -20
  166. package/scss/mixins/_aspect-ratio.scss +0 -29
  167. package/scss/mixins/_background-variant.scss +0 -25
  168. package/scss/mixins/_badge-variant.scss +0 -36
  169. package/scss/mixins/_breakpoints.scss +0 -102
  170. package/scss/mixins/_buttons.scss +0 -104
  171. package/scss/mixins/_caret.scss +0 -80
  172. package/scss/mixins/_clearfix.scss +0 -10
  173. package/scss/mixins/_float.scss +0 -14
  174. package/scss/mixins/_forms.scss +0 -67
  175. package/scss/mixins/_gradients.scss +0 -40
  176. package/scss/mixins/_grid-framework.scss +0 -72
  177. package/scss/mixins/_grid.scss +0 -60
  178. package/scss/mixins/_nav-divider.scss +0 -9
  179. package/scss/mixins/_notification-variant.scss +0 -7
  180. package/scss/mixins/_object-fit.scss +0 -16
  181. package/scss/mixins/_reset-text.scss +0 -19
  182. package/scss/mixins/_text-emphasis.scss +0 -21
  183. package/scss/mixins/_text-hide.scss +0 -10
  184. package/scss/mixins/_text-truncate.scss +0 -81
  185. package/scss/mixins/_visibility.scss +0 -7
  186. package/scss/project.sublime-workspace +0 -491
  187. package/scss/utilities/_align.scss +0 -41
  188. package/scss/utilities/_animate.scss +0 -3512
  189. package/scss/utilities/_background.scss +0 -14
  190. package/scss/utilities/_borders.scss +0 -146
  191. package/scss/utilities/_clearfix.scss +0 -6
  192. package/scss/utilities/_collapse.scss +0 -33
  193. package/scss/utilities/_cursor.scss +0 -22
  194. package/scss/utilities/_display.scss +0 -16
  195. package/scss/utilities/_embed.scss +0 -78
  196. package/scss/utilities/_flex.scss +0 -52
  197. package/scss/utilities/_lazyload.scss +0 -31
  198. package/scss/utilities/_overflow.scss +0 -6
  199. package/scss/utilities/_perfect-scrollbar.scss +0 -141
  200. package/scss/utilities/_placeholder.scss +0 -77
  201. package/scss/utilities/_position.scss +0 -30
  202. package/scss/utilities/_sizing.scss +0 -32
  203. package/scss/utilities/_spacing.scss +0 -92
  204. package/scss/utilities/_text.scss +0 -99
  205. package/scss/utilities/_user-select.scss +0 -14
  206. package/scss/utilities/_visibility.scss +0 -10
package/js/src/toast.js DELETED
@@ -1,581 +0,0 @@
1
- import 'jquery';
2
- import { debounce } from './util/index';
3
- import AbstractUIComponent from './abstract-ui-component';
4
-
5
- const NAME = 'coolToast';
6
- const DATA_KEY = 'plugin_coolToast';
7
-
8
- class Toast {
9
-
10
- constructor(container, opts) {
11
-
12
- this.settings = {};
13
-
14
- if (window.Cool.settings.toast) {
15
-
16
- $.extend(true, this.settings, $.fn[NAME].defaults, window.Cool.settings.toast, opts);
17
-
18
- } else {
19
-
20
- $.extend(true, this.settings, $.fn[NAME].defaults, opts);
21
- }
22
-
23
- this.container = container;
24
- this.$container = $(this.container);
25
- this.debug = this.settings.debug;
26
- this.faPro = this.settings.faPro;
27
- this.toasts = [];
28
- this.queue = [];
29
- this.processingQueue = false;
30
- this.onInitialize = this.settings.onInitialize;
31
- this.onDestroy = this.settings.onDestroy;
32
- }
33
-
34
- // Add item to queue
35
- addQueue(toast) {
36
-
37
- this.queue.push(toast);
38
-
39
- if (this.processingQueue) {
40
- return;
41
- }
42
-
43
- return this.processQueue();
44
- }
45
-
46
- // Process queue
47
- processQueue() {
48
-
49
- if (this.processingQueue) {
50
-
51
- this.queue.shift();
52
- }
53
-
54
- if (!this.queue.length) {
55
-
56
- this.processingQueue = false;
57
- return;
58
- }
59
-
60
- this.processingQueue = true;
61
-
62
- return this.show(this.queue[0]);
63
- }
64
-
65
- // Init toast
66
- init(opts) {
67
-
68
- let settings = {};
69
-
70
- $.extend(true, settings, this.settings, opts);
71
-
72
- let toast = this.buildToast(settings);
73
-
74
- this.addQueue(toast);
75
- this.onInit(toast);
76
-
77
- return toast;
78
- }
79
-
80
- // Remove plugin instance completely
81
- destroy() {
82
-
83
- this.$container.removeData(DATA_KEY);
84
- this.onDestroy();
85
- }
86
-
87
- // Build toast
88
- buildToast(settings) {
89
-
90
- let toast = {
91
- uuid: 'toast-'+this.generateUUID(),
92
- placement: settings.placement,
93
- placementX: settings.placementX,
94
- placementY: settings.placementY,
95
- offset: settings.offset,
96
- animation: settings.animation,
97
- animationIn: settings.animationIn,
98
- animationOut: settings.animationOut,
99
- animationSpeed: settings.animationSpeed,
100
- dismiss: settings.dismiss,
101
- size: settings.size,
102
- header: settings.header,
103
- theme: settings.theme,
104
- title: settings.title,
105
- content: settings.content,
106
- template: settings.template,
107
- maxBodyHeight: settings.maxBodyHeight,
108
- onInit: settings.onInit,
109
- onShow: settings.onShow,
110
- onClose: settings.onClose
111
- };
112
-
113
- if (typeof toast.content === 'function') {
114
-
115
- toast.$el = $(toast.template());
116
-
117
- } else {
118
-
119
- toast.$el = $(this._renderTemplate(toast));
120
- }
121
-
122
- toast.$inner = toast.$el.find('.toast-inner');
123
- toast.$closeBtn = toast.$el.find('[data-toast-close]');
124
-
125
- this.log(toast);
126
- this.toasts.push(toast);
127
-
128
- return toast;
129
- }
130
-
131
- // Bind events that trigger methods
132
- bindEvents(toast) {
133
-
134
- let self = this;
135
-
136
- toast.$el.on('click', '[data-toast-close]', () => {
137
-
138
- if (toast.$el) {
139
- self.close(toast);
140
- }
141
- });
142
-
143
- $(window).on('resize', debounce(() => {
144
-
145
- if (toast.$el) {
146
- this.setPosition(toast);
147
- }
148
- }, 250));
149
- }
150
-
151
- // Generate UUID
152
- generateUUID() {
153
-
154
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
155
- let r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
156
- return v.toString(16);
157
- });
158
- }
159
-
160
- // Set positions
161
- setPosition(toast, placement, placementY, placementX) {
162
-
163
- if (typeof placementY === 'undefined' || placementY === null) {
164
- placementY = toast.placementY;
165
- }
166
-
167
- if (typeof placementX === 'undefined' || placementX === null) {
168
- placementX = toast.placementX;
169
- }
170
-
171
- if (!placementX || !placementY) {
172
- placement = toast.placement
173
- }
174
-
175
- if (toast.offset) {
176
-
177
- let offsets = toast.offset.split(',')
178
- let offsetX = parseInt(offsets[0], 10);
179
- let offsetY = parseInt(offsets[1], 10);
180
- }
181
-
182
- let toastWidth = toast.$el.outerWidth(true);
183
- let toastHeight = toast.$el.outerHeight(true);
184
- let toastPosX;
185
- let toastPosY;
186
-
187
- if (placement) {
188
-
189
- if (placement === 'top-left') {
190
-
191
- toastPosX = 0;
192
- toastPosY = 0;
193
-
194
- if (toast.offset) {
195
- toastPosX += offsetX;
196
- toastPosY += offsetY;
197
- } else {
198
- toastPosX += 30;
199
- toastPosY += 30;
200
- }
201
-
202
- } else if (placement === 'top-center') {
203
-
204
- toastPosX = (this.$container.width() / 2) - toastWidth / 2;
205
- toastPosY = 0;
206
-
207
- this.log(this.$container.width);
208
-
209
- if (toast.offset) {
210
- toastPosX += offsetX;
211
- toastPosY += offsetY;
212
- } else {
213
- toastPosY += 30;
214
- }
215
-
216
- } else if (placement === 'top-right') {
217
-
218
- toastPosX = this.$container.width() - toastWidth;
219
- toastPosY = 0;
220
-
221
- if (toast.offset) {
222
- toastPosX += -offsetX;
223
- toastPosY += offsetY;
224
- } else {
225
- toastPosX += -30;
226
- toastPosY += 30;
227
- }
228
-
229
- } else if (placement === 'center-left') {
230
-
231
- toastPosX = 0;
232
- toastPosY = (this.$container.height() / 2) - toastHeight / 2;
233
-
234
- if (toast.offset) {
235
- toastPosX += offsetX;
236
- toastPosY += offsetY;
237
- } else {
238
- toastPosX += 30;
239
- }
240
-
241
- } else if (placement === 'center-center') {
242
-
243
- toastPosX = (this.$container.width() / 2) - toastWidth / 2;
244
- toastPosY = (this.$container.height() / 2) - toastHeight / 2;
245
-
246
- if (toast.offset) {
247
- toastPosX += offsetX;
248
- toastPosY += offsetY;
249
- }
250
-
251
- } else if (placement === 'center-right') {
252
-
253
- toastPosX = this.$container.width() - toastWidth;
254
- toastPosY = (this.$container.height() / 2) - toastHeight / 2;
255
-
256
- if (toast.offset) {
257
- toastPosX += -offsetX;
258
- toastPosY += offsetY;
259
- } else {
260
- toastPosX += -30;
261
- }
262
-
263
- } else if (placement === 'bottom-left') {
264
-
265
- toastPosX = 0;
266
- toastPosY = this.$container.height() - toastHeight;
267
-
268
- if (toast.offset) {
269
- toastPosX += offsetX;
270
- toastPosY += -offsetY;
271
- } else {
272
- toastPosX += 30;
273
- toastPosY += -30;
274
- }
275
-
276
- } else if (placement === 'bottom-center') {
277
-
278
- toastPosX = (this.$container.width() / 2) - toastWidth / 2;
279
- toastPosY = this.$container.height() - toastHeight;
280
-
281
- if (toast.offset) {
282
- toastPosX += offsetX;
283
- toastPosY += -offsetY;
284
- } else {
285
- toastPosY += -30;
286
- }
287
-
288
- } else if (placement === 'bottom-right') {
289
-
290
- toastPosX = this.$container.width() - toastWidth
291
- toastPosY = this.$container.height() - toastHeight;
292
-
293
- if (toast.offset) {
294
- toastPosX += -offsetX;
295
- toastPosY += -offsetY;
296
- } else {
297
- toastPosX += -30;
298
- toastPosY += -30;
299
- }
300
- }
301
-
302
- } else {
303
-
304
- toastPosX = placementX;
305
- toastPosY = placementY;
306
- }
307
-
308
- toast.$el.css({
309
- position: 'absolute',
310
- top: '0px',
311
- left: '0px',
312
- transform: 'translate3d('+toastPosX+'px, '+toastPosY+'px, 0px)',
313
- 'will-change': 'transform'
314
- });
315
-
316
- this.log('Toast width: '+toastWidth+'px');
317
- this.log('Toast height: '+toastHeight+'px');
318
- this.log('Toast position Y: '+toastPosX+'px');
319
- this.log('Toast position x: '+toastPosY+'px');
320
- }
321
-
322
- // Show
323
- show(toast) {
324
-
325
- this.$container.append(toast.$el);
326
- this.bindEvents(toast);
327
- this.setPosition(toast);
328
-
329
- if (toast.animation) {
330
-
331
- toast.$el.addClass('show');
332
- toast.$inner.addClass(toast.animationSpeed);
333
- toast.$inner.animateCss(toast.animationIn);
334
-
335
- } else {
336
-
337
- toast.$el.addClass('show');
338
- }
339
-
340
- if (toast.dismiss) {
341
-
342
- setTimeout(() => {
343
- this.close(toast);
344
- }, toast.dismiss * 1000);
345
- }
346
-
347
- this.onShow(toast);
348
- }
349
-
350
- // Close
351
- close(toast) {
352
-
353
- if (toast.animation && !toast.$inner.hasClass('animated')) {
354
-
355
- toast.$el.removeClass('show');
356
- toast.$inner.animateCss(toast.animationOut, () => {
357
-
358
- toast.$el.remove();
359
-
360
- this.toasts = $.grep(this.toasts, function(item) {
361
- return item.uuid != toast.uuid;
362
- });
363
-
364
- this.processQueue();
365
- this.onClose(toast);
366
- });
367
-
368
- } else {
369
-
370
- toast.$el.remove();
371
-
372
- this.toasts = $.grep(this.toasts, function(item) {
373
- return item.uuid != toast.uuid;
374
- });
375
-
376
- this.processQueue();
377
- this.onClose(toast);
378
- }
379
- }
380
-
381
- // Initialize callback
382
- onInitialize() {
383
-
384
- let onInitialize = this.onInitialize;
385
-
386
- if (typeof onInitialize === 'function') {
387
-
388
- onInitialize.call(this.container);
389
- }
390
- }
391
-
392
- // Destroy callback
393
- onDestroy() {
394
-
395
- let onDestroy = this.onDestroy;
396
-
397
- if (typeof onDestroy === 'function') {
398
-
399
- onDestroy.call(this.container);
400
- }
401
- }
402
-
403
- // Init callback
404
- onInit(toast) {
405
-
406
- let onInit = toast.onInit;
407
-
408
- if (typeof onInit === 'function') {
409
-
410
- onInit.call(toast);
411
- }
412
- }
413
-
414
- // Show callback
415
- onShow(toast) {
416
-
417
- let onShow = toast.onShow;
418
-
419
- if (typeof onShow === 'function') {
420
-
421
- onShow.call(toast);
422
- }
423
- }
424
-
425
- // Close callback
426
- onClose(toast) {
427
-
428
- let onClose = toast.onClose;
429
-
430
- if (typeof onClose === 'function') {
431
-
432
- onClose.call(toast);
433
- }
434
- }
435
-
436
- // Debug log
437
- log(...args) {
438
-
439
- if (this.debug) {
440
-
441
- if (typeof this.debug === 'function') {
442
- this.debug(...args);
443
- } else {
444
- console.log(...args);
445
- }
446
- }
447
- }
448
-
449
- // Render template
450
- _renderTemplate(toast) {
451
-
452
- let faNameSpace = this.faPro ? 'far' : 'fas';
453
- let content = '';
454
- let header = '';
455
- let body = '';
456
- let bodyCloseBtn = '';
457
-
458
- if (typeof toast.content === 'function') {
459
-
460
- content = toast.content();
461
-
462
- } else {
463
-
464
- content = toast.content;
465
- }
466
-
467
- if (toast.header) {
468
-
469
- header = `
470
- <div class="toast-header">
471
-
472
- <span>${toast.title}</span>
473
-
474
- <button type="button" data-toast-close>
475
- <i class="${faNameSpace} fa-times icon"></i>
476
- </button>
477
-
478
- </div>
479
- `;
480
-
481
- } else {
482
-
483
- bodyCloseBtn = `
484
- <button type="button" data-toast-close>
485
-
486
- <i class="${faNameSpace} fa-times icon"></i>
487
-
488
- </button>
489
- `;
490
- }
491
-
492
- body = `
493
- <div class="toast-body">
494
-
495
- <span>${content}</span>
496
- ${bodyCloseBtn}
497
-
498
- </div>
499
- `;
500
-
501
- return `
502
- <div class="toast toast-${toast.size} toast-${toast.theme}" role="alert" id="${toast.uuid}">
503
-
504
- <div class="toast-inner">
505
-
506
- ${header}
507
- ${body}
508
-
509
- </div>
510
-
511
- </div>
512
- `;
513
- }
514
-
515
- static _jQueryInterface(config) {
516
-
517
- return this.each(function() {
518
-
519
- let data = $(this).data(DATA_KEY);
520
- const _config = typeof config === 'object' && config;
521
-
522
- if (!data) {
523
- data = new Toast(this, _config);
524
- $(this).data(DATA_KEY, data);
525
- }
526
-
527
- if (typeof config === 'string') {
528
-
529
- if (typeof data[config] === 'undefined') {
530
- throw new TypeError(`No method named "${config}"`)
531
- }
532
-
533
- data[config]()
534
- }
535
- });
536
- }
537
- }
538
-
539
- if (typeof $ !== 'undefined') {
540
-
541
- // jQuery
542
- const JQUERY_NO_CONFLICT = $.fn[NAME];
543
-
544
- $.fn[NAME] = Toast._jQueryInterface;
545
- $.fn[NAME].Constructor = Toast;
546
-
547
- $.fn[NAME].noConflict = () => {
548
-
549
- $.fn[NAME] = JQUERY_NO_CONFLICT;
550
-
551
- return Toast._jQueryInterface;
552
- }
553
-
554
- $.fn[NAME].defaults = {
555
- title: '',
556
- content: '',
557
- template: '',
558
- theme: 'dark',
559
- placement: 'bottom-center',
560
- placementX: null,
561
- placementY: null,
562
- animation: true,
563
- animationIn: 'slideInUp',
564
- animationOut: 'slideOutDown',
565
- animationSpeed: 'faster',
566
- offset: null,
567
- size: null,
568
- dismiss: 3,
569
- header: false,
570
- faPro: false,
571
- debug: false,
572
- onInitialize: null,
573
- onDestroy: null,
574
- onInit: null,
575
- onDestroy: null,
576
- onShow: null,
577
- onClose: null
578
- }
579
- }
580
-
581
- export default Toast;