@voidable/ui 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/base-entry.d.ts +1 -0
- package/dist/base.d.ts +2 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BxmMM3B7.js +298 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-D_YVy2vg.js → modal-CgGp_fCs.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-hLJ7IQHx.js} +2 -2
- package/dist/chunks/{parts-D30c8OoG.js → parts-DI_3VpSy.js} +25 -18
- package/dist/chunks/{base-CMruMbxC.js → projection-SnR79EHI.js} +105 -389
- package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
- package/dist/chunks/value-list-CH6GjYXM.js +28 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +8 -4
- package/dist/components/action-input.js +61 -49
- package/dist/components/alert.js +2 -2
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +2 -2
- package/dist/components/bar-chart.js +31 -29
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +78 -76
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +18 -17
- package/dist/components/checkbox-group.d.ts +10 -0
- package/dist/components/checkbox-group.js +36 -23
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.d.ts +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.d.ts +4 -2
- package/dist/components/combobox.js +22 -18
- package/dist/components/compose-input.d.ts +1 -1
- package/dist/components/compose-input.js +15 -10
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +11 -9
- package/dist/components/donut-chart.js +51 -49
- package/dist/components/drawer.d.ts +2 -2
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +4 -4
- package/dist/components/editable.d.ts +1 -1
- package/dist/components/editable.js +13 -12
- package/dist/components/error-fallback.js +2 -2
- package/dist/components/field.js +10 -9
- package/dist/components/file-upload.js +19 -17
- package/dist/components/gauge.js +90 -85
- package/dist/components/hamburger.js +11 -9
- package/dist/components/hover-card.js +3 -3
- package/dist/components/indicator.js +14 -12
- package/dist/components/input.d.ts +6 -2
- package/dist/components/input.js +46 -34
- package/dist/components/line-chart.js +41 -39
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +3 -3
- package/dist/components/multiselect.d.ts +9 -0
- package/dist/components/multiselect.js +64 -54
- package/dist/components/nav-bar.js +1 -1
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/number-input.js +17 -15
- package/dist/components/pagination.js +22 -20
- package/dist/components/panel.js +2 -2
- package/dist/components/pin-input.d.ts +6 -2
- package/dist/components/pin-input.js +39 -27
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +15 -10
- package/dist/components/radio.d.ts +25 -0
- package/dist/components/radio.js +78 -29
- package/dist/components/scroll-area.js +8 -7
- package/dist/components/segmented-control.d.ts +1 -1
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.d.ts +67 -16
- package/dist/components/select.js +183 -56
- package/dist/components/sidebar.d.ts +2 -2
- package/dist/components/sidebar.js +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +18 -13
- package/dist/components/spinner.js +11 -9
- package/dist/components/stat.js +19 -17
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +15 -13
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +14 -12
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +29 -29
- package/dist/components/tag.js +9 -8
- package/dist/components/tags-input.d.ts +1 -1
- package/dist/components/tags-input.js +25 -19
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +36 -31
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +5 -2
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +3 -3
- package/dist/custom-elements.json +133 -67
- package/dist/dev/types.d.ts +2 -3
- package/dist/dev.js +81 -55
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +125 -0
- package/dist/parts.d.ts +8 -1
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +4575 -0
- package/dist/secret-value.d.ts +17 -0
- package/dist/types/elements.d.ts +2 -2
- package/dist/value-list.d.ts +14 -0
- package/dist/vscode.html-custom-data.json +46 -26
- package/dist/web-types.json +73 -53
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -185,6 +185,14 @@ Dialog and drawer are native `<dialog>` elements opened with `showModal()`, so t
|
|
|
185
185
|
|
|
186
186
|
Every overlay takes `open`, `side` and `align` where it is anchored, and fires `void-open` and `void-close` with a `reason` (`escape`, `outside`, `select`, `api`, ...). These two events do not bubble, and `void-close` can be cancelled when the user caused it. Browser baseline: the Popover API (Chrome 114, Firefox 125, Safari 17). Details on the [docs site](https://voidable.dev/components/overlays/).
|
|
187
187
|
|
|
188
|
+
## For AI agents
|
|
189
|
+
|
|
190
|
+
The package carries its own reference, generated from the Custom Elements Manifest at build time, so an agent with only `node_modules/@voidable/ui` has it:
|
|
191
|
+
|
|
192
|
+
- `@voidable/ui/llms.txt` (`dist/llms.txt`): what the library is, install, the composition rules and conventions, one line per element.
|
|
193
|
+
- `@voidable/ui/reference.md` (`dist/reference.md`): every element in full, with its parts, attributes and allowed values, events and their `detail`, and a correct example.
|
|
194
|
+
- `@voidable/ui/custom-elements.json`: the manifest both are generated from.
|
|
195
|
+
|
|
188
196
|
## Documentation
|
|
189
197
|
|
|
190
198
|
- [Docs](https://voidable.dev)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VoidElement } from './base.js';
|
package/dist/base.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import { PROJECTION_KEY
|
|
2
|
+
import { PROJECTION_KEY } from './projection-api.js';
|
|
3
|
+
import { ProjectionController } from './projection.js';
|
|
3
4
|
/** Same key as parts.ts's MORPH_PARTICIPANTS (a registered symbol, so base needs no import of parts.ts). */
|
|
4
5
|
declare const MORPH_PARTICIPANTS: unique symbol;
|
|
5
6
|
export declare class VoidElement extends LitElement {
|
package/dist/base.js
CHANGED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { LitElement as e, ReactiveElement as t } from "lit";
|
|
2
|
+
//#region src/projection-api.ts
|
|
3
|
+
var n = "__voidProjection", r = {}, i = Symbol("voidReflectedDefaults"), a = Symbol("voidDefaultsProbe"), o = Symbol("voidReflectAgain");
|
|
4
|
+
function s(e) {
|
|
5
|
+
let t = e.constructor;
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(t, i)) return t[i];
|
|
7
|
+
let n = /* @__PURE__ */ new Map();
|
|
8
|
+
t[i] = n;
|
|
9
|
+
let r = null;
|
|
10
|
+
try {
|
|
11
|
+
customElements.get(e.localName) === t && (r = Object.assign(new t(), { [a]: !0 }));
|
|
12
|
+
} catch {
|
|
13
|
+
r = null;
|
|
14
|
+
}
|
|
15
|
+
if (!r) return n;
|
|
16
|
+
for (let [e, i] of t.elementProperties) {
|
|
17
|
+
if (!i.reflect || i.attribute === !1) continue;
|
|
18
|
+
let t = typeof i.attribute == "string" ? i.attribute : String(e).toLowerCase(), a = typeof i.converter == "function" || !!i.converter?.fromAttribute;
|
|
19
|
+
n.set(t, {
|
|
20
|
+
prop: e,
|
|
21
|
+
value: r[e],
|
|
22
|
+
custom: a,
|
|
23
|
+
options: i
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
var c = Symbol("voidMorphMeta");
|
|
29
|
+
function l(e) {
|
|
30
|
+
let t = e.constructor;
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(t, c)) return t[c];
|
|
32
|
+
let n = /* @__PURE__ */ new Map();
|
|
33
|
+
for (let [e, r] of t.elementProperties) {
|
|
34
|
+
if (r.attribute === !1) continue;
|
|
35
|
+
let t = typeof r.attribute == "string" ? r.attribute : String(e).toLowerCase();
|
|
36
|
+
n.set(t, !!r.reflect);
|
|
37
|
+
}
|
|
38
|
+
let r = {
|
|
39
|
+
attrs: n,
|
|
40
|
+
drafts: Object.entries(t.clientState ?? {}),
|
|
41
|
+
hook: e.morphedCallback !== h.prototype.morphedCallback,
|
|
42
|
+
edits: t.editState ?? []
|
|
43
|
+
};
|
|
44
|
+
return t[c] = r, r;
|
|
45
|
+
}
|
|
46
|
+
var u = 10, d = 1e3, f = Symbol.for("voidable.dev"), p = Symbol.for("@voidable/ui:morph-participants"), m = /* @__PURE__ */ new WeakMap(), h = class i extends e {
|
|
47
|
+
#e = null;
|
|
48
|
+
#t = null;
|
|
49
|
+
#n = !1;
|
|
50
|
+
#r = !1;
|
|
51
|
+
#i = null;
|
|
52
|
+
#a = void 0;
|
|
53
|
+
#o = void 0;
|
|
54
|
+
#s = !1;
|
|
55
|
+
#c = null;
|
|
56
|
+
static get observedAttributes() {
|
|
57
|
+
let e = super.observedAttributes;
|
|
58
|
+
return this.labelTarget ? [
|
|
59
|
+
...e,
|
|
60
|
+
"aria-label",
|
|
61
|
+
"aria-labelledby"
|
|
62
|
+
] : e;
|
|
63
|
+
}
|
|
64
|
+
#l = null;
|
|
65
|
+
#u(e, t) {
|
|
66
|
+
this.#l || (this.#l = {
|
|
67
|
+
"aria-label": null,
|
|
68
|
+
"aria-labelledby": null,
|
|
69
|
+
written: /* @__PURE__ */ new Map()
|
|
70
|
+
}, this.addController({ hostUpdated: () => this.#d() })), this.#l[e] = t || null, this.removeAttribute(e), this.#d();
|
|
71
|
+
}
|
|
72
|
+
#d() {
|
|
73
|
+
let e = this.#l, t = this.constructor.labelTarget;
|
|
74
|
+
if (!e || !t) return;
|
|
75
|
+
let n = Array.from(this.querySelectorAll(t));
|
|
76
|
+
for (let [t, r] of e.written) if (!n.includes(t)) {
|
|
77
|
+
e.written.delete(t);
|
|
78
|
+
for (let [e, n] of Object.entries(r)) n !== null && t.getAttribute(e) === n && t.removeAttribute(e);
|
|
79
|
+
}
|
|
80
|
+
for (let t of n) {
|
|
81
|
+
let n = e.written.get(t);
|
|
82
|
+
n || e.written.set(t, n = {
|
|
83
|
+
"aria-label": null,
|
|
84
|
+
"aria-labelledby": null
|
|
85
|
+
});
|
|
86
|
+
for (let r of ["aria-label", "aria-labelledby"]) {
|
|
87
|
+
let i = e[r], a = t.getAttribute(r);
|
|
88
|
+
r === "aria-labelledby" && a !== null && a !== n[r] || (i === null ? (n[r] !== null && a === n[r] && a !== null && t.removeAttribute(r), n[r] = null) : (a !== i && t.setAttribute(r, i), n[r] = i));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
createRenderRoot() {
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
connectedCallback() {
|
|
96
|
+
this.#a === void 0 && (this.#a = this.#f(this), this.#o = this.outerHTML, !this.__voidProjection && this.render !== e.prototype.render && r.current?.create(this)), super.connectedCallback();
|
|
97
|
+
}
|
|
98
|
+
connectedMoveCallback() {}
|
|
99
|
+
#f(e) {
|
|
100
|
+
if (!e.hasAttributes()) return null;
|
|
101
|
+
let { attrs: t } = l(this), n = e.attributes, r = null;
|
|
102
|
+
for (let e = 0; e < n.length; e++) {
|
|
103
|
+
let i = n[e];
|
|
104
|
+
t.has(i.name) && (r ??= /* @__PURE__ */ new Map()).set(i.name, i.value);
|
|
105
|
+
}
|
|
106
|
+
return r;
|
|
107
|
+
}
|
|
108
|
+
shouldUpdate(e) {
|
|
109
|
+
return !this[a] && super.shouldUpdate(e);
|
|
110
|
+
}
|
|
111
|
+
update(n) {
|
|
112
|
+
this.#r = !0;
|
|
113
|
+
try {
|
|
114
|
+
this.render === e.prototype.render ? t.prototype.update.call(this, n) : super.update(n);
|
|
115
|
+
} finally {
|
|
116
|
+
this.#r = !1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
setHostAttribute(e, t) {
|
|
120
|
+
let n = t === !0 ? "" : t === !1 || t == null ? null : String(t), r = this.#e ??= /* @__PURE__ */ new Map();
|
|
121
|
+
this.#i && r.get(e) !== n && this.#i.delete(e), r.set(e, n), n === null ? this.hasAttribute(e) && super.removeAttribute(e) : this.getAttribute(e) !== n && super.setAttribute(e, n);
|
|
122
|
+
}
|
|
123
|
+
setHostStyle(e, t) {
|
|
124
|
+
t == null || t === "" ? (this.#t?.delete(e), this.style.removeProperty(e)) : ((this.#t ??= /* @__PURE__ */ new Map()).set(e, t), this.style.getPropertyValue(e) !== t && this.style.setProperty(e, t));
|
|
125
|
+
}
|
|
126
|
+
removeAttribute(e) {
|
|
127
|
+
super.removeAttribute(e), this.#p(e);
|
|
128
|
+
}
|
|
129
|
+
removeAttributeNS(e, t) {
|
|
130
|
+
super.removeAttributeNS(e, t), e || this.#p(t);
|
|
131
|
+
}
|
|
132
|
+
toggleAttribute(e, t) {
|
|
133
|
+
let n = super.toggleAttribute(e, t);
|
|
134
|
+
return n || this.#p(e), n;
|
|
135
|
+
}
|
|
136
|
+
setAttribute(e, t) {
|
|
137
|
+
super.setAttribute(e, t), e === "style" && this.#t?.size && this.#m();
|
|
138
|
+
}
|
|
139
|
+
#p(e) {
|
|
140
|
+
(e === "style" ? this.#t?.size : this.#e?.get(e) != null) && this.#m();
|
|
141
|
+
}
|
|
142
|
+
#m() {
|
|
143
|
+
this.#n || (this.#n = !0, queueMicrotask(() => {
|
|
144
|
+
this.#n = !1, this.#h();
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
#h() {
|
|
148
|
+
if (this.#e) for (let [e, t] of this.#e) t !== null && !this.hasAttribute(e) && this.#g(e) && super.setAttribute(e, t);
|
|
149
|
+
if (this.#t) {
|
|
150
|
+
let e;
|
|
151
|
+
for (let [t, n] of this.#t) if (this.style.getPropertyValue(t) !== n) {
|
|
152
|
+
if (!(e ??= this.#g("style"))) break;
|
|
153
|
+
this.style.setProperty(t, n);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
#g(e) {
|
|
158
|
+
let t = Date.now(), n = this.#i ??= /* @__PURE__ */ new Map(), r = n.get(e);
|
|
159
|
+
return r && r[0] === Infinity ? !1 : ((!r || t - r[1] > d) && n.set(e, r = [0, t]), ++r[0] <= u ? !0 : (r[0] = Infinity, globalThis[f]?.report?.({
|
|
160
|
+
kind: "attribute-fight",
|
|
161
|
+
tag: this.localName,
|
|
162
|
+
subject: e,
|
|
163
|
+
message: `<${this.localName}> ${e}: something keeps removing this attribute, which the component manages; after ${u} restorations within ${d} ms it is no longer put back. Find the script that removes it (a MutationObserver, a sanitiser) and leave the attribute alone.`,
|
|
164
|
+
element: this
|
|
165
|
+
}), !1));
|
|
166
|
+
}
|
|
167
|
+
attributeChangedCallback(e, t, n) {
|
|
168
|
+
if ((e === "aria-label" || e === "aria-labelledby") && this.constructor.labelTarget) {
|
|
169
|
+
n !== null && this.#u(e, n);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (super.attributeChangedCallback(e, t, n), n !== null || t === null || this.#r) return;
|
|
173
|
+
let r = s(this).get(e);
|
|
174
|
+
if (!r) return;
|
|
175
|
+
let i = this;
|
|
176
|
+
if (!r.custom && r.value !== void 0 && i[r.prop] !== r.value) {
|
|
177
|
+
i[r.prop] = r.value;
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
let { options: a } = r, c = i[r.prop], l = typeof a.converter == "object" ? a.converter : void 0;
|
|
181
|
+
(l?.toAttribute ? l.toAttribute(c, a.type) : a.type === Boolean ? c ? "" : null : c ?? null) != null && this.requestUpdate(r.prop, o);
|
|
182
|
+
}
|
|
183
|
+
insertBefore(e, t) {
|
|
184
|
+
let r = this[n];
|
|
185
|
+
return r && t && t.parentNode !== this && (r.isProjected(t) || r.isWrapEnd(t)) ? r.insertBefore(e, t) : r && !t && r.append(e) ? e : super.insertBefore(e, t);
|
|
186
|
+
}
|
|
187
|
+
removeChild(e) {
|
|
188
|
+
let t = this[n];
|
|
189
|
+
return t && e.parentNode !== this && t.isProjected(e) ? e.parentNode.removeChild(e) : super.removeChild(e);
|
|
190
|
+
}
|
|
191
|
+
replaceChild(e, t) {
|
|
192
|
+
let r = this[n];
|
|
193
|
+
return r && t.parentNode !== this && r.isProjected(t) ? (r.insertBefore(e, t), t.parentNode.removeChild(t)) : super.replaceChild(e, t);
|
|
194
|
+
}
|
|
195
|
+
get textContent() {
|
|
196
|
+
return super.textContent ?? "";
|
|
197
|
+
}
|
|
198
|
+
set textContent(e) {
|
|
199
|
+
let t = this[n], r = e == null ? "" : String(e), i = r ? [this.ownerDocument.createTextNode(r)] : [];
|
|
200
|
+
(!t || !t.replaceContent(i)) && (super.textContent = e);
|
|
201
|
+
}
|
|
202
|
+
replaceChildren(...e) {
|
|
203
|
+
let t = this[n];
|
|
204
|
+
if (t) {
|
|
205
|
+
let n = [];
|
|
206
|
+
for (let t of e) typeof t == "string" ? n.push(this.ownerDocument.createTextNode(t)) : t.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? n.push(...Array.from(t.childNodes)) : n.push(t);
|
|
207
|
+
for (let e of n) if (e.nodeType === Node.DOCUMENT_NODE || e.nodeType === Node.DOCUMENT_TYPE_NODE || e.contains(this)) throw new DOMException(`Failed to execute 'replaceChildren' on '${this.localName}': the new child cannot be inserted here.`, "HierarchyRequestError");
|
|
208
|
+
if (t.replaceContent(n)) return;
|
|
209
|
+
}
|
|
210
|
+
super.replaceChildren(...e);
|
|
211
|
+
}
|
|
212
|
+
voidBeforeMorph(e) {
|
|
213
|
+
if (e && e !== this) {
|
|
214
|
+
e instanceof i && e[n]?.unproject();
|
|
215
|
+
let t = !!r.current?.strip(e) || (this[p] ?? []).some((t) => t.isCopy?.(e)), a = this.#l;
|
|
216
|
+
if (a) {
|
|
217
|
+
for (let t of ["aria-label", "aria-labelledby"]) a[t] !== null && !e.hasAttribute(t) && (a[t] = null);
|
|
218
|
+
this.#d();
|
|
219
|
+
}
|
|
220
|
+
if (m.get(e) !== this) {
|
|
221
|
+
m.set(e, this);
|
|
222
|
+
for (let t of this[p] ?? []) t.voidBeforeMorph(e);
|
|
223
|
+
this.#_(e, t);
|
|
224
|
+
}
|
|
225
|
+
this.#y(e);
|
|
226
|
+
}
|
|
227
|
+
this.isConnected || r.current?.strip(this);
|
|
228
|
+
let t = this[n];
|
|
229
|
+
return t ? t.parked || t.unproject() : !1;
|
|
230
|
+
}
|
|
231
|
+
voidUnchanged(e) {
|
|
232
|
+
let t = e.outerHTML;
|
|
233
|
+
return t === this.#o && !this.__voidProjection?.parked ? !0 : (this.#o = t, !1);
|
|
234
|
+
}
|
|
235
|
+
voidAfterMorph() {
|
|
236
|
+
return this.__voidProjection?.reproject() ?? this.updateComplete;
|
|
237
|
+
}
|
|
238
|
+
#_(e, t = !1) {
|
|
239
|
+
let n = l(this), r = this.#a ?? null, a = e instanceof i && e.#a !== void 0 ? e.#a : t ? r : this.#f(e), o = null;
|
|
240
|
+
if (r) for (let [e, t] of r) a?.get(e) !== t && (o ??= /* @__PURE__ */ new Set()).add(e);
|
|
241
|
+
if (a) for (let [e, t] of a) r?.get(e) !== t && (o ??= /* @__PURE__ */ new Set()).add(e);
|
|
242
|
+
if (o && (this.#a = a), o && n.edits.length && this.#v()) {
|
|
243
|
+
for (let t of n.edits) {
|
|
244
|
+
if (!o.delete(t)) continue;
|
|
245
|
+
let n = this.getAttribute(t);
|
|
246
|
+
n === null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
247
|
+
}
|
|
248
|
+
o.size || (o = null);
|
|
249
|
+
}
|
|
250
|
+
let s = this.attributes;
|
|
251
|
+
for (let t = 0; t < s.length; t++) {
|
|
252
|
+
let r = s[t];
|
|
253
|
+
n.attrs.get(r.name) !== !0 || o?.has(r.name) || e.getAttribute(r.name) !== r.value && e.setAttribute(r.name, r.value);
|
|
254
|
+
}
|
|
255
|
+
if (e instanceof i) {
|
|
256
|
+
let t = e.attributes;
|
|
257
|
+
for (let r = t.length - 1; r >= 0; r--) {
|
|
258
|
+
let i = t[r].name;
|
|
259
|
+
n.attrs.get(i) === !0 && !a?.has(i) && !this.hasAttribute(i) && e.removeAttribute(i);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (a) for (let t of a.keys()) n.attrs.get(t) === !0 && !o?.has(t) && !this.hasAttribute(t) && e.removeAttribute(t);
|
|
263
|
+
if (o && n.drafts.length) {
|
|
264
|
+
let e = this;
|
|
265
|
+
for (let [t, r] of n.drafts) r !== null && o.has(r) && e[t] != null && (e[t] = null, this.requestUpdate());
|
|
266
|
+
}
|
|
267
|
+
if (o) for (let e of o) (this.#c ??= /* @__PURE__ */ new Set()).add(e);
|
|
268
|
+
(n.hook || this.#c) && !this.#s && (this.#s = !0, queueMicrotask(() => {
|
|
269
|
+
this.updateComplete.then(() => {
|
|
270
|
+
this.#s = !1;
|
|
271
|
+
let e = this.#c;
|
|
272
|
+
this.#c = null, this.isConnected && (e && this.serverChangedCallback(e), n.hook && this.morphedCallback());
|
|
273
|
+
});
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
#v() {
|
|
277
|
+
let e = this.ownerDocument.activeElement;
|
|
278
|
+
return !!e && e !== this && this.contains(e) || !!r.current?.isFocusParked(this);
|
|
279
|
+
}
|
|
280
|
+
serverChangedCallback(e) {}
|
|
281
|
+
morphedCallback() {}
|
|
282
|
+
#y(e) {
|
|
283
|
+
if (this.#e) {
|
|
284
|
+
let t = e instanceof i ? e.#e : null;
|
|
285
|
+
for (let [n, r] of this.#e) {
|
|
286
|
+
if (r === null) continue;
|
|
287
|
+
let i = e.getAttribute(n);
|
|
288
|
+
(i === null || t?.has(n) && t.get(n) === i) && i !== r && e.setAttribute(n, r);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (this.#t?.size && "style" in e) {
|
|
292
|
+
let t = e.style;
|
|
293
|
+
for (let [e, n] of this.#t) t.getPropertyValue(e) || t.setProperty(e, n);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
//#endregion
|
|
298
|
+
export { n, r, h as t };
|
|
@@ -38,9 +38,25 @@ var r = class {
|
|
|
38
38
|
reset() {
|
|
39
39
|
clearTimeout(this.#t), this.#e = "";
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
};
|
|
42
|
+
function i(e) {
|
|
43
|
+
try {
|
|
44
|
+
if (e.matches(":dir(rtl)")) return !0;
|
|
45
|
+
} catch {}
|
|
46
|
+
return getComputedStyle(e).direction === "rtl";
|
|
47
|
+
}
|
|
42
48
|
function a(e) {
|
|
43
|
-
return
|
|
49
|
+
return i(e) ? {
|
|
50
|
+
next: "ArrowLeft",
|
|
51
|
+
prev: "ArrowRight"
|
|
52
|
+
} : {
|
|
53
|
+
next: "ArrowRight",
|
|
54
|
+
prev: "ArrowLeft"
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
var o = 0;
|
|
58
|
+
function s(e) {
|
|
59
|
+
return `${e}-${++o}`;
|
|
44
60
|
}
|
|
45
61
|
//#endregion
|
|
46
|
-
export { a,
|
|
62
|
+
export { e as a, n as i, t as n, s as o, a as r, r as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./base-
|
|
1
|
+
import { t as e } from "./base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "./decorate-CaYbmmmm.js";
|
|
3
|
-
import { n, r } from "./parts-
|
|
4
|
-
import { t as i } from "./overlay-
|
|
3
|
+
import { n, r } from "./parts-DI_3VpSy.js";
|
|
4
|
+
import { t as i } from "./overlay-hLJ7IQHx.js";
|
|
5
5
|
import { property as a } from "lit/decorators.js";
|
|
6
6
|
//#region src/modal.ts
|
|
7
7
|
var o = class extends e {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as e } from "./base-BxmMM3B7.js";
|
|
2
2
|
//#region src/overlay.ts
|
|
3
3
|
var t = new Set([
|
|
4
4
|
"escape",
|
|
@@ -318,7 +318,7 @@ var S = class {
|
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
320
|
if (l(t)) try {
|
|
321
|
-
c(t, ":popover-open") || (t.showPopover(), this._watchFade(t), e(t.ownerDocument));
|
|
321
|
+
c(t, ":popover-open") || (t.showPopover(), this._watchFade(t), e.current?.restoreParkedFocus(t.ownerDocument));
|
|
322
322
|
} catch {}
|
|
323
323
|
else t.hidden = !1;
|
|
324
324
|
}
|
|
@@ -5,7 +5,7 @@ function n(e) {
|
|
|
5
5
|
}
|
|
6
6
|
var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
|
|
7
7
|
constructor(t, n) {
|
|
8
|
-
this._observer = null, this._queued = !1, this._attrs = /* @__PURE__ */ new Map(), this._styles = /* @__PURE__ */ new Map(), this._names = /* @__PURE__ */ new Set(), this._syncing = !1, this._pass = 0, this._onMutations = (e) => {
|
|
8
|
+
this._observer = null, this._queued = !1, this._attrs = /* @__PURE__ */ new Map(), this._styles = /* @__PURE__ */ new Map(), this._names = /* @__PURE__ */ new Set(), this._syncing = !1, this._observing = !1, this._namesDirty = !1, this._pass = 0, this._onMutations = (e) => {
|
|
9
9
|
for (let t of e) {
|
|
10
10
|
if (t.type === "attributes") {
|
|
11
11
|
if (this._lostOwned(t.target, t.attributeName)) return this.requestSync();
|
|
@@ -13,6 +13,8 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
|
|
|
13
13
|
}
|
|
14
14
|
let e = t.target;
|
|
15
15
|
if (e.localName?.endsWith("-trigger") && this._tags.has(e.localName)) return this.requestSync();
|
|
16
|
+
let n = e.localName === "void-button" ? e.parentElement : null;
|
|
17
|
+
if (n && n.localName.endsWith("-trigger") && this._tags.has(n.localName)) return this.requestSync();
|
|
16
18
|
for (let e of [t.addedNodes, t.removedNodes]) for (let t = 0; t < e.length; t++) {
|
|
17
19
|
let n = e[t];
|
|
18
20
|
if (n.nodeType !== 1) continue;
|
|
@@ -48,7 +50,7 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
|
|
|
48
50
|
r || this._attrs.set(e, r = /* @__PURE__ */ new Map()), r.set(t, {
|
|
49
51
|
...n,
|
|
50
52
|
pass: this._syncing ? this._pass : r.get(t)?.pass ?? 0
|
|
51
|
-
}), this._names.has(t) || (this._names.add(t), this.
|
|
53
|
+
}), this._names.has(t) || (this._names.add(t), this._observing && (this._syncing ? this._namesDirty = !0 : this._observe()));
|
|
52
54
|
}
|
|
53
55
|
set(e, t, n) {
|
|
54
56
|
let r = n === !0 ? "" : n === !1 || n == null ? null : String(n);
|
|
@@ -111,10 +113,10 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
hostConnected() {
|
|
114
|
-
this._observer ??= new MutationObserver(this._onMutations), this.
|
|
116
|
+
this._observer ??= new MutationObserver(this._onMutations), this.sync(), this._observing || this._observe();
|
|
115
117
|
}
|
|
116
118
|
hostDisconnected() {
|
|
117
|
-
this._observer?.disconnect();
|
|
119
|
+
this._observer?.disconnect(), this._observing = !1;
|
|
118
120
|
}
|
|
119
121
|
sync() {
|
|
120
122
|
if (this._syncing) return;
|
|
@@ -127,25 +129,29 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
|
|
|
127
129
|
} finally {
|
|
128
130
|
this._syncing = !1;
|
|
129
131
|
}
|
|
130
|
-
this._observer?.takeRecords();
|
|
132
|
+
this._namesDirty && (this._namesDirty = !1, this._observe(!0)), this._observer?.takeRecords();
|
|
131
133
|
}
|
|
132
134
|
requestSync() {
|
|
133
135
|
this._queued || (this._queued = !0, queueMicrotask(() => {
|
|
134
136
|
this._queued = !1, this.host.isConnected && this.sync();
|
|
135
137
|
}));
|
|
136
138
|
}
|
|
137
|
-
_observe() {
|
|
138
|
-
let
|
|
139
|
-
if (!
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
_observe(e = !1) {
|
|
140
|
+
let t = this._observer;
|
|
141
|
+
if (!(!t || !this.host.isConnected)) {
|
|
142
|
+
if (this._observing) {
|
|
143
|
+
let n = t.takeRecords();
|
|
144
|
+
t.disconnect(), n.length && !e && !this._syncing && queueMicrotask(() => this._onMutations(n));
|
|
145
|
+
}
|
|
146
|
+
this._observing = !0, t.observe(this.host, {
|
|
147
|
+
childList: !0,
|
|
148
|
+
subtree: !0,
|
|
149
|
+
...this._names.size ? {
|
|
150
|
+
attributes: !0,
|
|
151
|
+
attributeFilter: [...this._names].filter((e) => !e.includes(" ")).concat(this._tokenNames())
|
|
152
|
+
} : {}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
149
155
|
}
|
|
150
156
|
_tokenNames() {
|
|
151
157
|
let e = /* @__PURE__ */ new Set();
|
|
@@ -219,7 +225,8 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
|
|
|
219
225
|
}
|
|
220
226
|
};
|
|
221
227
|
function a(e) {
|
|
222
|
-
|
|
228
|
+
let t = e?.firstElementChild ?? null;
|
|
229
|
+
return t?.localName === "void-button" ? t.querySelector(":scope > a[href], :scope > button") ?? t : t;
|
|
223
230
|
}
|
|
224
231
|
function o(e, t) {
|
|
225
232
|
let n = e.shadowRoot ?? e.attachShadow({ mode: "open" });
|