@kupola/kupola 1.9.11 → 1.9.13
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/css/scaffold.css +5 -35
- package/dist/{core-D0uN-4lt.cjs → core-Cs-VWZ5H.cjs} +1 -1
- package/dist/{core-oOQWnSRW.js → core-DBjFFC_n.js} +83 -83
- package/dist/core.cjs.js +1 -1
- package/dist/core.esm.js +1 -1
- package/dist/css/scaffold.css +5 -35
- package/dist/kupola.cjs.js +1 -1
- package/dist/kupola.css +5 -35
- package/dist/kupola.esm.js +2 -2
- package/dist/kupola.min.css +1 -1
- package/dist/plugins/vite-plugin-kupola.js +13 -2
- package/dist/plugins/webpack-plugin-kupola.js +13 -2
- package/dist/theme-preload.js +72 -4
- package/dist/theme-standalone.js +161 -104
- package/js/theme-preload.js +72 -4
- package/js/theme-standalone.js +161 -104
- package/js/theme.js +371 -371
- package/package.json +1 -1
- package/plugins/vite-plugin-kupola.js +15 -4
- package/plugins/webpack-plugin-kupola.js +14 -3
|
@@ -2885,7 +2885,7 @@ function getTheme() {
|
|
|
2885
2885
|
}
|
|
2886
2886
|
function setTheme(theme) {
|
|
2887
2887
|
if (theme !== "dark" && theme !== "light") return;
|
|
2888
|
-
|
|
2888
|
+
const root = document.documentElement;
|
|
2889
2889
|
if (root.hasAttribute("data-kupola-theme-preloaded")) {
|
|
2890
2890
|
root.style.removeProperty("--bg-base-default");
|
|
2891
2891
|
root.style.removeProperty("--text-default");
|
|
@@ -2942,8 +2942,83 @@ function _themeToggleHandler(e) {
|
|
|
2942
2942
|
const newTheme = currentTheme === "dark" ? "light" : "dark";
|
|
2943
2943
|
setTheme(newTheme);
|
|
2944
2944
|
}
|
|
2945
|
+
function _createBrandPicker() {
|
|
2946
|
+
let brandPicker = document.getElementById("brand-picker");
|
|
2947
|
+
if (brandPicker) return brandPicker;
|
|
2948
|
+
brandPicker = document.createElement("div");
|
|
2949
|
+
brandPicker.id = "brand-picker";
|
|
2950
|
+
brandPicker.style.position = "fixed";
|
|
2951
|
+
brandPicker.style.top = "64px";
|
|
2952
|
+
brandPicker.style.right = "16px";
|
|
2953
|
+
brandPicker.style.zIndex = "9998";
|
|
2954
|
+
brandPicker.style.display = "none";
|
|
2955
|
+
brandPicker.style.padding = "12px";
|
|
2956
|
+
brandPicker.style.width = "200px";
|
|
2957
|
+
brandPicker.style.gridTemplateColumns = "repeat(3, 1fr)";
|
|
2958
|
+
brandPicker.style.gap = "6px";
|
|
2959
|
+
brandPicker.style.backgroundColor = "var(--bg-base-secondary)";
|
|
2960
|
+
brandPicker.style.border = "1px solid var(--border-neutral-l1)";
|
|
2961
|
+
brandPicker.style.borderRadius = "8px";
|
|
2962
|
+
brandPicker.style.boxShadow = "0 4px 20px rgba(0, 0, 0, 0.2)";
|
|
2963
|
+
brandPicker.style.overflow = "hidden";
|
|
2964
|
+
BRAND_OPTIONS.forEach((brand) => {
|
|
2965
|
+
const btn = document.createElement("button");
|
|
2966
|
+
btn.setAttribute("data-brand-btn", brand.id);
|
|
2967
|
+
btn.style.display = "flex";
|
|
2968
|
+
btn.style.justifyContent = "center";
|
|
2969
|
+
btn.style.alignItems = "center";
|
|
2970
|
+
btn.style.height = "60px";
|
|
2971
|
+
btn.style.backgroundColor = brand.color;
|
|
2972
|
+
btn.style.color = ["#32F08C", "#FF9900", "#E2C027", "#0EB0C9", "#B1A6CC"].includes(brand.color) ? "#0C0C0D" : "#FFFFFF";
|
|
2973
|
+
btn.style.fontWeight = "500";
|
|
2974
|
+
btn.style.borderRadius = "4px";
|
|
2975
|
+
btn.style.border = "none";
|
|
2976
|
+
btn.style.cursor = "pointer";
|
|
2977
|
+
btn.style.margin = "0";
|
|
2978
|
+
btn.style.padding = "0";
|
|
2979
|
+
btn.textContent = brand.name;
|
|
2980
|
+
brandPicker.appendChild(btn);
|
|
2981
|
+
});
|
|
2982
|
+
document.body.appendChild(brandPicker);
|
|
2983
|
+
return brandPicker;
|
|
2984
|
+
}
|
|
2985
|
+
function _bindBrandPicker(brandPicker) {
|
|
2986
|
+
const brandToggle = document.querySelector("[data-brand-toggle]");
|
|
2987
|
+
if (!brandToggle || !brandPicker) return;
|
|
2988
|
+
brandToggle.onclick = function(e) {
|
|
2989
|
+
e.stopPropagation();
|
|
2990
|
+
e.preventDefault();
|
|
2991
|
+
const isHidden = brandPicker.style.display === "none";
|
|
2992
|
+
brandPicker.style.display = isHidden ? "grid" : "none";
|
|
2993
|
+
if (isHidden) {
|
|
2994
|
+
setTimeout(() => {
|
|
2995
|
+
document.addEventListener("click", closeBrandPicker, true);
|
|
2996
|
+
}, 0);
|
|
2997
|
+
} else {
|
|
2998
|
+
document.removeEventListener("click", closeBrandPicker, true);
|
|
2999
|
+
}
|
|
3000
|
+
};
|
|
3001
|
+
brandPicker.onclick = function(e) {
|
|
3002
|
+
e.stopPropagation();
|
|
3003
|
+
};
|
|
3004
|
+
function closeBrandPicker(e) {
|
|
3005
|
+
if (!brandPicker.contains(e.target) && !brandToggle.contains(e.target)) {
|
|
3006
|
+
brandPicker.style.display = "none";
|
|
3007
|
+
document.removeEventListener("click", closeBrandPicker, true);
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
const brandButtons = brandPicker.querySelectorAll("[data-brand-btn]");
|
|
3011
|
+
brandButtons.forEach((btn) => {
|
|
3012
|
+
btn.onclick = function(e) {
|
|
3013
|
+
e.stopPropagation();
|
|
3014
|
+
const brandId = btn.getAttribute("data-brand-btn");
|
|
3015
|
+
setBrand(brandId);
|
|
3016
|
+
brandPicker.style.display = "none";
|
|
3017
|
+
};
|
|
3018
|
+
});
|
|
3019
|
+
}
|
|
2945
3020
|
function initTheme() {
|
|
2946
|
-
|
|
3021
|
+
const root = document.documentElement;
|
|
2947
3022
|
if (root.hasAttribute("data-kupola-theme-preloaded")) {
|
|
2948
3023
|
root.style.removeProperty("--bg-base-default");
|
|
2949
3024
|
root.style.removeProperty("--text-default");
|
|
@@ -2955,90 +3030,15 @@ function initTheme() {
|
|
|
2955
3030
|
const savedBrand = getBrand();
|
|
2956
3031
|
setBrand(savedBrand);
|
|
2957
3032
|
document.body.classList.add("theme-initialized");
|
|
2958
|
-
setTimeout(() => {
|
|
2959
|
-
document.body.classList.add("theme-initialized");
|
|
2960
|
-
}, 1500);
|
|
2961
3033
|
if (toggleBtn) {
|
|
2962
3034
|
updateThemeIcon(toggleBtn);
|
|
2963
|
-
toggleBtn.
|
|
2964
|
-
toggleBtn.addEventListener("click", _themeToggleHandler);
|
|
2965
|
-
}
|
|
2966
|
-
let brandPicker = document.getElementById("brand-picker");
|
|
2967
|
-
if (!brandPicker) {
|
|
2968
|
-
brandPicker = document.createElement("div");
|
|
2969
|
-
brandPicker.id = "brand-picker";
|
|
2970
|
-
brandPicker.style.position = "fixed";
|
|
2971
|
-
brandPicker.style.top = "64px";
|
|
2972
|
-
brandPicker.style.right = "16px";
|
|
2973
|
-
brandPicker.style.zIndex = "9998";
|
|
2974
|
-
brandPicker.style.display = "none";
|
|
2975
|
-
brandPicker.style.padding = "12px";
|
|
2976
|
-
brandPicker.style.width = "200px";
|
|
2977
|
-
brandPicker.style.gridTemplateColumns = "repeat(3, 1fr)";
|
|
2978
|
-
brandPicker.style.gap = "6px";
|
|
2979
|
-
brandPicker.style.backgroundColor = "var(--bg-base-secondary)";
|
|
2980
|
-
brandPicker.style.border = "1px solid var(--border-neutral-l1)";
|
|
2981
|
-
brandPicker.style.borderRadius = "8px";
|
|
2982
|
-
brandPicker.style.boxShadow = "0 4px 20px rgba(0, 0, 0, 0.2)";
|
|
2983
|
-
brandPicker.style.overflow = "hidden";
|
|
2984
|
-
BRAND_OPTIONS.forEach((brand) => {
|
|
2985
|
-
const btn = document.createElement("button");
|
|
2986
|
-
btn.setAttribute("data-brand-btn", brand.id);
|
|
2987
|
-
btn.style.display = "flex";
|
|
2988
|
-
btn.style.justifyContent = "center";
|
|
2989
|
-
btn.style.alignItems = "center";
|
|
2990
|
-
btn.style.height = "60px";
|
|
2991
|
-
btn.style.backgroundColor = brand.color;
|
|
2992
|
-
btn.style.color = ["#32F08C", "#FF9900", "#E2C027", "#0EB0C9", "#B1A6CC"].includes(brand.color) ? "#0C0C0D" : "#FFFFFF";
|
|
2993
|
-
btn.style.fontWeight = "500";
|
|
2994
|
-
btn.style.borderRadius = "4px";
|
|
2995
|
-
btn.style.border = "none";
|
|
2996
|
-
btn.style.cursor = "pointer";
|
|
2997
|
-
btn.style.margin = "0";
|
|
2998
|
-
btn.style.padding = "0";
|
|
2999
|
-
btn.textContent = brand.name;
|
|
3000
|
-
brandPicker.appendChild(btn);
|
|
3001
|
-
});
|
|
3002
|
-
document.body.appendChild(brandPicker);
|
|
3035
|
+
toggleBtn.onclick = _themeToggleHandler;
|
|
3003
3036
|
}
|
|
3004
3037
|
const brandToggle = document.querySelector("[data-brand-toggle]");
|
|
3005
|
-
if (brandToggle
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
e.preventDefault();
|
|
3009
|
-
const isHidden = brandPicker.style.display === "none";
|
|
3010
|
-
brandPicker.style.display = isHidden ? "grid" : "none";
|
|
3011
|
-
if (isHidden) {
|
|
3012
|
-
setTimeout(() => {
|
|
3013
|
-
document.addEventListener("click", closeBrandPicker, true);
|
|
3014
|
-
}, 0);
|
|
3015
|
-
} else {
|
|
3016
|
-
document.removeEventListener("click", closeBrandPicker, true);
|
|
3017
|
-
}
|
|
3018
|
-
};
|
|
3019
|
-
brandPicker.onclick = function(e) {
|
|
3020
|
-
e.stopPropagation();
|
|
3021
|
-
};
|
|
3022
|
-
}
|
|
3023
|
-
function closeBrandPicker(e) {
|
|
3024
|
-
if (brandPicker && brandToggle) {
|
|
3025
|
-
if (!brandPicker.contains(e.target) && !brandToggle.contains(e.target)) {
|
|
3026
|
-
brandPicker.style.display = "none";
|
|
3027
|
-
document.removeEventListener("click", closeBrandPicker, true);
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3038
|
+
if (brandToggle) {
|
|
3039
|
+
const brandPicker = _createBrandPicker();
|
|
3040
|
+
_bindBrandPicker(brandPicker);
|
|
3030
3041
|
}
|
|
3031
|
-
const brandButtons = document.querySelectorAll("[data-brand-btn]");
|
|
3032
|
-
brandButtons.forEach((btn) => {
|
|
3033
|
-
btn.addEventListener("click", (e) => {
|
|
3034
|
-
e.stopPropagation();
|
|
3035
|
-
const brandId = btn.getAttribute("data-brand-btn");
|
|
3036
|
-
setBrand(brandId);
|
|
3037
|
-
if (brandPicker) {
|
|
3038
|
-
brandPicker.style.display = "none";
|
|
3039
|
-
}
|
|
3040
|
-
});
|
|
3041
|
-
});
|
|
3042
3042
|
}
|
|
3043
3043
|
function createThemeToggle() {
|
|
3044
3044
|
const btn = document.createElement("button");
|
|
@@ -3150,12 +3150,12 @@ function createBrandPicker() {
|
|
|
3150
3150
|
}
|
|
3151
3151
|
const brandButtons = container.querySelectorAll("[data-brand-btn]");
|
|
3152
3152
|
brandButtons.forEach((btn) => {
|
|
3153
|
-
btn.
|
|
3153
|
+
btn.onclick = function(e) {
|
|
3154
3154
|
e.stopPropagation();
|
|
3155
3155
|
const brandId = btn.getAttribute("data-brand-btn");
|
|
3156
3156
|
setBrand(brandId);
|
|
3157
3157
|
container.style.display = "none";
|
|
3158
|
-
}
|
|
3158
|
+
};
|
|
3159
3159
|
});
|
|
3160
3160
|
return { toggleBtn, container };
|
|
3161
3161
|
}
|
package/dist/core.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core-Cs-VWZ5H.cjs");exports.BRAND_OPTIONS=e.BRAND_OPTIONS,exports.CacheEntry=e.CacheEntry,exports.CacheManager=e.CacheManager,exports.ComponentInitializerRegistry=e.ComponentInitializerRegistry,exports.DependsError=e.DependsError,exports.DependsSource=e.DependsSource,exports.FetchedSource=e.FetchedSource,exports.FunctionSource=e.FunctionSource,exports.GlobalEvents=e.GlobalEvents,exports.KupolaComponent=e.KupolaComponent,exports.KupolaComponentRegistry=e.KupolaComponentRegistry,exports.KupolaDataBind=e.KupolaDataBind,exports.KupolaEventBus=e.KupolaEventBus,exports.KupolaI18n=e.KupolaI18n,exports.KupolaLifecycle=e.KupolaLifecycle,exports.KupolaStore=e.KupolaStore,exports.KupolaStoreManager=e.KupolaStoreManager,exports.KupolaUtils=e.KupolaUtils,exports.RouteSource=e.RouteSource,exports.Scheduler=e.Scheduler,exports.StaticSource=e.StaticSource,exports.StorageSource=e.StorageSource,exports.WebSocketSource=e.WebSocketSource,exports.applyMixin=e.applyMixin,exports.arrayUtils=e.arrayUtils,exports.bootstrapComponents=e.bootstrapComponents,exports.clearCache=e.clearCache,exports.configureHttpClient=e.configureHttpClient,exports.createBrandPicker=e.createBrandPicker,exports.createI18n=e.createI18n,exports.createLifecycle=e.createLifecycle,exports.createSource=e.createSource,exports.createStore=e.createStore,exports.createThemeToggle=e.createThemeToggle,exports.cryptoUtils=e.cryptoUtils,exports.dateUtils=e.dateUtils,exports.debounce=e.debounce,exports.defineComponent=e.defineComponent,exports.defineMixin=e.defineMixin,exports.emit=e.emit,exports.emitGlobal=e.emitGlobal,exports.escapeHtml=e.escapeHtml,exports.formatCurrency=e.formatCurrency,exports.formatDate=e.formatDate,exports.formatNumber=e.formatNumber,exports.generateSecureId=e.generateSecureId,exports.getBasePath=e.getBasePath,exports.getBrand=e.getBrand,exports.getConfig=e.getConfig,exports.getDefaultBrand=e.getDefaultBrand,exports.getDefaultTheme=e.getDefaultTheme,exports.getHttpClient=e.getHttpClient,exports.getHttpConfig=e.getHttpConfig,exports.getIconsPath=e.getIconsPath,exports.getListenerCount=e.getListenerCount,exports.getLocale=e.getLocale,exports.getMessageConfig=e.getMessageConfig,exports.getNotificationConfig=e.getNotificationConfig,exports.getPerformanceConfig=e.getPerformanceConfig,exports.getSecurityConfig=e.getSecurityConfig,exports.getStore=e.getStore,exports.getTheme=e.getTheme,exports.getUiConfig=e.getUiConfig,exports.getValidationConfig=e.getValidationConfig,exports.globalEvents=e.globalEvents,exports.initTheme=e.initTheme,exports.kupolaBootstrap=e.kupolaBootstrap,exports.kupolaData=e.kupolaData,exports.kupolaEvents=e.kupolaEvents,exports.kupolaI18n=e.kupolaI18n,exports.kupolaInitializer=e.kupolaInitializer,exports.kupolaLifecycle=e.kupolaLifecycle,Object.defineProperty(exports,"kupolaRegistry",{enumerable:!0,get:()=>e.kupolaRegistry}),exports.kupolaStoreManager=e.kupolaStoreManager,exports.maskData=e.maskData,exports.n=e.n,exports.numberUtils=e.numberUtils,exports.objectUtils=e.objectUtils,exports.off=e.off,exports.offAll=e.offAll,exports.offByScope=e.offByScope,exports.offConfigChange=e.offConfigChange,exports.on=e.on,exports.onConfigChange=e.onConfigChange,exports.once=e.once,exports.preloadUtils=e.preloadUtils,exports.ref=e.ref,exports.registerComponent=e.registerComponent,exports.registerLazyComponent=e.registerLazyComponent,exports.resetHttpClient=e.resetHttpClient,exports.sanitizeHtml=e.sanitizeHtml,exports.setBrand=e.setBrand,exports.setConfig=e.setConfig,exports.setLocale=e.setLocale,exports.setTheme=e.setTheme,exports.stringUtils=e.stringUtils,exports.stripHtml=e.stripHtml,exports.t=e.t,exports.throttle=e.throttle,exports.useDeps=e.useDeps,exports.useMixin=e.useMixin,exports.useQuery=e.useQuery,exports.validatorUtils=e.validatorUtils;
|
package/dist/core.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, C, h, i, D, j, F, l, G, K, m, n, o, p, q, s, t, u, R, S, v, w, W, x, y, z, A, E, H, I, J, L, M, N, O, P, Q, T, U, V, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, d, c, f, ab, ac, ad, g, e, a, ae, af, ag, ah, ai, k, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, r, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN } from "./core-
|
|
1
|
+
import { B, C, h, i, D, j, F, l, G, K, m, n, o, p, q, s, t, u, R, S, v, w, W, x, y, z, A, E, H, I, J, L, M, N, O, P, Q, T, U, V, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, d, c, f, ab, ac, ad, g, e, a, ae, af, ag, ah, ai, k, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, r, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN } from "./core-DBjFFC_n.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BRAND_OPTIONS,
|
|
4
4
|
C as CacheEntry,
|
package/dist/css/scaffold.css
CHANGED
|
@@ -6,44 +6,14 @@
|
|
|
6
6
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
7
7
|
|
|
8
8
|
/* ===== Theme Loading ===== */
|
|
9
|
-
body:not(.theme-initialized)
|
|
10
|
-
opacity: 0 !important;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.ds-theme-loader {
|
|
14
|
-
position: fixed;
|
|
15
|
-
inset: 0;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
background: var(--bg-base-default);
|
|
21
|
-
z-index: 9999;
|
|
22
|
-
transition: opacity 0.3s ease;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
body.theme-initialized .ds-theme-loader {
|
|
9
|
+
body:not(.theme-initialized):not([data-kupola-theme-preloaded]) {
|
|
26
10
|
opacity: 0;
|
|
27
|
-
|
|
11
|
+
transition: opacity 0.15s ease-out;
|
|
28
12
|
}
|
|
29
13
|
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border: 2px solid var(--border-neutral-l2);
|
|
34
|
-
border-top-color: var(--bg-brand);
|
|
35
|
-
border-radius: 50%;
|
|
36
|
-
animation: ds-spin 0.8s linear infinite;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.ds-theme-loader__text {
|
|
40
|
-
margin-top: 16px;
|
|
41
|
-
color: var(--text-secondary);
|
|
42
|
-
font-size: 14px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@keyframes ds-spin {
|
|
46
|
-
to { transform: rotate(360deg); }
|
|
14
|
+
body.theme-initialized,
|
|
15
|
+
body[data-kupola-theme-preloaded] {
|
|
16
|
+
opacity: 1;
|
|
47
17
|
}
|
|
48
18
|
|
|
49
19
|
html, body {
|