@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.
- package/README.md +28 -3
- package/css/components-ext.css +1 -1
- package/css/kupola.css +3 -2
- package/css/table.css +74 -0
- package/dist/css/components-ext.css +158 -1
- package/dist/css/components.css +93 -1
- package/dist/css/kupola.css +13 -1
- package/dist/css/table.css +74 -0
- package/dist/css/theme-dark.css +5 -5
- package/dist/css/utilities.css +159 -1
- package/dist/kupola.cjs.js +214 -17409
- package/dist/kupola.cjs.js.map +1 -1
- package/dist/kupola.css +101 -4
- package/dist/kupola.esm.js +8196 -17225
- package/dist/kupola.esm.js.map +1 -1
- package/dist/kupola.min.css +1 -1
- package/dist/kupola.umd.js +214 -17415
- package/dist/kupola.umd.js.map +1 -1
- package/dist/types/kupola.d.ts +41 -25
- package/js/calendar.js +3 -10
- package/js/carousel.js +3 -10
- package/js/collapse.js +3 -10
- package/js/color-picker.js +5 -16
- package/js/component.js +4 -18
- package/js/countdown.js +3 -10
- package/js/data-bind.js +56 -36
- package/js/datepicker.js +16 -24
- package/js/depends.js +27 -16
- package/js/dialog.js +1 -5
- package/js/drawer.js +3 -11
- package/js/dropdown.js +11 -18
- package/js/dynamic-tags.js +3 -10
- package/js/fileupload.js +10 -12
- package/js/form.js +26 -20
- package/js/global-events.js +1 -14
- package/js/heatmap.js +3 -12
- package/js/i18n.js +1 -14
- package/js/icons.js +2 -2
- package/js/image-preview.js +1 -7
- package/js/initializer.js +0 -43
- package/js/kupola-core.js +1 -13
- package/js/kupola-lifecycle.js +1 -9
- package/js/message.js +1 -6
- package/js/modal.js +22 -20
- package/js/notification.js +1 -6
- package/js/numberinput.js +3 -10
- package/js/pagination.js +0 -5
- package/js/registry.js +0 -4
- package/js/select.js +5 -16
- package/js/slide-captcha.js +8 -21
- package/js/slider.js +3 -10
- package/js/statcard.js +3 -11
- package/js/table.js +240 -262
- package/js/tag.js +3 -10
- package/js/theme.js +11 -16
- package/js/timepicker.js +6 -19
- package/js/tooltip.js +3 -10
- package/js/utils.js +281 -1439
- package/js/validation.js +2 -7
- package/js/virtual-list.js +13 -38
- package/js/web-components.js +0 -9
- package/package.json +12 -7
- package/scripts/build-css.cjs +3 -2
- package/types/kupola.d.ts +41 -25
- package/version.json +10 -0
- package/dist/css/kupola.min.css +0 -1
- package/dist/icons.svg +0 -284
- package/dist/kupola.min.js +0 -2
- package/dist/kupola.min.js.map +0 -1
- /package/css/{colors_and_type.css → colors-and-type.css} +0 -0
- /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
|
-
|
|
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.
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|