@pontive/pontkit-core 1.25.0 → 1.27.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 +4 -0
- package/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -8
- package/dist/index.mjs.map +1 -1
- package/dist/pont2/core/attrs.d.ts +22 -0
- package/dist/pont2/core/controllers/roving-focus.d.ts +38 -0
- package/dist/pont2/core/events.d.ts +28 -0
- package/dist/pont2/core/form-control.d.ts +70 -0
- package/dist/pont2/core/host-element.d.ts +129 -0
- package/dist/pont2/core/icons.d.ts +20 -0
- package/dist/pont2/core/ids.d.ts +6 -0
- package/dist/pont2/core/index.d.ts +8 -0
- package/dist/pont2/core/names.d.ts +78 -0
- package/dist/pont2/core/popup/anchored.d.ts +48 -0
- package/dist/pont2/core/popup/index.d.ts +5 -0
- package/dist/pont2/core/popup/list.d.ts +38 -0
- package/dist/pont2/core/popup/popup-content.d.ts +68 -0
- package/dist/pont2/core/popup/popup-root.d.ts +94 -0
- package/dist/pont2/core/popup/position.d.ts +73 -0
- package/dist/pont2/globals.css +109 -0
- package/dist/pont2/index.d.ts +44 -0
- package/dist/pont2/index.mjs +3805 -0
- package/dist/pont2/index.mjs.map +1 -0
- package/dist/pont2/kit/alert/alert.d.ts +62 -0
- package/dist/pont2/kit/aliases.d.ts +33 -0
- package/dist/pont2/kit/avatar/avatar.d.ts +52 -0
- package/dist/pont2/kit/index.d.ts +3 -0
- package/dist/pont2/kit/input-otp/input-otp.d.ts +52 -0
- package/dist/pont2/primitives/alert/alert.d.ts +49 -0
- package/dist/pont2/primitives/avatar/avatar.d.ts +89 -0
- package/dist/pont2/primitives/badge/badge.d.ts +30 -0
- package/dist/pont2/primitives/button/button.d.ts +113 -0
- package/dist/pont2/primitives/button-group/button-group.d.ts +55 -0
- package/dist/pont2/primitives/card/card.d.ts +63 -0
- package/dist/pont2/primitives/checkbox/checkbox.d.ts +54 -0
- package/dist/pont2/primitives/combobox/combobox.d.ts +213 -0
- package/dist/pont2/primitives/dropdown-menu/dropdown-menu.d.ts +267 -0
- package/dist/pont2/primitives/empty/empty.d.ts +60 -0
- package/dist/pont2/primitives/field/field.d.ts +146 -0
- package/dist/pont2/primitives/input/input.d.ts +47 -0
- package/dist/pont2/primitives/input-group/input-group.d.ts +97 -0
- package/dist/pont2/primitives/input-otp/input-otp.d.ts +121 -0
- package/dist/pont2/primitives/input-otp/otp.d.ts +22 -0
- package/dist/pont2/primitives/item/item.d.ts +100 -0
- package/dist/pont2/primitives/kbd/kbd.d.ts +29 -0
- package/dist/pont2/primitives/label/label.d.ts +37 -0
- package/dist/pont2/primitives/native-select/native-select.d.ts +59 -0
- package/dist/pont2/primitives/popover/popover.d.ts +85 -0
- package/dist/pont2/primitives/progress/progress.d.ts +80 -0
- package/dist/pont2/primitives/radio-group/radio-group.d.ts +93 -0
- package/dist/pont2/primitives/select/select.d.ts +184 -0
- package/dist/pont2/primitives/separator/separator.d.ts +34 -0
- package/dist/pont2/primitives/skeleton/skeleton.d.ts +18 -0
- package/dist/pont2/primitives/slider/slider-math.d.ts +42 -0
- package/dist/pont2/primitives/slider/slider.d.ts +85 -0
- package/dist/pont2/primitives/spinner/spinner.d.ts +29 -0
- package/dist/pont2/primitives/switch/switch.d.ts +55 -0
- package/dist/pont2/primitives/table/table.d.ts +55 -0
- package/dist/pont2/primitives/tabs/tabs.d.ts +126 -0
- package/dist/pont2/primitives/textarea/textarea.d.ts +41 -0
- package/dist/pont2/primitives/tooltip/tooltip.d.ts +69 -0
- package/dist/pont2/styles.css +4137 -0
- package/dist/pont2/with-legacy.css +10 -0
- package/dist/styles.css +6 -0
- package/package.json +16 -4
|
@@ -0,0 +1,3805 @@
|
|
|
1
|
+
import { noChange as Ya, LitElement as ar, ReactiveElement as Er, svg as k, html as m, nothing as d } from "lit";
|
|
2
|
+
import { directive as Or, Directive as Sr, PartType as Nr } from "lit/directive.js";
|
|
3
|
+
import { live as Oa } from "lit/directives/live.js";
|
|
4
|
+
import { styleMap as Wi } from "lit/directives/style-map.js";
|
|
5
|
+
import { repeat as qr } from "lit/directives/repeat.js";
|
|
6
|
+
class Lr extends Sr {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
if (super(t), this.prev = /* @__PURE__ */ new Set(), t.type !== Nr.ELEMENT) throw new Error("attrs() must be used in element position");
|
|
9
|
+
}
|
|
10
|
+
render(t) {
|
|
11
|
+
return Ya;
|
|
12
|
+
}
|
|
13
|
+
update(t, [e]) {
|
|
14
|
+
return Cr(t.element, e, this.prev), this.prev = new Set(Object.keys(e)), Ya;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const L = Or(Lr);
|
|
18
|
+
function Cr(s, t, e) {
|
|
19
|
+
if (e)
|
|
20
|
+
for (const i of e) i in t || s.removeAttribute(i);
|
|
21
|
+
for (const [i, a] of Object.entries(t))
|
|
22
|
+
if (a === !1 || a == null)
|
|
23
|
+
s.hasAttribute(i) && s.removeAttribute(i);
|
|
24
|
+
else {
|
|
25
|
+
const r = a === !0 ? "" : String(a);
|
|
26
|
+
s.getAttribute(i) !== r && s.setAttribute(i, r);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const Mt = "pont2", Ur = "prim", rr = (s) => `${Mt}-${s}`, nr = (s) => `${Mt}-${Ur}-${s}`, or = (s) => `data-${Mt}-${s}`, f = (s) => `:is(${nr(s)}, ${rr(s)}, [${or(s)}])`, Xt = (s) => `:is(${nr(s)}, ${rr(s)})`;
|
|
30
|
+
function n(s, t) {
|
|
31
|
+
customElements.get(s) || customElements.define(s, t);
|
|
32
|
+
}
|
|
33
|
+
const Qa = /* @__PURE__ */ new Map();
|
|
34
|
+
function A(s, t) {
|
|
35
|
+
let e = Qa.get(t);
|
|
36
|
+
return e || (e = class extends t {
|
|
37
|
+
}, Object.defineProperty(e, "name", { value: `${t.name}Alias` }), Qa.set(t, e)), n(s, e), customElements.get(s);
|
|
38
|
+
}
|
|
39
|
+
const Ee = class Ee extends ar {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments), this.internals = this.attachInternals();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A **part**: this element's identity, `data-slot` and default role as plain
|
|
45
|
+
* attributes, for a template to put on a native element.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* html`<div ${AlertTitle.part()}>${this.heading}</div>`
|
|
49
|
+
* // → <div data-pont2-alert-title data-slot="alert-title">…</div>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* The result is styled by the element's recipe and found by `sel()` lookups,
|
|
53
|
+
* exactly like the element itself, so a composite reproduces shadcn's DOM
|
|
54
|
+
* without nesting custom elements. A part carries **attributes only**: use
|
|
55
|
+
* it for Tier 1 elements whose host adds nothing but identity, slot and role.
|
|
56
|
+
* An element with behaviour (state, observers, keyboard, form association)
|
|
57
|
+
* has to be rendered as the element. `extra` adds or overrides attributes.
|
|
58
|
+
*/
|
|
59
|
+
static part(t = {}) {
|
|
60
|
+
const e = {};
|
|
61
|
+
for (const i of Za(this)) e[or(i)] = !0;
|
|
62
|
+
return this.slotName && (e["data-slot"] = this.slotName), this.role && (e.role = this.role), L({ ...e, ...t });
|
|
63
|
+
}
|
|
64
|
+
createRenderRoot() {
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Elements that do not override `render()` (most Tier 1 hosts) skip Lit's
|
|
69
|
+
* template rendering entirely. Otherwise lit-html would append a `<!---->`
|
|
70
|
+
* part marker to the author's children: a stray node in a component whose
|
|
71
|
+
* whole point is to add none, and one more node for React to step around.
|
|
72
|
+
*/
|
|
73
|
+
update(t) {
|
|
74
|
+
if (this.render === Ee.prototype.render) {
|
|
75
|
+
Er.prototype.update.call(this, t);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
super.update(t);
|
|
79
|
+
}
|
|
80
|
+
connectedCallback() {
|
|
81
|
+
const t = this.constructor;
|
|
82
|
+
t.composite && this.hasUpdated, super.connectedCallback();
|
|
83
|
+
for (const e of Za(t))
|
|
84
|
+
this.hasAttribute(`data-${Mt}-${e}`) || this.setAttribute(`data-${Mt}-${e}`, "");
|
|
85
|
+
t.slotName && !this.hasAttribute("data-slot") && this.setAttribute("data-slot", t.slotName), t.role && !this.internals.role && (this.internals.role = t.role);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Sets `data-<name>`: a string value, `true` → empty (presence) attribute,
|
|
89
|
+
* `false`/`null`/`undefined` → removed. Base UI exposes state as presence
|
|
90
|
+
* attributes (`data-checked`, `data-disabled`, `data-open`), which is what
|
|
91
|
+
* shadcn's Base UI styles select on, so `true`/`false` is the common call.
|
|
92
|
+
*/
|
|
93
|
+
setData(t, e) {
|
|
94
|
+
const i = `data-${t}`;
|
|
95
|
+
if (e === !1 || e == null)
|
|
96
|
+
this.hasAttribute(i) && this.removeAttribute(i);
|
|
97
|
+
else {
|
|
98
|
+
const a = e === !0 ? "" : e;
|
|
99
|
+
this.getAttribute(i) !== a && this.setAttribute(i, a);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Adds or removes a custom state, matchable in CSS as `:state(<name>)`. */
|
|
103
|
+
setState(t, e) {
|
|
104
|
+
try {
|
|
105
|
+
e ? this.internals.states.add(t) : this.internals.states.delete(t);
|
|
106
|
+
} catch {
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
Ee.composite = !1;
|
|
111
|
+
let c = Ee;
|
|
112
|
+
function Za(s) {
|
|
113
|
+
const t = [];
|
|
114
|
+
let e = s;
|
|
115
|
+
for (; typeof e == "function" && e !== c && e !== ar; ) {
|
|
116
|
+
const i = e;
|
|
117
|
+
Object.hasOwn(i, "identity") && i.identity && t.push(i.identity), e = Object.getPrototypeOf(e);
|
|
118
|
+
}
|
|
119
|
+
return t;
|
|
120
|
+
}
|
|
121
|
+
const Na = class Na extends c {
|
|
122
|
+
focus(t) {
|
|
123
|
+
var e;
|
|
124
|
+
(e = this.control) == null || e.focus(t);
|
|
125
|
+
}
|
|
126
|
+
blur() {
|
|
127
|
+
var t;
|
|
128
|
+
(t = this.control) == null || t.blur();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
Na.identity = "shell";
|
|
132
|
+
let Yt = Na;
|
|
133
|
+
const qa = class qa extends Yt {
|
|
134
|
+
constructor() {
|
|
135
|
+
super(...arguments), this._warned = !1;
|
|
136
|
+
}
|
|
137
|
+
get control() {
|
|
138
|
+
const t = this.constructor.nativeSelector;
|
|
139
|
+
for (const e of Array.from(this.children))
|
|
140
|
+
if (e.matches(t)) return e;
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
connectedCallback() {
|
|
144
|
+
super.connectedCallback(), this._observer ?? (this._observer = new MutationObserver(() => this.requestUpdate())), this._observer.observe(this, { childList: !0 });
|
|
145
|
+
}
|
|
146
|
+
disconnectedCallback() {
|
|
147
|
+
var t;
|
|
148
|
+
super.disconnectedCallback(), (t = this._observer) == null || t.disconnect();
|
|
149
|
+
}
|
|
150
|
+
updated() {
|
|
151
|
+
const t = this.control;
|
|
152
|
+
if (t) {
|
|
153
|
+
this.apply(t);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (!this._warned && this.isConnected && this.childNodes.length) {
|
|
157
|
+
this._warned = !0;
|
|
158
|
+
const e = this.constructor.nativeSelector;
|
|
159
|
+
console.warn(
|
|
160
|
+
`<${this.localName}> enhances a native child element (${e}) and found none. Write <${this.localName}><${e.split(",")[0].trim()}>…</…></${this.localName}>, or use the recipe attributes on the native element directly.`,
|
|
161
|
+
this
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
qa.nativeSelector = "*";
|
|
167
|
+
let S = qa;
|
|
168
|
+
const Oe = class Oe extends c {
|
|
169
|
+
constructor() {
|
|
170
|
+
super(), this._customMessage = "", this.name = "", this.disabled = !1, this.required = !1, this.readOnly = !1, this.formDisabled = !1;
|
|
171
|
+
}
|
|
172
|
+
/** Built-in constraint check. Return `null` when valid. */
|
|
173
|
+
validate() {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
/** Whether the host itself is a tab stop. Composite widgets with an inner roving tab stop return false. */
|
|
177
|
+
get hostFocusable() {
|
|
178
|
+
return !0;
|
|
179
|
+
}
|
|
180
|
+
/** Element `reportValidity()` should point at (must be inside the host). */
|
|
181
|
+
get validationAnchor() {
|
|
182
|
+
}
|
|
183
|
+
/* -------------------------------------------------------------- */
|
|
184
|
+
/* Public form API (mirrors native controls) */
|
|
185
|
+
/* -------------------------------------------------------------- */
|
|
186
|
+
get form() {
|
|
187
|
+
return this.internals.form;
|
|
188
|
+
}
|
|
189
|
+
get labels() {
|
|
190
|
+
return this.internals.labels;
|
|
191
|
+
}
|
|
192
|
+
get validity() {
|
|
193
|
+
return this.internals.validity;
|
|
194
|
+
}
|
|
195
|
+
get validationMessage() {
|
|
196
|
+
return this.internals.validationMessage;
|
|
197
|
+
}
|
|
198
|
+
get willValidate() {
|
|
199
|
+
return this.internals.willValidate;
|
|
200
|
+
}
|
|
201
|
+
/** `disabled` or disabled by a fieldset/form. */
|
|
202
|
+
get isDisabled() {
|
|
203
|
+
return this.disabled || this.formDisabled;
|
|
204
|
+
}
|
|
205
|
+
checkValidity() {
|
|
206
|
+
return this.internals.checkValidity();
|
|
207
|
+
}
|
|
208
|
+
reportValidity() {
|
|
209
|
+
return this.internals.reportValidity();
|
|
210
|
+
}
|
|
211
|
+
setCustomValidity(t) {
|
|
212
|
+
this._customMessage = t, this.syncValidity();
|
|
213
|
+
}
|
|
214
|
+
/* -------------------------------------------------------------- */
|
|
215
|
+
/* FACE lifecycle */
|
|
216
|
+
/* -------------------------------------------------------------- */
|
|
217
|
+
formResetCallback() {
|
|
218
|
+
this.resetToDefault();
|
|
219
|
+
}
|
|
220
|
+
formDisabledCallback(t) {
|
|
221
|
+
this.formDisabled = t;
|
|
222
|
+
}
|
|
223
|
+
formStateRestoreCallback(t) {
|
|
224
|
+
this.restoreState(t);
|
|
225
|
+
}
|
|
226
|
+
/** Override to restore from the value `formValue()` produced. */
|
|
227
|
+
restoreState(t) {
|
|
228
|
+
}
|
|
229
|
+
/* -------------------------------------------------------------- */
|
|
230
|
+
/* Sync */
|
|
231
|
+
/* -------------------------------------------------------------- */
|
|
232
|
+
updated(t) {
|
|
233
|
+
super.updated(t);
|
|
234
|
+
const e = this.isDisabled;
|
|
235
|
+
this.internals.ariaDisabled = e ? "true" : null, this.internals.ariaRequired = this.required ? "true" : null, this.internals.ariaReadOnly = this.readOnly ? "true" : null, this.setData("disabled", e), this.setData("required", this.required), this.setData("readonly", this.readOnly), this.hostFocusable && (e ? this.removeAttribute("tabindex") : this.hasAttribute("tabindex") || (this.tabIndex = 0)), this.internals.setFormValue(this.formValue()), this.syncValidity();
|
|
236
|
+
}
|
|
237
|
+
syncValidity() {
|
|
238
|
+
const t = this.validate();
|
|
239
|
+
this._customMessage ? this.internals.setValidity({ customError: !0 }, this._customMessage, this.validationAnchor) : t ? this.internals.setValidity(t.flags, t.message, this.validationAnchor) : this.internals.setValidity({});
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
Oe.formAssociated = !0, Oe.properties = {
|
|
243
|
+
name: { type: String, reflect: !0 },
|
|
244
|
+
disabled: { type: Boolean, reflect: !0 },
|
|
245
|
+
required: { type: Boolean, reflect: !0 },
|
|
246
|
+
readOnly: { type: Boolean, reflect: !0, attribute: "readonly" },
|
|
247
|
+
formDisabled: { state: !0 }
|
|
248
|
+
};
|
|
249
|
+
let W = Oe, Ja = 0;
|
|
250
|
+
function lr(s = "id") {
|
|
251
|
+
return Ja += 1, `pont2-${s}-${Ja}`;
|
|
252
|
+
}
|
|
253
|
+
function $(s, t = "id") {
|
|
254
|
+
return s.id || (s.id = lr(t)), s.id;
|
|
255
|
+
}
|
|
256
|
+
function yn(s, t, e, i) {
|
|
257
|
+
const a = new Set((s.getAttribute(t) ?? "").split(/\s+/).filter(Boolean));
|
|
258
|
+
i ? a.add(e) : a.delete(e), a.size ? s.setAttribute(t, [...a].join(" ")) : s.removeAttribute(t);
|
|
259
|
+
}
|
|
260
|
+
function v(s, t) {
|
|
261
|
+
s.dispatchEvent(new Event(t, { bubbles: !0, composed: t === "input" }));
|
|
262
|
+
}
|
|
263
|
+
function cr(s, t, e, i = !1) {
|
|
264
|
+
return s.dispatchEvent(new CustomEvent(t, { detail: e, bubbles: !0, composed: !0, cancelable: i }));
|
|
265
|
+
}
|
|
266
|
+
const x = (s, t) => m`<svg
|
|
267
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
268
|
+
width="24"
|
|
269
|
+
height="24"
|
|
270
|
+
viewBox="0 0 24 24"
|
|
271
|
+
fill="none"
|
|
272
|
+
stroke="currentColor"
|
|
273
|
+
stroke-width="2"
|
|
274
|
+
stroke-linecap="round"
|
|
275
|
+
stroke-linejoin="round"
|
|
276
|
+
aria-hidden="true"
|
|
277
|
+
data-icon-name=${s}
|
|
278
|
+
>${t}</svg>`, w = {
|
|
279
|
+
check: () => x("check", k`<path d="M20 6 9 17l-5-5" />`),
|
|
280
|
+
minus: () => x("minus", k`<path d="M5 12h14" />`),
|
|
281
|
+
x: () => x("x", k`<path d="M18 6 6 18" /><path d="m6 6 12 12" />`),
|
|
282
|
+
chevronDown: () => x("chevron-down", k`<path d="m6 9 6 6 6-6" />`),
|
|
283
|
+
chevronUp: () => x("chevron-up", k`<path d="m18 15-6-6-6 6" />`),
|
|
284
|
+
chevronRight: () => x("chevron-right", k`<path d="m9 18 6-6-6-6" />`),
|
|
285
|
+
chevronLeft: () => x("chevron-left", k`<path d="m15 18-6-6 6-6" />`),
|
|
286
|
+
chevronsUpDown: () => x("chevrons-up-down", k`<path d="m7 15 5 5 5-5" /><path d="m7 9 5-5 5 5" />`),
|
|
287
|
+
search: () => x("search", k`<path d="m21 21-4.34-4.34" /><circle cx="11" cy="11" r="8" />`),
|
|
288
|
+
circle: () => x("circle", k`<circle cx="12" cy="12" r="10" />`),
|
|
289
|
+
loaderCircle: () => x("loader-circle", k`<path d="M21 12a9 9 0 1 1-6.219-8.56" />`),
|
|
290
|
+
circleAlert: () => x(
|
|
291
|
+
"circle-alert",
|
|
292
|
+
k`<circle cx="12" cy="12" r="10" /><line x1="12" x2="12" y1="8" y2="12" /><line x1="12" x2="12.01" y1="16" y2="16" />`
|
|
293
|
+
),
|
|
294
|
+
circleX: () => x("circle-x", k`<circle cx="12" cy="12" r="10" /><path d="m15 9-6 6" /><path d="m9 9 6 6" />`),
|
|
295
|
+
circleCheck: () => x("circle-check", k`<circle cx="12" cy="12" r="10" /><path d="m9 12 2 2 4-4" />`),
|
|
296
|
+
triangleAlert: () => x(
|
|
297
|
+
"triangle-alert",
|
|
298
|
+
k`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /><path d="M12 9v4" /><path d="M12 17h.01" />`
|
|
299
|
+
),
|
|
300
|
+
info: () => x("info", k`<circle cx="12" cy="12" r="10" /><path d="M12 16v-4" /><path d="M12 8h.01" />`)
|
|
301
|
+
};
|
|
302
|
+
function dt(s) {
|
|
303
|
+
const t = s.closest("[dir]");
|
|
304
|
+
return ((t == null ? void 0 : t.getAttribute("dir")) ?? document.documentElement.dir ?? "").toLowerCase() === "rtl" ? "rtl" : "ltr";
|
|
305
|
+
}
|
|
306
|
+
const zr = (s) => s.hasAttribute("data-disabled") || s.getAttribute("aria-disabled") === "true" || s.disabled === !0;
|
|
307
|
+
class hr {
|
|
308
|
+
constructor(t, e) {
|
|
309
|
+
this.host = t, this.onFocusIn = (i) => {
|
|
310
|
+
const r = this.opts.items().find((o) => o === i.target || o.contains(i.target));
|
|
311
|
+
r && !this.opts.isDisabled(r) && this.sync(r);
|
|
312
|
+
}, this.onKeyDown = (i) => {
|
|
313
|
+
var b, y;
|
|
314
|
+
if (i.defaultPrevented || i.altKey || i.ctrlKey || i.metaKey) return;
|
|
315
|
+
const a = this.opts.items(), r = a.findIndex((E) => E === i.target || E.contains(i.target));
|
|
316
|
+
if (r < 0) return;
|
|
317
|
+
const o = this.opts.orientation(), h = dt(this.host) === "rtl", l = o !== "vertical", p = o !== "horizontal";
|
|
318
|
+
let u = 0;
|
|
319
|
+
switch (i.key) {
|
|
320
|
+
case "ArrowRight":
|
|
321
|
+
l && (u = h ? -1 : 1);
|
|
322
|
+
break;
|
|
323
|
+
case "ArrowLeft":
|
|
324
|
+
l && (u = h ? 1 : -1);
|
|
325
|
+
break;
|
|
326
|
+
case "ArrowDown":
|
|
327
|
+
p && (u = 1);
|
|
328
|
+
break;
|
|
329
|
+
case "ArrowUp":
|
|
330
|
+
p && (u = -1);
|
|
331
|
+
break;
|
|
332
|
+
case "Home":
|
|
333
|
+
u = "first";
|
|
334
|
+
break;
|
|
335
|
+
case "End":
|
|
336
|
+
u = "last";
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
if (u === 0) return;
|
|
340
|
+
const g = this.findNext(a, r, u);
|
|
341
|
+
g && (i.preventDefault(), this.focus(g), (y = (b = this.opts).onNavigate) == null || y.call(b, g, i));
|
|
342
|
+
}, this.opts = {
|
|
343
|
+
orientation: () => "both",
|
|
344
|
+
loop: () => !0,
|
|
345
|
+
isDisabled: zr,
|
|
346
|
+
...e
|
|
347
|
+
}, t.addController(this);
|
|
348
|
+
}
|
|
349
|
+
hostConnected() {
|
|
350
|
+
this.host.addEventListener("keydown", this.onKeyDown), this.host.addEventListener("focusin", this.onFocusIn);
|
|
351
|
+
}
|
|
352
|
+
hostDisconnected() {
|
|
353
|
+
this.host.removeEventListener("keydown", this.onKeyDown), this.host.removeEventListener("focusin", this.onFocusIn);
|
|
354
|
+
}
|
|
355
|
+
/** Make `active` (or the first enabled item) the single tab stop. */
|
|
356
|
+
sync(t) {
|
|
357
|
+
const e = this.opts.items(), i = e.filter((r) => !this.opts.isDisabled(r)), a = t && i.includes(t) ? t : i[0];
|
|
358
|
+
for (const r of e) r.tabIndex = r === a ? 0 : -1;
|
|
359
|
+
}
|
|
360
|
+
/** Focus an item and make it the tab stop. */
|
|
361
|
+
focus(t, e) {
|
|
362
|
+
this.sync(t), t.focus(e);
|
|
363
|
+
}
|
|
364
|
+
findNext(t, e, i) {
|
|
365
|
+
const a = (h) => !this.opts.isDisabled(h);
|
|
366
|
+
if (i === "first") return t.find(a);
|
|
367
|
+
if (i === "last") return [...t].reverse().find(a);
|
|
368
|
+
const r = t.length, o = this.opts.loop();
|
|
369
|
+
for (let h = 1; h <= r; h++) {
|
|
370
|
+
let l = e + i * h;
|
|
371
|
+
if (o) l = (l + r) % r;
|
|
372
|
+
else if (l < 0 || l >= r) return;
|
|
373
|
+
if (a(t[l])) return t[l];
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const vn = ["default", "secondary", "destructive", "outline", "ghost", "link"], yt = class yt extends c {
|
|
378
|
+
constructor() {
|
|
379
|
+
super(), this.variant = "default";
|
|
380
|
+
}
|
|
381
|
+
willUpdate() {
|
|
382
|
+
this.setData("variant", this.variant || "default");
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
yt.identity = "badge", yt.slotName = "badge", yt.properties = {
|
|
386
|
+
variant: { type: String, reflect: !0 }
|
|
387
|
+
};
|
|
388
|
+
let ee = yt;
|
|
389
|
+
n("pont2-prim-badge", ee);
|
|
390
|
+
const kn = ["default", "outline", "secondary", "ghost", "destructive", "link"], xn = ["default", "xs", "sm", "lg", "icon", "icon-xs", "icon-sm", "icon-lg"];
|
|
391
|
+
function dr(s, t) {
|
|
392
|
+
s.hasAttribute("data-pont2-button") || s.setAttribute("data-pont2-button", ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", "button"), s.setAttribute("data-variant", t.variant ?? "default"), s.setAttribute("data-size", t.size ?? "default");
|
|
393
|
+
const e = !!t.disabled, i = s instanceof HTMLButtonElement;
|
|
394
|
+
s.toggleAttribute("data-disabled", e), i && !t.focusableWhenDisabled ? (s.disabled = e, s.removeAttribute("aria-disabled")) : (i && (s.disabled = !1), e ? s.setAttribute("aria-disabled", "true") : s.removeAttribute("aria-disabled"), i || (e && !t.focusableWhenDisabled ? s.tabIndex = -1 : s.removeAttribute("tabindex")));
|
|
395
|
+
}
|
|
396
|
+
function Vr(s) {
|
|
397
|
+
return s.getAttribute("aria-disabled") === "true" || s.hasAttribute("data-disabled");
|
|
398
|
+
}
|
|
399
|
+
function ur(s, t) {
|
|
400
|
+
const e = s.variant ?? "default", i = s.size ?? "default", a = s.slot ?? "button", r = !!s.disabled, o = r && (s.focusableWhenDisabled || s.href !== void 0), h = (l) => {
|
|
401
|
+
var p;
|
|
402
|
+
if (o) {
|
|
403
|
+
l.preventDefault(), l.stopImmediatePropagation();
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
(p = s.onClick) == null || p.call(s, l);
|
|
407
|
+
};
|
|
408
|
+
return s.href !== void 0 ? m`<a
|
|
409
|
+
data-pont2-button
|
|
410
|
+
data-slot=${a}
|
|
411
|
+
data-variant=${e}
|
|
412
|
+
data-size=${i}
|
|
413
|
+
href=${s.href}
|
|
414
|
+
target=${s.target ?? d}
|
|
415
|
+
rel=${s.rel ?? d}
|
|
416
|
+
?data-disabled=${r}
|
|
417
|
+
aria-disabled=${r ? "true" : d}
|
|
418
|
+
tabindex=${r && !s.focusableWhenDisabled ? "-1" : d}
|
|
419
|
+
${L(s.attrs ?? {})}
|
|
420
|
+
@click=${h}
|
|
421
|
+
>${t}</a
|
|
422
|
+
>` : m`<button
|
|
423
|
+
data-pont2-button
|
|
424
|
+
data-slot=${a}
|
|
425
|
+
data-variant=${e}
|
|
426
|
+
data-size=${i}
|
|
427
|
+
type=${s.type ?? "button"}
|
|
428
|
+
name=${s.name ?? d}
|
|
429
|
+
.value=${s.value ?? ""}
|
|
430
|
+
?disabled=${r && !s.focusableWhenDisabled}
|
|
431
|
+
?data-disabled=${r}
|
|
432
|
+
aria-disabled=${o ? "true" : d}
|
|
433
|
+
${L(s.attrs ?? {})}
|
|
434
|
+
@click=${h}
|
|
435
|
+
>${t}</button>`;
|
|
436
|
+
}
|
|
437
|
+
const pr = {
|
|
438
|
+
variant: { type: String, reflect: !0 },
|
|
439
|
+
size: { type: String, reflect: !0 },
|
|
440
|
+
disabled: { type: Boolean, reflect: !0 },
|
|
441
|
+
focusableWhenDisabled: { type: Boolean, attribute: "focusable-when-disabled" }
|
|
442
|
+
}, Se = class Se extends S {
|
|
443
|
+
constructor() {
|
|
444
|
+
super(), this.guard = (t) => {
|
|
445
|
+
const e = this.control;
|
|
446
|
+
e && this.disabled && (e === t.target || e.contains(t.target)) && Vr(e) && (t.preventDefault(), t.stopImmediatePropagation());
|
|
447
|
+
}, this.variant = "default", this.size = "default", this.disabled = !1, this.focusableWhenDisabled = !1, this.addEventListener("click", this.guard, { capture: !0 });
|
|
448
|
+
}
|
|
449
|
+
apply(t) {
|
|
450
|
+
dr(t, this);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
Se.nativeSelector = "button, a", Se.properties = pr;
|
|
454
|
+
let Qt = Se;
|
|
455
|
+
const La = class La extends Yt {
|
|
456
|
+
constructor() {
|
|
457
|
+
super(), this.variant = "default", this.size = "default", this.disabled = !1, this.focusableWhenDisabled = !1, this.type = "button";
|
|
458
|
+
}
|
|
459
|
+
/** The native element. Focus, tooltips and popovers anchor here, never on the shell. */
|
|
460
|
+
get control() {
|
|
461
|
+
return this.querySelector(":scope > [data-pont2-button]");
|
|
462
|
+
}
|
|
463
|
+
buttonOptions() {
|
|
464
|
+
const { variant: t, size: e, type: i, name: a, value: r, disabled: o, focusableWhenDisabled: h, href: l, target: p, rel: u } = this;
|
|
465
|
+
return { variant: t, size: e, type: i, name: a, value: r, disabled: o, focusableWhenDisabled: h, href: l, target: p, rel: u };
|
|
466
|
+
}
|
|
467
|
+
render() {
|
|
468
|
+
return ur(this.buttonOptions(), this.renderContent());
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
La.properties = {
|
|
472
|
+
...pr,
|
|
473
|
+
type: { type: String },
|
|
474
|
+
name: { type: String },
|
|
475
|
+
value: { type: String },
|
|
476
|
+
href: { type: String },
|
|
477
|
+
target: { type: String },
|
|
478
|
+
rel: { type: String }
|
|
479
|
+
};
|
|
480
|
+
let Ia = La;
|
|
481
|
+
n("pont2-prim-button", Qt);
|
|
482
|
+
const H = class H extends W {
|
|
483
|
+
constructor() {
|
|
484
|
+
super(), this.onClick = (t) => {
|
|
485
|
+
if (this.isDisabled || this.readOnly) {
|
|
486
|
+
t.preventDefault();
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
this.toggle();
|
|
490
|
+
}, this.onKeyDown = (t) => {
|
|
491
|
+
t.key === " " && t.target === this && t.preventDefault();
|
|
492
|
+
}, this.onKeyUp = (t) => {
|
|
493
|
+
t.key === " " && t.target === this && this.click();
|
|
494
|
+
}, this.checked = !1, this.indeterminate = !1, this.value = "on", this.addEventListener("click", this.onClick), this.addEventListener("keydown", this.onKeyDown), this.addEventListener("keyup", this.onKeyUp);
|
|
495
|
+
}
|
|
496
|
+
/** Toggle as if the user clicked (fires input/change). */
|
|
497
|
+
toggle() {
|
|
498
|
+
this.isDisabled || this.readOnly || (this.indeterminate = !1, this.checked = !this.checked, v(this, "input"), v(this, "change"));
|
|
499
|
+
}
|
|
500
|
+
formValue() {
|
|
501
|
+
return this.checked ? this.value : this.uncheckedValue ?? null;
|
|
502
|
+
}
|
|
503
|
+
resetToDefault() {
|
|
504
|
+
this.checked = this.hasAttribute("checked"), this.indeterminate = this.hasAttribute("indeterminate");
|
|
505
|
+
}
|
|
506
|
+
restoreState(t) {
|
|
507
|
+
this.checked = t === this.value;
|
|
508
|
+
}
|
|
509
|
+
validate() {
|
|
510
|
+
return this.required && !this.checked ? { flags: { valueMissing: !0 }, message: "Please tick this box if you want to proceed." } : null;
|
|
511
|
+
}
|
|
512
|
+
willUpdate(t) {
|
|
513
|
+
super.willUpdate(t);
|
|
514
|
+
const e = this.checked && !this.indeterminate;
|
|
515
|
+
this.internals.ariaChecked = this.indeterminate ? "mixed" : String(this.checked), this.setData("checked", e), this.setData("unchecked", !this.checked && !this.indeterminate), this.setData("indeterminate", this.indeterminate), this.setState("checked", e), this.setState("indeterminate", this.indeterminate);
|
|
516
|
+
}
|
|
517
|
+
render() {
|
|
518
|
+
return !this.checked && !this.indeterminate ? d : m`<span
|
|
519
|
+
data-pont2-checkbox-indicator
|
|
520
|
+
data-slot="checkbox-indicator"
|
|
521
|
+
?data-checked=${this.checked && !this.indeterminate}
|
|
522
|
+
?data-indeterminate=${this.indeterminate}
|
|
523
|
+
>${this.indeterminate ? w.minus() : w.check()}</span
|
|
524
|
+
>`;
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
H.identity = "checkbox", H.slotName = "checkbox", H.role = "checkbox", H.properties = {
|
|
528
|
+
...W.properties,
|
|
529
|
+
checked: { type: Boolean },
|
|
530
|
+
indeterminate: { type: Boolean, reflect: !0 },
|
|
531
|
+
value: { type: String },
|
|
532
|
+
uncheckedValue: { type: String, attribute: "unchecked-value" }
|
|
533
|
+
};
|
|
534
|
+
let ie = H;
|
|
535
|
+
n("pont2-prim-checkbox", ie);
|
|
536
|
+
function fr(s, t = "input") {
|
|
537
|
+
s.hasAttribute("data-pont2-input") || s.setAttribute("data-pont2-input", ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", t);
|
|
538
|
+
}
|
|
539
|
+
function Rr(s = {}) {
|
|
540
|
+
return m`<input
|
|
541
|
+
data-pont2-input
|
|
542
|
+
data-slot=${s.slot ?? "input"}
|
|
543
|
+
id=${s.id ?? d}
|
|
544
|
+
name=${s.name ?? d}
|
|
545
|
+
type=${s.type ?? "text"}
|
|
546
|
+
.value=${Oa(s.value ?? "")}
|
|
547
|
+
placeholder=${s.placeholder ?? d}
|
|
548
|
+
autocomplete=${s.autocomplete ?? d}
|
|
549
|
+
inputmode=${s.inputmode ?? d}
|
|
550
|
+
?required=${s.required}
|
|
551
|
+
?disabled=${s.disabled}
|
|
552
|
+
?readonly=${s.readonly}
|
|
553
|
+
aria-invalid=${s.invalid ? "true" : d}
|
|
554
|
+
aria-describedby=${s.describedBy ?? d}
|
|
555
|
+
${L(s.attrs ?? {})}
|
|
556
|
+
@input=${s.onInput ?? d}
|
|
557
|
+
@change=${s.onChange ?? d}
|
|
558
|
+
/>`;
|
|
559
|
+
}
|
|
560
|
+
const Ca = class Ca extends S {
|
|
561
|
+
apply(t) {
|
|
562
|
+
fr(t);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
Ca.nativeSelector = "input";
|
|
566
|
+
let se = Ca;
|
|
567
|
+
n("pont2-prim-input", se);
|
|
568
|
+
const Ne = class Ne extends c {
|
|
569
|
+
};
|
|
570
|
+
Ne.identity = "kbd", Ne.slotName = "kbd";
|
|
571
|
+
let ae = Ne;
|
|
572
|
+
const qe = class qe extends c {
|
|
573
|
+
};
|
|
574
|
+
qe.identity = "kbd-group", qe.slotName = "kbd-group";
|
|
575
|
+
let re = qe;
|
|
576
|
+
n("pont2-prim-kbd", ae);
|
|
577
|
+
n("pont2-prim-kbd-group", re);
|
|
578
|
+
function mr(s, t = "label") {
|
|
579
|
+
s.hasAttribute("data-pont2-label") || s.setAttribute("data-pont2-label", ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", t);
|
|
580
|
+
}
|
|
581
|
+
function wn(s, t) {
|
|
582
|
+
const e = {};
|
|
583
|
+
for (const i of s.identities ?? []) e[`data-pont2-${i}`] = !0;
|
|
584
|
+
return m`<label
|
|
585
|
+
data-pont2-label
|
|
586
|
+
data-slot=${s.slot ?? "label"}
|
|
587
|
+
for=${s.for ?? d}
|
|
588
|
+
id=${s.id ?? d}
|
|
589
|
+
${L({ ...e, ...s.attrs ?? {} })}
|
|
590
|
+
>${t}</label
|
|
591
|
+
>`;
|
|
592
|
+
}
|
|
593
|
+
const Ua = class Ua extends S {
|
|
594
|
+
apply(t) {
|
|
595
|
+
mr(t);
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
Ua.nativeSelector = "label";
|
|
599
|
+
let ne = Ua;
|
|
600
|
+
n("pont2-prim-label", ne);
|
|
601
|
+
const j = class j extends c {
|
|
602
|
+
constructor() {
|
|
603
|
+
super(), this.orientation = "horizontal";
|
|
604
|
+
}
|
|
605
|
+
willUpdate() {
|
|
606
|
+
const t = this.orientation === "vertical" ? "vertical" : "horizontal";
|
|
607
|
+
this.setData("orientation", t), this.internals.ariaOrientation = t;
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
j.identity = "separator", j.slotName = "separator", j.role = "separator", j.properties = {
|
|
611
|
+
orientation: { type: String, reflect: !0 }
|
|
612
|
+
};
|
|
613
|
+
let z = j;
|
|
614
|
+
n("pont2-prim-separator", z);
|
|
615
|
+
const Le = class Le extends c {
|
|
616
|
+
};
|
|
617
|
+
Le.identity = "skeleton", Le.slotName = "skeleton";
|
|
618
|
+
let oe = Le;
|
|
619
|
+
n("pont2-prim-skeleton", oe);
|
|
620
|
+
const vt = class vt extends c {
|
|
621
|
+
connectedCallback() {
|
|
622
|
+
super.connectedCallback(), this.internals.ariaLabel || (this.internals.ariaLabel = "Loading");
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
vt.identity = "spinner", vt.slotName = "spinner", vt.role = "status";
|
|
626
|
+
let le = vt;
|
|
627
|
+
n("pont2-prim-spinner", le);
|
|
628
|
+
function gr(s, t = "textarea") {
|
|
629
|
+
s.hasAttribute("data-pont2-textarea") || s.setAttribute("data-pont2-textarea", ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", t);
|
|
630
|
+
}
|
|
631
|
+
function Kr(s = {}) {
|
|
632
|
+
return m`<textarea
|
|
633
|
+
data-pont2-textarea
|
|
634
|
+
data-slot=${s.slot ?? "textarea"}
|
|
635
|
+
id=${s.id ?? d}
|
|
636
|
+
name=${s.name ?? d}
|
|
637
|
+
rows=${s.rows ?? d}
|
|
638
|
+
placeholder=${s.placeholder ?? d}
|
|
639
|
+
?required=${s.required}
|
|
640
|
+
?disabled=${s.disabled}
|
|
641
|
+
?readonly=${s.readonly}
|
|
642
|
+
aria-invalid=${s.invalid ? "true" : d}
|
|
643
|
+
aria-describedby=${s.describedBy ?? d}
|
|
644
|
+
.value=${Oa(s.value ?? "")}
|
|
645
|
+
${L(s.attrs ?? {})}
|
|
646
|
+
@input=${s.onInput ?? d}
|
|
647
|
+
></textarea>`;
|
|
648
|
+
}
|
|
649
|
+
const za = class za extends S {
|
|
650
|
+
apply(t) {
|
|
651
|
+
gr(t);
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
za.nativeSelector = "textarea";
|
|
655
|
+
let ce = za;
|
|
656
|
+
n("pont2-prim-textarea", ce);
|
|
657
|
+
const $n = ["default", "destructive"], M = class M extends c {
|
|
658
|
+
constructor() {
|
|
659
|
+
super(), this.variant = "default";
|
|
660
|
+
}
|
|
661
|
+
willUpdate() {
|
|
662
|
+
this.setData("variant", this.variant || "default");
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
M.identity = "alert", M.slotName = "alert", M.role = "alert", M.properties = {
|
|
666
|
+
variant: { type: String, reflect: !0 }
|
|
667
|
+
};
|
|
668
|
+
let he = M;
|
|
669
|
+
const Ce = class Ce extends c {
|
|
670
|
+
};
|
|
671
|
+
Ce.identity = "alert-title", Ce.slotName = "alert-title";
|
|
672
|
+
let de = Ce;
|
|
673
|
+
const Ue = class Ue extends c {
|
|
674
|
+
};
|
|
675
|
+
Ue.identity = "alert-description", Ue.slotName = "alert-description";
|
|
676
|
+
let ue = Ue;
|
|
677
|
+
const ze = class ze extends c {
|
|
678
|
+
};
|
|
679
|
+
ze.identity = "alert-action", ze.slotName = "alert-action";
|
|
680
|
+
let Ti = ze;
|
|
681
|
+
n("pont2-prim-alert", he);
|
|
682
|
+
n("pont2-prim-alert-title", de);
|
|
683
|
+
n("pont2-prim-alert-description", ue);
|
|
684
|
+
n("pont2-prim-alert-action", Ti);
|
|
685
|
+
const kt = class kt extends c {
|
|
686
|
+
constructor() {
|
|
687
|
+
super(), this.img = null, this.onLoad = () => this.setStatus("loaded"), this.onError = () => this.setStatus("error"), this.size = "default", this.imageLoadingStatus = "idle";
|
|
688
|
+
}
|
|
689
|
+
/** The author's `<img>` (a direct child), if any. */
|
|
690
|
+
get image() {
|
|
691
|
+
return this.querySelector(":scope > img");
|
|
692
|
+
}
|
|
693
|
+
connectedCallback() {
|
|
694
|
+
super.connectedCallback(), this.observer ?? (this.observer = new MutationObserver(() => this.track())), this.observer.observe(this, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["src", "srcset"] }), this.track();
|
|
695
|
+
}
|
|
696
|
+
disconnectedCallback() {
|
|
697
|
+
var t;
|
|
698
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect(), this.detach();
|
|
699
|
+
}
|
|
700
|
+
detach() {
|
|
701
|
+
var t, e;
|
|
702
|
+
(t = this.img) == null || t.removeEventListener("load", this.onLoad), (e = this.img) == null || e.removeEventListener("error", this.onError), this.img = null;
|
|
703
|
+
}
|
|
704
|
+
track() {
|
|
705
|
+
const t = this.image;
|
|
706
|
+
if (t !== this.img && (this.detach(), this.img = t, t && (t.addEventListener("load", this.onLoad), t.addEventListener("error", this.onError), t.hasAttribute("data-pont2-avatar-image") || t.setAttribute("data-pont2-avatar-image", ""), t.hasAttribute("data-slot") || t.setAttribute("data-slot", "avatar-image"))), !t || !(t.currentSrc || t.getAttribute("src"))) return this.setStatus(t ? "error" : "idle");
|
|
707
|
+
t.complete ? this.setStatus(t.naturalWidth > 0 ? "loaded" : "error") : this.setStatus("loading");
|
|
708
|
+
}
|
|
709
|
+
setStatus(t) {
|
|
710
|
+
t !== this.imageLoadingStatus && (this.imageLoadingStatus = t, this.dispatchEvent(
|
|
711
|
+
new CustomEvent("pont2-loading-status-change", { detail: { status: t }, bubbles: !0, composed: !0 })
|
|
712
|
+
));
|
|
713
|
+
}
|
|
714
|
+
willUpdate() {
|
|
715
|
+
this.setData("size", this.size || "default"), this.setData("image-loading-status", this.imageLoadingStatus);
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
kt.identity = "avatar", kt.slotName = "avatar", kt.properties = {
|
|
719
|
+
size: { type: String, reflect: !0 },
|
|
720
|
+
imageLoadingStatus: { state: !0 }
|
|
721
|
+
};
|
|
722
|
+
let pe = kt;
|
|
723
|
+
const Ve = class Ve extends c {
|
|
724
|
+
};
|
|
725
|
+
Ve.identity = "avatar-fallback", Ve.slotName = "avatar-fallback";
|
|
726
|
+
let fe = Ve;
|
|
727
|
+
const Re = class Re extends c {
|
|
728
|
+
};
|
|
729
|
+
Re.identity = "avatar-badge", Re.slotName = "avatar-badge";
|
|
730
|
+
let me = Re;
|
|
731
|
+
const Ke = class Ke extends c {
|
|
732
|
+
};
|
|
733
|
+
Ke.identity = "avatar-group", Ke.slotName = "avatar-group";
|
|
734
|
+
let Fi = Ke;
|
|
735
|
+
const Be = class Be extends c {
|
|
736
|
+
};
|
|
737
|
+
Be.identity = "avatar-group-count", Be.slotName = "avatar-group-count";
|
|
738
|
+
let Pi = Be;
|
|
739
|
+
n("pont2-prim-avatar", pe);
|
|
740
|
+
n("pont2-prim-avatar-fallback", fe);
|
|
741
|
+
n("pont2-prim-avatar-badge", me);
|
|
742
|
+
n("pont2-prim-avatar-group", Fi);
|
|
743
|
+
n("pont2-prim-avatar-group-count", Pi);
|
|
744
|
+
const X = class X extends c {
|
|
745
|
+
constructor() {
|
|
746
|
+
super(), this.orientation = "horizontal";
|
|
747
|
+
}
|
|
748
|
+
willUpdate() {
|
|
749
|
+
this.setData("orientation", this.orientation === "vertical" ? "vertical" : "horizontal");
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
X.identity = "button-group", X.slotName = "button-group", X.role = "group", X.properties = {
|
|
753
|
+
orientation: { type: String, reflect: !0 }
|
|
754
|
+
};
|
|
755
|
+
let Hi = X;
|
|
756
|
+
const We = class We extends c {
|
|
757
|
+
};
|
|
758
|
+
We.identity = "button-group-text", We.slotName = "button-group-text";
|
|
759
|
+
let ji = We;
|
|
760
|
+
const Te = class Te extends z {
|
|
761
|
+
constructor() {
|
|
762
|
+
super(), this.orientation = "vertical";
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
Te.identity = "button-group-separator", Te.slotName = "button-group-separator";
|
|
766
|
+
let Mi = Te;
|
|
767
|
+
n("pont2-prim-button-group", Hi);
|
|
768
|
+
n("pont2-prim-button-group-text", ji);
|
|
769
|
+
n("pont2-prim-button-group-separator", Mi);
|
|
770
|
+
const xt = class xt extends c {
|
|
771
|
+
constructor() {
|
|
772
|
+
super(), this.size = "default";
|
|
773
|
+
}
|
|
774
|
+
willUpdate() {
|
|
775
|
+
this.setData("size", this.size || "default");
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
xt.identity = "card", xt.slotName = "card", xt.properties = {
|
|
779
|
+
size: { type: String, reflect: !0 }
|
|
780
|
+
};
|
|
781
|
+
let Xi = xt;
|
|
782
|
+
const Fe = class Fe extends c {
|
|
783
|
+
};
|
|
784
|
+
Fe.identity = "card-header", Fe.slotName = "card-header";
|
|
785
|
+
let Yi = Fe;
|
|
786
|
+
const Pe = class Pe extends c {
|
|
787
|
+
};
|
|
788
|
+
Pe.identity = "card-title", Pe.slotName = "card-title";
|
|
789
|
+
let Qi = Pe;
|
|
790
|
+
const He = class He extends c {
|
|
791
|
+
};
|
|
792
|
+
He.identity = "card-description", He.slotName = "card-description";
|
|
793
|
+
let Zi = He;
|
|
794
|
+
const je = class je extends c {
|
|
795
|
+
};
|
|
796
|
+
je.identity = "card-action", je.slotName = "card-action";
|
|
797
|
+
let Ji = je;
|
|
798
|
+
const Me = class Me extends c {
|
|
799
|
+
};
|
|
800
|
+
Me.identity = "card-content", Me.slotName = "card-content";
|
|
801
|
+
let Ii = Me;
|
|
802
|
+
const Xe = class Xe extends c {
|
|
803
|
+
};
|
|
804
|
+
Xe.identity = "card-footer", Xe.slotName = "card-footer";
|
|
805
|
+
let Gi = Xe;
|
|
806
|
+
n("pont2-prim-card", Xi);
|
|
807
|
+
n("pont2-prim-card-header", Yi);
|
|
808
|
+
n("pont2-prim-card-title", Qi);
|
|
809
|
+
n("pont2-prim-card-description", Zi);
|
|
810
|
+
n("pont2-prim-card-action", Ji);
|
|
811
|
+
n("pont2-prim-card-content", Ii);
|
|
812
|
+
n("pont2-prim-card-footer", Gi);
|
|
813
|
+
const Ye = class Ye extends c {
|
|
814
|
+
};
|
|
815
|
+
Ye.identity = "empty", Ye.slotName = "empty";
|
|
816
|
+
let _i = Ye;
|
|
817
|
+
const Qe = class Qe extends c {
|
|
818
|
+
};
|
|
819
|
+
Qe.identity = "empty-header", Qe.slotName = "empty-header";
|
|
820
|
+
let ts = Qe;
|
|
821
|
+
const wt = class wt extends c {
|
|
822
|
+
constructor() {
|
|
823
|
+
super(), this.variant = "default";
|
|
824
|
+
}
|
|
825
|
+
willUpdate() {
|
|
826
|
+
this.setData("variant", this.variant || "default");
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
wt.identity = "empty-media", wt.slotName = "empty-icon", wt.properties = {
|
|
830
|
+
variant: { type: String, reflect: !0 }
|
|
831
|
+
};
|
|
832
|
+
let es = wt;
|
|
833
|
+
const Ze = class Ze extends c {
|
|
834
|
+
};
|
|
835
|
+
Ze.identity = "empty-title", Ze.slotName = "empty-title";
|
|
836
|
+
let is = Ze;
|
|
837
|
+
const Je = class Je extends c {
|
|
838
|
+
};
|
|
839
|
+
Je.identity = "empty-description", Je.slotName = "empty-description";
|
|
840
|
+
let ss = Je;
|
|
841
|
+
const Ie = class Ie extends c {
|
|
842
|
+
};
|
|
843
|
+
Ie.identity = "empty-content", Ie.slotName = "empty-content";
|
|
844
|
+
let as = Ie;
|
|
845
|
+
n("pont2-prim-empty", _i);
|
|
846
|
+
n("pont2-prim-empty-header", ts);
|
|
847
|
+
n("pont2-prim-empty-media", es);
|
|
848
|
+
n("pont2-prim-empty-title", is);
|
|
849
|
+
n("pont2-prim-empty-description", ss);
|
|
850
|
+
n("pont2-prim-empty-content", as);
|
|
851
|
+
function Br(s) {
|
|
852
|
+
s.hasAttribute("data-pont2-field-set") || s.setAttribute("data-pont2-field-set", ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", "field-set");
|
|
853
|
+
}
|
|
854
|
+
function An(s, t) {
|
|
855
|
+
return m`<fieldset data-pont2-field-set data-slot="field-set" ?disabled=${s.disabled} ${L(s.attrs ?? {})}>
|
|
856
|
+
${t}
|
|
857
|
+
</fieldset>`;
|
|
858
|
+
}
|
|
859
|
+
function Dn(s, t) {
|
|
860
|
+
return m`<legend
|
|
861
|
+
data-pont2-field-legend
|
|
862
|
+
data-slot="field-legend"
|
|
863
|
+
data-variant=${s.variant ?? "legend"}
|
|
864
|
+
${L(s.attrs ?? {})}
|
|
865
|
+
>${t}</legend
|
|
866
|
+
>`;
|
|
867
|
+
}
|
|
868
|
+
const Va = class Va extends S {
|
|
869
|
+
apply(t) {
|
|
870
|
+
Br(t);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
Va.nativeSelector = "fieldset";
|
|
874
|
+
let rs = Va;
|
|
875
|
+
const Ge = class Ge extends c {
|
|
876
|
+
};
|
|
877
|
+
Ge.identity = "field-group", Ge.slotName = "field-group";
|
|
878
|
+
let ns = Ge;
|
|
879
|
+
const Y = class Y extends c {
|
|
880
|
+
constructor() {
|
|
881
|
+
super(), this.orientation = "vertical", this.invalid = !1, this.disabled = !1;
|
|
882
|
+
}
|
|
883
|
+
willUpdate(t) {
|
|
884
|
+
this.setData("orientation", this.orientation || "vertical"), t.has("invalid") && (this.invalid || t.get("invalid")) && this.setData("invalid", this.invalid), t.has("disabled") && (this.disabled || t.get("disabled")) && this.setData("disabled", this.disabled);
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
Y.identity = "field", Y.slotName = "field", Y.role = "group", Y.properties = {
|
|
888
|
+
orientation: { type: String, reflect: !0 },
|
|
889
|
+
invalid: { type: Boolean, reflect: !0 },
|
|
890
|
+
disabled: { type: Boolean, reflect: !0 }
|
|
891
|
+
};
|
|
892
|
+
let os = Y;
|
|
893
|
+
const _e = class _e extends c {
|
|
894
|
+
};
|
|
895
|
+
_e.identity = "field-content", _e.slotName = "field-content";
|
|
896
|
+
let ls = _e;
|
|
897
|
+
function Wr(s) {
|
|
898
|
+
mr(s, "field-label"), s.hasAttribute("data-pont2-field-label") || s.setAttribute("data-pont2-field-label", "");
|
|
899
|
+
}
|
|
900
|
+
function En(s, t) {
|
|
901
|
+
return m`<label
|
|
902
|
+
data-pont2-label
|
|
903
|
+
data-pont2-field-label
|
|
904
|
+
data-slot="field-label"
|
|
905
|
+
for=${s.for ?? d}
|
|
906
|
+
id=${s.id ?? d}
|
|
907
|
+
${L(s.attrs ?? {})}
|
|
908
|
+
>${t}</label
|
|
909
|
+
>`;
|
|
910
|
+
}
|
|
911
|
+
const Ra = class Ra extends S {
|
|
912
|
+
apply(t) {
|
|
913
|
+
Wr(t);
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
Ra.nativeSelector = "label";
|
|
917
|
+
let cs = Ra;
|
|
918
|
+
const ti = class ti extends c {
|
|
919
|
+
};
|
|
920
|
+
ti.identity = "field-title", ti.slotName = "field-label";
|
|
921
|
+
let hs = ti;
|
|
922
|
+
const ei = class ei extends c {
|
|
923
|
+
};
|
|
924
|
+
ei.identity = "field-description", ei.slotName = "field-description";
|
|
925
|
+
let ds = ei;
|
|
926
|
+
const ii = class ii extends c {
|
|
927
|
+
connectedCallback() {
|
|
928
|
+
super.connectedCallback(), this.observer ?? (this.observer = new MutationObserver(() => this.sync())), this.observer.observe(this, { childList: !0, characterData: !0, subtree: !0 }), this.sync();
|
|
929
|
+
}
|
|
930
|
+
disconnectedCallback() {
|
|
931
|
+
var t;
|
|
932
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect();
|
|
933
|
+
}
|
|
934
|
+
sync() {
|
|
935
|
+
var t;
|
|
936
|
+
this.setAttribute("data-content", String(!!((t = this.textContent) != null && t.trim()) || this.children.length > 0));
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
ii.identity = "field-separator", ii.slotName = "field-separator";
|
|
940
|
+
let us = ii;
|
|
941
|
+
const Q = class Q extends c {
|
|
942
|
+
render() {
|
|
943
|
+
var e;
|
|
944
|
+
if (!((e = this.errors) != null && e.length)) return d;
|
|
945
|
+
const t = [...new Map(this.errors.map((i) => [i == null ? void 0 : i.message, i])).values()].filter((i) => i == null ? void 0 : i.message);
|
|
946
|
+
return t.length === 1 ? t[0].message : m`<ul data-slot="field-error-list">
|
|
947
|
+
${t.map((i) => m`<li>${i.message}</li>`)}
|
|
948
|
+
</ul>`;
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
Q.identity = "field-error", Q.slotName = "field-error", Q.role = "alert", Q.properties = {
|
|
952
|
+
errors: { attribute: !1 }
|
|
953
|
+
};
|
|
954
|
+
let ps = Q;
|
|
955
|
+
n("pont2-prim-field-set", rs);
|
|
956
|
+
n("pont2-prim-field-group", ns);
|
|
957
|
+
n("pont2-prim-field", os);
|
|
958
|
+
n("pont2-prim-field-content", ls);
|
|
959
|
+
n("pont2-prim-field-label", cs);
|
|
960
|
+
n("pont2-prim-field-title", hs);
|
|
961
|
+
n("pont2-prim-field-description", ds);
|
|
962
|
+
n("pont2-prim-field-separator", us);
|
|
963
|
+
n("pont2-prim-field-error", ps);
|
|
964
|
+
const Z = class Z extends c {
|
|
965
|
+
constructor() {
|
|
966
|
+
super(), this.disabled = !1;
|
|
967
|
+
}
|
|
968
|
+
willUpdate(t) {
|
|
969
|
+
t.has("disabled") && (this.disabled || t.get("disabled")) && this.setData("disabled", this.disabled);
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
Z.identity = "input-group", Z.slotName = "input-group", Z.role = "group", Z.properties = {
|
|
973
|
+
disabled: { type: Boolean, reflect: !0 }
|
|
974
|
+
};
|
|
975
|
+
let fs = Z;
|
|
976
|
+
const J = class J extends c {
|
|
977
|
+
constructor() {
|
|
978
|
+
super(), this.align = "inline-start", this.addEventListener("click", (t) => {
|
|
979
|
+
var e, i;
|
|
980
|
+
t.target.closest("button") || (i = (e = this.parentElement) == null ? void 0 : e.querySelector("input")) == null || i.focus();
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
willUpdate() {
|
|
984
|
+
this.setData("align", this.align || "inline-start");
|
|
985
|
+
}
|
|
986
|
+
};
|
|
987
|
+
J.identity = "input-group-addon", J.slotName = "input-group-addon", J.role = "group", J.properties = {
|
|
988
|
+
align: { type: String, reflect: !0 }
|
|
989
|
+
};
|
|
990
|
+
let ms = J;
|
|
991
|
+
const Ka = class Ka extends c {
|
|
992
|
+
};
|
|
993
|
+
Ka.identity = "input-group-text";
|
|
994
|
+
let gs = Ka;
|
|
995
|
+
const T = "input-group-control";
|
|
996
|
+
function br(s, t) {
|
|
997
|
+
s.hasAttribute(`data-pont2-${t}`) || s.setAttribute(`data-pont2-${t}`, ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", T);
|
|
998
|
+
}
|
|
999
|
+
function On(s = {}) {
|
|
1000
|
+
return Rr({ ...s, slot: T, attrs: { "data-pont2-input-group-input": !0, ...s.attrs ?? {} } });
|
|
1001
|
+
}
|
|
1002
|
+
function Sn(s = {}) {
|
|
1003
|
+
return Kr({ ...s, slot: T, attrs: { "data-pont2-input-group-textarea": !0, ...s.attrs ?? {} } });
|
|
1004
|
+
}
|
|
1005
|
+
function Nn(s, t) {
|
|
1006
|
+
return ur(
|
|
1007
|
+
{
|
|
1008
|
+
variant: "ghost",
|
|
1009
|
+
...s,
|
|
1010
|
+
size: s.size ?? "xs",
|
|
1011
|
+
attrs: { "data-pont2-input-group-button": !0, ...s.attrs ?? {} }
|
|
1012
|
+
},
|
|
1013
|
+
t
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1016
|
+
const Ba = class Ba extends S {
|
|
1017
|
+
apply(t) {
|
|
1018
|
+
t.hasAttribute("data-slot") || t.setAttribute("data-slot", T), fr(t, T), br(t, "input-group-input");
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
Ba.nativeSelector = "input";
|
|
1022
|
+
let bs = Ba;
|
|
1023
|
+
const Wa = class Wa extends S {
|
|
1024
|
+
apply(t) {
|
|
1025
|
+
t.hasAttribute("data-slot") || t.setAttribute("data-slot", T), gr(t, T), br(t, "input-group-textarea");
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
Wa.nativeSelector = "textarea";
|
|
1029
|
+
let ys = Wa;
|
|
1030
|
+
class Tr extends Qt {
|
|
1031
|
+
constructor() {
|
|
1032
|
+
super(), this.variant = "ghost", this.size = "xs";
|
|
1033
|
+
}
|
|
1034
|
+
apply(t) {
|
|
1035
|
+
dr(t, this), t.hasAttribute("data-pont2-input-group-button") || t.setAttribute("data-pont2-input-group-button", ""), t instanceof HTMLButtonElement && !t.hasAttribute("type") && (t.type = "button");
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
n("pont2-prim-input-group", fs);
|
|
1039
|
+
n("pont2-prim-input-group-addon", ms);
|
|
1040
|
+
n("pont2-prim-input-group-text", gs);
|
|
1041
|
+
n("pont2-prim-input-group-input", bs);
|
|
1042
|
+
n("pont2-prim-input-group-textarea", ys);
|
|
1043
|
+
n("pont2-prim-input-group-button", Tr);
|
|
1044
|
+
const $t = class $t extends c {
|
|
1045
|
+
};
|
|
1046
|
+
$t.identity = "item-group", $t.slotName = "item-group", $t.role = "list";
|
|
1047
|
+
let vs = $t;
|
|
1048
|
+
const si = class si extends z {
|
|
1049
|
+
};
|
|
1050
|
+
si.identity = "item-separator", si.slotName = "item-separator";
|
|
1051
|
+
let ks = si;
|
|
1052
|
+
const At = class At extends c {
|
|
1053
|
+
constructor() {
|
|
1054
|
+
super(), this.variant = "default", this.size = "default";
|
|
1055
|
+
}
|
|
1056
|
+
willUpdate() {
|
|
1057
|
+
this.setData("variant", this.variant || "default"), this.setData("size", this.size || "default");
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
At.identity = "item", At.slotName = "item", At.properties = {
|
|
1061
|
+
variant: { type: String, reflect: !0 },
|
|
1062
|
+
size: { type: String, reflect: !0 }
|
|
1063
|
+
};
|
|
1064
|
+
let xs = At;
|
|
1065
|
+
const Dt = class Dt extends c {
|
|
1066
|
+
constructor() {
|
|
1067
|
+
super(), this.variant = "default";
|
|
1068
|
+
}
|
|
1069
|
+
willUpdate() {
|
|
1070
|
+
this.setData("variant", this.variant || "default");
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
1073
|
+
Dt.identity = "item-media", Dt.slotName = "item-media", Dt.properties = {
|
|
1074
|
+
variant: { type: String, reflect: !0 }
|
|
1075
|
+
};
|
|
1076
|
+
let ws = Dt;
|
|
1077
|
+
const ai = class ai extends c {
|
|
1078
|
+
};
|
|
1079
|
+
ai.identity = "item-content", ai.slotName = "item-content";
|
|
1080
|
+
let $s = ai;
|
|
1081
|
+
const ri = class ri extends c {
|
|
1082
|
+
};
|
|
1083
|
+
ri.identity = "item-title", ri.slotName = "item-title";
|
|
1084
|
+
let As = ri;
|
|
1085
|
+
const ni = class ni extends c {
|
|
1086
|
+
};
|
|
1087
|
+
ni.identity = "item-description", ni.slotName = "item-description";
|
|
1088
|
+
let Ds = ni;
|
|
1089
|
+
const oi = class oi extends c {
|
|
1090
|
+
};
|
|
1091
|
+
oi.identity = "item-actions", oi.slotName = "item-actions";
|
|
1092
|
+
let Es = oi;
|
|
1093
|
+
const li = class li extends c {
|
|
1094
|
+
};
|
|
1095
|
+
li.identity = "item-header", li.slotName = "item-header";
|
|
1096
|
+
let Os = li;
|
|
1097
|
+
const ci = class ci extends c {
|
|
1098
|
+
};
|
|
1099
|
+
ci.identity = "item-footer", ci.slotName = "item-footer";
|
|
1100
|
+
let Ss = ci;
|
|
1101
|
+
n("pont2-prim-item-group", vs);
|
|
1102
|
+
n("pont2-prim-item-separator", ks);
|
|
1103
|
+
n("pont2-prim-item", xs);
|
|
1104
|
+
n("pont2-prim-item-media", ws);
|
|
1105
|
+
n("pont2-prim-item-content", $s);
|
|
1106
|
+
n("pont2-prim-item-title", As);
|
|
1107
|
+
n("pont2-prim-item-description", Ds);
|
|
1108
|
+
n("pont2-prim-item-actions", Es);
|
|
1109
|
+
n("pont2-prim-item-header", Os);
|
|
1110
|
+
n("pont2-prim-item-footer", Ss);
|
|
1111
|
+
const Et = class Et extends c {
|
|
1112
|
+
constructor() {
|
|
1113
|
+
super(), this.size = "default";
|
|
1114
|
+
}
|
|
1115
|
+
/** The native `<select>`. */
|
|
1116
|
+
get control() {
|
|
1117
|
+
return this.querySelector(":scope > select");
|
|
1118
|
+
}
|
|
1119
|
+
connectedCallback() {
|
|
1120
|
+
super.connectedCallback(), this.observer ?? (this.observer = new MutationObserver(() => this.requestUpdate())), this.observer.observe(this, { childList: !0 });
|
|
1121
|
+
}
|
|
1122
|
+
disconnectedCallback() {
|
|
1123
|
+
var t;
|
|
1124
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect();
|
|
1125
|
+
}
|
|
1126
|
+
focus(t) {
|
|
1127
|
+
var e;
|
|
1128
|
+
(e = this.control) == null || e.focus(t);
|
|
1129
|
+
}
|
|
1130
|
+
willUpdate() {
|
|
1131
|
+
const t = this.size || "default";
|
|
1132
|
+
this.setData("size", t);
|
|
1133
|
+
const e = this.control;
|
|
1134
|
+
e && Fr(e, t);
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1137
|
+
Et.identity = "native-select-wrapper", Et.slotName = "native-select-wrapper", Et.properties = {
|
|
1138
|
+
size: { type: String, reflect: !0 }
|
|
1139
|
+
};
|
|
1140
|
+
let ge = Et;
|
|
1141
|
+
function Fr(s, t = "default") {
|
|
1142
|
+
s.hasAttribute("data-pont2-native-select") || s.setAttribute("data-pont2-native-select", ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", "native-select"), s.setAttribute("data-size", t);
|
|
1143
|
+
}
|
|
1144
|
+
function qn(s, t) {
|
|
1145
|
+
const e = s.size ?? "default";
|
|
1146
|
+
return m`<div data-pont2-native-select-wrapper data-slot="native-select-wrapper" data-size=${e}>
|
|
1147
|
+
<select
|
|
1148
|
+
data-pont2-native-select
|
|
1149
|
+
data-slot="native-select"
|
|
1150
|
+
data-size=${e}
|
|
1151
|
+
id=${s.id ?? d}
|
|
1152
|
+
name=${s.name ?? d}
|
|
1153
|
+
?disabled=${s.disabled}
|
|
1154
|
+
?required=${s.required}
|
|
1155
|
+
aria-invalid=${s.invalid ? "true" : d}
|
|
1156
|
+
${L(s.attrs ?? {})}
|
|
1157
|
+
@change=${s.onChange ?? d}
|
|
1158
|
+
>
|
|
1159
|
+
${t}
|
|
1160
|
+
</select>
|
|
1161
|
+
</div>`;
|
|
1162
|
+
}
|
|
1163
|
+
n("pont2-prim-native-select", ge);
|
|
1164
|
+
const hi = class hi extends c {
|
|
1165
|
+
/** The native `<table>` this container holds. */
|
|
1166
|
+
get table() {
|
|
1167
|
+
return this.querySelector(":scope > table");
|
|
1168
|
+
}
|
|
1169
|
+
connectedCallback() {
|
|
1170
|
+
super.connectedCallback(), this.observer ?? (this.observer = new MutationObserver(() => this.stamp())), this.observer.observe(this, { childList: !0, subtree: !0 }), this.stamp();
|
|
1171
|
+
}
|
|
1172
|
+
disconnectedCallback() {
|
|
1173
|
+
var t;
|
|
1174
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect();
|
|
1175
|
+
}
|
|
1176
|
+
stamp() {
|
|
1177
|
+
const t = this.table;
|
|
1178
|
+
t && Pr(t);
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
hi.identity = "table-container", hi.slotName = "table-container";
|
|
1182
|
+
let be = hi;
|
|
1183
|
+
const te = {
|
|
1184
|
+
CAPTION: "table-caption",
|
|
1185
|
+
THEAD: "table-header",
|
|
1186
|
+
TBODY: "table-body",
|
|
1187
|
+
TFOOT: "table-footer",
|
|
1188
|
+
TR: "table-row",
|
|
1189
|
+
TH: "table-head",
|
|
1190
|
+
TD: "table-cell"
|
|
1191
|
+
};
|
|
1192
|
+
function mt(s, t) {
|
|
1193
|
+
s.hasAttribute(`data-pont2-${t}`) || s.setAttribute(`data-pont2-${t}`, ""), s.hasAttribute("data-slot") || s.setAttribute("data-slot", t);
|
|
1194
|
+
}
|
|
1195
|
+
function Pr(s) {
|
|
1196
|
+
mt(s, "table"), s.caption && mt(s.caption, te.CAPTION);
|
|
1197
|
+
for (const t of [s.tHead, ...Array.from(s.tBodies), s.tFoot])
|
|
1198
|
+
t && mt(t, te[t.tagName]);
|
|
1199
|
+
for (const t of Array.from(s.rows)) {
|
|
1200
|
+
mt(t, te.TR);
|
|
1201
|
+
for (const e of Array.from(t.cells)) mt(e, te[e.tagName]);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
n("pont2-prim-table", be);
|
|
1205
|
+
const Ns = "^\\d+$", Ln = "^[a-zA-Z]+$", Cn = "^[a-zA-Z0-9]+$";
|
|
1206
|
+
function Ri(s, t, e = Ns) {
|
|
1207
|
+
let i = null;
|
|
1208
|
+
if (e)
|
|
1209
|
+
try {
|
|
1210
|
+
i = new RegExp(e);
|
|
1211
|
+
} catch {
|
|
1212
|
+
i = null;
|
|
1213
|
+
}
|
|
1214
|
+
let a = "";
|
|
1215
|
+
for (const r of Array.from(s)) {
|
|
1216
|
+
if (a.length >= t) break;
|
|
1217
|
+
/\s/.test(r) || i && !i.test(r) || (a += r);
|
|
1218
|
+
}
|
|
1219
|
+
return a;
|
|
1220
|
+
}
|
|
1221
|
+
function Hr(s, t, e, i, a) {
|
|
1222
|
+
const r = Array.from(s);
|
|
1223
|
+
let o = i ?? r.length, h = a ?? o;
|
|
1224
|
+
o === h && o >= t && (o = t - 1, h = t);
|
|
1225
|
+
const l = o === h;
|
|
1226
|
+
return Array.from({ length: t }, (p, u) => {
|
|
1227
|
+
const g = r[u] ?? null, b = e && (l ? u === o : u >= o && u < h);
|
|
1228
|
+
return { char: g, isActive: b, hasFakeCaret: b && l && g === null };
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
const yr = f("input-otp"), jr = f("input-otp-slot"), Ga = ["aria-label", "aria-labelledby", "aria-describedby", "aria-invalid"], di = class di extends c {
|
|
1232
|
+
constructor() {
|
|
1233
|
+
super(), this.dirty = !1, this.focused = !1, this.onInput = (t) => {
|
|
1234
|
+
this.setFromInput(t.target.value, t.target);
|
|
1235
|
+
}, this.onPaste = (t) => {
|
|
1236
|
+
var o;
|
|
1237
|
+
const e = t.target, i = (o = t.clipboardData) == null ? void 0 : o.getData("text/plain");
|
|
1238
|
+
if (i == null) return;
|
|
1239
|
+
t.preventDefault();
|
|
1240
|
+
const a = e.selectionStart ?? e.value.length, r = e.selectionEnd ?? a;
|
|
1241
|
+
this.setFromInput(e.value.slice(0, a) + i + e.value.slice(r), e), e.dispatchEvent(new Event("input", { bubbles: !0, composed: !0 }));
|
|
1242
|
+
}, this.placeCaret = () => {
|
|
1243
|
+
const t = this.input;
|
|
1244
|
+
if (!t) return;
|
|
1245
|
+
const e = t.value.length;
|
|
1246
|
+
e >= this.maxLength ? t.setSelectionRange(this.maxLength - 1, this.maxLength) : t.setSelectionRange(e, e), this.syncSlots();
|
|
1247
|
+
}, this.onFocus = () => {
|
|
1248
|
+
this.focused = !0, this.setData("focused", !0), requestAnimationFrame(this.placeCaret);
|
|
1249
|
+
}, this.onBlur = () => {
|
|
1250
|
+
this.focused = !1, this.setData("focused", !1), this.syncSlots();
|
|
1251
|
+
}, this.onSelectionChange = () => {
|
|
1252
|
+
this.focused && document.activeElement === this.input && this.syncSlots();
|
|
1253
|
+
}, this.maxLength = 6, this.pattern = Ns, this.defaultValue = null, this.name = null, this.required = !1, this.disabled = !1, this.autocomplete = "one-time-code", this.keyboardMode = null, this.inputId = null, this.current = "", this.forwarded = {};
|
|
1254
|
+
}
|
|
1255
|
+
/** The native input (the real form control). */
|
|
1256
|
+
get input() {
|
|
1257
|
+
return this.querySelector(":scope > [data-pont2-input-otp-input-wrapper] > input");
|
|
1258
|
+
}
|
|
1259
|
+
get value() {
|
|
1260
|
+
return this.current;
|
|
1261
|
+
}
|
|
1262
|
+
set value(t) {
|
|
1263
|
+
this.dirty = !0, this.current = Ri(String(t ?? ""), this.maxLength, this.pattern || null);
|
|
1264
|
+
}
|
|
1265
|
+
focus(t) {
|
|
1266
|
+
var e;
|
|
1267
|
+
(e = this.input) == null || e.focus(t);
|
|
1268
|
+
}
|
|
1269
|
+
connectedCallback() {
|
|
1270
|
+
super.connectedCallback(), this.readForwarded(), this.observer ?? (this.observer = new MutationObserver((t) => {
|
|
1271
|
+
t.some((e) => e.type === "attributes" && e.target === this) ? this.readForwarded() : this.syncSlots();
|
|
1272
|
+
})), this.observer.observe(this, { attributes: !0, attributeFilter: [...Ga], childList: !0, subtree: !0 }), document.addEventListener("selectionchange", this.onSelectionChange);
|
|
1273
|
+
}
|
|
1274
|
+
disconnectedCallback() {
|
|
1275
|
+
var t;
|
|
1276
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect(), document.removeEventListener("selectionchange", this.onSelectionChange);
|
|
1277
|
+
}
|
|
1278
|
+
readForwarded() {
|
|
1279
|
+
const t = {};
|
|
1280
|
+
for (const e of Ga) t[e] = this.getAttribute(e);
|
|
1281
|
+
this.forwarded = t;
|
|
1282
|
+
}
|
|
1283
|
+
get slots() {
|
|
1284
|
+
return Array.from(this.querySelectorAll(jr)).filter((t) => t.closest(yr) === this);
|
|
1285
|
+
}
|
|
1286
|
+
/** Push per-slot state into the slot elements. */
|
|
1287
|
+
syncSlots() {
|
|
1288
|
+
const t = this.input, e = Hr(this.current, this.maxLength, this.focused, (t == null ? void 0 : t.selectionStart) ?? null, (t == null ? void 0 : t.selectionEnd) ?? null), i = this.forwarded["aria-invalid"] === "true";
|
|
1289
|
+
this.slots.forEach((a, r) => {
|
|
1290
|
+
const o = a.hasAttribute("index") ? Number(a.getAttribute("index")) : r;
|
|
1291
|
+
typeof a.sync == "function" && a.sync(e[o] ?? { char: null, isActive: !1, hasFakeCaret: !1 }, i);
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
/* -------------------------------------------------------------- */
|
|
1295
|
+
/* Input handling (what input-otp does) */
|
|
1296
|
+
/* -------------------------------------------------------------- */
|
|
1297
|
+
setFromInput(t, e) {
|
|
1298
|
+
const i = Ri(t, this.maxLength, this.pattern || null);
|
|
1299
|
+
i !== e.value && (e.value = i, e.setSelectionRange(i.length, i.length));
|
|
1300
|
+
const a = this.current;
|
|
1301
|
+
this.dirty = !0, this.current = i, i !== a && i.length === this.maxLength && cr(this, "pont2-complete", { value: i }), this.syncSlots();
|
|
1302
|
+
}
|
|
1303
|
+
/* -------------------------------------------------------------- */
|
|
1304
|
+
/* Render */
|
|
1305
|
+
/* -------------------------------------------------------------- */
|
|
1306
|
+
willUpdate(t) {
|
|
1307
|
+
!this.dirty && (t.has("defaultValue") || !this.hasUpdated) && (this.current = Ri(this.defaultValue ?? "", this.maxLength, this.pattern || null)), this.setData("disabled", this.disabled), this.setData("complete", this.current.length === this.maxLength);
|
|
1308
|
+
}
|
|
1309
|
+
updated() {
|
|
1310
|
+
this.syncSlots();
|
|
1311
|
+
}
|
|
1312
|
+
render() {
|
|
1313
|
+
const t = this.pattern === Ns, e = this.forwarded;
|
|
1314
|
+
return m`<div data-pont2-input-otp-input-wrapper>
|
|
1315
|
+
<input
|
|
1316
|
+
data-pont2-input-otp-input
|
|
1317
|
+
data-slot="input-otp"
|
|
1318
|
+
id=${this.inputId ?? d}
|
|
1319
|
+
name=${this.name ?? d}
|
|
1320
|
+
.value=${Oa(this.current)}
|
|
1321
|
+
maxlength=${this.maxLength}
|
|
1322
|
+
pattern=${this.pattern || d}
|
|
1323
|
+
inputmode=${this.keyboardMode ?? (t ? "numeric" : "text")}
|
|
1324
|
+
autocomplete=${this.autocomplete}
|
|
1325
|
+
spellcheck="false"
|
|
1326
|
+
autocapitalize="off"
|
|
1327
|
+
?required=${this.required}
|
|
1328
|
+
?disabled=${this.disabled}
|
|
1329
|
+
aria-label=${e["aria-label"] ?? d}
|
|
1330
|
+
aria-labelledby=${e["aria-labelledby"] ?? d}
|
|
1331
|
+
aria-describedby=${e["aria-describedby"] ?? d}
|
|
1332
|
+
aria-invalid=${e["aria-invalid"] ?? d}
|
|
1333
|
+
@input=${this.onInput}
|
|
1334
|
+
@paste=${this.onPaste}
|
|
1335
|
+
@focus=${this.onFocus}
|
|
1336
|
+
@blur=${this.onBlur}
|
|
1337
|
+
@click=${this.placeCaret}
|
|
1338
|
+
/>
|
|
1339
|
+
</div>`;
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1342
|
+
di.identity = "input-otp", di.properties = {
|
|
1343
|
+
maxLength: { type: Number, attribute: "maxlength" },
|
|
1344
|
+
pattern: { type: String },
|
|
1345
|
+
defaultValue: { type: String, attribute: "value" },
|
|
1346
|
+
name: { type: String },
|
|
1347
|
+
required: { type: Boolean },
|
|
1348
|
+
disabled: { type: Boolean, reflect: !0 },
|
|
1349
|
+
autocomplete: { type: String },
|
|
1350
|
+
keyboardMode: { type: String, attribute: "inputmode" },
|
|
1351
|
+
inputId: { type: String, attribute: "input-id" },
|
|
1352
|
+
current: { state: !0 },
|
|
1353
|
+
forwarded: { state: !0 }
|
|
1354
|
+
};
|
|
1355
|
+
let ye = di;
|
|
1356
|
+
const ui = class ui extends c {
|
|
1357
|
+
};
|
|
1358
|
+
ui.identity = "input-otp-group", ui.slotName = "input-otp-group";
|
|
1359
|
+
let ve = ui;
|
|
1360
|
+
const Ot = class Ot extends c {
|
|
1361
|
+
constructor() {
|
|
1362
|
+
super(), this.state = { char: null, isActive: !1, hasFakeCaret: !1 };
|
|
1363
|
+
}
|
|
1364
|
+
connectedCallback() {
|
|
1365
|
+
var t;
|
|
1366
|
+
super.connectedCallback(), (t = this.closest(yr)) == null || t.requestUpdate();
|
|
1367
|
+
}
|
|
1368
|
+
/** @internal Called by the InputOTP. */
|
|
1369
|
+
sync(t, e) {
|
|
1370
|
+
this.state = t, this.setData("active", t.isActive ? "true" : "false"), this.setData("filled", t.char != null), this.setData("invalid", e);
|
|
1371
|
+
}
|
|
1372
|
+
render() {
|
|
1373
|
+
const { char: t, hasFakeCaret: e } = this.state;
|
|
1374
|
+
return m`${t ?? d}${e ? m`<div data-pont2-input-otp-caret><div data-pont2-input-otp-caret-line></div></div>` : d}`;
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
Ot.identity = "input-otp-slot", Ot.slotName = "input-otp-slot", Ot.properties = {
|
|
1378
|
+
state: { state: !0 }
|
|
1379
|
+
};
|
|
1380
|
+
let qs = Ot;
|
|
1381
|
+
const St = class St extends c {
|
|
1382
|
+
render() {
|
|
1383
|
+
return w.minus();
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
St.identity = "input-otp-separator", St.slotName = "input-otp-separator", St.role = "separator";
|
|
1387
|
+
let ke = St;
|
|
1388
|
+
n("pont2-prim-input-otp", ye);
|
|
1389
|
+
n("pont2-prim-input-otp-group", ve);
|
|
1390
|
+
n("pont2-prim-input-otp-slot", qs);
|
|
1391
|
+
n("pont2-prim-input-otp-separator", ke);
|
|
1392
|
+
const vr = f("progress"), I = class I extends c {
|
|
1393
|
+
constructor() {
|
|
1394
|
+
super(), this.value = null, this.min = 0, this.max = 100;
|
|
1395
|
+
}
|
|
1396
|
+
get status() {
|
|
1397
|
+
return this.value == null || Number.isNaN(this.value) ? "indeterminate" : this.value >= this.max ? "complete" : "progressing";
|
|
1398
|
+
}
|
|
1399
|
+
/** 0..1, or null when indeterminate. */
|
|
1400
|
+
get fraction() {
|
|
1401
|
+
if (this.status === "indeterminate") return null;
|
|
1402
|
+
const t = this.max - this.min;
|
|
1403
|
+
return t > 0 ? Math.min(1, Math.max(0, (this.value - this.min) / t)) : 0;
|
|
1404
|
+
}
|
|
1405
|
+
/** The value as Base UI formats it by default: a locale percentage. */
|
|
1406
|
+
get formattedValue() {
|
|
1407
|
+
const t = this.fraction;
|
|
1408
|
+
return t == null ? "" : new Intl.NumberFormat(void 0, { style: "percent" }).format(t);
|
|
1409
|
+
}
|
|
1410
|
+
willUpdate(t) {
|
|
1411
|
+
super.willUpdate(t);
|
|
1412
|
+
const e = this.status, i = this.internals;
|
|
1413
|
+
i.ariaValueMin = String(this.min), i.ariaValueMax = String(this.max), i.ariaValueNow = e === "indeterminate" ? null : String(this.value), i.ariaValueText = e === "indeterminate" ? null : this.formattedValue;
|
|
1414
|
+
for (const a of ["progressing", "complete", "indeterminate"]) this.setData(a, a === e);
|
|
1415
|
+
}
|
|
1416
|
+
updated() {
|
|
1417
|
+
const t = this.own(f("progress-label"));
|
|
1418
|
+
"ariaLabelledByElements" in ElementInternals.prototype ? this.internals.ariaLabelledByElements = t.length ? t : null : t.length && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-labelledby", t.map((i) => $(i, "progress-label")).join(" "));
|
|
1419
|
+
const e = [...t, ...this.own(f("progress-value"))];
|
|
1420
|
+
for (const i of e) typeof i.sync == "function" && i.sync(this.status, this.formattedValue);
|
|
1421
|
+
}
|
|
1422
|
+
own(t) {
|
|
1423
|
+
return Array.from(this.querySelectorAll(t)).filter((e) => e.closest(vr) === this);
|
|
1424
|
+
}
|
|
1425
|
+
render() {
|
|
1426
|
+
const t = this.status, e = this.fraction;
|
|
1427
|
+
return m`<div
|
|
1428
|
+
data-pont2-progress-track
|
|
1429
|
+
data-slot="progress-track"
|
|
1430
|
+
?data-progressing=${t === "progressing"}
|
|
1431
|
+
?data-complete=${t === "complete"}
|
|
1432
|
+
?data-indeterminate=${t === "indeterminate"}
|
|
1433
|
+
>
|
|
1434
|
+
<div
|
|
1435
|
+
data-pont2-progress-indicator
|
|
1436
|
+
data-slot="progress-indicator"
|
|
1437
|
+
?data-progressing=${t === "progressing"}
|
|
1438
|
+
?data-complete=${t === "complete"}
|
|
1439
|
+
?data-indeterminate=${t === "indeterminate"}
|
|
1440
|
+
style=${e == null ? d : Wi({ insetInlineStart: "0", width: `${e * 100}%` })}
|
|
1441
|
+
></div>
|
|
1442
|
+
</div>`;
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
I.identity = "progress", I.slotName = "progress", I.role = "progressbar", I.properties = {
|
|
1446
|
+
value: { type: Number },
|
|
1447
|
+
min: { type: Number },
|
|
1448
|
+
max: { type: Number }
|
|
1449
|
+
};
|
|
1450
|
+
let Ls = I;
|
|
1451
|
+
class kr extends c {
|
|
1452
|
+
connectedCallback() {
|
|
1453
|
+
var t;
|
|
1454
|
+
super.connectedCallback(), (t = this.closest(vr)) == null || t.requestUpdate();
|
|
1455
|
+
}
|
|
1456
|
+
/** @internal Called by the root. */
|
|
1457
|
+
sync(t, e) {
|
|
1458
|
+
for (const i of ["progressing", "complete", "indeterminate"]) this.setData(i, i === t);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
const pi = class pi extends kr {
|
|
1462
|
+
};
|
|
1463
|
+
pi.identity = "progress-label", pi.slotName = "progress-label";
|
|
1464
|
+
let Cs = pi;
|
|
1465
|
+
const Nt = class Nt extends kr {
|
|
1466
|
+
constructor() {
|
|
1467
|
+
super(), this.authored = !1, this.formatted = "";
|
|
1468
|
+
}
|
|
1469
|
+
connectedCallback() {
|
|
1470
|
+
this.hasUpdated || (this.authored = (this.textContent ?? "").trim() !== ""), super.connectedCallback(), this.setAttribute("aria-hidden", this.getAttribute("aria-hidden") ?? "true");
|
|
1471
|
+
}
|
|
1472
|
+
sync(t, e) {
|
|
1473
|
+
super.sync(t, e), this.formatted = e;
|
|
1474
|
+
}
|
|
1475
|
+
render() {
|
|
1476
|
+
return this.authored ? d : this.formatted;
|
|
1477
|
+
}
|
|
1478
|
+
};
|
|
1479
|
+
Nt.identity = "progress-value", Nt.slotName = "progress-value", Nt.properties = {
|
|
1480
|
+
formatted: { state: !0 }
|
|
1481
|
+
};
|
|
1482
|
+
let Us = Nt;
|
|
1483
|
+
n("pont2-prim-progress", Ls);
|
|
1484
|
+
n("pont2-prim-progress-label", Cs);
|
|
1485
|
+
n("pont2-prim-progress-value", Us);
|
|
1486
|
+
const G = class G extends W {
|
|
1487
|
+
constructor() {
|
|
1488
|
+
super(), this.roving = new hr(this, {
|
|
1489
|
+
items: () => this.items,
|
|
1490
|
+
orientation: () => this.orientation ?? "both",
|
|
1491
|
+
onNavigate: (t) => this.selectItem(t)
|
|
1492
|
+
}), this.value = "";
|
|
1493
|
+
}
|
|
1494
|
+
/** The items that belong to this group (not to a nested group). */
|
|
1495
|
+
get items() {
|
|
1496
|
+
return Array.from(this.querySelectorAll(f("radio-group-item"))).filter(
|
|
1497
|
+
(t) => t.closest(f("radio-group")) === this
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
get hostFocusable() {
|
|
1501
|
+
return !1;
|
|
1502
|
+
}
|
|
1503
|
+
get validationAnchor() {
|
|
1504
|
+
return this.items[0];
|
|
1505
|
+
}
|
|
1506
|
+
connectedCallback() {
|
|
1507
|
+
super.connectedCallback(), this.observer ?? (this.observer = new MutationObserver(() => this.requestUpdate())), this.observer.observe(this, { childList: !0, subtree: !0 });
|
|
1508
|
+
}
|
|
1509
|
+
disconnectedCallback() {
|
|
1510
|
+
var t;
|
|
1511
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect();
|
|
1512
|
+
}
|
|
1513
|
+
/** Called by an item when it is pressed. */
|
|
1514
|
+
selectItem(t) {
|
|
1515
|
+
this.isDisabled || this.readOnly || t.disabled || t.value !== this.value && (this.value = t.value, v(this, "input"), v(this, "change"));
|
|
1516
|
+
}
|
|
1517
|
+
/** Called by items when they connect, so a late-upgrading item is synced. */
|
|
1518
|
+
itemsChanged() {
|
|
1519
|
+
this.requestUpdate();
|
|
1520
|
+
}
|
|
1521
|
+
formValue() {
|
|
1522
|
+
return this.value || null;
|
|
1523
|
+
}
|
|
1524
|
+
resetToDefault() {
|
|
1525
|
+
this.value = this.getAttribute("value") ?? "";
|
|
1526
|
+
}
|
|
1527
|
+
restoreState(t) {
|
|
1528
|
+
typeof t == "string" && (this.value = t);
|
|
1529
|
+
}
|
|
1530
|
+
validate() {
|
|
1531
|
+
return this.required && !this.value ? { flags: { valueMissing: !0 }, message: "Please select one of these options." } : null;
|
|
1532
|
+
}
|
|
1533
|
+
willUpdate(t) {
|
|
1534
|
+
super.willUpdate(t), this.internals.ariaOrientation = this.orientation === "horizontal" || this.orientation === "vertical" ? this.orientation : null;
|
|
1535
|
+
}
|
|
1536
|
+
updated(t) {
|
|
1537
|
+
super.updated(t);
|
|
1538
|
+
const e = this.isDisabled;
|
|
1539
|
+
let i = null;
|
|
1540
|
+
for (const a of this.items)
|
|
1541
|
+
a.checked = !!this.value && a.value === this.value, a.groupDisabled = e, a.groupReadOnly = this.readOnly, a.groupRequired = this.required, a.checked && (i = a);
|
|
1542
|
+
this.roving.sync(i);
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
G.identity = "radio-group", G.slotName = "radio-group", G.role = "radiogroup", G.properties = {
|
|
1546
|
+
value: { type: String },
|
|
1547
|
+
orientation: { type: String }
|
|
1548
|
+
};
|
|
1549
|
+
let zs = G;
|
|
1550
|
+
const K = class K extends c {
|
|
1551
|
+
constructor() {
|
|
1552
|
+
super(), this.onClick = (t) => {
|
|
1553
|
+
var e;
|
|
1554
|
+
if (this.isDisabled) {
|
|
1555
|
+
t.preventDefault();
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
(e = this.group) == null || e.selectItem(this), document.activeElement !== this && this.focus();
|
|
1559
|
+
}, this.onKeyDown = (t) => {
|
|
1560
|
+
var e;
|
|
1561
|
+
t.target === this && (t.key === " " && (t.preventDefault(), this.click()), t.key === "Enter" && ((e = this.internals.form) == null || e.requestSubmit()));
|
|
1562
|
+
}, this.value = "", this.disabled = !1, this.checked = !1, this.groupDisabled = !1, this.groupReadOnly = !1, this.groupRequired = !1, this.formDisabled = !1, this.addEventListener("click", this.onClick), this.addEventListener("keydown", this.onKeyDown);
|
|
1563
|
+
}
|
|
1564
|
+
get group() {
|
|
1565
|
+
return this.closest(f("radio-group"));
|
|
1566
|
+
}
|
|
1567
|
+
get isDisabled() {
|
|
1568
|
+
return this.disabled || this.groupDisabled || this.formDisabled;
|
|
1569
|
+
}
|
|
1570
|
+
get labels() {
|
|
1571
|
+
return this.internals.labels;
|
|
1572
|
+
}
|
|
1573
|
+
formDisabledCallback(t) {
|
|
1574
|
+
this.formDisabled = t;
|
|
1575
|
+
}
|
|
1576
|
+
connectedCallback() {
|
|
1577
|
+
var t;
|
|
1578
|
+
super.connectedCallback(), (t = this.group) == null || t.itemsChanged();
|
|
1579
|
+
}
|
|
1580
|
+
willUpdate() {
|
|
1581
|
+
const t = this.isDisabled;
|
|
1582
|
+
this.internals.ariaChecked = String(this.checked), this.internals.ariaDisabled = t ? "true" : null, this.internals.ariaReadOnly = this.groupReadOnly ? "true" : null, this.internals.ariaRequired = this.groupRequired ? "true" : null, this.setData("checked", this.checked), this.setData("unchecked", !this.checked), this.setData("disabled", t), this.setData("readonly", this.groupReadOnly), this.setData("required", this.groupRequired), this.setState("checked", this.checked), t ? this.tabIndex = -1 : this.hasAttribute("tabindex") || (this.tabIndex = -1);
|
|
1583
|
+
}
|
|
1584
|
+
render() {
|
|
1585
|
+
return this.checked ? m`<span data-pont2-radio-group-indicator data-slot="radio-group-indicator" data-checked
|
|
1586
|
+
><span data-pont2-radio-group-indicator-icon></span
|
|
1587
|
+
></span>` : d;
|
|
1588
|
+
}
|
|
1589
|
+
};
|
|
1590
|
+
K.formAssociated = !0, K.identity = "radio-group-item", K.slotName = "radio-group-item", K.role = "radio", K.properties = {
|
|
1591
|
+
value: { type: String },
|
|
1592
|
+
disabled: { type: Boolean, reflect: !0 },
|
|
1593
|
+
checked: { state: !0 },
|
|
1594
|
+
groupDisabled: { state: !0 },
|
|
1595
|
+
groupReadOnly: { state: !0 },
|
|
1596
|
+
groupRequired: { state: !0 },
|
|
1597
|
+
formDisabled: { state: !0 }
|
|
1598
|
+
};
|
|
1599
|
+
let Vs = K;
|
|
1600
|
+
n("pont2-prim-radio-group", zs);
|
|
1601
|
+
n("pont2-prim-radio-group-item", Vs);
|
|
1602
|
+
const Zt = (s, t, e) => Math.min(e, Math.max(t, s));
|
|
1603
|
+
function _a(s) {
|
|
1604
|
+
if (!Number.isFinite(s)) return 0;
|
|
1605
|
+
const t = String(s);
|
|
1606
|
+
if (t.includes("e-")) return Number(t.split("e-")[1]);
|
|
1607
|
+
const e = t.indexOf(".");
|
|
1608
|
+
return e < 0 ? 0 : t.length - e - 1;
|
|
1609
|
+
}
|
|
1610
|
+
function Mr(s, { min: t, max: e, step: i }) {
|
|
1611
|
+
if (!(i > 0)) return Zt(s, t, e);
|
|
1612
|
+
const a = Math.round((s - t) / i) * i + t, r = Math.max(_a(i), _a(t));
|
|
1613
|
+
return Zt(Number(a.toFixed(r)), t, e);
|
|
1614
|
+
}
|
|
1615
|
+
function Xr(s, { min: t, max: e }) {
|
|
1616
|
+
return e <= t ? 0 : Zt((s - t) / (e - t), 0, 1);
|
|
1617
|
+
}
|
|
1618
|
+
function tr(s, { min: t, max: e }) {
|
|
1619
|
+
return t + Zt(s, 0, 1) * (e - t);
|
|
1620
|
+
}
|
|
1621
|
+
function Yr(s, t) {
|
|
1622
|
+
let e = 0, i = 1 / 0;
|
|
1623
|
+
return s.forEach((a, r) => {
|
|
1624
|
+
const o = Math.abs(a - t);
|
|
1625
|
+
(o < i || o === i && t > a) && (e = r, i = o);
|
|
1626
|
+
}), e;
|
|
1627
|
+
}
|
|
1628
|
+
function Ki(s, t, e, i, a = 0) {
|
|
1629
|
+
const r = a * i.step, o = t > 0 ? s[t - 1] + r : i.min, h = t < s.length - 1 ? s[t + 1] - r : i.max, l = s.slice();
|
|
1630
|
+
return l[t] = Zt(Mr(e, i), o, h), l;
|
|
1631
|
+
}
|
|
1632
|
+
function Qr(s, t, e, i = {}) {
|
|
1633
|
+
const a = i.shift ? e.largeStep : e.step, r = i.rtl && !i.vertical ? -1 : 1;
|
|
1634
|
+
switch (s) {
|
|
1635
|
+
case "ArrowUp":
|
|
1636
|
+
return t + a;
|
|
1637
|
+
case "ArrowDown":
|
|
1638
|
+
return t - a;
|
|
1639
|
+
case "ArrowRight":
|
|
1640
|
+
return t + a * r;
|
|
1641
|
+
case "ArrowLeft":
|
|
1642
|
+
return t - a * r;
|
|
1643
|
+
case "PageUp":
|
|
1644
|
+
return t + e.largeStep;
|
|
1645
|
+
case "PageDown":
|
|
1646
|
+
return t - e.largeStep;
|
|
1647
|
+
case "Home":
|
|
1648
|
+
return e.min;
|
|
1649
|
+
case "End":
|
|
1650
|
+
return e.max;
|
|
1651
|
+
default:
|
|
1652
|
+
return null;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
function Zr(s, t) {
|
|
1656
|
+
if (s == null || s.trim() === "") return [t];
|
|
1657
|
+
const e = s.split(",").map((i) => Number(i.trim())).filter((i) => Number.isFinite(i));
|
|
1658
|
+
return e.length ? e.sort((i, a) => i - a) : [t];
|
|
1659
|
+
}
|
|
1660
|
+
const qt = class qt extends W {
|
|
1661
|
+
constructor() {
|
|
1662
|
+
super(), this.dirty = !1, this.dragging = -1, this.onKeyDown = (t, e) => {
|
|
1663
|
+
if (this.isDisabled || this.readOnly) return;
|
|
1664
|
+
const i = this.orientation === "vertical", a = Qr(t.key, this.values[e], { ...this.range, largeStep: this.largeStep }, {
|
|
1665
|
+
shift: t.shiftKey,
|
|
1666
|
+
rtl: dt(this) === "rtl",
|
|
1667
|
+
vertical: i
|
|
1668
|
+
});
|
|
1669
|
+
a != null && (t.preventDefault(), this.commit(e, a, !0));
|
|
1670
|
+
}, this.onPointerDown = (t) => {
|
|
1671
|
+
var o, h, l;
|
|
1672
|
+
if (this.isDisabled || this.readOnly || t.button !== 0) return;
|
|
1673
|
+
const e = this.control, i = this.valueFromPointer(t), a = (h = (o = t.target).closest) == null ? void 0 : h.call(o, "[data-slot=slider-thumb]"), r = a ? this.thumbs.indexOf(a) : Yr(this.values, i);
|
|
1674
|
+
this.dragging = r, this.activeThumb = r, e.setPointerCapture(t.pointerId), t.preventDefault(), (l = this.thumbs[r]) == null || l.focus({ preventScroll: !0 }), a || this.commit(r, i, !1);
|
|
1675
|
+
}, this.onPointerMove = (t) => {
|
|
1676
|
+
this.dragging < 0 || this.commit(this.dragging, this.valueFromPointer(t), !1);
|
|
1677
|
+
}, this.onPointerUp = (t) => {
|
|
1678
|
+
var e;
|
|
1679
|
+
this.dragging < 0 || ((e = this.control) == null || e.releasePointerCapture(t.pointerId), this.commit(this.dragging, this.values[this.dragging], !0), this.dragging = -1, this.activeThumb = -1);
|
|
1680
|
+
}, this.defaultValue = null, this.min = 0, this.max = 100, this.step = 1, this.largeStep = 10, this.minStepsBetweenValues = 0, this.orientation = "horizontal", this.values = [0], this.activeThumb = -1;
|
|
1681
|
+
}
|
|
1682
|
+
/** A number for a single-thumb slider, an array for a range (Base UI's shape). */
|
|
1683
|
+
get value() {
|
|
1684
|
+
return this.values.length === 1 ? this.values[0] : this.values.slice();
|
|
1685
|
+
}
|
|
1686
|
+
set value(t) {
|
|
1687
|
+
this.dirty = !0;
|
|
1688
|
+
const e = Array.isArray(t) ? t.slice() : [t];
|
|
1689
|
+
this.values = e.map((i) => Ki([i], 0, i, this.range)[0]).sort((i, a) => i - a);
|
|
1690
|
+
}
|
|
1691
|
+
get range() {
|
|
1692
|
+
return { min: this.min, max: this.max, step: this.step };
|
|
1693
|
+
}
|
|
1694
|
+
get hostFocusable() {
|
|
1695
|
+
return !1;
|
|
1696
|
+
}
|
|
1697
|
+
get validationAnchor() {
|
|
1698
|
+
return this.thumbs[0];
|
|
1699
|
+
}
|
|
1700
|
+
get thumbs() {
|
|
1701
|
+
return Array.from(this.querySelectorAll(":scope > [data-slot=slider-control] > [data-slot=slider-thumb]"));
|
|
1702
|
+
}
|
|
1703
|
+
get control() {
|
|
1704
|
+
return this.querySelector(":scope > [data-slot=slider-control]");
|
|
1705
|
+
}
|
|
1706
|
+
/* -------------------------------------------------------------- */
|
|
1707
|
+
/* Form */
|
|
1708
|
+
/* -------------------------------------------------------------- */
|
|
1709
|
+
formValue() {
|
|
1710
|
+
if (!this.name) return null;
|
|
1711
|
+
if (this.values.length === 1) return String(this.values[0]);
|
|
1712
|
+
const t = new FormData();
|
|
1713
|
+
for (const e of this.values) t.append(this.name, String(e));
|
|
1714
|
+
return t;
|
|
1715
|
+
}
|
|
1716
|
+
resetToDefault() {
|
|
1717
|
+
this.dirty = !1, this.values = this.initialValues();
|
|
1718
|
+
}
|
|
1719
|
+
restoreState(t) {
|
|
1720
|
+
typeof t == "string" ? this.value = Number(t) : t instanceof FormData && (this.value = t.getAll(this.name).map(Number));
|
|
1721
|
+
}
|
|
1722
|
+
initialValues() {
|
|
1723
|
+
return Zr(this.defaultValue, this.min).map((t) => Ki([t], 0, t, this.range)[0]);
|
|
1724
|
+
}
|
|
1725
|
+
/* -------------------------------------------------------------- */
|
|
1726
|
+
/* Interaction */
|
|
1727
|
+
/* -------------------------------------------------------------- */
|
|
1728
|
+
commit(t, e, i) {
|
|
1729
|
+
const a = Ki(this.values, t, e, this.range, this.minStepsBetweenValues), r = a[t] !== this.values[t];
|
|
1730
|
+
r && (this.dirty = !0, this.values = a, v(this, "input")), i && (r || this.dragging >= 0) && v(this, "change");
|
|
1731
|
+
}
|
|
1732
|
+
valueFromPointer(t) {
|
|
1733
|
+
var o;
|
|
1734
|
+
const e = this.control.getBoundingClientRect(), i = (o = this.thumbs[0]) == null ? void 0 : o.getBoundingClientRect();
|
|
1735
|
+
if (this.orientation === "vertical") {
|
|
1736
|
+
const h = (i == null ? void 0 : i.height) ?? 0;
|
|
1737
|
+
return tr(1 - (t.clientY - e.top - h / 2) / Math.max(1, e.height - h), this.range);
|
|
1738
|
+
}
|
|
1739
|
+
const a = (i == null ? void 0 : i.width) ?? 0;
|
|
1740
|
+
let r = (t.clientX - e.left - a / 2) / Math.max(1, e.width - a);
|
|
1741
|
+
return dt(this) === "rtl" && (r = 1 - r), tr(r, this.range);
|
|
1742
|
+
}
|
|
1743
|
+
/* -------------------------------------------------------------- */
|
|
1744
|
+
/* Render */
|
|
1745
|
+
/* -------------------------------------------------------------- */
|
|
1746
|
+
willUpdate(t) {
|
|
1747
|
+
super.willUpdate(t), !this.dirty && (t.has("defaultValue") || t.has("min") || t.has("max") || !this.hasUpdated) && (this.values = this.initialValues()), this.setData("orientation", this.orientation === "vertical" ? "vertical" : "horizontal"), this.setData("dragging", this.dragging >= 0);
|
|
1748
|
+
}
|
|
1749
|
+
updated(t) {
|
|
1750
|
+
super.updated(t);
|
|
1751
|
+
const i = Array.from(this.labels).map((a) => $(a, "slider-label")).join(" ");
|
|
1752
|
+
for (const a of this.thumbs)
|
|
1753
|
+
i ? a.setAttribute("aria-labelledby", i) : a.removeAttribute("aria-labelledby");
|
|
1754
|
+
}
|
|
1755
|
+
render() {
|
|
1756
|
+
const t = this.orientation === "vertical", e = t ? "vertical" : "horizontal", i = this.isDisabled, a = this.values.map((g) => Xr(g, this.range)), r = (g) => `calc(${g} * (100% - var(--_pont2-slider-thumb)))`, o = this.values.length > 1 ? a[0] : 0, h = a[a.length - 1], l = t ? { bottom: this.values.length > 1 ? `calc(${r(o)} + var(--_pont2-slider-thumb) / 2)` : "0", top: `calc(100% - ${r(h)} - var(--_pont2-slider-thumb) / 2)` } : { insetInlineStart: this.values.length > 1 ? `calc(${r(o)} + var(--_pont2-slider-thumb) / 2)` : "0", insetInlineEnd: `calc(100% - ${r(h)} - var(--_pont2-slider-thumb) / 2)` }, p = this.getAttribute("aria-label"), u = this.values.length === 2 ? ["Minimum", "Maximum"] : [];
|
|
1757
|
+
return m`<div
|
|
1758
|
+
data-pont2-slider-control
|
|
1759
|
+
data-slot="slider-control"
|
|
1760
|
+
data-orientation=${e}
|
|
1761
|
+
?data-disabled=${i}
|
|
1762
|
+
@pointerdown=${this.onPointerDown}
|
|
1763
|
+
@pointermove=${this.onPointerMove}
|
|
1764
|
+
@pointerup=${this.onPointerUp}
|
|
1765
|
+
@pointercancel=${this.onPointerUp}
|
|
1766
|
+
>
|
|
1767
|
+
<div data-pont2-slider-track data-slot="slider-track" data-orientation=${e} ?data-disabled=${i}>
|
|
1768
|
+
<div data-pont2-slider-range data-slot="slider-range" data-orientation=${e} ?data-disabled=${i} style=${Wi(l)}></div>
|
|
1769
|
+
</div>
|
|
1770
|
+
${qr(
|
|
1771
|
+
this.values,
|
|
1772
|
+
(g, b) => b,
|
|
1773
|
+
(g, b) => m`<div
|
|
1774
|
+
data-pont2-slider-thumb
|
|
1775
|
+
data-slot="slider-thumb"
|
|
1776
|
+
data-index=${b}
|
|
1777
|
+
data-orientation=${e}
|
|
1778
|
+
?data-disabled=${i}
|
|
1779
|
+
?data-dragging=${this.activeThumb === b}
|
|
1780
|
+
role="slider"
|
|
1781
|
+
tabindex=${i ? -1 : 0}
|
|
1782
|
+
aria-valuemin=${this.min}
|
|
1783
|
+
aria-valuemax=${this.max}
|
|
1784
|
+
aria-valuenow=${g}
|
|
1785
|
+
aria-orientation=${e}
|
|
1786
|
+
aria-disabled=${i ? "true" : "false"}
|
|
1787
|
+
aria-label=${p ? u[b] ? `${p} ${u[b].toLowerCase()}` : p : u[b] ?? d}
|
|
1788
|
+
style=${Wi(t ? { bottom: r(a[b]) } : { insetInlineStart: r(a[b]) })}
|
|
1789
|
+
@keydown=${(y) => this.onKeyDown(y, b)}
|
|
1790
|
+
></div>`
|
|
1791
|
+
)}
|
|
1792
|
+
</div>`;
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
qt.identity = "slider", qt.slotName = "slider", qt.properties = {
|
|
1796
|
+
defaultValue: { type: String, attribute: "value" },
|
|
1797
|
+
min: { type: Number },
|
|
1798
|
+
max: { type: Number },
|
|
1799
|
+
step: { type: Number },
|
|
1800
|
+
largeStep: { type: Number, attribute: "large-step" },
|
|
1801
|
+
minStepsBetweenValues: { type: Number, attribute: "min-steps-between-values" },
|
|
1802
|
+
orientation: { type: String, reflect: !0 },
|
|
1803
|
+
values: { attribute: !1 },
|
|
1804
|
+
activeThumb: { state: !0 }
|
|
1805
|
+
};
|
|
1806
|
+
let xe = qt;
|
|
1807
|
+
n("pont2-prim-slider", xe);
|
|
1808
|
+
const _ = class _ extends W {
|
|
1809
|
+
constructor() {
|
|
1810
|
+
super(), this.onClick = (t) => {
|
|
1811
|
+
if (this.isDisabled || this.readOnly) {
|
|
1812
|
+
t.preventDefault();
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
this.toggle();
|
|
1816
|
+
}, this.onKeyDown = (t) => {
|
|
1817
|
+
t.target === this && (t.key === " " && t.preventDefault(), t.key === "Enter" && (t.preventDefault(), this.click()));
|
|
1818
|
+
}, this.onKeyUp = (t) => {
|
|
1819
|
+
t.key === " " && t.target === this && this.click();
|
|
1820
|
+
}, this.checked = !1, this.size = "default", this.value = "on", this.addEventListener("click", this.onClick), this.addEventListener("keydown", this.onKeyDown), this.addEventListener("keyup", this.onKeyUp);
|
|
1821
|
+
}
|
|
1822
|
+
/** Toggle as if the user clicked (fires input/change). */
|
|
1823
|
+
toggle() {
|
|
1824
|
+
this.isDisabled || this.readOnly || (this.checked = !this.checked, v(this, "input"), v(this, "change"));
|
|
1825
|
+
}
|
|
1826
|
+
formValue() {
|
|
1827
|
+
return this.checked ? this.value : this.uncheckedValue ?? null;
|
|
1828
|
+
}
|
|
1829
|
+
resetToDefault() {
|
|
1830
|
+
this.checked = this.hasAttribute("checked");
|
|
1831
|
+
}
|
|
1832
|
+
restoreState(t) {
|
|
1833
|
+
this.checked = t === this.value;
|
|
1834
|
+
}
|
|
1835
|
+
validate() {
|
|
1836
|
+
return this.required && !this.checked ? { flags: { valueMissing: !0 }, message: "Please turn this on if you want to proceed." } : null;
|
|
1837
|
+
}
|
|
1838
|
+
willUpdate(t) {
|
|
1839
|
+
super.willUpdate(t), this.internals.ariaChecked = String(this.checked), this.setData("checked", this.checked), this.setData("unchecked", !this.checked), this.setData("size", this.size === "sm" ? "sm" : "default"), this.setState("checked", this.checked);
|
|
1840
|
+
}
|
|
1841
|
+
render() {
|
|
1842
|
+
return m`<span
|
|
1843
|
+
data-pont2-switch-thumb
|
|
1844
|
+
data-slot="switch-thumb"
|
|
1845
|
+
?data-checked=${this.checked}
|
|
1846
|
+
?data-unchecked=${!this.checked}
|
|
1847
|
+
?data-disabled=${this.isDisabled}
|
|
1848
|
+
></span>`;
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
_.identity = "switch", _.slotName = "switch", _.role = "switch", _.properties = {
|
|
1852
|
+
checked: { type: Boolean },
|
|
1853
|
+
size: { type: String, reflect: !0 },
|
|
1854
|
+
value: { type: String },
|
|
1855
|
+
uncheckedValue: { type: String, attribute: "unchecked-value" }
|
|
1856
|
+
};
|
|
1857
|
+
let we = _;
|
|
1858
|
+
n("pont2-prim-switch", we);
|
|
1859
|
+
const Vi = f("tabs"), Jr = f("tabs-trigger"), Ir = f("tabs-content");
|
|
1860
|
+
function xr(s, t, e, i, a) {
|
|
1861
|
+
e in ElementInternals.prototype ? s[e] = a.length ? a : null : a.length ? t.setAttribute(i, a.map((r) => $(r, "tabs")).join(" ")) : t.removeAttribute(i);
|
|
1862
|
+
}
|
|
1863
|
+
const Lt = class Lt extends c {
|
|
1864
|
+
constructor() {
|
|
1865
|
+
super(), this.dirty = !1, this.direction = "none", this.defaultValue = null, this.orientation = "horizontal", this.current = "";
|
|
1866
|
+
}
|
|
1867
|
+
/** The active tab's value. Setting it activates that tab without firing events. */
|
|
1868
|
+
get value() {
|
|
1869
|
+
return this.current;
|
|
1870
|
+
}
|
|
1871
|
+
set value(t) {
|
|
1872
|
+
this.dirty = !0, this.current = t;
|
|
1873
|
+
}
|
|
1874
|
+
get triggers() {
|
|
1875
|
+
return this.own(Jr);
|
|
1876
|
+
}
|
|
1877
|
+
get panels() {
|
|
1878
|
+
return this.own(Ir);
|
|
1879
|
+
}
|
|
1880
|
+
get lists() {
|
|
1881
|
+
return this.own(f("tabs-list"));
|
|
1882
|
+
}
|
|
1883
|
+
own(t) {
|
|
1884
|
+
return Array.from(this.querySelectorAll(t)).filter((e) => e.closest(Vi) === this);
|
|
1885
|
+
}
|
|
1886
|
+
connectedCallback() {
|
|
1887
|
+
super.connectedCallback(), this.observer ?? (this.observer = new MutationObserver(() => this.requestUpdate())), this.observer.observe(this, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["value", "disabled"] });
|
|
1888
|
+
}
|
|
1889
|
+
disconnectedCallback() {
|
|
1890
|
+
var t;
|
|
1891
|
+
super.disconnectedCallback(), (t = this.observer) == null || t.disconnect();
|
|
1892
|
+
}
|
|
1893
|
+
/** Activate a trigger as the user would (fires input/change). */
|
|
1894
|
+
select(t) {
|
|
1895
|
+
if (t.disabled || t.value === this.value) return;
|
|
1896
|
+
const e = this.triggers, i = e.findIndex((o) => o.value === this.value), a = e.indexOf(t), r = this.orientation === "vertical";
|
|
1897
|
+
this.direction = i < 0 || a === i ? "none" : a > i ? r ? "down" : "right" : r ? "up" : "left", this.value = t.value, v(this, "input"), v(this, "change");
|
|
1898
|
+
}
|
|
1899
|
+
willUpdate(t) {
|
|
1900
|
+
!this.dirty && (t.has("defaultValue") || !this.hasUpdated) && (this.current = this.defaultValue ?? "");
|
|
1901
|
+
}
|
|
1902
|
+
updated() {
|
|
1903
|
+
var h;
|
|
1904
|
+
const t = this.orientation === "vertical" ? "vertical" : "horizontal", e = this.triggers, i = this.panels;
|
|
1905
|
+
let a = this.current;
|
|
1906
|
+
e.some((l) => l.getAttribute("value") === a) || (a = ((h = e.find((l) => !l.hasAttribute("disabled"))) == null ? void 0 : h.getAttribute("value")) ?? ""), this.setData("orientation", t), this.setData("activation-direction", this.direction);
|
|
1907
|
+
const r = (l) => typeof l.sync == "function";
|
|
1908
|
+
for (const l of this.lists) r(l) && l.sync(t, this.direction);
|
|
1909
|
+
let o = null;
|
|
1910
|
+
for (const l of e) {
|
|
1911
|
+
const p = l.getAttribute("value") === a, u = i.find((g) => g.getAttribute("value") === l.getAttribute("value")) ?? null;
|
|
1912
|
+
r(l) && l.sync(p, t, u), p && (o = l);
|
|
1913
|
+
}
|
|
1914
|
+
for (const l of i) {
|
|
1915
|
+
const p = e.find((u) => u.getAttribute("value") === l.getAttribute("value")) ?? null;
|
|
1916
|
+
r(l) && l.sync(l.getAttribute("value") === a, t, p);
|
|
1917
|
+
}
|
|
1918
|
+
for (const l of this.lists) r(l) && l.focusSync(o);
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
Lt.identity = "tabs", Lt.slotName = "tabs", Lt.properties = {
|
|
1922
|
+
defaultValue: { type: String, attribute: "value" },
|
|
1923
|
+
orientation: { type: String, reflect: !0 },
|
|
1924
|
+
current: { state: !0 }
|
|
1925
|
+
};
|
|
1926
|
+
let Rs = Lt;
|
|
1927
|
+
const tt = class tt extends c {
|
|
1928
|
+
constructor() {
|
|
1929
|
+
super(), this.orientation = "horizontal", this.roving = new hr(this, {
|
|
1930
|
+
items: () => {
|
|
1931
|
+
var t;
|
|
1932
|
+
return ((t = this.root) == null ? void 0 : t.triggers.filter((e) => this.contains(e))) ?? [];
|
|
1933
|
+
},
|
|
1934
|
+
orientation: () => this.orientation,
|
|
1935
|
+
loop: () => this.loop !== "false",
|
|
1936
|
+
onNavigate: (t) => {
|
|
1937
|
+
var e;
|
|
1938
|
+
this.activateOnFocus && ((e = this.root) == null || e.select(t));
|
|
1939
|
+
}
|
|
1940
|
+
}), this.variant = "default", this.activateOnFocus = !1, this.loop = null;
|
|
1941
|
+
}
|
|
1942
|
+
get root() {
|
|
1943
|
+
return this.closest(Vi);
|
|
1944
|
+
}
|
|
1945
|
+
connectedCallback() {
|
|
1946
|
+
var t;
|
|
1947
|
+
super.connectedCallback(), (t = this.root) == null || t.requestUpdate();
|
|
1948
|
+
}
|
|
1949
|
+
/** @internal Called by the root. */
|
|
1950
|
+
sync(t, e) {
|
|
1951
|
+
this.orientation = t, this.internals.ariaOrientation = t, this.setData("orientation", t), this.setData("activation-direction", e);
|
|
1952
|
+
}
|
|
1953
|
+
/** @internal Called by the root. */
|
|
1954
|
+
focusSync(t) {
|
|
1955
|
+
var i;
|
|
1956
|
+
const e = (i = this.root) == null ? void 0 : i.triggers.find((a) => a === document.activeElement);
|
|
1957
|
+
this.roving.sync(e ?? t);
|
|
1958
|
+
}
|
|
1959
|
+
willUpdate() {
|
|
1960
|
+
this.setData("variant", this.variant === "line" ? "line" : "default");
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
tt.identity = "tabs-list", tt.slotName = "tabs-list", tt.role = "tablist", tt.properties = {
|
|
1964
|
+
variant: { type: String, reflect: !0 },
|
|
1965
|
+
activateOnFocus: { type: Boolean, attribute: "activate-on-focus" },
|
|
1966
|
+
loop: { type: String }
|
|
1967
|
+
};
|
|
1968
|
+
let Ks = tt;
|
|
1969
|
+
const et = class et extends c {
|
|
1970
|
+
constructor() {
|
|
1971
|
+
super(), this.onClick = () => {
|
|
1972
|
+
var t;
|
|
1973
|
+
this.disabled || (t = this.root) == null || t.select(this);
|
|
1974
|
+
}, this.onKeyDown = (t) => {
|
|
1975
|
+
var e;
|
|
1976
|
+
t.target !== this || this.disabled || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), (e = this.root) == null || e.select(this));
|
|
1977
|
+
}, this.value = "", this.disabled = !1, this.addEventListener("click", this.onClick), this.addEventListener("keydown", this.onKeyDown);
|
|
1978
|
+
}
|
|
1979
|
+
get root() {
|
|
1980
|
+
return this.closest(Vi);
|
|
1981
|
+
}
|
|
1982
|
+
connectedCallback() {
|
|
1983
|
+
var t;
|
|
1984
|
+
super.connectedCallback(), (t = this.root) == null || t.requestUpdate();
|
|
1985
|
+
}
|
|
1986
|
+
/** @internal Called by the root. */
|
|
1987
|
+
sync(t, e, i) {
|
|
1988
|
+
this.internals.ariaSelected = String(t), this.internals.ariaDisabled = this.disabled ? "true" : null, xr(this.internals, this, "ariaControlsElements", "aria-controls", i ? [i] : []), this.setData("active", t), this.setData("disabled", this.disabled), this.setData("orientation", e), this.setState("active", t);
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
et.identity = "tabs-trigger", et.slotName = "tabs-trigger", et.role = "tab", et.properties = {
|
|
1992
|
+
value: { type: String },
|
|
1993
|
+
disabled: { type: Boolean, reflect: !0 }
|
|
1994
|
+
};
|
|
1995
|
+
let Bs = et;
|
|
1996
|
+
const it = class it extends c {
|
|
1997
|
+
constructor() {
|
|
1998
|
+
super(), this.value = "";
|
|
1999
|
+
}
|
|
2000
|
+
connectedCallback() {
|
|
2001
|
+
var t;
|
|
2002
|
+
super.connectedCallback(), (t = this.closest(Vi)) == null || t.requestUpdate();
|
|
2003
|
+
}
|
|
2004
|
+
/** @internal Called by the root. */
|
|
2005
|
+
sync(t, e, i) {
|
|
2006
|
+
xr(this.internals, this, "ariaLabelledByElements", "aria-labelledby", i ? [i] : []), this.hidden = !t, this.setData("hidden", !t), this.setData("orientation", e), this.hasAttribute("tabindex") || (this.tabIndex = 0);
|
|
2007
|
+
}
|
|
2008
|
+
};
|
|
2009
|
+
it.identity = "tabs-content", it.slotName = "tabs-content", it.role = "tabpanel", it.properties = {
|
|
2010
|
+
value: { type: String }
|
|
2011
|
+
};
|
|
2012
|
+
let Ws = it;
|
|
2013
|
+
n("pont2-prim-tabs", Rs);
|
|
2014
|
+
n("pont2-prim-tabs-list", Ks);
|
|
2015
|
+
n("pont2-prim-tabs-trigger", Bs);
|
|
2016
|
+
n("pont2-prim-tabs-content", Ws);
|
|
2017
|
+
const er = { top: "bottom", bottom: "top", left: "right", right: "left" };
|
|
2018
|
+
function Gr(s, t) {
|
|
2019
|
+
return s === "inline-start" ? t === "rtl" ? "right" : "left" : s === "inline-end" ? t === "rtl" ? "left" : "right" : s;
|
|
2020
|
+
}
|
|
2021
|
+
function _r(s, t, e) {
|
|
2022
|
+
return t !== "inline-start" && t !== "inline-end" ? s : s === (e === "rtl" ? "right" : "left") ? "inline-start" : "inline-end";
|
|
2023
|
+
}
|
|
2024
|
+
const gt = (s) => s === "top" || s === "bottom";
|
|
2025
|
+
function Bi(s, t, e, i, a) {
|
|
2026
|
+
switch (s) {
|
|
2027
|
+
case "bottom":
|
|
2028
|
+
return e.y + e.height - a - (t.y + t.height + i);
|
|
2029
|
+
case "top":
|
|
2030
|
+
return t.y - i - (e.y + a);
|
|
2031
|
+
case "right":
|
|
2032
|
+
return e.x + e.width - a - (t.x + t.width + i);
|
|
2033
|
+
case "left":
|
|
2034
|
+
return t.x - i - (e.x + a);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
function tn(s) {
|
|
2038
|
+
const {
|
|
2039
|
+
anchor: t,
|
|
2040
|
+
floating: e,
|
|
2041
|
+
viewport: i,
|
|
2042
|
+
side: a = "bottom",
|
|
2043
|
+
align: r = "center",
|
|
2044
|
+
sideOffset: o = 0,
|
|
2045
|
+
alignOffset: h = 0,
|
|
2046
|
+
collisionPadding: l = 5,
|
|
2047
|
+
flip: p = !0,
|
|
2048
|
+
shift: u = !0,
|
|
2049
|
+
dir: g = "ltr"
|
|
2050
|
+
} = s, b = l;
|
|
2051
|
+
let y = Gr(a, g);
|
|
2052
|
+
if (p) {
|
|
2053
|
+
const O = gt(y) ? e.height : e.width, N = Bi(y, t, i, o, b), ft = Bi(er[y], t, i, o, b);
|
|
2054
|
+
N < O && ft > N && (y = er[y]);
|
|
2055
|
+
}
|
|
2056
|
+
let E = 0, C = 0;
|
|
2057
|
+
switch (y) {
|
|
2058
|
+
case "bottom":
|
|
2059
|
+
C = t.y + t.height + o;
|
|
2060
|
+
break;
|
|
2061
|
+
case "top":
|
|
2062
|
+
C = t.y - e.height - o;
|
|
2063
|
+
break;
|
|
2064
|
+
case "right":
|
|
2065
|
+
E = t.x + t.width + o;
|
|
2066
|
+
break;
|
|
2067
|
+
case "left":
|
|
2068
|
+
E = t.x - e.width - o;
|
|
2069
|
+
break;
|
|
2070
|
+
}
|
|
2071
|
+
if (gt(y)) {
|
|
2072
|
+
const O = g === "rtl" ? t.x + t.width - e.width : t.x, N = g === "rtl" ? t.x : t.x + t.width - e.width, ft = g === "rtl" ? -1 : 1;
|
|
2073
|
+
r === "start" ? E = O + ft * h : r === "end" ? E = N - ft * h : E = t.x + (t.width - e.width) / 2 + ft * h;
|
|
2074
|
+
} else
|
|
2075
|
+
r === "start" ? C = t.y + h : r === "end" ? C = t.y + t.height - e.height - h : C = t.y + (t.height - e.height) / 2 + h;
|
|
2076
|
+
if (u)
|
|
2077
|
+
if (gt(y)) {
|
|
2078
|
+
const O = i.x + b, N = i.x + i.width - b - e.width;
|
|
2079
|
+
E = N < O ? O : Math.min(Math.max(E, O), N);
|
|
2080
|
+
} else {
|
|
2081
|
+
const O = i.y + b, N = i.y + i.height - b - e.height;
|
|
2082
|
+
C = N < O ? O : Math.min(Math.max(C, O), N);
|
|
2083
|
+
}
|
|
2084
|
+
const ja = Math.max(0, Bi(y, t, i, o, b)), $r = gt(y) ? ja : Math.max(0, i.height - 2 * b), Ar = gt(y) ? Math.max(0, i.width - 2 * b) : ja, Ma = t.x + t.width / 2 - E, Xa = t.y + t.height / 2 - C, Dr = y === "bottom" ? `${q(Ma)}px ${-o}px` : y === "top" ? `${q(Ma)}px ${e.height + o}px` : y === "right" ? `${-o}px ${q(Xa)}px` : `${e.width + o}px ${q(Xa)}px`;
|
|
2085
|
+
return {
|
|
2086
|
+
x: q(E),
|
|
2087
|
+
y: q(C),
|
|
2088
|
+
side: _r(y, a, g),
|
|
2089
|
+
physicalSide: y,
|
|
2090
|
+
align: r,
|
|
2091
|
+
availableWidth: q(Ar),
|
|
2092
|
+
availableHeight: q($r),
|
|
2093
|
+
transformOrigin: Dr
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2096
|
+
function en(s) {
|
|
2097
|
+
const t = s.collisionPadding ?? 5, { anchor: e, floating: i, viewport: a } = s, r = e.y + e.height / 2 - (s.itemTop + s.itemHeight / 2), o = a.y + t, h = a.y + a.height - t - i.height;
|
|
2098
|
+
return h < o || r < o || r > h ? null : { x: q(e.x), y: q(r) };
|
|
2099
|
+
}
|
|
2100
|
+
const q = (s) => Math.round(s * 100) / 100;
|
|
2101
|
+
class sn {
|
|
2102
|
+
constructor(t, e, i) {
|
|
2103
|
+
this.floating = t, this.anchor = e, this.options = i, this.frame = 0, this.running = !1, this.observedAnchor = null, this.schedule = () => {
|
|
2104
|
+
this.running && (cancelAnimationFrame(this.frame), this.frame = requestAnimationFrame(() => this.update()));
|
|
2105
|
+
};
|
|
2106
|
+
}
|
|
2107
|
+
start() {
|
|
2108
|
+
if (this.running) {
|
|
2109
|
+
this.update();
|
|
2110
|
+
return;
|
|
2111
|
+
}
|
|
2112
|
+
this.running = !0, window.addEventListener("scroll", this.schedule, { capture: !0, passive: !0 }), window.addEventListener("resize", this.schedule, { passive: !0 }), this.ro = new ResizeObserver(this.schedule), this.ro.observe(this.floating), this.observeAnchor(), this.update();
|
|
2113
|
+
}
|
|
2114
|
+
stop() {
|
|
2115
|
+
var t;
|
|
2116
|
+
this.running && (this.running = !1, cancelAnimationFrame(this.frame), window.removeEventListener("scroll", this.schedule, { capture: !0 }), window.removeEventListener("resize", this.schedule), (t = this.ro) == null || t.disconnect(), this.observedAnchor = null);
|
|
2117
|
+
}
|
|
2118
|
+
observeAnchor() {
|
|
2119
|
+
var e;
|
|
2120
|
+
const t = this.anchor();
|
|
2121
|
+
t && t !== this.observedAnchor && ((e = this.ro) == null || e.observe(t), this.observedAnchor = t);
|
|
2122
|
+
}
|
|
2123
|
+
/** Measure and write synchronously (also called right after showPopover, before first paint). */
|
|
2124
|
+
update() {
|
|
2125
|
+
const t = this.anchor();
|
|
2126
|
+
if (!t || !this.floating.isConnected) return;
|
|
2127
|
+
this.observeAnchor();
|
|
2128
|
+
const e = t.getBoundingClientRect(), i = { x: e.left, y: e.top, width: e.width, height: e.height }, a = { width: this.floating.offsetWidth, height: this.floating.offsetHeight }, r = {
|
|
2129
|
+
x: 0,
|
|
2130
|
+
y: 0,
|
|
2131
|
+
width: document.documentElement.clientWidth,
|
|
2132
|
+
height: window.innerHeight
|
|
2133
|
+
}, o = this.options(), h = this.floating.style, l = (u, g) => {
|
|
2134
|
+
h.setProperty(`--pont2-${u}`, g), h.setProperty(`--${u}`, g);
|
|
2135
|
+
};
|
|
2136
|
+
if (l("anchor-width", `${e.width}px`), l("anchor-height", `${e.height}px`), o.alignItem) {
|
|
2137
|
+
const u = this.floating.getBoundingClientRect(), g = o.alignItem.getBoundingClientRect(), b = en({
|
|
2138
|
+
anchor: i,
|
|
2139
|
+
floating: a,
|
|
2140
|
+
viewport: r,
|
|
2141
|
+
itemTop: g.top - u.top,
|
|
2142
|
+
itemHeight: g.height,
|
|
2143
|
+
collisionPadding: o.collisionPadding
|
|
2144
|
+
});
|
|
2145
|
+
if (b) {
|
|
2146
|
+
h.setProperty("--pont2-popup-x", `${b.x}px`), h.setProperty("--pont2-popup-y", `${b.y}px`), l("available-height", `${r.height - 2 * o.collisionPadding}px`), l("available-width", `${r.width - 2 * o.collisionPadding}px`), l("transform-origin", "center"), this.floating.setAttribute("data-side", "none"), this.floating.setAttribute("data-align", "center");
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
const p = tn({
|
|
2151
|
+
anchor: i,
|
|
2152
|
+
floating: a,
|
|
2153
|
+
viewport: r,
|
|
2154
|
+
side: o.side,
|
|
2155
|
+
align: o.align,
|
|
2156
|
+
sideOffset: o.sideOffset,
|
|
2157
|
+
alignOffset: o.alignOffset,
|
|
2158
|
+
collisionPadding: o.collisionPadding,
|
|
2159
|
+
dir: dt(t)
|
|
2160
|
+
});
|
|
2161
|
+
h.setProperty("--pont2-popup-x", `${p.x}px`), h.setProperty("--pont2-popup-y", `${p.y}px`), l("available-width", `${p.availableWidth}px`), l("available-height", `${p.availableHeight}px`), l("transform-origin", p.transformOrigin), h.setProperty("--pont2-arrow-x", `${e.left + e.width / 2 - p.x}px`), h.setProperty("--pont2-arrow-y", `${e.top + e.height / 2 - p.y}px`), this.floating.getAttribute("data-side") !== p.side && this.floating.setAttribute("data-side", p.side), this.floating.getAttribute("data-align") !== p.align && this.floating.setAttribute("data-align", p.align);
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
const _t = (s) => s.hasAttribute("data-disabled") || s.getAttribute("aria-disabled") === "true", bt = (s) => !s.hidden && !s.closest("[hidden]");
|
|
2165
|
+
function Jt(s, t, e, { loop: i = !0, isDisabled: a = _t } = {}) {
|
|
2166
|
+
const r = s.length;
|
|
2167
|
+
if (!r) return -1;
|
|
2168
|
+
const o = (l) => !a(s[l]);
|
|
2169
|
+
if (e === "first") {
|
|
2170
|
+
for (let l = 0; l < r; l++) if (o(l)) return l;
|
|
2171
|
+
return -1;
|
|
2172
|
+
}
|
|
2173
|
+
if (e === "last") {
|
|
2174
|
+
for (let l = r - 1; l >= 0; l--) if (o(l)) return l;
|
|
2175
|
+
return -1;
|
|
2176
|
+
}
|
|
2177
|
+
const h = e === "next" ? 1 : -1;
|
|
2178
|
+
if (t < 0) return Jt(s, -1, h === 1 ? "first" : "last", { loop: i, isDisabled: a });
|
|
2179
|
+
for (let l = 1; l <= r; l++) {
|
|
2180
|
+
let p = t + h * l;
|
|
2181
|
+
if (i) p = (p + r) % r;
|
|
2182
|
+
else if (p < 0 || p >= r) return t;
|
|
2183
|
+
if (o(p)) return p;
|
|
2184
|
+
}
|
|
2185
|
+
return t;
|
|
2186
|
+
}
|
|
2187
|
+
function Sa(s) {
|
|
2188
|
+
switch (s) {
|
|
2189
|
+
case "ArrowDown":
|
|
2190
|
+
return "next";
|
|
2191
|
+
case "ArrowUp":
|
|
2192
|
+
return "prev";
|
|
2193
|
+
case "Home":
|
|
2194
|
+
return "first";
|
|
2195
|
+
case "End":
|
|
2196
|
+
return "last";
|
|
2197
|
+
default:
|
|
2198
|
+
return null;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
class ut {
|
|
2202
|
+
constructor(t = 500) {
|
|
2203
|
+
this.timeout = t, this.buffer = "";
|
|
2204
|
+
}
|
|
2205
|
+
/** Whether a keyboard event is a typeahead character. */
|
|
2206
|
+
static isChar(t) {
|
|
2207
|
+
return t.key.length === 1 && !t.ctrlKey && !t.metaKey && !t.altKey && t.key !== " ";
|
|
2208
|
+
}
|
|
2209
|
+
get active() {
|
|
2210
|
+
return this.buffer.length > 0;
|
|
2211
|
+
}
|
|
2212
|
+
match(t, e, i, a = (r) => r.textContent ?? "") {
|
|
2213
|
+
clearTimeout(this.timer), this.timer = setTimeout(() => this.buffer = "", this.timeout), this.buffer += t.toLowerCase();
|
|
2214
|
+
const r = this.buffer.split("").every((p) => p === this.buffer[0]), o = r ? this.buffer[0] : this.buffer, h = e.length, l = r || i < 0 ? i + 1 : i;
|
|
2215
|
+
for (let p = 0; p < h; p++) {
|
|
2216
|
+
const u = (l + p + h) % h, g = e[u];
|
|
2217
|
+
if (!_t(g) && a(g).trim().toLowerCase().startsWith(o))
|
|
2218
|
+
return u;
|
|
2219
|
+
}
|
|
2220
|
+
return -1;
|
|
2221
|
+
}
|
|
2222
|
+
reset() {
|
|
2223
|
+
clearTimeout(this.timer), this.buffer = "";
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
const U = [];
|
|
2227
|
+
let ir = !1;
|
|
2228
|
+
function an() {
|
|
2229
|
+
ir || (ir = !0, document.addEventListener("keydown", (s) => {
|
|
2230
|
+
if (s.key !== "Escape" || s.defaultPrevented) return;
|
|
2231
|
+
const t = U.at(-1);
|
|
2232
|
+
t && (s.preventDefault(), s.stopPropagation(), t.requestClose("escape-key"));
|
|
2233
|
+
}), document.addEventListener(
|
|
2234
|
+
"pointerdown",
|
|
2235
|
+
(s) => {
|
|
2236
|
+
const t = s.composedPath();
|
|
2237
|
+
for (const e of [...U].reverse()) {
|
|
2238
|
+
if (e.containsPath(t)) break;
|
|
2239
|
+
e.requestClose("outside-press");
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
!0
|
|
2243
|
+
));
|
|
2244
|
+
}
|
|
2245
|
+
const fi = class fi extends c {
|
|
2246
|
+
constructor() {
|
|
2247
|
+
super(), this.insideElements = () => [], this.anchorElement = () => null, this.positioner = new sn(
|
|
2248
|
+
this,
|
|
2249
|
+
() => this.anchorElement(),
|
|
2250
|
+
() => ({
|
|
2251
|
+
side: this.side,
|
|
2252
|
+
align: this.align,
|
|
2253
|
+
sideOffset: this.sideOffset,
|
|
2254
|
+
alignOffset: this.alignOffset,
|
|
2255
|
+
collisionPadding: this.collisionPadding,
|
|
2256
|
+
alignItem: this.alignItem()
|
|
2257
|
+
})
|
|
2258
|
+
), this.generation = 0, this.side = "bottom", this.align = "center", this.sideOffset = 0, this.alignOffset = 0, this.collisionPadding = 5;
|
|
2259
|
+
}
|
|
2260
|
+
connectedCallback() {
|
|
2261
|
+
super.connectedCallback(), an(), this.hasAttribute("popover") || this.setAttribute("popover", "manual"), this.isOpen || this.setData("closed", !0);
|
|
2262
|
+
}
|
|
2263
|
+
disconnectedCallback() {
|
|
2264
|
+
super.disconnectedCallback(), this.positioner.stop();
|
|
2265
|
+
const t = U.indexOf(this);
|
|
2266
|
+
t >= 0 && U.splice(t, 1);
|
|
2267
|
+
}
|
|
2268
|
+
get isOpen() {
|
|
2269
|
+
return this.hasAttribute("data-open");
|
|
2270
|
+
}
|
|
2271
|
+
/** Select overrides this to lay the selected item over the trigger. */
|
|
2272
|
+
alignItem() {
|
|
2273
|
+
return null;
|
|
2274
|
+
}
|
|
2275
|
+
/** True if the event path is inside this popup or one of its inside elements. */
|
|
2276
|
+
containsPath(t) {
|
|
2277
|
+
return t.includes(this) ? !0 : this.insideElements().some((e) => e && t.includes(e));
|
|
2278
|
+
}
|
|
2279
|
+
requestClose(t) {
|
|
2280
|
+
var e;
|
|
2281
|
+
(e = this.onRequestClose) == null || e.call(this, t);
|
|
2282
|
+
}
|
|
2283
|
+
/** Re-measure (e.g. after the content changed size). */
|
|
2284
|
+
reposition() {
|
|
2285
|
+
this.isOpen && this.positioner.update();
|
|
2286
|
+
}
|
|
2287
|
+
show() {
|
|
2288
|
+
if (this.generation++, this.closing = void 0, this.setData("ending-style", !1), this.setData("closed", !1), this.setData("open", !0), !this.matches(":popover-open")) {
|
|
2289
|
+
this.setData("starting-style", !0);
|
|
2290
|
+
try {
|
|
2291
|
+
this.showPopover();
|
|
2292
|
+
} catch {
|
|
2293
|
+
}
|
|
2294
|
+
requestAnimationFrame(() => this.setData("starting-style", !1));
|
|
2295
|
+
}
|
|
2296
|
+
U.includes(this) || U.push(this), this.positioner.start();
|
|
2297
|
+
}
|
|
2298
|
+
/** Starts the close; resolves once the exit animation finished and the popover is hidden. */
|
|
2299
|
+
hide() {
|
|
2300
|
+
if (!this.isOpen && !this.closing)
|
|
2301
|
+
return this.setData("closed", !0), Promise.resolve();
|
|
2302
|
+
if (this.closing) return this.closing;
|
|
2303
|
+
const t = ++this.generation;
|
|
2304
|
+
this.setData("open", !1), this.setData("closed", !0), this.setData("ending-style", !0);
|
|
2305
|
+
const e = U.indexOf(this);
|
|
2306
|
+
return e >= 0 && U.splice(e, 1), this.closing = (async () => {
|
|
2307
|
+
await new Promise((a) => requestAnimationFrame(() => a(null)));
|
|
2308
|
+
const i = this.getAnimations().filter((a) => a.playState !== "finished");
|
|
2309
|
+
if (await Promise.allSettled(i.map((a) => a.finished)), t === this.generation) {
|
|
2310
|
+
this.setData("ending-style", !1), this.positioner.stop();
|
|
2311
|
+
try {
|
|
2312
|
+
this.hidePopover();
|
|
2313
|
+
} catch {
|
|
2314
|
+
}
|
|
2315
|
+
this.closing = void 0;
|
|
2316
|
+
}
|
|
2317
|
+
})(), this.closing;
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
fi.identity = "popup", fi.properties = {
|
|
2321
|
+
side: { type: String, reflect: !1 },
|
|
2322
|
+
align: { type: String, reflect: !1 },
|
|
2323
|
+
sideOffset: { type: Number, attribute: "side-offset" },
|
|
2324
|
+
alignOffset: { type: Number, attribute: "align-offset" },
|
|
2325
|
+
collisionPadding: { type: Number, attribute: "collision-padding" }
|
|
2326
|
+
};
|
|
2327
|
+
let F = fi;
|
|
2328
|
+
const Un = () => U;
|
|
2329
|
+
function D(s, t, e) {
|
|
2330
|
+
var i;
|
|
2331
|
+
for (const a of Array.from(s.querySelectorAll(t)))
|
|
2332
|
+
if (((i = a.parentElement) == null ? void 0 : i.closest(e)) === s) return a;
|
|
2333
|
+
return null;
|
|
2334
|
+
}
|
|
2335
|
+
function zn(s, t, e) {
|
|
2336
|
+
return Array.from(s.querySelectorAll(t)).filter(
|
|
2337
|
+
(i) => {
|
|
2338
|
+
var a;
|
|
2339
|
+
return ((a = i.parentElement) == null ? void 0 : a.closest(e)) === s;
|
|
2340
|
+
}
|
|
2341
|
+
);
|
|
2342
|
+
}
|
|
2343
|
+
const mi = class mi extends c {
|
|
2344
|
+
constructor() {
|
|
2345
|
+
super(), this.lastReason = "imperative", this.openedByKeyboard = !1, this.open = !1, this.disabled = !1;
|
|
2346
|
+
}
|
|
2347
|
+
/**
|
|
2348
|
+
* Request an open-state change, as the user did. Returns false if a
|
|
2349
|
+
* `pont2-open-change` listener cancelled it.
|
|
2350
|
+
*/
|
|
2351
|
+
setOpen(t, e, i = {}) {
|
|
2352
|
+
return t === this.open ? !0 : t && this.disabled || !cr(this, "pont2-open-change", { open: t, reason: e }, !0) ? !1 : (this.lastReason = e, this.openedByKeyboard = !!i.keyboard, this.open = t, !0);
|
|
2353
|
+
}
|
|
2354
|
+
toggle(t = "trigger-press", e = {}) {
|
|
2355
|
+
this.setOpen(!this.open, t, e);
|
|
2356
|
+
}
|
|
2357
|
+
connectedCallback() {
|
|
2358
|
+
super.connectedCallback(), queueMicrotask(() => this.wire());
|
|
2359
|
+
}
|
|
2360
|
+
/** Connect trigger and content (idempotent). Call when parts change. */
|
|
2361
|
+
wire() {
|
|
2362
|
+
const t = this.contentElement, e = this.triggerElement;
|
|
2363
|
+
t && ($(t, "popup"), t.onRequestClose = (i) => this.setOpen(!1, i), t.anchorElement = () => this.anchorElement(), t.insideElements = () => [this.triggerElement, ...this.extraInsideElements()]), e && (e.setAttribute("aria-haspopup", this.popupKind), e.setAttribute("aria-expanded", String(this.open)), t && e.setAttribute("aria-controls", t.id), e.toggleAttribute("data-popup-open", this.open), e.toggleAttribute("data-disabled", this.disabled));
|
|
2364
|
+
}
|
|
2365
|
+
/** What the content positions against. Defaults to the trigger. */
|
|
2366
|
+
anchorElement() {
|
|
2367
|
+
return this.triggerElement;
|
|
2368
|
+
}
|
|
2369
|
+
/** Further elements whose presses are not "outside" (e.g. a combobox input group). */
|
|
2370
|
+
extraInsideElements() {
|
|
2371
|
+
return [];
|
|
2372
|
+
}
|
|
2373
|
+
updated(t) {
|
|
2374
|
+
if (super.updated(t), this.wire(), !t.has("open")) return;
|
|
2375
|
+
const e = this.contentElement;
|
|
2376
|
+
if (e) {
|
|
2377
|
+
if (this.open)
|
|
2378
|
+
e.show(), this.afterOpen();
|
|
2379
|
+
else if (t.get("open") !== void 0) {
|
|
2380
|
+
const i = e.contains(document.activeElement) || document.activeElement === document.body;
|
|
2381
|
+
e.hide(), this.afterClose(i);
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
/** Focus management after opening. Default: focus the popup itself. */
|
|
2386
|
+
afterOpen() {
|
|
2387
|
+
}
|
|
2388
|
+
/** Focus management after closing. Default: return focus to the trigger if it was inside. */
|
|
2389
|
+
afterClose(t) {
|
|
2390
|
+
var e;
|
|
2391
|
+
t && this.lastReason !== "outside-press" && ((e = this.triggerElement) == null || e.focus({ preventScroll: !0 }));
|
|
2392
|
+
}
|
|
2393
|
+
};
|
|
2394
|
+
mi.identity = "popup-root", mi.properties = {
|
|
2395
|
+
open: { type: Boolean, reflect: !0 },
|
|
2396
|
+
disabled: { type: Boolean, reflect: !0 }
|
|
2397
|
+
};
|
|
2398
|
+
let V = mi;
|
|
2399
|
+
const Ct = class Ct extends S {
|
|
2400
|
+
get root() {
|
|
2401
|
+
return this.closest(this.constructor.rootTag);
|
|
2402
|
+
}
|
|
2403
|
+
constructor() {
|
|
2404
|
+
super(), this.addEventListener("click", (t) => this.onClick(t)), this.addEventListener("keydown", (t) => this.onKeyDown(t));
|
|
2405
|
+
}
|
|
2406
|
+
apply(t) {
|
|
2407
|
+
var i;
|
|
2408
|
+
const e = this.constructor.controlSlot;
|
|
2409
|
+
(!t.hasAttribute("data-slot") || t.getAttribute("data-slot") === "button") && t.setAttribute("data-slot", e), t.hasAttribute("type") || (t.type = "button"), (i = this.root) == null || i.wire();
|
|
2410
|
+
}
|
|
2411
|
+
onClick(t) {
|
|
2412
|
+
var i;
|
|
2413
|
+
const e = this.control;
|
|
2414
|
+
!e || !(e === t.target || e.contains(t.target)) || e.disabled || (i = this.root) == null || i.toggle("trigger-press", { keyboard: t.detail === 0 });
|
|
2415
|
+
}
|
|
2416
|
+
onKeyDown(t) {
|
|
2417
|
+
}
|
|
2418
|
+
};
|
|
2419
|
+
Ct.nativeSelector = "button", Ct.rootTag = "", Ct.controlSlot = "trigger";
|
|
2420
|
+
let It = Ct;
|
|
2421
|
+
const Ts = f("popover"), rn = 'button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Ta = class Ta extends V {
|
|
2422
|
+
get triggerElement() {
|
|
2423
|
+
var t;
|
|
2424
|
+
return ((t = D(this, Xt("popover-trigger"), Ts)) == null ? void 0 : t.control) ?? null;
|
|
2425
|
+
}
|
|
2426
|
+
get contentElement() {
|
|
2427
|
+
return D(this, f("popover-content"), Ts);
|
|
2428
|
+
}
|
|
2429
|
+
get popupKind() {
|
|
2430
|
+
return "dialog";
|
|
2431
|
+
}
|
|
2432
|
+
afterOpen() {
|
|
2433
|
+
const t = this.contentElement;
|
|
2434
|
+
if (!t) return;
|
|
2435
|
+
(t.querySelector(rn) ?? t).focus({ preventScroll: !0 });
|
|
2436
|
+
}
|
|
2437
|
+
};
|
|
2438
|
+
Ta.identity = "popover";
|
|
2439
|
+
let Fs = Ta;
|
|
2440
|
+
const gi = class gi extends It {
|
|
2441
|
+
};
|
|
2442
|
+
gi.rootTag = Ts, gi.controlSlot = "popover-trigger";
|
|
2443
|
+
let Ps = gi;
|
|
2444
|
+
const Ut = class Ut extends F {
|
|
2445
|
+
constructor() {
|
|
2446
|
+
super(), this.onFocusOut = (t) => {
|
|
2447
|
+
const e = t.relatedTarget;
|
|
2448
|
+
!e || !this.isOpen || this.contains(e) || this.insideElements().some((i) => i == null ? void 0 : i.contains(e)) || this.requestClose("focus-out");
|
|
2449
|
+
}, this.side = "bottom", this.align = "center", this.sideOffset = 4, this.addEventListener("focusout", this.onFocusOut);
|
|
2450
|
+
}
|
|
2451
|
+
show() {
|
|
2452
|
+
this.tabIndex = -1;
|
|
2453
|
+
const t = this.querySelector(`${f("popover-title")}, [data-slot=popover-title]`), e = this.querySelector(`${f("popover-description")}, [data-slot=popover-description]`);
|
|
2454
|
+
t && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-labelledby", $(t, "popover-title")), e && !this.hasAttribute("aria-describedby") && this.setAttribute("aria-describedby", $(e, "popover-desc")), super.show();
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
Ut.identity = "popover-content", Ut.slotName = "popover-content", Ut.role = "dialog";
|
|
2458
|
+
let Hs = Ut;
|
|
2459
|
+
const bi = class bi extends c {
|
|
2460
|
+
};
|
|
2461
|
+
bi.identity = "popover-header", bi.slotName = "popover-header";
|
|
2462
|
+
let js = bi;
|
|
2463
|
+
const zt = class zt extends c {
|
|
2464
|
+
connectedCallback() {
|
|
2465
|
+
super.connectedCallback(), this.internals.ariaLevel || (this.internals.ariaLevel = "2");
|
|
2466
|
+
}
|
|
2467
|
+
};
|
|
2468
|
+
zt.identity = "popover-title", zt.slotName = "popover-title", zt.role = "heading";
|
|
2469
|
+
let Ms = zt;
|
|
2470
|
+
const yi = class yi extends c {
|
|
2471
|
+
};
|
|
2472
|
+
yi.identity = "popover-description", yi.slotName = "popover-description";
|
|
2473
|
+
let Xs = yi;
|
|
2474
|
+
n("pont2-prim-popover", Fs);
|
|
2475
|
+
n("pont2-prim-popover-trigger", Ps);
|
|
2476
|
+
n("pont2-prim-popover-content", Hs);
|
|
2477
|
+
n("pont2-prim-popover-header", js);
|
|
2478
|
+
n("pont2-prim-popover-title", Ms);
|
|
2479
|
+
n("pont2-prim-popover-description", Xs);
|
|
2480
|
+
const $e = `${f("dropdown-menu")}, ${f("dropdown-menu-sub")}`, P = "[data-pont2-dropdown-menu-content]", nn = "[data-pont2-menu-item]", on = { fromAttribute: (s) => s !== "false", toAttribute: (s) => String(s) }, Fa = class Fa extends V {
|
|
2481
|
+
constructor() {
|
|
2482
|
+
super(...arguments), this.focusOnOpen = "popup";
|
|
2483
|
+
}
|
|
2484
|
+
get triggerElement() {
|
|
2485
|
+
var t;
|
|
2486
|
+
return ((t = D(this, Xt("dropdown-menu-trigger"), $e)) == null ? void 0 : t.control) ?? null;
|
|
2487
|
+
}
|
|
2488
|
+
get contentElement() {
|
|
2489
|
+
return D(this, f("dropdown-menu-content"), $e);
|
|
2490
|
+
}
|
|
2491
|
+
get popupKind() {
|
|
2492
|
+
return "menu";
|
|
2493
|
+
}
|
|
2494
|
+
openWith(t, e = "trigger-press") {
|
|
2495
|
+
var i;
|
|
2496
|
+
this.focusOnOpen = t, this.open ? (i = this.contentElement) == null || i.focusTarget(t) : this.setOpen(!0, e, { keyboard: t !== "popup" });
|
|
2497
|
+
}
|
|
2498
|
+
toggle(t = "trigger-press", e = {}) {
|
|
2499
|
+
this.focusOnOpen = e.keyboard ? "first" : "popup", super.toggle(t, e);
|
|
2500
|
+
}
|
|
2501
|
+
afterOpen() {
|
|
2502
|
+
var t;
|
|
2503
|
+
(t = this.contentElement) == null || t.focusTarget(this.focusOnOpen);
|
|
2504
|
+
}
|
|
2505
|
+
};
|
|
2506
|
+
Fa.identity = "dropdown-menu";
|
|
2507
|
+
let Ys = Fa;
|
|
2508
|
+
const Pa = class Pa extends V {
|
|
2509
|
+
constructor() {
|
|
2510
|
+
super(...arguments), this.focusOnOpen = "popup";
|
|
2511
|
+
}
|
|
2512
|
+
get triggerElement() {
|
|
2513
|
+
return D(this, f("dropdown-menu-sub-trigger"), $e);
|
|
2514
|
+
}
|
|
2515
|
+
get contentElement() {
|
|
2516
|
+
return D(this, f("dropdown-menu-sub-content"), $e);
|
|
2517
|
+
}
|
|
2518
|
+
get popupKind() {
|
|
2519
|
+
return "menu";
|
|
2520
|
+
}
|
|
2521
|
+
openWith(t, e) {
|
|
2522
|
+
var i;
|
|
2523
|
+
this.focusOnOpen = t, this.open ? (i = this.contentElement) == null || i.focusTarget(t) : this.setOpen(!0, e, { keyboard: t !== "popup" });
|
|
2524
|
+
}
|
|
2525
|
+
afterOpen() {
|
|
2526
|
+
var t;
|
|
2527
|
+
this.focusOnOpen !== "popup" && ((t = this.contentElement) == null || t.focusTarget(this.focusOnOpen));
|
|
2528
|
+
}
|
|
2529
|
+
};
|
|
2530
|
+
Pa.identity = "dropdown-menu-sub";
|
|
2531
|
+
let Qs = Pa;
|
|
2532
|
+
const vi = class vi extends It {
|
|
2533
|
+
onKeyDown(t) {
|
|
2534
|
+
const e = this.root;
|
|
2535
|
+
!e || !this.control || t.target !== this.control || (t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), e.openWith(t.key === "ArrowDown" ? "first" : "last", "list-navigation"));
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
vi.rootTag = f("dropdown-menu"), vi.controlSlot = "dropdown-menu-trigger";
|
|
2539
|
+
let Zs = vi;
|
|
2540
|
+
const Vt = class Vt extends F {
|
|
2541
|
+
constructor() {
|
|
2542
|
+
super(), this.typeahead = new ut(), this.subCloseTimer = 0, this.onPointerLeave = () => {
|
|
2543
|
+
if (this.contains(document.activeElement) && document.activeElement !== this) {
|
|
2544
|
+
const t = document.activeElement;
|
|
2545
|
+
t.closest(P) === this && !(t instanceof Gt && t.isSubOpen) && this.focus({ preventScroll: !0 });
|
|
2546
|
+
}
|
|
2547
|
+
}, this.onKeyDown = (t) => {
|
|
2548
|
+
var l, p;
|
|
2549
|
+
if (t.target.closest(P) !== this || t.defaultPrevented) return;
|
|
2550
|
+
const i = this.items, a = i.indexOf(t.target), r = dt(this) === "rtl";
|
|
2551
|
+
if (t.key === "Tab") {
|
|
2552
|
+
const u = this.closest(f("dropdown-menu"));
|
|
2553
|
+
u == null || u.setOpen(!1, "focus-out"), (l = u == null ? void 0 : u.triggerElement) == null || l.focus();
|
|
2554
|
+
return;
|
|
2555
|
+
}
|
|
2556
|
+
const o = r ? "ArrowRight" : "ArrowLeft";
|
|
2557
|
+
if (t.key === o && this instanceof De) {
|
|
2558
|
+
t.preventDefault();
|
|
2559
|
+
const u = this.closest(f("dropdown-menu-sub"));
|
|
2560
|
+
u == null || u.setOpen(!1, "list-navigation"), (p = u == null ? void 0 : u.triggerElement) == null || p.focus();
|
|
2561
|
+
return;
|
|
2562
|
+
}
|
|
2563
|
+
const h = Sa(t.key);
|
|
2564
|
+
if (h) {
|
|
2565
|
+
t.preventDefault();
|
|
2566
|
+
const u = Jt(i, a, h);
|
|
2567
|
+
u >= 0 && i[u].focus();
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
2570
|
+
if ((t.key === "Enter" || t.key === " ") && a >= 0) {
|
|
2571
|
+
if (t.preventDefault(), t.key === " " && this.typeahead.active) return;
|
|
2572
|
+
i[a].click();
|
|
2573
|
+
return;
|
|
2574
|
+
}
|
|
2575
|
+
if (ut.isChar(t)) {
|
|
2576
|
+
const u = this.typeahead.match(t.key, i, a, (g) => g.label);
|
|
2577
|
+
u >= 0 && i[u].focus();
|
|
2578
|
+
}
|
|
2579
|
+
}, this.side = "bottom", this.align = "start", this.sideOffset = 4, this.addEventListener("keydown", this.onKeyDown), this.addEventListener("pointerleave", this.onPointerLeave), this.addEventListener("pointerenter", () => this.cancelSubClose());
|
|
2580
|
+
}
|
|
2581
|
+
/** This menu's own items (not its submenus'), visible, in order. */
|
|
2582
|
+
get items() {
|
|
2583
|
+
return Array.from(this.querySelectorAll(nn)).filter(
|
|
2584
|
+
(t) => t.closest(P) === this && bt(t)
|
|
2585
|
+
);
|
|
2586
|
+
}
|
|
2587
|
+
connectedCallback() {
|
|
2588
|
+
super.connectedCallback(), this.internals.ariaOrientation = "vertical";
|
|
2589
|
+
}
|
|
2590
|
+
show() {
|
|
2591
|
+
this.tabIndex = -1, super.show();
|
|
2592
|
+
}
|
|
2593
|
+
hide() {
|
|
2594
|
+
return this.closeSubs(), super.hide();
|
|
2595
|
+
}
|
|
2596
|
+
focusTarget(t) {
|
|
2597
|
+
const e = this.items, i = t === "popup" ? -1 : Jt(e, -1, t);
|
|
2598
|
+
(i >= 0 ? e[i] : this).focus({ preventScroll: i < 0 });
|
|
2599
|
+
}
|
|
2600
|
+
/** Close open submenus of this menu, optionally keeping one. */
|
|
2601
|
+
closeSubs(t) {
|
|
2602
|
+
var e;
|
|
2603
|
+
for (const i of Array.from(this.querySelectorAll(f("dropdown-menu-sub"))))
|
|
2604
|
+
i === t || ((e = i.parentElement) == null ? void 0 : e.closest(P)) !== this || i.open && (i.open = !1);
|
|
2605
|
+
}
|
|
2606
|
+
/** Called when the pointer rests on one of this menu's items. */
|
|
2607
|
+
scheduleSubClose(t) {
|
|
2608
|
+
this.cancelSubClose(), this.subCloseTimer = window.setTimeout(() => this.closeSubs(t), 120);
|
|
2609
|
+
}
|
|
2610
|
+
cancelSubClose() {
|
|
2611
|
+
clearTimeout(this.subCloseTimer);
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
Vt.identity = "dropdown-menu-content", Vt.slotName = "dropdown-menu-content", Vt.role = "menu";
|
|
2615
|
+
let Ae = Vt;
|
|
2616
|
+
const ki = class ki extends Ae {
|
|
2617
|
+
constructor() {
|
|
2618
|
+
super(), this.side = "inline-end", this.align = "start", this.sideOffset = 0, this.alignOffset = -3, this.addEventListener(
|
|
2619
|
+
"pointerenter",
|
|
2620
|
+
() => {
|
|
2621
|
+
var t, e;
|
|
2622
|
+
return (e = (t = this.parentElement) == null ? void 0 : t.closest(P)) == null ? void 0 : e.cancelSubClose();
|
|
2623
|
+
}
|
|
2624
|
+
);
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
ki.identity = "dropdown-menu-sub-content", ki.slotName = "dropdown-menu-sub-content";
|
|
2628
|
+
let De = ki;
|
|
2629
|
+
const Rt = class Rt extends c {
|
|
2630
|
+
constructor() {
|
|
2631
|
+
super(), this.onPointerMove = (t) => {
|
|
2632
|
+
var e;
|
|
2633
|
+
t.pointerType === "touch" || this.disabled || (document.activeElement !== this && this.focus({ preventScroll: !0 }), (e = this.menu) == null || e.scheduleSubClose(this instanceof Gt ? this.parentElement : null));
|
|
2634
|
+
}, this.onClick = (t) => {
|
|
2635
|
+
var e;
|
|
2636
|
+
if (this.disabled || _t(this)) {
|
|
2637
|
+
t.preventDefault(), t.stopImmediatePropagation();
|
|
2638
|
+
return;
|
|
2639
|
+
}
|
|
2640
|
+
this.activate(), this.closeOnClick && ((e = this.closest(f("dropdown-menu"))) == null || e.setOpen(!1, "item-press"));
|
|
2641
|
+
}, this.disabled = !1, this.inset = !1, this.closeOnClick = !0, this.addEventListener("focus", () => this.setData("highlighted", !0)), this.addEventListener("blur", () => this.setData("highlighted", !1)), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("click", this.onClick);
|
|
2642
|
+
}
|
|
2643
|
+
/** Text used by typeahead (Base UI `label`): the `label` attribute, else the text content. */
|
|
2644
|
+
get label() {
|
|
2645
|
+
return this.getAttribute("label") ?? (this.textContent ?? "").trim();
|
|
2646
|
+
}
|
|
2647
|
+
connectedCallback() {
|
|
2648
|
+
super.connectedCallback(), this.hasAttribute("tabindex") || (this.tabIndex = -1);
|
|
2649
|
+
}
|
|
2650
|
+
get menu() {
|
|
2651
|
+
return this.closest(P);
|
|
2652
|
+
}
|
|
2653
|
+
/** What pressing the item does beyond firing `click`. */
|
|
2654
|
+
activate() {
|
|
2655
|
+
}
|
|
2656
|
+
willUpdate(t) {
|
|
2657
|
+
super.willUpdate(t), this.setData("disabled", this.disabled), this.setData("inset", this.inset), this.internals.ariaDisabled = this.disabled ? "true" : null;
|
|
2658
|
+
}
|
|
2659
|
+
};
|
|
2660
|
+
Rt.identity = "menu-item", Rt.role = "menuitem", Rt.properties = {
|
|
2661
|
+
disabled: { type: Boolean, reflect: !0 },
|
|
2662
|
+
inset: { type: Boolean, reflect: !0 },
|
|
2663
|
+
closeOnClick: { attribute: "close-on-click", converter: on }
|
|
2664
|
+
};
|
|
2665
|
+
let pt = Rt;
|
|
2666
|
+
const Kt = class Kt extends pt {
|
|
2667
|
+
constructor() {
|
|
2668
|
+
super(), this.variant = "default";
|
|
2669
|
+
}
|
|
2670
|
+
willUpdate(t) {
|
|
2671
|
+
super.willUpdate(t), this.setData("variant", this.variant || "default");
|
|
2672
|
+
}
|
|
2673
|
+
};
|
|
2674
|
+
Kt.identity = "dropdown-menu-item", Kt.slotName = "dropdown-menu-item", Kt.properties = {
|
|
2675
|
+
variant: { type: String, reflect: !0 }
|
|
2676
|
+
};
|
|
2677
|
+
let Js = Kt;
|
|
2678
|
+
const wr = (s, t) => m`<span data-pont2-dropdown-menu-item-indicator data-slot=${s}>${t ? w.check() : d}</span>`, st = class st extends pt {
|
|
2679
|
+
constructor() {
|
|
2680
|
+
super(), this.checked = !1, this.closeOnClick = !1;
|
|
2681
|
+
}
|
|
2682
|
+
activate() {
|
|
2683
|
+
this.checked = !this.checked, v(this, "change");
|
|
2684
|
+
}
|
|
2685
|
+
willUpdate(t) {
|
|
2686
|
+
super.willUpdate(t), this.internals.ariaChecked = String(this.checked), this.setData("checked", this.checked), this.setData("unchecked", !this.checked);
|
|
2687
|
+
}
|
|
2688
|
+
render() {
|
|
2689
|
+
return wr("dropdown-menu-checkbox-item-indicator", this.checked);
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
st.identity = "dropdown-menu-checkbox-item", st.slotName = "dropdown-menu-checkbox-item", st.role = "menuitemcheckbox", st.properties = {
|
|
2693
|
+
checked: { type: Boolean, reflect: !0 }
|
|
2694
|
+
};
|
|
2695
|
+
let Is = st;
|
|
2696
|
+
const at = class at extends c {
|
|
2697
|
+
constructor() {
|
|
2698
|
+
super(), this.value = "";
|
|
2699
|
+
}
|
|
2700
|
+
select(t) {
|
|
2701
|
+
t !== this.value && (this.value = t, v(this, "change"));
|
|
2702
|
+
}
|
|
2703
|
+
updated() {
|
|
2704
|
+
for (const t of Array.from(this.querySelectorAll(f("dropdown-menu-radio-item"))))
|
|
2705
|
+
t.closest(f("dropdown-menu-radio-group")) === this && t.requestUpdate();
|
|
2706
|
+
}
|
|
2707
|
+
};
|
|
2708
|
+
at.identity = "dropdown-menu-radio-group", at.slotName = "dropdown-menu-radio-group", at.role = "group", at.properties = {
|
|
2709
|
+
value: { type: String, reflect: !0 }
|
|
2710
|
+
};
|
|
2711
|
+
let Gs = at;
|
|
2712
|
+
const rt = class rt extends pt {
|
|
2713
|
+
constructor() {
|
|
2714
|
+
super(), this.value = "", this.closeOnClick = !1;
|
|
2715
|
+
}
|
|
2716
|
+
get group() {
|
|
2717
|
+
return this.closest(f("dropdown-menu-radio-group"));
|
|
2718
|
+
}
|
|
2719
|
+
get checked() {
|
|
2720
|
+
return !!this.group && this.group.value === this.value;
|
|
2721
|
+
}
|
|
2722
|
+
activate() {
|
|
2723
|
+
var t;
|
|
2724
|
+
(t = this.group) == null || t.select(this.value);
|
|
2725
|
+
}
|
|
2726
|
+
willUpdate(t) {
|
|
2727
|
+
super.willUpdate(t), this.internals.ariaChecked = String(this.checked), this.setData("checked", this.checked), this.setData("unchecked", !this.checked);
|
|
2728
|
+
}
|
|
2729
|
+
render() {
|
|
2730
|
+
return wr("dropdown-menu-radio-item-indicator", this.checked);
|
|
2731
|
+
}
|
|
2732
|
+
};
|
|
2733
|
+
rt.identity = "dropdown-menu-radio-item", rt.slotName = "dropdown-menu-radio-item", rt.role = "menuitemradio", rt.properties = {
|
|
2734
|
+
value: { type: String }
|
|
2735
|
+
};
|
|
2736
|
+
let _s = rt;
|
|
2737
|
+
const xi = class xi extends pt {
|
|
2738
|
+
constructor() {
|
|
2739
|
+
super(), this.hoverTimer = 0, this.onEnter = (t) => {
|
|
2740
|
+
t.pointerType === "touch" || this.disabled || (clearTimeout(this.hoverTimer), this.hoverTimer = window.setTimeout(() => {
|
|
2741
|
+
var e;
|
|
2742
|
+
return (e = this.sub) == null ? void 0 : e.openWith("popup", "trigger-hover");
|
|
2743
|
+
}, 100));
|
|
2744
|
+
}, this.onKey = (t) => {
|
|
2745
|
+
var i;
|
|
2746
|
+
if (t.target !== this || this.disabled) return;
|
|
2747
|
+
const e = dt(this) === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
2748
|
+
t.key === e && (t.preventDefault(), t.stopPropagation(), (i = this.sub) == null || i.openWith("first", "list-navigation"));
|
|
2749
|
+
}, this.closeOnClick = !1, this.addEventListener("keydown", this.onKey), this.addEventListener("pointerenter", this.onEnter), this.addEventListener("pointerleave", () => clearTimeout(this.hoverTimer));
|
|
2750
|
+
}
|
|
2751
|
+
get sub() {
|
|
2752
|
+
return this.closest(f("dropdown-menu-sub"));
|
|
2753
|
+
}
|
|
2754
|
+
get isSubOpen() {
|
|
2755
|
+
var t;
|
|
2756
|
+
return !!((t = this.sub) != null && t.open);
|
|
2757
|
+
}
|
|
2758
|
+
activate() {
|
|
2759
|
+
var t;
|
|
2760
|
+
(t = this.sub) == null || t.openWith("first", "trigger-press");
|
|
2761
|
+
}
|
|
2762
|
+
render() {
|
|
2763
|
+
return w.chevronRight();
|
|
2764
|
+
}
|
|
2765
|
+
};
|
|
2766
|
+
xi.identity = "dropdown-menu-sub-trigger", xi.slotName = "dropdown-menu-sub-trigger";
|
|
2767
|
+
let Gt = xi;
|
|
2768
|
+
const Bt = class Bt extends c {
|
|
2769
|
+
connectedCallback() {
|
|
2770
|
+
super.connectedCallback(), queueMicrotask(() => {
|
|
2771
|
+
const t = this.querySelector(`:scope > ${f("dropdown-menu-label")}`);
|
|
2772
|
+
t && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-labelledby", $(t, "menu-label"));
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
};
|
|
2776
|
+
Bt.identity = "dropdown-menu-group", Bt.slotName = "dropdown-menu-group", Bt.role = "group";
|
|
2777
|
+
let ta = Bt;
|
|
2778
|
+
const Wt = class Wt extends c {
|
|
2779
|
+
constructor() {
|
|
2780
|
+
super(), this.inset = !1;
|
|
2781
|
+
}
|
|
2782
|
+
willUpdate() {
|
|
2783
|
+
this.setData("inset", this.inset);
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
Wt.identity = "dropdown-menu-label", Wt.slotName = "dropdown-menu-label", Wt.properties = { inset: { type: Boolean, reflect: !0 } };
|
|
2787
|
+
let ea = Wt;
|
|
2788
|
+
const wi = class wi extends z {
|
|
2789
|
+
};
|
|
2790
|
+
wi.identity = "dropdown-menu-separator", wi.slotName = "dropdown-menu-separator";
|
|
2791
|
+
let ia = wi;
|
|
2792
|
+
const $i = class $i extends c {
|
|
2793
|
+
};
|
|
2794
|
+
$i.identity = "dropdown-menu-shortcut", $i.slotName = "dropdown-menu-shortcut";
|
|
2795
|
+
let sa = $i;
|
|
2796
|
+
n("pont2-prim-dropdown-menu", Ys);
|
|
2797
|
+
n("pont2-prim-dropdown-menu-sub", Qs);
|
|
2798
|
+
n("pont2-prim-dropdown-menu-trigger", Zs);
|
|
2799
|
+
n("pont2-prim-dropdown-menu-content", Ae);
|
|
2800
|
+
n("pont2-prim-dropdown-menu-sub-content", De);
|
|
2801
|
+
n("pont2-prim-dropdown-menu-item", Js);
|
|
2802
|
+
n("pont2-prim-dropdown-menu-checkbox-item", Is);
|
|
2803
|
+
n("pont2-prim-dropdown-menu-radio-group", Gs);
|
|
2804
|
+
n("pont2-prim-dropdown-menu-radio-item", _s);
|
|
2805
|
+
n("pont2-prim-dropdown-menu-sub-trigger", Gt);
|
|
2806
|
+
n("pont2-prim-dropdown-menu-group", ta);
|
|
2807
|
+
n("pont2-prim-dropdown-menu-label", ea);
|
|
2808
|
+
n("pont2-prim-dropdown-menu-separator", ia);
|
|
2809
|
+
n("pont2-prim-dropdown-menu-shortcut", sa);
|
|
2810
|
+
const B = f("select"), ln = { fromAttribute: (s) => s !== "false", toAttribute: (s) => String(s) }, Tt = class Tt extends V {
|
|
2811
|
+
constructor() {
|
|
2812
|
+
super(), this.typeahead = new ut(), this.focusSelectedOnOpen = !0, this.value = "", this.name = "", this.required = !1, this.formDisabled = !1, this.addEventListener("click", (t) => {
|
|
2813
|
+
var e;
|
|
2814
|
+
t.target === this && ((e = this.triggerElement) == null || e.focus());
|
|
2815
|
+
});
|
|
2816
|
+
}
|
|
2817
|
+
/* ---------------- parts ---------------- */
|
|
2818
|
+
get triggerElement() {
|
|
2819
|
+
var t;
|
|
2820
|
+
return ((t = D(this, Xt("select-trigger"), B)) == null ? void 0 : t.control) ?? null;
|
|
2821
|
+
}
|
|
2822
|
+
get triggerHost() {
|
|
2823
|
+
return D(this, Xt("select-trigger"), B);
|
|
2824
|
+
}
|
|
2825
|
+
get contentElement() {
|
|
2826
|
+
return D(this, f("select-content"), B);
|
|
2827
|
+
}
|
|
2828
|
+
get popupKind() {
|
|
2829
|
+
return "listbox";
|
|
2830
|
+
}
|
|
2831
|
+
get items() {
|
|
2832
|
+
return Array.from(this.querySelectorAll(f("select-item"))).filter(
|
|
2833
|
+
(t) => t.closest(B) === this && bt(t)
|
|
2834
|
+
);
|
|
2835
|
+
}
|
|
2836
|
+
get selectedItem() {
|
|
2837
|
+
return this.items.find((t) => t.value === this.value) ?? null;
|
|
2838
|
+
}
|
|
2839
|
+
/* ---------------- form-associated API ---------------- */
|
|
2840
|
+
get form() {
|
|
2841
|
+
return this.internals.form;
|
|
2842
|
+
}
|
|
2843
|
+
get labels() {
|
|
2844
|
+
return this.internals.labels;
|
|
2845
|
+
}
|
|
2846
|
+
get validity() {
|
|
2847
|
+
return this.internals.validity;
|
|
2848
|
+
}
|
|
2849
|
+
get validationMessage() {
|
|
2850
|
+
return this.internals.validationMessage;
|
|
2851
|
+
}
|
|
2852
|
+
get isDisabled() {
|
|
2853
|
+
return this.disabled || this.formDisabled;
|
|
2854
|
+
}
|
|
2855
|
+
checkValidity() {
|
|
2856
|
+
return this.internals.checkValidity();
|
|
2857
|
+
}
|
|
2858
|
+
reportValidity() {
|
|
2859
|
+
return this.internals.reportValidity();
|
|
2860
|
+
}
|
|
2861
|
+
formResetCallback() {
|
|
2862
|
+
this.value = this.getAttribute("value") ?? "";
|
|
2863
|
+
}
|
|
2864
|
+
formDisabledCallback(t) {
|
|
2865
|
+
this.formDisabled = t;
|
|
2866
|
+
}
|
|
2867
|
+
formStateRestoreCallback(t) {
|
|
2868
|
+
typeof t == "string" && (this.value = t);
|
|
2869
|
+
}
|
|
2870
|
+
/* ---------------- behaviour ---------------- */
|
|
2871
|
+
wire() {
|
|
2872
|
+
super.wire();
|
|
2873
|
+
const t = this.triggerElement;
|
|
2874
|
+
if (t) {
|
|
2875
|
+
const e = Array.from(this.internals.labels).map((i) => $(i, "select-label"));
|
|
2876
|
+
e.length && !t.hasAttribute("aria-label") && t.setAttribute("aria-labelledby", e.join(" "));
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
/** Pick `value` as the user did: updates, fires input/change, closes. */
|
|
2880
|
+
select(t) {
|
|
2881
|
+
const e = t !== this.value;
|
|
2882
|
+
this.value = t, e && (v(this, "input"), v(this, "change")), this.setOpen(!1, "item-press");
|
|
2883
|
+
}
|
|
2884
|
+
/** Called by the trigger for keys pressed while it has focus. */
|
|
2885
|
+
handleTriggerKey(t) {
|
|
2886
|
+
if (!this.isDisabled) {
|
|
2887
|
+
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
2888
|
+
t.preventDefault(), this.setOpen(!0, "list-navigation", { keyboard: !0 });
|
|
2889
|
+
return;
|
|
2890
|
+
}
|
|
2891
|
+
if (!this.open && ut.isChar(t)) {
|
|
2892
|
+
const e = this.items, i = this.typeahead.match(t.key, e, e.indexOf(this.selectedItem), (a) => a.label);
|
|
2893
|
+
i >= 0 && e[i].value !== this.value && (this.value = e[i].value, v(this, "input"), v(this, "change"));
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
setOpen(t, e, i) {
|
|
2898
|
+
return t && this.isDisabled ? !1 : super.setOpen(t, e, i);
|
|
2899
|
+
}
|
|
2900
|
+
afterOpen() {
|
|
2901
|
+
const t = this.contentElement;
|
|
2902
|
+
if (!t) return;
|
|
2903
|
+
((this.focusSelectedOnOpen && this.selectedItem || (this.openedByKeyboard ? this.items.find((i) => !_t(i)) : null)) ?? t).focus({ preventScroll: !0 });
|
|
2904
|
+
}
|
|
2905
|
+
updated(t) {
|
|
2906
|
+
var i;
|
|
2907
|
+
super.updated(t);
|
|
2908
|
+
const e = this.isDisabled;
|
|
2909
|
+
if (this.setData("disabled", e), this.setData("required", this.required), this.internals.setFormValue(this.value || null), this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, "Please select an item in the list.", this.triggerElement ?? void 0) : this.internals.setValidity({}), t.has("value") || t.has("disabled") || t.has("formDisabled") || t.has("invalid")) {
|
|
2910
|
+
for (const a of this.items) a.requestUpdate();
|
|
2911
|
+
(i = this.triggerHost) == null || i.requestUpdate();
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
};
|
|
2915
|
+
Tt.formAssociated = !0, Tt.identity = "select", Tt.properties = {
|
|
2916
|
+
value: { type: String },
|
|
2917
|
+
name: { type: String, reflect: !0 },
|
|
2918
|
+
required: { type: Boolean, reflect: !0 },
|
|
2919
|
+
/** `aria-invalid` on the root is forwarded to the native trigger (which you do not write). */
|
|
2920
|
+
invalid: { type: String, attribute: "aria-invalid" },
|
|
2921
|
+
formDisabled: { state: !0 }
|
|
2922
|
+
};
|
|
2923
|
+
let aa = Tt;
|
|
2924
|
+
const Ha = class Ha extends Yt {
|
|
2925
|
+
constructor() {
|
|
2926
|
+
super(), this.onClick = (t) => {
|
|
2927
|
+
const e = this.root;
|
|
2928
|
+
!e || e.isDisabled || e.toggle("trigger-press", { keyboard: t.detail === 0 });
|
|
2929
|
+
}, this.onKeyDown = (t) => {
|
|
2930
|
+
var e;
|
|
2931
|
+
return (e = this.root) == null ? void 0 : e.handleTriggerKey(t);
|
|
2932
|
+
}, this.placeholder = "", this.size = "default";
|
|
2933
|
+
}
|
|
2934
|
+
get root() {
|
|
2935
|
+
return this.closest(B);
|
|
2936
|
+
}
|
|
2937
|
+
get control() {
|
|
2938
|
+
return this.querySelector(":scope > [data-pont2-select-trigger]");
|
|
2939
|
+
}
|
|
2940
|
+
updated() {
|
|
2941
|
+
var t;
|
|
2942
|
+
(t = this.root) == null || t.wire();
|
|
2943
|
+
}
|
|
2944
|
+
render() {
|
|
2945
|
+
const t = this.root, e = (t == null ? void 0 : t.selectedItem) ?? null, i = !!(t != null && t.isDisabled);
|
|
2946
|
+
return m`<button
|
|
2947
|
+
type="button"
|
|
2948
|
+
role="combobox"
|
|
2949
|
+
data-pont2-select-trigger
|
|
2950
|
+
data-slot="select-trigger"
|
|
2951
|
+
data-size=${this.size || "default"}
|
|
2952
|
+
?data-placeholder=${!e}
|
|
2953
|
+
aria-invalid=${(t == null ? void 0 : t.invalid) ?? d}
|
|
2954
|
+
?disabled=${i}
|
|
2955
|
+
?data-disabled=${i}
|
|
2956
|
+
@click=${this.onClick}
|
|
2957
|
+
@keydown=${this.onKeyDown}
|
|
2958
|
+
><span data-pont2-select-value data-slot="select-value" ?data-placeholder=${!e}
|
|
2959
|
+
>${e ? e.labelNodes() : this.placeholder}</span
|
|
2960
|
+
>${w.chevronDown()}</button>`;
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2963
|
+
Ha.properties = {
|
|
2964
|
+
placeholder: { type: String },
|
|
2965
|
+
size: { type: String }
|
|
2966
|
+
};
|
|
2967
|
+
let ra = Ha;
|
|
2968
|
+
const nt = class nt extends F {
|
|
2969
|
+
constructor() {
|
|
2970
|
+
super(), this.typeahead = new ut(), this.onKeyDown = (t) => {
|
|
2971
|
+
var o;
|
|
2972
|
+
const e = this.root;
|
|
2973
|
+
if (!e || t.defaultPrevented) return;
|
|
2974
|
+
const i = e.items, a = i.indexOf(t.target);
|
|
2975
|
+
if (t.key === "Tab") {
|
|
2976
|
+
e.setOpen(!1, "focus-out"), (o = e.triggerElement) == null || o.focus();
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
2979
|
+
const r = Sa(t.key);
|
|
2980
|
+
if (r) {
|
|
2981
|
+
t.preventDefault();
|
|
2982
|
+
const h = Jt(i, a, r, { loop: !1 });
|
|
2983
|
+
h >= 0 && i[h].focus();
|
|
2984
|
+
return;
|
|
2985
|
+
}
|
|
2986
|
+
if ((t.key === "Enter" || t.key === " ") && a >= 0) {
|
|
2987
|
+
if (t.preventDefault(), t.key === " " && this.typeahead.active) return;
|
|
2988
|
+
i[a].click();
|
|
2989
|
+
return;
|
|
2990
|
+
}
|
|
2991
|
+
if (ut.isChar(t)) {
|
|
2992
|
+
const h = this.typeahead.match(t.key, i, a, (l) => l.label);
|
|
2993
|
+
h >= 0 && i[h].focus();
|
|
2994
|
+
}
|
|
2995
|
+
}, this.side = "bottom", this.align = "center", this.sideOffset = 4, this.alignItemWithTrigger = !0, this.addEventListener("keydown", this.onKeyDown), this.addEventListener("pointerleave", () => {
|
|
2996
|
+
this.contains(document.activeElement) && this.focus({ preventScroll: !0 });
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
get root() {
|
|
3000
|
+
return this.closest(B);
|
|
3001
|
+
}
|
|
3002
|
+
alignItem() {
|
|
3003
|
+
if (!this.alignItemWithTrigger) return null;
|
|
3004
|
+
const t = this.root;
|
|
3005
|
+
return (t == null ? void 0 : t.selectedItem) ?? (t == null ? void 0 : t.items[0]) ?? null;
|
|
3006
|
+
}
|
|
3007
|
+
willUpdate() {
|
|
3008
|
+
this.setData("align-trigger", this.alignItemWithTrigger ? "true" : "false");
|
|
3009
|
+
}
|
|
3010
|
+
show() {
|
|
3011
|
+
var e;
|
|
3012
|
+
this.tabIndex = -1, super.show();
|
|
3013
|
+
const t = (e = this.root) == null ? void 0 : e.selectedItem;
|
|
3014
|
+
if (t) {
|
|
3015
|
+
const i = t.offsetTop;
|
|
3016
|
+
(i < this.scrollTop || i + t.offsetHeight > this.scrollTop + this.clientHeight) && (this.scrollTop = i - (this.clientHeight - t.offsetHeight) / 2);
|
|
3017
|
+
}
|
|
3018
|
+
this.positioner.update();
|
|
3019
|
+
}
|
|
3020
|
+
};
|
|
3021
|
+
nt.identity = "select-content", nt.slotName = "select-content", nt.role = "listbox", nt.properties = {
|
|
3022
|
+
alignItemWithTrigger: { attribute: "align-item-with-trigger", converter: ln }
|
|
3023
|
+
};
|
|
3024
|
+
let na = nt;
|
|
3025
|
+
const ot = class ot extends c {
|
|
3026
|
+
constructor() {
|
|
3027
|
+
super(), this.value = "", this.disabled = !1, this.addEventListener("focus", () => this.setData("highlighted", !0)), this.addEventListener("blur", () => this.setData("highlighted", !1)), this.addEventListener("pointermove", (t) => {
|
|
3028
|
+
t.pointerType !== "touch" && !this.disabled && document.activeElement !== this && this.focus({ preventScroll: !0 });
|
|
3029
|
+
}), this.addEventListener("click", (t) => {
|
|
3030
|
+
var e;
|
|
3031
|
+
if (this.disabled) {
|
|
3032
|
+
t.stopImmediatePropagation();
|
|
3033
|
+
return;
|
|
3034
|
+
}
|
|
3035
|
+
(e = this.root) == null || e.select(this.value);
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
get root() {
|
|
3039
|
+
return this.closest(B);
|
|
3040
|
+
}
|
|
3041
|
+
get selected() {
|
|
3042
|
+
return !!this.root && this.root.value === this.value;
|
|
3043
|
+
}
|
|
3044
|
+
get label() {
|
|
3045
|
+
return this.getAttribute("label") ?? this.textOf();
|
|
3046
|
+
}
|
|
3047
|
+
textOf() {
|
|
3048
|
+
let t = "";
|
|
3049
|
+
for (const e of Array.from(this.childNodes))
|
|
3050
|
+
e instanceof Comment || e instanceof Element && e.hasAttribute("data-pont2-select-item-indicator") || (t += e.textContent ?? "");
|
|
3051
|
+
return t.trim();
|
|
3052
|
+
}
|
|
3053
|
+
/** Copies of the author's content, for the trigger to display (Base UI renders the item label). */
|
|
3054
|
+
labelNodes() {
|
|
3055
|
+
return this.hasAttribute("label") ? [document.createTextNode(this.getAttribute("label"))] : Array.from(this.childNodes).filter((t) => !(t instanceof Comment) && !(t instanceof Element && t.hasAttribute("data-pont2-select-item-indicator"))).map((t) => {
|
|
3056
|
+
const e = t.cloneNode(!0);
|
|
3057
|
+
return e instanceof Element && e.removeAttribute("id"), e;
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
connectedCallback() {
|
|
3061
|
+
super.connectedCallback(), this.hasAttribute("tabindex") || (this.tabIndex = -1);
|
|
3062
|
+
}
|
|
3063
|
+
willUpdate() {
|
|
3064
|
+
const t = this.selected;
|
|
3065
|
+
this.internals.ariaSelected = String(t), this.internals.ariaDisabled = this.disabled ? "true" : null, this.setData("selected", t), this.setData("disabled", this.disabled);
|
|
3066
|
+
}
|
|
3067
|
+
render() {
|
|
3068
|
+
return this.selected ? m`<span data-pont2-select-item-indicator data-slot="select-item-indicator">${w.check()}</span>` : d;
|
|
3069
|
+
}
|
|
3070
|
+
};
|
|
3071
|
+
ot.identity = "select-item", ot.slotName = "select-item", ot.role = "option", ot.properties = {
|
|
3072
|
+
value: { type: String },
|
|
3073
|
+
disabled: { type: Boolean, reflect: !0 }
|
|
3074
|
+
};
|
|
3075
|
+
let oa = ot;
|
|
3076
|
+
const Ft = class Ft extends c {
|
|
3077
|
+
connectedCallback() {
|
|
3078
|
+
super.connectedCallback(), queueMicrotask(() => {
|
|
3079
|
+
const t = this.querySelector(`:scope > ${f("select-label")}`);
|
|
3080
|
+
t && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-labelledby", $(t, "select-group-label"));
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
};
|
|
3084
|
+
Ft.identity = "select-group", Ft.slotName = "select-group", Ft.role = "group";
|
|
3085
|
+
let la = Ft;
|
|
3086
|
+
const Ai = class Ai extends c {
|
|
3087
|
+
};
|
|
3088
|
+
Ai.identity = "select-label", Ai.slotName = "select-label";
|
|
3089
|
+
let ca = Ai;
|
|
3090
|
+
const Di = class Di extends z {
|
|
3091
|
+
};
|
|
3092
|
+
Di.identity = "select-separator", Di.slotName = "select-separator";
|
|
3093
|
+
let ha = Di;
|
|
3094
|
+
n("pont2-prim-select", aa);
|
|
3095
|
+
n("pont2-prim-select-trigger", ra);
|
|
3096
|
+
n("pont2-prim-select-content", na);
|
|
3097
|
+
n("pont2-prim-select-item", oa);
|
|
3098
|
+
n("pont2-prim-select-group", la);
|
|
3099
|
+
n("pont2-prim-select-label", ca);
|
|
3100
|
+
n("pont2-prim-select-separator", ha);
|
|
3101
|
+
const R = f("combobox"), cn = { fromAttribute: (s) => s !== "false", toAttribute: (s) => String(s) }, lt = class lt extends V {
|
|
3102
|
+
constructor() {
|
|
3103
|
+
super(), this.highlighted = null, this.value = "", this.name = "", this.required = !1, this.query = "", this.formDisabled = !1, this.addEventListener("click", (t) => {
|
|
3104
|
+
var e;
|
|
3105
|
+
t.target === this && ((e = this.inputElement) == null || e.focus());
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
/* ---------------- parts ---------------- */
|
|
3109
|
+
get inputHost() {
|
|
3110
|
+
return D(this, f("combobox-input"), R);
|
|
3111
|
+
}
|
|
3112
|
+
get inputElement() {
|
|
3113
|
+
var t;
|
|
3114
|
+
return ((t = this.inputHost) == null ? void 0 : t.control) ?? null;
|
|
3115
|
+
}
|
|
3116
|
+
/** The input is the combobox element: it gets aria-expanded/controls and receives focus back. */
|
|
3117
|
+
get triggerElement() {
|
|
3118
|
+
return this.inputElement;
|
|
3119
|
+
}
|
|
3120
|
+
get contentElement() {
|
|
3121
|
+
return D(this, f("combobox-content"), R);
|
|
3122
|
+
}
|
|
3123
|
+
get listElement() {
|
|
3124
|
+
return D(this, f("combobox-list"), R);
|
|
3125
|
+
}
|
|
3126
|
+
get popupKind() {
|
|
3127
|
+
return "listbox";
|
|
3128
|
+
}
|
|
3129
|
+
anchorElement() {
|
|
3130
|
+
return this.inputHost;
|
|
3131
|
+
}
|
|
3132
|
+
extraInsideElements() {
|
|
3133
|
+
return [this.inputHost];
|
|
3134
|
+
}
|
|
3135
|
+
get allItems() {
|
|
3136
|
+
return Array.from(this.querySelectorAll(f("combobox-item"))).filter((t) => t.closest(R) === this);
|
|
3137
|
+
}
|
|
3138
|
+
/** Items matching the current query. */
|
|
3139
|
+
get items() {
|
|
3140
|
+
return this.allItems.filter((t) => bt(t));
|
|
3141
|
+
}
|
|
3142
|
+
get selectedItem() {
|
|
3143
|
+
return this.allItems.find((t) => t.value === this.value) ?? null;
|
|
3144
|
+
}
|
|
3145
|
+
/* ---------------- form-associated API ---------------- */
|
|
3146
|
+
get form() {
|
|
3147
|
+
return this.internals.form;
|
|
3148
|
+
}
|
|
3149
|
+
get labels() {
|
|
3150
|
+
return this.internals.labels;
|
|
3151
|
+
}
|
|
3152
|
+
get validity() {
|
|
3153
|
+
return this.internals.validity;
|
|
3154
|
+
}
|
|
3155
|
+
get isDisabled() {
|
|
3156
|
+
return this.disabled || this.formDisabled;
|
|
3157
|
+
}
|
|
3158
|
+
checkValidity() {
|
|
3159
|
+
return this.internals.checkValidity();
|
|
3160
|
+
}
|
|
3161
|
+
reportValidity() {
|
|
3162
|
+
return this.internals.reportValidity();
|
|
3163
|
+
}
|
|
3164
|
+
formResetCallback() {
|
|
3165
|
+
this.value = this.getAttribute("value") ?? "", this.syncInputText();
|
|
3166
|
+
}
|
|
3167
|
+
formDisabledCallback(t) {
|
|
3168
|
+
this.formDisabled = t;
|
|
3169
|
+
}
|
|
3170
|
+
formStateRestoreCallback(t) {
|
|
3171
|
+
typeof t == "string" && (this.value = t);
|
|
3172
|
+
}
|
|
3173
|
+
/* ---------------- behaviour ---------------- */
|
|
3174
|
+
/** Base UI default filter: case- and accent-insensitive "contains". */
|
|
3175
|
+
static filter(t, e) {
|
|
3176
|
+
const i = (a) => a.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase();
|
|
3177
|
+
return i(t).includes(i(e.trim()));
|
|
3178
|
+
}
|
|
3179
|
+
select(t) {
|
|
3180
|
+
const e = (t == null ? void 0 : t.value) ?? "", i = e !== this.value;
|
|
3181
|
+
this.value = e, this.query = "", this.syncInputText(), i && (v(this, "input"), v(this, "change")), this.setOpen(!1, "item-press");
|
|
3182
|
+
}
|
|
3183
|
+
/** Show the selected item's label in the input (after select/close/reset). */
|
|
3184
|
+
syncInputText() {
|
|
3185
|
+
var e;
|
|
3186
|
+
const t = this.inputElement;
|
|
3187
|
+
t && (t.value = ((e = this.selectedItem) == null ? void 0 : e.label) ?? "");
|
|
3188
|
+
}
|
|
3189
|
+
highlight(t, e = !0) {
|
|
3190
|
+
var a;
|
|
3191
|
+
if (this.highlighted === t) return;
|
|
3192
|
+
(a = this.highlighted) == null || a.setHighlighted(!1), this.highlighted = t, t == null || t.setHighlighted(!0);
|
|
3193
|
+
const i = this.inputElement;
|
|
3194
|
+
i && (t ? i.setAttribute("aria-activedescendant", $(t, "combobox-item")) : i.removeAttribute("aria-activedescendant")), t && e && t.scrollIntoView({ block: "nearest" });
|
|
3195
|
+
}
|
|
3196
|
+
/** From the input: the user typed. */
|
|
3197
|
+
handleQuery(t) {
|
|
3198
|
+
this.query = t, this.open || this.setOpen(!0, "input-change"), this.applyFilter(), this.highlighted && !bt(this.highlighted) && this.highlight(null);
|
|
3199
|
+
}
|
|
3200
|
+
/** From the input: keyboard. */
|
|
3201
|
+
handleKey(t) {
|
|
3202
|
+
if (this.isDisabled) return;
|
|
3203
|
+
const e = t.key === "ArrowDown" || t.key === "ArrowUp" ? Sa(t.key) : null;
|
|
3204
|
+
if (e) {
|
|
3205
|
+
t.preventDefault(), this.open || (this.setOpen(!0, "list-navigation", { keyboard: !0 }), this.applyFilter());
|
|
3206
|
+
const i = this.items, a = this.highlighted ? i.indexOf(this.highlighted) : -1, r = Jt(i, a, e);
|
|
3207
|
+
this.highlight(r >= 0 ? i[r] : null);
|
|
3208
|
+
return;
|
|
3209
|
+
}
|
|
3210
|
+
if (t.key === "Enter" && this.open) {
|
|
3211
|
+
t.preventDefault(), this.highlighted && !_t(this.highlighted) && this.select(this.highlighted);
|
|
3212
|
+
return;
|
|
3213
|
+
}
|
|
3214
|
+
t.key === "Tab" && this.open && this.setOpen(!1, "focus-out");
|
|
3215
|
+
}
|
|
3216
|
+
/** Hide items (and empty groups) that do not match the query. */
|
|
3217
|
+
applyFilter() {
|
|
3218
|
+
var a, r, o;
|
|
3219
|
+
const t = this.query;
|
|
3220
|
+
let e = 0;
|
|
3221
|
+
for (const h of this.allItems) {
|
|
3222
|
+
const l = !t || lt.filter(h.label, t);
|
|
3223
|
+
h.hidden = !l, l && e++;
|
|
3224
|
+
}
|
|
3225
|
+
for (const h of Array.from(this.querySelectorAll(f("combobox-group"))))
|
|
3226
|
+
h.closest(R) === this && (h.hidden = !h.querySelector(`${f("combobox-item")}:not([hidden])`));
|
|
3227
|
+
const i = e === 0;
|
|
3228
|
+
(a = this.listElement) == null || a.toggleAttribute("data-empty", i), (r = this.contentElement) == null || r.toggleAttribute("data-empty", i), (o = this.contentElement) == null || o.reposition();
|
|
3229
|
+
}
|
|
3230
|
+
wire() {
|
|
3231
|
+
super.wire();
|
|
3232
|
+
const t = this.inputElement, e = this.listElement;
|
|
3233
|
+
if (t && e && t.setAttribute("aria-controls", $(e, "combobox-list")), t) {
|
|
3234
|
+
const i = Array.from(this.internals.labels).map((a) => $(a, "combobox-label"));
|
|
3235
|
+
i.length && !t.hasAttribute("aria-label") && t.setAttribute("aria-labelledby", i.join(" "));
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
afterOpen() {
|
|
3239
|
+
if (this.applyFilter(), this.openedByKeyboard && !this.highlighted) {
|
|
3240
|
+
const t = this.selectedItem;
|
|
3241
|
+
this.highlight(t && bt(t) ? t : null);
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
afterClose() {
|
|
3245
|
+
this.highlight(null), this.query = "", this.syncInputText(), setTimeout(() => {
|
|
3246
|
+
this.open || this.applyFilter();
|
|
3247
|
+
}, 200);
|
|
3248
|
+
}
|
|
3249
|
+
updated(t) {
|
|
3250
|
+
var e;
|
|
3251
|
+
if (super.updated(t), this.setData("disabled", this.isDisabled), this.internals.setFormValue(this.value || null), this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, "Please select an item in the list.", this.inputElement ?? void 0) : this.internals.setValidity({}), t.has("value")) {
|
|
3252
|
+
for (const i of this.allItems) i.requestUpdate();
|
|
3253
|
+
t.get("value") === void 0 && queueMicrotask(() => this.syncInputText());
|
|
3254
|
+
}
|
|
3255
|
+
(t.has("disabled") || t.has("formDisabled")) && ((e = this.inputHost) == null || e.requestUpdate());
|
|
3256
|
+
}
|
|
3257
|
+
};
|
|
3258
|
+
lt.formAssociated = !0, lt.identity = "combobox", lt.properties = {
|
|
3259
|
+
value: { type: String },
|
|
3260
|
+
name: { type: String, reflect: !0 },
|
|
3261
|
+
required: { type: Boolean, reflect: !0 },
|
|
3262
|
+
query: { state: !0 },
|
|
3263
|
+
formDisabled: { state: !0 }
|
|
3264
|
+
};
|
|
3265
|
+
let da = lt;
|
|
3266
|
+
const ct = class ct extends c {
|
|
3267
|
+
constructor() {
|
|
3268
|
+
super(), this.inputId = lr("combobox-input"), this.onInput = (t) => {
|
|
3269
|
+
var e;
|
|
3270
|
+
return (e = this.root) == null ? void 0 : e.handleQuery(t.target.value);
|
|
3271
|
+
}, this.onKeyDown = (t) => {
|
|
3272
|
+
var e;
|
|
3273
|
+
return (e = this.root) == null ? void 0 : e.handleKey(t);
|
|
3274
|
+
}, this.onInputClick = () => {
|
|
3275
|
+
const t = this.root;
|
|
3276
|
+
t && !t.open && t.setOpen(!0, "trigger-press");
|
|
3277
|
+
}, this.onFocusOut = (t) => {
|
|
3278
|
+
var a;
|
|
3279
|
+
const e = this.root, i = t.relatedTarget;
|
|
3280
|
+
e != null && e.open && (i && (this.contains(i) || (a = e.contentElement) != null && a.contains(i)) || e.setOpen(!1, "focus-out"));
|
|
3281
|
+
}, this.onTrigger = () => {
|
|
3282
|
+
var e;
|
|
3283
|
+
const t = this.root;
|
|
3284
|
+
t && (t.query = "", t.toggle("trigger-press"), (e = this.control) == null || e.focus());
|
|
3285
|
+
}, this.onClear = () => {
|
|
3286
|
+
var e;
|
|
3287
|
+
const t = this.root;
|
|
3288
|
+
t && (t.select(null), (e = this.control) == null || e.focus());
|
|
3289
|
+
}, this.onAddonClick = (t) => {
|
|
3290
|
+
var e;
|
|
3291
|
+
t.target.closest("button") || (e = this.control) == null || e.focus();
|
|
3292
|
+
}, this.placeholder = "", this.showTrigger = !0, this.showClear = !1;
|
|
3293
|
+
}
|
|
3294
|
+
get root() {
|
|
3295
|
+
return this.closest(R);
|
|
3296
|
+
}
|
|
3297
|
+
get control() {
|
|
3298
|
+
return this.querySelector(":scope > input");
|
|
3299
|
+
}
|
|
3300
|
+
focus(t) {
|
|
3301
|
+
var e;
|
|
3302
|
+
(e = this.control) == null || e.focus(t);
|
|
3303
|
+
}
|
|
3304
|
+
updated() {
|
|
3305
|
+
var t;
|
|
3306
|
+
(t = this.root) == null || t.wire();
|
|
3307
|
+
}
|
|
3308
|
+
render() {
|
|
3309
|
+
const t = this.root, e = !!(t != null && t.isDisabled), i = !!(t != null && t.value);
|
|
3310
|
+
return m`<input
|
|
3311
|
+
id=${this.inputId}
|
|
3312
|
+
data-pont2-combobox-input-control
|
|
3313
|
+
data-slot="input-group-control"
|
|
3314
|
+
type="text"
|
|
3315
|
+
role="combobox"
|
|
3316
|
+
aria-autocomplete="list"
|
|
3317
|
+
autocomplete="off"
|
|
3318
|
+
placeholder=${this.placeholder || d}
|
|
3319
|
+
?disabled=${e}
|
|
3320
|
+
aria-invalid=${(t == null ? void 0 : t.getAttribute("aria-invalid")) ?? d}
|
|
3321
|
+
@input=${this.onInput}
|
|
3322
|
+
@keydown=${this.onKeyDown}
|
|
3323
|
+
@click=${this.onInputClick}
|
|
3324
|
+
@focusout=${this.onFocusOut}
|
|
3325
|
+
/><div data-pont2-combobox-input-addon data-slot="input-group-addon" data-align="inline-end" role="group" @click=${this.onAddonClick}>
|
|
3326
|
+
${this.showTrigger && !(this.showClear && i) ? m`<button
|
|
3327
|
+
type="button"
|
|
3328
|
+
tabindex="-1"
|
|
3329
|
+
data-pont2-button
|
|
3330
|
+
data-variant="ghost"
|
|
3331
|
+
data-size="icon-xs"
|
|
3332
|
+
data-slot="input-group-button"
|
|
3333
|
+
data-combobox-trigger
|
|
3334
|
+
aria-label="Open"
|
|
3335
|
+
?disabled=${e}
|
|
3336
|
+
@mousedown=${(a) => a.preventDefault()}
|
|
3337
|
+
@click=${this.onTrigger}
|
|
3338
|
+
>${w.chevronDown()}</button>` : d}
|
|
3339
|
+
${this.showClear && i ? m`<button
|
|
3340
|
+
type="button"
|
|
3341
|
+
data-pont2-button
|
|
3342
|
+
data-variant="ghost"
|
|
3343
|
+
data-size="icon-xs"
|
|
3344
|
+
data-slot="combobox-clear"
|
|
3345
|
+
aria-label="Clear"
|
|
3346
|
+
?disabled=${e}
|
|
3347
|
+
@mousedown=${(a) => a.preventDefault()}
|
|
3348
|
+
@click=${this.onClear}
|
|
3349
|
+
>${w.x()}</button>` : d}
|
|
3350
|
+
</div>`;
|
|
3351
|
+
}
|
|
3352
|
+
};
|
|
3353
|
+
ct.identity = "combobox-input", ct.slotName = "input-group", ct.role = "group", ct.properties = {
|
|
3354
|
+
placeholder: { type: String },
|
|
3355
|
+
showTrigger: { attribute: "show-trigger", converter: cn },
|
|
3356
|
+
showClear: { type: Boolean, attribute: "show-clear" }
|
|
3357
|
+
};
|
|
3358
|
+
let ua = ct;
|
|
3359
|
+
const Ei = class Ei extends F {
|
|
3360
|
+
constructor() {
|
|
3361
|
+
super(), this.side = "bottom", this.align = "start", this.sideOffset = 6, this.addEventListener("mousedown", (t) => t.preventDefault());
|
|
3362
|
+
}
|
|
3363
|
+
};
|
|
3364
|
+
Ei.identity = "combobox-content", Ei.slotName = "combobox-content";
|
|
3365
|
+
let pa = Ei;
|
|
3366
|
+
const Pt = class Pt extends c {
|
|
3367
|
+
};
|
|
3368
|
+
Pt.identity = "combobox-list", Pt.slotName = "combobox-list", Pt.role = "listbox";
|
|
3369
|
+
let fa = Pt;
|
|
3370
|
+
const ht = class ht extends c {
|
|
3371
|
+
constructor() {
|
|
3372
|
+
super(), this.value = "", this.disabled = !1, this.addEventListener("pointermove", (t) => {
|
|
3373
|
+
var e;
|
|
3374
|
+
t.pointerType !== "touch" && !this.disabled && ((e = this.root) == null || e.highlight(this, !1));
|
|
3375
|
+
}), this.addEventListener("click", () => {
|
|
3376
|
+
var t;
|
|
3377
|
+
this.disabled || (t = this.root) == null || t.select(this);
|
|
3378
|
+
});
|
|
3379
|
+
}
|
|
3380
|
+
get root() {
|
|
3381
|
+
return this.closest(R);
|
|
3382
|
+
}
|
|
3383
|
+
get selected() {
|
|
3384
|
+
return !!this.root && !!this.root.value && this.root.value === this.value;
|
|
3385
|
+
}
|
|
3386
|
+
get label() {
|
|
3387
|
+
if (this.hasAttribute("label")) return this.getAttribute("label");
|
|
3388
|
+
let t = "";
|
|
3389
|
+
for (const e of Array.from(this.childNodes))
|
|
3390
|
+
e instanceof Comment || e instanceof Element && e.hasAttribute("data-pont2-combobox-item-indicator") || (t += e.textContent ?? "");
|
|
3391
|
+
return t.trim();
|
|
3392
|
+
}
|
|
3393
|
+
setHighlighted(t) {
|
|
3394
|
+
this.setData("highlighted", t);
|
|
3395
|
+
}
|
|
3396
|
+
connectedCallback() {
|
|
3397
|
+
super.connectedCallback(), $(this, "combobox-item");
|
|
3398
|
+
}
|
|
3399
|
+
willUpdate() {
|
|
3400
|
+
const t = this.selected;
|
|
3401
|
+
this.internals.ariaSelected = String(t), this.internals.ariaDisabled = this.disabled ? "true" : null, this.setData("selected", t), this.setData("disabled", this.disabled);
|
|
3402
|
+
}
|
|
3403
|
+
render() {
|
|
3404
|
+
return this.selected ? m`<span data-pont2-combobox-item-indicator data-slot="combobox-item-indicator">${w.check()}</span>` : d;
|
|
3405
|
+
}
|
|
3406
|
+
};
|
|
3407
|
+
ht.identity = "combobox-item", ht.slotName = "combobox-item", ht.role = "option", ht.properties = {
|
|
3408
|
+
value: { type: String },
|
|
3409
|
+
disabled: { type: Boolean, reflect: !0 }
|
|
3410
|
+
};
|
|
3411
|
+
let ma = ht;
|
|
3412
|
+
const Oi = class Oi extends c {
|
|
3413
|
+
connectedCallback() {
|
|
3414
|
+
super.connectedCallback(), this.internals.role = "status", this.internals.ariaLive = "polite";
|
|
3415
|
+
}
|
|
3416
|
+
};
|
|
3417
|
+
Oi.identity = "combobox-empty", Oi.slotName = "combobox-empty";
|
|
3418
|
+
let ga = Oi;
|
|
3419
|
+
const Ht = class Ht extends c {
|
|
3420
|
+
connectedCallback() {
|
|
3421
|
+
super.connectedCallback(), queueMicrotask(() => {
|
|
3422
|
+
const t = this.querySelector(`:scope > ${f("combobox-label")}`);
|
|
3423
|
+
t && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-labelledby", $(t, "combobox-group-label"));
|
|
3424
|
+
});
|
|
3425
|
+
}
|
|
3426
|
+
};
|
|
3427
|
+
Ht.identity = "combobox-group", Ht.slotName = "combobox-group", Ht.role = "group";
|
|
3428
|
+
let ba = Ht;
|
|
3429
|
+
const Si = class Si extends c {
|
|
3430
|
+
};
|
|
3431
|
+
Si.identity = "combobox-label", Si.slotName = "combobox-label";
|
|
3432
|
+
let ya = Si;
|
|
3433
|
+
const Ni = class Ni extends z {
|
|
3434
|
+
};
|
|
3435
|
+
Ni.identity = "combobox-separator", Ni.slotName = "combobox-separator";
|
|
3436
|
+
let va = Ni;
|
|
3437
|
+
n("pont2-prim-combobox", da);
|
|
3438
|
+
n("pont2-prim-combobox-input", ua);
|
|
3439
|
+
n("pont2-prim-combobox-content", pa);
|
|
3440
|
+
n("pont2-prim-combobox-list", fa);
|
|
3441
|
+
n("pont2-prim-combobox-item", ma);
|
|
3442
|
+
n("pont2-prim-combobox-empty", ga);
|
|
3443
|
+
n("pont2-prim-combobox-group", ba);
|
|
3444
|
+
n("pont2-prim-combobox-label", ya);
|
|
3445
|
+
n("pont2-prim-combobox-separator", va);
|
|
3446
|
+
const ka = f("tooltip"), qi = class qi extends V {
|
|
3447
|
+
constructor() {
|
|
3448
|
+
super(), this.timer = 0, this.delay = 0, this.closeDelay = 0;
|
|
3449
|
+
}
|
|
3450
|
+
get triggerElement() {
|
|
3451
|
+
var t;
|
|
3452
|
+
return ((t = D(this, Xt("tooltip-trigger"), ka)) == null ? void 0 : t.control) ?? null;
|
|
3453
|
+
}
|
|
3454
|
+
get contentElement() {
|
|
3455
|
+
return D(this, f("tooltip-content"), ka);
|
|
3456
|
+
}
|
|
3457
|
+
get popupKind() {
|
|
3458
|
+
return "true";
|
|
3459
|
+
}
|
|
3460
|
+
/** A tooltip is not a popup the trigger "has": no aria-haspopup/expanded, just a description. */
|
|
3461
|
+
wire() {
|
|
3462
|
+
const t = this.contentElement, e = this.triggerElement;
|
|
3463
|
+
if (t && ($(t, "tooltip"), t.onRequestClose = (i) => this.setOpen(!1, i), t.anchorElement = () => this.triggerElement, t.insideElements = () => []), e && t) {
|
|
3464
|
+
const i = new Set((e.getAttribute("aria-describedby") ?? "").split(/\s+/).filter(Boolean));
|
|
3465
|
+
this.open ? i.add(t.id) : i.delete(t.id), i.size ? e.setAttribute("aria-describedby", [...i].join(" ")) : e.removeAttribute("aria-describedby"), e.toggleAttribute("data-popup-open", this.open);
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
schedule(t, e) {
|
|
3469
|
+
clearTimeout(this.timer);
|
|
3470
|
+
const i = t ? this.delay : this.closeDelay;
|
|
3471
|
+
i <= 0 ? this.setOpen(t, e) : this.timer = window.setTimeout(() => this.setOpen(t, e), i);
|
|
3472
|
+
}
|
|
3473
|
+
// Focus stays where it is: a tooltip never takes focus.
|
|
3474
|
+
afterClose() {
|
|
3475
|
+
}
|
|
3476
|
+
};
|
|
3477
|
+
qi.identity = "tooltip", qi.properties = {
|
|
3478
|
+
delay: { type: Number },
|
|
3479
|
+
closeDelay: { type: Number, attribute: "close-delay" }
|
|
3480
|
+
};
|
|
3481
|
+
let xa = qi;
|
|
3482
|
+
const Li = class Li extends It {
|
|
3483
|
+
constructor() {
|
|
3484
|
+
super(), this.addEventListener("pointerenter", (t) => {
|
|
3485
|
+
var e;
|
|
3486
|
+
t.pointerType !== "touch" && ((e = this.root) == null || e.schedule(!0, "trigger-hover"));
|
|
3487
|
+
}), this.addEventListener("pointerleave", () => {
|
|
3488
|
+
var t;
|
|
3489
|
+
return (t = this.root) == null ? void 0 : t.schedule(!1, "trigger-hover");
|
|
3490
|
+
}), this.addEventListener("focusin", (t) => {
|
|
3491
|
+
var e;
|
|
3492
|
+
t.target.matches(":focus-visible") && ((e = this.root) == null || e.schedule(!0, "trigger-focus"));
|
|
3493
|
+
}), this.addEventListener("focusout", () => {
|
|
3494
|
+
var t;
|
|
3495
|
+
return (t = this.root) == null ? void 0 : t.schedule(!1, "focus-out");
|
|
3496
|
+
});
|
|
3497
|
+
}
|
|
3498
|
+
/** Pressing the trigger closes the tooltip (Base UI), it never toggles it open. */
|
|
3499
|
+
onClick() {
|
|
3500
|
+
const t = this.root;
|
|
3501
|
+
t != null && t.open && t.setOpen(!1, "trigger-press");
|
|
3502
|
+
}
|
|
3503
|
+
};
|
|
3504
|
+
Li.rootTag = ka, Li.controlSlot = "tooltip-trigger";
|
|
3505
|
+
let wa = Li;
|
|
3506
|
+
const jt = class jt extends F {
|
|
3507
|
+
constructor() {
|
|
3508
|
+
super(), this.side = "top", this.align = "center", this.sideOffset = 4;
|
|
3509
|
+
}
|
|
3510
|
+
};
|
|
3511
|
+
jt.identity = "tooltip-content", jt.slotName = "tooltip-content", jt.role = "tooltip";
|
|
3512
|
+
let $a = jt;
|
|
3513
|
+
n("pont2-prim-tooltip", xa);
|
|
3514
|
+
n("pont2-prim-tooltip-trigger", wa);
|
|
3515
|
+
n("pont2-prim-tooltip-content", $a);
|
|
3516
|
+
A("pont2-badge", ee);
|
|
3517
|
+
A("pont2-button", Qt);
|
|
3518
|
+
A("pont2-checkbox", ie);
|
|
3519
|
+
A("pont2-input", se);
|
|
3520
|
+
A("pont2-kbd", ae);
|
|
3521
|
+
A("pont2-kbd-group", re);
|
|
3522
|
+
A("pont2-label", ne);
|
|
3523
|
+
A("pont2-native-select", ge);
|
|
3524
|
+
A("pont2-separator", z);
|
|
3525
|
+
A("pont2-skeleton", oe);
|
|
3526
|
+
A("pont2-slider", xe);
|
|
3527
|
+
A("pont2-spinner", le);
|
|
3528
|
+
A("pont2-switch", we);
|
|
3529
|
+
A("pont2-table", be);
|
|
3530
|
+
A("pont2-textarea", ce);
|
|
3531
|
+
const sr = ["default", "error", "warning", "success", "info"], hn = {
|
|
3532
|
+
default: w.circleAlert,
|
|
3533
|
+
error: w.circleX,
|
|
3534
|
+
warning: w.triangleAlert,
|
|
3535
|
+
success: w.circleCheck,
|
|
3536
|
+
info: w.info
|
|
3537
|
+
}, Ci = class Ci extends he {
|
|
3538
|
+
constructor() {
|
|
3539
|
+
super(), this.status = "default", this.heading = "", this.description = "", this.icon = !1;
|
|
3540
|
+
}
|
|
3541
|
+
willUpdate() {
|
|
3542
|
+
const t = sr.includes(this.status) ? this.status : "default";
|
|
3543
|
+
this.variant = t === "error" ? "destructive" : "default", super.willUpdate(), this.setData("status", t), this.internals.role = t === "error" || t === "warning" ? "alert" : "status";
|
|
3544
|
+
}
|
|
3545
|
+
render() {
|
|
3546
|
+
const t = sr.includes(this.status) ? this.status : "default";
|
|
3547
|
+
return m`${this.icon ? hn[t]() : d}${this.heading ? m`<div ${de.part()}>${this.heading}</div>` : d}${this.description ? m`<div ${ue.part()}>${this.description}</div>` : d}`;
|
|
3548
|
+
}
|
|
3549
|
+
};
|
|
3550
|
+
Ci.composite = !0, Ci.properties = {
|
|
3551
|
+
status: { type: String, reflect: !0 },
|
|
3552
|
+
heading: { type: String },
|
|
3553
|
+
description: { type: String },
|
|
3554
|
+
icon: { type: Boolean, reflect: !0 }
|
|
3555
|
+
};
|
|
3556
|
+
let Aa = Ci;
|
|
3557
|
+
n("pont2-alert", Aa);
|
|
3558
|
+
function dn(s) {
|
|
3559
|
+
const t = s.trim().split(/\s+/).filter(Boolean);
|
|
3560
|
+
return (t.length > 1 ? [t[0], t[t.length - 1]] : t).map((i) => Array.from(i)[0] ?? "").join("").toLocaleUpperCase();
|
|
3561
|
+
}
|
|
3562
|
+
const Ui = class Ui extends pe {
|
|
3563
|
+
constructor() {
|
|
3564
|
+
super(), this.src = "", this.alt = "", this.fallback = "", this.badge = !1;
|
|
3565
|
+
}
|
|
3566
|
+
render() {
|
|
3567
|
+
const t = this.fallback || dn(this.alt);
|
|
3568
|
+
return m`${this.src ? m`<img src=${this.src} alt=${this.alt} />` : d}<span
|
|
3569
|
+
${fe.part(this.alt ? { role: "img", "aria-label": this.alt } : {})}
|
|
3570
|
+
>${t}</span
|
|
3571
|
+
>${this.badge ? m`<span ${me.part()}></span>` : d}`;
|
|
3572
|
+
}
|
|
3573
|
+
};
|
|
3574
|
+
Ui.composite = !0, Ui.properties = {
|
|
3575
|
+
src: { type: String },
|
|
3576
|
+
alt: { type: String },
|
|
3577
|
+
fallback: { type: String },
|
|
3578
|
+
badge: { type: Boolean, reflect: !0 }
|
|
3579
|
+
};
|
|
3580
|
+
let Da = Ui;
|
|
3581
|
+
n("pont2-avatar", Da);
|
|
3582
|
+
function un(s, t) {
|
|
3583
|
+
const e = Math.max(0, Math.floor(s)), i = Math.floor(t);
|
|
3584
|
+
if (!(i > 0) || i >= e) return e ? [e] : [];
|
|
3585
|
+
const a = [];
|
|
3586
|
+
for (let r = e; r > 0; r -= i) a.push(Math.min(i, r));
|
|
3587
|
+
return a;
|
|
3588
|
+
}
|
|
3589
|
+
const zi = class zi extends ye {
|
|
3590
|
+
constructor() {
|
|
3591
|
+
super(), this.groupSize = 0, this.separator = !1;
|
|
3592
|
+
}
|
|
3593
|
+
render() {
|
|
3594
|
+
let t = 0;
|
|
3595
|
+
const e = un(this.maxLength, this.groupSize).map((i, a) => {
|
|
3596
|
+
const r = Array.from({ length: i }, () => {
|
|
3597
|
+
const h = t++;
|
|
3598
|
+
return m`<pont2-prim-input-otp-slot index=${h}></pont2-prim-input-otp-slot>`;
|
|
3599
|
+
}), o = a > 0 && this.separator ? m`<div ${ke.part()}>${w.minus()}</div>` : d;
|
|
3600
|
+
return m`${o}<div ${ve.part()}>${r}</div>`;
|
|
3601
|
+
});
|
|
3602
|
+
return m`${e}${super.render()}`;
|
|
3603
|
+
}
|
|
3604
|
+
};
|
|
3605
|
+
zi.composite = !0, zi.properties = {
|
|
3606
|
+
groupSize: { type: Number, attribute: "group-size" },
|
|
3607
|
+
separator: { type: Boolean }
|
|
3608
|
+
};
|
|
3609
|
+
let Ea = zi;
|
|
3610
|
+
n("pont2-input-otp", Ea);
|
|
3611
|
+
export {
|
|
3612
|
+
sr as ALERT_STATUSES,
|
|
3613
|
+
$n as ALERT_VARIANTS,
|
|
3614
|
+
he as Alert,
|
|
3615
|
+
Ti as AlertAction,
|
|
3616
|
+
ue as AlertDescription,
|
|
3617
|
+
de as AlertTitle,
|
|
3618
|
+
sn as AnchoredPositioner,
|
|
3619
|
+
pe as Avatar,
|
|
3620
|
+
me as AvatarBadge,
|
|
3621
|
+
fe as AvatarFallback,
|
|
3622
|
+
Fi as AvatarGroup,
|
|
3623
|
+
Pi as AvatarGroupCount,
|
|
3624
|
+
vn as BADGE_VARIANTS,
|
|
3625
|
+
xn as BUTTON_SIZES,
|
|
3626
|
+
kn as BUTTON_VARIANTS,
|
|
3627
|
+
ee as Badge,
|
|
3628
|
+
Ia as ButtonBase,
|
|
3629
|
+
Hi as ButtonGroup,
|
|
3630
|
+
Mi as ButtonGroupSeparator,
|
|
3631
|
+
ji as ButtonGroupText,
|
|
3632
|
+
Xi as Card,
|
|
3633
|
+
Ji as CardAction,
|
|
3634
|
+
Ii as CardContent,
|
|
3635
|
+
Zi as CardDescription,
|
|
3636
|
+
Gi as CardFooter,
|
|
3637
|
+
Yi as CardHeader,
|
|
3638
|
+
Qi as CardTitle,
|
|
3639
|
+
ie as Checkbox,
|
|
3640
|
+
da as Combobox,
|
|
3641
|
+
pa as ComboboxContent,
|
|
3642
|
+
ga as ComboboxEmpty,
|
|
3643
|
+
ba as ComboboxGroup,
|
|
3644
|
+
ua as ComboboxInput,
|
|
3645
|
+
ma as ComboboxItem,
|
|
3646
|
+
ya as ComboboxLabel,
|
|
3647
|
+
fa as ComboboxList,
|
|
3648
|
+
va as ComboboxSeparator,
|
|
3649
|
+
Ys as DropdownMenu,
|
|
3650
|
+
Is as DropdownMenuCheckboxItem,
|
|
3651
|
+
Ae as DropdownMenuContent,
|
|
3652
|
+
ta as DropdownMenuGroup,
|
|
3653
|
+
Js as DropdownMenuItem,
|
|
3654
|
+
ea as DropdownMenuLabel,
|
|
3655
|
+
Gs as DropdownMenuRadioGroup,
|
|
3656
|
+
_s as DropdownMenuRadioItem,
|
|
3657
|
+
ia as DropdownMenuSeparator,
|
|
3658
|
+
sa as DropdownMenuShortcut,
|
|
3659
|
+
Qs as DropdownMenuSub,
|
|
3660
|
+
De as DropdownMenuSubContent,
|
|
3661
|
+
Gt as DropdownMenuSubTrigger,
|
|
3662
|
+
Zs as DropdownMenuTrigger,
|
|
3663
|
+
_i as Empty,
|
|
3664
|
+
as as EmptyContent,
|
|
3665
|
+
ss as EmptyDescription,
|
|
3666
|
+
ts as EmptyHeader,
|
|
3667
|
+
es as EmptyMedia,
|
|
3668
|
+
is as EmptyTitle,
|
|
3669
|
+
os as Field,
|
|
3670
|
+
ls as FieldContent,
|
|
3671
|
+
ds as FieldDescription,
|
|
3672
|
+
ps as FieldError,
|
|
3673
|
+
ns as FieldGroup,
|
|
3674
|
+
cs as FieldLabelElement,
|
|
3675
|
+
us as FieldSeparator,
|
|
3676
|
+
rs as FieldSetElement,
|
|
3677
|
+
hs as FieldTitle,
|
|
3678
|
+
W as FormControlElement,
|
|
3679
|
+
c as HostElement,
|
|
3680
|
+
fs as InputGroup,
|
|
3681
|
+
ms as InputGroupAddon,
|
|
3682
|
+
Tr as InputGroupButton,
|
|
3683
|
+
bs as InputGroupInput,
|
|
3684
|
+
gs as InputGroupText,
|
|
3685
|
+
ys as InputGroupTextarea,
|
|
3686
|
+
ye as InputOTP,
|
|
3687
|
+
ve as InputOTPGroup,
|
|
3688
|
+
ke as InputOTPSeparator,
|
|
3689
|
+
qs as InputOTPSlot,
|
|
3690
|
+
xs as Item,
|
|
3691
|
+
Es as ItemActions,
|
|
3692
|
+
$s as ItemContent,
|
|
3693
|
+
Ds as ItemDescription,
|
|
3694
|
+
Ss as ItemFooter,
|
|
3695
|
+
vs as ItemGroup,
|
|
3696
|
+
Os as ItemHeader,
|
|
3697
|
+
ws as ItemMedia,
|
|
3698
|
+
ks as ItemSeparator,
|
|
3699
|
+
As as ItemTitle,
|
|
3700
|
+
ae as Kbd,
|
|
3701
|
+
re as KbdGroup,
|
|
3702
|
+
Aa as KitAlert,
|
|
3703
|
+
Da as KitAvatar,
|
|
3704
|
+
Ea as KitInputOTP,
|
|
3705
|
+
pt as MenuItemBase,
|
|
3706
|
+
S as NativeEnhancer,
|
|
3707
|
+
ge as NativeSelect,
|
|
3708
|
+
Mt as PREFIX,
|
|
3709
|
+
Ur as PRIM,
|
|
3710
|
+
Qt as Pont2Button,
|
|
3711
|
+
se as Pont2Input,
|
|
3712
|
+
ne as Pont2Label,
|
|
3713
|
+
ce as Pont2Textarea,
|
|
3714
|
+
Fs as Popover,
|
|
3715
|
+
Hs as PopoverContent,
|
|
3716
|
+
Xs as PopoverDescription,
|
|
3717
|
+
js as PopoverHeader,
|
|
3718
|
+
Ms as PopoverTitle,
|
|
3719
|
+
Ps as PopoverTrigger,
|
|
3720
|
+
F as PopupContent,
|
|
3721
|
+
V as PopupRoot,
|
|
3722
|
+
It as PopupTrigger,
|
|
3723
|
+
Ls as Progress,
|
|
3724
|
+
Cs as ProgressLabel,
|
|
3725
|
+
Us as ProgressValue,
|
|
3726
|
+
Ln as REGEXP_ONLY_CHARS,
|
|
3727
|
+
Ns as REGEXP_ONLY_DIGITS,
|
|
3728
|
+
Cn as REGEXP_ONLY_DIGITS_AND_CHARS,
|
|
3729
|
+
zs as RadioGroup,
|
|
3730
|
+
Vs as RadioGroupItem,
|
|
3731
|
+
hr as RovingFocusController,
|
|
3732
|
+
aa as Select,
|
|
3733
|
+
na as SelectContent,
|
|
3734
|
+
la as SelectGroup,
|
|
3735
|
+
oa as SelectItem,
|
|
3736
|
+
ca as SelectLabel,
|
|
3737
|
+
ha as SelectSeparator,
|
|
3738
|
+
ra as SelectTrigger,
|
|
3739
|
+
z as Separator,
|
|
3740
|
+
Yt as ShellElement,
|
|
3741
|
+
oe as Skeleton,
|
|
3742
|
+
xe as Slider,
|
|
3743
|
+
le as Spinner,
|
|
3744
|
+
we as Switch,
|
|
3745
|
+
be as Table,
|
|
3746
|
+
Rs as Tabs,
|
|
3747
|
+
Ws as TabsContent,
|
|
3748
|
+
Ks as TabsList,
|
|
3749
|
+
Bs as TabsTrigger,
|
|
3750
|
+
xa as Tooltip,
|
|
3751
|
+
$a as TooltipContent,
|
|
3752
|
+
wa as TooltipTrigger,
|
|
3753
|
+
ut as Typeahead,
|
|
3754
|
+
en as alignItemWithAnchor,
|
|
3755
|
+
Cr as applyAttrs,
|
|
3756
|
+
dr as applyButton,
|
|
3757
|
+
Wr as applyFieldLabel,
|
|
3758
|
+
Br as applyFieldSet,
|
|
3759
|
+
fr as applyInput,
|
|
3760
|
+
mr as applyLabel,
|
|
3761
|
+
Fr as applyNativeSelect,
|
|
3762
|
+
Pr as applyTable,
|
|
3763
|
+
gr as applyTextarea,
|
|
3764
|
+
L as attrs,
|
|
3765
|
+
ur as button,
|
|
3766
|
+
tn as computePosition,
|
|
3767
|
+
n as define,
|
|
3768
|
+
A as defineAlias,
|
|
3769
|
+
dt as directionOf,
|
|
3770
|
+
$ as ensureId,
|
|
3771
|
+
En as fieldLabel,
|
|
3772
|
+
Dn as fieldLegend,
|
|
3773
|
+
An as fieldSet,
|
|
3774
|
+
cr as fire,
|
|
3775
|
+
v as fireNative,
|
|
3776
|
+
un as groupSizes,
|
|
3777
|
+
w as icons,
|
|
3778
|
+
Za as identitiesOf,
|
|
3779
|
+
or as identityAttr,
|
|
3780
|
+
dn as initials,
|
|
3781
|
+
Rr as input,
|
|
3782
|
+
Nn as inputGroupButton,
|
|
3783
|
+
On as inputGroupInput,
|
|
3784
|
+
Sn as inputGroupTextarea,
|
|
3785
|
+
_t as isItemDisabled,
|
|
3786
|
+
bt as isItemVisible,
|
|
3787
|
+
Vr as isSoftDisabled,
|
|
3788
|
+
Sa as keyToMove,
|
|
3789
|
+
wn as label,
|
|
3790
|
+
Jt as moveIndex,
|
|
3791
|
+
qn as nativeSelect,
|
|
3792
|
+
Un as openPopups,
|
|
3793
|
+
D as ownQuery,
|
|
3794
|
+
zn as ownQueryAll,
|
|
3795
|
+
nr as primTag,
|
|
3796
|
+
f as sel,
|
|
3797
|
+
Bi as spaceOn,
|
|
3798
|
+
rr as tag,
|
|
3799
|
+
Xt as tags,
|
|
3800
|
+
Kr as textarea,
|
|
3801
|
+
Gr as toPhysical,
|
|
3802
|
+
yn as toggleIdRef,
|
|
3803
|
+
lr as uid
|
|
3804
|
+
};
|
|
3805
|
+
//# sourceMappingURL=index.mjs.map
|