@kupola/kupola 1.4.2 → 1.4.4

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 (71) hide show
  1. package/README.md +28 -3
  2. package/css/components-ext.css +1 -1
  3. package/css/kupola.css +3 -2
  4. package/css/table.css +74 -0
  5. package/dist/css/components-ext.css +158 -1
  6. package/dist/css/components.css +93 -1
  7. package/dist/css/kupola.css +13 -1
  8. package/dist/css/table.css +74 -0
  9. package/dist/css/theme-dark.css +5 -5
  10. package/dist/css/utilities.css +159 -1
  11. package/dist/kupola.cjs.js +214 -17409
  12. package/dist/kupola.cjs.js.map +1 -1
  13. package/dist/kupola.css +101 -4
  14. package/dist/kupola.esm.js +8196 -17225
  15. package/dist/kupola.esm.js.map +1 -1
  16. package/dist/kupola.min.css +1 -1
  17. package/dist/kupola.umd.js +214 -17415
  18. package/dist/kupola.umd.js.map +1 -1
  19. package/dist/types/kupola.d.ts +41 -25
  20. package/js/calendar.js +3 -10
  21. package/js/carousel.js +3 -10
  22. package/js/collapse.js +3 -10
  23. package/js/color-picker.js +5 -16
  24. package/js/component.js +4 -18
  25. package/js/countdown.js +3 -10
  26. package/js/data-bind.js +56 -36
  27. package/js/datepicker.js +16 -24
  28. package/js/depends.js +27 -16
  29. package/js/dialog.js +1 -5
  30. package/js/drawer.js +3 -11
  31. package/js/dropdown.js +11 -18
  32. package/js/dynamic-tags.js +3 -10
  33. package/js/fileupload.js +10 -12
  34. package/js/form.js +26 -20
  35. package/js/global-events.js +1 -14
  36. package/js/heatmap.js +3 -12
  37. package/js/i18n.js +1 -14
  38. package/js/icons.js +2 -2
  39. package/js/image-preview.js +1 -7
  40. package/js/initializer.js +0 -43
  41. package/js/kupola-core.js +1 -13
  42. package/js/kupola-lifecycle.js +1 -9
  43. package/js/message.js +1 -6
  44. package/js/modal.js +22 -20
  45. package/js/notification.js +1 -6
  46. package/js/numberinput.js +3 -10
  47. package/js/pagination.js +0 -5
  48. package/js/registry.js +0 -4
  49. package/js/select.js +5 -16
  50. package/js/slide-captcha.js +8 -21
  51. package/js/slider.js +3 -10
  52. package/js/statcard.js +3 -11
  53. package/js/table.js +240 -262
  54. package/js/tag.js +3 -10
  55. package/js/theme.js +11 -16
  56. package/js/timepicker.js +6 -19
  57. package/js/tooltip.js +3 -10
  58. package/js/utils.js +281 -1439
  59. package/js/validation.js +2 -7
  60. package/js/virtual-list.js +13 -38
  61. package/js/web-components.js +0 -9
  62. package/package.json +12 -7
  63. package/scripts/build-css.cjs +3 -2
  64. package/types/kupola.d.ts +41 -25
  65. package/version.json +10 -0
  66. package/dist/css/kupola.min.css +0 -1
  67. package/dist/icons.svg +0 -284
  68. package/dist/kupola.min.js +0 -2
  69. package/dist/kupola.min.js.map +0 -1
  70. /package/css/{colors_and_type.css → colors-and-type.css} +0 -0
  71. /package/dist/css/{colors_and_type.css → colors-and-type.css} +0 -0
package/js/theme.js CHANGED
@@ -82,11 +82,16 @@ function initTheme() {
82
82
 
83
83
  const toggleBtn = document.querySelector('[data-theme-toggle]');
84
84
  if (toggleBtn) {
85
- toggleBtn.addEventListener('click', () => {
85
+ const existingOnClick = toggleBtn.onclick;
86
+ toggleBtn.onclick = function(e) {
87
+ e.preventDefault();
86
88
  const currentTheme = getTheme();
87
89
  const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
88
90
  setTheme(newTheme);
89
- });
91
+ if (typeof existingOnClick === 'function') {
92
+ existingOnClick.call(this, e);
93
+ }
94
+ };
90
95
  }
91
96
 
92
97
  let brandPicker = document.getElementById('brand-picker');
@@ -201,11 +206,12 @@ function createThemeToggle() {
201
206
  btn.appendChild(icon);
202
207
  document.body.appendChild(btn);
203
208
 
204
- btn.addEventListener('click', () => {
209
+ btn.onclick = function(e) {
210
+ e.preventDefault();
205
211
  const currentTheme = getTheme();
206
212
  const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
207
213
  setTheme(newTheme);
208
- });
214
+ };
209
215
 
210
216
  return btn;
211
217
  }
@@ -320,15 +326,4 @@ export {
320
326
  getTheme, setTheme, initTheme, createThemeToggle,
321
327
  getBrand, setBrand, BRAND_OPTIONS, createBrandPicker,
322
328
  THEME_KEY, BRAND_KEY
323
- };
324
-
325
- if (typeof window !== 'undefined') {
326
- window.getTheme = getTheme;
327
- window.setTheme = setTheme;
328
- window.initTheme = initTheme;
329
- window.createThemeToggle = createThemeToggle;
330
- window.getBrand = getBrand;
331
- window.setBrand = setBrand;
332
- window.BRAND_OPTIONS = BRAND_OPTIONS;
333
- window.createBrandPicker = createBrandPicker;
334
- }
329
+ };
package/js/timepicker.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { globalEvents } from './global-events.js';
2
+ import { kupolaInitializer } from './initializer.js';
3
+
1
4
  class Timepicker {
2
5
  constructor(element, options = {}) {
3
6
  this.element = element;
@@ -55,15 +58,8 @@ class Timepicker {
55
58
 
56
59
  this.inputWrap.addEventListener('click', this._inputWrapClickHandler);
57
60
 
58
- if (window.globalEvents) {
59
- this._documentClickListener = window.globalEvents.on(document, 'click', (e) => this.hideTimepicker(e), { scope: this.scope });
60
- this._resizeListener = window.globalEvents.on(window, 'resize', () => this.resizeHandler(), { scope: this.scope });
61
- } else {
62
- document.addEventListener('click', (e) => this.hideTimepicker(e));
63
- window.addEventListener('resize', () => this.resizeHandler());
64
- this._documentClickHandler = (e) => this.hideTimepicker(e);
65
- this._resizeHandler = () => this.resizeHandler();
66
- }
61
+ this._documentClickListener = globalEvents.on(document, 'click', (e) => this.hideTimepicker(e), { scope: this.scope });
62
+ this._resizeListener = globalEvents.on(window, 'resize', () => this.resizeHandler(), { scope: this.scope });
67
63
 
68
64
  this._keydownHandler = (e) => {
69
65
  if (e.key === 'Escape' && this.panelEl && this.panelEl.style.display === 'block') {
@@ -495,13 +491,4 @@ function cleanupTimepicker(element) {
495
491
 
496
492
  export { Timepicker, initTimepicker, initTimepickers, cleanupTimepicker };
497
493
 
498
- if (typeof window !== 'undefined') {
499
- window.Timepicker = Timepicker;
500
- window.initTimepicker = initTimepicker;
501
- window.initTimepickers = initTimepickers;
502
- window.cleanupTimepicker = cleanupTimepicker;
503
-
504
- if (window.kupolaInitializer) {
505
- window.kupolaInitializer.register('timepicker', initTimepicker, cleanupTimepicker);
506
- }
507
- }
494
+ kupolaInitializer.register('timepicker', initTimepicker, cleanupTimepicker);
package/js/tooltip.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { kupolaInitializer } from './initializer.js';
2
+
1
3
  class Tooltip {
2
4
  constructor(element, options = {}) {
3
5
  this.element = element;
@@ -341,13 +343,4 @@ function cleanupTooltip(element) {
341
343
 
342
344
  export { Tooltip, initTooltip, initTooltips, cleanupTooltip };
343
345
 
344
- if (typeof window !== 'undefined') {
345
- window.Tooltip = Tooltip;
346
- window.initTooltip = initTooltip;
347
- window.initTooltips = initTooltips;
348
- window.cleanupTooltip = cleanupTooltip;
349
-
350
- if (window.kupolaInitializer) {
351
- window.kupolaInitializer.register('tooltip', initTooltip, cleanupTooltip);
352
- }
353
- }
346
+ kupolaInitializer.register('tooltip', initTooltip, cleanupTooltip);