zs3-ui-components 1.2.2 → 1.2.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.
Potentially problematic release.
This version of zs3-ui-components might be problematic. Click here for more details.
- package/README.md +26 -3
- package/dist/components/zs3-BaseComponent.d.ts +18 -12
- package/dist/index.js +799 -760
- package/package.json +1 -1
- package/dist/components/zs3-BaseComponent.senseRouter.d.ts +0 -318
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class C {
|
|
2
2
|
/**
|
|
3
3
|
* Creates a new instance by selecting elements using a CSS selector.
|
|
4
4
|
* @param {string} selector - CSS selector string.
|
|
@@ -14,7 +14,7 @@ class T {
|
|
|
14
14
|
* @returns {string} Library version.
|
|
15
15
|
*/
|
|
16
16
|
static version() {
|
|
17
|
-
return "1.2.
|
|
17
|
+
return "1.2.4";
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Creates a ZS3 instance from an HTMLElement.
|
|
@@ -22,7 +22,7 @@ class T {
|
|
|
22
22
|
* @returns {ZS3} A new ZS3 instance containing only this element.
|
|
23
23
|
*/
|
|
24
24
|
static fromElement(t) {
|
|
25
|
-
const s = Object.create(
|
|
25
|
+
const s = Object.create(C.prototype);
|
|
26
26
|
return s.list = [t], s.$ = t, s.$$ = [t], s;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -32,7 +32,7 @@ class T {
|
|
|
32
32
|
*/
|
|
33
33
|
forEach(t) {
|
|
34
34
|
return this.list.forEach((s, i) => {
|
|
35
|
-
t(
|
|
35
|
+
t(C.fromElement(s), i);
|
|
36
36
|
}), this;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -51,7 +51,7 @@ class T {
|
|
|
51
51
|
*/
|
|
52
52
|
*[Symbol.iterator]() {
|
|
53
53
|
for (const t of this.list)
|
|
54
|
-
yield
|
|
54
|
+
yield C.fromElement(t);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Get or set the innerHTML of the selected elements.
|
|
@@ -371,8 +371,8 @@ class T {
|
|
|
371
371
|
return typeof t == "string" && s !== void 0 ? (this.list.forEach((i) => {
|
|
372
372
|
i.style.setProperty(t, s);
|
|
373
373
|
}), this) : typeof t == "string" && s === void 0 ? this.list[0]?.style.getPropertyValue(t) ?? "" : typeof t == "object" ? (this.list.forEach((i) => {
|
|
374
|
-
for (const [
|
|
375
|
-
i.style.setProperty(
|
|
374
|
+
for (const [o, r] of Object.entries(t))
|
|
375
|
+
i.style.setProperty(o, r);
|
|
376
376
|
}), this) : this;
|
|
377
377
|
}
|
|
378
378
|
/**
|
|
@@ -381,7 +381,7 @@ class T {
|
|
|
381
381
|
parent() {
|
|
382
382
|
const t = this.list[0]?.parentElement;
|
|
383
383
|
if (!t) return null;
|
|
384
|
-
const s = new
|
|
384
|
+
const s = new C("body");
|
|
385
385
|
return s.list.length = 0, s.list.push(t), s.$ = t, s.$$ = [t], s;
|
|
386
386
|
}
|
|
387
387
|
/**
|
|
@@ -390,7 +390,7 @@ class T {
|
|
|
390
390
|
children() {
|
|
391
391
|
const t = Array.from(this.list[0]?.children ?? []);
|
|
392
392
|
if (t.length === 0) return null;
|
|
393
|
-
const s = new
|
|
393
|
+
const s = new C("body");
|
|
394
394
|
return s.list.length = 0, s.list.push(...t), s.$ = t[0], s.$$ = t, s;
|
|
395
395
|
}
|
|
396
396
|
/**
|
|
@@ -400,7 +400,7 @@ class T {
|
|
|
400
400
|
find(t) {
|
|
401
401
|
const s = Array.from(this.list[0]?.querySelectorAll(t) ?? []);
|
|
402
402
|
if (s.length === 0) return null;
|
|
403
|
-
const i = new
|
|
403
|
+
const i = new C("body");
|
|
404
404
|
return i.list.length = 0, i.list.push(...s), i.$ = s[0], i.$$ = s, i;
|
|
405
405
|
}
|
|
406
406
|
/**
|
|
@@ -416,7 +416,7 @@ class T {
|
|
|
416
416
|
eq(t) {
|
|
417
417
|
const s = this.list[t];
|
|
418
418
|
if (!s) return null;
|
|
419
|
-
const i = new
|
|
419
|
+
const i = new C("body");
|
|
420
420
|
return i.list.length = 0, i.list.push(s), i.$ = s, i.$$ = [s], i;
|
|
421
421
|
}
|
|
422
422
|
/**
|
|
@@ -427,18 +427,18 @@ class T {
|
|
|
427
427
|
return this.list[0]?.cloneNode(t) ?? null;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
const
|
|
430
|
+
const N = (e, t) => e != null && e.length > 0 ? new C(e, t) : null, Oe = () => ({
|
|
431
431
|
userAgent: navigator.userAgent,
|
|
432
432
|
language: navigator.language,
|
|
433
433
|
platform: navigator.platform,
|
|
434
|
-
ZS3:
|
|
434
|
+
ZS3: C.version()
|
|
435
435
|
});
|
|
436
|
-
class
|
|
436
|
+
class At {
|
|
437
437
|
constructor() {
|
|
438
438
|
this.getAll = () => {
|
|
439
439
|
const t = new URLSearchParams(window.location.search), s = {};
|
|
440
|
-
return t.forEach((i,
|
|
441
|
-
s[
|
|
440
|
+
return t.forEach((i, o) => {
|
|
441
|
+
s[o] = i;
|
|
442
442
|
}), s;
|
|
443
443
|
}, this.get = (t) => t.length === 0 ? this.getAll() : new URLSearchParams(window.location.search).get(t) ?? "", this.set = (t, s) => {
|
|
444
444
|
const i = new URL(window.location.href);
|
|
@@ -449,20 +449,20 @@ class xt {
|
|
|
449
449
|
}, this.has = (t) => new URLSearchParams(window.location.search).has(t);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
class
|
|
452
|
+
class St {
|
|
453
453
|
constructor() {
|
|
454
454
|
this.start = (t, s, i = document) => {
|
|
455
|
-
const
|
|
456
|
-
|
|
455
|
+
const o = `${t}:${s}`, r = this.debugging.get(o) ?? [];
|
|
456
|
+
r.some((c) => c.root === i) || (N(t, i)?.addEvent(s, this.doDebug), r.push({ selector: t, eventType: s, root: i }), this.debugging.set(o, r));
|
|
457
457
|
}, this.stop = (t, s, i = document) => {
|
|
458
|
-
const
|
|
459
|
-
if (!
|
|
460
|
-
const a =
|
|
461
|
-
a !== -1 && (
|
|
458
|
+
const o = `${t}:${s}`, r = this.debugging.get(o);
|
|
459
|
+
if (!r) return;
|
|
460
|
+
const a = r.findIndex((c) => c.root === i);
|
|
461
|
+
a !== -1 && (N(t, i)?.removeEvent(s, this.doDebug), r.splice(a, 1), r.length === 0 && this.debugging.delete(o));
|
|
462
462
|
}, this.stopAll = () => {
|
|
463
463
|
this.debugging.forEach((t) => {
|
|
464
|
-
t.forEach(({ selector: s, eventType: i, root:
|
|
465
|
-
|
|
464
|
+
t.forEach(({ selector: s, eventType: i, root: o }) => {
|
|
465
|
+
N(s, o)?.removeEvent(i, this.doDebug);
|
|
466
466
|
});
|
|
467
467
|
}), this.debugging.clear();
|
|
468
468
|
}, this.doDebug = (t) => {
|
|
@@ -479,7 +479,7 @@ class Et {
|
|
|
479
479
|
}, this.debugging = /* @__PURE__ */ new Map();
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class kt {
|
|
483
483
|
constructor() {
|
|
484
484
|
this.enabled = !0, this.level = "all", this.setEnabled = (t) => {
|
|
485
485
|
this.enabled = t;
|
|
@@ -498,31 +498,31 @@ class _t {
|
|
|
498
498
|
}
|
|
499
499
|
info(t, s) {
|
|
500
500
|
if (!this.shouldLog("info")) return;
|
|
501
|
-
const i = "color: green; font-weight: bold;",
|
|
502
|
-
console.log(`%c[INFO ${
|
|
501
|
+
const i = "color: green; font-weight: bold;", o = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
502
|
+
console.log(`%c[INFO ${o}] ${t}`, i), s && this.logObject(s, console.log);
|
|
503
503
|
}
|
|
504
504
|
warn(t, s) {
|
|
505
505
|
if (!this.shouldLog("warn")) return;
|
|
506
|
-
const i = "color: orange; font-weight: bold;",
|
|
507
|
-
console.warn(`%c[WARN ${
|
|
506
|
+
const i = "color: orange; font-weight: bold;", o = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
507
|
+
console.warn(`%c[WARN ${o}] ${t}`, i), s && this.logObject(s, console.warn);
|
|
508
508
|
}
|
|
509
509
|
error(t, s) {
|
|
510
510
|
if (!this.shouldLog("error")) return;
|
|
511
|
-
const i = "color: red; font-weight: bold;",
|
|
512
|
-
console.error(`%c[ERROR ${
|
|
511
|
+
const i = "color: red; font-weight: bold;", o = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
512
|
+
console.error(`%c[ERROR ${o}] ${t}`, i), s && this.logObject(s, console.error);
|
|
513
513
|
}
|
|
514
514
|
debug(t, s) {
|
|
515
515
|
if (!this.enabled) return;
|
|
516
|
-
const i = "color: blue; font-weight: bold;",
|
|
517
|
-
console.log(`%c[DEBUG ${
|
|
516
|
+
const i = "color: blue; font-weight: bold;", o = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
517
|
+
console.log(`%c[DEBUG ${o}] ${t}`, i), s && this.logObject(s, console.log);
|
|
518
518
|
}
|
|
519
519
|
success(t, s) {
|
|
520
520
|
if (!this.enabled) return;
|
|
521
|
-
const i = "color: lime; font-weight: bold;",
|
|
522
|
-
console.log(`%c[SUCCESS ${
|
|
521
|
+
const i = "color: lime; font-weight: bold;", o = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
522
|
+
console.log(`%c[SUCCESS ${o}] ${t}`, i), s && this.logObject(s, console.log);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
class
|
|
525
|
+
class Pt {
|
|
526
526
|
constructor() {
|
|
527
527
|
this.set = (t, s) => {
|
|
528
528
|
try {
|
|
@@ -545,7 +545,7 @@ class Tt {
|
|
|
545
545
|
}, this.has = (t) => localStorage.getItem(t) !== null, this.keys = () => Object.keys(localStorage);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
class
|
|
548
|
+
class Be {
|
|
549
549
|
/**
|
|
550
550
|
* Crea una nova instància del Store amb l'estat inicial proporcionat.
|
|
551
551
|
* L'estat inicial es copia en profunditat (structuredClone) per evitar mutacions exteriors.
|
|
@@ -610,8 +610,8 @@ class Ae {
|
|
|
610
610
|
console.warn(`[Store] No hi ha reducer per l'acció: ${t}`);
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
|
-
const
|
|
614
|
-
this.state = { ...this.state, ...
|
|
613
|
+
const o = i(this.state, s);
|
|
614
|
+
this.state = { ...this.state, ...o }, this.listeners.get(t)?.forEach((r) => r(this.getState())), this.listeners.get("*")?.forEach((r) => r(this.getState()));
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
617
617
|
* Subscriu un listener als canvis d'una acció concreta o de qualsevol acció.
|
|
@@ -645,12 +645,12 @@ class Ae {
|
|
|
645
645
|
};
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
const
|
|
649
|
-
typeof window < "u" && (window.$ =
|
|
648
|
+
const Dt = new At(), Ht = new St(), ft = new kt(), tt = new Pt();
|
|
649
|
+
typeof window < "u" && (window.$ = N, window.log = ft, window.debug = Ht, window.storage = tt, window.params = Dt);
|
|
650
650
|
window.addEventListener("load", () => {
|
|
651
|
-
|
|
651
|
+
ft.success("ZS3 v" + C.version() + " loaded");
|
|
652
652
|
});
|
|
653
|
-
class
|
|
653
|
+
class Rt extends CustomEvent {
|
|
654
654
|
constructor(t) {
|
|
655
655
|
super("zs3-theme-change", {
|
|
656
656
|
bubbles: !0,
|
|
@@ -660,18 +660,18 @@ class Ct extends CustomEvent {
|
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
class
|
|
663
|
+
class X {
|
|
664
664
|
constructor() {
|
|
665
665
|
this.currentTheme = "light", this.STORAGE_KEY = "zs3-theme", this.loadSavedTheme(), this.setupSystemThemeListener();
|
|
666
666
|
}
|
|
667
667
|
static getInstance() {
|
|
668
|
-
return
|
|
668
|
+
return X.instance || (X.instance = new X()), X.instance;
|
|
669
669
|
}
|
|
670
670
|
/**
|
|
671
671
|
* Carrega el tema guardat o usa el del sistema
|
|
672
672
|
*/
|
|
673
673
|
loadSavedTheme() {
|
|
674
|
-
const t =
|
|
674
|
+
const t = tt.get(this.STORAGE_KEY);
|
|
675
675
|
t ? this.setTheme(t) : this.setTheme("system");
|
|
676
676
|
}
|
|
677
677
|
/**
|
|
@@ -697,13 +697,13 @@ class K {
|
|
|
697
697
|
this.applySystemTheme();
|
|
698
698
|
return;
|
|
699
699
|
}
|
|
700
|
-
document.body.setAttribute("data-theme", t), window.dispatchEvent(new
|
|
700
|
+
document.body.setAttribute("data-theme", t), window.dispatchEvent(new Rt(t));
|
|
701
701
|
}
|
|
702
702
|
/**
|
|
703
703
|
* Estableix un nou tema
|
|
704
704
|
*/
|
|
705
705
|
setTheme(t) {
|
|
706
|
-
this.currentTheme = t,
|
|
706
|
+
this.currentTheme = t, tt.set(this.STORAGE_KEY, t), this.applyTheme(t);
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
709
709
|
* Obté el tema actual
|
|
@@ -740,9 +740,9 @@ class K {
|
|
|
740
740
|
];
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
const
|
|
744
|
-
typeof window < "u" && (window.themeManager =
|
|
745
|
-
function
|
|
743
|
+
const Z = X.getInstance();
|
|
744
|
+
typeof window < "u" && (window.themeManager = Z);
|
|
745
|
+
function Ve(e) {
|
|
746
746
|
return class extends e {
|
|
747
747
|
connectedCallback() {
|
|
748
748
|
super.connectedCallback && super.connectedCallback(), this._themeChangeHandler = this.onThemeChange.bind(this), window.addEventListener("zs3-theme-change", this._themeChangeHandler);
|
|
@@ -756,20 +756,20 @@ function Se(e) {
|
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function Fe(e) {
|
|
760
760
|
return getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Ie(e, t) {
|
|
763
763
|
document.documentElement.style.setProperty(`--${e}`, t);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Tt(e) {
|
|
766
766
|
const { defaultTheme: t } = e || {};
|
|
767
|
-
t &&
|
|
767
|
+
t && Z.setTheme(t), console.log("✅ ZS3 Theme System initialized");
|
|
768
768
|
}
|
|
769
769
|
typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => {
|
|
770
|
-
|
|
771
|
-
}) :
|
|
772
|
-
class
|
|
770
|
+
Tt();
|
|
771
|
+
}) : Tt());
|
|
772
|
+
class Ot {
|
|
773
773
|
constructor() {
|
|
774
774
|
this.handlers = /* @__PURE__ */ new Map();
|
|
775
775
|
}
|
|
@@ -829,8 +829,8 @@ class $t {
|
|
|
829
829
|
* ```
|
|
830
830
|
*/
|
|
831
831
|
once(t, s) {
|
|
832
|
-
const i = (
|
|
833
|
-
s(
|
|
832
|
+
const i = (o) => {
|
|
833
|
+
s(o), this.handlers.get(t)?.delete(i);
|
|
834
834
|
};
|
|
835
835
|
this.on(t, i);
|
|
836
836
|
}
|
|
@@ -860,8 +860,8 @@ class $t {
|
|
|
860
860
|
this.handlers.clear();
|
|
861
861
|
}
|
|
862
862
|
}
|
|
863
|
-
const
|
|
864
|
-
class
|
|
863
|
+
const je = new Ot();
|
|
864
|
+
class Bt {
|
|
865
865
|
constructor() {
|
|
866
866
|
this.registry = /* @__PURE__ */ new Map();
|
|
867
867
|
}
|
|
@@ -961,8 +961,8 @@ class At {
|
|
|
961
961
|
this.registry.clear();
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
const
|
|
965
|
-
class
|
|
964
|
+
const Ne = new Bt();
|
|
965
|
+
class Ue {
|
|
966
966
|
/**
|
|
967
967
|
* Crea una nova instància del Router.
|
|
968
968
|
*
|
|
@@ -988,8 +988,8 @@ class Re {
|
|
|
988
988
|
const i = t.target.closest("a[data-link]");
|
|
989
989
|
if (i) {
|
|
990
990
|
t.preventDefault();
|
|
991
|
-
const
|
|
992
|
-
|
|
991
|
+
const o = i.getAttribute("href");
|
|
992
|
+
o && this.navigate(o);
|
|
993
993
|
}
|
|
994
994
|
}), this.resolve(window.location.pathname);
|
|
995
995
|
}
|
|
@@ -1025,24 +1025,24 @@ class Re {
|
|
|
1025
1025
|
async resolve(t) {
|
|
1026
1026
|
const s = this.match(t);
|
|
1027
1027
|
if (!s) {
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1028
|
+
const r = this.routes.find((a) => a.path === "*");
|
|
1029
|
+
r && await this.loadComponent(r, {});
|
|
1030
1030
|
return;
|
|
1031
1031
|
}
|
|
1032
|
-
const { route: i, params:
|
|
1032
|
+
const { route: i, params: o } = s;
|
|
1033
1033
|
if (i.guard) {
|
|
1034
|
-
const
|
|
1034
|
+
const r = {
|
|
1035
1035
|
path: t,
|
|
1036
|
-
params:
|
|
1036
|
+
params: o,
|
|
1037
1037
|
query: new URLSearchParams(window.location.search)
|
|
1038
|
-
}, a = i.guard(
|
|
1038
|
+
}, a = i.guard(r);
|
|
1039
1039
|
if (a === !1) return;
|
|
1040
1040
|
if (typeof a == "string") {
|
|
1041
1041
|
await this.navigate(a);
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
this.currentPath = t, await this.loadComponent(i,
|
|
1045
|
+
this.currentPath = t, await this.loadComponent(i, o);
|
|
1046
1046
|
}
|
|
1047
1047
|
/**
|
|
1048
1048
|
* Destrueix el component actual (si existeix), fa el lazy-load del mòdul de
|
|
@@ -1086,21 +1086,21 @@ class Re {
|
|
|
1086
1086
|
* extractParams('/about', '/contact') // null
|
|
1087
1087
|
*/
|
|
1088
1088
|
extractParams(t, s) {
|
|
1089
|
-
const i = t.split("/").filter(Boolean),
|
|
1090
|
-
if (i.length !==
|
|
1091
|
-
const
|
|
1089
|
+
const i = t.split("/").filter(Boolean), o = s.split("/").filter(Boolean);
|
|
1090
|
+
if (i.length !== o.length) return null;
|
|
1091
|
+
const r = {};
|
|
1092
1092
|
for (let a = 0; a < i.length; a++) {
|
|
1093
|
-
const c = i[a], l =
|
|
1093
|
+
const c = i[a], l = o[a];
|
|
1094
1094
|
if (c.startsWith(":")) {
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1095
|
+
const f = c.slice(1);
|
|
1096
|
+
r[f] = l;
|
|
1097
1097
|
} else if (c !== l)
|
|
1098
1098
|
return null;
|
|
1099
1099
|
}
|
|
1100
|
-
return
|
|
1100
|
+
return r;
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
const
|
|
1103
|
+
const ut = {
|
|
1104
1104
|
ca: {
|
|
1105
1105
|
// Dialog
|
|
1106
1106
|
"zs3.dialog.accept": "Acceptar",
|
|
@@ -1356,18 +1356,18 @@ const ot = {
|
|
|
1356
1356
|
"zs3.recover.email.placeholder": "email@example.com",
|
|
1357
1357
|
"zs3.recover.submit": "发送"
|
|
1358
1358
|
}
|
|
1359
|
-
},
|
|
1360
|
-
function
|
|
1361
|
-
return new Map(
|
|
1359
|
+
}, pt = "ca", mt = "en", _t = /* @__PURE__ */ new Map();
|
|
1360
|
+
function Vt() {
|
|
1361
|
+
return new Map(_t);
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function E(e) {
|
|
1364
1364
|
return function(t) {
|
|
1365
|
-
return customElements.get(e) || (customElements.define(e, t),
|
|
1365
|
+
return customElements.get(e) || (customElements.define(e, t), _t.set(e, t)), t;
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
|
-
class
|
|
1368
|
+
class Ft {
|
|
1369
1369
|
constructor() {
|
|
1370
|
-
this.locale =
|
|
1370
|
+
this.locale = pt, this.fallbackLocale = mt, this.translations = {}, this.STORAGE_KEY = "zs3-locale", this.frameworkDefaultsLoaded = !1, this.init = (t) => {
|
|
1371
1371
|
t?.locale && (this.locale = t.locale), t?.fallbackLocale && (this.fallbackLocale = t.fallbackLocale), t?.translations && this.loadMultiple(t.translations);
|
|
1372
1372
|
const s = this.getSaved();
|
|
1373
1373
|
s && this.translations[s] && (this.locale = s), document.documentElement.lang = this.locale, window.dispatchEvent(
|
|
@@ -1390,12 +1390,12 @@ class kt {
|
|
|
1390
1390
|
}, this.t = (t, s) => {
|
|
1391
1391
|
let i = this.translations[this.locale]?.[t] ?? this.translations[this.fallbackLocale]?.[t] ?? t;
|
|
1392
1392
|
if (s)
|
|
1393
|
-
for (const [
|
|
1394
|
-
i = i.replace(new RegExp(`{${
|
|
1393
|
+
for (const [o, r] of Object.entries(s))
|
|
1394
|
+
i = i.replace(new RegExp(`{${o}}`, "g"), String(r));
|
|
1395
1395
|
return i;
|
|
1396
1396
|
}, this.getLocale = () => this.locale, this.setLocale = (t, s) => {
|
|
1397
1397
|
const i = this.locale;
|
|
1398
|
-
this.locale = t, document.documentElement.lang = t,
|
|
1398
|
+
this.locale = t, document.documentElement.lang = t, tt.set(this.STORAGE_KEY, t), window.dispatchEvent(
|
|
1399
1399
|
new CustomEvent("zs3-locale-change", {
|
|
1400
1400
|
bubbles: !0,
|
|
1401
1401
|
detail: {
|
|
@@ -1404,26 +1404,26 @@ class kt {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
})
|
|
1406
1406
|
), this.updateElements(), s && s(t);
|
|
1407
|
-
}, this.getSaved = () =>
|
|
1407
|
+
}, this.getSaved = () => tt.get(this.STORAGE_KEY), this.getBrowserLocale = () => navigator.language.split("-")[0], this.setBrowserLocale = () => {
|
|
1408
1408
|
const t = this.getBrowserLocale();
|
|
1409
1409
|
this.translations[t] && this.setLocale(t);
|
|
1410
1410
|
}, this.updateRoot = (t) => {
|
|
1411
1411
|
this.updateElementsInRoot(t);
|
|
1412
1412
|
}, this.updateElements = () => {
|
|
1413
|
-
this.updateElementsInRoot(document),
|
|
1413
|
+
this.updateElementsInRoot(document), Vt().forEach((t, s) => {
|
|
1414
1414
|
document.querySelectorAll(s).forEach((i) => {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1415
|
+
const o = i.shadowRoot;
|
|
1416
|
+
o && this.updateElementsInRoot(o);
|
|
1417
1417
|
});
|
|
1418
1418
|
});
|
|
1419
|
-
}, this.has = (t) => !!(this.translations[this.locale]?.[t] || this.translations[this.fallbackLocale]?.[t]), this.getAvailableLocales = () => Object.keys(this.translations), this.getTranslations = (t) => this.translations[t ?? this.locale] ?? {}, this.getDefaultLocale = () =>
|
|
1419
|
+
}, this.has = (t) => !!(this.translations[this.locale]?.[t] || this.translations[this.fallbackLocale]?.[t]), this.getAvailableLocales = () => Object.keys(this.translations), this.getTranslations = (t) => this.translations[t ?? this.locale] ?? {}, this.getDefaultLocale = () => pt, this.getDefaultFallbackLocale = () => mt, this.getFrameworkTranslationKeys = () => {
|
|
1420
1420
|
const t = /* @__PURE__ */ new Set();
|
|
1421
|
-
for (const s of Object.values(
|
|
1421
|
+
for (const s of Object.values(ut))
|
|
1422
1422
|
for (const i of Object.keys(s))
|
|
1423
1423
|
t.add(i);
|
|
1424
1424
|
return Array.from(t);
|
|
1425
|
-
}, this.getFrameworkDefaults = (t) =>
|
|
1426
|
-
this.locale =
|
|
1425
|
+
}, this.getFrameworkDefaults = (t) => ut[t ?? this.locale] ?? {}, this.reset = () => {
|
|
1426
|
+
this.locale = pt, this.fallbackLocale = mt, this.translations = {}, this.frameworkDefaultsLoaded = !1, this.loadFrameworkDefaults();
|
|
1427
1427
|
}, this.loadFrameworkDefaults();
|
|
1428
1428
|
}
|
|
1429
1429
|
/**
|
|
@@ -1432,10 +1432,10 @@ class kt {
|
|
|
1432
1432
|
*/
|
|
1433
1433
|
loadFrameworkDefaults() {
|
|
1434
1434
|
if (!this.frameworkDefaultsLoaded) {
|
|
1435
|
-
for (const [t, s] of Object.entries(
|
|
1435
|
+
for (const [t, s] of Object.entries(ut)) {
|
|
1436
1436
|
this.translations[t] || (this.translations[t] = {});
|
|
1437
|
-
for (const [i,
|
|
1438
|
-
i in this.translations[t] || (this.translations[t][i] =
|
|
1437
|
+
for (const [i, o] of Object.entries(s))
|
|
1438
|
+
i in this.translations[t] || (this.translations[t][i] = o);
|
|
1439
1439
|
}
|
|
1440
1440
|
this.frameworkDefaultsLoaded = !0;
|
|
1441
1441
|
}
|
|
@@ -1452,12 +1452,12 @@ class kt {
|
|
|
1452
1452
|
const i = s.getAttribute("data-i18n-attr");
|
|
1453
1453
|
if (i)
|
|
1454
1454
|
try {
|
|
1455
|
-
const
|
|
1456
|
-
for (const [
|
|
1457
|
-
s.setAttribute(
|
|
1455
|
+
const o = JSON.parse(i);
|
|
1456
|
+
for (const [r, a] of Object.entries(o))
|
|
1457
|
+
s.setAttribute(r, this.t(a));
|
|
1458
1458
|
this.forceUpdateIfComponent(s);
|
|
1459
|
-
} catch (
|
|
1460
|
-
console.error("Error parsing data-i18n-attr:",
|
|
1459
|
+
} catch (o) {
|
|
1460
|
+
console.error("Error parsing data-i18n-attr:", o);
|
|
1461
1461
|
}
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
@@ -1469,11 +1469,11 @@ class kt {
|
|
|
1469
1469
|
"forceUpdate" in t && typeof t.forceUpdate == "function" && t.forceUpdate();
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
const
|
|
1473
|
-
typeof window < "u" && (window.i18n =
|
|
1474
|
-
class
|
|
1475
|
-
constructor(t, s, i,
|
|
1476
|
-
super(t), this.status = s, this.statusText = i, this.body =
|
|
1472
|
+
const w = new Ft();
|
|
1473
|
+
typeof window < "u" && (window.i18n = w);
|
|
1474
|
+
class J extends Error {
|
|
1475
|
+
constructor(t, s, i, o, r) {
|
|
1476
|
+
super(t), this.status = s, this.statusText = i, this.body = o, this.config = r, this.name = "HttpError";
|
|
1477
1477
|
}
|
|
1478
1478
|
get isClientError() {
|
|
1479
1479
|
return this.status >= 400 && this.status < 500;
|
|
@@ -1494,7 +1494,7 @@ class U extends Error {
|
|
|
1494
1494
|
return this.status === 408 || this.message.includes("timeout");
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
1497
|
-
class
|
|
1497
|
+
class qe {
|
|
1498
1498
|
constructor(t = {}) {
|
|
1499
1499
|
this.requestInterceptors = [], this.responseInterceptors = [], this.errorInterceptors = [], this.baseUrl = (t.baseUrl ?? "").replace(/\/+$/, ""), this.defaultTimeout = t.timeout ?? 1e4, this.defaultRetries = t.retries ?? 0, this.defaultRetryDelay = t.retryDelay ?? 1e3, this.defaultHeaders = {
|
|
1500
1500
|
"Content-Type": "application/json",
|
|
@@ -1537,10 +1537,10 @@ class Oe {
|
|
|
1537
1537
|
// --- Core request pipeline ---
|
|
1538
1538
|
async request(t) {
|
|
1539
1539
|
let s = this.mergeConfig(t);
|
|
1540
|
-
for (const
|
|
1541
|
-
s = await
|
|
1542
|
-
const i = s.retries ?? this.defaultRetries,
|
|
1543
|
-
return this.executeWithRetry(s, i,
|
|
1540
|
+
for (const r of this.requestInterceptors)
|
|
1541
|
+
s = await r(s);
|
|
1542
|
+
const i = s.retries ?? this.defaultRetries, o = s.retryDelay ?? this.defaultRetryDelay;
|
|
1543
|
+
return this.executeWithRetry(s, i, o);
|
|
1544
1544
|
}
|
|
1545
1545
|
// --- Internal ---
|
|
1546
1546
|
mergeConfig(t) {
|
|
@@ -1556,49 +1556,49 @@ class Oe {
|
|
|
1556
1556
|
resolveUrl(t, s) {
|
|
1557
1557
|
const i = t.startsWith("http") ? t : `${this.baseUrl}${t.startsWith("/") ? "" : "/"}${t}`;
|
|
1558
1558
|
if (!s || Object.keys(s).length === 0) return i;
|
|
1559
|
-
const
|
|
1560
|
-
return `${i}${
|
|
1559
|
+
const o = new URLSearchParams(s), r = i.includes("?") ? "&" : "?";
|
|
1560
|
+
return `${i}${r}${o.toString()}`;
|
|
1561
1561
|
}
|
|
1562
1562
|
async executeWithRetry(t, s, i) {
|
|
1563
1563
|
try {
|
|
1564
1564
|
return await this.executeFetch(t);
|
|
1565
|
-
} catch (
|
|
1566
|
-
if (
|
|
1565
|
+
} catch (o) {
|
|
1566
|
+
if (o instanceof J)
|
|
1567
1567
|
for (const a of this.errorInterceptors)
|
|
1568
1568
|
try {
|
|
1569
|
-
return await a(
|
|
1569
|
+
return await a(o);
|
|
1570
1570
|
} catch {
|
|
1571
1571
|
}
|
|
1572
|
-
if (s > 0 && this.isRetryable(
|
|
1572
|
+
if (s > 0 && this.isRetryable(o))
|
|
1573
1573
|
return await this.delay(i), this.executeWithRetry(t, s - 1, i * 2);
|
|
1574
|
-
throw
|
|
1574
|
+
throw o;
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
1577
|
async executeFetch(t) {
|
|
1578
|
-
const s = new AbortController(), i = setTimeout(() => s.abort(), t.timeout ?? this.defaultTimeout),
|
|
1578
|
+
const s = new AbortController(), i = setTimeout(() => s.abort(), t.timeout ?? this.defaultTimeout), o = {
|
|
1579
1579
|
method: t.method,
|
|
1580
1580
|
headers: t.headers,
|
|
1581
1581
|
signal: t.signal ?? s.signal
|
|
1582
1582
|
};
|
|
1583
|
-
t.body && t.method !== "GET" && (
|
|
1583
|
+
t.body && t.method !== "GET" && (o.body = typeof t.body == "string" ? t.body : JSON.stringify(t.body));
|
|
1584
1584
|
try {
|
|
1585
|
-
const
|
|
1586
|
-
if (!
|
|
1587
|
-
const l = await this.parseBody(
|
|
1588
|
-
throw new
|
|
1585
|
+
const r = await fetch(t.url, o);
|
|
1586
|
+
if (!r.ok) {
|
|
1587
|
+
const l = await this.parseBody(r);
|
|
1588
|
+
throw new J(`HTTP ${r.status}: ${r.statusText}`, r.status, r.statusText, l, t);
|
|
1589
1589
|
}
|
|
1590
1590
|
let c = {
|
|
1591
|
-
data: await this.parseBody(
|
|
1592
|
-
status:
|
|
1593
|
-
statusText:
|
|
1594
|
-
headers:
|
|
1591
|
+
data: await this.parseBody(r),
|
|
1592
|
+
status: r.status,
|
|
1593
|
+
statusText: r.statusText,
|
|
1594
|
+
headers: r.headers,
|
|
1595
1595
|
config: t
|
|
1596
1596
|
};
|
|
1597
1597
|
for (const l of this.responseInterceptors)
|
|
1598
1598
|
c = await l(c);
|
|
1599
1599
|
return c;
|
|
1600
|
-
} catch (
|
|
1601
|
-
throw
|
|
1600
|
+
} catch (r) {
|
|
1601
|
+
throw r instanceof J ? r : r instanceof DOMException && r.name === "AbortError" ? new J(`Request timeout after ${t.timeout}ms`, 408, "Request Timeout", null, t) : new J(`Network error: ${r.message}`, 0, "Network Error", null, t);
|
|
1602
1602
|
} finally {
|
|
1603
1603
|
clearTimeout(i);
|
|
1604
1604
|
}
|
|
@@ -1618,13 +1618,13 @@ class Oe {
|
|
|
1618
1618
|
}
|
|
1619
1619
|
}
|
|
1620
1620
|
isRetryable(t) {
|
|
1621
|
-
return t instanceof
|
|
1621
|
+
return t instanceof J ? t.isServerError || t.isTimeout || t.status === 429 : !0;
|
|
1622
1622
|
}
|
|
1623
1623
|
delay(t) {
|
|
1624
1624
|
return new Promise((s) => setTimeout(s, t));
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
|
-
const
|
|
1627
|
+
const It = (e, t = {}) => {
|
|
1628
1628
|
const s = e, i = e.getAttribute("float");
|
|
1629
1629
|
if (!i)
|
|
1630
1630
|
return e.classList.remove("float-top", "float-bottom", "float-left", "float-right"), e.style.position = "", e.style.top = "", e.style.bottom = "", e.style.left = "", e.style.right = "", e.style.transform = "", s._floatApplied = void 0, e;
|
|
@@ -1632,60 +1632,60 @@ const Pt = (e, t = {}) => {
|
|
|
1632
1632
|
return e;
|
|
1633
1633
|
s._floatApplied = i, t.horizontalPosition = t.horizontalPosition || e.getAttribute("left") || void 0, t.verticalPosition = t.verticalPosition || e.getAttribute("top") || void 0;
|
|
1634
1634
|
const {
|
|
1635
|
-
visibleRatio:
|
|
1636
|
-
offset:
|
|
1635
|
+
visibleRatio: o = 0.15,
|
|
1636
|
+
offset: r = 0,
|
|
1637
1637
|
transitionDuration: a = 0.4,
|
|
1638
1638
|
horizontalPosition: c,
|
|
1639
1639
|
verticalPosition: l
|
|
1640
|
-
} = t,
|
|
1641
|
-
return b ||
|
|
1642
|
-
const
|
|
1640
|
+
} = t, f = e.parentElement, b = f === document.body || f === document.documentElement;
|
|
1641
|
+
return b || jt(e), e.classList.add(`float-${i}`), e.style.position = b ? "fixed" : "absolute", e.style.zIndex = "1000", e.style.transition = "none", requestAnimationFrame(() => {
|
|
1642
|
+
const v = e.getBoundingClientRect(), m = 1 - o, M = i === "top" || i === "bottom" || i === "left" || i === "right" ? i : "top";
|
|
1643
1643
|
switch (i) {
|
|
1644
1644
|
case "top":
|
|
1645
|
-
e.style.top = `${-
|
|
1645
|
+
e.style.top = `${-v.height * m + r}px`, e.style.bottom = "", e.style.left = c || "50%", e.style.right = "", e.style.transform = c ? "" : "translateX(-50%)";
|
|
1646
1646
|
break;
|
|
1647
1647
|
case "bottom":
|
|
1648
|
-
e.style.top = "", e.style.bottom = `${-
|
|
1648
|
+
e.style.top = "", e.style.bottom = `${-v.height * m + r}px`, e.style.left = c || "50%", e.style.right = "", e.style.transform = c ? "" : "translateX(-50%)";
|
|
1649
1649
|
break;
|
|
1650
1650
|
case "left":
|
|
1651
|
-
e.style.left = `${-
|
|
1651
|
+
e.style.left = `${-v.width * m + r}px`, e.style.right = "", e.style.top = l || "50%", e.style.bottom = "", e.style.transform = l ? "" : "translateY(-50%)";
|
|
1652
1652
|
break;
|
|
1653
1653
|
case "right":
|
|
1654
|
-
e.style.left = "", e.style.right = `${-
|
|
1654
|
+
e.style.left = "", e.style.right = `${-v.width * m + r}px`, e.style.top = l || "50%", e.style.bottom = "", e.style.transform = l ? "" : "translateY(-50%)";
|
|
1655
1655
|
break;
|
|
1656
1656
|
}
|
|
1657
1657
|
requestAnimationFrame(() => {
|
|
1658
|
-
e.style.transition = `${
|
|
1659
|
-
}),
|
|
1658
|
+
e.style.transition = `${M} ${a}s ease`;
|
|
1659
|
+
}), Nt(
|
|
1660
1660
|
e,
|
|
1661
1661
|
i,
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1662
|
+
v,
|
|
1663
|
+
m,
|
|
1664
|
+
r,
|
|
1665
1665
|
a
|
|
1666
1666
|
);
|
|
1667
1667
|
}), e;
|
|
1668
|
-
},
|
|
1668
|
+
}, jt = (e) => {
|
|
1669
1669
|
const t = e.parentElement;
|
|
1670
1670
|
if (!t) return;
|
|
1671
1671
|
const s = window.getComputedStyle(t);
|
|
1672
1672
|
s.position === "static" && (t.style.position = "relative"), s.overflow === "visible" && (t.style.overflow = "hidden");
|
|
1673
|
-
},
|
|
1674
|
-
const i = { position: s, element: e },
|
|
1673
|
+
}, nt = (e, t, s) => {
|
|
1674
|
+
const i = { position: s, element: e }, o = new CustomEvent(t, {
|
|
1675
1675
|
detail: i,
|
|
1676
1676
|
bubbles: !0,
|
|
1677
1677
|
composed: !0
|
|
1678
|
-
}),
|
|
1679
|
-
if (
|
|
1678
|
+
}), r = e.getAttribute(t);
|
|
1679
|
+
if (r !== null)
|
|
1680
1680
|
try {
|
|
1681
|
-
new Function("event",
|
|
1681
|
+
new Function("event", r)(o);
|
|
1682
1682
|
} catch (a) {
|
|
1683
1683
|
console.error(`Error executing ${t} attribute:`, a);
|
|
1684
1684
|
}
|
|
1685
|
-
e.dispatchEvent(
|
|
1686
|
-
},
|
|
1687
|
-
const a =
|
|
1688
|
-
switch (
|
|
1685
|
+
e.dispatchEvent(o);
|
|
1686
|
+
}, Nt = (e, t, s, i, o, r) => {
|
|
1687
|
+
const a = Ut(t, s, i, o), c = o, l = e, f = () => {
|
|
1688
|
+
switch (nt(e, "zs3-float-show-start", t), l._floatIsShown = !0, t) {
|
|
1689
1689
|
case "top":
|
|
1690
1690
|
e.style.top = `${c}px`;
|
|
1691
1691
|
break;
|
|
@@ -1700,10 +1700,10 @@ const Pt = (e, t = {}) => {
|
|
|
1700
1700
|
break;
|
|
1701
1701
|
}
|
|
1702
1702
|
setTimeout(() => {
|
|
1703
|
-
l._floatIsShown &&
|
|
1704
|
-
},
|
|
1703
|
+
l._floatIsShown && nt(e, "zs3-float-show-end", t);
|
|
1704
|
+
}, r * 1e3);
|
|
1705
1705
|
}, b = () => {
|
|
1706
|
-
switch (
|
|
1706
|
+
switch (nt(e, "zs3-float-hide-start", t), l._floatIsShown = !1, t) {
|
|
1707
1707
|
case "top":
|
|
1708
1708
|
e.style.top = `${a}px`;
|
|
1709
1709
|
break;
|
|
@@ -1718,11 +1718,18 @@ const Pt = (e, t = {}) => {
|
|
|
1718
1718
|
break;
|
|
1719
1719
|
}
|
|
1720
1720
|
setTimeout(() => {
|
|
1721
|
-
l._floatIsShown ||
|
|
1722
|
-
},
|
|
1723
|
-
},
|
|
1724
|
-
|
|
1725
|
-
|
|
1721
|
+
l._floatIsShown || nt(e, "zs3-float-hide-end", t);
|
|
1722
|
+
}, r * 1e3);
|
|
1723
|
+
}, v = l._floatShowHandler, m = l._floatHideHandler, M = l._floatTouchHandler, B = l._floatDocTouchHandler;
|
|
1724
|
+
v && e.removeEventListener("mouseenter", v), m && e.removeEventListener("mouseleave", m), M && e.removeEventListener("touchstart", M), B && document.removeEventListener("touchstart", B), l._floatShowHandler = f, l._floatHideHandler = b, e.addEventListener("mouseenter", f), e.addEventListener("mouseleave", b);
|
|
1725
|
+
const $ = (F) => {
|
|
1726
|
+
const it = F.target;
|
|
1727
|
+
!e.contains(it) && l._floatIsShown && (b(), document.removeEventListener("touchstart", $), l._floatDocTouchHandler = void 0);
|
|
1728
|
+
}, V = (F) => {
|
|
1729
|
+
F.stopPropagation(), l._floatIsShown ? (b(), document.removeEventListener("touchstart", $), l._floatDocTouchHandler = void 0) : (f(), document.addEventListener("touchstart", $), l._floatDocTouchHandler = $);
|
|
1730
|
+
};
|
|
1731
|
+
l._floatTouchHandler = V, e.addEventListener("touchstart", V);
|
|
1732
|
+
}, Ut = (e, t, s, i) => {
|
|
1726
1733
|
switch (e) {
|
|
1727
1734
|
case "top":
|
|
1728
1735
|
case "bottom":
|
|
@@ -1731,88 +1738,100 @@ const Pt = (e, t = {}) => {
|
|
|
1731
1738
|
case "right":
|
|
1732
1739
|
return -t.width * s + i;
|
|
1733
1740
|
}
|
|
1734
|
-
},
|
|
1741
|
+
}, Q = (e, t, s) => {
|
|
1735
1742
|
const i = new CustomEvent(t, {
|
|
1736
1743
|
detail: s,
|
|
1737
1744
|
bubbles: !0,
|
|
1738
1745
|
composed: !0
|
|
1739
|
-
}),
|
|
1740
|
-
if (
|
|
1746
|
+
}), o = e.getAttribute(t);
|
|
1747
|
+
if (o !== null)
|
|
1741
1748
|
try {
|
|
1742
|
-
new Function("event",
|
|
1743
|
-
} catch (
|
|
1744
|
-
console.error(`Error executing ${t} attribute:`,
|
|
1749
|
+
new Function("event", o)(i);
|
|
1750
|
+
} catch (r) {
|
|
1751
|
+
console.error(`Error executing ${t} attribute:`, r);
|
|
1745
1752
|
}
|
|
1746
1753
|
e.dispatchEvent(i);
|
|
1747
|
-
},
|
|
1754
|
+
}, qt = (e) => {
|
|
1748
1755
|
const { container: t, dragHandle: s = t, direction: i = "xy" } = e;
|
|
1749
1756
|
if (!t)
|
|
1750
1757
|
return console.warn("move: container is required"), null;
|
|
1751
|
-
const
|
|
1752
|
-
if (!
|
|
1758
|
+
const o = t.parentElement;
|
|
1759
|
+
if (!o)
|
|
1753
1760
|
return console.warn("move: container must have a parent element"), null;
|
|
1754
|
-
window.getComputedStyle(
|
|
1755
|
-
let a = !1, c = 0, l = 0,
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
m = parseFloat(et.left) || 0, b = parseFloat(et.top) || 0, g = m, p = b, $.clear(), t.classList.add("zs3-dragging"), s.style.cursor = "grabbing", S.preventDefault(), J(t, "zs3-move-start", {
|
|
1761
|
+
window.getComputedStyle(o).position === "static" && (o.style.position = "relative"), t.style.position = "absolute", s.style.touchAction = "none";
|
|
1762
|
+
let a = !1, c = 0, l = 0, f = 0, b = 0, v = 0, m = 0, M = /* @__PURE__ */ new Set();
|
|
1763
|
+
const B = (h, ht) => {
|
|
1764
|
+
a = !0, c = h, l = ht;
|
|
1765
|
+
const at = window.getComputedStyle(t);
|
|
1766
|
+
f = parseFloat(at.left) || 0, b = parseFloat(at.top) || 0, v = f, m = b, M.clear(), t.classList.add("zs3-dragging"), s.style.cursor = "grabbing", Q(t, "zs3-move-start", {
|
|
1761
1767
|
direction: i,
|
|
1762
1768
|
element: t,
|
|
1763
|
-
startX:
|
|
1769
|
+
startX: f,
|
|
1764
1770
|
startY: b
|
|
1765
|
-
})
|
|
1766
|
-
},
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
$.has(ft) || J(t, "zs3-move-boundary", {
|
|
1771
|
+
});
|
|
1772
|
+
}, $ = (h, ht) => {
|
|
1773
|
+
const at = h - c, Ct = ht - l, zt = o.getBoundingClientRect(), yt = t.getBoundingClientRect();
|
|
1774
|
+
let I = f + at, j = b + Ct;
|
|
1775
|
+
const wt = zt.width - yt.width, xt = zt.height - yt.height, W = /* @__PURE__ */ new Set();
|
|
1776
|
+
I <= 0 && (I = 0, W.add("left")), I >= wt && (I = wt, W.add("right")), j <= 0 && (j = 0, W.add("top")), j >= xt && (j = xt, W.add("bottom")), W.forEach((Et) => {
|
|
1777
|
+
M.has(Et) || Q(t, "zs3-move-boundary", {
|
|
1773
1778
|
direction: i,
|
|
1774
1779
|
element: t,
|
|
1775
|
-
x:
|
|
1776
|
-
y:
|
|
1777
|
-
boundary:
|
|
1780
|
+
x: I,
|
|
1781
|
+
y: j,
|
|
1782
|
+
boundary: Et
|
|
1778
1783
|
});
|
|
1779
|
-
}),
|
|
1784
|
+
}), M = W, (i === "x" || i === "xy") && (t.style.left = `${I}px`, v = I), (i === "y" || i === "xy") && (t.style.top = `${j}px`, m = j), Q(t, "zs3-move", {
|
|
1780
1785
|
direction: i,
|
|
1781
1786
|
element: t,
|
|
1782
|
-
x:
|
|
1783
|
-
y:
|
|
1784
|
-
deltaX:
|
|
1785
|
-
deltaY:
|
|
1787
|
+
x: v,
|
|
1788
|
+
y: m,
|
|
1789
|
+
deltaX: v - f,
|
|
1790
|
+
deltaY: m - b
|
|
1786
1791
|
});
|
|
1787
|
-
},
|
|
1788
|
-
a
|
|
1792
|
+
}, V = () => {
|
|
1793
|
+
a = !1, t.classList.remove("zs3-dragging"), s.style.cursor = "grab", Q(t, "zs3-move-end", {
|
|
1789
1794
|
direction: i,
|
|
1790
1795
|
element: t,
|
|
1791
|
-
endX:
|
|
1792
|
-
endY:
|
|
1793
|
-
})
|
|
1794
|
-
},
|
|
1795
|
-
|
|
1796
|
+
endX: v,
|
|
1797
|
+
endY: m
|
|
1798
|
+
});
|
|
1799
|
+
}, F = () => {
|
|
1800
|
+
a = !1, t.classList.remove("zs3-dragging"), s.style.cursor = "grab", (i === "x" || i === "xy") && (t.style.left = `${f}px`), (i === "y" || i === "xy") && (t.style.top = `${b}px`), Q(t, "zs3-move-cancel", {
|
|
1796
1801
|
direction: i,
|
|
1797
1802
|
element: t
|
|
1798
|
-
})
|
|
1799
|
-
},
|
|
1800
|
-
|
|
1801
|
-
},
|
|
1803
|
+
});
|
|
1804
|
+
}, it = (h) => {
|
|
1805
|
+
h.button === 0 && (B(h.clientX, h.clientY), h.preventDefault(), document.addEventListener("mousemove", ot), document.addEventListener("mouseup", rt), document.addEventListener("keydown", Y));
|
|
1806
|
+
}, ot = (h) => {
|
|
1807
|
+
a && $(h.clientX, h.clientY);
|
|
1808
|
+
}, rt = () => {
|
|
1809
|
+
a && (V(), document.removeEventListener("mousemove", ot), document.removeEventListener("mouseup", rt), document.removeEventListener("keydown", Y));
|
|
1810
|
+
}, vt = (h) => {
|
|
1811
|
+
h.touches.length === 1 && (B(h.touches[0].clientX, h.touches[0].clientY), h.preventDefault(), document.addEventListener("touchmove", dt, { passive: !1 }), document.addEventListener("touchend", K), document.addEventListener("touchcancel", K), document.addEventListener("keydown", Y));
|
|
1812
|
+
}, dt = (h) => {
|
|
1813
|
+
!a || h.touches.length === 0 || (h.preventDefault(), $(h.touches[0].clientX, h.touches[0].clientY));
|
|
1814
|
+
}, K = () => {
|
|
1815
|
+
a && (V(), document.removeEventListener("touchmove", dt), document.removeEventListener("touchend", K), document.removeEventListener("touchcancel", K), document.removeEventListener("keydown", Y));
|
|
1816
|
+
}, Y = (h) => {
|
|
1817
|
+
h.key === "Escape" && a && (F(), document.removeEventListener("mousemove", ot), document.removeEventListener("mouseup", rt), document.removeEventListener("touchmove", dt), document.removeEventListener("touchend", K), document.removeEventListener("touchcancel", K), document.removeEventListener("keydown", Y));
|
|
1818
|
+
}, L = s;
|
|
1819
|
+
return L._moveMouseDownHandler && s.removeEventListener("mousedown", L._moveMouseDownHandler), L._moveTouchStartHandler && s.removeEventListener("touchstart", L._moveTouchStartHandler), L._moveMouseDownHandler = it, L._moveTouchStartHandler = vt, L._moveMouseMoveHandler = ot, L._moveMouseUpHandler = rt, L._moveKeyDownHandler = Y, L._moveEnabled = !0, L._moveDirection = i, L._moveComponent = t, s.addEventListener("mousedown", it), s.addEventListener("touchstart", vt, { passive: !1 }), s.style.cursor = "grab", t;
|
|
1820
|
+
}, Kt = (e) => {
|
|
1802
1821
|
const t = e;
|
|
1803
|
-
t._moveMouseDownHandler && (e.removeEventListener("mousedown", t._moveMouseDownHandler), t._moveMouseDownHandler = void 0), t._moveMouseMoveHandler = void 0, t._moveMouseUpHandler = void 0, t._moveKeyDownHandler = void 0, t._moveEnabled = !1, t._moveDirection = void 0, t._moveComponent = void 0, e.style.cursor = "";
|
|
1804
|
-
},
|
|
1822
|
+
t._moveMouseDownHandler && (e.removeEventListener("mousedown", t._moveMouseDownHandler), t._moveMouseDownHandler = void 0), t._moveTouchStartHandler && (e.removeEventListener("touchstart", t._moveTouchStartHandler), t._moveTouchStartHandler = void 0), t._moveMouseMoveHandler = void 0, t._moveMouseUpHandler = void 0, t._moveKeyDownHandler = void 0, t._moveEnabled = !1, t._moveDirection = void 0, t._moveComponent = void 0, e.style.cursor = "", e.style.touchAction = "";
|
|
1823
|
+
}, Ke = (e) => e._moveEnabled === !0, Ye = (e) => e._moveDirection, We = (e) => {
|
|
1805
1824
|
const { name: t, htmlElement: s } = e;
|
|
1806
1825
|
let { detail: i } = e;
|
|
1807
1826
|
i = i ?? {}, i.htmlElement = s ?? void 0;
|
|
1808
|
-
const
|
|
1827
|
+
const o = new CustomEvent(t, {
|
|
1809
1828
|
detail: i,
|
|
1810
1829
|
bubbles: !0,
|
|
1811
1830
|
composed: !0
|
|
1812
|
-
}),
|
|
1813
|
-
|
|
1831
|
+
}), r = s?.getAttribute(t);
|
|
1832
|
+
r !== null && new Function("event", r)(o), s?.dispatchEvent(o);
|
|
1814
1833
|
};
|
|
1815
|
-
class
|
|
1834
|
+
class P extends HTMLElement {
|
|
1816
1835
|
/**
|
|
1817
1836
|
* Initializes the base component
|
|
1818
1837
|
* @param options - Configuration options for the component
|
|
@@ -1831,7 +1850,7 @@ class k extends HTMLElement {
|
|
|
1831
1850
|
slotAssignment: this._options.slotAssignment,
|
|
1832
1851
|
clonable: this._options.clonable,
|
|
1833
1852
|
serializable: this._options.serializable
|
|
1834
|
-
})), this.initialize(), this.emitLifecycleEvent("zs3-built", { phase: "complete" }), this.$ = (s) =>
|
|
1853
|
+
})), this.initialize(), this.emitLifecycleEvent("zs3-built", { phase: "complete" }), this.$ = (s) => N(s, this.shadowRoot ?? this._container ?? void 0), this.$$ = (s) => N(s, this.shadowRoot ?? this._container ?? void 0).$$;
|
|
1835
1854
|
}
|
|
1836
1855
|
/**
|
|
1837
1856
|
* Initialize component (called in constructor)
|
|
@@ -1845,22 +1864,6 @@ class k extends HTMLElement {
|
|
|
1845
1864
|
get root() {
|
|
1846
1865
|
return this._shadowRoot ?? this;
|
|
1847
1866
|
}
|
|
1848
|
-
/**
|
|
1849
|
-
* Query selector within the component's root
|
|
1850
|
-
* @param selector - CSS selector to query
|
|
1851
|
-
* @returns Found element or null
|
|
1852
|
-
*/
|
|
1853
|
-
qs(t) {
|
|
1854
|
-
return this.root.querySelector(t);
|
|
1855
|
-
}
|
|
1856
|
-
/**
|
|
1857
|
-
* Query all matching elements within the component's root
|
|
1858
|
-
* @param selector - CSS selector to query
|
|
1859
|
-
* @returns NodeList of found elements
|
|
1860
|
-
*/
|
|
1861
|
-
qsAll(t) {
|
|
1862
|
-
return this.root.querySelectorAll(t);
|
|
1863
|
-
}
|
|
1864
1867
|
/**
|
|
1865
1868
|
* Register an attribute change handler
|
|
1866
1869
|
* @param attributeName - Name of the attribute to observe
|
|
@@ -1876,9 +1879,9 @@ class k extends HTMLElement {
|
|
|
1876
1879
|
* @param handler - Event handler
|
|
1877
1880
|
* @param options - Event listener options
|
|
1878
1881
|
*/
|
|
1879
|
-
addManagedEventListener(t, s, i,
|
|
1880
|
-
t.addEventListener(s, i,
|
|
1881
|
-
t.removeEventListener(s, i,
|
|
1882
|
+
addManagedEventListener(t, s, i, o) {
|
|
1883
|
+
t.addEventListener(s, i, o), this._cleanupFunctions.push(() => {
|
|
1884
|
+
t.removeEventListener(s, i, o);
|
|
1882
1885
|
});
|
|
1883
1886
|
}
|
|
1884
1887
|
/**
|
|
@@ -1889,19 +1892,19 @@ class k extends HTMLElement {
|
|
|
1889
1892
|
*/
|
|
1890
1893
|
emit(t, s, i) {
|
|
1891
1894
|
const {
|
|
1892
|
-
skipDisabledCheck:
|
|
1893
|
-
cancelable:
|
|
1895
|
+
skipDisabledCheck: o = !1,
|
|
1896
|
+
cancelable: r = !0,
|
|
1894
1897
|
bubbles: a = !0,
|
|
1895
1898
|
composed: c = !0
|
|
1896
1899
|
} = i ?? {};
|
|
1897
|
-
if (!
|
|
1900
|
+
if (!o && (this.getBooleanAttribute("disabled") || this.getBooleanAttribute("loading")))
|
|
1898
1901
|
return !1;
|
|
1899
1902
|
const l = new CustomEvent(t, {
|
|
1900
1903
|
bubbles: a,
|
|
1901
1904
|
composed: c,
|
|
1902
|
-
cancelable:
|
|
1905
|
+
cancelable: r,
|
|
1903
1906
|
detail: s
|
|
1904
|
-
}),
|
|
1907
|
+
}), f = this.dispatchEvent(l), b = this.getAttribute(t);
|
|
1905
1908
|
return b && new Function(
|
|
1906
1909
|
"event",
|
|
1907
1910
|
"detail",
|
|
@@ -1909,7 +1912,7 @@ class k extends HTMLElement {
|
|
|
1909
1912
|
"log",
|
|
1910
1913
|
"window",
|
|
1911
1914
|
b
|
|
1912
|
-
).call(this, l, s,
|
|
1915
|
+
).call(this, l, s, N, ft, window), f;
|
|
1913
1916
|
}
|
|
1914
1917
|
/**
|
|
1915
1918
|
* Emit lifecycle event (internal use)
|
|
@@ -1942,8 +1945,8 @@ class k extends HTMLElement {
|
|
|
1942
1945
|
getNumberAttribute(t, s = 0) {
|
|
1943
1946
|
const i = this.getAttribute(t);
|
|
1944
1947
|
if (!i) return s;
|
|
1945
|
-
const
|
|
1946
|
-
return isNaN(
|
|
1948
|
+
const o = parseFloat(i);
|
|
1949
|
+
return isNaN(o) ? s : o;
|
|
1947
1950
|
}
|
|
1948
1951
|
/**
|
|
1949
1952
|
* Get attribute as array (comma-separated)
|
|
@@ -1952,7 +1955,7 @@ class k extends HTMLElement {
|
|
|
1952
1955
|
*/
|
|
1953
1956
|
getArrayAttribute(t, s = []) {
|
|
1954
1957
|
const i = this.getAttribute(t);
|
|
1955
|
-
return i ? i.split(",").map((
|
|
1958
|
+
return i ? i.split(",").map((o) => o.trim()).filter(Boolean) : s;
|
|
1956
1959
|
}
|
|
1957
1960
|
/**
|
|
1958
1961
|
* Set boolean attribute
|
|
@@ -1969,7 +1972,7 @@ class k extends HTMLElement {
|
|
|
1969
1972
|
*/
|
|
1970
1973
|
applyFloatEffect() {
|
|
1971
1974
|
if (!this._mounted || !this._floatTargetSelector) return;
|
|
1972
|
-
this.getAttribute("float") &&
|
|
1975
|
+
this.getAttribute("float") && It(this);
|
|
1973
1976
|
}
|
|
1974
1977
|
/**
|
|
1975
1978
|
* Aplica l'efecte move (drag & drop) al component si està configurat.
|
|
@@ -1982,10 +1985,10 @@ class k extends HTMLElement {
|
|
|
1982
1985
|
*/
|
|
1983
1986
|
applyMoveEffect() {
|
|
1984
1987
|
if (!this._mounted || !this._moveContainerSelector) return;
|
|
1985
|
-
const t = this.getAttribute("move"), s = this._moveContainerSelector === ":host" ? this : this
|
|
1988
|
+
const t = this.getAttribute("move"), s = this._moveContainerSelector === ":host" ? this : this.$(this._moveContainerSelector).$;
|
|
1986
1989
|
if (!s) return;
|
|
1987
1990
|
let i;
|
|
1988
|
-
this._moveDragSelector ? i = this._moveDragSelector === ":host" ? this : this
|
|
1991
|
+
this._moveDragSelector ? i = this._moveDragSelector === ":host" ? this : this.$(this._moveDragSelector).$ : i = s, i && (t && ["x", "y", "xy"].includes(t) ? qt({ container: s, dragHandle: i, direction: t }) : Kt(i));
|
|
1989
1992
|
}
|
|
1990
1993
|
/**
|
|
1991
1994
|
* Request an animation frame update
|
|
@@ -2005,8 +2008,8 @@ class k extends HTMLElement {
|
|
|
2005
2008
|
*/
|
|
2006
2009
|
debounce(t, s) {
|
|
2007
2010
|
let i;
|
|
2008
|
-
return (...
|
|
2009
|
-
clearTimeout(i), i = window.setTimeout(() => t(...
|
|
2011
|
+
return (...o) => {
|
|
2012
|
+
clearTimeout(i), i = window.setTimeout(() => t(...o), s);
|
|
2010
2013
|
};
|
|
2011
2014
|
}
|
|
2012
2015
|
/**
|
|
@@ -2054,8 +2057,8 @@ class k extends HTMLElement {
|
|
|
2054
2057
|
newValue: i,
|
|
2055
2058
|
phase: "start"
|
|
2056
2059
|
});
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2060
|
+
const o = this._attributeHandlers.get(t);
|
|
2061
|
+
o && o(t, s, i), this.onAttributeChanged(t, s, i), this._mounted && (this.render(), this.applyFloatEffect(), this.applyMoveEffect()), this.emitLifecycleEvent("zs3-modified", {
|
|
2059
2062
|
name: t,
|
|
2060
2063
|
oldValue: s,
|
|
2061
2064
|
newValue: i,
|
|
@@ -2092,7 +2095,7 @@ class k extends HTMLElement {
|
|
|
2092
2095
|
*/
|
|
2093
2096
|
handleThemeChange(t) {
|
|
2094
2097
|
const s = t;
|
|
2095
|
-
this.onThemeChange(s.detail.theme)
|
|
2098
|
+
this.onThemeChange(s.detail.theme);
|
|
2096
2099
|
}
|
|
2097
2100
|
/**
|
|
2098
2101
|
* Hook called when theme changes
|
|
@@ -2123,7 +2126,7 @@ class k extends HTMLElement {
|
|
|
2123
2126
|
* @returns Translated string or key if not found
|
|
2124
2127
|
*/
|
|
2125
2128
|
t(t, s) {
|
|
2126
|
-
return
|
|
2129
|
+
return w.t(t, s);
|
|
2127
2130
|
}
|
|
2128
2131
|
/**
|
|
2129
2132
|
* Check if a translation exists
|
|
@@ -2131,7 +2134,7 @@ class k extends HTMLElement {
|
|
|
2131
2134
|
* @returns True if translation exists
|
|
2132
2135
|
*/
|
|
2133
2136
|
hasTranslation(t) {
|
|
2134
|
-
return
|
|
2137
|
+
return w.has(t);
|
|
2135
2138
|
}
|
|
2136
2139
|
/**
|
|
2137
2140
|
* Get translated attribute value
|
|
@@ -2194,14 +2197,14 @@ class k extends HTMLElement {
|
|
|
2194
2197
|
this.render(), this.applyFloatEffect(), this.applyMoveEffect();
|
|
2195
2198
|
}
|
|
2196
2199
|
}
|
|
2197
|
-
function
|
|
2200
|
+
function T(e, t = {}) {
|
|
2198
2201
|
const { inherit: s = !1 } = t;
|
|
2199
2202
|
return function(i) {
|
|
2200
2203
|
return Object.defineProperty(i, "observedAttributes", {
|
|
2201
2204
|
get() {
|
|
2202
2205
|
if (s) {
|
|
2203
|
-
const
|
|
2204
|
-
return [.../* @__PURE__ */ new Set([...
|
|
2206
|
+
const r = Object.getPrototypeOf(this)?.observedAttributes || [];
|
|
2207
|
+
return [.../* @__PURE__ */ new Set([...r, ...e])];
|
|
2205
2208
|
}
|
|
2206
2209
|
return e;
|
|
2207
2210
|
},
|
|
@@ -2209,7 +2212,7 @@ function E(e, t = {}) {
|
|
|
2209
2212
|
}), i;
|
|
2210
2213
|
};
|
|
2211
2214
|
}
|
|
2212
|
-
function
|
|
2215
|
+
function Mt(e) {
|
|
2213
2216
|
return function(t) {
|
|
2214
2217
|
const s = t.prototype.initialize;
|
|
2215
2218
|
return t.prototype.initialize = function() {
|
|
@@ -2217,7 +2220,7 @@ function vt(e) {
|
|
|
2217
2220
|
}, t;
|
|
2218
2221
|
};
|
|
2219
2222
|
}
|
|
2220
|
-
function
|
|
2223
|
+
function Yt(e, t) {
|
|
2221
2224
|
return function(s) {
|
|
2222
2225
|
const i = s.prototype.initialize;
|
|
2223
2226
|
return s.prototype.initialize = function() {
|
|
@@ -2227,21 +2230,21 @@ function Ft(e, t) {
|
|
|
2227
2230
|
}
|
|
2228
2231
|
function n(e, t) {
|
|
2229
2232
|
return function(s, i) {
|
|
2230
|
-
const
|
|
2231
|
-
Object.defineProperty(s,
|
|
2233
|
+
const o = typeof i == "string" ? i : i.toString(), r = Wt(e, t);
|
|
2234
|
+
Object.defineProperty(s, o, r);
|
|
2232
2235
|
};
|
|
2233
2236
|
}
|
|
2234
|
-
function
|
|
2237
|
+
function Wt(e, t) {
|
|
2235
2238
|
switch (t.type) {
|
|
2236
2239
|
case "string":
|
|
2237
|
-
return
|
|
2240
|
+
return Jt(e, t.default);
|
|
2238
2241
|
case "boolean":
|
|
2239
|
-
return
|
|
2242
|
+
return Xt(e, t.default ?? !1);
|
|
2240
2243
|
case "number":
|
|
2241
|
-
return
|
|
2244
|
+
return Gt(e, t.default ?? 0);
|
|
2242
2245
|
}
|
|
2243
2246
|
}
|
|
2244
|
-
function
|
|
2247
|
+
function Jt(e, t) {
|
|
2245
2248
|
return t !== void 0 ? {
|
|
2246
2249
|
get() {
|
|
2247
2250
|
return this.getAttribute(e) || t;
|
|
@@ -2262,7 +2265,7 @@ function It(e, t) {
|
|
|
2262
2265
|
configurable: !0
|
|
2263
2266
|
};
|
|
2264
2267
|
}
|
|
2265
|
-
function
|
|
2268
|
+
function Xt(e, t) {
|
|
2266
2269
|
return {
|
|
2267
2270
|
get() {
|
|
2268
2271
|
return this.getBooleanAttribute(e, t);
|
|
@@ -2274,7 +2277,7 @@ function qt(e, t) {
|
|
|
2274
2277
|
configurable: !0
|
|
2275
2278
|
};
|
|
2276
2279
|
}
|
|
2277
|
-
function
|
|
2280
|
+
function Gt(e, t) {
|
|
2278
2281
|
return {
|
|
2279
2282
|
get() {
|
|
2280
2283
|
return this.getNumberAttribute(e, t);
|
|
@@ -2286,12 +2289,12 @@ function jt(e, t) {
|
|
|
2286
2289
|
configurable: !0
|
|
2287
2290
|
};
|
|
2288
2291
|
}
|
|
2289
|
-
var
|
|
2290
|
-
for (var
|
|
2291
|
-
(a = e[
|
|
2292
|
-
return i &&
|
|
2292
|
+
var Qt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, U = (e, t, s, i) => {
|
|
2293
|
+
for (var o = i > 1 ? void 0 : i ? Zt(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
2294
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
2295
|
+
return i && o && Qt(t, s, o), o;
|
|
2293
2296
|
};
|
|
2294
|
-
const
|
|
2297
|
+
const te = [
|
|
2295
2298
|
"name",
|
|
2296
2299
|
"size",
|
|
2297
2300
|
"color",
|
|
@@ -2301,7 +2304,7 @@ const Kt = [
|
|
|
2301
2304
|
"clickable",
|
|
2302
2305
|
"i18n-aria-label"
|
|
2303
2306
|
];
|
|
2304
|
-
let
|
|
2307
|
+
let y = class extends P {
|
|
2305
2308
|
/**
|
|
2306
2309
|
* Initializes the icon component
|
|
2307
2310
|
*/
|
|
@@ -2331,13 +2334,13 @@ let z = class extends k {
|
|
|
2331
2334
|
* Setup event listeners after mount
|
|
2332
2335
|
*/
|
|
2333
2336
|
afterMount() {
|
|
2334
|
-
this.setupEventListeners(), this._shadowRoot &&
|
|
2337
|
+
this.setupEventListeners(), this._shadowRoot && w.updateRoot(this._shadowRoot);
|
|
2335
2338
|
}
|
|
2336
2339
|
/**
|
|
2337
2340
|
* Setup event listeners with automatic cleanup
|
|
2338
2341
|
*/
|
|
2339
2342
|
setupEventListeners() {
|
|
2340
|
-
const e = this
|
|
2343
|
+
const e = this.$(".icon-container").$;
|
|
2341
2344
|
e && this.clickable && this.addManagedEventListener(e, "click", (t) => {
|
|
2342
2345
|
this.emit("zs3-icon-click", {
|
|
2343
2346
|
icon: this,
|
|
@@ -2368,7 +2371,7 @@ let z = class extends k {
|
|
|
2368
2371
|
*/
|
|
2369
2372
|
getIconPath() {
|
|
2370
2373
|
const e = this.name?.toLowerCase() || "warning";
|
|
2371
|
-
return
|
|
2374
|
+
return y._iconPaths[e] || y._iconPaths.warning;
|
|
2372
2375
|
}
|
|
2373
2376
|
/**
|
|
2374
2377
|
* Get transformation string for SVG
|
|
@@ -2382,10 +2385,10 @@ let z = class extends k {
|
|
|
2382
2385
|
*/
|
|
2383
2386
|
render() {
|
|
2384
2387
|
if (!this.root) return;
|
|
2385
|
-
const e = this.getIconPath(), t = this.getTransform(), s = this.name === "dark" || this.name === "sun" ? "currentColor" : "none", i = this.getAttribute("i18n-aria-label"),
|
|
2388
|
+
const e = this.getIconPath(), t = this.getTransform(), s = this.name === "dark" || this.name === "sun" ? "currentColor" : "none", i = this.getAttribute("i18n-aria-label"), o = i ? `data-i18n-attr='{"aria-label":"${i}"}'` : `aria-label="${this.getAttribute("aria-label") || this.name || "icon"}"`;
|
|
2386
2389
|
this.setHTML(`
|
|
2387
2390
|
${this.getStyles()}
|
|
2388
|
-
<span class="icon-container" role="img" ${
|
|
2391
|
+
<span class="icon-container" role="img" ${o}>
|
|
2389
2392
|
<svg
|
|
2390
2393
|
xmlns="http://www.w3.org/2000/svg"
|
|
2391
2394
|
width="${this._size}"
|
|
@@ -2484,7 +2487,7 @@ let z = class extends k {
|
|
|
2484
2487
|
* @param path - SVG path data
|
|
2485
2488
|
*/
|
|
2486
2489
|
static addIcon(e, t) {
|
|
2487
|
-
|
|
2490
|
+
y._iconPaths[e] = t;
|
|
2488
2491
|
}
|
|
2489
2492
|
/**
|
|
2490
2493
|
* Public API: Add multiple custom icons
|
|
@@ -2492,14 +2495,14 @@ let z = class extends k {
|
|
|
2492
2495
|
*/
|
|
2493
2496
|
static addIcons(e) {
|
|
2494
2497
|
Object.entries(e).forEach(([t, s]) => {
|
|
2495
|
-
|
|
2498
|
+
y.addIcon(t, s);
|
|
2496
2499
|
});
|
|
2497
2500
|
}
|
|
2498
2501
|
/**
|
|
2499
2502
|
* Public API: Get list of available icons
|
|
2500
2503
|
*/
|
|
2501
2504
|
static getAvailableIcons() {
|
|
2502
|
-
return Object.keys(
|
|
2505
|
+
return Object.keys(y._iconPaths);
|
|
2503
2506
|
}
|
|
2504
2507
|
// size es manté manual: parseja 'small'|'medium'|'large'|number
|
|
2505
2508
|
get size() {
|
|
@@ -2519,7 +2522,7 @@ let z = class extends k {
|
|
|
2519
2522
|
this.setAttribute("stroke-width", String(e));
|
|
2520
2523
|
}
|
|
2521
2524
|
};
|
|
2522
|
-
|
|
2525
|
+
y._iconPaths = {
|
|
2523
2526
|
increase: "<path stroke='none' d='M0 0h24v24H0z' fill='none'/><path d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0' /><path d='M9 12h6' /><path d='M12 9v6' />",
|
|
2524
2527
|
decrease: "<path stroke='none' d='M0 0h24v24H0z' fill='none'/><path d='M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /><path d='M9 12l6 0' />",
|
|
2525
2528
|
error: "<path stroke='none' d='M0 0h24v24H0z' fill='none'/><path d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0' /><path d='M12 8v4' /><path d='M12 16h.01' />",
|
|
@@ -2568,36 +2571,36 @@ z._iconPaths = {
|
|
|
2568
2571
|
check: '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" />',
|
|
2569
2572
|
x: '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" />'
|
|
2570
2573
|
};
|
|
2571
|
-
|
|
2574
|
+
U([
|
|
2572
2575
|
n("name", { type: "string" })
|
|
2573
|
-
],
|
|
2574
|
-
|
|
2576
|
+
], y.prototype, "name", 2);
|
|
2577
|
+
U([
|
|
2575
2578
|
n("color", { type: "string" })
|
|
2576
|
-
],
|
|
2577
|
-
|
|
2579
|
+
], y.prototype, "color", 2);
|
|
2580
|
+
U([
|
|
2578
2581
|
n("rotate", { type: "number", default: 0 })
|
|
2579
|
-
],
|
|
2580
|
-
|
|
2582
|
+
], y.prototype, "rotate", 2);
|
|
2583
|
+
U([
|
|
2581
2584
|
n("flip", { type: "string" })
|
|
2582
|
-
],
|
|
2583
|
-
|
|
2585
|
+
], y.prototype, "flip", 2);
|
|
2586
|
+
U([
|
|
2584
2587
|
n("clickable", { type: "boolean" })
|
|
2585
|
-
],
|
|
2586
|
-
|
|
2588
|
+
], y.prototype, "clickable", 2);
|
|
2589
|
+
U([
|
|
2587
2590
|
n("i18n-aria-label", { type: "string" })
|
|
2588
|
-
],
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
],
|
|
2593
|
-
customElements.get("zs3-icon") || customElements.define("zs3-icon",
|
|
2594
|
-
typeof window < "u" && (window.$Icon =
|
|
2595
|
-
var
|
|
2596
|
-
for (var
|
|
2597
|
-
(a = e[
|
|
2598
|
-
return i &&
|
|
2591
|
+
], y.prototype, "i18nAriaLabel", 2);
|
|
2592
|
+
y = U([
|
|
2593
|
+
E("zs3-icon"),
|
|
2594
|
+
T(te)
|
|
2595
|
+
], y);
|
|
2596
|
+
customElements.get("zs3-icon") || customElements.define("zs3-icon", y);
|
|
2597
|
+
typeof window < "u" && (window.$Icon = y);
|
|
2598
|
+
var ee = Object.defineProperty, se = Object.getOwnPropertyDescriptor, D = (e, t, s, i) => {
|
|
2599
|
+
for (var o = i > 1 ? void 0 : i ? se(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
2600
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
2601
|
+
return i && o && ee(t, s, o), o;
|
|
2599
2602
|
};
|
|
2600
|
-
const
|
|
2603
|
+
const ie = [
|
|
2601
2604
|
"icon",
|
|
2602
2605
|
"icon-size",
|
|
2603
2606
|
"position",
|
|
@@ -2614,7 +2617,7 @@ const Jt = [
|
|
|
2614
2617
|
"zs3-float-hide-start",
|
|
2615
2618
|
"zs3-float-hide-end"
|
|
2616
2619
|
];
|
|
2617
|
-
let
|
|
2620
|
+
let g = class extends P {
|
|
2618
2621
|
/**
|
|
2619
2622
|
* Initializes the button component
|
|
2620
2623
|
*/
|
|
@@ -2652,7 +2655,7 @@ let f = class extends k {
|
|
|
2652
2655
|
* Called after component mounts
|
|
2653
2656
|
*/
|
|
2654
2657
|
afterMount() {
|
|
2655
|
-
this.setupEventListeners(), this._shadowRoot &&
|
|
2658
|
+
this.setupEventListeners(), this._shadowRoot && w.updateRoot(this._shadowRoot);
|
|
2656
2659
|
}
|
|
2657
2660
|
/**
|
|
2658
2661
|
* Called before component unmounts
|
|
@@ -2664,14 +2667,14 @@ let f = class extends k {
|
|
|
2664
2667
|
* Setup event listeners with automatic cleanup
|
|
2665
2668
|
*/
|
|
2666
2669
|
setupEventListeners() {
|
|
2667
|
-
const e = this
|
|
2670
|
+
const e = this.$("button").$;
|
|
2668
2671
|
e && (this._buttonElement = e, this.addManagedEventListener(e, "click", (s) => {
|
|
2669
2672
|
s.stopPropagation(), s.preventDefault(), this.emit("zs3-click", {
|
|
2670
2673
|
button: this,
|
|
2671
2674
|
originalEvent: s
|
|
2672
2675
|
});
|
|
2673
2676
|
}));
|
|
2674
|
-
const t = this
|
|
2677
|
+
const t = this.$(".icon-container").$;
|
|
2675
2678
|
t && this.addManagedEventListener(t, "click", (s) => {
|
|
2676
2679
|
this.emit("zs3-icon-click", {
|
|
2677
2680
|
button: this,
|
|
@@ -2695,19 +2698,19 @@ let f = class extends k {
|
|
|
2695
2698
|
* Update button content (text and icon)
|
|
2696
2699
|
*/
|
|
2697
2700
|
updateButtonContent() {
|
|
2698
|
-
const e = this
|
|
2701
|
+
const e = this.$("button").$;
|
|
2699
2702
|
if (!e) return;
|
|
2700
2703
|
const t = this.textContent?.trim() || this._textContent, s = this.getIconHTML(), i = this.position;
|
|
2701
2704
|
e.setAttribute("aria-label", this.getAttribute("aria-label") || t || "Button");
|
|
2702
|
-
const
|
|
2703
|
-
let
|
|
2704
|
-
this.loading ?
|
|
2705
|
+
const o = t ? `<span class="button-text">${t}</span>` : "";
|
|
2706
|
+
let r = "";
|
|
2707
|
+
this.loading ? r = this.getLoadingHTML() + o : i === "left" && s ? r = s + o : r = o + s, e.innerHTML = r, e.disabled = this.disabled || this.loading;
|
|
2705
2708
|
}
|
|
2706
2709
|
/**
|
|
2707
2710
|
* Update button CSS classes
|
|
2708
2711
|
*/
|
|
2709
2712
|
updateButtonClasses() {
|
|
2710
|
-
const e = this
|
|
2713
|
+
const e = this.$("button").$;
|
|
2711
2714
|
e && (e.className = "", this.variant && e.classList.add(`btn-${this.variant}`), this.size && e.classList.add(`btn-${this.size}`), this.rounded && e.classList.add("rounded"), this.loading && e.classList.add("loading"), this.disabled && e.classList.add("disabled"));
|
|
2712
2715
|
}
|
|
2713
2716
|
/**
|
|
@@ -2772,11 +2775,13 @@ let f = class extends k {
|
|
|
2772
2775
|
outline: none;
|
|
2773
2776
|
}
|
|
2774
2777
|
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2778
|
+
@media (hover: hover) {
|
|
2779
|
+
button:hover:not(:disabled):not(.loading) {
|
|
2780
|
+
background-color: var(--zs3-fg-color, #111827);
|
|
2781
|
+
color: var(--zs3-bg-color, #ffffff);
|
|
2782
|
+
border-color: var(--zs3-border-color, #d1d5db);
|
|
2783
|
+
box-shadow: var(--zs3-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
|
|
2784
|
+
}
|
|
2780
2785
|
}
|
|
2781
2786
|
|
|
2782
2787
|
button:active:not(:disabled):not(.loading) {
|
|
@@ -2802,9 +2807,11 @@ let f = class extends k {
|
|
|
2802
2807
|
border-color: var(--zs3-primary-color, #3b82f6);
|
|
2803
2808
|
}
|
|
2804
2809
|
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2810
|
+
@media (hover: hover) {
|
|
2811
|
+
button.btn-primary:hover:not(:disabled):not(.loading) {
|
|
2812
|
+
background-color: var(--zs3-primary-hover-color, #2563eb);
|
|
2813
|
+
border-color: var(--zs3-primary-hover-color, #2563eb);
|
|
2814
|
+
}
|
|
2808
2815
|
}
|
|
2809
2816
|
|
|
2810
2817
|
button.btn-secondary {
|
|
@@ -2813,9 +2820,11 @@ let f = class extends k {
|
|
|
2813
2820
|
border-color: var(--zs3-secondary-color, #8b5cf6);
|
|
2814
2821
|
}
|
|
2815
2822
|
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2823
|
+
@media (hover: hover) {
|
|
2824
|
+
button.btn-secondary:hover:not(:disabled):not(.loading) {
|
|
2825
|
+
background-color: var(--zs3-secondary-hover-color, #7c3aed);
|
|
2826
|
+
border-color: var(--zs3-secondary-hover-color, #7c3aed);
|
|
2827
|
+
}
|
|
2819
2828
|
}
|
|
2820
2829
|
|
|
2821
2830
|
button.btn-success {
|
|
@@ -2824,8 +2833,10 @@ let f = class extends k {
|
|
|
2824
2833
|
border-color: var(--zs3-success-color, #10b981);
|
|
2825
2834
|
}
|
|
2826
2835
|
|
|
2827
|
-
|
|
2828
|
-
|
|
2836
|
+
@media (hover: hover) {
|
|
2837
|
+
button.btn-success:hover:not(:disabled):not(.loading) {
|
|
2838
|
+
filter: brightness(0.9);
|
|
2839
|
+
}
|
|
2829
2840
|
}
|
|
2830
2841
|
|
|
2831
2842
|
button.btn-danger {
|
|
@@ -2834,8 +2845,10 @@ let f = class extends k {
|
|
|
2834
2845
|
border-color: var(--zs3-error-color, #ef4444);
|
|
2835
2846
|
}
|
|
2836
2847
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2848
|
+
@media (hover: hover) {
|
|
2849
|
+
button.btn-danger:hover:not(:disabled):not(.loading) {
|
|
2850
|
+
filter: brightness(0.9);
|
|
2851
|
+
}
|
|
2839
2852
|
}
|
|
2840
2853
|
|
|
2841
2854
|
button.btn-warning {
|
|
@@ -2844,8 +2857,10 @@ let f = class extends k {
|
|
|
2844
2857
|
border-color: var(--zs3-warning-color, #f59e0b);
|
|
2845
2858
|
}
|
|
2846
2859
|
|
|
2847
|
-
|
|
2848
|
-
|
|
2860
|
+
@media (hover: hover) {
|
|
2861
|
+
button.btn-warning:hover:not(:disabled):not(.loading) {
|
|
2862
|
+
filter: brightness(0.9);
|
|
2863
|
+
}
|
|
2849
2864
|
}
|
|
2850
2865
|
|
|
2851
2866
|
button.btn-info {
|
|
@@ -2854,8 +2869,10 @@ let f = class extends k {
|
|
|
2854
2869
|
border-color: var(--zs3-info-color, #06b6d4);
|
|
2855
2870
|
}
|
|
2856
2871
|
|
|
2857
|
-
|
|
2858
|
-
|
|
2872
|
+
@media (hover: hover) {
|
|
2873
|
+
button.btn-info:hover:not(:disabled):not(.loading) {
|
|
2874
|
+
filter: brightness(0.9);
|
|
2875
|
+
}
|
|
2859
2876
|
}
|
|
2860
2877
|
|
|
2861
2878
|
/* Sizes */
|
|
@@ -2971,43 +2988,43 @@ let f = class extends k {
|
|
|
2971
2988
|
this.setBooleanAttribute("disabled", e);
|
|
2972
2989
|
}
|
|
2973
2990
|
};
|
|
2974
|
-
|
|
2991
|
+
D([
|
|
2975
2992
|
n("icon", { type: "string" })
|
|
2976
|
-
],
|
|
2977
|
-
|
|
2993
|
+
], g.prototype, "icon", 2);
|
|
2994
|
+
D([
|
|
2978
2995
|
n("icon-size", { type: "string" })
|
|
2979
|
-
],
|
|
2980
|
-
|
|
2996
|
+
], g.prototype, "iconSize", 2);
|
|
2997
|
+
D([
|
|
2981
2998
|
n("position", { type: "string", default: "right" })
|
|
2982
|
-
],
|
|
2983
|
-
|
|
2999
|
+
], g.prototype, "position", 2);
|
|
3000
|
+
D([
|
|
2984
3001
|
n("rounded", { type: "boolean" })
|
|
2985
|
-
],
|
|
2986
|
-
|
|
3002
|
+
], g.prototype, "rounded", 2);
|
|
3003
|
+
D([
|
|
2987
3004
|
n("variant", { type: "string" })
|
|
2988
|
-
],
|
|
2989
|
-
|
|
3005
|
+
], g.prototype, "variant", 2);
|
|
3006
|
+
D([
|
|
2990
3007
|
n("size", { type: "string" })
|
|
2991
|
-
],
|
|
2992
|
-
|
|
3008
|
+
], g.prototype, "size", 2);
|
|
3009
|
+
D([
|
|
2993
3010
|
n("disabled", { type: "boolean" })
|
|
2994
|
-
],
|
|
2995
|
-
|
|
3011
|
+
], g.prototype, "disabled", 2);
|
|
3012
|
+
D([
|
|
2996
3013
|
n("loading", { type: "boolean" })
|
|
2997
|
-
],
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
],
|
|
3003
|
-
customElements.get("zs3-button") || customElements.define("zs3-button",
|
|
3004
|
-
typeof window < "u" && (window.$Button =
|
|
3005
|
-
var
|
|
3006
|
-
for (var
|
|
3007
|
-
(a = e[
|
|
3008
|
-
return i &&
|
|
3014
|
+
], g.prototype, "loading", 2);
|
|
3015
|
+
g = D([
|
|
3016
|
+
E("zs3-button"),
|
|
3017
|
+
T(ie),
|
|
3018
|
+
Mt("button")
|
|
3019
|
+
], g);
|
|
3020
|
+
customElements.get("zs3-button") || customElements.define("zs3-button", g);
|
|
3021
|
+
typeof window < "u" && (window.$Button = g);
|
|
3022
|
+
var oe = Object.defineProperty, re = Object.getOwnPropertyDescriptor, x = (e, t, s, i) => {
|
|
3023
|
+
for (var o = i > 1 ? void 0 : i ? re(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
3024
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
3025
|
+
return i && o && oe(t, s, o), o;
|
|
3009
3026
|
};
|
|
3010
|
-
const
|
|
3027
|
+
const ae = [
|
|
3011
3028
|
"title",
|
|
3012
3029
|
"description",
|
|
3013
3030
|
"fields",
|
|
@@ -3023,7 +3040,7 @@ const Qt = [
|
|
|
3023
3040
|
"i18n-accept-text",
|
|
3024
3041
|
"i18n-cancel-text"
|
|
3025
3042
|
];
|
|
3026
|
-
let
|
|
3043
|
+
let p = class extends P {
|
|
3027
3044
|
/**
|
|
3028
3045
|
* Constructor
|
|
3029
3046
|
*/
|
|
@@ -3044,7 +3061,7 @@ let u = class extends k {
|
|
|
3044
3061
|
* After mount setup
|
|
3045
3062
|
*/
|
|
3046
3063
|
afterMount() {
|
|
3047
|
-
super.afterMount(), this.setupFormElements(), this._shadowRoot &&
|
|
3064
|
+
super.afterMount(), this.setupFormElements(), this._shadowRoot && w.updateRoot(this._shadowRoot), this._parentElement && this.appendTo(this._parentElement);
|
|
3048
3065
|
}
|
|
3049
3066
|
/**
|
|
3050
3067
|
* Handle attribute changes
|
|
@@ -3121,9 +3138,9 @@ let u = class extends k {
|
|
|
3121
3138
|
if (i.max !== void 0 && e.type === "number" && Number(t) > i.max)
|
|
3122
3139
|
return this.t("zs3.form.maxValue", { max: i.max });
|
|
3123
3140
|
if (i.custom) {
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3126
|
-
return typeof
|
|
3141
|
+
const o = i.custom(t);
|
|
3142
|
+
if (o !== !0)
|
|
3143
|
+
return typeof o == "string" ? o : this.getTranslatedErrorMessage(e, "zs3.form.invalidValue");
|
|
3127
3144
|
}
|
|
3128
3145
|
}
|
|
3129
3146
|
if (e.type === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s))
|
|
@@ -3236,19 +3253,17 @@ let u = class extends k {
|
|
|
3236
3253
|
setupFormElements() {
|
|
3237
3254
|
this._buttons.forEach((e) => e.remove()), this._buttons = [];
|
|
3238
3255
|
for (const e of this._fields) {
|
|
3239
|
-
const t = this.
|
|
3240
|
-
`[data-field="${e.name}"]`
|
|
3241
|
-
);
|
|
3256
|
+
const t = this.$(`[data-field="${e.name}"]`).$;
|
|
3242
3257
|
t && (this.addManagedEventListener(t, "input", (s) => {
|
|
3243
3258
|
const i = s.target;
|
|
3244
|
-
let
|
|
3245
|
-
if (e.type === "checkbox" ?
|
|
3246
|
-
const
|
|
3247
|
-
|
|
3259
|
+
let o;
|
|
3260
|
+
if (e.type === "checkbox" ? o = i.checked : e.type === "number" ? o = i.value === "" ? "" : Number(i.value) : o = i.value, this._values[e.name] = o, this._touched.has(e.name)) {
|
|
3261
|
+
const r = this.validateField(e);
|
|
3262
|
+
r ? this._errors[e.name] = r : delete this._errors[e.name], this.updateFieldUI(e.name);
|
|
3248
3263
|
}
|
|
3249
3264
|
this.updateButtonState(), this.emit("zs3-form-change", {
|
|
3250
3265
|
name: e.name,
|
|
3251
|
-
value:
|
|
3266
|
+
value: o,
|
|
3252
3267
|
isValid: this.isValid()
|
|
3253
3268
|
});
|
|
3254
3269
|
}), this.addManagedEventListener(t, "blur", () => {
|
|
@@ -3269,13 +3284,13 @@ let u = class extends k {
|
|
|
3269
3284
|
* Setup accept and cancel buttons
|
|
3270
3285
|
*/
|
|
3271
3286
|
setupButtons() {
|
|
3272
|
-
const e = this
|
|
3287
|
+
const e = this.$(".form-buttons").$;
|
|
3273
3288
|
if (!e) return;
|
|
3274
|
-
const t = new
|
|
3289
|
+
const t = new g();
|
|
3275
3290
|
if (t.textContent = this.i18nAcceptText ? this.t(this.i18nAcceptText) : this.acceptText || this.t("zs3.form.accept"), t.variant = this.acceptVariant, t.setAttribute("data-action", "accept"), this.addManagedEventListener(t, "zs3-click", () => {
|
|
3276
3291
|
this.handleSubmit();
|
|
3277
3292
|
}), e.appendChild(t), this._buttons.push(t), this.showCancel) {
|
|
3278
|
-
const s = new
|
|
3293
|
+
const s = new g();
|
|
3279
3294
|
s.textContent = this.i18nCancelText ? this.t(this.i18nCancelText) : this.cancelText || this.t("zs3.form.cancel"), s.variant = this.cancelVariant || "secondary", s.setAttribute("data-action", "cancel"), this.addManagedEventListener(s, "zs3-click", () => {
|
|
3280
3295
|
this.handleCancel();
|
|
3281
3296
|
}), e.appendChild(s), this._buttons.push(s);
|
|
@@ -3285,10 +3300,10 @@ let u = class extends k {
|
|
|
3285
3300
|
* Update field UI (show/hide error)
|
|
3286
3301
|
*/
|
|
3287
3302
|
updateFieldUI(e) {
|
|
3288
|
-
const t = this
|
|
3303
|
+
const t = this.$(`[data-field-container="${e}"]`).$, s = this.$(`[data-error="${e}"]`).$, i = this.$(`[data-field="${e}"]`).$;
|
|
3289
3304
|
if (!t || !i) return;
|
|
3290
|
-
const
|
|
3291
|
-
|
|
3305
|
+
const o = this._errors[e], r = this._touched.has(e);
|
|
3306
|
+
o && r ? (t.classList.add("has-error"), i.classList.add("invalid"), s && (s.textContent = o, s.style.display = "block")) : (t.classList.remove("has-error"), i.classList.remove("invalid"), s && (s.textContent = "", s.style.display = "none"));
|
|
3292
3307
|
}
|
|
3293
3308
|
/**
|
|
3294
3309
|
* Update accept button state
|
|
@@ -3328,41 +3343,41 @@ let u = class extends k {
|
|
|
3328
3343
|
* Render a single field
|
|
3329
3344
|
*/
|
|
3330
3345
|
renderField(e) {
|
|
3331
|
-
const t = this.getTranslatedLabel(e), s = this.getTranslatedPlaceholder(e), i = this._values[e.name] ?? "",
|
|
3332
|
-
let
|
|
3346
|
+
const t = this.getTranslatedLabel(e), s = this.getTranslatedPlaceholder(e), i = this._values[e.name] ?? "", o = this._errors[e.name], r = this._touched.has(e.name), a = o && r, c = e.required ? '<span class="required-mark">*</span>' : "", l = e.disabled || this.formDisabled ? "disabled" : "", f = e.readonly ? "readonly" : "", b = e.i18nLabel ? `<span data-i18n="${e.i18nLabel}"></span>${c}` : `${t}${c}`, v = e.i18nPlaceholder ? `data-i18n-attr='{"placeholder":"${e.i18nPlaceholder}"}'` : `placeholder="${s}"`;
|
|
3347
|
+
let m = "";
|
|
3333
3348
|
switch (e.type) {
|
|
3334
3349
|
case "textarea":
|
|
3335
|
-
|
|
3350
|
+
m = `
|
|
3336
3351
|
<textarea
|
|
3337
3352
|
data-field="${e.name}"
|
|
3338
|
-
${
|
|
3353
|
+
${v}
|
|
3339
3354
|
rows="${e.rows || 4}"
|
|
3340
3355
|
class="${a ? "invalid" : ""}"
|
|
3341
3356
|
${l}
|
|
3342
|
-
${
|
|
3357
|
+
${f}
|
|
3343
3358
|
>${i}</textarea>
|
|
3344
3359
|
`;
|
|
3345
3360
|
break;
|
|
3346
3361
|
case "select": {
|
|
3347
|
-
const
|
|
3348
|
-
const
|
|
3349
|
-
return `<option value="${
|
|
3350
|
-
}).join(""),
|
|
3351
|
-
|
|
3362
|
+
const M = (e.options || []).map(($) => {
|
|
3363
|
+
const V = this.getTranslatedOptionLabel($), F = i === $.value ? "selected" : "";
|
|
3364
|
+
return `<option value="${$.value}" ${F}>${V}</option>`;
|
|
3365
|
+
}).join(""), B = e.i18nPlaceholder ? `<option value="" disabled ${i ? "" : "selected"} data-i18n="${e.i18nPlaceholder}"></option>` : s ? `<option value="" disabled ${i ? "" : "selected"}>${s}</option>` : "";
|
|
3366
|
+
m = `
|
|
3352
3367
|
<select
|
|
3353
3368
|
data-field="${e.name}"
|
|
3354
3369
|
class="${a ? "invalid" : ""}"
|
|
3355
3370
|
${l}
|
|
3356
3371
|
>
|
|
3357
|
-
${
|
|
3358
|
-
${
|
|
3372
|
+
${B}
|
|
3373
|
+
${M}
|
|
3359
3374
|
</select>
|
|
3360
3375
|
`;
|
|
3361
3376
|
break;
|
|
3362
3377
|
}
|
|
3363
3378
|
case "checkbox": {
|
|
3364
|
-
const
|
|
3365
|
-
|
|
3379
|
+
const M = e.i18nLabel ? `<span class="checkbox-text" data-i18n="${e.i18nLabel}"></span>` : `<span class="checkbox-text">${t}</span>`;
|
|
3380
|
+
m = `
|
|
3366
3381
|
<label class="checkbox-label">
|
|
3367
3382
|
<input
|
|
3368
3383
|
type="checkbox"
|
|
@@ -3370,29 +3385,29 @@ let u = class extends k {
|
|
|
3370
3385
|
${i ? "checked" : ""}
|
|
3371
3386
|
${l}
|
|
3372
3387
|
/>
|
|
3373
|
-
${
|
|
3388
|
+
${M}
|
|
3374
3389
|
</label>
|
|
3375
3390
|
`;
|
|
3376
3391
|
break;
|
|
3377
3392
|
}
|
|
3378
3393
|
default:
|
|
3379
|
-
|
|
3394
|
+
m = `
|
|
3380
3395
|
<input
|
|
3381
3396
|
type="${e.type}"
|
|
3382
3397
|
data-field="${e.name}"
|
|
3383
3398
|
value="${i}"
|
|
3384
|
-
${
|
|
3399
|
+
${v}
|
|
3385
3400
|
class="${a ? "invalid" : ""}"
|
|
3386
3401
|
${l}
|
|
3387
|
-
${
|
|
3402
|
+
${f}
|
|
3388
3403
|
/>
|
|
3389
3404
|
`;
|
|
3390
3405
|
}
|
|
3391
3406
|
return e.type === "checkbox" ? `
|
|
3392
3407
|
<div class="form-field ${a ? "has-error" : ""}" data-field-container="${e.name}">
|
|
3393
|
-
${
|
|
3408
|
+
${m}
|
|
3394
3409
|
<span class="error-message" data-error="${e.name}" style="display: ${a ? "block" : "none"}">
|
|
3395
|
-
${
|
|
3410
|
+
${o || ""}
|
|
3396
3411
|
</span>
|
|
3397
3412
|
</div>
|
|
3398
3413
|
` : `
|
|
@@ -3400,9 +3415,9 @@ let u = class extends k {
|
|
|
3400
3415
|
<label class="field-label" for="${e.name}">
|
|
3401
3416
|
${b}
|
|
3402
3417
|
</label>
|
|
3403
|
-
${
|
|
3418
|
+
${m}
|
|
3404
3419
|
<span class="error-message" data-error="${e.name}" style="display: ${a ? "block" : "none"}">
|
|
3405
|
-
${
|
|
3420
|
+
${o || ""}
|
|
3406
3421
|
</span>
|
|
3407
3422
|
</div>
|
|
3408
3423
|
`;
|
|
@@ -3412,7 +3427,7 @@ let u = class extends k {
|
|
|
3412
3427
|
*/
|
|
3413
3428
|
render() {
|
|
3414
3429
|
if (!this.root) return;
|
|
3415
|
-
const e = this.getAttribute("i18n-title"), t = e ? `<h2 class="form-title" data-i18n="${e}"></h2>` : this.formTitle ? `<h2 class="form-title">${this.formTitle}</h2>` : "", s = this.getAttribute("i18n-description"), i = s ? `<p class="form-description" data-i18n="${s}"></p>` : this.description ? `<p class="form-description">${this.description}</p>` : "",
|
|
3430
|
+
const e = this.getAttribute("i18n-title"), t = e ? `<h2 class="form-title" data-i18n="${e}"></h2>` : this.formTitle ? `<h2 class="form-title">${this.formTitle}</h2>` : "", s = this.getAttribute("i18n-description"), i = s ? `<p class="form-description" data-i18n="${s}"></p>` : this.description ? `<p class="form-description">${this.description}</p>` : "", o = this._fields.map((r) => this.renderField(r)).join("");
|
|
3416
3431
|
this.setHTML(`
|
|
3417
3432
|
${this.getStyles()}
|
|
3418
3433
|
<form class="zs3-form" novalidate>
|
|
@@ -3420,7 +3435,7 @@ let u = class extends k {
|
|
|
3420
3435
|
${i}
|
|
3421
3436
|
|
|
3422
3437
|
<div class="form-fields">
|
|
3423
|
-
${
|
|
3438
|
+
${o}
|
|
3424
3439
|
</div>
|
|
3425
3440
|
|
|
3426
3441
|
<div class="form-buttons"></div>
|
|
@@ -3612,88 +3627,88 @@ let u = class extends k {
|
|
|
3612
3627
|
* Create a form from configuration
|
|
3613
3628
|
*/
|
|
3614
3629
|
static create(e) {
|
|
3615
|
-
const t = new
|
|
3630
|
+
const t = new p();
|
|
3616
3631
|
return e.title && t.setAttribute("title", e.title), e.i18nTitle && t.setAttribute("i18n-title", e.i18nTitle), e.description && t.setAttribute("description", e.description), e.i18nDescription && t.setAttribute("i18n-description", e.i18nDescription), e.acceptText && t.setAttribute("accept-text", e.acceptText), e.i18nAcceptText && t.setAttribute("i18n-accept-text", e.i18nAcceptText), e.cancelText && t.setAttribute("cancel-text", e.cancelText), e.i18nCancelText && t.setAttribute("i18n-cancel-text", e.i18nCancelText), e.showCancel !== void 0 && t.setAttribute("show-cancel", String(e.showCancel)), e.acceptVariant && t.setAttribute("accept-variant", e.acceptVariant), e.cancelVariant && t.setAttribute("cancel-variant", e.cancelVariant), e.parent && t.setParent(e.parent), e.fields && t.setAttribute("fields", JSON.stringify(e.fields)), t;
|
|
3617
3632
|
}
|
|
3618
3633
|
/**
|
|
3619
3634
|
* Create and show a form as a promise (resolves when submitted)
|
|
3620
3635
|
*/
|
|
3621
3636
|
static async prompt(e) {
|
|
3622
|
-
const t =
|
|
3637
|
+
const t = p.create({
|
|
3623
3638
|
...e,
|
|
3624
3639
|
showCancel: !0
|
|
3625
3640
|
});
|
|
3626
3641
|
return document.body.appendChild(t), new Promise((s) => {
|
|
3627
3642
|
const i = (a) => {
|
|
3628
3643
|
const c = a.detail;
|
|
3629
|
-
|
|
3630
|
-
}, r = () => {
|
|
3631
|
-
o(), s(null);
|
|
3644
|
+
r(), s(c.values);
|
|
3632
3645
|
}, o = () => {
|
|
3633
|
-
|
|
3646
|
+
r(), s(null);
|
|
3647
|
+
}, r = () => {
|
|
3648
|
+
t.removeEventListener("zs3-form-submit", i), t.removeEventListener("zs3-form-cancel", o), t.remove();
|
|
3634
3649
|
};
|
|
3635
|
-
t.addEventListener("zs3-form-submit", i), t.addEventListener("zs3-form-cancel",
|
|
3650
|
+
t.addEventListener("zs3-form-submit", i), t.addEventListener("zs3-form-cancel", o);
|
|
3636
3651
|
});
|
|
3637
3652
|
}
|
|
3638
3653
|
};
|
|
3639
|
-
|
|
3654
|
+
x([
|
|
3640
3655
|
n("title", { type: "string", default: "" })
|
|
3641
|
-
],
|
|
3642
|
-
|
|
3656
|
+
], p.prototype, "formTitle", 2);
|
|
3657
|
+
x([
|
|
3643
3658
|
n("description", { type: "string", default: "" })
|
|
3644
|
-
],
|
|
3645
|
-
|
|
3659
|
+
], p.prototype, "description", 2);
|
|
3660
|
+
x([
|
|
3646
3661
|
n("accept-text", { type: "string" })
|
|
3647
|
-
],
|
|
3648
|
-
|
|
3662
|
+
], p.prototype, "acceptText", 2);
|
|
3663
|
+
x([
|
|
3649
3664
|
n("cancel-text", { type: "string" })
|
|
3650
|
-
],
|
|
3651
|
-
|
|
3665
|
+
], p.prototype, "cancelText", 2);
|
|
3666
|
+
x([
|
|
3652
3667
|
n("show-cancel", { type: "boolean" })
|
|
3653
|
-
],
|
|
3654
|
-
|
|
3668
|
+
], p.prototype, "showCancel", 2);
|
|
3669
|
+
x([
|
|
3655
3670
|
n("accept-variant", { type: "string", default: "primary" })
|
|
3656
|
-
],
|
|
3657
|
-
|
|
3671
|
+
], p.prototype, "acceptVariant", 2);
|
|
3672
|
+
x([
|
|
3658
3673
|
n("cancel-variant", { type: "string", default: "secondary" })
|
|
3659
|
-
],
|
|
3660
|
-
|
|
3674
|
+
], p.prototype, "cancelVariant", 2);
|
|
3675
|
+
x([
|
|
3661
3676
|
n("disabled", { type: "boolean" })
|
|
3662
|
-
],
|
|
3663
|
-
|
|
3677
|
+
], p.prototype, "formDisabled", 2);
|
|
3678
|
+
x([
|
|
3664
3679
|
n("i18n-title", { type: "string" })
|
|
3665
|
-
],
|
|
3666
|
-
|
|
3680
|
+
], p.prototype, "i18nTitle", 2);
|
|
3681
|
+
x([
|
|
3667
3682
|
n("i18n-description", { type: "string" })
|
|
3668
|
-
],
|
|
3669
|
-
|
|
3683
|
+
], p.prototype, "i18nDescription", 2);
|
|
3684
|
+
x([
|
|
3670
3685
|
n("i18n-accept-text", { type: "string" })
|
|
3671
|
-
],
|
|
3672
|
-
|
|
3686
|
+
], p.prototype, "i18nAcceptText", 2);
|
|
3687
|
+
x([
|
|
3673
3688
|
n("i18n-cancel-text", { type: "string" })
|
|
3674
|
-
],
|
|
3675
|
-
|
|
3689
|
+
], p.prototype, "i18nCancelText", 2);
|
|
3690
|
+
x([
|
|
3676
3691
|
n("fields", { type: "string" })
|
|
3677
|
-
],
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
],
|
|
3682
|
-
customElements.get("zs3-form") || customElements.define("zs3-form",
|
|
3683
|
-
typeof window < "u" && (window.$Form =
|
|
3684
|
-
var
|
|
3685
|
-
for (var
|
|
3686
|
-
(a = e[
|
|
3687
|
-
return i &&
|
|
3692
|
+
], p.prototype, "fields", 2);
|
|
3693
|
+
p = x([
|
|
3694
|
+
E("zs3-form"),
|
|
3695
|
+
T(ae)
|
|
3696
|
+
], p);
|
|
3697
|
+
customElements.get("zs3-form") || customElements.define("zs3-form", p);
|
|
3698
|
+
typeof window < "u" && (window.$Form = p);
|
|
3699
|
+
var ne = Object.defineProperty, le = Object.getOwnPropertyDescriptor, G = (e, t, s, i) => {
|
|
3700
|
+
for (var o = i > 1 ? void 0 : i ? le(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
3701
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
3702
|
+
return i && o && ne(t, s, o), o;
|
|
3688
3703
|
};
|
|
3689
|
-
const
|
|
3704
|
+
const ce = [
|
|
3690
3705
|
"show-register",
|
|
3691
3706
|
"login-text",
|
|
3692
3707
|
"register-text",
|
|
3693
3708
|
"i18n-login-text",
|
|
3694
3709
|
"i18n-register-text"
|
|
3695
3710
|
];
|
|
3696
|
-
let H = class extends
|
|
3711
|
+
let H = class extends p {
|
|
3697
3712
|
constructor() {
|
|
3698
3713
|
super();
|
|
3699
3714
|
}
|
|
@@ -3747,44 +3762,44 @@ let H = class extends u {
|
|
|
3747
3762
|
* Add register button
|
|
3748
3763
|
*/
|
|
3749
3764
|
addRegisterButton() {
|
|
3750
|
-
const e = this
|
|
3765
|
+
const e = this.$(".form-buttons").$;
|
|
3751
3766
|
if (!e) return;
|
|
3752
|
-
const t = new
|
|
3767
|
+
const t = new g(), s = this.i18nRegisterText || "zs3.login.register";
|
|
3753
3768
|
t.textContent = this.t(s), t.variant = "secondary", t.setAttribute("data-action", "register"), this.addManagedEventListener(t, "zs3-click", () => {
|
|
3754
3769
|
this.emit("zs3-login-register", { form: this });
|
|
3755
3770
|
}), e.appendChild(t), this._buttons.push(t);
|
|
3756
3771
|
}
|
|
3757
3772
|
};
|
|
3758
|
-
|
|
3773
|
+
G([
|
|
3759
3774
|
n("show-register", { type: "boolean" })
|
|
3760
3775
|
], H.prototype, "showRegister", 2);
|
|
3761
|
-
|
|
3776
|
+
G([
|
|
3762
3777
|
n("login-text", { type: "string" })
|
|
3763
3778
|
], H.prototype, "loginText", 2);
|
|
3764
|
-
|
|
3779
|
+
G([
|
|
3765
3780
|
n("register-text", { type: "string" })
|
|
3766
3781
|
], H.prototype, "registerText", 2);
|
|
3767
|
-
|
|
3782
|
+
G([
|
|
3768
3783
|
n("i18n-login-text", { type: "string" })
|
|
3769
3784
|
], H.prototype, "i18nLoginText", 2);
|
|
3770
|
-
|
|
3785
|
+
G([
|
|
3771
3786
|
n("i18n-register-text", { type: "string" })
|
|
3772
3787
|
], H.prototype, "i18nRegisterText", 2);
|
|
3773
|
-
H =
|
|
3774
|
-
|
|
3775
|
-
|
|
3788
|
+
H = G([
|
|
3789
|
+
E("zs3-login-form"),
|
|
3790
|
+
T(ce, { inherit: !0 })
|
|
3776
3791
|
], H);
|
|
3777
3792
|
typeof window < "u" && (window.$LoginForm = H);
|
|
3778
|
-
var
|
|
3779
|
-
for (var
|
|
3780
|
-
(a = e[
|
|
3781
|
-
return i &&
|
|
3793
|
+
var de = Object.defineProperty, he = Object.getOwnPropertyDescriptor, bt = (e, t, s, i) => {
|
|
3794
|
+
for (var o = i > 1 ? void 0 : i ? he(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
3795
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
3796
|
+
return i && o && de(t, s, o), o;
|
|
3782
3797
|
};
|
|
3783
|
-
const
|
|
3798
|
+
const ue = [
|
|
3784
3799
|
"register-text",
|
|
3785
3800
|
"i18n-register-text"
|
|
3786
3801
|
];
|
|
3787
|
-
let
|
|
3802
|
+
let et = class extends p {
|
|
3788
3803
|
constructor() {
|
|
3789
3804
|
super();
|
|
3790
3805
|
}
|
|
@@ -3883,27 +3898,27 @@ let Q = class extends u {
|
|
|
3883
3898
|
}
|
|
3884
3899
|
}
|
|
3885
3900
|
};
|
|
3886
|
-
|
|
3901
|
+
bt([
|
|
3887
3902
|
n("register-text", { type: "string" })
|
|
3888
|
-
],
|
|
3889
|
-
|
|
3903
|
+
], et.prototype, "registerButtonText", 2);
|
|
3904
|
+
bt([
|
|
3890
3905
|
n("i18n-register-text", { type: "string" })
|
|
3891
|
-
],
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
],
|
|
3896
|
-
typeof window < "u" && (window.$RegisterForm =
|
|
3897
|
-
var
|
|
3898
|
-
for (var
|
|
3899
|
-
(a = e[
|
|
3900
|
-
return i &&
|
|
3906
|
+
], et.prototype, "i18nRegisterText", 2);
|
|
3907
|
+
et = bt([
|
|
3908
|
+
E("zs3-register-form"),
|
|
3909
|
+
T(ue, { inherit: !0 })
|
|
3910
|
+
], et);
|
|
3911
|
+
typeof window < "u" && (window.$RegisterForm = et);
|
|
3912
|
+
var pe = Object.defineProperty, me = Object.getOwnPropertyDescriptor, gt = (e, t, s, i) => {
|
|
3913
|
+
for (var o = i > 1 ? void 0 : i ? me(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
3914
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
3915
|
+
return i && o && pe(t, s, o), o;
|
|
3901
3916
|
};
|
|
3902
|
-
const
|
|
3917
|
+
const fe = [
|
|
3903
3918
|
"submit-text",
|
|
3904
3919
|
"i18n-submit-text"
|
|
3905
3920
|
];
|
|
3906
|
-
let
|
|
3921
|
+
let st = class extends p {
|
|
3907
3922
|
constructor() {
|
|
3908
3923
|
super();
|
|
3909
3924
|
}
|
|
@@ -3941,23 +3956,23 @@ let Z = class extends u {
|
|
|
3941
3956
|
}
|
|
3942
3957
|
}
|
|
3943
3958
|
};
|
|
3944
|
-
|
|
3959
|
+
gt([
|
|
3945
3960
|
n("submit-text", { type: "string" })
|
|
3946
|
-
],
|
|
3947
|
-
|
|
3961
|
+
], st.prototype, "submitText", 2);
|
|
3962
|
+
gt([
|
|
3948
3963
|
n("i18n-submit-text", { type: "string" })
|
|
3949
|
-
],
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
],
|
|
3954
|
-
typeof window < "u" && (window.$RecoverPasswordForm =
|
|
3955
|
-
var
|
|
3956
|
-
for (var
|
|
3957
|
-
(a = e[
|
|
3958
|
-
return i &&
|
|
3964
|
+
], st.prototype, "i18nSubmitText", 2);
|
|
3965
|
+
st = gt([
|
|
3966
|
+
E("zs3-recover-password-form"),
|
|
3967
|
+
T(fe, { inherit: !0 })
|
|
3968
|
+
], st);
|
|
3969
|
+
typeof window < "u" && (window.$RecoverPasswordForm = st);
|
|
3970
|
+
var be = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, q = (e, t, s, i) => {
|
|
3971
|
+
for (var o = i > 1 ? void 0 : i ? ge(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
3972
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
3973
|
+
return i && o && be(t, s, o), o;
|
|
3959
3974
|
};
|
|
3960
|
-
const
|
|
3975
|
+
const ve = [
|
|
3961
3976
|
"size",
|
|
3962
3977
|
"backdrop",
|
|
3963
3978
|
"close-on-backdrop",
|
|
@@ -3965,7 +3980,7 @@ const de = [
|
|
|
3965
3980
|
"centered",
|
|
3966
3981
|
"scrollable"
|
|
3967
3982
|
];
|
|
3968
|
-
let
|
|
3983
|
+
let A = class extends P {
|
|
3969
3984
|
/**
|
|
3970
3985
|
* Initializes the modal component
|
|
3971
3986
|
*/
|
|
@@ -3997,11 +4012,11 @@ let M = class extends k {
|
|
|
3997
4012
|
* Setup event listeners
|
|
3998
4013
|
*/
|
|
3999
4014
|
setupEventListeners() {
|
|
4000
|
-
const e = this
|
|
4015
|
+
const e = this.$(".modal-backdrop").$;
|
|
4001
4016
|
e && this.closeOnBackdrop && this.addManagedEventListener(e, "click", (s) => {
|
|
4002
4017
|
s.target === e && (this.emit("zs3-modal-backdrop-click", { modal: this }), this.hide());
|
|
4003
4018
|
});
|
|
4004
|
-
const t = this
|
|
4019
|
+
const t = this.$(".modal-container").$;
|
|
4005
4020
|
t && this.addManagedEventListener(t, "click", (s) => {
|
|
4006
4021
|
s.stopPropagation();
|
|
4007
4022
|
});
|
|
@@ -4028,8 +4043,8 @@ let M = class extends k {
|
|
|
4028
4043
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
4029
4044
|
);
|
|
4030
4045
|
if (e.length === 0) return;
|
|
4031
|
-
const t = e[0], s = e[e.length - 1], i = (
|
|
4032
|
-
|
|
4046
|
+
const t = e[0], s = e[e.length - 1], i = (o) => {
|
|
4047
|
+
o.key === "Tab" && (o.shiftKey ? document.activeElement === t && (o.preventDefault(), s.focus()) : document.activeElement === s && (o.preventDefault(), t.focus()));
|
|
4033
4048
|
};
|
|
4034
4049
|
this.addManagedEventListener(this, "keydown", i), t.focus();
|
|
4035
4050
|
}
|
|
@@ -4068,7 +4083,7 @@ let M = class extends k {
|
|
|
4068
4083
|
</div>
|
|
4069
4084
|
</div>
|
|
4070
4085
|
`);
|
|
4071
|
-
const e = this
|
|
4086
|
+
const e = this.$(".modal-backdrop").$, t = this.$(".modal-container").$;
|
|
4072
4087
|
e && t && (t.classList.add(`size-${this.size}`), this.centered && e.classList.add("centered"), this.scrollable && t.classList.add("scrollable"), this._isVisible && (e.classList.add("visible"), t.classList.add("visible"))), this._mounted && this.setupEventListeners(), this.emitLifecycleEvent("zs3-rendered", { phase: "complete" });
|
|
4073
4088
|
}
|
|
4074
4089
|
/**
|
|
@@ -4234,7 +4249,7 @@ let M = class extends k {
|
|
|
4234
4249
|
hide() {
|
|
4235
4250
|
if (!this._isVisible) return;
|
|
4236
4251
|
this._isVisible = !1;
|
|
4237
|
-
const e = this
|
|
4252
|
+
const e = this.$(".modal-backdrop").$, t = this.$(".modal-container").$;
|
|
4238
4253
|
e && t && (e.classList.remove("visible"), t.classList.remove("visible")), setTimeout(() => {
|
|
4239
4254
|
this._isVisible || (this.style.display = "none", this.unlockBodyScroll(), this.removeEscapeListener(), this.restoreFocus());
|
|
4240
4255
|
}, 300), this.emit("zs3-modal-hide", {
|
|
@@ -4260,36 +4275,36 @@ let M = class extends k {
|
|
|
4260
4275
|
e.size !== void 0 && (this.size = e.size), e.backdrop !== void 0 && (this.backdrop = e.backdrop), e.closeOnBackdrop !== void 0 && (this.closeOnBackdrop = e.closeOnBackdrop), e.closeOnEscape !== void 0 && (this.closeOnEscape = e.closeOnEscape), e.centered !== void 0 && (this.centered = e.centered), e.scrollable !== void 0 && (this.scrollable = e.scrollable), this.render();
|
|
4261
4276
|
}
|
|
4262
4277
|
};
|
|
4263
|
-
|
|
4278
|
+
q([
|
|
4264
4279
|
n("size", { type: "string", default: "medium" })
|
|
4265
|
-
],
|
|
4266
|
-
|
|
4280
|
+
], A.prototype, "size", 2);
|
|
4281
|
+
q([
|
|
4267
4282
|
n("backdrop", { type: "boolean", default: !0 })
|
|
4268
|
-
],
|
|
4269
|
-
|
|
4283
|
+
], A.prototype, "backdrop", 2);
|
|
4284
|
+
q([
|
|
4270
4285
|
n("close-on-backdrop", { type: "boolean", default: !0 })
|
|
4271
|
-
],
|
|
4272
|
-
|
|
4286
|
+
], A.prototype, "closeOnBackdrop", 2);
|
|
4287
|
+
q([
|
|
4273
4288
|
n("close-on-escape", { type: "boolean", default: !0 })
|
|
4274
|
-
],
|
|
4275
|
-
|
|
4289
|
+
], A.prototype, "closeOnEscape", 2);
|
|
4290
|
+
q([
|
|
4276
4291
|
n("centered", { type: "boolean", default: !0 })
|
|
4277
|
-
],
|
|
4278
|
-
|
|
4292
|
+
], A.prototype, "centered", 2);
|
|
4293
|
+
q([
|
|
4279
4294
|
n("scrollable", { type: "boolean" })
|
|
4280
|
-
],
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
],
|
|
4285
|
-
customElements.get("zs3-modal") || customElements.define("zs3-modal",
|
|
4286
|
-
typeof window < "u" && (window.$Modal =
|
|
4287
|
-
var
|
|
4288
|
-
for (var
|
|
4289
|
-
(a = e[
|
|
4290
|
-
return i &&
|
|
4295
|
+
], A.prototype, "scrollable", 2);
|
|
4296
|
+
A = q([
|
|
4297
|
+
E("zs3-modal"),
|
|
4298
|
+
T(ve)
|
|
4299
|
+
], A);
|
|
4300
|
+
customElements.get("zs3-modal") || customElements.define("zs3-modal", A);
|
|
4301
|
+
typeof window < "u" && (window.$Modal = A);
|
|
4302
|
+
var ze = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, z = (e, t, s, i) => {
|
|
4303
|
+
for (var o = i > 1 ? void 0 : i ? ye(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
4304
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
4305
|
+
return i && o && ze(t, s, o), o;
|
|
4291
4306
|
};
|
|
4292
|
-
const
|
|
4307
|
+
const we = [
|
|
4293
4308
|
"title",
|
|
4294
4309
|
"message",
|
|
4295
4310
|
"show-accept",
|
|
@@ -4308,7 +4323,7 @@ const pe = [
|
|
|
4308
4323
|
"i18n-cancel-text",
|
|
4309
4324
|
"i18n-close-text"
|
|
4310
4325
|
];
|
|
4311
|
-
let d = class extends
|
|
4326
|
+
let d = class extends A {
|
|
4312
4327
|
/**
|
|
4313
4328
|
* Initializes the modal dialog component
|
|
4314
4329
|
*/
|
|
@@ -4319,7 +4334,7 @@ let d = class extends M {
|
|
|
4319
4334
|
* After mount setup
|
|
4320
4335
|
*/
|
|
4321
4336
|
afterMount() {
|
|
4322
|
-
super.afterMount(), this.setupDialogButtons(), this._shadowRoot &&
|
|
4337
|
+
super.afterMount(), this.setupDialogButtons(), this._shadowRoot && w.updateRoot(this._shadowRoot);
|
|
4323
4338
|
}
|
|
4324
4339
|
/**
|
|
4325
4340
|
* Setup dialog button event listeners
|
|
@@ -4328,22 +4343,22 @@ let d = class extends M {
|
|
|
4328
4343
|
this._buttons.forEach((t) => {
|
|
4329
4344
|
t.remove();
|
|
4330
4345
|
}), this._buttons = [];
|
|
4331
|
-
const e = this
|
|
4346
|
+
const e = this.$(".dialog-buttons").$;
|
|
4332
4347
|
if (e) {
|
|
4333
4348
|
if (this.showAccept) {
|
|
4334
|
-
const t = new
|
|
4349
|
+
const t = new g(), s = this.getAttribute("i18n-accept-text");
|
|
4335
4350
|
t.textContent = s ? this.t(s) : this.acceptText, t.variant = this.acceptVariant, t.setAttribute("data-action", "accept"), this.addManagedEventListener(t, "zs3-click", () => {
|
|
4336
4351
|
this.handleAccept();
|
|
4337
4352
|
}), e.appendChild(t), this._buttons.push(t);
|
|
4338
4353
|
}
|
|
4339
4354
|
if (this.showCancel) {
|
|
4340
|
-
const t = new
|
|
4355
|
+
const t = new g(), s = this.getAttribute("i18n-cancel-text");
|
|
4341
4356
|
t.textContent = s ? this.t(s) : this.cancelText, t.variant = this.cancelVariant, t.setAttribute("data-action", "cancel"), this.addManagedEventListener(t, "zs3-click", () => {
|
|
4342
4357
|
this.handleCancel();
|
|
4343
4358
|
}), e.appendChild(t), this._buttons.push(t);
|
|
4344
4359
|
}
|
|
4345
4360
|
if (this.showClose) {
|
|
4346
|
-
const t = new
|
|
4361
|
+
const t = new g(), s = this.getAttribute("i18n-close-text");
|
|
4347
4362
|
t.textContent = s ? this.t(s) : this.closeText, t.variant = "secondary", t.setAttribute("data-action", "close"), this.addManagedEventListener(t, "zs3-click", () => {
|
|
4348
4363
|
this.handleClose();
|
|
4349
4364
|
}), e.appendChild(t), this._buttons.push(t);
|
|
@@ -4382,7 +4397,7 @@ let d = class extends M {
|
|
|
4382
4397
|
*/
|
|
4383
4398
|
render() {
|
|
4384
4399
|
if (!this.root) return;
|
|
4385
|
-
const e = this.icon ? `<zs3-icon name="${this.icon}" size="large" class="dialog-icon"></zs3-icon>` : "", t = this.getAttribute("i18n-title"), s = t ? `<h2 id="dialog-title" class="dialog-title" data-i18n="${t}"></h2>` : this.title ? `<h2 id="dialog-title" class="dialog-title">${this.title}</h2>` : "", i = this.getAttribute("i18n-message"),
|
|
4400
|
+
const e = this.icon ? `<zs3-icon name="${this.icon}" size="large" class="dialog-icon"></zs3-icon>` : "", t = this.getAttribute("i18n-title"), s = t ? `<h2 id="dialog-title" class="dialog-title" data-i18n="${t}"></h2>` : this.title ? `<h2 id="dialog-title" class="dialog-title">${this.title}</h2>` : "", i = this.getAttribute("i18n-message"), o = i ? `<p class="dialog-message" data-i18n="${i}"></p>` : this.message ? `<p class="dialog-message">${this.message}</p>` : "";
|
|
4386
4401
|
this.setHTML(`
|
|
4387
4402
|
${this.getStyles()}
|
|
4388
4403
|
<div class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="dialog-title">
|
|
@@ -4394,7 +4409,7 @@ let d = class extends M {
|
|
|
4394
4409
|
</div>
|
|
4395
4410
|
|
|
4396
4411
|
<div class="dialog-body">
|
|
4397
|
-
${
|
|
4412
|
+
${o}
|
|
4398
4413
|
<slot></slot>
|
|
4399
4414
|
</div>
|
|
4400
4415
|
|
|
@@ -4403,8 +4418,8 @@ let d = class extends M {
|
|
|
4403
4418
|
</div>
|
|
4404
4419
|
</div>
|
|
4405
4420
|
`);
|
|
4406
|
-
const
|
|
4407
|
-
|
|
4421
|
+
const r = this.$(".modal-backdrop").$, a = this.$(".modal-container").$;
|
|
4422
|
+
r && a && (a.classList.add(`size-${this.size}`), this.centered && r.classList.add("centered"), this.scrollable && a.classList.add("scrollable"), this._isVisible && (r.classList.add("visible"), a.classList.add("visible"))), this._mounted && (this.setupEventListeners(), this.setupDialogButtons()), this.emitLifecycleEvent("zs3-rendered", { phase: "complete" });
|
|
4408
4423
|
}
|
|
4409
4424
|
/**
|
|
4410
4425
|
* Get component styles (extends parent styles)
|
|
@@ -4485,12 +4500,12 @@ let d = class extends M {
|
|
|
4485
4500
|
async showDialog() {
|
|
4486
4501
|
return new Promise((e) => {
|
|
4487
4502
|
const t = () => {
|
|
4488
|
-
|
|
4503
|
+
o(), e("accept");
|
|
4489
4504
|
}, s = () => {
|
|
4490
|
-
|
|
4505
|
+
o(), e("cancel");
|
|
4491
4506
|
}, i = () => {
|
|
4492
|
-
|
|
4493
|
-
},
|
|
4507
|
+
o(), e("close");
|
|
4508
|
+
}, o = () => {
|
|
4494
4509
|
this.removeEventListener("zs3-dialog-accept", t), this.removeEventListener("zs3-dialog-cancel", s), this.removeEventListener("zs3-dialog-close", i);
|
|
4495
4510
|
};
|
|
4496
4511
|
this.addEventListener("zs3-dialog-accept", t), this.addEventListener("zs3-dialog-cancel", s), this.addEventListener("zs3-dialog-close", i), this.show();
|
|
@@ -4550,8 +4565,8 @@ let d = class extends M {
|
|
|
4550
4565
|
static prompt(e, t, s) {
|
|
4551
4566
|
const i = new d();
|
|
4552
4567
|
i.title = e, i.showAccept = !0, i.showCancel = !0, i.size = "medium", i.setAttribute("i18n-accept-text", "zs3.dialog.accept"), i.setAttribute("i18n-cancel-text", "zs3.dialog.cancel");
|
|
4553
|
-
let
|
|
4554
|
-
return t ? i.appendChild(t) : (
|
|
4568
|
+
let o = null;
|
|
4569
|
+
return t ? i.appendChild(t) : (o = document.createElement("input"), o.type = "text", o.placeholder = s ?? "", o.style.cssText = `
|
|
4555
4570
|
width: 100%;
|
|
4556
4571
|
padding: 0.5rem 0.75rem;
|
|
4557
4572
|
border: 1px solid var(--zs3-border-color, #d1d5db);
|
|
@@ -4559,13 +4574,13 @@ let d = class extends M {
|
|
|
4559
4574
|
font-size: 1rem;
|
|
4560
4575
|
outline: none;
|
|
4561
4576
|
box-sizing: border-box;
|
|
4562
|
-
`,
|
|
4563
|
-
|
|
4564
|
-
}),
|
|
4565
|
-
|
|
4566
|
-
}), i.appendChild(
|
|
4567
|
-
const a =
|
|
4568
|
-
return i.remove(),
|
|
4577
|
+
`, o.addEventListener("focus", () => {
|
|
4578
|
+
o.style.borderColor = "var(--zs3-primary-color, #3b82f6)", o.style.boxShadow = "0 0 0 2px rgba(59, 130, 246, 0.2)";
|
|
4579
|
+
}), o.addEventListener("blur", () => {
|
|
4580
|
+
o.style.borderColor = "var(--zs3-border-color, #d1d5db)", o.style.boxShadow = "none";
|
|
4581
|
+
}), i.appendChild(o)), document.body.appendChild(i), o && setTimeout(() => o.focus(), 100), i.showDialog().then((r) => {
|
|
4582
|
+
const a = o ? o.value : null;
|
|
4583
|
+
return i.remove(), r === "accept" ? a : null;
|
|
4569
4584
|
});
|
|
4570
4585
|
}
|
|
4571
4586
|
/**
|
|
@@ -4590,8 +4605,8 @@ let d = class extends M {
|
|
|
4590
4605
|
}), s.addEventListener("blur", () => {
|
|
4591
4606
|
s.style.borderColor = "var(--zs3-border-color, #d1d5db)", s.style.boxShadow = "none";
|
|
4592
4607
|
}), t.appendChild(s)), document.body.appendChild(t), s && setTimeout(() => s.focus(), 100), t.showDialog().then((i) => {
|
|
4593
|
-
const
|
|
4594
|
-
return t.remove(), i === "accept" ?
|
|
4608
|
+
const o = s ? s.value : null;
|
|
4609
|
+
return t.remove(), i === "accept" ? o : null;
|
|
4595
4610
|
});
|
|
4596
4611
|
}
|
|
4597
4612
|
/**
|
|
@@ -4616,66 +4631,66 @@ let d = class extends M {
|
|
|
4616
4631
|
return e.title && (t.title = e.title), e.message && (t.message = e.message), e.acceptText && (t.acceptText = e.acceptText), e.cancelText && (t.cancelText = e.cancelText), e.closeText && (t.closeText = e.closeText), e.i18nTitle && (t.i18nTitle = e.i18nTitle), e.i18nMessage && (t.i18nMessage = e.i18nMessage), e.i18nAcceptText && (t.i18nAcceptText = e.i18nAcceptText), e.i18nCancelText && (t.i18nCancelText = e.i18nCancelText), e.i18nCloseText && (t.i18nCloseText = e.i18nCloseText), e.showAccept !== void 0 && (t.showAccept = e.showAccept), e.showCancel !== void 0 && (t.showCancel = e.showCancel), e.showClose !== void 0 && (t.showClose = e.showClose), e.acceptVariant && (t.acceptVariant = e.acceptVariant), e.cancelVariant && (t.cancelVariant = e.cancelVariant), e.icon && (t.icon = e.icon), t;
|
|
4617
4632
|
}
|
|
4618
4633
|
};
|
|
4619
|
-
|
|
4634
|
+
z([
|
|
4620
4635
|
n("title", { type: "string", default: "" })
|
|
4621
4636
|
], d.prototype, "title", 2);
|
|
4622
|
-
|
|
4637
|
+
z([
|
|
4623
4638
|
n("message", { type: "string", default: "" })
|
|
4624
4639
|
], d.prototype, "message", 2);
|
|
4625
|
-
|
|
4640
|
+
z([
|
|
4626
4641
|
n("show-accept", { type: "boolean" })
|
|
4627
4642
|
], d.prototype, "showAccept", 2);
|
|
4628
|
-
|
|
4643
|
+
z([
|
|
4629
4644
|
n("show-cancel", { type: "boolean" })
|
|
4630
4645
|
], d.prototype, "showCancel", 2);
|
|
4631
|
-
|
|
4646
|
+
z([
|
|
4632
4647
|
n("show-close", { type: "boolean" })
|
|
4633
4648
|
], d.prototype, "showClose", 2);
|
|
4634
|
-
|
|
4649
|
+
z([
|
|
4635
4650
|
n("accept-text", { type: "string", default: "Accept" })
|
|
4636
4651
|
], d.prototype, "acceptText", 2);
|
|
4637
|
-
|
|
4652
|
+
z([
|
|
4638
4653
|
n("cancel-text", { type: "string", default: "Cancel" })
|
|
4639
4654
|
], d.prototype, "cancelText", 2);
|
|
4640
|
-
|
|
4655
|
+
z([
|
|
4641
4656
|
n("close-text", { type: "string", default: "Close" })
|
|
4642
4657
|
], d.prototype, "closeText", 2);
|
|
4643
|
-
|
|
4658
|
+
z([
|
|
4644
4659
|
n("accept-variant", { type: "string", default: "primary" })
|
|
4645
4660
|
], d.prototype, "acceptVariant", 2);
|
|
4646
|
-
|
|
4661
|
+
z([
|
|
4647
4662
|
n("cancel-variant", { type: "string", default: "secondary" })
|
|
4648
4663
|
], d.prototype, "cancelVariant", 2);
|
|
4649
|
-
|
|
4664
|
+
z([
|
|
4650
4665
|
n("icon", { type: "string" })
|
|
4651
4666
|
], d.prototype, "icon", 2);
|
|
4652
|
-
|
|
4667
|
+
z([
|
|
4653
4668
|
n("i18n-title", { type: "string" })
|
|
4654
4669
|
], d.prototype, "i18nTitle", 2);
|
|
4655
|
-
|
|
4670
|
+
z([
|
|
4656
4671
|
n("i18n-message", { type: "string" })
|
|
4657
4672
|
], d.prototype, "i18nMessage", 2);
|
|
4658
|
-
|
|
4673
|
+
z([
|
|
4659
4674
|
n("i18n-accept-text", { type: "string" })
|
|
4660
4675
|
], d.prototype, "i18nAcceptText", 2);
|
|
4661
|
-
|
|
4676
|
+
z([
|
|
4662
4677
|
n("i18n-cancel-text", { type: "string" })
|
|
4663
4678
|
], d.prototype, "i18nCancelText", 2);
|
|
4664
|
-
|
|
4679
|
+
z([
|
|
4665
4680
|
n("i18n-close-text", { type: "string" })
|
|
4666
4681
|
], d.prototype, "i18nCloseText", 2);
|
|
4667
|
-
d =
|
|
4668
|
-
|
|
4669
|
-
|
|
4682
|
+
d = z([
|
|
4683
|
+
E("zs3-modal-dialog"),
|
|
4684
|
+
T(we, { inherit: !0 })
|
|
4670
4685
|
], d);
|
|
4671
4686
|
customElements.get("zs3-modal-dialog") || customElements.define("zs3-modal-dialog", d);
|
|
4672
4687
|
typeof window < "u" && (window.$ModalDialog = d);
|
|
4673
|
-
var
|
|
4674
|
-
for (var
|
|
4675
|
-
(a = e[
|
|
4676
|
-
return i &&
|
|
4688
|
+
var xe = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, _ = (e, t, s, i) => {
|
|
4689
|
+
for (var o = i > 1 ? void 0 : i ? Ee(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
4690
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
4691
|
+
return i && o && xe(t, s, o), o;
|
|
4677
4692
|
};
|
|
4678
|
-
const
|
|
4693
|
+
const Te = [
|
|
4679
4694
|
"type",
|
|
4680
4695
|
"title",
|
|
4681
4696
|
"message",
|
|
@@ -4689,7 +4704,7 @@ const be = [
|
|
|
4689
4704
|
"i18n-message",
|
|
4690
4705
|
"i18n-close-label"
|
|
4691
4706
|
];
|
|
4692
|
-
let
|
|
4707
|
+
let u = class extends P {
|
|
4693
4708
|
/**
|
|
4694
4709
|
* Initializes the notification component
|
|
4695
4710
|
*/
|
|
@@ -4716,7 +4731,7 @@ let h = class extends k {
|
|
|
4716
4731
|
* After mount setup
|
|
4717
4732
|
*/
|
|
4718
4733
|
afterMount() {
|
|
4719
|
-
this.setupEventListeners(), this._shadowRoot &&
|
|
4734
|
+
this.setupEventListeners(), this._shadowRoot && w.updateRoot(this._shadowRoot), this.autoShow && this.show();
|
|
4720
4735
|
}
|
|
4721
4736
|
/**
|
|
4722
4737
|
* Before unmount cleanup
|
|
@@ -4728,9 +4743,9 @@ let h = class extends k {
|
|
|
4728
4743
|
* Setup event listeners
|
|
4729
4744
|
*/
|
|
4730
4745
|
setupEventListeners() {
|
|
4731
|
-
const e = this
|
|
4746
|
+
const e = this.$(".close-btn").$;
|
|
4732
4747
|
e && this.dismissible && this.addManagedEventListener(e, "click", this.handleDismiss.bind(this));
|
|
4733
|
-
const t = this
|
|
4748
|
+
const t = this.$(".notification").$;
|
|
4734
4749
|
t && this.addManagedEventListener(t, "click", (s) => {
|
|
4735
4750
|
s.target.classList.contains("close-btn") || this.emit("zs3-notification-click", {
|
|
4736
4751
|
notification: this,
|
|
@@ -4767,7 +4782,7 @@ let h = class extends k {
|
|
|
4767
4782
|
animateProgress() {
|
|
4768
4783
|
const e = () => {
|
|
4769
4784
|
if (!this._isVisible) return;
|
|
4770
|
-
const t = Date.now() - this._startTime, s = Math.min(t / this.duration * 100, 100), i = this
|
|
4785
|
+
const t = Date.now() - this._startTime, s = Math.min(t / this.duration * 100, 100), i = this.$(".progress-bar").$;
|
|
4771
4786
|
i && (i.style.width = `${s}%`), s < 100 && (this._progressAnimationFrame = requestAnimationFrame(e));
|
|
4772
4787
|
};
|
|
4773
4788
|
e();
|
|
@@ -4785,7 +4800,7 @@ let h = class extends k {
|
|
|
4785
4800
|
*/
|
|
4786
4801
|
render() {
|
|
4787
4802
|
if (!this.root) return;
|
|
4788
|
-
const e = this.getIconHTML(), t = this.getAttribute("i18n-close-label"), s = this.dismissible ? `<button class="close-btn" ${t ? `data-i18n-attr='{"aria-label":"${t}"}'` : 'aria-label="Close notification"'}>×</button>` : "", i = this.showProgress ? '<div class="progress-container"><div class="progress-bar"></div></div>' : "",
|
|
4803
|
+
const e = this.getIconHTML(), t = this.getAttribute("i18n-close-label"), s = this.dismissible ? `<button class="close-btn" ${t ? `data-i18n-attr='{"aria-label":"${t}"}'` : 'aria-label="Close notification"'}>×</button>` : "", i = this.showProgress ? '<div class="progress-container"><div class="progress-bar"></div></div>' : "", o = this.getAttribute("i18n-title"), r = o ? `<div class="notification-title" data-i18n="${o}"></div>` : this.title ? `<div class="notification-title">${this.title}</div>` : "", a = this.getAttribute("i18n-message"), c = a ? `<div class="notification-message" data-i18n="${a}"></div>` : `<div class="notification-message">${this.message || ""}</div>`;
|
|
4789
4804
|
this.setHTML(`
|
|
4790
4805
|
${this.getStyles()}
|
|
4791
4806
|
<div class="notification" role="alert" aria-live="polite">
|
|
@@ -4793,14 +4808,14 @@ let h = class extends k {
|
|
|
4793
4808
|
<div class="notification-content">
|
|
4794
4809
|
${e}
|
|
4795
4810
|
<div class="notification-text">
|
|
4796
|
-
${
|
|
4811
|
+
${r}
|
|
4797
4812
|
${c}
|
|
4798
4813
|
</div>
|
|
4799
4814
|
</div>
|
|
4800
4815
|
${i}
|
|
4801
4816
|
</div>
|
|
4802
4817
|
`);
|
|
4803
|
-
const l = this
|
|
4818
|
+
const l = this.$(".notification").$;
|
|
4804
4819
|
l && (l.className = `notification position-${this.position}`, this.type && l.classList.add(`type-${this.type}`)), this._mounted && this.setupEventListeners(), this.emitLifecycleEvent("zs3-rendered", { phase: "complete" });
|
|
4805
4820
|
}
|
|
4806
4821
|
/**
|
|
@@ -4941,9 +4956,19 @@ let h = class extends k {
|
|
|
4941
4956
|
transition: all var(--zs3-transition-fast, 150ms ease-in-out);
|
|
4942
4957
|
}
|
|
4943
4958
|
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4959
|
+
@media (hover: hover) {
|
|
4960
|
+
.close-btn:hover {
|
|
4961
|
+
opacity: 1;
|
|
4962
|
+
color: var(--zs3-fg-color, #111827);
|
|
4963
|
+
}
|
|
4964
|
+
}
|
|
4965
|
+
|
|
4966
|
+
/* Zona tàctil mínima (44px) per a dispositius amb punter gruixut */
|
|
4967
|
+
@media (pointer: coarse) {
|
|
4968
|
+
.close-btn {
|
|
4969
|
+
min-width: 2.75rem;
|
|
4970
|
+
min-height: 2.75rem;
|
|
4971
|
+
}
|
|
4947
4972
|
}
|
|
4948
4973
|
|
|
4949
4974
|
/* Progress bar */
|
|
@@ -5044,7 +5069,7 @@ let h = class extends k {
|
|
|
5044
5069
|
*/
|
|
5045
5070
|
show() {
|
|
5046
5071
|
this._isVisible || (this._isVisible = !0, this.className = `position-${this.position}`, requestAnimationFrame(() => {
|
|
5047
|
-
const e = this
|
|
5072
|
+
const e = this.$(".notification").$;
|
|
5048
5073
|
e && e.classList.add("visible");
|
|
5049
5074
|
}), this.resetAutoHideTimer(), this.emit("zs3-notification-show", {
|
|
5050
5075
|
notification: this,
|
|
@@ -5058,7 +5083,7 @@ let h = class extends k {
|
|
|
5058
5083
|
hide() {
|
|
5059
5084
|
if (!this._isVisible) return;
|
|
5060
5085
|
this._isVisible = !1, this.clearTimers();
|
|
5061
|
-
const e = this
|
|
5086
|
+
const e = this.$(".notification").$;
|
|
5062
5087
|
e && e.classList.remove("visible"), this.emit("zs3-notification-hide", {
|
|
5063
5088
|
notification: this,
|
|
5064
5089
|
type: this.type,
|
|
@@ -5090,84 +5115,84 @@ let h = class extends k {
|
|
|
5090
5115
|
* Create and show a success notification
|
|
5091
5116
|
*/
|
|
5092
5117
|
static success(e, t) {
|
|
5093
|
-
return
|
|
5118
|
+
return u.create({ ...t, type: "success", message: e });
|
|
5094
5119
|
}
|
|
5095
5120
|
/**
|
|
5096
5121
|
* Create and show an error notification
|
|
5097
5122
|
*/
|
|
5098
5123
|
static error(e, t) {
|
|
5099
|
-
return
|
|
5124
|
+
return u.create({ ...t, type: "error", message: e });
|
|
5100
5125
|
}
|
|
5101
5126
|
/**
|
|
5102
5127
|
* Create and show a warning notification
|
|
5103
5128
|
*/
|
|
5104
5129
|
static warning(e, t) {
|
|
5105
|
-
return
|
|
5130
|
+
return u.create({ ...t, type: "warning", message: e });
|
|
5106
5131
|
}
|
|
5107
5132
|
/**
|
|
5108
5133
|
* Create and show an info notification
|
|
5109
5134
|
*/
|
|
5110
5135
|
static info(e, t) {
|
|
5111
|
-
return
|
|
5136
|
+
return u.create({ ...t, type: "info", message: e });
|
|
5112
5137
|
}
|
|
5113
5138
|
/**
|
|
5114
5139
|
* Create a notification programmatically
|
|
5115
5140
|
*/
|
|
5116
5141
|
static create(e) {
|
|
5117
|
-
const t = new
|
|
5142
|
+
const t = new u();
|
|
5118
5143
|
return t.message = e.message, e.title && (t.title = e.title), e.type && (t.type = e.type), e.duration !== void 0 && (t.duration = e.duration), e.position && (t.position = e.position), e.dismissible !== void 0 && (t.dismissible = e.dismissible), e.showIcon !== void 0 && (t.showIcon = e.showIcon), e.showProgress !== void 0 && (t.showProgress = e.showProgress), e.i18nTitle && (t.i18nTitle = e.i18nTitle), e.i18nMessage && (t.i18nMessage = e.i18nMessage), e.i18nCloseLabel && (t.i18nCloseLabel = e.i18nCloseLabel), document.body.appendChild(t), t.show(), t;
|
|
5119
5144
|
}
|
|
5120
5145
|
};
|
|
5121
|
-
|
|
5146
|
+
u.DEFAULT_DURATION = 5e3;
|
|
5122
5147
|
_([
|
|
5123
5148
|
n("type", { type: "string", default: "info" })
|
|
5124
|
-
],
|
|
5149
|
+
], u.prototype, "type", 2);
|
|
5125
5150
|
_([
|
|
5126
5151
|
n("title", { type: "string", default: "" })
|
|
5127
|
-
],
|
|
5152
|
+
], u.prototype, "title", 2);
|
|
5128
5153
|
_([
|
|
5129
5154
|
n("message", { type: "string", default: "" })
|
|
5130
|
-
],
|
|
5155
|
+
], u.prototype, "message", 2);
|
|
5131
5156
|
_([
|
|
5132
5157
|
n("duration", { type: "number", default: 5e3 })
|
|
5133
|
-
],
|
|
5158
|
+
], u.prototype, "duration", 2);
|
|
5134
5159
|
_([
|
|
5135
5160
|
n("position", { type: "string", default: "top-center" })
|
|
5136
|
-
],
|
|
5161
|
+
], u.prototype, "position", 2);
|
|
5137
5162
|
_([
|
|
5138
5163
|
n("dismissible", { type: "boolean", default: !0 })
|
|
5139
|
-
],
|
|
5164
|
+
], u.prototype, "dismissible", 2);
|
|
5140
5165
|
_([
|
|
5141
5166
|
n("show-icon", { type: "boolean", default: !0 })
|
|
5142
|
-
],
|
|
5167
|
+
], u.prototype, "showIcon", 2);
|
|
5143
5168
|
_([
|
|
5144
5169
|
n("show-progress", { type: "boolean" })
|
|
5145
|
-
],
|
|
5170
|
+
], u.prototype, "showProgress", 2);
|
|
5146
5171
|
_([
|
|
5147
5172
|
n("auto-show", { type: "boolean" })
|
|
5148
|
-
],
|
|
5173
|
+
], u.prototype, "autoShow", 2);
|
|
5149
5174
|
_([
|
|
5150
5175
|
n("i18n-title", { type: "string" })
|
|
5151
|
-
],
|
|
5176
|
+
], u.prototype, "i18nTitle", 2);
|
|
5152
5177
|
_([
|
|
5153
5178
|
n("i18n-message", { type: "string" })
|
|
5154
|
-
],
|
|
5179
|
+
], u.prototype, "i18nMessage", 2);
|
|
5155
5180
|
_([
|
|
5156
5181
|
n("i18n-close-label", { type: "string" })
|
|
5157
|
-
],
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
],
|
|
5162
|
-
customElements.get("zs3-notification") || customElements.define("zs3-notification",
|
|
5163
|
-
typeof window < "u" && (window.$Notification =
|
|
5164
|
-
var
|
|
5165
|
-
for (var
|
|
5166
|
-
(a = e[
|
|
5167
|
-
return i &&
|
|
5182
|
+
], u.prototype, "i18nCloseLabel", 2);
|
|
5183
|
+
u = _([
|
|
5184
|
+
E("zs3-notification"),
|
|
5185
|
+
T(Te)
|
|
5186
|
+
], u);
|
|
5187
|
+
customElements.get("zs3-notification") || customElements.define("zs3-notification", u);
|
|
5188
|
+
typeof window < "u" && (window.$Notification = u);
|
|
5189
|
+
var _e = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, Lt = (e, t, s, i) => {
|
|
5190
|
+
for (var o = i > 1 ? void 0 : i ? Me(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
5191
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
5192
|
+
return i && o && _e(t, s, o), o;
|
|
5168
5193
|
};
|
|
5169
|
-
const
|
|
5170
|
-
let
|
|
5194
|
+
const Le = ["zs3-position"];
|
|
5195
|
+
let lt = class extends P {
|
|
5171
5196
|
constructor() {
|
|
5172
5197
|
super({
|
|
5173
5198
|
useShadowDOM: !0,
|
|
@@ -5178,24 +5203,24 @@ let it = class extends k {
|
|
|
5178
5203
|
this.setupEventListeners();
|
|
5179
5204
|
}
|
|
5180
5205
|
setupEventListeners() {
|
|
5181
|
-
const e = this
|
|
5206
|
+
const e = this.$("select").$;
|
|
5182
5207
|
e && this.addManagedEventListener(e, "change", () => {
|
|
5183
|
-
|
|
5208
|
+
w.setLocale(e.value);
|
|
5184
5209
|
});
|
|
5185
5210
|
}
|
|
5186
5211
|
onLocaleChange(e) {
|
|
5187
5212
|
this.updateSelectedValue();
|
|
5188
5213
|
}
|
|
5189
5214
|
updateSelectedValue() {
|
|
5190
|
-
const e = this
|
|
5191
|
-
e && (e.value =
|
|
5215
|
+
const e = this.$("select").$;
|
|
5216
|
+
e && (e.value = w.getLocale());
|
|
5192
5217
|
}
|
|
5193
5218
|
render() {
|
|
5194
5219
|
this.root && (this.root.innerHTML = this.getStyles() + this.getTemplate(), this.updateSelectedValue(), this._mounted && this.setupEventListeners());
|
|
5195
5220
|
}
|
|
5196
5221
|
getTemplate() {
|
|
5197
|
-
const e =
|
|
5198
|
-
return `<select aria-label="Select language">${
|
|
5222
|
+
const e = w.getLocale();
|
|
5223
|
+
return `<select aria-label="Select language">${w.getAvailableLocales().map(
|
|
5199
5224
|
(i) => `<option value="${i}"${i === e ? " selected" : ""}>${i}</option>`
|
|
5200
5225
|
).join("")}</select>`;
|
|
5201
5226
|
}
|
|
@@ -5234,20 +5259,20 @@ let it = class extends k {
|
|
|
5234
5259
|
`;
|
|
5235
5260
|
}
|
|
5236
5261
|
};
|
|
5237
|
-
|
|
5262
|
+
Lt([
|
|
5238
5263
|
n("zs3-position", { type: "string" })
|
|
5239
|
-
],
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
],
|
|
5244
|
-
typeof window < "u" && (window.$SelectLocale =
|
|
5245
|
-
var
|
|
5246
|
-
for (var
|
|
5247
|
-
(a = e[
|
|
5248
|
-
return i &&
|
|
5264
|
+
], lt.prototype, "zs3Position", 2);
|
|
5265
|
+
lt = Lt([
|
|
5266
|
+
E("zs3-select-locale"),
|
|
5267
|
+
T(Le)
|
|
5268
|
+
], lt);
|
|
5269
|
+
typeof window < "u" && (window.$SelectLocale = lt);
|
|
5270
|
+
var $e = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, $t = (e, t, s, i) => {
|
|
5271
|
+
for (var o = i > 1 ? void 0 : i ? Ce(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
5272
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
5273
|
+
return i && o && $e(t, s, o), o;
|
|
5249
5274
|
};
|
|
5250
|
-
const
|
|
5275
|
+
const Ae = ["zs3-position"], Se = [
|
|
5251
5276
|
{ value: "light", label: "Light" },
|
|
5252
5277
|
{ value: "light-blue", label: "Light Blue" },
|
|
5253
5278
|
{ value: "dark", label: "Dark" },
|
|
@@ -5256,7 +5281,7 @@ const xe = ["zs3-position"], Ee = [
|
|
|
5256
5281
|
{ value: "high-contrast", label: "High Contrast" },
|
|
5257
5282
|
{ value: "system", label: "System" }
|
|
5258
5283
|
];
|
|
5259
|
-
let
|
|
5284
|
+
let ct = class extends P {
|
|
5260
5285
|
constructor() {
|
|
5261
5286
|
super({
|
|
5262
5287
|
useShadowDOM: !0,
|
|
@@ -5267,24 +5292,24 @@ let rt = class extends k {
|
|
|
5267
5292
|
this.setupEventListeners();
|
|
5268
5293
|
}
|
|
5269
5294
|
setupEventListeners() {
|
|
5270
|
-
const e = this
|
|
5295
|
+
const e = this.$("select").$;
|
|
5271
5296
|
e && this.addManagedEventListener(e, "change", () => {
|
|
5272
|
-
|
|
5297
|
+
Z.setTheme(e.value);
|
|
5273
5298
|
});
|
|
5274
5299
|
}
|
|
5275
5300
|
onThemeChange(e) {
|
|
5276
5301
|
this.updateSelectedValue();
|
|
5277
5302
|
}
|
|
5278
5303
|
updateSelectedValue() {
|
|
5279
|
-
const e = this
|
|
5280
|
-
e && (e.value =
|
|
5304
|
+
const e = this.$("select").$;
|
|
5305
|
+
e && (e.value = Z.getTheme());
|
|
5281
5306
|
}
|
|
5282
5307
|
render() {
|
|
5283
5308
|
this.root && (this.root.innerHTML = this.getStyles() + this.getTemplate(), this.updateSelectedValue(), this._mounted && this.setupEventListeners());
|
|
5284
5309
|
}
|
|
5285
5310
|
getTemplate() {
|
|
5286
|
-
const e =
|
|
5287
|
-
return `<select aria-label="Select theme">${
|
|
5311
|
+
const e = Z.getTheme();
|
|
5312
|
+
return `<select aria-label="Select theme">${Se.map(
|
|
5288
5313
|
(s) => `<option value="${s.value}"${s.value === e ? " selected" : ""}>${s.label}</option>`
|
|
5289
5314
|
).join("")}</select>`;
|
|
5290
5315
|
}
|
|
@@ -5323,20 +5348,20 @@ let rt = class extends k {
|
|
|
5323
5348
|
`;
|
|
5324
5349
|
}
|
|
5325
5350
|
};
|
|
5326
|
-
|
|
5351
|
+
$t([
|
|
5327
5352
|
n("zs3-position", { type: "string" })
|
|
5328
|
-
],
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
],
|
|
5333
|
-
typeof window < "u" && (window.$SelectTheme =
|
|
5334
|
-
var
|
|
5335
|
-
for (var
|
|
5336
|
-
(a = e[
|
|
5337
|
-
return i &&
|
|
5353
|
+
], ct.prototype, "zs3Position", 2);
|
|
5354
|
+
ct = $t([
|
|
5355
|
+
E("zs3-select-theme"),
|
|
5356
|
+
T(Ae)
|
|
5357
|
+
], ct);
|
|
5358
|
+
typeof window < "u" && (window.$SelectTheme = ct);
|
|
5359
|
+
var ke = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, R = (e, t, s, i) => {
|
|
5360
|
+
for (var o = i > 1 ? void 0 : i ? Pe(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
5361
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
5362
|
+
return i && o && ke(t, s, o), o;
|
|
5338
5363
|
};
|
|
5339
|
-
const
|
|
5364
|
+
const De = [
|
|
5340
5365
|
"direction",
|
|
5341
5366
|
"float",
|
|
5342
5367
|
"move",
|
|
@@ -5357,7 +5382,7 @@ const Me = [
|
|
|
5357
5382
|
"zs3-move-cancel",
|
|
5358
5383
|
"zs3-move-boundary"
|
|
5359
5384
|
];
|
|
5360
|
-
let
|
|
5385
|
+
let S = class extends P {
|
|
5361
5386
|
/**
|
|
5362
5387
|
* Initializes the toolbar component
|
|
5363
5388
|
*/
|
|
@@ -5377,7 +5402,7 @@ let L = class extends k {
|
|
|
5377
5402
|
* After mount setup
|
|
5378
5403
|
*/
|
|
5379
5404
|
afterMount() {
|
|
5380
|
-
this.setupSlotObserver(), this.updateButtonsList(), this.setupButtonListeners(), this._shadowRoot &&
|
|
5405
|
+
this.setupSlotObserver(), this.updateButtonsList(), this.setupButtonListeners(), this._shadowRoot && w.updateRoot(this._shadowRoot);
|
|
5381
5406
|
}
|
|
5382
5407
|
/**
|
|
5383
5408
|
* Before unmount cleanup
|
|
@@ -5436,7 +5461,7 @@ let L = class extends k {
|
|
|
5436
5461
|
<slot></slot>
|
|
5437
5462
|
</div>
|
|
5438
5463
|
`);
|
|
5439
|
-
const i = this
|
|
5464
|
+
const i = this.$(".toolbar").$;
|
|
5440
5465
|
i && (i.className = "toolbar", i.classList.add(this.direction), this.variant && i.classList.add(`variant-${this.variant}`), this.rounded && i.classList.add("rounded"), this.align && i.classList.add(`align-${this.align}`), this.float && i.classList.add(`float-${this.float}`)), this.emitLifecycleEvent("zs3-rendered", { phase: "complete" });
|
|
5441
5466
|
}
|
|
5442
5467
|
/**
|
|
@@ -5465,8 +5490,10 @@ let L = class extends k {
|
|
|
5465
5490
|
transition: all var(--zs3-transition-slow, 150ms ease-in-out);
|
|
5466
5491
|
}
|
|
5467
5492
|
|
|
5468
|
-
|
|
5469
|
-
|
|
5493
|
+
@media (hover: hover) {
|
|
5494
|
+
.toolbar:hover {
|
|
5495
|
+
box-shadow: var(--zs3-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
|
|
5496
|
+
}
|
|
5470
5497
|
}
|
|
5471
5498
|
|
|
5472
5499
|
/* Directions */
|
|
@@ -5675,39 +5702,39 @@ let L = class extends k {
|
|
|
5675
5702
|
};
|
|
5676
5703
|
R([
|
|
5677
5704
|
n("direction", { type: "string", default: "row" })
|
|
5678
|
-
],
|
|
5705
|
+
], S.prototype, "direction", 2);
|
|
5679
5706
|
R([
|
|
5680
5707
|
n("float", { type: "string" })
|
|
5681
|
-
],
|
|
5708
|
+
], S.prototype, "float", 2);
|
|
5682
5709
|
R([
|
|
5683
5710
|
n("align", { type: "string" })
|
|
5684
|
-
],
|
|
5711
|
+
], S.prototype, "align", 2);
|
|
5685
5712
|
R([
|
|
5686
5713
|
n("gap", { type: "string" })
|
|
5687
|
-
],
|
|
5714
|
+
], S.prototype, "gap", 2);
|
|
5688
5715
|
R([
|
|
5689
5716
|
n("variant", { type: "string" })
|
|
5690
|
-
],
|
|
5717
|
+
], S.prototype, "variant", 2);
|
|
5691
5718
|
R([
|
|
5692
5719
|
n("rounded", { type: "boolean" })
|
|
5693
|
-
],
|
|
5720
|
+
], S.prototype, "rounded", 2);
|
|
5694
5721
|
R([
|
|
5695
5722
|
n("i18n-aria-label", { type: "string" })
|
|
5696
|
-
],
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
],
|
|
5703
|
-
customElements.get("zs3-toolbar") || customElements.define("zs3-toolbar",
|
|
5704
|
-
typeof window < "u" && (window.$Toolbar =
|
|
5705
|
-
var
|
|
5706
|
-
for (var
|
|
5707
|
-
(a = e[
|
|
5708
|
-
return i &&
|
|
5723
|
+
], S.prototype, "i18nAriaLabel", 2);
|
|
5724
|
+
S = R([
|
|
5725
|
+
E("zs3-toolbar"),
|
|
5726
|
+
T(De),
|
|
5727
|
+
Mt(".toolbar"),
|
|
5728
|
+
Yt(":host")
|
|
5729
|
+
], S);
|
|
5730
|
+
customElements.get("zs3-toolbar") || customElements.define("zs3-toolbar", S);
|
|
5731
|
+
typeof window < "u" && (window.$Toolbar = S);
|
|
5732
|
+
var He = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, O = (e, t, s, i) => {
|
|
5733
|
+
for (var o = i > 1 ? void 0 : i ? Re(t, s) : t, r = e.length - 1, a; r >= 0; r--)
|
|
5734
|
+
(a = e[r]) && (o = (i ? a(t, s, o) : a(o)) || o);
|
|
5735
|
+
return i && o && He(t, s, o), o;
|
|
5709
5736
|
};
|
|
5710
|
-
let
|
|
5737
|
+
let k = class extends P {
|
|
5711
5738
|
/**
|
|
5712
5739
|
* Initializes the window component
|
|
5713
5740
|
*/
|
|
@@ -5727,21 +5754,21 @@ let C = class extends k {
|
|
|
5727
5754
|
* After mount setup
|
|
5728
5755
|
*/
|
|
5729
5756
|
afterMount() {
|
|
5730
|
-
this.setupEventListeners(), this._shadowRoot &&
|
|
5757
|
+
this.setupEventListeners(), this._shadowRoot && w.updateRoot(this._shadowRoot);
|
|
5731
5758
|
}
|
|
5732
5759
|
/**
|
|
5733
5760
|
* Setup event listeners
|
|
5734
5761
|
*/
|
|
5735
5762
|
setupEventListeners() {
|
|
5736
|
-
const e = this
|
|
5763
|
+
const e = this.$(".btn-close").$;
|
|
5737
5764
|
e && this.addManagedEventListener(e, "click", (i) => {
|
|
5738
5765
|
i.stopPropagation(), this.emit("zs3-window-close", { window: this });
|
|
5739
5766
|
});
|
|
5740
|
-
const t = this
|
|
5767
|
+
const t = this.$(".btn-minimize").$;
|
|
5741
5768
|
t && this.addManagedEventListener(t, "click", (i) => {
|
|
5742
5769
|
i.stopPropagation(), this.emit("zs3-window-minimize", { window: this });
|
|
5743
5770
|
});
|
|
5744
|
-
const s = this
|
|
5771
|
+
const s = this.$(".btn-maximize").$;
|
|
5745
5772
|
s && this.addManagedEventListener(s, "click", (i) => {
|
|
5746
5773
|
i.stopPropagation(), this.emit("zs3-window-maximize", { window: this });
|
|
5747
5774
|
});
|
|
@@ -5839,12 +5866,24 @@ let C = class extends k {
|
|
|
5839
5866
|
transition: background-color var(--zs3-transition-fast, 150ms ease-in-out);
|
|
5840
5867
|
}
|
|
5841
5868
|
|
|
5842
|
-
|
|
5843
|
-
|
|
5869
|
+
@media (hover: hover) {
|
|
5870
|
+
.controls button:hover {
|
|
5871
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
5872
|
+
}
|
|
5873
|
+
|
|
5874
|
+
.btn-close:hover {
|
|
5875
|
+
background-color: var(--zs3-error-color, #ef4444) !important;
|
|
5876
|
+
}
|
|
5844
5877
|
}
|
|
5845
5878
|
|
|
5846
|
-
|
|
5847
|
-
|
|
5879
|
+
/* Zones tàctils mínimes (44px) per a dispositius amb punter gruixut */
|
|
5880
|
+
@media (pointer: coarse) {
|
|
5881
|
+
.controls button {
|
|
5882
|
+
min-width: 2.75rem;
|
|
5883
|
+
min-height: 2.75rem;
|
|
5884
|
+
width: auto;
|
|
5885
|
+
height: auto;
|
|
5886
|
+
}
|
|
5848
5887
|
}
|
|
5849
5888
|
|
|
5850
5889
|
.content {
|
|
@@ -5881,28 +5920,28 @@ let C = class extends k {
|
|
|
5881
5920
|
};
|
|
5882
5921
|
O([
|
|
5883
5922
|
n("title", { type: "string" })
|
|
5884
|
-
],
|
|
5923
|
+
], k.prototype, "windowTitle", 2);
|
|
5885
5924
|
O([
|
|
5886
5925
|
n("width", { type: "string" })
|
|
5887
|
-
],
|
|
5926
|
+
], k.prototype, "width", 2);
|
|
5888
5927
|
O([
|
|
5889
5928
|
n("height", { type: "string" })
|
|
5890
|
-
],
|
|
5929
|
+
], k.prototype, "height", 2);
|
|
5891
5930
|
O([
|
|
5892
5931
|
n("closable", { type: "boolean" })
|
|
5893
|
-
],
|
|
5932
|
+
], k.prototype, "closable", 2);
|
|
5894
5933
|
O([
|
|
5895
5934
|
n("minimizable", { type: "boolean" })
|
|
5896
|
-
],
|
|
5935
|
+
], k.prototype, "minimizable", 2);
|
|
5897
5936
|
O([
|
|
5898
5937
|
n("maximizable", { type: "boolean" })
|
|
5899
|
-
],
|
|
5938
|
+
], k.prototype, "maximizable", 2);
|
|
5900
5939
|
O([
|
|
5901
5940
|
n("i18n-title", { type: "string" })
|
|
5902
|
-
],
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5941
|
+
], k.prototype, "i18nTitle", 2);
|
|
5942
|
+
k = O([
|
|
5943
|
+
E("zs3-window"),
|
|
5944
|
+
T([
|
|
5906
5945
|
"title",
|
|
5907
5946
|
"width",
|
|
5908
5947
|
"height",
|
|
@@ -5918,64 +5957,64 @@ C = O([
|
|
|
5918
5957
|
"zs3-move-cancel",
|
|
5919
5958
|
"zs3-move-boundary"
|
|
5920
5959
|
])
|
|
5921
|
-
],
|
|
5922
|
-
customElements.get("zs3-window") || customElements.define("zs3-window",
|
|
5923
|
-
typeof window < "u" && (window.$Window =
|
|
5960
|
+
], k);
|
|
5961
|
+
customElements.get("zs3-window") || customElements.define("zs3-window", k);
|
|
5962
|
+
typeof window < "u" && (window.$Window = k);
|
|
5924
5963
|
export {
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5964
|
+
N as $,
|
|
5965
|
+
P as $BaseComponent,
|
|
5966
|
+
g as $Button,
|
|
5967
|
+
St as $Debug,
|
|
5968
|
+
p as $Form,
|
|
5969
|
+
Ft as $I18n,
|
|
5970
|
+
y as $Icon,
|
|
5971
|
+
kt as $Log,
|
|
5933
5972
|
H as $LoginForm,
|
|
5934
|
-
|
|
5973
|
+
A as $Modal,
|
|
5935
5974
|
d as $ModalDialog,
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5975
|
+
u as $Notification,
|
|
5976
|
+
At as $Parameters,
|
|
5977
|
+
st as $RecoverPasswordForm,
|
|
5978
|
+
et as $RegisterForm,
|
|
5979
|
+
lt as $SelectLocale,
|
|
5980
|
+
ct as $SelectTheme,
|
|
5981
|
+
Pt as $Storage,
|
|
5982
|
+
Be as $Store,
|
|
5983
|
+
S as $Toolbar,
|
|
5984
|
+
k as $Window,
|
|
5985
|
+
Oe as $env,
|
|
5986
|
+
E as Component,
|
|
5987
|
+
mt as DEFAULT_FALLBACK_LOCALE,
|
|
5988
|
+
pt as DEFAULT_LOCALE,
|
|
5989
|
+
Bt as DIContainer,
|
|
5990
|
+
Ot as EventBus,
|
|
5991
|
+
Mt as Float,
|
|
5992
|
+
qe as HttpClient,
|
|
5993
|
+
J as HttpError,
|
|
5994
|
+
Yt as Move,
|
|
5995
|
+
T as ObservedAttributes,
|
|
5996
|
+
Ue as Router,
|
|
5997
|
+
Rt as ThemeChangeEvent,
|
|
5998
|
+
X as ThemeManager,
|
|
5999
|
+
C as ZS3,
|
|
6000
|
+
Ht as debug,
|
|
6001
|
+
ut as defaultTranslations,
|
|
6002
|
+
Ne as diContainer,
|
|
6003
|
+
Kt as disableMove,
|
|
6004
|
+
je as eventBus,
|
|
6005
|
+
It as float,
|
|
6006
|
+
We as generateEvent,
|
|
6007
|
+
Fe as getCSSVariable,
|
|
6008
|
+
Ye as getMoveDirection,
|
|
6009
|
+
Vt as getRegisteredComponents,
|
|
6010
|
+
w as i18n,
|
|
6011
|
+
Tt as initThemeSystem,
|
|
6012
|
+
Ke as isMoveEnabled,
|
|
6013
|
+
ft as log,
|
|
6014
|
+
qt as move,
|
|
6015
|
+
Dt as params,
|
|
6016
|
+
Ie as setCSSVariable,
|
|
6017
|
+
tt as storage,
|
|
6018
|
+
Z as themeManager,
|
|
6019
|
+
Ve as withThemeSupport
|
|
5981
6020
|
};
|