@albi_scando/as-design-system-lib 1.7.4 → 1.7.6
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.
|
@@ -126,7 +126,7 @@ const E = {
|
|
|
126
126
|
t !== void 0 && document.body.classList.add(t);
|
|
127
127
|
}, F = () => {
|
|
128
128
|
document.body.classList.remove(...Object.values(c));
|
|
129
|
-
}, z = "base-button",
|
|
129
|
+
}, z = "base-button", n = "", g = {
|
|
130
130
|
SHOW_MODAL: "show-modal",
|
|
131
131
|
CLOSE: "close"
|
|
132
132
|
}, B = {
|
|
@@ -215,49 +215,49 @@ class i extends HTMLElement {
|
|
|
215
215
|
return this.hasAttribute(i.autofocusAttribute);
|
|
216
216
|
}
|
|
217
217
|
set autofocus(t) {
|
|
218
|
-
t ? this.setAttribute(i.autofocusAttribute,
|
|
218
|
+
t ? this.setAttribute(i.autofocusAttribute, n) : this.removeAttribute(i.autofocusAttribute);
|
|
219
219
|
}
|
|
220
220
|
get command() {
|
|
221
|
-
return this.getAttribute(i.commandAttribute) ??
|
|
221
|
+
return this.getAttribute(i.commandAttribute) ?? n;
|
|
222
222
|
}
|
|
223
223
|
set command(t) {
|
|
224
224
|
this.setAttribute(i.commandAttribute, t);
|
|
225
225
|
}
|
|
226
226
|
get commandfor() {
|
|
227
|
-
return this.getAttribute(i.commandforAttribute) ??
|
|
227
|
+
return this.getAttribute(i.commandforAttribute) ?? n;
|
|
228
228
|
}
|
|
229
229
|
set commandfor(t) {
|
|
230
|
-
t !==
|
|
230
|
+
t !== n ? this.setAttribute(i.commandforAttribute, t) : this.removeAttribute(i.commandforAttribute);
|
|
231
231
|
}
|
|
232
232
|
get disabled() {
|
|
233
233
|
return this.hasAttribute(i.disabledAttribute);
|
|
234
234
|
}
|
|
235
235
|
set disabled(t) {
|
|
236
|
-
t ? this.setAttribute(i.disabledAttribute,
|
|
236
|
+
t ? this.setAttribute(i.disabledAttribute, n) : this.removeAttribute(i.disabledAttribute);
|
|
237
237
|
}
|
|
238
238
|
get name() {
|
|
239
|
-
return this.getAttribute(i.nameAttribute) ??
|
|
239
|
+
return this.getAttribute(i.nameAttribute) ?? n;
|
|
240
240
|
}
|
|
241
241
|
set name(t) {
|
|
242
|
-
t !==
|
|
242
|
+
t !== n ? this.setAttribute(i.nameAttribute, t) : this.removeAttribute(i.nameAttribute);
|
|
243
243
|
}
|
|
244
244
|
get headline() {
|
|
245
|
-
return this.getAttribute(i.titleAttribute) ??
|
|
245
|
+
return this.getAttribute(i.titleAttribute) ?? n;
|
|
246
246
|
}
|
|
247
247
|
set headline(t) {
|
|
248
|
-
t !==
|
|
248
|
+
t !== n ? this.setAttribute(i.titleAttribute, t) : this.removeAttribute(i.titleAttribute);
|
|
249
249
|
}
|
|
250
250
|
get type() {
|
|
251
251
|
return this.getAttribute(i.typeAttribute) ?? "button";
|
|
252
252
|
}
|
|
253
253
|
set type(t) {
|
|
254
|
-
t !==
|
|
254
|
+
t !== n ? this.setAttribute(i.typeAttribute, t) : this.removeAttribute(i.typeAttribute);
|
|
255
255
|
}
|
|
256
256
|
get value() {
|
|
257
257
|
return this.getAttribute(i.valueAttribute) ?? "button";
|
|
258
258
|
}
|
|
259
259
|
set value(t) {
|
|
260
|
-
t !==
|
|
260
|
+
t !== n ? this.setAttribute(i.valueAttribute, t) : this.removeAttribute(i.valueAttribute);
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
263
|
* Lifecycle hook invoked when the component is inserted into the DOM.
|
|
@@ -333,7 +333,7 @@ class i extends HTMLElement {
|
|
|
333
333
|
* @returns {void}
|
|
334
334
|
*/
|
|
335
335
|
_handleClick = () => {
|
|
336
|
-
if (this.command ===
|
|
336
|
+
if (this.command === n || this.commandfor === n)
|
|
337
337
|
return;
|
|
338
338
|
let t = document.getElementById(this.commandfor);
|
|
339
339
|
if (t ??= this._findElementInShadowDOM(this.commandfor), t === null)
|
|
@@ -360,17 +360,17 @@ class i extends HTMLElement {
|
|
|
360
360
|
let r = this.querySelector(s);
|
|
361
361
|
if (r !== null || (r = this._searchInShadowRootsOfChildren(this, s), r !== null))
|
|
362
362
|
return r;
|
|
363
|
-
let
|
|
364
|
-
for (;
|
|
365
|
-
if (r =
|
|
363
|
+
let o = this.parentElement;
|
|
364
|
+
for (; o !== null; ) {
|
|
365
|
+
if (r = o.querySelector(s), r !== null || (r = this._searchInShadowRootsOfChildren(o, s), r !== null))
|
|
366
366
|
return r;
|
|
367
|
-
const l =
|
|
367
|
+
const l = o.parentElement;
|
|
368
368
|
if (l !== null)
|
|
369
|
-
|
|
369
|
+
o = l;
|
|
370
370
|
else {
|
|
371
|
-
const a =
|
|
371
|
+
const a = o.getRootNode();
|
|
372
372
|
if (a instanceof ShadowRoot && a.host !== null)
|
|
373
|
-
|
|
373
|
+
o = a.host;
|
|
374
374
|
else
|
|
375
375
|
break;
|
|
376
376
|
}
|
|
@@ -398,12 +398,12 @@ class i extends HTMLElement {
|
|
|
398
398
|
if (a !== null)
|
|
399
399
|
return a;
|
|
400
400
|
}
|
|
401
|
-
const
|
|
401
|
+
const o = this._searchInShadowRootsOfChildren(
|
|
402
402
|
r,
|
|
403
403
|
e
|
|
404
404
|
);
|
|
405
|
-
if (
|
|
406
|
-
return
|
|
405
|
+
if (o !== null)
|
|
406
|
+
return o;
|
|
407
407
|
}
|
|
408
408
|
return null;
|
|
409
409
|
}
|
|
@@ -415,7 +415,7 @@ class i extends HTMLElement {
|
|
|
415
415
|
*/
|
|
416
416
|
_syncAttribute(t) {
|
|
417
417
|
const e = this.buttonElement;
|
|
418
|
-
e !== null && (this.hasAttribute(t) ? e.setAttribute(t, this.getAttribute(t) ??
|
|
418
|
+
e !== null && (this.hasAttribute(t) ? e.setAttribute(t, this.getAttribute(t) ?? n) : e.removeAttribute(t));
|
|
419
419
|
}
|
|
420
420
|
/**
|
|
421
421
|
* Syncs all observed attributes from host to button element.
|
|
@@ -641,11 +641,11 @@ const rt = "next-button", Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Obj
|
|
|
641
641
|
__proto__: null,
|
|
642
642
|
NextButtonComponent: w,
|
|
643
643
|
selector: rt
|
|
644
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
644
|
+
}, Symbol.toStringTag, { value: "Module" })), ot = `<dialog part="dialog">
|
|
645
645
|
<slot></slot>
|
|
646
646
|
</dialog>
|
|
647
|
-
`,
|
|
648
|
-
P.replaceSync(
|
|
647
|
+
`, nt = "*{box-sizing:border-box}dialog{background-color:var(--color-bg-primary);color:var(--color-text-primary);border:var(--border-width-1) solid var(--color-border-secondary);border-radius:var(--border-radius-xl);padding:var(--spacing-4);max-width:90vw;max-height:90vh;font-family:var(--font-family-base);line-height:var(--line-height-normal);font-size:var(--font-size-sm);box-shadow:var(--shadow-2xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:slideIn var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog.closing{animation:slideOut var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog::backdrop{background:var(--window-backdrop);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:fadeIn var(--transition-base) ease-out forwards}dialog.closing::backdrop{animation:fadeOut var(--transition-base) ease-out forwards}@keyframes slideIn{0%{opacity:0;transform:scale(.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes slideOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.95) translateY(-20px)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}", P = new CSSStyleSheet();
|
|
648
|
+
P.replaceSync(nt);
|
|
649
649
|
class v extends HTMLElement {
|
|
650
650
|
/**
|
|
651
651
|
* @see HTMLDialogElement.closedBy
|
|
@@ -731,7 +731,7 @@ class v extends HTMLElement {
|
|
|
731
731
|
* @returns {void}
|
|
732
732
|
*/
|
|
733
733
|
_render() {
|
|
734
|
-
this.shadowRoot !== null && (this.shadowRoot.innerHTML =
|
|
734
|
+
this.shadowRoot !== null && (this.shadowRoot.innerHTML = ot, this._syncAttributes());
|
|
735
735
|
}
|
|
736
736
|
/**
|
|
737
737
|
* Syncs a single attribute from host to dialog element.
|
|
@@ -741,7 +741,7 @@ class v extends HTMLElement {
|
|
|
741
741
|
*/
|
|
742
742
|
_syncAttribute(t) {
|
|
743
743
|
const e = this.dialogElement;
|
|
744
|
-
e != null && (this.hasAttribute(t) === !0 ? e.setAttribute(t, this.getAttribute(t) ??
|
|
744
|
+
e != null && (this.hasAttribute(t) === !0 ? e.setAttribute(t, this.getAttribute(t) ?? n) : e.removeAttribute(t));
|
|
745
745
|
}
|
|
746
746
|
/**
|
|
747
747
|
* Syncs all observed attributes from host to dialog element.
|
|
@@ -803,7 +803,7 @@ const at = "base-dialog", Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Obj
|
|
|
803
803
|
<slot name="footer"></slot>
|
|
804
804
|
</footer>
|
|
805
805
|
</dialog>
|
|
806
|
-
`, ct = '*{box-sizing:border-box}dialog[open]{display:flex;flex-direction:column;gap:var(--spacing-4)}dialog>[part]{position:relative}dialog>[part][hidden]{display:none}dialog>[part][data-divider=true]:after{content:"";position:absolute;left:0;right:0;bottom:0;border-bottom:var(--border-width-1) solid var(--color-neutral-600)}dialog>[part][data-divider=true]{padding-bottom:var(--spacing-4)}dialog div[part=body]{flex:1;min-height:0}', D = new CSSStyleSheet();
|
|
806
|
+
`, ct = '*{box-sizing:border-box}:host{display:block;width:auto;height:auto;max-width:100%;max-height:100%;box-sizing:border-box}dialog[open]{display:flex;flex-direction:column;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;gap:var(--spacing-4)}dialog>[part]{position:relative}dialog>[part][hidden]{display:none}dialog>[part][data-divider=true]:after{content:"";position:absolute;left:0;right:0;bottom:0;border-bottom:var(--border-width-1) solid var(--color-neutral-600)}dialog>[part][data-divider=true]{padding-bottom:var(--spacing-4)}dialog div[part=body]{flex:1;min-height:0}', D = new CSSStyleSheet();
|
|
807
807
|
D.replaceSync(ct);
|
|
808
808
|
class k extends v {
|
|
809
809
|
_sectionNames = ["header", "body", "footer"];
|
|
@@ -870,8 +870,8 @@ class k extends v {
|
|
|
870
870
|
);
|
|
871
871
|
if (s === null || r === null)
|
|
872
872
|
return;
|
|
873
|
-
const
|
|
874
|
-
s.toggleAttribute("hidden",
|
|
873
|
+
const o = r.assignedNodes({ flatten: !0 }).some((l) => l.nodeType === Node.TEXT_NODE ? l.textContent?.trim().length !== 0 : l.nodeType === Node.ELEMENT_NODE);
|
|
874
|
+
s.toggleAttribute("hidden", o === !1), s.dataset.filled = String(o), s.removeAttribute("data-divider"), o === !0 && t.push(s);
|
|
875
875
|
}), t.slice(0, -1).forEach((e) => {
|
|
876
876
|
e.dataset.divider = "true";
|
|
877
877
|
});
|
|
@@ -883,11 +883,11 @@ class u extends k {
|
|
|
883
883
|
/**
|
|
884
884
|
* The title of the confirmation dialog.
|
|
885
885
|
*/
|
|
886
|
-
_headline =
|
|
886
|
+
_headline = n;
|
|
887
887
|
/**
|
|
888
888
|
* The text content of the confirmation dialog.
|
|
889
889
|
*/
|
|
890
|
-
_text =
|
|
890
|
+
_text = n;
|
|
891
891
|
/**
|
|
892
892
|
* The value associated with the confirmation action, emitted in the confirm event.
|
|
893
893
|
*/
|
|
@@ -967,13 +967,13 @@ class u extends k {
|
|
|
967
967
|
if (u.observedAttributes.includes(t))
|
|
968
968
|
switch (t) {
|
|
969
969
|
case u.headlineAttribute: {
|
|
970
|
-
this._headline = this.getAttribute(t) ??
|
|
970
|
+
this._headline = this.getAttribute(t) ?? n;
|
|
971
971
|
const e = this.shadowRoot?.querySelector("h2");
|
|
972
972
|
e != null && (e.textContent = this._headline);
|
|
973
973
|
break;
|
|
974
974
|
}
|
|
975
975
|
case u.textAttribute: {
|
|
976
|
-
this._text = this.getAttribute(t) ??
|
|
976
|
+
this._text = this.getAttribute(t) ?? n;
|
|
977
977
|
const e = this.shadowRoot?.querySelector("p");
|
|
978
978
|
e != null && (e.textContent = this._text);
|
|
979
979
|
break;
|
|
@@ -1106,7 +1106,7 @@ class h extends HTMLElement {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
get visibleButtons() {
|
|
1108
1108
|
const t = this.getAttribute(h._visibleCountAttribute);
|
|
1109
|
-
if (t !== null && t !==
|
|
1109
|
+
if (t !== null && t !== n) {
|
|
1110
1110
|
const e = parseInt(t, 10);
|
|
1111
1111
|
return Math.max(this._MIN_VISIBLE, Math.min(this._MAX_VISIBLE, e));
|
|
1112
1112
|
}
|
|
@@ -1125,7 +1125,7 @@ class h extends HTMLElement {
|
|
|
1125
1125
|
set cyclicalNavigation(t) {
|
|
1126
1126
|
t ? this.setAttribute(
|
|
1127
1127
|
h._cyclicalNavigationAttribute,
|
|
1128
|
-
|
|
1128
|
+
n
|
|
1129
1129
|
) : this.removeAttribute(h._cyclicalNavigationAttribute);
|
|
1130
1130
|
}
|
|
1131
1131
|
/**
|
|
@@ -1209,25 +1209,25 @@ class h extends HTMLElement {
|
|
|
1209
1209
|
* Update button visibility by showing/hiding rows with fade
|
|
1210
1210
|
*/
|
|
1211
1211
|
_updateButtonVisibility(t) {
|
|
1212
|
-
const e = this._getSlottedButtons(), s = e.length, r = this.visibleButtons,
|
|
1212
|
+
const e = this._getSlottedButtons(), s = e.length, r = this.visibleButtons, o = this._currentIndex, l = Math.min(o + r, s);
|
|
1213
1213
|
e.forEach((a, d) => {
|
|
1214
|
-
const y = d >=
|
|
1214
|
+
const y = d >= o && d < l, p = a;
|
|
1215
1215
|
y || (a.classList.remove("visible-button"), a.classList.remove("animating"), p.style.display = "none");
|
|
1216
1216
|
}), t !== void 0 ? (e[0]?.offsetHeight, e.forEach((a, d) => {
|
|
1217
|
-
if (d >=
|
|
1217
|
+
if (d >= o && d < l) {
|
|
1218
1218
|
const p = a;
|
|
1219
1219
|
p.style.display = "inline-flex", a.classList.add("animating");
|
|
1220
1220
|
const K = d % this.visibleButtons * 50;
|
|
1221
1221
|
p.style.transitionDelay = `${K}ms`;
|
|
1222
1222
|
}
|
|
1223
1223
|
}), e[0]?.offsetHeight, e.forEach((a, d) => {
|
|
1224
|
-
d >=
|
|
1224
|
+
d >= o && d < l && a.classList.add("visible-button");
|
|
1225
1225
|
}), setTimeout(() => {
|
|
1226
1226
|
e.forEach((a) => {
|
|
1227
|
-
a.classList.remove("animating"), a.style.transitionDelay =
|
|
1227
|
+
a.classList.remove("animating"), a.style.transitionDelay = n;
|
|
1228
1228
|
});
|
|
1229
1229
|
}, 400)) : e.forEach((a, d) => {
|
|
1230
|
-
const y = d >=
|
|
1230
|
+
const y = d >= o && d < l, p = a;
|
|
1231
1231
|
y && (p.style.display = "inline-flex", a.classList.add("visible-button"));
|
|
1232
1232
|
}), this._updateNavigationButtons(s, r);
|
|
1233
1233
|
}
|
|
@@ -1235,8 +1235,8 @@ class h extends HTMLElement {
|
|
|
1235
1235
|
* Update navigation buttons visibility and disabled state
|
|
1236
1236
|
*/
|
|
1237
1237
|
_updateNavigationButtons(t, e) {
|
|
1238
|
-
const s = t > e, r = this._currentIndex + e < t,
|
|
1239
|
-
this._navPrevButton !== null && (s ? (this._navPrevButton.classList.add("visible"), this._navPrevButton.disabled = !this._cyclicalNavigation &&
|
|
1238
|
+
const s = t > e, r = this._currentIndex + e < t, o = this._currentIndex === 0, l = !r;
|
|
1239
|
+
this._navPrevButton !== null && (s ? (this._navPrevButton.classList.add("visible"), this._navPrevButton.disabled = !this._cyclicalNavigation && o) : this._navPrevButton.classList.remove("visible")), this._navNextButton !== null && (s ? (this._navNextButton.classList.add("visible"), this._navNextButton.disabled = !this._cyclicalNavigation && l) : this._navNextButton.classList.remove("visible"));
|
|
1240
1240
|
}
|
|
1241
1241
|
/**
|
|
1242
1242
|
* Navigate to previous page (scrolls by visibleCount buttons)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<!-- Black crosshair lines (on top) -->
|
|
7
7
|
<line x1="16" y1="2" x2="16" y2="30" stroke="black" stroke-width="2"/>
|
|
8
8
|
<line x1="2" y1="16" x2="30" y2="16" stroke="black" stroke-width="2"/>
|
|
9
|
-
</svg>`}.CUSTOM_CROSSHAIR)}`;const
|
|
9
|
+
</svg>`}.CUSTOM_CROSSHAIR)}`;const I={ANY:"any",NONE:"none"},C={KEY_DOWN:"keydown"},v={CLICK:"click"},q=`<button part="button">
|
|
10
10
|
<slot></slot>
|
|
11
11
|
</button>
|
|
12
12
|
`,W="*{box-sizing:border-box}:where(button,input[type=button],input[type=submit],input[type=reset]),:where(input[type=file])::file-selector-button{cursor:pointer;-webkit-user-select:none;user-select:none;font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);font-family:var(--font-family-base);letter-spacing:var(--letter-spacing-normal);line-height:var(--line-height-normal);padding-block:var(--button-padding-block-md);padding-inline:var(--button-padding-inline-md);display:inline-flex;justify-content:center;align-items:center;text-align:center;gap:var(--gap-sm);background:var(--color-bg-secondary);color:var(--color-text-primary);border:var(--border-width-1) solid var(--color-border-primary);border-radius:var(--border-radius-lg);transition:all var(--transition-base)}:where(button,input[type=button],input[type=submit],input[type=reset])>.material-symbols-outlined{font-size:var(--font-size-xl);font-family:Material Symbols Outlined;line-height:1}:where(button,input[type=button],input[type=submit],input[type=reset])[disabled]{opacity:.3;cursor:not-allowed}:where(button,input[type=button],input[type=submit],input[type=reset]):where(:not(:disabled):hover),:where(button,input[type=button],input[type=submit],input[type=reset]):where(:not(:disabled):active){background:var(--color-hover-bg-secondary);border-color:var(--color-hover-border-secondary)}:where(input[type=file]){inline-size:100%;max-inline-size:max-content;background-color:var(--color-bg-secondary)}",M=new CSSStyleSheet;M.replaceSync(W);class i extends HTMLElement{static autofocusAttribute="autofocus";static commandAttribute="command";static commandforAttribute="commandfor";static disabledAttribute="disabled";static nameAttribute="name";static titleAttribute="title";static typeAttribute="type";static valueAttribute="value";constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(M)}static get observedAttributes(){return[i.autofocusAttribute,i.commandAttribute,i.commandforAttribute,i.disabledAttribute,i.nameAttribute,i.titleAttribute,i.typeAttribute,i.valueAttribute]}get buttonElement(){return this.shadowRoot?.querySelector("button")}get autofocus(){return this.hasAttribute(i.autofocusAttribute)}set autofocus(t){t?this.setAttribute(i.autofocusAttribute,n):this.removeAttribute(i.autofocusAttribute)}get command(){return this.getAttribute(i.commandAttribute)??n}set command(t){this.setAttribute(i.commandAttribute,t)}get commandfor(){return this.getAttribute(i.commandforAttribute)??n}set commandfor(t){t!==n?this.setAttribute(i.commandforAttribute,t):this.removeAttribute(i.commandforAttribute)}get disabled(){return this.hasAttribute(i.disabledAttribute)}set disabled(t){t?this.setAttribute(i.disabledAttribute,n):this.removeAttribute(i.disabledAttribute)}get name(){return this.getAttribute(i.nameAttribute)??n}set name(t){t!==n?this.setAttribute(i.nameAttribute,t):this.removeAttribute(i.nameAttribute)}get headline(){return this.getAttribute(i.titleAttribute)??n}set headline(t){t!==n?this.setAttribute(i.titleAttribute,t):this.removeAttribute(i.titleAttribute)}get type(){return this.getAttribute(i.typeAttribute)??"button"}set type(t){t!==n?this.setAttribute(i.typeAttribute,t):this.removeAttribute(i.typeAttribute)}get value(){return this.getAttribute(i.valueAttribute)??"button"}set value(t){t!==n?this.setAttribute(i.valueAttribute,t):this.removeAttribute(i.valueAttribute)}connectedCallback(){this._render(),this._addEventListeners()}disconnectedCallback(){this._removeEventListeners()}attributeChangedCallback(t,e,s){s!==e&&this._syncAttribute(t)}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=q,this._syncAttributes())}_addEventListeners(){this.buttonElement.addEventListener(v.CLICK,this._handleClick)}_removeEventListeners(){this.buttonElement.addEventListener(v.CLICK,this._handleClick)}_handleClick=()=>{if(this.command===n||this.commandfor===n)return;let t=document.getElementById(this.commandfor);if(t??=this._findElementInShadowDOM(this.commandfor),t===null)return;const e=t;switch(this.command){case g.SHOW_MODAL:e.showModal?.();break;case g.CLOSE:e.close?.();break}};_findElementInShadowDOM(t){const s=`#${CSS.escape(t)}`;let r=this.querySelector(s);if(r!==null||(r=this._searchInShadowRootsOfChildren(this,s),r!==null))return r;let o=this.parentElement;for(;o!==null;){if(r=o.querySelector(s),r!==null||(r=this._searchInShadowRootsOfChildren(o,s),r!==null))return r;const d=o.parentElement;if(d!==null)o=d;else{const a=o.getRootNode();if(a instanceof ShadowRoot&&a.host!==null)o=a.host;else break}}return null}_searchInShadowRootsOfChildren(t,e){const s=t.children;for(const r of s){if(r.shadowRoot!==null){const d=r.shadowRoot.querySelector(e);if(d!==null)return d;const a=this._searchInShadowRootsOfChildren(r.shadowRoot,e);if(a!==null)return a}const o=this._searchInShadowRootsOfChildren(r,e);if(o!==null)return o}return null}_syncAttribute(t){const e=this.buttonElement;e!==null&&(this.hasAttribute(t)?e.setAttribute(t,this.getAttribute(t)??n):e.removeAttribute(t))}_syncAttributes(){i.observedAttributes.forEach(t=>{this._syncAttribute(t)})}}const Y=Object.freeze(Object.defineProperty({__proto__:null,BaseButtonComponent:i,selector:V},Symbol.toStringTag,{value:"Module"})),X=`<button title="Undo" part="button">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
`,lt="*{box-sizing:border-box}button[part=button]{border:none;background:transparent}button[part=button]:not(:disabled):hover{transform:scale(1.2)}",D=new CSSStyleSheet;D.replaceSync(lt);class E extends i{static _disabledAttribute="disabled";static _titleAttribute="title";constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(D),this.command=g.CLOSE}static get observedAttributes(){return i.observedAttributes}connectedCallback(){this._render(),this._addEventListeners(),this._updateTitle()}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t===E._disabledAttribute&&this._updateTitle()}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=at,this._syncAttributes())}_updateTitle(){const t=this.shadowRoot?.querySelector("button");t!==null&&(this.disabled?t.removeAttribute(E._titleAttribute):t.setAttribute(E._titleAttribute,"Next"))}}const dt=Object.freeze(Object.defineProperty({__proto__:null,NextButtonComponent:E,selector:"next-button"},Symbol.toStringTag,{value:"Module"})),ut=`<dialog part="dialog">
|
|
27
27
|
<slot></slot>
|
|
28
28
|
</dialog>
|
|
29
|
-
`,ct="*{box-sizing:border-box}dialog{background-color:var(--color-bg-primary);color:var(--color-text-primary);border:var(--border-width-1) solid var(--color-border-secondary);border-radius:var(--border-radius-xl);padding:var(--spacing-4);max-width:90vw;max-height:90vh;font-family:var(--font-family-base);line-height:var(--line-height-normal);font-size:var(--font-size-sm);box-shadow:var(--shadow-2xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:slideIn var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog.closing{animation:slideOut var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog::backdrop{background:var(--window-backdrop);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:fadeIn var(--transition-base) ease-out forwards}dialog.closing::backdrop{animation:fadeOut var(--transition-base) ease-out forwards}@keyframes slideIn{0%{opacity:0;transform:scale(.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes slideOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.95) translateY(-20px)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}",U=new CSSStyleSheet;U.replaceSync(ct);class p extends HTMLElement{static closedByAttribute="closedby";_closedBy=
|
|
29
|
+
`,ct="*{box-sizing:border-box}dialog{background-color:var(--color-bg-primary);color:var(--color-text-primary);border:var(--border-width-1) solid var(--color-border-secondary);border-radius:var(--border-radius-xl);padding:var(--spacing-4);max-width:90vw;max-height:90vh;font-family:var(--font-family-base);line-height:var(--line-height-normal);font-size:var(--font-size-sm);box-shadow:var(--shadow-2xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);animation:slideIn var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog.closing{animation:slideOut var(--transition-base) cubic-bezier(.34,1.56,.64,1) forwards}dialog::backdrop{background:var(--window-backdrop);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:fadeIn var(--transition-base) ease-out forwards}dialog.closing::backdrop{animation:fadeOut var(--transition-base) ease-out forwards}@keyframes slideIn{0%{opacity:0;transform:scale(.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes slideOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.95) translateY(-20px)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}",U=new CSSStyleSheet;U.replaceSync(ct);class p extends HTMLElement{static closedByAttribute="closedby";_closedBy=I.ANY;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(U)}static get observedAttributes(){return[p.closedByAttribute]}get dialogElement(){return this.shadowRoot?.querySelector("dialog")}get command(){return this.getAttribute(p.closedByAttribute)??I.ANY}get closedBy(){return this._closedBy}set closedBy(t){this._closedBy=t,this.setAttribute(p.closedByAttribute,t)}connectedCallback(){this._render(),this._addEventListeners()}disconnectedCallback(){this._removeEventListeners()}attributeChangedCallback(t,e,s){const r=this.dialogElement;r!=null&&s!==e&&this._syncAttribute(t)}_addEventListeners(){}_removeEventListeners(){}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=ut,this._syncAttributes())}_syncAttribute(t){const e=this.dialogElement;e!=null&&(this.hasAttribute(t)===!0?e.setAttribute(t,this.getAttribute(t)??n):e.removeAttribute(t))}_syncAttributes(){p.observedAttributes.forEach(t=>{this._syncAttribute(t)})}show(){this.dialogElement.show()}showModal(){this.dialogElement.showModal()}close(t){const e=this.dialogElement;e.classList.add("closing"),setTimeout(()=>{e.close(t),e.classList.remove("closing")},300)}}const ht=Object.freeze(Object.defineProperty({__proto__:null,BaseDialogComponent:p,selector:"base-dialog"},Symbol.toStringTag,{value:"Module"})),bt=`<dialog part="dialog">
|
|
30
30
|
<header part="header">
|
|
31
31
|
<h2></h2>
|
|
32
32
|
</header>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<slot name="footer"></slot>
|
|
50
50
|
</footer>
|
|
51
51
|
</dialog>
|
|
52
|
-
`,gt='*{box-sizing:border-box}dialog[open]{display:flex;flex-direction:column;gap:var(--spacing-4)}dialog>[part]{position:relative}dialog>[part][hidden]{display:none}dialog>[part][data-divider=true]:after{content:"";position:absolute;left:0;right:0;bottom:0;border-bottom:var(--border-width-1) solid var(--color-neutral-600)}dialog>[part][data-divider=true]{padding-bottom:var(--spacing-4)}dialog div[part=body]{flex:1;min-height:0}',K=new CSSStyleSheet;K.replaceSync(gt);class T extends p{_sectionNames=["header","body","footer"];_handleSlotChange=()=>{this._updateSectionState()};constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(K)}static get observedAttributes(){return p.observedAttributes}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=pt,this._syncAttributes())}_addEventListeners(){super._addEventListeners(),this.shadowRoot!==null&&(this.shadowRoot.querySelectorAll("slot").forEach(t=>{t.addEventListener("slotchange",this._handleSlotChange)}),this._updateSectionState())}_removeEventListeners(){super._removeEventListeners(),this.shadowRoot!==null&&this.shadowRoot.querySelectorAll("slot").forEach(t=>{t.removeEventListener("slotchange",this._handleSlotChange)})}_updateSectionState(){if(this.shadowRoot===null)return;const t=[];this._sectionNames.forEach(e=>{const s=this.shadowRoot?.querySelector(`[part='${e}']`),r=this.shadowRoot?.querySelector(`slot[name='${e}']`);if(s===null||r===null)return;const o=r.assignedNodes({flatten:!0}).some(d=>d.nodeType===Node.TEXT_NODE?d.textContent?.trim().length!==0:d.nodeType===Node.ELEMENT_NODE);s.toggleAttribute("hidden",o===!1),s.dataset.filled=String(o),s.removeAttribute("data-divider"),o===!0&&t.push(s)}),t.slice(0,-1).forEach(e=>{e.dataset.divider="true"})}}const G=new CSSStyleSheet;G.replaceSync(vt);class u extends T{_headline=n;_text=n;_value=void 0;static textAttribute="text";static headlineAttribute="headline";static valueAttribute="value";constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(G)}static get observedAttributes(){return[...T.observedAttributes,u.textAttribute,u.headlineAttribute,u.valueAttribute]}get headline(){return this._headline}set headline(t){this._headline=t,this.setAttribute(u.headlineAttribute,t)}get text(){return this._text}set text(t){this._text=t,this.setAttribute(u.textAttribute,t)}get value(){return this._value}set value(t){this._value=t}connectedCallback(){this._render(),this._addEventListeners(),this.closedBy=
|
|
52
|
+
`,gt='*{box-sizing:border-box}:host{display:block;width:auto;height:auto;max-width:100%;max-height:100%;box-sizing:border-box}dialog[open]{display:flex;flex-direction:column;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;gap:var(--spacing-4)}dialog>[part]{position:relative}dialog>[part][hidden]{display:none}dialog>[part][data-divider=true]:after{content:"";position:absolute;left:0;right:0;bottom:0;border-bottom:var(--border-width-1) solid var(--color-neutral-600)}dialog>[part][data-divider=true]{padding-bottom:var(--spacing-4)}dialog div[part=body]{flex:1;min-height:0}',K=new CSSStyleSheet;K.replaceSync(gt);class T extends p{_sectionNames=["header","body","footer"];_handleSlotChange=()=>{this._updateSectionState()};constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(K)}static get observedAttributes(){return p.observedAttributes}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=pt,this._syncAttributes())}_addEventListeners(){super._addEventListeners(),this.shadowRoot!==null&&(this.shadowRoot.querySelectorAll("slot").forEach(t=>{t.addEventListener("slotchange",this._handleSlotChange)}),this._updateSectionState())}_removeEventListeners(){super._removeEventListeners(),this.shadowRoot!==null&&this.shadowRoot.querySelectorAll("slot").forEach(t=>{t.removeEventListener("slotchange",this._handleSlotChange)})}_updateSectionState(){if(this.shadowRoot===null)return;const t=[];this._sectionNames.forEach(e=>{const s=this.shadowRoot?.querySelector(`[part='${e}']`),r=this.shadowRoot?.querySelector(`slot[name='${e}']`);if(s===null||r===null)return;const o=r.assignedNodes({flatten:!0}).some(d=>d.nodeType===Node.TEXT_NODE?d.textContent?.trim().length!==0:d.nodeType===Node.ELEMENT_NODE);s.toggleAttribute("hidden",o===!1),s.dataset.filled=String(o),s.removeAttribute("data-divider"),o===!0&&t.push(s)}),t.slice(0,-1).forEach(e=>{e.dataset.divider="true"})}}const G=new CSSStyleSheet;G.replaceSync(vt);class u extends T{_headline=n;_text=n;_value=void 0;static textAttribute="text";static headlineAttribute="headline";static valueAttribute="value";constructor(){super(),this.shadowRoot?.adoptedStyleSheets.push(G)}static get observedAttributes(){return[...T.observedAttributes,u.textAttribute,u.headlineAttribute,u.valueAttribute]}get headline(){return this._headline}set headline(t){this._headline=t,this.setAttribute(u.headlineAttribute,t)}get text(){return this._text}set text(t){this._text=t,this.setAttribute(u.textAttribute,t)}get value(){return this._value}set value(t){this._value=t}connectedCallback(){this._render(),this._addEventListeners(),this.closedBy=I.NONE}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=bt,this._syncAttributes())}_syncAttribute(t){if(u.observedAttributes.includes(t))switch(t){case u.headlineAttribute:{this._headline=this.getAttribute(t)??n;const e=this.shadowRoot?.querySelector("h2");e!=null&&(e.textContent=this._headline);break}case u.textAttribute:{this._text=this.getAttribute(t)??n;const e=this.shadowRoot?.querySelector("p");e!=null&&(e.textContent=this._text);break}case u.valueAttribute:{this._value=this.getAttribute(t);break}default:super._syncAttribute(t)}else super._syncAttribute(t)}_syncAttributes(){super._syncAttributes(),u.observedAttributes.forEach(t=>{this._syncAttribute(t)})}_addEventListeners(){super._addEventListeners(),this.shadowRoot?.querySelector(k)?.addEventListener(v.CLICK,this._handleConfirm),this.shadowRoot?.querySelector(O)?.addEventListener(v.CLICK,this._handleUndo)}_removeEventListeners(){super._removeEventListeners(),this.shadowRoot?.querySelector(k)?.removeEventListener(v.CLICK,this._handleConfirm),this.shadowRoot?.querySelector(O)?.removeEventListener(v.CLICK,this._handleUndo)}_handleConfirm=()=>{const t=new CustomEvent(f.CONFIRMATION_DIALOG_CONFIRM,{bubbles:!0,composed:!0,detail:{value:this._value}});this.dispatchEvent(t)};_handleUndo=()=>{const t=new CustomEvent(f.CONFIRMATION_DIALOG_UNDO,{bubbles:!0,composed:!0,detail:{value:this._value}});this.dispatchEvent(t),this._value=void 0}}const mt="confirmation-dialog",yt={CONFIRMATION_DIALOG_CONFIRM:f.CONFIRMATION_DIALOG_CONFIRM,CONFIRMATION_DIALOG_UNDO:f.CONFIRMATION_DIALOG_UNDO},ft=Object.freeze(Object.defineProperty({__proto__:null,COMPONENT_CUSTOM_MESSAGES:yt,ConfirmationDialogComponent:u,selector:mt},Symbol.toStringTag,{value:"Module"})),_t=Object.freeze(Object.defineProperty({__proto__:null,HeaderBodyFooterDialogComponent:T,selector:"header-body-footer-dialog"},Symbol.toStringTag,{value:"Module"})),At=`<div class="bar-menu-container">
|
|
53
53
|
<previous-button class="nav-prev" part="nav-prev-button"></previous-button>
|
|
54
54
|
|
|
55
55
|
<div class="buttons-wrapper" part="buttons-wrapper">
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
|
|
59
59
|
<next-button class="nav-next" part="nav-next-button"></next-button>
|
|
60
60
|
</div>
|
|
61
|
-
`,St="*{box-sizing:border-box}:host{display:block;width:100%}.bar-menu-container{display:flex;align-items:center;justify-content:space-between;height:100%;gap:var(--gap-sm);padding:var(--spacing-1);background:var(--color-bg-primary);border-radius:var(--border-radius-full);border:var(--border-width-2) solid var(--color-border-secondary);box-shadow:var(--shadow-sm);margin:0 auto}.bar-menu-container .nav-prev,.bar-menu-container .nav-next{flex-shrink:0;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease-in-out,visibility .2s ease-in-out}.bar-menu-container .nav-prev.visible,.bar-menu-container .nav-next.visible{opacity:1;visibility:visible;pointer-events:auto}.bar-menu-container .nav-prev::part(button),.bar-menu-container .nav-next::part(button){background-color:transparent;box-shadow:none}.bar-menu-container .buttons-wrapper{display:grid;grid-template-columns:repeat(var(--bar-menu-visible-count, 3),1fr);grid-auto-rows:max-content;align-items:center;justify-items:center;gap:var(--gap-sm);overflow:hidden;position:relative;width:auto}::slotted(*){display:none;flex-shrink:0;will-change:opacity,transform;contain:layout style paint;opacity:0;transform:scale(.8)}::slotted(.animating){transition:opacity .4s cubic-bezier(.34,1.56,.64,1),transform .4s cubic-bezier(.34,1.56,.64,1)}::slotted(.visible-button){display:inline-flex!important;pointer-events:auto;opacity:1;transform:scale(1)}",F=new CSSStyleSheet;F.replaceSync(St);class b extends HTMLElement{static _visibleCountAttribute="visible-count";static _cyclicalNavigationAttribute="cyclical-navigation";_currentIndex=0;_visibleCount=3;_cyclicalNavigation=!1;_MIN_VISIBLE=1;_MAX_VISIBLE=5;_slotElement=null;_navPrevButton=null;_navNextButton=null;_buttonsWrapper=null;_slotChangeListener=null;_keyDownListener=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(F)}static get observedAttributes(){return[b._visibleCountAttribute,b._cyclicalNavigationAttribute]}get visibleButtons(){const t=this.getAttribute(b._visibleCountAttribute);if(t!==null&&t!==n){const e=parseInt(t,10);return Math.max(this._MIN_VISIBLE,Math.min(this._MAX_VISIBLE,e))}return this._visibleCount}set visibleButtons(t){const e=Math.max(this._MIN_VISIBLE,Math.min(this._MAX_VISIBLE,t));this.setAttribute(b._visibleCountAttribute,String(e))}get cyclicalNavigation(){return this.hasAttribute(b._cyclicalNavigationAttribute)}set cyclicalNavigation(t){t?this.setAttribute(b._cyclicalNavigationAttribute,n):this.removeAttribute(b._cyclicalNavigationAttribute)}connectedCallback(){this._render(),this._cacheElements(),this._setupSlotListener(),this._setupKeyboardListener(),this._updateButtonVisibility()}disconnectedCallback(){this._removeSlotListener(),this._removeKeyboardListener()}attributeChangedCallback(t,e,s){t===b._visibleCountAttribute?(this._visibleCount=this.visibleButtons,this._buttonsWrapper!==null&&this._buttonsWrapper.style.setProperty("--bar-menu-visible-count",String(this.visibleButtons)),this._updateButtonVisibility()):t===b._cyclicalNavigationAttribute&&(this._cyclicalNavigation=this.cyclicalNavigation,this._updateButtonVisibility())}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=At)}_cacheElements(){this._slotElement=this.shadowRoot?.querySelector("slot")??null,this._navPrevButton=this.shadowRoot?.querySelector(".nav-prev")??null,this._navNextButton=this.shadowRoot?.querySelector(".nav-next")??null,this._buttonsWrapper=this.shadowRoot?.querySelector(".buttons-wrapper")??null,this._buttonsWrapper!==null&&this._buttonsWrapper.style.setProperty("--bar-menu-visible-count",String(this.visibleButtons)),this._navPrevButton!==null&&(this._navPrevButton.setAttribute("aria-label","Previous"),this._navPrevButton.addEventListener(v.CLICK,()=>{this._scrollPrevious()})),this._navNextButton!==null&&(this._navNextButton.setAttribute("aria-label","Next"),this._navNextButton.addEventListener(v.CLICK,()=>{this._scrollNext()}))}_setupSlotListener(){this._slotElement!==null&&(this._slotChangeListener=()=>{this._currentIndex=0,this._updateButtonVisibility()},this._slotElement.addEventListener("slotchange",this._slotChangeListener))}_removeSlotListener(){this._slotElement!==null&&this._slotChangeListener!==null&&this._slotElement.removeEventListener("slotchange",this._slotChangeListener)}_setupKeyboardListener(){this._keyDownListener=t=>{t.key==="ArrowLeft"?(t.preventDefault(),this._scrollPrevious()):t.key==="ArrowRight"&&(t.preventDefault(),this._scrollNext())},this.addEventListener(C.KEY_DOWN,this._keyDownListener)}_removeKeyboardListener(){this._keyDownListener!==null&&this.removeEventListener(C.KEY_DOWN,this._keyDownListener)}_getSlottedButtons(){return this._slotElement===null?[]:this._slotElement.assignedElements()}_updateButtonVisibility(t){const e=this._getSlottedButtons(),s=e.length,r=this.visibleButtons,o=this._currentIndex,d=Math.min(o+r,s);e.forEach((a,c)=>{const
|
|
61
|
+
`,St="*{box-sizing:border-box}:host{display:block;width:100%}.bar-menu-container{display:flex;align-items:center;justify-content:space-between;height:100%;gap:var(--gap-sm);padding:var(--spacing-1);background:var(--color-bg-primary);border-radius:var(--border-radius-full);border:var(--border-width-2) solid var(--color-border-secondary);box-shadow:var(--shadow-sm);margin:0 auto}.bar-menu-container .nav-prev,.bar-menu-container .nav-next{flex-shrink:0;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease-in-out,visibility .2s ease-in-out}.bar-menu-container .nav-prev.visible,.bar-menu-container .nav-next.visible{opacity:1;visibility:visible;pointer-events:auto}.bar-menu-container .nav-prev::part(button),.bar-menu-container .nav-next::part(button){background-color:transparent;box-shadow:none}.bar-menu-container .buttons-wrapper{display:grid;grid-template-columns:repeat(var(--bar-menu-visible-count, 3),1fr);grid-auto-rows:max-content;align-items:center;justify-items:center;gap:var(--gap-sm);overflow:hidden;position:relative;width:auto}::slotted(*){display:none;flex-shrink:0;will-change:opacity,transform;contain:layout style paint;opacity:0;transform:scale(.8)}::slotted(.animating){transition:opacity .4s cubic-bezier(.34,1.56,.64,1),transform .4s cubic-bezier(.34,1.56,.64,1)}::slotted(.visible-button){display:inline-flex!important;pointer-events:auto;opacity:1;transform:scale(1)}",F=new CSSStyleSheet;F.replaceSync(St);class b extends HTMLElement{static _visibleCountAttribute="visible-count";static _cyclicalNavigationAttribute="cyclical-navigation";_currentIndex=0;_visibleCount=3;_cyclicalNavigation=!1;_MIN_VISIBLE=1;_MAX_VISIBLE=5;_slotElement=null;_navPrevButton=null;_navNextButton=null;_buttonsWrapper=null;_slotChangeListener=null;_keyDownListener=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.adoptedStyleSheets.push(F)}static get observedAttributes(){return[b._visibleCountAttribute,b._cyclicalNavigationAttribute]}get visibleButtons(){const t=this.getAttribute(b._visibleCountAttribute);if(t!==null&&t!==n){const e=parseInt(t,10);return Math.max(this._MIN_VISIBLE,Math.min(this._MAX_VISIBLE,e))}return this._visibleCount}set visibleButtons(t){const e=Math.max(this._MIN_VISIBLE,Math.min(this._MAX_VISIBLE,t));this.setAttribute(b._visibleCountAttribute,String(e))}get cyclicalNavigation(){return this.hasAttribute(b._cyclicalNavigationAttribute)}set cyclicalNavigation(t){t?this.setAttribute(b._cyclicalNavigationAttribute,n):this.removeAttribute(b._cyclicalNavigationAttribute)}connectedCallback(){this._render(),this._cacheElements(),this._setupSlotListener(),this._setupKeyboardListener(),this._updateButtonVisibility()}disconnectedCallback(){this._removeSlotListener(),this._removeKeyboardListener()}attributeChangedCallback(t,e,s){t===b._visibleCountAttribute?(this._visibleCount=this.visibleButtons,this._buttonsWrapper!==null&&this._buttonsWrapper.style.setProperty("--bar-menu-visible-count",String(this.visibleButtons)),this._updateButtonVisibility()):t===b._cyclicalNavigationAttribute&&(this._cyclicalNavigation=this.cyclicalNavigation,this._updateButtonVisibility())}_render(){this.shadowRoot!==null&&(this.shadowRoot.innerHTML=At)}_cacheElements(){this._slotElement=this.shadowRoot?.querySelector("slot")??null,this._navPrevButton=this.shadowRoot?.querySelector(".nav-prev")??null,this._navNextButton=this.shadowRoot?.querySelector(".nav-next")??null,this._buttonsWrapper=this.shadowRoot?.querySelector(".buttons-wrapper")??null,this._buttonsWrapper!==null&&this._buttonsWrapper.style.setProperty("--bar-menu-visible-count",String(this.visibleButtons)),this._navPrevButton!==null&&(this._navPrevButton.setAttribute("aria-label","Previous"),this._navPrevButton.addEventListener(v.CLICK,()=>{this._scrollPrevious()})),this._navNextButton!==null&&(this._navNextButton.setAttribute("aria-label","Next"),this._navNextButton.addEventListener(v.CLICK,()=>{this._scrollNext()}))}_setupSlotListener(){this._slotElement!==null&&(this._slotChangeListener=()=>{this._currentIndex=0,this._updateButtonVisibility()},this._slotElement.addEventListener("slotchange",this._slotChangeListener))}_removeSlotListener(){this._slotElement!==null&&this._slotChangeListener!==null&&this._slotElement.removeEventListener("slotchange",this._slotChangeListener)}_setupKeyboardListener(){this._keyDownListener=t=>{t.key==="ArrowLeft"?(t.preventDefault(),this._scrollPrevious()):t.key==="ArrowRight"&&(t.preventDefault(),this._scrollNext())},this.addEventListener(C.KEY_DOWN,this._keyDownListener)}_removeKeyboardListener(){this._keyDownListener!==null&&this.removeEventListener(C.KEY_DOWN,this._keyDownListener)}_getSlottedButtons(){return this._slotElement===null?[]:this._slotElement.assignedElements()}_updateButtonVisibility(t){const e=this._getSlottedButtons(),s=e.length,r=this.visibleButtons,o=this._currentIndex,d=Math.min(o+r,s);e.forEach((a,c)=>{const x=c>=o&&c<d,m=a;x||(a.classList.remove("visible-button"),a.classList.remove("animating"),m.style.display="none")}),t!==void 0?(e[0]?.offsetHeight,e.forEach((a,c)=>{if(c>=o&&c<d){const m=a;m.style.display="inline-flex",a.classList.add("animating");const wt=c%this.visibleButtons*50;m.style.transitionDelay=`${wt}ms`}}),e[0]?.offsetHeight,e.forEach((a,c)=>{c>=o&&c<d&&a.classList.add("visible-button")}),setTimeout(()=>{e.forEach(a=>{a.classList.remove("animating"),a.style.transitionDelay=n})},400)):e.forEach((a,c)=>{const x=c>=o&&c<d,m=a;x&&(m.style.display="inline-flex",a.classList.add("visible-button"))}),this._updateNavigationButtons(s,r)}_updateNavigationButtons(t,e){const s=t>e,r=this._currentIndex+e<t,o=this._currentIndex===0,d=!r;this._navPrevButton!==null&&(s?(this._navPrevButton.classList.add("visible"),this._navPrevButton.disabled=!this._cyclicalNavigation&&o):this._navPrevButton.classList.remove("visible")),this._navNextButton!==null&&(s?(this._navNextButton.classList.add("visible"),this._navNextButton.disabled=!this._cyclicalNavigation&&d):this._navNextButton.classList.remove("visible"))}_scrollPrevious(){const t=this._getSlottedButtons().length,e=this.visibleButtons;this._currentIndex>0?(this._currentIndex=Math.max(0,this._currentIndex-e),this._updateButtonVisibility("previous")):this._cyclicalNavigation&&t>e&&(this._currentIndex=Math.max(0,t-e),this._updateButtonVisibility("previous"))}_scrollNext(){const t=this._getSlottedButtons().length,e=this.visibleButtons,s=this._currentIndex+e;s<t?(this._currentIndex=s,this._updateButtonVisibility("next")):this._cyclicalNavigation&&t>e&&(this._currentIndex=0,this._updateButtonVisibility("next"))}scrollToButton(t){const e=this._getSlottedButtons().length,s=this.visibleButtons;t>=0&&t<e&&(this._currentIndex=Math.max(0,Math.min(t,e-s)),this._updateButtonVisibility())}getVisibleButtons(){return this._getSlottedButtons().filter(t=>t.classList.contains("visible-button"))}getAllButtons(){return this._getSlottedButtons()}getCurrentIndex(){return this._currentIndex}}const Lt=Object.freeze(Object.defineProperty({__proto__:null,BarMenuComponent:b,selector:"bar-menu"},Symbol.toStringTag,{value:"Module"}));l.APPLICATION_NAME=y,l.BarMenu=Lt,l.BaseButton=Y,l.BaseDialog=ht,l.CUSTOM_MESSAGES=f,l.ConfirmButton=st,l.ConfirmationDialog=ft,l.HeaderBodyFooterDialog=_t,l.NextButton=dt,l.PreviousButton=ot,l.UndoButton=Z,l.WebComponentsRegistry=z,l.clearThemes=N,l.switchTheme=j,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@albi_scando/as-design-system-lib",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "A library of reusable, strongly typed Web Components built with TypeScript, designed for creating consistent and maintainable user interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|