@avento-space/ts-ui 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{card.wc-pFLgjfwm.d.ts → card.wc-CLzyZAbJ.d.ts} +32 -0
- package/dist/{chunk-ICB6OBEZ.js → chunk-2UKGVIH2.js} +277 -277
- package/dist/chunk-2UKGVIH2.js.map +1 -0
- package/dist/chunk-NJHLJNRI.js +4983 -0
- package/dist/chunk-NJHLJNRI.js.map +1 -0
- package/dist/{chunk-QTANS5ZS.js → chunk-NUMML2ZR.js} +4 -4
- package/dist/{chunk-QTANS5ZS.js.map → chunk-NUMML2ZR.js.map} +1 -1
- package/dist/{chunk-RQZ7KDYP.js → chunk-PIXJHFME.js} +273 -67
- package/dist/chunk-PIXJHFME.js.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +2 -2
- package/dist/define.js +4 -4
- package/dist/icons/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/react/index.d.ts +4 -2
- package/dist/react/index.js +66 -8
- package/dist/react/index.js.map +1 -1
- package/package.json +7 -3
- package/dist/chunk-ICB6OBEZ.js.map +0 -1
- package/dist/chunk-RATTHYIP.js +0 -4855
- package/dist/chunk-RATTHYIP.js.map +0 -1
- package/dist/chunk-RQZ7KDYP.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UElement, buttonStyles, inputStyles, boxStyles, listStyles, textStyles, stackStyles, gridStyles, overlayStyles, fieldStyles, checkboxStyles, selectStyles, linkStyles, containerStyles, dialogStyles, tooltipStyles, textareaStyles, radioStyles, switchStyles, labelStyles, treeStyles, tableStyles, breadcrumbStyles, tabsStyles, visuallyHiddenStyles, presenceStyles, animateKeyframes, modalStyles, drawerStyles, popoverStyles, dropdownStyles, accordionStyles, comboboxStyles, calendarStyles, dataTableStyles, commandPaletteStyles, toastStyles, contextMenuStyles, sortableStyles, formStyles, badgeStyles, cardStyles } from './chunk-
|
|
1
|
+
import { UElement, buttonStyles, inputStyles, boxStyles, listStyles, textStyles, stackStyles, gridStyles, overlayStyles, fieldStyles, checkboxStyles, selectStyles, linkStyles, containerStyles, dialogStyles, tooltipStyles, textareaStyles, radioStyles, switchStyles, labelStyles, treeStyles, tableStyles, breadcrumbStyles, tabsStyles, visuallyHiddenStyles, presenceStyles, animateKeyframes, modalStyles, drawerStyles, popoverStyles, dropdownStyles, accordionStyles, comboboxStyles, calendarStyles, dataTableStyles, commandPaletteStyles, toastStyles, contextMenuStyles, sortableStyles, formStyles, badgeStyles, cardStyles } from './chunk-2UKGVIH2.js';
|
|
2
2
|
import { signal, effect } from './chunk-Q5RCPPCF.js';
|
|
3
3
|
|
|
4
4
|
// src/components/button.wc.ts
|
|
@@ -12,7 +12,7 @@ var UButton = class extends UElement {
|
|
|
12
12
|
this._root.innerHTML = `<style>${buttonStyles}</style><button part="button"><slot></slot></button>`;
|
|
13
13
|
}
|
|
14
14
|
static get observedAttributes() {
|
|
15
|
-
return ["variant", "size", "disabled", "type"];
|
|
15
|
+
return ["variant", "size", "disabled", "type", "class"];
|
|
16
16
|
}
|
|
17
17
|
get variant() {
|
|
18
18
|
return this._variant;
|
|
@@ -73,7 +73,7 @@ var UButton = class extends UElement {
|
|
|
73
73
|
}
|
|
74
74
|
_sync() {
|
|
75
75
|
const btn = this._root.querySelector("button");
|
|
76
|
-
btn.className = `btn btn-${this._variant} btn-${this._size}
|
|
76
|
+
btn.className = `btn btn-${this._variant} btn-${this._size} ${this.className}`.trim();
|
|
77
77
|
btn.disabled = this._disabled;
|
|
78
78
|
btn.type = this._buttonType;
|
|
79
79
|
}
|
|
@@ -101,7 +101,7 @@ var UInput = class extends UElement {
|
|
|
101
101
|
this._root.innerHTML = `<style>${inputStyles}</style><div class="input-wrapper"><input part="input" /></div>`;
|
|
102
102
|
}
|
|
103
103
|
static get observedAttributes() {
|
|
104
|
-
return ["placeholder", "disabled", "readonly", "type", "name"];
|
|
104
|
+
return ["placeholder", "disabled", "readonly", "type", "name", "class"];
|
|
105
105
|
}
|
|
106
106
|
get value() {
|
|
107
107
|
return this._root.querySelector("input")?.value ?? "";
|
|
@@ -175,6 +175,7 @@ var UInput = class extends UElement {
|
|
|
175
175
|
_sync() {
|
|
176
176
|
const input = this._root.querySelector("input");
|
|
177
177
|
if (!input) return;
|
|
178
|
+
input.className = this.className;
|
|
178
179
|
input.placeholder = this._placeholder;
|
|
179
180
|
input.disabled = this._disabled;
|
|
180
181
|
input.readOnly = this._readonly;
|
|
@@ -237,7 +238,7 @@ var UBox = class extends UElement {
|
|
|
237
238
|
this._root.innerHTML = `<style>${boxStyles}</style><div part="box"><slot></slot></div>`;
|
|
238
239
|
}
|
|
239
240
|
static get observedAttributes() {
|
|
240
|
-
return ["as"];
|
|
241
|
+
return ["as", "class"];
|
|
241
242
|
}
|
|
242
243
|
get as() {
|
|
243
244
|
return this._as;
|
|
@@ -268,6 +269,7 @@ var UBox = class extends UElement {
|
|
|
268
269
|
}
|
|
269
270
|
const wrapper = document.createElement(this._as);
|
|
270
271
|
wrapper.setAttribute("part", "box");
|
|
272
|
+
wrapper.className = `box ${this.className}`.trim();
|
|
271
273
|
const newSlot = document.createElement("slot");
|
|
272
274
|
wrapper.appendChild(newSlot);
|
|
273
275
|
this._root.innerHTML = `<style>${boxStyles}</style>`;
|
|
@@ -277,6 +279,8 @@ var UBox = class extends UElement {
|
|
|
277
279
|
const inner = this._root.querySelector('[part="box"]');
|
|
278
280
|
if (!inner || inner.tagName.toLowerCase() !== this._as) {
|
|
279
281
|
this._rebuild();
|
|
282
|
+
} else {
|
|
283
|
+
inner.className = `box ${this.className}`.trim();
|
|
280
284
|
}
|
|
281
285
|
}
|
|
282
286
|
_mount() {
|
|
@@ -292,6 +296,9 @@ var UList = class extends UElement {
|
|
|
292
296
|
this._emptyText = "";
|
|
293
297
|
this._root.innerHTML = `<style>${listStyles}</style><ul part="list"><slot></slot></ul>`;
|
|
294
298
|
}
|
|
299
|
+
static get observedAttributes() {
|
|
300
|
+
return ["class"];
|
|
301
|
+
}
|
|
295
302
|
get items() {
|
|
296
303
|
return this._items;
|
|
297
304
|
}
|
|
@@ -333,6 +340,18 @@ var UList = class extends UElement {
|
|
|
333
340
|
ul.appendChild(li);
|
|
334
341
|
}
|
|
335
342
|
}
|
|
343
|
+
connectedCallback() {
|
|
344
|
+
super.connectedCallback();
|
|
345
|
+
this._sync();
|
|
346
|
+
}
|
|
347
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
348
|
+
if (oldVal === newVal) return;
|
|
349
|
+
if (name === "class") this._sync();
|
|
350
|
+
}
|
|
351
|
+
_sync() {
|
|
352
|
+
const ul = this._root.querySelector("ul");
|
|
353
|
+
ul.className = this.className;
|
|
354
|
+
}
|
|
336
355
|
_mount() {
|
|
337
356
|
}
|
|
338
357
|
};
|
|
@@ -351,7 +370,7 @@ var UVirtualList = class extends UElement {
|
|
|
351
370
|
</style><div class="viewport" part="viewport"></div>`;
|
|
352
371
|
}
|
|
353
372
|
static get observedAttributes() {
|
|
354
|
-
return ["item-height", "container-height", "overscan"];
|
|
373
|
+
return ["item-height", "container-height", "overscan", "class"];
|
|
355
374
|
}
|
|
356
375
|
get items() {
|
|
357
376
|
return this._items;
|
|
@@ -411,6 +430,7 @@ var UVirtualList = class extends UElement {
|
|
|
411
430
|
const visibleCount = Math.ceil(this._containerHeight / this._itemHeight) + this._overscan * 2;
|
|
412
431
|
const startIndex = Math.max(0, Math.floor(scrollTop / this._itemHeight) - this._overscan);
|
|
413
432
|
const endIndex = Math.min(this._items.length, startIndex + visibleCount);
|
|
433
|
+
viewport.className = `viewport ${this.className}`.trim();
|
|
414
434
|
viewport.style.height = `${totalHeight}px`;
|
|
415
435
|
viewport.innerHTML = "";
|
|
416
436
|
for (let i = startIndex; i < endIndex; i++) {
|
|
@@ -515,7 +535,7 @@ var UText = class extends UElement {
|
|
|
515
535
|
this._root.innerHTML = `<style>${textStyles}</style><span part="text"><slot></slot></span>`;
|
|
516
536
|
}
|
|
517
537
|
static get observedAttributes() {
|
|
518
|
-
return ["size", "weight", "color", "as", "align", "truncate"];
|
|
538
|
+
return ["size", "weight", "color", "as", "align", "truncate", "class"];
|
|
519
539
|
}
|
|
520
540
|
get size() {
|
|
521
541
|
return this._size;
|
|
@@ -591,7 +611,7 @@ var UText = class extends UElement {
|
|
|
591
611
|
_sync() {
|
|
592
612
|
const el = this._root.querySelector('[part="text"]');
|
|
593
613
|
if (!el) return;
|
|
594
|
-
el.className = `text text-${this._size} text-${this._weight} text-${this._color} text-${this._align}
|
|
614
|
+
el.className = `text text-${this._size} text-${this._weight} text-${this._color} text-${this._align} ${this.className}`.trim();
|
|
595
615
|
if (this._truncate) el.classList.add("text-truncate");
|
|
596
616
|
}
|
|
597
617
|
_mount() {
|
|
@@ -606,10 +626,11 @@ var UStack = class extends UElement {
|
|
|
606
626
|
this._align = "stretch";
|
|
607
627
|
this._justify = "start";
|
|
608
628
|
this._wrap = false;
|
|
629
|
+
this._direction = "v";
|
|
609
630
|
this._root.innerHTML = `<style>${stackStyles}</style><div part="stack" class="stack stack-v"><slot></slot></div>`;
|
|
610
631
|
}
|
|
611
632
|
static get observedAttributes() {
|
|
612
|
-
return ["gap", "align", "justify", "wrap"];
|
|
633
|
+
return ["gap", "align", "justify", "wrap", "class"];
|
|
613
634
|
}
|
|
614
635
|
get gap() {
|
|
615
636
|
return this._gap;
|
|
@@ -653,6 +674,7 @@ var UStack = class extends UElement {
|
|
|
653
674
|
}
|
|
654
675
|
_sync() {
|
|
655
676
|
const el = this._root.querySelector('[part="stack"]');
|
|
677
|
+
el.className = `stack stack-${this._direction} ${this.className}`.trim();
|
|
656
678
|
el.style.gap = `${this._gap}px`;
|
|
657
679
|
el.style.alignItems = this._align === "stretch" ? "stretch" : `flex-${this._align === "start" ? "start" : this._align === "end" ? "end" : this._align}`;
|
|
658
680
|
el.style.justifyContent = this._justify === "start" ? "flex-start" : this._justify === "end" ? "flex-end" : this._justify === "between" ? "space-between" : this._justify === "around" ? "space-around" : "flex-start";
|
|
@@ -665,9 +687,7 @@ var UStack = class extends UElement {
|
|
|
665
687
|
var UHStack = class extends UStack {
|
|
666
688
|
constructor() {
|
|
667
689
|
super();
|
|
668
|
-
|
|
669
|
-
el.classList.remove("stack-v");
|
|
670
|
-
el.classList.add("stack-h");
|
|
690
|
+
this._direction = "h";
|
|
671
691
|
}
|
|
672
692
|
};
|
|
673
693
|
|
|
@@ -681,7 +701,7 @@ var UGrid = class extends UElement {
|
|
|
681
701
|
this._root.innerHTML = `<style>${gridStyles}</style><div part="grid" class="grid"><slot></slot></div>`;
|
|
682
702
|
}
|
|
683
703
|
static get observedAttributes() {
|
|
684
|
-
return ["columns", "gap", "align"];
|
|
704
|
+
return ["columns", "gap", "align", "class"];
|
|
685
705
|
}
|
|
686
706
|
get columns() {
|
|
687
707
|
return this._columns;
|
|
@@ -716,6 +736,7 @@ var UGrid = class extends UElement {
|
|
|
716
736
|
}
|
|
717
737
|
_sync() {
|
|
718
738
|
const el = this._root.querySelector('[part="grid"]');
|
|
739
|
+
el.className = `grid ${this.className}`.trim();
|
|
719
740
|
el.style.gridTemplateColumns = `repeat(${this._columns}, 1fr)`;
|
|
720
741
|
el.style.gap = `${this._gap}px`;
|
|
721
742
|
el.style.alignItems = this._align === "stretch" ? "stretch" : `flex-${this._align}`;
|
|
@@ -750,7 +771,7 @@ var UPressable = class extends UElement {
|
|
|
750
771
|
this._root.addEventListener("keyup", (e) => this._onKeyUp(e));
|
|
751
772
|
}
|
|
752
773
|
static get observedAttributes() {
|
|
753
|
-
return ["disabled"];
|
|
774
|
+
return ["disabled", "class"];
|
|
754
775
|
}
|
|
755
776
|
get disabled() {
|
|
756
777
|
return this._disabled;
|
|
@@ -773,9 +794,13 @@ var UPressable = class extends UElement {
|
|
|
773
794
|
if (name === "disabled") {
|
|
774
795
|
this._disabled = newVal !== null;
|
|
775
796
|
this._sync();
|
|
797
|
+
} else if (name === "class") {
|
|
798
|
+
this._sync();
|
|
776
799
|
}
|
|
777
800
|
}
|
|
778
801
|
_sync() {
|
|
802
|
+
const pressableEl = this._root.querySelector('[part="pressable"]');
|
|
803
|
+
pressableEl.className = `pressable ${this.className}`.trim();
|
|
779
804
|
if (this._disabled) {
|
|
780
805
|
this.setAttribute("aria-disabled", "true");
|
|
781
806
|
} else {
|
|
@@ -968,7 +993,7 @@ var UOverlay = class extends UElement {
|
|
|
968
993
|
this._root.innerHTML = `<style>${overlayStyles}</style><div part="overlay" class="overlay" hidden><slot></slot></div>`;
|
|
969
994
|
}
|
|
970
995
|
static get observedAttributes() {
|
|
971
|
-
return ["visible", "opacity", "blur"];
|
|
996
|
+
return ["visible", "opacity", "blur", "class"];
|
|
972
997
|
}
|
|
973
998
|
get visible() {
|
|
974
999
|
return this._visible;
|
|
@@ -1005,6 +1030,7 @@ var UOverlay = class extends UElement {
|
|
|
1005
1030
|
}
|
|
1006
1031
|
_sync() {
|
|
1007
1032
|
const el = this._root.querySelector('[part="overlay"]');
|
|
1033
|
+
el.className = `overlay ${this.className}`.trim();
|
|
1008
1034
|
if (this._visible) {
|
|
1009
1035
|
el.removeAttribute("hidden");
|
|
1010
1036
|
el.style.opacity = String(this._opacity);
|
|
@@ -1044,7 +1070,7 @@ var UField = class extends UElement {
|
|
|
1044
1070
|
this._root.innerHTML = `<style>${fieldStyles}</style><div part="field" class="field"><label part="label" class="field-label"></label><div part="content" class="field-content"><slot></slot></div><div part="hint" class="field-hint"></div><div part="error" class="field-error" role="alert"></div></div>`;
|
|
1045
1071
|
}
|
|
1046
1072
|
static get observedAttributes() {
|
|
1047
|
-
return ["label", "error", "hint", "required"];
|
|
1073
|
+
return ["label", "error", "hint", "required", "class"];
|
|
1048
1074
|
}
|
|
1049
1075
|
get label() {
|
|
1050
1076
|
return this._label;
|
|
@@ -1095,6 +1121,8 @@ var UField = class extends UElement {
|
|
|
1095
1121
|
this._sync();
|
|
1096
1122
|
}
|
|
1097
1123
|
_sync() {
|
|
1124
|
+
const fieldEl = this._root.querySelector('[part="field"]');
|
|
1125
|
+
fieldEl.className = `field ${this.className}`.trim();
|
|
1098
1126
|
const labelEl = this._root.querySelector('[part="label"]');
|
|
1099
1127
|
labelEl.textContent = this._label;
|
|
1100
1128
|
if (this._required) labelEl.classList.add("field-label-required");
|
|
@@ -1120,7 +1148,7 @@ var UCheckbox = class extends UElement {
|
|
|
1120
1148
|
this._root.innerHTML = `<style>${checkboxStyles}</style><label part="checkbox" class="checkbox"><input type="checkbox" part="input" /><span part="indicator" class="checkbox-indicator"><svg viewBox="0 0 12 12" width="12" height="12"><path d="M2.5 6L5 8.5L9.5 3.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></span><span part="label-text" class="checkbox-label"><slot></slot></span></label>`;
|
|
1121
1149
|
}
|
|
1122
1150
|
static get observedAttributes() {
|
|
1123
|
-
return ["checked", "disabled", "value"];
|
|
1151
|
+
return ["checked", "disabled", "value", "class"];
|
|
1124
1152
|
}
|
|
1125
1153
|
get checked() {
|
|
1126
1154
|
return this._checked;
|
|
@@ -1171,6 +1199,8 @@ var UCheckbox = class extends UElement {
|
|
|
1171
1199
|
const indicator = this._root.querySelector('[part="indicator"]');
|
|
1172
1200
|
if (this._checked) indicator.classList.add("checked");
|
|
1173
1201
|
else indicator.classList.remove("checked");
|
|
1202
|
+
const checkbox = this._root.querySelector('[part="checkbox"]');
|
|
1203
|
+
checkbox.className = `checkbox ${this.className}`.trim();
|
|
1174
1204
|
}
|
|
1175
1205
|
_mount() {
|
|
1176
1206
|
const input = this._root.querySelector("input");
|
|
@@ -1201,7 +1231,7 @@ var USelect = class extends UElement {
|
|
|
1201
1231
|
this._root.innerHTML = `<style>${selectStyles}</style><div part="select" class="select-wrapper"><select part="native-select" class="select"></select><span part="arrow" class="select-arrow"><svg viewBox="0 0 16 16" width="16" height="16"><path d="M4 6L8 10L12 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></span></div>`;
|
|
1202
1232
|
}
|
|
1203
1233
|
static get observedAttributes() {
|
|
1204
|
-
return ["placeholder", "disabled", "value"];
|
|
1234
|
+
return ["placeholder", "disabled", "value", "class"];
|
|
1205
1235
|
}
|
|
1206
1236
|
get value() {
|
|
1207
1237
|
return this._value;
|
|
@@ -1274,6 +1304,8 @@ var USelect = class extends UElement {
|
|
|
1274
1304
|
const select = this._root.querySelector("select");
|
|
1275
1305
|
select.disabled = this._disabled;
|
|
1276
1306
|
if (this._value) select.value = this._value;
|
|
1307
|
+
const selectEl = this._root.querySelector('[part="select"]');
|
|
1308
|
+
selectEl.className = `select-wrapper ${this.className}`.trim();
|
|
1277
1309
|
}
|
|
1278
1310
|
_mount() {
|
|
1279
1311
|
const select = this._root.querySelector("select");
|
|
@@ -1306,7 +1338,7 @@ var ULink = class extends UElement {
|
|
|
1306
1338
|
this._root.innerHTML = `<style>${linkStyles}</style><a part="link" class="link"><slot></slot></a>`;
|
|
1307
1339
|
}
|
|
1308
1340
|
static get observedAttributes() {
|
|
1309
|
-
return ["href", "target", "rel", "disabled", "variant", "underline", "external", "download"];
|
|
1341
|
+
return ["href", "target", "rel", "disabled", "variant", "underline", "external", "download", "class"];
|
|
1310
1342
|
}
|
|
1311
1343
|
get href() {
|
|
1312
1344
|
return this._href;
|
|
@@ -1395,7 +1427,7 @@ var ULink = class extends UElement {
|
|
|
1395
1427
|
anchor.rel = this._rel || (anchor.target === "_blank" ? "noopener noreferrer" : "");
|
|
1396
1428
|
if (this._download) anchor.setAttribute("download", this._download);
|
|
1397
1429
|
else anchor.removeAttribute("download");
|
|
1398
|
-
anchor.className = `link link-${this._variant} link-underline-${this._underline}
|
|
1430
|
+
anchor.className = `link link-${this._variant} link-underline-${this._underline} ${this.className}`.trim();
|
|
1399
1431
|
if (this._disabled) {
|
|
1400
1432
|
anchor.classList.add("link-disabled");
|
|
1401
1433
|
anchor.setAttribute("aria-disabled", "true");
|
|
@@ -1424,7 +1456,7 @@ var USpacer = class extends UElement {
|
|
|
1424
1456
|
this._root.innerHTML = `<div part="spacer" style="flex:1"></div>`;
|
|
1425
1457
|
}
|
|
1426
1458
|
static get observedAttributes() {
|
|
1427
|
-
return ["size"];
|
|
1459
|
+
return ["size", "class"];
|
|
1428
1460
|
}
|
|
1429
1461
|
get size() {
|
|
1430
1462
|
return this._size;
|
|
@@ -1440,11 +1472,12 @@ var USpacer = class extends UElement {
|
|
|
1440
1472
|
if (oldVal === newVal) return;
|
|
1441
1473
|
if (name === "size") {
|
|
1442
1474
|
this._size = Number(newVal) || 0;
|
|
1443
|
-
this._sync();
|
|
1444
1475
|
}
|
|
1476
|
+
this._sync();
|
|
1445
1477
|
}
|
|
1446
1478
|
_sync() {
|
|
1447
1479
|
const el = this._root.querySelector('[part="spacer"]');
|
|
1480
|
+
el.className = `spacer ${this.className}`.trim();
|
|
1448
1481
|
if (this._size > 0) {
|
|
1449
1482
|
el.style.flex = "none";
|
|
1450
1483
|
el.style.width = `${this._size}px`;
|
|
@@ -1468,7 +1501,7 @@ var UContainer = class extends UElement {
|
|
|
1468
1501
|
this._root.innerHTML = `<style>${containerStyles}</style><div part="container" class="container"><slot></slot></div>`;
|
|
1469
1502
|
}
|
|
1470
1503
|
static get observedAttributes() {
|
|
1471
|
-
return ["max-width", "padding"];
|
|
1504
|
+
return ["max-width", "padding", "class"];
|
|
1472
1505
|
}
|
|
1473
1506
|
get maxWidth() {
|
|
1474
1507
|
return this._maxWidth;
|
|
@@ -1488,6 +1521,7 @@ var UContainer = class extends UElement {
|
|
|
1488
1521
|
}
|
|
1489
1522
|
_sync() {
|
|
1490
1523
|
const el = this._root.querySelector('[part="container"]');
|
|
1524
|
+
el.className = `container ${this.className}`.trim();
|
|
1491
1525
|
el.style.maxWidth = this._maxWidth;
|
|
1492
1526
|
el.style.padding = this._padding;
|
|
1493
1527
|
}
|
|
@@ -1962,7 +1996,7 @@ var UTooltipRoot = class extends UElement {
|
|
|
1962
1996
|
this._root.innerHTML = `<style>${tooltipStyles}</style><div part="trigger" class="tooltip-trigger" style="display:inline-flex"><slot></slot></div><div part="tooltip" class="tooltip" role="tooltip" hidden><div part="tooltip-content" class="tooltip-content"></div><div part="arrow" class="tooltip-arrow"></div></div>`;
|
|
1963
1997
|
}
|
|
1964
1998
|
static get observedAttributes() {
|
|
1965
|
-
return ["content", "placement", "delay", "disabled"];
|
|
1999
|
+
return ["content", "placement", "delay", "disabled", "class"];
|
|
1966
2000
|
}
|
|
1967
2001
|
get content() {
|
|
1968
2002
|
return this._content;
|
|
@@ -2005,6 +2039,8 @@ var UTooltipRoot = class extends UElement {
|
|
|
2005
2039
|
this._sync();
|
|
2006
2040
|
}
|
|
2007
2041
|
_sync() {
|
|
2042
|
+
const triggerEl = this._root.querySelector('[part="trigger"]');
|
|
2043
|
+
triggerEl.className = `tooltip-trigger ${this.className}`.trim();
|
|
2008
2044
|
const contentEl = this._root.querySelector('[part="tooltip-content"]');
|
|
2009
2045
|
contentEl.textContent = this._content;
|
|
2010
2046
|
}
|
|
@@ -2064,7 +2100,7 @@ var UTextarea = class extends UElement {
|
|
|
2064
2100
|
this._root.innerHTML = `<style>${textareaStyles}</style><div class="textarea-wrapper"><textarea part="textarea"></textarea></div>`;
|
|
2065
2101
|
}
|
|
2066
2102
|
static get observedAttributes() {
|
|
2067
|
-
return ["placeholder", "disabled", "readonly", "rows", "max-length", "name"];
|
|
2103
|
+
return ["placeholder", "disabled", "readonly", "rows", "max-length", "name", "class"];
|
|
2068
2104
|
}
|
|
2069
2105
|
get value() {
|
|
2070
2106
|
return this._root.querySelector("textarea")?.value ?? "";
|
|
@@ -2130,6 +2166,8 @@ var UTextarea = class extends UElement {
|
|
|
2130
2166
|
ta.rows = this._rows;
|
|
2131
2167
|
if (this._maxLength > 0) ta.maxLength = this._maxLength;
|
|
2132
2168
|
ta.name = this._name;
|
|
2169
|
+
const wrapper = this._root.querySelector(".textarea-wrapper");
|
|
2170
|
+
wrapper.className = `textarea-wrapper ${this.className}`.trim();
|
|
2133
2171
|
}
|
|
2134
2172
|
_mount() {
|
|
2135
2173
|
const ta = this._root.querySelector("textarea");
|
|
@@ -2165,7 +2203,7 @@ var URadioGroup = class extends UElement {
|
|
|
2165
2203
|
this._root.innerHTML = `<style>${radioStyles}</style><div part="group" class="radio-group" role="radiogroup"><slot></slot></div>`;
|
|
2166
2204
|
}
|
|
2167
2205
|
static get observedAttributes() {
|
|
2168
|
-
return ["value", "name", "disabled", "orientation"];
|
|
2206
|
+
return ["value", "name", "disabled", "orientation", "class"];
|
|
2169
2207
|
}
|
|
2170
2208
|
get value() {
|
|
2171
2209
|
return this._value;
|
|
@@ -2211,6 +2249,7 @@ var URadioGroup = class extends UElement {
|
|
|
2211
2249
|
}
|
|
2212
2250
|
_sync() {
|
|
2213
2251
|
const group = this._root.querySelector('[part="group"]');
|
|
2252
|
+
group.className = `radio-group ${this.className}`.trim();
|
|
2214
2253
|
group.style.flexDirection = this._orientation === "horizontal" ? "row" : "column";
|
|
2215
2254
|
group.style.gap = this._orientation === "horizontal" ? "16px" : "8px";
|
|
2216
2255
|
if (this._name) group.setAttribute("aria-labelledby", this._name);
|
|
@@ -2250,7 +2289,7 @@ var URadio = class extends UElement {
|
|
|
2250
2289
|
this._root.innerHTML = `<style>${radioStyles}</style><label part="radio" class="radio"><input type="radio" part="input" /><span part="circle" class="radio-circle"></span><span part="label" class="radio-label"><slot></slot></span></label>`;
|
|
2251
2290
|
}
|
|
2252
2291
|
static get observedAttributes() {
|
|
2253
|
-
return ["value", "disabled", "checked"];
|
|
2292
|
+
return ["value", "disabled", "checked", "class"];
|
|
2254
2293
|
}
|
|
2255
2294
|
get value() {
|
|
2256
2295
|
return this._value;
|
|
@@ -2301,6 +2340,8 @@ var URadio = class extends UElement {
|
|
|
2301
2340
|
const circle = this._root.querySelector('[part="circle"]');
|
|
2302
2341
|
if (this._checked) circle.classList.add("checked");
|
|
2303
2342
|
else circle.classList.remove("checked");
|
|
2343
|
+
const radio = this._root.querySelector('[part="radio"]');
|
|
2344
|
+
radio.className = `radio ${this.className}`.trim();
|
|
2304
2345
|
}
|
|
2305
2346
|
_mount() {
|
|
2306
2347
|
const input = this._root.querySelector("input");
|
|
@@ -2329,7 +2370,7 @@ var USwitch = class extends UElement {
|
|
|
2329
2370
|
this._root.innerHTML = `<style>${switchStyles}</style><label part="switch" class="switch"><input type="checkbox" part="input" role="switch" /><span part="track" class="switch-track"><span part="thumb" class="switch-thumb"></span></span></label>`;
|
|
2330
2371
|
}
|
|
2331
2372
|
static get observedAttributes() {
|
|
2332
|
-
return ["checked", "disabled"];
|
|
2373
|
+
return ["checked", "disabled", "class"];
|
|
2333
2374
|
}
|
|
2334
2375
|
get checked() {
|
|
2335
2376
|
return this._checked;
|
|
@@ -2370,6 +2411,8 @@ var USwitch = class extends UElement {
|
|
|
2370
2411
|
const track = this._root.querySelector('[part="track"]');
|
|
2371
2412
|
if (this._checked) track.classList.add("checked");
|
|
2372
2413
|
else track.classList.remove("checked");
|
|
2414
|
+
const switchEl = this._root.querySelector('[part="switch"]');
|
|
2415
|
+
switchEl.className = `switch ${this.className}`.trim();
|
|
2373
2416
|
}
|
|
2374
2417
|
_mount() {
|
|
2375
2418
|
const input = this._root.querySelector("input");
|
|
@@ -2396,7 +2439,7 @@ var ULabel = class extends UElement {
|
|
|
2396
2439
|
this._root.innerHTML = `<style>${labelStyles}</style><label part="label" class="label"><slot></slot></label>`;
|
|
2397
2440
|
}
|
|
2398
2441
|
static get observedAttributes() {
|
|
2399
|
-
return ["for", "required"];
|
|
2442
|
+
return ["for", "required", "class"];
|
|
2400
2443
|
}
|
|
2401
2444
|
get htmlFor() {
|
|
2402
2445
|
return this._for;
|
|
@@ -2424,10 +2467,9 @@ var ULabel = class extends UElement {
|
|
|
2424
2467
|
}
|
|
2425
2468
|
_sync() {
|
|
2426
2469
|
const label = this._root.querySelector("label");
|
|
2470
|
+
label.className = `label ${this._required ? "label-required" : ""} ${this.className}`.trim();
|
|
2427
2471
|
if (this._for) label.setAttribute("for", this._for);
|
|
2428
2472
|
else label.removeAttribute("for");
|
|
2429
|
-
if (this._required) label.classList.add("label-required");
|
|
2430
|
-
else label.classList.remove("label-required");
|
|
2431
2473
|
}
|
|
2432
2474
|
_mount() {
|
|
2433
2475
|
}
|
|
@@ -2443,7 +2485,7 @@ var UCollection = class extends UElement {
|
|
|
2443
2485
|
this._root.innerHTML = `<div part="collection" class="collection" role="listbox"><slot></slot></div>`;
|
|
2444
2486
|
}
|
|
2445
2487
|
static get observedAttributes() {
|
|
2446
|
-
return ["selection"];
|
|
2488
|
+
return ["selection", "class"];
|
|
2447
2489
|
}
|
|
2448
2490
|
get items() {
|
|
2449
2491
|
return this._items;
|
|
@@ -2489,12 +2531,18 @@ var UCollection = class extends UElement {
|
|
|
2489
2531
|
}
|
|
2490
2532
|
connectedCallback() {
|
|
2491
2533
|
super.connectedCallback();
|
|
2534
|
+
this._sync();
|
|
2492
2535
|
}
|
|
2493
2536
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
2494
2537
|
if (oldVal === newVal) return;
|
|
2495
2538
|
if (name === "selection") {
|
|
2496
2539
|
this._selection = newVal ?? "none";
|
|
2497
2540
|
}
|
|
2541
|
+
this._sync();
|
|
2542
|
+
}
|
|
2543
|
+
_sync() {
|
|
2544
|
+
const el = this._root.querySelector('[part="collection"]');
|
|
2545
|
+
el.className = `collection ${this.className}`.trim();
|
|
2498
2546
|
}
|
|
2499
2547
|
_updateItems() {
|
|
2500
2548
|
const slot = this._root.querySelector("slot");
|
|
@@ -2539,7 +2587,15 @@ var UTree = class extends UElement {
|
|
|
2539
2587
|
this._root.addEventListener("click", (e) => this._onClick(e));
|
|
2540
2588
|
}
|
|
2541
2589
|
static get observedAttributes() {
|
|
2542
|
-
return [];
|
|
2590
|
+
return ["class"];
|
|
2591
|
+
}
|
|
2592
|
+
connectedCallback() {
|
|
2593
|
+
super.connectedCallback();
|
|
2594
|
+
this._sync();
|
|
2595
|
+
}
|
|
2596
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
2597
|
+
if (oldVal === newVal) return;
|
|
2598
|
+
if (name === "class") this._sync();
|
|
2543
2599
|
}
|
|
2544
2600
|
get items() {
|
|
2545
2601
|
return this._items;
|
|
@@ -2548,6 +2604,10 @@ var UTree = class extends UElement {
|
|
|
2548
2604
|
this._items = val;
|
|
2549
2605
|
this._render();
|
|
2550
2606
|
}
|
|
2607
|
+
_sync() {
|
|
2608
|
+
const el = this._root.querySelector('[part="tree"]');
|
|
2609
|
+
el.className = `tree ${this.className}`.trim();
|
|
2610
|
+
}
|
|
2551
2611
|
_render() {
|
|
2552
2612
|
const container = this._root.querySelector('[part="tree"]');
|
|
2553
2613
|
container.innerHTML = "";
|
|
@@ -2625,7 +2685,7 @@ var UTable = class extends UElement {
|
|
|
2625
2685
|
this._root.innerHTML = `<style>${tableStyles}</style><div part="table-wrapper" class="table-wrapper"><table part="table" class="table"><thead part="thead"><tr part="header-row"></tr></thead><tbody part="tbody"></tbody></table></div>`;
|
|
2626
2686
|
}
|
|
2627
2687
|
static get observedAttributes() {
|
|
2628
|
-
return ["sortable"];
|
|
2688
|
+
return ["sortable", "class"];
|
|
2629
2689
|
}
|
|
2630
2690
|
get columns() {
|
|
2631
2691
|
return this._columns;
|
|
@@ -2643,10 +2703,16 @@ var UTable = class extends UElement {
|
|
|
2643
2703
|
}
|
|
2644
2704
|
connectedCallback() {
|
|
2645
2705
|
super.connectedCallback();
|
|
2706
|
+
this._sync();
|
|
2646
2707
|
}
|
|
2647
2708
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
2648
2709
|
if (oldVal === newVal) return;
|
|
2649
2710
|
if (name === "sortable") this._sortable = newVal !== null;
|
|
2711
|
+
else if (name === "class") this._sync();
|
|
2712
|
+
}
|
|
2713
|
+
_sync() {
|
|
2714
|
+
const el = this._root.querySelector('[part="table-wrapper"]');
|
|
2715
|
+
el.className = `table-wrapper ${this.className}`.trim();
|
|
2650
2716
|
}
|
|
2651
2717
|
_render() {
|
|
2652
2718
|
this._renderHeader();
|
|
@@ -2746,7 +2812,7 @@ var UBreadcrumb = class extends UElement {
|
|
|
2746
2812
|
this._root.innerHTML = `<style>${breadcrumbStyles}</style><nav part="breadcrumb" class="breadcrumb" aria-label="Breadcrumb"><ol part="list"></ol></nav>`;
|
|
2747
2813
|
}
|
|
2748
2814
|
static get observedAttributes() {
|
|
2749
|
-
return ["separator"];
|
|
2815
|
+
return ["separator", "class"];
|
|
2750
2816
|
}
|
|
2751
2817
|
get items() {
|
|
2752
2818
|
return this._items;
|
|
@@ -2763,14 +2829,21 @@ var UBreadcrumb = class extends UElement {
|
|
|
2763
2829
|
}
|
|
2764
2830
|
connectedCallback() {
|
|
2765
2831
|
super.connectedCallback();
|
|
2832
|
+
this._sync();
|
|
2766
2833
|
}
|
|
2767
2834
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
2768
2835
|
if (oldVal === newVal) return;
|
|
2769
2836
|
if (name === "separator") {
|
|
2770
2837
|
this._separator = newVal ?? "/";
|
|
2771
2838
|
this._render();
|
|
2839
|
+
} else if (name === "class") {
|
|
2840
|
+
this._sync();
|
|
2772
2841
|
}
|
|
2773
2842
|
}
|
|
2843
|
+
_sync() {
|
|
2844
|
+
const el = this._root.querySelector('[part="breadcrumb"]');
|
|
2845
|
+
el.className = `breadcrumb ${this.className}`.trim();
|
|
2846
|
+
}
|
|
2774
2847
|
_render() {
|
|
2775
2848
|
const list = this._root.querySelector("ol");
|
|
2776
2849
|
list.innerHTML = "";
|
|
@@ -2818,7 +2891,7 @@ var UTabs = class extends UElement {
|
|
|
2818
2891
|
this._indicatorEl = this._tablistEl.querySelector(".tab-indicator");
|
|
2819
2892
|
}
|
|
2820
2893
|
static get observedAttributes() {
|
|
2821
|
-
return ["value", "orientation", "variant", "full-width"];
|
|
2894
|
+
return ["value", "orientation", "variant", "full-width", "class"];
|
|
2822
2895
|
}
|
|
2823
2896
|
get value() {
|
|
2824
2897
|
return this._value;
|
|
@@ -2923,6 +2996,8 @@ var UTabs = class extends UElement {
|
|
|
2923
2996
|
this._panelsContainer.appendChild(div);
|
|
2924
2997
|
});
|
|
2925
2998
|
this._updateIndicator();
|
|
2999
|
+
const tabsEl = this._root.querySelector('[part="tabs"]');
|
|
3000
|
+
tabsEl.className = `tabs ${this.className}`.trim();
|
|
2926
3001
|
}
|
|
2927
3002
|
_updateIndicator() {
|
|
2928
3003
|
if (this._variant !== "underline" || !this._indicatorEl) return;
|
|
@@ -2988,10 +3063,25 @@ var UTabs = class extends UElement {
|
|
|
2988
3063
|
|
|
2989
3064
|
// src/components/visually-hidden.wc.ts
|
|
2990
3065
|
var UVisuallyHidden = class extends UElement {
|
|
3066
|
+
static get observedAttributes() {
|
|
3067
|
+
return ["class"];
|
|
3068
|
+
}
|
|
2991
3069
|
constructor() {
|
|
2992
3070
|
super();
|
|
2993
3071
|
this._root.innerHTML = `<style>${visuallyHiddenStyles}</style><span part="hidden" class="visually-hidden"><slot></slot></span>`;
|
|
2994
3072
|
}
|
|
3073
|
+
connectedCallback() {
|
|
3074
|
+
super.connectedCallback();
|
|
3075
|
+
this._sync();
|
|
3076
|
+
}
|
|
3077
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
3078
|
+
if (oldVal === newVal) return;
|
|
3079
|
+
if (name === "class") this._sync();
|
|
3080
|
+
}
|
|
3081
|
+
_sync() {
|
|
3082
|
+
const el = this._root.querySelector('[part="hidden"]');
|
|
3083
|
+
el.className = `visually-hidden ${this.className}`.trim();
|
|
3084
|
+
}
|
|
2995
3085
|
_mount() {
|
|
2996
3086
|
}
|
|
2997
3087
|
};
|
|
@@ -3005,7 +3095,7 @@ var ULiveRegion = class extends UElement {
|
|
|
3005
3095
|
this._root.innerHTML = `<div part="region" aria-live="polite" aria-atomic="false"><slot></slot></div>`;
|
|
3006
3096
|
}
|
|
3007
3097
|
static get observedAttributes() {
|
|
3008
|
-
return ["politeness", "atomic"];
|
|
3098
|
+
return ["politeness", "atomic", "class"];
|
|
3009
3099
|
}
|
|
3010
3100
|
get politeness() {
|
|
3011
3101
|
return this._politeness;
|
|
@@ -3028,10 +3118,12 @@ var ULiveRegion = class extends UElement {
|
|
|
3028
3118
|
if (oldVal === newVal) return;
|
|
3029
3119
|
if (name === "politeness") this._politeness = newVal ?? "polite";
|
|
3030
3120
|
else if (name === "atomic") this._atomic = newVal !== null;
|
|
3121
|
+
else ;
|
|
3031
3122
|
this._sync();
|
|
3032
3123
|
}
|
|
3033
3124
|
_sync() {
|
|
3034
3125
|
const el = this._root.querySelector('[part="region"]');
|
|
3126
|
+
el.className = this.className;
|
|
3035
3127
|
el.setAttribute("aria-live", this._politeness);
|
|
3036
3128
|
el.setAttribute("aria-atomic", String(this._atomic));
|
|
3037
3129
|
}
|
|
@@ -3178,7 +3270,7 @@ var UPresence = class extends UElement {
|
|
|
3178
3270
|
this._root.innerHTML = `<style>${presenceStyles}</style><div part="presence" class="presence"><slot></slot></div>`;
|
|
3179
3271
|
}
|
|
3180
3272
|
static get observedAttributes() {
|
|
3181
|
-
return ["present", "animation", "duration"];
|
|
3273
|
+
return ["present", "animation", "duration", "class"];
|
|
3182
3274
|
}
|
|
3183
3275
|
get present() {
|
|
3184
3276
|
return this._present;
|
|
@@ -3196,6 +3288,7 @@ var UPresence = class extends UElement {
|
|
|
3196
3288
|
}
|
|
3197
3289
|
connectedCallback() {
|
|
3198
3290
|
super.connectedCallback();
|
|
3291
|
+
this._sync();
|
|
3199
3292
|
this._present = this.hasAttribute("present");
|
|
3200
3293
|
this._mounted = true;
|
|
3201
3294
|
if (this._present) {
|
|
@@ -3220,8 +3313,15 @@ var UPresence = class extends UElement {
|
|
|
3220
3313
|
case "duration":
|
|
3221
3314
|
this._duration = Number(newVal) || 200;
|
|
3222
3315
|
break;
|
|
3316
|
+
case "class":
|
|
3317
|
+
this._sync();
|
|
3318
|
+
break;
|
|
3223
3319
|
}
|
|
3224
3320
|
}
|
|
3321
|
+
_sync() {
|
|
3322
|
+
const presenceEl = this._root.querySelector('[part="presence"]');
|
|
3323
|
+
presenceEl.className = `presence ${this.className}`.trim();
|
|
3324
|
+
}
|
|
3225
3325
|
_enter() {
|
|
3226
3326
|
const el = this._root.querySelector('[part="presence"]');
|
|
3227
3327
|
this.style.display = "";
|
|
@@ -3506,7 +3606,7 @@ var UModal = class extends UElement {
|
|
|
3506
3606
|
</div>`;
|
|
3507
3607
|
}
|
|
3508
3608
|
static get observedAttributes() {
|
|
3509
|
-
return ["open", "size", "title", "close-on-escape", "close-on-overlay"];
|
|
3609
|
+
return ["open", "size", "title", "close-on-escape", "close-on-overlay", "class"];
|
|
3510
3610
|
}
|
|
3511
3611
|
get open() {
|
|
3512
3612
|
return this._open;
|
|
@@ -3554,9 +3654,14 @@ var UModal = class extends UElement {
|
|
|
3554
3654
|
case "close-on-overlay":
|
|
3555
3655
|
this._closeOnOverlay = parseBooleanAttribute(newVal, true);
|
|
3556
3656
|
break;
|
|
3657
|
+
case "class":
|
|
3658
|
+
this._sync();
|
|
3659
|
+
break;
|
|
3557
3660
|
}
|
|
3558
3661
|
}
|
|
3559
3662
|
_sync() {
|
|
3663
|
+
const modalEl = this._root.querySelector('[part="modal"]');
|
|
3664
|
+
modalEl.className = `modal ${this.className}`.trim();
|
|
3560
3665
|
this._updateOpenState();
|
|
3561
3666
|
this._updateSize();
|
|
3562
3667
|
this._updateTitle();
|
|
@@ -3693,7 +3798,7 @@ var UDrawer = class extends UElement {
|
|
|
3693
3798
|
</div>`;
|
|
3694
3799
|
}
|
|
3695
3800
|
static get observedAttributes() {
|
|
3696
|
-
return ["open", "side", "size", "close-on-escape", "close-on-overlay"];
|
|
3801
|
+
return ["open", "side", "size", "close-on-escape", "close-on-overlay", "class"];
|
|
3697
3802
|
}
|
|
3698
3803
|
get open() {
|
|
3699
3804
|
return this._open;
|
|
@@ -3744,7 +3849,7 @@ var UDrawer = class extends UElement {
|
|
|
3744
3849
|
}
|
|
3745
3850
|
_sync() {
|
|
3746
3851
|
const drawer = this._root.querySelector('[part="drawer"]');
|
|
3747
|
-
drawer.className = `drawer drawer-${this._side}
|
|
3852
|
+
drawer.className = `drawer drawer-${this._side} ${this.className}`.trim();
|
|
3748
3853
|
const content = this._root.querySelector('[part="drawer-content"]');
|
|
3749
3854
|
this._applyDrawerSize(content);
|
|
3750
3855
|
this._updateOpenState();
|
|
@@ -3879,7 +3984,7 @@ var UPopover = class extends UElement {
|
|
|
3879
3984
|
</div>`;
|
|
3880
3985
|
}
|
|
3881
3986
|
static get observedAttributes() {
|
|
3882
|
-
return ["open", "placement", "offset", "close-on-escape", "close-on-outside-click"];
|
|
3987
|
+
return ["open", "placement", "offset", "close-on-escape", "close-on-outside-click", "class"];
|
|
3883
3988
|
}
|
|
3884
3989
|
get open() {
|
|
3885
3990
|
return this._open;
|
|
@@ -3909,6 +4014,7 @@ var UPopover = class extends UElement {
|
|
|
3909
4014
|
}
|
|
3910
4015
|
connectedCallback() {
|
|
3911
4016
|
super.connectedCallback();
|
|
4017
|
+
this._sync();
|
|
3912
4018
|
}
|
|
3913
4019
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
3914
4020
|
if (oldVal === newVal) return;
|
|
@@ -3929,8 +4035,15 @@ var UPopover = class extends UElement {
|
|
|
3929
4035
|
case "close-on-outside-click":
|
|
3930
4036
|
this._closeOnOutsideClick = newVal !== null;
|
|
3931
4037
|
break;
|
|
4038
|
+
case "class":
|
|
4039
|
+
this._sync();
|
|
4040
|
+
break;
|
|
3932
4041
|
}
|
|
3933
4042
|
}
|
|
4043
|
+
_sync() {
|
|
4044
|
+
const popoverEl = this._root.querySelector('[part="popover"]');
|
|
4045
|
+
popoverEl.className = `popover ${this.className}`.trim();
|
|
4046
|
+
}
|
|
3934
4047
|
_updateOpenState() {
|
|
3935
4048
|
const popover = this._root.querySelector('[part="popover"]');
|
|
3936
4049
|
if (this._open) {
|
|
@@ -4042,7 +4155,7 @@ var UDropdown = class extends UElement {
|
|
|
4042
4155
|
this._triggerEl = this._root.querySelector('[part="trigger"]');
|
|
4043
4156
|
}
|
|
4044
4157
|
static get observedAttributes() {
|
|
4045
|
-
return ["open", "placement", "value"];
|
|
4158
|
+
return ["open", "placement", "value", "class"];
|
|
4046
4159
|
}
|
|
4047
4160
|
get open() {
|
|
4048
4161
|
return this._open;
|
|
@@ -4079,6 +4192,7 @@ var UDropdown = class extends UElement {
|
|
|
4079
4192
|
}
|
|
4080
4193
|
connectedCallback() {
|
|
4081
4194
|
super.connectedCallback();
|
|
4195
|
+
this._sync();
|
|
4082
4196
|
this._renderItems();
|
|
4083
4197
|
}
|
|
4084
4198
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
@@ -4095,8 +4209,15 @@ var UDropdown = class extends UElement {
|
|
|
4095
4209
|
this._value = newVal ?? "";
|
|
4096
4210
|
this._updateSelected();
|
|
4097
4211
|
break;
|
|
4212
|
+
case "class":
|
|
4213
|
+
this._sync();
|
|
4214
|
+
break;
|
|
4098
4215
|
}
|
|
4099
4216
|
}
|
|
4217
|
+
_sync() {
|
|
4218
|
+
const triggerEl = this._root.querySelector('[part="trigger"]');
|
|
4219
|
+
triggerEl.className = `dropdown-trigger ${this.className}`.trim();
|
|
4220
|
+
}
|
|
4100
4221
|
_renderItems() {
|
|
4101
4222
|
this._itemsContainer.innerHTML = "";
|
|
4102
4223
|
this._itemElements = [];
|
|
@@ -4253,7 +4374,7 @@ var UAccordion = class extends UElement {
|
|
|
4253
4374
|
this._root.innerHTML = `<style>${accordionStyles}</style><div part="accordion" class="accordion"><slot></slot></div>`;
|
|
4254
4375
|
}
|
|
4255
4376
|
static get observedAttributes() {
|
|
4256
|
-
return ["collapsible", "multiple"];
|
|
4377
|
+
return ["collapsible", "multiple", "class"];
|
|
4257
4378
|
}
|
|
4258
4379
|
get value() {
|
|
4259
4380
|
return Array.from(this._value);
|
|
@@ -4276,12 +4397,18 @@ var UAccordion = class extends UElement {
|
|
|
4276
4397
|
}
|
|
4277
4398
|
connectedCallback() {
|
|
4278
4399
|
super.connectedCallback();
|
|
4400
|
+
this._sync();
|
|
4279
4401
|
this._initItems();
|
|
4280
4402
|
}
|
|
4281
4403
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
4282
4404
|
if (oldVal === newVal) return;
|
|
4283
4405
|
if (name === "collapsible") this._collapsible = newVal !== null;
|
|
4284
4406
|
else if (name === "multiple") this._multiple = newVal !== null;
|
|
4407
|
+
else if (name === "class") this._sync();
|
|
4408
|
+
}
|
|
4409
|
+
_sync() {
|
|
4410
|
+
const accordionEl = this._root.querySelector('[part="accordion"]');
|
|
4411
|
+
accordionEl.className = `accordion ${this.className}`.trim();
|
|
4285
4412
|
}
|
|
4286
4413
|
_initItems() {
|
|
4287
4414
|
const items = this.querySelectorAll(":scope > u-accordion-item");
|
|
@@ -4356,7 +4483,7 @@ var UAccordionItem = class extends UElement {
|
|
|
4356
4483
|
</div>`;
|
|
4357
4484
|
}
|
|
4358
4485
|
static get observedAttributes() {
|
|
4359
|
-
return ["value", "open"];
|
|
4486
|
+
return ["value", "open", "class"];
|
|
4360
4487
|
}
|
|
4361
4488
|
get value() {
|
|
4362
4489
|
return this._value;
|
|
@@ -4374,12 +4501,18 @@ var UAccordionItem = class extends UElement {
|
|
|
4374
4501
|
}
|
|
4375
4502
|
connectedCallback() {
|
|
4376
4503
|
super.connectedCallback();
|
|
4504
|
+
this._sync();
|
|
4377
4505
|
if (this.hasAttribute("open")) this._open = true;
|
|
4378
4506
|
}
|
|
4379
4507
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
4380
4508
|
if (oldVal === newVal) return;
|
|
4381
4509
|
if (name === "value") this._value = newVal ?? "";
|
|
4382
4510
|
else if (name === "open") this._open = newVal !== null;
|
|
4511
|
+
else if (name === "class") this._sync();
|
|
4512
|
+
}
|
|
4513
|
+
_sync() {
|
|
4514
|
+
const itemEl = this._root.querySelector('[part="accordion-item"]');
|
|
4515
|
+
itemEl.className = `accordion-item ${this.className}`.trim();
|
|
4383
4516
|
}
|
|
4384
4517
|
_mount() {
|
|
4385
4518
|
}
|
|
@@ -4414,7 +4547,7 @@ var UCombobox = class extends UElement {
|
|
|
4414
4547
|
</div>`;
|
|
4415
4548
|
}
|
|
4416
4549
|
static get observedAttributes() {
|
|
4417
|
-
return ["value", "placeholder", "disabled", "filterable"];
|
|
4550
|
+
return ["value", "placeholder", "disabled", "filterable", "class"];
|
|
4418
4551
|
}
|
|
4419
4552
|
get value() {
|
|
4420
4553
|
return this._value;
|
|
@@ -4450,9 +4583,14 @@ var UCombobox = class extends UElement {
|
|
|
4450
4583
|
case "filterable":
|
|
4451
4584
|
this._filterable = newVal !== null;
|
|
4452
4585
|
break;
|
|
4586
|
+
case "class":
|
|
4587
|
+
this._syncInput();
|
|
4588
|
+
break;
|
|
4453
4589
|
}
|
|
4454
4590
|
}
|
|
4455
4591
|
_syncInput() {
|
|
4592
|
+
const combobox = this._root.querySelector('[part="combobox"]');
|
|
4593
|
+
combobox.className = `combobox ${this.className}`.trim();
|
|
4456
4594
|
const input = this._root.querySelector("input");
|
|
4457
4595
|
input.placeholder = this._placeholder;
|
|
4458
4596
|
input.disabled = this._disabled;
|
|
@@ -4645,7 +4783,7 @@ var UCalendar = class extends UElement {
|
|
|
4645
4783
|
</div>`;
|
|
4646
4784
|
}
|
|
4647
4785
|
static get observedAttributes() {
|
|
4648
|
-
return ["value", "min", "max"];
|
|
4786
|
+
return ["value", "min", "max", "class"];
|
|
4649
4787
|
}
|
|
4650
4788
|
get value() {
|
|
4651
4789
|
return this._value;
|
|
@@ -4655,6 +4793,7 @@ var UCalendar = class extends UElement {
|
|
|
4655
4793
|
}
|
|
4656
4794
|
connectedCallback() {
|
|
4657
4795
|
super.connectedCallback();
|
|
4796
|
+
this._sync();
|
|
4658
4797
|
if (this._value) {
|
|
4659
4798
|
const d = new Date(this._value);
|
|
4660
4799
|
if (!isNaN(d.getTime())) {
|
|
@@ -4670,8 +4809,16 @@ var UCalendar = class extends UElement {
|
|
|
4670
4809
|
if (name === "value") this._value = newVal ?? "";
|
|
4671
4810
|
else if (name === "min") this._min = newVal ?? "";
|
|
4672
4811
|
else if (name === "max") this._max = newVal ?? "";
|
|
4812
|
+
else if (name === "class") {
|
|
4813
|
+
this._sync();
|
|
4814
|
+
return;
|
|
4815
|
+
}
|
|
4673
4816
|
this._render();
|
|
4674
4817
|
}
|
|
4818
|
+
_sync() {
|
|
4819
|
+
const el = this._root.querySelector('[part="calendar"]');
|
|
4820
|
+
el.className = `calendar ${this.className}`.trim();
|
|
4821
|
+
}
|
|
4675
4822
|
_renderDayNames() {
|
|
4676
4823
|
const container = this._root.querySelector('[part="day-names"]');
|
|
4677
4824
|
container.innerHTML = DAYS.map((d) => `<span class="cal-day-name">${d}</span>`).join("");
|
|
@@ -4783,7 +4930,7 @@ var UDataTable = class extends UElement {
|
|
|
4783
4930
|
</div>`;
|
|
4784
4931
|
}
|
|
4785
4932
|
static get observedAttributes() {
|
|
4786
|
-
return ["page-size", "sortable", "selectable"];
|
|
4933
|
+
return ["page-size", "sortable", "selectable", "class"];
|
|
4787
4934
|
}
|
|
4788
4935
|
get columns() {
|
|
4789
4936
|
return this._columns;
|
|
@@ -4807,14 +4954,20 @@ var UDataTable = class extends UElement {
|
|
|
4807
4954
|
}
|
|
4808
4955
|
connectedCallback() {
|
|
4809
4956
|
super.connectedCallback();
|
|
4957
|
+
this._sync();
|
|
4810
4958
|
}
|
|
4811
4959
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
4812
4960
|
if (oldVal === newVal) return;
|
|
4813
4961
|
if (name === "page-size") this._pageSize = Number(newVal) || 10;
|
|
4814
4962
|
else if (name === "sortable") this._sortable = newVal !== null;
|
|
4815
4963
|
else if (name === "selectable") this._selectable = newVal !== null;
|
|
4964
|
+
else if (name === "class") return;
|
|
4816
4965
|
this._render();
|
|
4817
4966
|
}
|
|
4967
|
+
_sync() {
|
|
4968
|
+
const el = this._root.querySelector('[part="data-table"]');
|
|
4969
|
+
el.className = `data-table ${this.className}`.trim();
|
|
4970
|
+
}
|
|
4818
4971
|
_getProcessedData() {
|
|
4819
4972
|
let data = [...this._rows];
|
|
4820
4973
|
if (this._filterText) {
|
|
@@ -5032,7 +5185,7 @@ var UCommandPalette = class extends UElement {
|
|
|
5032
5185
|
</div>`;
|
|
5033
5186
|
}
|
|
5034
5187
|
static get observedAttributes() {
|
|
5035
|
-
return ["open", "placeholder", "shortcut"];
|
|
5188
|
+
return ["open", "placeholder", "shortcut", "class"];
|
|
5036
5189
|
}
|
|
5037
5190
|
get open() {
|
|
5038
5191
|
return this._open;
|
|
@@ -5072,9 +5225,13 @@ var UCommandPalette = class extends UElement {
|
|
|
5072
5225
|
} else if (name === "shortcut") {
|
|
5073
5226
|
this._shortcut = newVal ?? "Ctrl+K";
|
|
5074
5227
|
this._sync();
|
|
5228
|
+
} else if (name === "class") {
|
|
5229
|
+
this._sync();
|
|
5075
5230
|
}
|
|
5076
5231
|
}
|
|
5077
5232
|
_sync() {
|
|
5233
|
+
const dialog = this._root.querySelector('[part="dialog"]');
|
|
5234
|
+
dialog.className = `cp-dialog ${this.className}`.trim();
|
|
5078
5235
|
const hint = this._root.querySelector('[part="shortcut-hint"]');
|
|
5079
5236
|
hint.textContent = this._shortcut;
|
|
5080
5237
|
const input = this._root.querySelector('[part="search-input"]');
|
|
@@ -5281,7 +5438,7 @@ var UToast = class extends UElement {
|
|
|
5281
5438
|
this._root.innerHTML = `<style>${toastStyles}</style><div part="container" class="toast-container toast-top-right"></div>`;
|
|
5282
5439
|
}
|
|
5283
5440
|
static get observedAttributes() {
|
|
5284
|
-
return ["placement"];
|
|
5441
|
+
return ["placement", "class"];
|
|
5285
5442
|
}
|
|
5286
5443
|
get placement() {
|
|
5287
5444
|
return this._placement;
|
|
@@ -5302,7 +5459,7 @@ var UToast = class extends UElement {
|
|
|
5302
5459
|
}
|
|
5303
5460
|
_updatePlacement() {
|
|
5304
5461
|
const container = this._root.querySelector('[part="container"]');
|
|
5305
|
-
container.className = `toast-container toast-${this._placement}
|
|
5462
|
+
container.className = `toast-container toast-${this._placement} ${this.className}`.trim();
|
|
5306
5463
|
}
|
|
5307
5464
|
show(opts) {
|
|
5308
5465
|
const id = `toast-${++toastId}`;
|
|
@@ -5403,6 +5560,9 @@ var UContextMenu = class extends UElement {
|
|
|
5403
5560
|
<div part="items" class="cm-items"></div>
|
|
5404
5561
|
</div>`;
|
|
5405
5562
|
}
|
|
5563
|
+
static get observedAttributes() {
|
|
5564
|
+
return ["class"];
|
|
5565
|
+
}
|
|
5406
5566
|
get items() {
|
|
5407
5567
|
return this._items;
|
|
5408
5568
|
}
|
|
@@ -5414,6 +5574,11 @@ var UContextMenu = class extends UElement {
|
|
|
5414
5574
|
super.connectedCallback();
|
|
5415
5575
|
this._parseSlotItems();
|
|
5416
5576
|
this._renderItems();
|
|
5577
|
+
this._sync();
|
|
5578
|
+
}
|
|
5579
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
5580
|
+
if (oldVal === newVal) return;
|
|
5581
|
+
if (name === "class") this._sync();
|
|
5417
5582
|
}
|
|
5418
5583
|
_parseSlotItems() {
|
|
5419
5584
|
const slotItems = this.querySelectorAll("u-context-menu-item");
|
|
@@ -5455,6 +5620,10 @@ var UContextMenu = class extends UElement {
|
|
|
5455
5620
|
container.appendChild(btn);
|
|
5456
5621
|
});
|
|
5457
5622
|
}
|
|
5623
|
+
_sync() {
|
|
5624
|
+
const menu = this._root.querySelector('[part="menu"]');
|
|
5625
|
+
menu.className = `cm-menu ${this.className}`.trim();
|
|
5626
|
+
}
|
|
5458
5627
|
_openMenu(x, y) {
|
|
5459
5628
|
const menu = this._root.querySelector('[part="menu"]');
|
|
5460
5629
|
const itemsContainer = this._root.querySelector('[part="items"]');
|
|
@@ -5653,7 +5822,11 @@ var USortable = class extends UElement {
|
|
|
5653
5822
|
</div>`;
|
|
5654
5823
|
}
|
|
5655
5824
|
static get observedAttributes() {
|
|
5656
|
-
return ["disabled"];
|
|
5825
|
+
return ["disabled", "class"];
|
|
5826
|
+
}
|
|
5827
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
5828
|
+
if (oldVal === newVal) return;
|
|
5829
|
+
if (name === "class") this._sync();
|
|
5657
5830
|
}
|
|
5658
5831
|
get disabled() {
|
|
5659
5832
|
return this._disabled;
|
|
@@ -5689,6 +5862,14 @@ var USortable = class extends UElement {
|
|
|
5689
5862
|
}
|
|
5690
5863
|
return null;
|
|
5691
5864
|
}
|
|
5865
|
+
connectedCallback() {
|
|
5866
|
+
super.connectedCallback();
|
|
5867
|
+
this._sync();
|
|
5868
|
+
}
|
|
5869
|
+
_sync() {
|
|
5870
|
+
const el = this._root.querySelector('[part="sortable"]');
|
|
5871
|
+
el.className = `sortable ${this.className}`.trim();
|
|
5872
|
+
}
|
|
5692
5873
|
_mount() {
|
|
5693
5874
|
this.addEventListener("pointerdown", this._onPointerDown);
|
|
5694
5875
|
}
|
|
@@ -5704,22 +5885,41 @@ var UForm = class extends UElement {
|
|
|
5704
5885
|
<slot></slot>
|
|
5705
5886
|
</form>`;
|
|
5706
5887
|
}
|
|
5888
|
+
static get observedAttributes() {
|
|
5889
|
+
return ["class"];
|
|
5890
|
+
}
|
|
5891
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
5892
|
+
if (oldVal === newVal) return;
|
|
5893
|
+
this._sync();
|
|
5894
|
+
}
|
|
5895
|
+
connectedCallback() {
|
|
5896
|
+
super.connectedCallback();
|
|
5897
|
+
this._sync();
|
|
5898
|
+
}
|
|
5707
5899
|
get form() {
|
|
5708
5900
|
return this._root.querySelector("form");
|
|
5709
5901
|
}
|
|
5902
|
+
_sync() {
|
|
5903
|
+
const form = this._root.querySelector("form");
|
|
5904
|
+
if (!form) return;
|
|
5905
|
+
form.className = `form ${this.className}`.trim();
|
|
5906
|
+
}
|
|
5710
5907
|
validate() {
|
|
5711
5908
|
let valid = true;
|
|
5712
5909
|
const errors = {};
|
|
5713
5910
|
this._fields.clear();
|
|
5714
|
-
const inputs = this.querySelectorAll(
|
|
5911
|
+
const inputs = this.querySelectorAll(
|
|
5912
|
+
"input, textarea, select, u-input, u-textarea, u-select, u-checkbox, u-radio-group"
|
|
5913
|
+
);
|
|
5715
5914
|
inputs.forEach((el) => {
|
|
5716
5915
|
const name = el.getAttribute("name") || "";
|
|
5717
5916
|
if (!name) return;
|
|
5718
5917
|
this._fields.set(name, el);
|
|
5719
|
-
|
|
5720
|
-
|
|
5918
|
+
const anyEl = el;
|
|
5919
|
+
if (typeof anyEl.checkValidity === "function") {
|
|
5920
|
+
if (!anyEl.checkValidity()) {
|
|
5721
5921
|
valid = false;
|
|
5722
|
-
errors[name] =
|
|
5922
|
+
errors[name] = anyEl.validationMessage || "Invalid";
|
|
5723
5923
|
const field = el.closest("u-field");
|
|
5724
5924
|
if (field) {
|
|
5725
5925
|
field.setAttribute("error", errors[name]);
|
|
@@ -5740,14 +5940,20 @@ var UForm = class extends UElement {
|
|
|
5740
5940
|
}
|
|
5741
5941
|
getValues() {
|
|
5742
5942
|
const values = {};
|
|
5743
|
-
const inputs = this.querySelectorAll(
|
|
5943
|
+
const inputs = this.querySelectorAll(
|
|
5944
|
+
"input, textarea, select, u-input, u-textarea, u-select, u-checkbox, u-radio-group"
|
|
5945
|
+
);
|
|
5744
5946
|
inputs.forEach((el) => {
|
|
5745
5947
|
const name = el.getAttribute("name") || "";
|
|
5746
5948
|
if (!name) return;
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
values[name] = String(
|
|
5949
|
+
const anyEl = el;
|
|
5950
|
+
const tag = el.tagName.toLowerCase();
|
|
5951
|
+
if (tag === "input" && anyEl.type === "checkbox") {
|
|
5952
|
+
values[name] = String(anyEl.checked);
|
|
5953
|
+
} else if (tag === "u-checkbox") {
|
|
5954
|
+
values[name] = String(anyEl.checked ?? false);
|
|
5955
|
+
} else if ("value" in anyEl) {
|
|
5956
|
+
values[name] = String(anyEl.value ?? "");
|
|
5751
5957
|
}
|
|
5752
5958
|
});
|
|
5753
5959
|
return values;
|
|
@@ -5786,7 +5992,7 @@ var UBadge = class extends UElement {
|
|
|
5786
5992
|
this._root.innerHTML = `<style>${badgeStyles}</style><span part="badge" class="badge badge-default badge-md badge-pill"><slot></slot></span>`;
|
|
5787
5993
|
}
|
|
5788
5994
|
static get observedAttributes() {
|
|
5789
|
-
return ["variant", "size", "dot", "pill"];
|
|
5995
|
+
return ["variant", "size", "dot", "pill", "class"];
|
|
5790
5996
|
}
|
|
5791
5997
|
get variant() {
|
|
5792
5998
|
return this._variant;
|
|
@@ -5838,7 +6044,7 @@ var UBadge = class extends UElement {
|
|
|
5838
6044
|
}
|
|
5839
6045
|
_sync() {
|
|
5840
6046
|
const el = this._root.querySelector('[part="badge"]');
|
|
5841
|
-
el.className = `badge badge-${this._variant} badge-${this._size}
|
|
6047
|
+
el.className = `badge badge-${this._variant} badge-${this._size} ${this.className}`.trim();
|
|
5842
6048
|
if (this._dot) {
|
|
5843
6049
|
el.classList.add("badge-dot");
|
|
5844
6050
|
} else if (this._pill) {
|
|
@@ -5875,7 +6081,7 @@ var UCard = class extends UElement {
|
|
|
5875
6081
|
</div>`;
|
|
5876
6082
|
}
|
|
5877
6083
|
static get observedAttributes() {
|
|
5878
|
-
return ["variant", "padding", "hoverable"];
|
|
6084
|
+
return ["variant", "padding", "hoverable", "class"];
|
|
5879
6085
|
}
|
|
5880
6086
|
get variant() {
|
|
5881
6087
|
return this._variant;
|
|
@@ -5917,7 +6123,7 @@ var UCard = class extends UElement {
|
|
|
5917
6123
|
}
|
|
5918
6124
|
_sync() {
|
|
5919
6125
|
const el = this._root.querySelector('[part="card"]');
|
|
5920
|
-
el.className = `card card-${this._variant} card-padding-${this._padding}
|
|
6126
|
+
el.className = `card card-${this._variant} card-padding-${this._padding} ${this.className}`.trim();
|
|
5921
6127
|
if (this._hoverable) el.classList.add("card-hoverable");
|
|
5922
6128
|
const imageSlot = this._root.querySelector('slot[name="image"]');
|
|
5923
6129
|
if (imageSlot) {
|
|
@@ -5937,5 +6143,5 @@ var UCard = class extends UElement {
|
|
|
5937
6143
|
};
|
|
5938
6144
|
|
|
5939
6145
|
export { UAccordion, UAccordionItem, UAnimate, UBadge, UBox, UBreadcrumb, UButton, UCalendar, UCard, UCheckbox, UCollection, UCombobox, UCommandPalette, UContainer, UContextMenu, UDataTable, UDialogRoot, UDismissableLayer, UDrawer, UDropdown, UField, UFocusManager, UFocusScope, UFocusTrap, UForm, UGrid, UHStack, UHoverable, UInput, UKeyboardNavigation, ULabel, ULink, UList, ULiveRegion, UModal, UOverlay, UPopover, UPopper, UPortal, UPresence, UPressable, URadio, URadioGroup, URouterView, USelect, USlot, USortable, USpacer, UStack, USwitch, UTable, UTabs, UText, UTextarea, UToast, UTooltipRoot, UTransition, UTree, UVirtualList, UVisuallyHidden, createControlledInput, setPortalRoot };
|
|
5940
|
-
//# sourceMappingURL=chunk-
|
|
5941
|
-
//# sourceMappingURL=chunk-
|
|
6146
|
+
//# sourceMappingURL=chunk-PIXJHFME.js.map
|
|
6147
|
+
//# sourceMappingURL=chunk-PIXJHFME.js.map
|