@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/dialog.js DELETED
@@ -1,579 +0,0 @@
1
- import 'jquery';
2
- import { debounce, touchEvents } from './util/index';
3
-
4
- const NAME = 'coolDialog';
5
- const DATA_KEY = 'plugin_coolDialog';
6
-
7
- class Dialog {
8
-
9
- constructor(container, opts) {
10
-
11
- this.settings = {};
12
-
13
- if (window.Cool.settings.dialog) {
14
-
15
- $.extend(true, this.settings, $.fn[NAME].defaults, window.Cool.settings.dialog, opts);
16
-
17
- } else {
18
-
19
- $.extend(true, this.settings, $.fn[NAME].defaults, opts);
20
- }
21
-
22
- this.container = container;
23
- this.$container = $(this.container);
24
- this.debug = this.settings.debug;
25
- this.faPro = this.settings.faPro;
26
- this.dialogs = [];
27
- this.onInitialize = this.settings.onInitialize;
28
- this.onDestroy = this.settings.onDestroy;
29
- }
30
-
31
- // Init dialog
32
- init(opts) {
33
-
34
- let settings = {};
35
-
36
- $.extend(true, settings, this.settings, opts);
37
-
38
- let dialog = this.buildDialog(settings);
39
-
40
- this.show(dialog);
41
- this.bindEvents(dialog);
42
- this.onInit(dialog);
43
-
44
- return dialog;
45
- }
46
-
47
- // Remove plugin instance completely
48
- destroy() {
49
-
50
- this.$container.removeData(DATA_KEY);
51
- this.onDestroy();
52
- }
53
-
54
- // Build dialog
55
- buildDialog(settings) {
56
-
57
- let self = this;
58
- let dialog = {
59
- uuid: 'dialog-'+this.generateUUID(),
60
- title: settings.title,
61
- template: settings.template,
62
- body: settings.body,
63
- footer: settings.footer,
64
- size: settings.size,
65
- classes: settings.classes,
66
- centered: settings.centered,
67
- backdrop: settings.backdrop,
68
- preventScroll: settings.preventScroll,
69
- closeBtn: settings.closeBtn,
70
- animation: settings.animation,
71
- animationIn: settings.animationIn,
72
- animationOut: settings.animationOut,
73
- animationSpeed: settings.animationSpeed,
74
- callbacks: settings.callbacks,
75
- maxBodyHeight: settings.maxBodyHeight,
76
- overflowVisible: settings.overflowVisible,
77
- actions: settings.actions,
78
- onInit: settings.onInit,
79
- onShow: settings.onShow,
80
- onClose: settings.onClose
81
- };
82
-
83
- if (dialog.maxBodyHeight == null) {
84
-
85
- dialog.maxBodyHeight = window.innerHeight - 200;
86
- }
87
-
88
- if (typeof dialog.template === 'function') {
89
-
90
- dialog.$el = $(dialog.template());
91
-
92
- } else {
93
-
94
- dialog.$el = $(this._renderTemplate(dialog));
95
- }
96
-
97
- dialog.show = function() {
98
- self.show(dialog);
99
- };
100
-
101
- dialog.close = function() {
102
- self.close(dialog);
103
- };
104
-
105
- this.log(dialog);
106
- this.dialogs.push(dialog);
107
-
108
- return dialog;
109
- }
110
-
111
- // Bind events that trigger methods
112
- bindEvents(dialog) {
113
-
114
- let self = this;
115
-
116
- dialog.$el.on('click', '[data-dialog-close]', function (e) {
117
-
118
- dialog.$el.trigger('dialog.close');
119
-
120
- if (typeof dialog.callbacks.close === 'function') {
121
-
122
- dialog.callbacks.close.call(self, function () {
123
- self.close(dialog)
124
- }, dialog);
125
-
126
- } else {
127
-
128
- self.close(dialog);
129
- }
130
- });
131
-
132
- dialog.$el.on('click', '[data-dialog-remove]', function (e) {
133
-
134
- dialog.$el.trigger('dialog.remove');
135
-
136
- if (typeof dialog.callbacks.remove === 'function') {
137
-
138
- dialog.callbacks.remove.call(self, function () {
139
- self.close(dialog)
140
- }, dialog);
141
- }
142
- });
143
-
144
- dialog.$el.on('click', '[data-dialog-confirm]', debounce(function (e) {
145
-
146
- dialog.$el.trigger('dialog.close');
147
-
148
- if (typeof dialog.callbacks.confirm === 'function') {
149
-
150
- dialog.callbacks.confirm.call(self, function () {
151
- self.close(dialog)
152
- }, dialog);
153
-
154
- } else {
155
-
156
- self.close(dialog);
157
- }
158
- }));
159
- }
160
-
161
- // Generate UUID
162
- generateUUID() {
163
-
164
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
165
- let r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
166
- return v.toString(16);
167
- });
168
- }
169
-
170
- // Show
171
- show(dialog) {
172
-
173
- if (!this.$container.hasClass('has-dialogs')) {
174
- this.$container.addClass('has-dialogs');
175
- }
176
-
177
- if (dialog.preventScroll && !this.$container.hasClass('dialog-prevent-scroll')) {
178
- this.$container.addClass('dialog-prevent-scroll');
179
- }
180
-
181
- if (this.dialogs.length > 1) {
182
-
183
- let $prevDialog = $(this.dialogs).eq(-2)[0].$el;
184
- let zIndex = parseInt($prevDialog.css('z-index'), 10) + 1;
185
-
186
- dialog.$el.css('z-index', zIndex);
187
-
188
- $prevDialog.css({
189
- 'transition': 'opacity 0.3s',
190
- 'opacity': 0,
191
- 'visibility': 'visible'
192
- });
193
- }
194
-
195
- if (dialog.backdrop && $('.dialog-backdrop').length < 1) {
196
-
197
- this.$container.append('<div class="dialog-backdrop"></div>');
198
-
199
- let checkForBackdrop = setInterval(() => {
200
-
201
- if (this.dialogs.length == 0 && $('.dialog-backdrop').length) {
202
-
203
- $('.dialog-backdrop').remove();
204
- clearInterval(checkForBackdrop);
205
- }
206
-
207
- }, 100);
208
- }
209
-
210
- this.$container.append(dialog.$el);
211
-
212
- if (dialog.animation) {
213
- dialog.$el.find('.dialog-content').addClass(dialog.animationSpeed).animateCss(dialog.animationIn);
214
- }
215
-
216
- this.onShow(dialog);
217
- }
218
-
219
- // Close
220
- close(dialog) {
221
-
222
- let $prevDialog = null;
223
-
224
- if (this.dialogs.length > 1) {
225
- $prevDialog = $(this.dialogs).eq(-2)[0].$el;
226
- }
227
-
228
- if ($('.dialog[data-dialog-backdrop="true"]').length === 0 && $('.dialog-backdrop').length) {
229
- $('.dialog-backdrop').remove();
230
- }
231
-
232
- if (dialog.animation) {
233
-
234
- dialog.$el.find('.dialog-content').animateCss(dialog.animationOut, () => {
235
-
236
- dialog.$el.remove();
237
-
238
- this.dialogs = $.grep(this.dialogs, function(item) {
239
- return item.uuid != dialog.uuid;
240
- });
241
-
242
- if (this.dialogs.length == 0) {
243
-
244
- this.$container.removeClass('has-dialogs');
245
-
246
- if (this.$container.hasClass('dialog-prevent-scroll')) {
247
- this.$container.removeClass('dialog-prevent-scroll');
248
- }
249
-
250
- } else {
251
-
252
- if ($prevDialog) {
253
- $prevDialog.css('opacity', 1);
254
- }
255
- }
256
- });
257
-
258
- } else {
259
-
260
- dialog.$el.remove();
261
-
262
- this.dialogs = $.grep(this.dialogs, function(item) {
263
- return item.uuid != dialog.uuid;
264
- });
265
-
266
- if (this.dialogs.length == 0) {
267
-
268
- this.$container.removeClass('has-dialogs');
269
-
270
- if (this.$container.hasClass('dialog-prevent-scroll')) {
271
- this.$container.removeClass('dialog-prevent-scroll');
272
- }
273
-
274
- } else {
275
-
276
- if ($prevDialog) {
277
- $prevDialog.css('opacity', 1);
278
- }
279
- }
280
- }
281
-
282
- this.onClose(dialog);
283
- }
284
-
285
- // Initialize callback
286
- onInitialize() {
287
-
288
- let onInitialize = this.onInitialize;
289
-
290
- if (typeof onInitialize === 'function') {
291
-
292
- onInitialize.call(this.container);
293
- }
294
- }
295
-
296
- // Destroy callback
297
- onDestroy() {
298
-
299
- let onDestroy = this.onDestroy;
300
-
301
- if (typeof onDestroy === 'function') {
302
-
303
- onDestroy.call(this.container);
304
- }
305
- }
306
-
307
- // Init callback
308
- onInit(dialog) {
309
-
310
- let onInit = dialog.onInit;
311
-
312
- if (typeof onInit === 'function') {
313
-
314
- onInit.call(dialog);
315
- }
316
- }
317
-
318
- // Show callback
319
- onShow(dialog) {
320
-
321
- let onShow = dialog.onShow;
322
-
323
- if (typeof onShow === 'function') {
324
-
325
- onShow.call(dialog);
326
- }
327
- }
328
-
329
- // Close callback
330
- onClose(dialog) {
331
-
332
- let onClose = dialog.onClose;
333
-
334
- if (typeof onClose === 'function') {
335
-
336
- onClose.call(dialog);
337
- }
338
- }
339
-
340
- // Debug log
341
- log(...args) {
342
-
343
- if (this.debug) {
344
-
345
- if (typeof this.debug === 'function') {
346
- this.debug(...args);
347
- } else {
348
- console.log(...args);
349
- }
350
- }
351
- }
352
-
353
- // Render footer
354
- _renderFooter(dialog) {
355
-
356
- let footer = '';
357
-
358
- if (typeof dialog.footer === 'function') {
359
-
360
- footer = dialog.footer();
361
-
362
- } else if (dialog.footer !== '' && dialog.footer !== false && dialog.footer !== true) {
363
-
364
- footer = dialog.footer;
365
-
366
- } else if (dialog.footer === true) {
367
-
368
- let btnCancel = '';
369
- let btnRemove = '';
370
- let btnConfirm = '';
371
- let btnStyle = '';
372
- let btnClasses = '';
373
- let btnAttrs = '';
374
-
375
- if (dialog.actions.close.visible) {
376
-
377
- btnStyle = dialog.actions.close.primary ? 'btn-primary' : 'btn-secondary';
378
- btnClasses = dialog.actions.close.classes ? ' '+dialog.actions.close.classes : '';
379
- btnAttrs = dialog.actions.close.attrs ? ' '+dialog.actions.close.attrs : '';
380
- btnCancel = `
381
- <button type="button" class="btn ${btnStyle}${btnClasses}"${btnAttrs} data-dialog-close>
382
- ${dialog.actions.close.content}
383
- </button>
384
- `;
385
- }
386
-
387
- if (dialog.actions.remove.visible) {
388
-
389
- btnStyle = 'btn-remove';
390
- btnClasses = dialog.actions.remove.classes ? ' '+dialog.actions.remove.classes : '';
391
- btnAttrs = dialog.actions.remove.attrs ? ' '+dialog.actions.remove.attrs : '';
392
- btnRemove = `
393
- <button type="button" class="btn ${btnStyle}${btnClasses}"${btnAttrs} data-dialog-remove>
394
- ${dialog.actions.remove.content}
395
- </button>
396
- `;
397
- }
398
-
399
- if (dialog.actions.confirm.visible) {
400
-
401
- btnStyle = dialog.actions.confirm.primary ? 'btn-primary' : 'btn-secondary';
402
- btnClasses = dialog.actions.confirm.classes ? ' '+dialog.actions.confirm.classes : '';
403
- btnAttrs = dialog.actions.confirm.attrs ? ' '+dialog.actions.confirm.attrs : '';
404
- btnConfirm = `
405
- <button type="button" class="btn ${btnStyle}${btnClasses}"${btnAttrs} data-dialog-confirm>
406
- ${dialog.actions.confirm.content}
407
- </button>
408
- `;
409
- }
410
-
411
- footer = `
412
- ${btnRemove}
413
- <div class="spacer"></div>
414
- ${btnCancel}
415
- ${btnConfirm}
416
- `;
417
-
418
- } else {
419
-
420
- return footer;
421
- }
422
-
423
- if (footer) {
424
-
425
- return `
426
- <div class="dialog-footer">
427
- ${footer}
428
- </div>
429
- `;
430
- }
431
- }
432
-
433
- // Render template
434
- _renderTemplate(dialog) {
435
-
436
- let faNameSpace = this.faPro ? 'far' : 'fas';
437
- let classes = dialog.classes ? ' '+dialog.classes : '';
438
- let centered = dialog.centered ? ' dialog-centered' : '';
439
- let size = dialog.size ? ' dialog-'+dialog.size : '';
440
- let overFlowVisible = dialog.overflowVisible ? ' dialog-overflow-visible' : '';
441
- let uuid = ' data-dialog-uuid="'+dialog.uuid+'"';
442
- let backdrop = dialog.backdrop ? ' data-dialog-backdrop="true"' : ' data-dialog-backdrop="false"';
443
- let title = dialog.title;
444
- let closeBtn = dialog.closeBtn ? `<button type="button" data-dialog-close><i class="${faNameSpace} fa-times icon"></i></button>` : '';
445
- let maxBodyHeight = dialog.maxBodyHeight ? ' style="max-height: '+dialog.maxBodyHeight+'px"' : '';
446
- let body = '';
447
- let footer = this._renderFooter(dialog);
448
-
449
- if (typeof dialog.body === 'function') {
450
-
451
- body = dialog.body();
452
-
453
- } else {
454
-
455
- body = dialog.body;
456
- }
457
-
458
- return `
459
- <div class="dialog${classes}${centered}${size}${overFlowVisible}"${uuid}${backdrop}>
460
-
461
- <div class="dialog-container">
462
-
463
- <div class="dialog-content">
464
-
465
- <div class="dialog-header">
466
-
467
- <span class="dialog-title">
468
- ${title}
469
- </span>
470
-
471
- ${closeBtn}
472
-
473
- </div>
474
-
475
- <div class="dialog-body"${maxBodyHeight}>
476
-
477
- ${body}
478
-
479
- </div>
480
-
481
- ${footer}
482
-
483
- </div>
484
-
485
- </div>
486
-
487
- </div>
488
- `;
489
- }
490
-
491
- static _jQueryInterface(config) {
492
-
493
- let data = $(this).data(DATA_KEY);
494
- const _config = typeof config === 'object' && config;
495
-
496
- if (!data) {
497
- data = new Dialog(this, _config);
498
- $(this).data(DATA_KEY, data);
499
- }
500
-
501
- if (typeof config === 'string') {
502
-
503
- if (typeof data[config] === 'undefined') {
504
- throw new TypeError(`No method named "${config}"`)
505
- }
506
-
507
- data[config]()
508
- }
509
- }
510
- }
511
-
512
- if (typeof $ !== 'undefined') {
513
-
514
- // jQuery
515
- const JQUERY_NO_CONFLICT = $.fn[NAME];
516
-
517
- $.fn[NAME] = Dialog._jQueryInterface;
518
- $.fn[NAME].Constructor = Dialog;
519
-
520
- $.fn[NAME].noConflict = () => {
521
-
522
- $.fn[NAME] = JQUERY_NO_CONFLICT;
523
-
524
- return Dialog._jQueryInterface;
525
- }
526
-
527
- $.fn[NAME].defaults = {
528
- title: '',
529
- template: '',
530
- body: '',
531
- footer: true,
532
- size: '', // sm/lg
533
- classes: '',
534
- centered: true,
535
- backdrop: true,
536
- preventScroll: true,
537
- closeBtn: true,
538
- animation: true,
539
- animationIn: 'zoomIn',
540
- animationOut: 'fadeOut',
541
- animationSpeed: 'fastest',
542
- callbacks: {},
543
- maxBodyHeight: null,
544
- overflowVisible: false,
545
- faPro: false,
546
- debug: true,
547
- onInitialize: null,
548
- onDestroy: null,
549
- onInit: null,
550
- onDestroy: null,
551
- onShow: null,
552
- onClose: null,
553
- actions: {
554
- close: {
555
- primary: false,
556
- visible: true,
557
- content: 'Close',
558
- classes: '',
559
- attrs: ''
560
- },
561
- remove: {
562
- primary: false,
563
- visible: true,
564
- content: 'Remove',
565
- classes: '',
566
- attrs: ''
567
- },
568
- confirm: {
569
- primary: true,
570
- visible: true,
571
- content: 'Confirm',
572
- classes: '',
573
- attrs: ''
574
- }
575
- }
576
- }
577
- }
578
-
579
- export default Dialog;