@mattilsynet/design 3.0.0 → 3.0.1
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/mtds/app/app-observer.js +1 -1
- package/mtds/app/app-toggle.js +10 -26
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +26 -10
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +1 -1
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +284 -0
- package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -0
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +201 -0
- package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +1 -0
- package/mtds/field/field.stories.d.ts +1 -1
- package/mtds/icons/megaphone.svg +1 -1
- package/mtds/illustrations/index.json +1 -1
- package/mtds/index.iife.js +1 -1
- package/mtds/index.js +37 -22
- package/mtds/package.json.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/tooltip/tooltip-element.js +1 -0
- package/mtds/tooltip/tooltip-element.js.map +1 -1
- package/package.json +12 -15
package/mtds/app/app-observer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import P from "../styles.module.css.js";
|
|
2
2
|
import { getByCSSModule as _, onHotReload as h, on as r, QUICK_EVENT as m, debounce as E } from "../utils.js";
|
|
3
|
-
import "./app-
|
|
3
|
+
import "./app-toggle.js";
|
|
4
4
|
const y = P.app.split(" ")[0], I = `[data-command="toggle-app-expanded"],.${y} > [command="show-modal"]`, u = `.${y} > dialog,.${y} dialog ~ main`, S = _("sticky"), w = (t) => {
|
|
5
5
|
document.startViewTransition ? document.startViewTransition(t) : t();
|
|
6
6
|
}, x = (t) => (
|
package/mtds/app/app-toggle.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
document.adoptedStyleSheets.push(sheet);
|
|
12
|
-
window.mtdsToggleAppExpanded = (force) => {
|
|
13
|
-
try {
|
|
14
|
-
const next = force ?? !prev();
|
|
15
|
-
sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
|
|
16
|
-
window.localStorage.setItem(key, next);
|
|
17
|
-
} catch (_err) {} // localStorage is full or replaceSync is not supported
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Set and store initial state
|
|
21
|
-
window.mtdsToggleAppExpanded(prev());
|
|
22
|
-
})();
|
|
23
|
-
`;
|
|
24
|
-
export {
|
|
25
|
-
t as default
|
|
26
|
-
};
|
|
1
|
+
typeof window < "u" && window.CSSStyleSheet && document.adoptedStyleSheets && (() => {
|
|
2
|
+
const e = "--mtds-app-expanded", d = new CSSStyleSheet(), o = () => !window.localStorage.getItem(e)?.includes("false");
|
|
3
|
+
document.adoptedStyleSheets.push(d), window.mtdsToggleAppExpanded = (n) => {
|
|
4
|
+
try {
|
|
5
|
+
const t = n ?? !o();
|
|
6
|
+
d.replaceSync?.(`:root { ${e}: var(${e}--${t})}`), window.localStorage.setItem(e, t);
|
|
7
|
+
} catch {
|
|
8
|
+
}
|
|
9
|
+
}, window.mtdsToggleAppExpanded(o());
|
|
10
|
+
})();
|
|
27
11
|
//# sourceMappingURL=app-toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js
|
|
1
|
+
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets\n)\n\t(() => {\n\t\tconst key = \"--mtds-app-expanded\";\n\t\tconst sheet = new CSSStyleSheet();\n\t\tconst prev = () => !window.localStorage.getItem(key)?.includes(\"false\");\n\n\t\tdocument.adoptedStyleSheets.push(sheet);\n\t\twindow.mtdsToggleAppExpanded = (force) => {\n\t\t\ttry {\n\t\t\t\tconst next = force ?? !prev();\n\t\t\t\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\n\t\t\t\twindow.localStorage.setItem(key, next);\n\t\t\t} catch (_err) {} // localStorage is full or replaceSync is not supported\n\t\t};\n\n\t\t// Set and store initial state\n\t\twindow.mtdsToggleAppExpanded(prev());\n\t})();\n"],"names":["key","sheet","prev","force","next"],"mappings":"AACC,OAAO,SAAW,OAClB,OAAO,iBACP,SAAS,uBAER,MAAM;AACN,QAAMA,IAAM,uBACNC,IAAQ,IAAI,cAAa,GACzBC,IAAO,MAAM,CAAC,OAAO,aAAa,QAAQF,CAAG,GAAG,SAAS,OAAO;AAEtE,WAAS,mBAAmB,KAAKC,CAAK,GACtC,OAAO,wBAAwB,CAACE,MAAU;AACzC,QAAI;AACH,YAAMC,IAAOD,KAAS,CAACD,EAAI;AAC3B,MAAAD,EAAM,cAAc,WAAWD,CAAG,SAASA,CAAG,KAAKI,CAAI,IAAI,GAC3D,OAAO,aAAa,QAAQJ,GAAKI,CAAI;AAAA,IACtC,QAAe;AAAA,IAAC;AAAA,EACjB,GAGA,OAAO,sBAAsBF,GAAM;AACpC,GAAC;"}
|
package/mtds/app/app-toggle2.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const t = `if (
|
|
2
|
+
typeof window !== "undefined" &&
|
|
3
|
+
window.CSSStyleSheet &&
|
|
4
|
+
document.adoptedStyleSheets
|
|
5
|
+
)
|
|
6
|
+
(() => {
|
|
7
|
+
const key = "--mtds-app-expanded";
|
|
8
|
+
const sheet = new CSSStyleSheet();
|
|
9
|
+
const prev = () => !window.localStorage.getItem(key)?.includes("false");
|
|
10
|
+
|
|
11
|
+
document.adoptedStyleSheets.push(sheet);
|
|
12
|
+
window.mtdsToggleAppExpanded = (force) => {
|
|
13
|
+
try {
|
|
14
|
+
const next = force ?? !prev();
|
|
15
|
+
sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
|
|
16
|
+
window.localStorage.setItem(key, next);
|
|
17
|
+
} catch (_err) {} // localStorage is full or replaceSync is not supported
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Set and store initial state
|
|
21
|
+
window.mtdsToggleAppExpanded(prev());
|
|
22
|
+
})();
|
|
23
|
+
`;
|
|
24
|
+
export {
|
|
25
|
+
t as default
|
|
26
|
+
};
|
|
11
27
|
//# sourceMappingURL=app-toggle2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (
|
|
1
|
+
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js?raw"],"sourcesContent":["export default \"if (\\n\\ttypeof window !== \\\"undefined\\\" &&\\n\\twindow.CSSStyleSheet &&\\n\\tdocument.adoptedStyleSheets\\n)\\n\\t(() => {\\n\\t\\tconst key = \\\"--mtds-app-expanded\\\";\\n\\t\\tconst sheet = new CSSStyleSheet();\\n\\t\\tconst prev = () => !window.localStorage.getItem(key)?.includes(\\\"false\\\");\\n\\n\\t\\tdocument.adoptedStyleSheets.push(sheet);\\n\\t\\twindow.mtdsToggleAppExpanded = (force) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst next = force ?? !prev();\\n\\t\\t\\t\\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\\n\\t\\t\\t\\twindow.localStorage.setItem(key, next);\\n\\t\\t\\t} catch (_err) {} // localStorage is full or replaceSync is not supported\\n\\t\\t};\\n\\n\\t\\t// Set and store initial state\\n\\t\\twindow.mtdsToggleAppExpanded(prev());\\n\\t})();\\n\""],"names":["script"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/mtds/app/app.js
CHANGED
|
@@ -3,7 +3,7 @@ import a from "clsx";
|
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { Button as m } from "../button/button.js";
|
|
5
5
|
import s from "../styles.module.css.js";
|
|
6
|
-
import d from "./app-
|
|
6
|
+
import d from "./app-toggle2.js";
|
|
7
7
|
const u = n(function({ as: r, className: t, ...p }, e) {
|
|
8
8
|
return /* @__PURE__ */ o(r || "div", { className: a(s.app, t), ref: e, ...p });
|
|
9
9
|
}), f = n(function({ as: r, className: t, ...p }, e) {
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
var rt = Object.defineProperty, q = Object.getOwnPropertySymbols, lt = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable, F = (t, e, o) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, ut = (t, e) => {
|
|
2
|
+
for (var o in e || (e = {}))
|
|
3
|
+
lt.call(e, o) && F(t, o, e[o]);
|
|
4
|
+
if (q)
|
|
5
|
+
for (var o of q(e))
|
|
6
|
+
st.call(e, o) && F(t, o, e[o]);
|
|
7
|
+
return t;
|
|
8
|
+
}, $ = typeof window < "u" && typeof window.document < "u" && typeof window.navigator < "u", dt = $ && /android/i.test(navigator.userAgent), Y = $ && /iPad|iPhone|iPod/.test(navigator.userAgent), W;
|
|
9
|
+
$ && // @ts-expect-error Typescript has not implemented userAgentData yet https://stackoverflow.com/a/71392474
|
|
10
|
+
/^Mac/i.test(((W = navigator.userAgentData) == null ? void 0 : W.platform) || navigator.platform);
|
|
11
|
+
var ct = "outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color", vt = typeof HTMLElement > "u" ? class {
|
|
12
|
+
} : HTMLElement;
|
|
13
|
+
function r(t, e, o) {
|
|
14
|
+
return o === void 0 ? t.getAttribute(e) : (o === null ? t.removeAttribute(e) : t.getAttribute(e) !== o && t.setAttribute(e, o), null);
|
|
15
|
+
}
|
|
16
|
+
var G = (t, e, o) => {
|
|
17
|
+
for (const i of o[0].split(","))
|
|
18
|
+
o[0] = i, Element.prototype[`${t}EventListener`].apply(e, o);
|
|
19
|
+
}, A = (t, ...e) => G("add", t, e), pt = (t, ...e) => G("remove", t, e), T = /* @__PURE__ */ new WeakMap(), H = (t, e) => {
|
|
20
|
+
if (e === void 0) return T.get(t);
|
|
21
|
+
try {
|
|
22
|
+
T.get(t).disconnect(), T.delete(t);
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
if (e) {
|
|
26
|
+
const o = new MutationObserver(
|
|
27
|
+
(i) => t.handleEvent({ type: "mutation", detail: i })
|
|
28
|
+
);
|
|
29
|
+
o.observe(t, e), T.set(t, o);
|
|
30
|
+
}
|
|
31
|
+
}, ft = (t) => {
|
|
32
|
+
var e;
|
|
33
|
+
const o = t.key === " " || t.key === "Enter";
|
|
34
|
+
return o && ((e = t.preventDefault) == null || e.call(t)), o && t.target instanceof HTMLElement && t.target.dispatchEvent(new MouseEvent("click", t)), o;
|
|
35
|
+
}, J = (t) => {
|
|
36
|
+
var e;
|
|
37
|
+
const o = ((e = t.getRootNode) == null ? void 0 : e.call(t)) || t.ownerDocument;
|
|
38
|
+
return o instanceof Document || o instanceof ShadowRoot ? o : document;
|
|
39
|
+
}, mt = 0, K = (t) => t ? (t.id || (t.id = `:${t.nodeName.toLowerCase()}${(++mt).toString(32)}`), t.id) : "", w = (t, e, o) => {
|
|
40
|
+
const i = document.createElement(t);
|
|
41
|
+
if (e && (i[t === "style" ? "textContent" : "innerHTML"] = e), o) for (const [n, a] of Object.entries(o)) r(i, n, a);
|
|
42
|
+
return i;
|
|
43
|
+
}, ht = {
|
|
44
|
+
define: (t, e) => !$ || window.customElements.get(t) || window.customElements.define(t, e)
|
|
45
|
+
}, bt = (t) => {
|
|
46
|
+
var e;
|
|
47
|
+
const o = r(t, "aria-label") || "";
|
|
48
|
+
return [
|
|
49
|
+
...(((e = r(t, "aria-labelledby")) == null ? void 0 : e.trim().split(/\s+/)) || []).map((n) => document.getElementById(n)),
|
|
50
|
+
// Get all labelledby elements
|
|
51
|
+
...Array.from(t.labels || [])
|
|
52
|
+
// Get all <label> elements
|
|
53
|
+
].reduce((n, a) => {
|
|
54
|
+
var l;
|
|
55
|
+
return n || ((l = a?.innerText) == null ? void 0 : l.trim()) || "";
|
|
56
|
+
}, o);
|
|
57
|
+
}, y, _t = 0, N = (t) => {
|
|
58
|
+
y || (y = w("div"), y.style.cssText = "position:fixed;overflow:hidden;width:1px;white-space:nowrap", r(y, "aria-live", "assertive")), y.isConnected || document.body.append(y), t && (y.textContent = `${t}${_t++ % 2 ? " " : ""}`);
|
|
59
|
+
}, Q = (t, e, o = "") => {
|
|
60
|
+
var i, n;
|
|
61
|
+
const a = { bubbles: !0, composed: !0, data: e, inputType: o }, l = HTMLInputElement.prototype;
|
|
62
|
+
t.dispatchEvent(new InputEvent("beforeinput", a)), (n = (i = Object.getOwnPropertyDescriptor(l, "value")) == null ? void 0 : i.set) == null || n.call(t, e), t.dispatchEvent(new InputEvent("input", a)), t.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
63
|
+
}, D = !1, P = (t) => (t?.type === "mouseup" && (D = !1), t?.type === "mousedown" && (D = !0, A(document, "mouseup", P, { once: !0 })), D), yt = (t, e = "<slot></slot>") => `<template shadowrootmode="open">${e}<style>${t}</style></template>`, Z = `:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */
|
|
64
|
+
:host(:not([data-multiple])) ::slotted(data),
|
|
65
|
+
:host([data-multiple="false"]) ::slotted(data) { display: none } /* Hide data if not multiple */
|
|
66
|
+
[role="listbox"] { position: absolute } /* Avoid affecting CSS like flex on the <u-combobox> */
|
|
67
|
+
::slotted(input[inputmode="none"]) { outline: none } /* Hide temporary foucs outline flash */
|
|
68
|
+
::slotted(del) { text-decoration: none }
|
|
69
|
+
::slotted(data:not([hidden])) { display: inline-block; pointer-events: none }
|
|
70
|
+
::slotted(data)::after { content: '\\00D7'; content: '\\00D7' / ''; padding-inline: .5ch; pointer-events: auto; cursor: pointer }
|
|
71
|
+
::slotted(data:focus) { ${ct} }`, Lt = yt(Z), X = "beforeinput,blur,focus,click,input,keydown,mousedown", tt = { once: !0, capture: !0, passive: !0 }, S = "false", I = dt || Y, z = "".repeat(5), et = "deleteContentBackward", Et = "insertText", gt = " ", L = {
|
|
72
|
+
added: "Added",
|
|
73
|
+
empty: "No selected",
|
|
74
|
+
found: "Navigate left to find %d selected",
|
|
75
|
+
invalid: "Invalid value",
|
|
76
|
+
items: "Selected",
|
|
77
|
+
// Note: Not announced by NVDA
|
|
78
|
+
of: "of",
|
|
79
|
+
remove: "Press to remove",
|
|
80
|
+
removed: "Removed"
|
|
81
|
+
}, wt = class extends vt {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(), this._item = "", this._speak = "", this._texts = ut({}, L), this._value = "", this.shadowRoot || this.attachShadow({ mode: "open" }).append(
|
|
84
|
+
w("slot", null, {
|
|
85
|
+
"aria-orientation": "horizontal",
|
|
86
|
+
tabindex: "-1",
|
|
87
|
+
role: "listbox",
|
|
88
|
+
// Note: Not announced by JAWS
|
|
89
|
+
name: "items"
|
|
90
|
+
}),
|
|
91
|
+
w("slot"),
|
|
92
|
+
// Used to prevent exiting JAWS forms mode when an item is removed, using listbox as this forces JAWS to stay in forms mode without mobile keyboard opening
|
|
93
|
+
w("div", '<div role="option" tabindex="-1"></div>', {
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
// Prevent screen readers from announcing this element
|
|
96
|
+
role: "listbox"
|
|
97
|
+
}),
|
|
98
|
+
w("style", Z)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
// Using ES2015 syntax for backwards compatibility
|
|
102
|
+
static get observedAttributes() {
|
|
103
|
+
return Object.keys(L).map((t) => `data-sr-${t}`);
|
|
104
|
+
}
|
|
105
|
+
connectedCallback() {
|
|
106
|
+
this._root = J(this), A(this, X, this, !0), H(this, {
|
|
107
|
+
attributeFilter: ["value", "id", "role"],
|
|
108
|
+
// Respond to changes in <data> value or change of id or role for <datalist> to reconnect with input
|
|
109
|
+
attributes: !0,
|
|
110
|
+
characterData: !0,
|
|
111
|
+
// Respond to changes in <data> textContent
|
|
112
|
+
childList: !0,
|
|
113
|
+
subtree: !0
|
|
114
|
+
}), setTimeout(O, 0, this), setTimeout(M, 0, this);
|
|
115
|
+
}
|
|
116
|
+
attributeChangedCallback(t, e, o) {
|
|
117
|
+
const i = t.split("data-sr-")[1];
|
|
118
|
+
L[i] && (this._texts[i] = o || L[i]);
|
|
119
|
+
}
|
|
120
|
+
disconnectedCallback() {
|
|
121
|
+
H(this, !1), pt(this, X, this, !0), this._items = this._clear = this._focus = this._control = void 0, this._list = this._options = this._root = this._form = void 0;
|
|
122
|
+
}
|
|
123
|
+
handleEvent(t) {
|
|
124
|
+
const e = t.target;
|
|
125
|
+
B(this) || (t.type === "beforeinput" && (this._value = e?.value || ""), t.type === "blur" && Ct(this), t.type === "click" && Tt(this, t), t.type === "focus" && xt(this, t), t.type === "input" && St(this, t), t.type === "keydown" && It(this, t), t.type === "mousedown" && P(t), t.type === "mutation" && O(this, t));
|
|
126
|
+
}
|
|
127
|
+
get multiple() {
|
|
128
|
+
var t;
|
|
129
|
+
return ((t = r(this, "data-multiple")) != null ? t : S) !== S;
|
|
130
|
+
}
|
|
131
|
+
set multiple(t) {
|
|
132
|
+
r(this, "data-multiple", t ? "" : null);
|
|
133
|
+
}
|
|
134
|
+
get creatable() {
|
|
135
|
+
var t;
|
|
136
|
+
return ((t = r(this, "data-creatable")) != null ? t : S) !== S;
|
|
137
|
+
}
|
|
138
|
+
set creatable(t) {
|
|
139
|
+
r(this, "data-creatable", t ? "" : null);
|
|
140
|
+
}
|
|
141
|
+
get control() {
|
|
142
|
+
var t;
|
|
143
|
+
return (t = this._control) != null && t.isConnected || (this._control = this.querySelector("input")), this._control;
|
|
144
|
+
}
|
|
145
|
+
get list() {
|
|
146
|
+
var t;
|
|
147
|
+
return (t = this._list) != null && t.isConnected || (this._list = this.querySelector('datalist,[role="listbox"]')), this._list;
|
|
148
|
+
}
|
|
149
|
+
get clear() {
|
|
150
|
+
var t;
|
|
151
|
+
return (t = this._clear) != null && t.isConnected || (this._clear = this.querySelector("del")), this._clear;
|
|
152
|
+
}
|
|
153
|
+
get items() {
|
|
154
|
+
return this._items || (this._items = this.getElementsByTagName("data")), this._items;
|
|
155
|
+
}
|
|
156
|
+
get options() {
|
|
157
|
+
var t, e;
|
|
158
|
+
if (!this._options) {
|
|
159
|
+
const o = (e = (t = this.list) == null ? void 0 : t.querySelector('[role="option"],option')) == null ? void 0 : e.nodeName;
|
|
160
|
+
o && (this._options = this.getElementsByTagName(o));
|
|
161
|
+
}
|
|
162
|
+
return this._options;
|
|
163
|
+
}
|
|
164
|
+
get values() {
|
|
165
|
+
return [...this.items].map(({ value: t }) => t);
|
|
166
|
+
}
|
|
167
|
+
}, E = (t) => {
|
|
168
|
+
var e;
|
|
169
|
+
return ((e = t?.textContent) == null ? void 0 : e.trim()) || "";
|
|
170
|
+
}, R = (t) => t instanceof HTMLDataElement, B = ({ control: t }) => t?.disabled || t?.readOnly || !1, O = (t, e) => {
|
|
171
|
+
var o, i;
|
|
172
|
+
const { _focus: n, _texts: a, items: l, control: s, list: d, multiple: u } = t;
|
|
173
|
+
if (!s) return;
|
|
174
|
+
const v = bt(s), p = v.endsWith(z) ? r(s, "data-label") : v;
|
|
175
|
+
r(s, "data-label", p);
|
|
176
|
+
let f = `${p}${u ? `, ${l.length ? a.found.replace("%d", `${l.length}`) : a.empty}` : ""}`;
|
|
177
|
+
const c = [];
|
|
178
|
+
for (const { addedNodes: m, removedNodes: _ } of e?.detail || []) {
|
|
179
|
+
for (const h of m) R(h) && c.unshift(h);
|
|
180
|
+
for (const h of _) R(h) && c.push(h);
|
|
181
|
+
}
|
|
182
|
+
const nt = u ? c.length === 1 : c[0] === n;
|
|
183
|
+
if (n && nt) {
|
|
184
|
+
const m = r(s, "aria-expanded"), _ = r(s, "inputmode"), h = R(n) ? s : n, g = !c[0].isConnected;
|
|
185
|
+
t._speak = `${a[g ? "removed" : "added"]} ${E(c[0])}, `, (I || n === s) && N(t._speak), s !== h && (I && r(s, "aria-expanded", null), I && r(s, "inputmode", "none"), f = gt, s.focus()), setTimeout(() => {
|
|
186
|
+
var k;
|
|
187
|
+
r(s, "aria-expanded", m), r(s, "inputmode", g ? "none" : _), (k = h?.focus) == null || k.call(h), r(s, "inputmode", _), t._speak = "", I ? setTimeout(O, 100, t) : A(t, "blur", () => O(t), tt);
|
|
188
|
+
}, 100);
|
|
189
|
+
}
|
|
190
|
+
let C = 0;
|
|
191
|
+
const b = t.querySelector("select"), at = B(t) ? "" : a.remove, U = (o = t.shadowRoot) == null ? void 0 : o.firstElementChild;
|
|
192
|
+
U && r(U, "aria-label", a.items);
|
|
193
|
+
for (const m of l) {
|
|
194
|
+
const _ = b?.options[C++], h = E(m), g = m.value || h, k = `${t._speak}${h}, ${at}`;
|
|
195
|
+
r(m, "aria-label", k), r(m, "aria-selected", "true"), r(m, "role", "option"), r(m, "slot", "items"), r(m, "tabindex", "-1"), r(m, "value", g), _ ? Object.assign(_, { textContent: h, value: g }) : b?.appendChild(new Option(h, g, !0, !0)), Y && r(m, "title", `${C} ${a.of} ${l.length}`);
|
|
196
|
+
}
|
|
197
|
+
b && r(b, "multiple", u ? "" : null);
|
|
198
|
+
for (const m of [...b?.options || []].slice(C)) m.remove();
|
|
199
|
+
!u && C > 1 && console.warn(t, " Multiple <data> found in single mode."), d && (r(d, "aria-multiselectable", `${u}`), r(s, "list", K(d)), r(s, "aria-label", `${t._speak}${f}${z}`), d.hasAttribute("popover") && (r(s, "popovertarget", K(d)), r(d, "popover", "manual")), d._of = a.of);
|
|
200
|
+
const j = E(l[0]);
|
|
201
|
+
j !== t._item && M(t), t._item = j, ot(t), it(t), (i = H(t)) == null || i.takeRecords();
|
|
202
|
+
}, ot = (t) => {
|
|
203
|
+
var e;
|
|
204
|
+
t.clear && r(t.clear, "role", "button"), t.clear && (t.clear.hidden = !((e = t.control) != null && e.value) || B(t));
|
|
205
|
+
}, it = (t) => {
|
|
206
|
+
var e;
|
|
207
|
+
const { _speak: o, options: i = [], values: n } = t;
|
|
208
|
+
for (const a of i) {
|
|
209
|
+
const l = (e = r(a, "value")) != null ? e : E(a);
|
|
210
|
+
r(a, "aria-label", o ? `${o}${E(a)}` : null), r(a, "selected", n.includes(l) ? "" : null);
|
|
211
|
+
}
|
|
212
|
+
}, M = (t) => {
|
|
213
|
+
const { multiple: e, control: o, items: i } = t, n = E(i[0]);
|
|
214
|
+
!e && o && n !== o.value && Q(o, n, n ? Et : et);
|
|
215
|
+
}, V = (t, e = !0) => {
|
|
216
|
+
var o;
|
|
217
|
+
const { _texts: i, options: n = [], creatable: a, control: l, items: s, multiple: d } = t, u = ((o = l?.value) == null ? void 0 : o.trim()) || "", v = u.toLowerCase() || null;
|
|
218
|
+
let p = [...n].find(
|
|
219
|
+
(c) => (r(c, "label") || E(c)).trim().toLowerCase() === v
|
|
220
|
+
);
|
|
221
|
+
const f = { bubbles: !0, cancelable: !0, detail: p };
|
|
222
|
+
if (t.dispatchEvent(new CustomEvent("comboboxbeforematch", f)) || (p = [...n].find((c) => c.selected)), e)
|
|
223
|
+
return it(t), p ? x(t, p, !1) : a && u ? x(t, { value: u }, !1) : (!d && !u && s[0] ? x(t, s[0]) : M(t), N(i.invalid));
|
|
224
|
+
for (const c of n) c.selected = c === p;
|
|
225
|
+
}, x = (t, e, o = !0) => {
|
|
226
|
+
var i, n, a;
|
|
227
|
+
const { control: l, items: s, multiple: d } = t, u = w("data", e.label || e.value, {
|
|
228
|
+
value: e.value
|
|
229
|
+
}), v = [...s].find((c) => c.value === e.value), p = { bubbles: !0, cancelable: !0, detail: v || u };
|
|
230
|
+
if (v && !o) return M(t);
|
|
231
|
+
if (v === ((i = J(t)) == null ? void 0 : i.activeElement) && ((a = (n = t.shadowRoot) == null ? void 0 : n.querySelector('[role="option"]')) == null || a.focus()), t.dispatchEvent(new CustomEvent("comboboxbeforeselect", p))) {
|
|
232
|
+
if (!d) for (const c of [...s]) c.remove();
|
|
233
|
+
v ? v.remove() : l?.insertAdjacentElement("beforebegin", u), t.dispatchEvent(new CustomEvent("comboboxafterselect", p));
|
|
234
|
+
}
|
|
235
|
+
}, xt = (t, { target: e }) => {
|
|
236
|
+
const { _form: o, control: i, multiple: n } = t;
|
|
237
|
+
e instanceof HTMLElement && (t._focus = e), n && o === void 0 && i && e === i && (t._form = r(i, "form"), r(i, "form", "#")), N();
|
|
238
|
+
}, Ct = (t) => P() || setTimeout(kt, 0, t), kt = (t) => {
|
|
239
|
+
const { _focus: e, _root: o, _form: i, multiple: n, control: a } = t;
|
|
240
|
+
!e || t.contains(o?.activeElement) || (n || V(t), i && a && r(a, "form", i), t._focus = t._form = void 0);
|
|
241
|
+
}, Tt = (t, e) => {
|
|
242
|
+
const { clientX: o, clientY: i, target: n } = e, { clear: a, control: l, items: s } = t;
|
|
243
|
+
if (a?.contains(n))
|
|
244
|
+
return l && Q(l, "", et), l?.focus();
|
|
245
|
+
for (const d of s) {
|
|
246
|
+
const { top: u, right: v, bottom: p, left: f } = d.getBoundingClientRect();
|
|
247
|
+
if (d.contains(n)) return x(t, d);
|
|
248
|
+
if (i >= u && i <= p && o >= f && o <= v) return d.focus();
|
|
249
|
+
}
|
|
250
|
+
n === t && l?.focus();
|
|
251
|
+
}, St = (t, e) => {
|
|
252
|
+
var o;
|
|
253
|
+
const { options: i = [], control: n, multiple: a } = t, l = ((o = n?.value) == null ? void 0 : o.trim()) || "";
|
|
254
|
+
if (e instanceof InputEvent ? !e.inputType || e.inputType === "insertReplacementText" : !!l) {
|
|
255
|
+
e.stopImmediatePropagation(), n && (n.value = t._value);
|
|
256
|
+
for (const d of i)
|
|
257
|
+
if (d.value && d.value === l)
|
|
258
|
+
return x(t, d, a);
|
|
259
|
+
} else a || V(t, !1);
|
|
260
|
+
ot(t);
|
|
261
|
+
}, It = (t, e) => {
|
|
262
|
+
var o;
|
|
263
|
+
const { clear: i, control: n, items: a } = t, { key: l, repeat: s, target: d } = e, u = n && n === d, v = u && n.selectionEnd, p = e.ctrlKey || e.metaKey || e.shiftKey || e.key === "Alt";
|
|
264
|
+
let f = u ? a.length : [...a].indexOf(d);
|
|
265
|
+
if (u && l === "Tab" && !e.shiftKey && i && !i.hidden && (e.preventDefault(), i.tabIndex = 0, i.focus(), A(i, "blur", () => r(i, "tabindex", null), tt)), !(!u && ft(e) || f === -1 || p)) {
|
|
266
|
+
if (l === "ArrowRight" && !u) f += 1;
|
|
267
|
+
else if (l === "ArrowLeft" && !v) f -= 1;
|
|
268
|
+
else {
|
|
269
|
+
if (l === "Enter" && u) return V(t);
|
|
270
|
+
if (l === "Backspace" && !v) {
|
|
271
|
+
if (e.preventDefault(), !s && a[f]) return x(t, a[f]);
|
|
272
|
+
u && (f -= 1);
|
|
273
|
+
} else return u || n?.focus();
|
|
274
|
+
}
|
|
275
|
+
e.preventDefault(), (o = a[Math.max(0, f)] || n) == null || o.focus();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
ht.define("u-combobox", wt);
|
|
279
|
+
export {
|
|
280
|
+
wt as UHTMLComboboxElement,
|
|
281
|
+
Lt as UHTMLComboboxShadowRoot,
|
|
282
|
+
Z as UHTMLComboboxStyle
|
|
283
|
+
};
|
|
284
|
+
//# sourceMappingURL=u-combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u-combobox.js","sources":["../../../../../node_modules/@u-elements/u-combobox/dist/u-combobox.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\n\n// ../utils.ts\nvar IS_BROWSER = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.navigator !== \"undefined\";\nvar IS_ANDROID = IS_BROWSER && /android/i.test(navigator.userAgent);\nvar IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(navigator.userAgent);\nvar _a;\nIS_BROWSER && // @ts-expect-error Typescript has not implemented userAgentData yet https://stackoverflow.com/a/71392474\n/^Mac/i.test(((_a = navigator.userAgentData) == null ? void 0 : _a.platform) || navigator.platform);\nvar FOCUS_OUTLINE = \"outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color\";\nvar UHTMLElement = typeof HTMLElement === \"undefined\" ? class {\n} : HTMLElement;\nfunction attr(el, name, value) {\n if (value === void 0) return el.getAttribute(name);\n if (value === null) el.removeAttribute(name);\n else if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n return null;\n}\nvar events = (action, element, rest) => {\n for (const type of rest[0].split(\",\")) {\n rest[0] = type;\n Element.prototype[`${action}EventListener`].apply(element, rest);\n }\n};\nvar on = (element, ...rest) => events(\"add\", element, rest);\nvar off = (element, ...rest) => events(\"remove\", element, rest);\nvar observers = /* @__PURE__ */ new WeakMap();\nvar mutationObserver = (element, options) => {\n if (options === void 0) return observers.get(element);\n try {\n observers.get(element).disconnect();\n observers.delete(element);\n } catch (_err) {\n }\n if (options) {\n const observer = new MutationObserver(\n (detail) => element.handleEvent({ type: \"mutation\", detail })\n );\n observer.observe(element, options);\n observers.set(element, observer);\n }\n};\nvar asButton = (event) => {\n var _a2;\n const isClick = event.key === \" \" || event.key === \"Enter\";\n if (isClick) (_a2 = event.preventDefault) == null ? void 0 : _a2.call(event);\n if (isClick && event.target instanceof HTMLElement)\n event.target.dispatchEvent(new MouseEvent(\"click\", event));\n return isClick;\n};\nvar getRoot = (node) => {\n var _a2;\n const root = ((_a2 = node.getRootNode) == null ? void 0 : _a2.call(node)) || node.ownerDocument;\n return root instanceof Document || root instanceof ShadowRoot ? root : document;\n};\nvar id = 0;\nvar useId = (el) => {\n if (!el) return \"\";\n if (!el.id) el.id = `:${el.nodeName.toLowerCase()}${(++id).toString(32)}`;\n return el.id;\n};\nvar createElement = (tagName, content, attrs) => {\n const el = document.createElement(tagName);\n if (content) el[tagName === \"style\" ? \"textContent\" : \"innerHTML\"] = content;\n if (attrs) for (const [key, val] of Object.entries(attrs)) attr(el, key, val);\n return el;\n};\nvar customElements = {\n define: (name, instance) => !IS_BROWSER || window.customElements.get(name) || window.customElements.define(name, instance)\n};\nvar getLabel = (el) => {\n var _a2;\n const label = attr(el, \"aria-label\") || \"\";\n const labels = ((_a2 = attr(el, \"aria-labelledby\")) == null ? void 0 : _a2.trim().split(/\\s+/)) || [];\n return [\n ...labels.map((id2) => document.getElementById(id2)),\n // Get all labelledby elements\n ...Array.from(el.labels || [])\n // Get all <label> elements\n ].reduce((acc, el2) => {\n var _a3;\n return acc || ((_a3 = el2 == null ? void 0 : el2.innerText) == null ? void 0 : _a3.trim()) || \"\";\n }, label);\n};\nvar LIVE;\nvar LIVE_SR_FIX = 0;\nvar speak = (text2) => {\n if (!LIVE) {\n LIVE = createElement(\"div\");\n LIVE.style.cssText = \"position:fixed;overflow:hidden;width:1px;white-space:nowrap\";\n attr(LIVE, \"aria-live\", \"assertive\");\n }\n if (!LIVE.isConnected) document.body.append(LIVE);\n if (text2) LIVE.textContent = `${text2}${LIVE_SR_FIX++ % 2 ? \"\\xA0\" : \"\"}`;\n};\nvar setValue = (input, data, type = \"\") => {\n var _a2, _b;\n const event = { bubbles: true, composed: true, data, inputType: type };\n const proto = HTMLInputElement.prototype;\n input.dispatchEvent(new InputEvent(\"beforeinput\", event));\n (_b = (_a2 = Object.getOwnPropertyDescriptor(proto, \"value\")) == null ? void 0 : _a2.set) == null ? void 0 : _b.call(input, data);\n input.dispatchEvent(new InputEvent(\"input\", event));\n input.dispatchEvent(new Event(\"change\", { bubbles: true }));\n};\nvar IS_PRESS = false;\nvar isMouseDown = (event) => {\n if ((event == null ? void 0 : event.type) === \"mouseup\") IS_PRESS = false;\n if ((event == null ? void 0 : event.type) === \"mousedown\") {\n IS_PRESS = true;\n on(document, \"mouseup\", isMouseDown, { once: true });\n }\n return IS_PRESS;\n};\nvar declarativeShadowRoot = (style, slot = \"<slot></slot>\") => `<template shadowrootmode=\"open\">${slot}<style>${style}</style></template>`;\n\n// u-combobox.ts\nvar UHTMLComboboxStyle = `:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */\n:host(:not([data-multiple])) ::slotted(data),\n:host([data-multiple=\"false\"]) ::slotted(data) { display: none } /* Hide data if not multiple */\n[role=\"listbox\"] { position: absolute } /* Avoid affecting CSS like flex on the <u-combobox> */\n::slotted(input[inputmode=\"none\"]) { outline: none } /* Hide temporary foucs outline flash */\n::slotted(del) { text-decoration: none }\n::slotted(data:not([hidden])) { display: inline-block; pointer-events: none }\n::slotted(data)::after { content: '\\\\00D7'; content: '\\\\00D7' / ''; padding-inline: .5ch; pointer-events: auto; cursor: pointer }\n::slotted(data:focus) { ${FOCUS_OUTLINE} }`;\nvar UHTMLComboboxShadowRoot = declarativeShadowRoot(UHTMLComboboxStyle);\nvar EVENTS = \"beforeinput,blur,focus,click,input,keydown,mousedown\";\nvar EVENT_ONCE = { once: true, capture: true, passive: true };\nvar FALSE = \"false\";\nvar IS_MOBILE = IS_ANDROID || IS_IOS;\nvar MODIFIED = \"\\u200B\".repeat(5);\nvar VALUE_DELETE = \"deleteContentBackward\";\nvar VALUE_INSERT = \"insertText\";\nvar WHITE_SPACE = \"\\xA0\";\nvar TEXTS = {\n added: \"Added\",\n empty: \"No selected\",\n found: \"Navigate left to find %d selected\",\n invalid: \"Invalid value\",\n items: \"Selected\",\n // Note: Not announced by NVDA\n of: \"of\",\n remove: \"Press to remove\",\n removed: \"Removed\"\n};\nvar UHTMLComboboxElement = class extends UHTMLElement {\n constructor() {\n super();\n this._item = \"\";\n this._speak = \"\";\n this._texts = __spreadValues({}, TEXTS);\n this._value = \"\";\n if (!this.shadowRoot)\n this.attachShadow({ mode: \"open\" }).append(\n createElement(\"slot\", null, {\n \"aria-orientation\": \"horizontal\",\n tabindex: \"-1\",\n role: \"listbox\",\n // Note: Not announced by JAWS\n name: \"items\"\n }),\n createElement(\"slot\"),\n // Used to prevent exiting JAWS forms mode when an item is removed, using listbox as this forces JAWS to stay in forms mode without mobile keyboard opening\n createElement(\"div\", '<div role=\"option\" tabindex=\"-1\"></div>', {\n \"aria-hidden\": \"true\",\n // Prevent screen readers from announcing this element\n role: \"listbox\"\n }),\n createElement(\"style\", UHTMLComboboxStyle)\n );\n }\n // Using ES2015 syntax for backwards compatibility\n static get observedAttributes() {\n return Object.keys(TEXTS).map((key) => `data-sr-${key}`);\n }\n connectedCallback() {\n this._root = getRoot(this);\n on(this, EVENTS, this, true);\n mutationObserver(this, {\n attributeFilter: [\"value\", \"id\", \"role\"],\n // Respond to changes in <data> value or change of id or role for <datalist> to reconnect with input\n attributes: true,\n characterData: true,\n // Respond to changes in <data> textContent\n childList: true,\n subtree: true\n });\n setTimeout(render, 0, this);\n setTimeout(syncInputValue, 0, this);\n }\n attributeChangedCallback(prop, _, val) {\n const text2 = prop.split(\"data-sr-\")[1];\n if (TEXTS[text2]) this._texts[text2] = val || TEXTS[text2];\n }\n disconnectedCallback() {\n mutationObserver(this, false);\n off(this, EVENTS, this, true);\n this._items = this._clear = this._focus = this._control = void 0;\n this._list = this._options = this._root = this._form = void 0;\n }\n handleEvent(event) {\n const target = event.target;\n if (isDisabled(this)) return;\n if (event.type === \"beforeinput\") this._value = (target == null ? void 0 : target.value) || \"\";\n if (event.type === \"blur\") onBlur(this);\n if (event.type === \"click\") onClick(this, event);\n if (event.type === \"focus\") onFocus(this, event);\n if (event.type === \"input\") onInput(this, event);\n if (event.type === \"keydown\") onKeyDown(this, event);\n if (event.type === \"mousedown\") isMouseDown(event);\n if (event.type === \"mutation\") render(this, event);\n }\n get multiple() {\n var _a2;\n return ((_a2 = attr(this, \"data-multiple\")) != null ? _a2 : FALSE) !== FALSE;\n }\n set multiple(value) {\n attr(this, \"data-multiple\", value ? \"\" : null);\n }\n get creatable() {\n var _a2;\n return ((_a2 = attr(this, \"data-creatable\")) != null ? _a2 : FALSE) !== FALSE;\n }\n set creatable(value) {\n attr(this, \"data-creatable\", value ? \"\" : null);\n }\n get control() {\n var _a2;\n if (!((_a2 = this._control) == null ? void 0 : _a2.isConnected))\n this._control = this.querySelector(\"input\");\n return this._control;\n }\n get list() {\n var _a2;\n if (!((_a2 = this._list) == null ? void 0 : _a2.isConnected))\n this._list = this.querySelector('datalist,[role=\"listbox\"]');\n return this._list;\n }\n get clear() {\n var _a2;\n if (!((_a2 = this._clear) == null ? void 0 : _a2.isConnected)) this._clear = this.querySelector(\"del\");\n return this._clear;\n }\n get items() {\n if (!this._items) this._items = this.getElementsByTagName(\"data\");\n return this._items;\n }\n get options() {\n var _a2, _b;\n if (!this._options) {\n const tag = (_b = (_a2 = this.list) == null ? void 0 : _a2.querySelector('[role=\"option\"],option')) == null ? void 0 : _b.nodeName;\n if (tag) this._options = this.getElementsByTagName(tag);\n }\n return this._options;\n }\n get values() {\n return [...this.items].map(({ value }) => value);\n }\n};\nvar text = (el) => {\n var _a2;\n return ((_a2 = el == null ? void 0 : el.textContent) == null ? void 0 : _a2.trim()) || \"\";\n};\nvar isData = (el) => el instanceof HTMLDataElement;\nvar isDisabled = ({ control }) => (control == null ? void 0 : control.disabled) || (control == null ? void 0 : control.readOnly) || false;\nvar render = (self, event) => {\n var _a2, _b;\n const { _focus, _texts, items, control, list, multiple } = self;\n if (!control) return;\n const prev = getLabel(control);\n const next = prev.endsWith(MODIFIED) ? attr(control, \"data-label\") : prev;\n attr(control, \"data-label\", next);\n let label = `${next}${multiple ? `, ${items.length ? _texts.found.replace(\"%d\", `${items.length}`) : _texts.empty}` : \"\"}`;\n const edits = [];\n for (const { addedNodes, removedNodes } of (event == null ? void 0 : event.detail) || []) {\n for (const el of addedNodes) if (isData(el)) edits.unshift(el);\n for (const el of removedNodes) if (isData(el)) edits.push(el);\n }\n const shouldAnnounce = multiple ? edits.length === 1 : edits[0] === _focus;\n if (_focus && shouldAnnounce) {\n const ariaExpanded = attr(control, \"aria-expanded\");\n const inputMode = attr(control, \"inputmode\");\n const nextFocus = isData(_focus) ? control : _focus;\n const isRemove = !edits[0].isConnected;\n self._speak = `${_texts[isRemove ? \"removed\" : \"added\"]} ${text(edits[0])}, `;\n if (IS_MOBILE || _focus === control) speak(self._speak);\n if (control !== nextFocus) {\n if (IS_MOBILE) attr(control, \"aria-expanded\", null);\n if (IS_MOBILE) attr(control, \"inputmode\", \"none\");\n label = WHITE_SPACE;\n control.focus();\n }\n setTimeout(() => {\n var _a3;\n attr(control, \"aria-expanded\", ariaExpanded);\n attr(control, \"inputmode\", isRemove ? \"none\" : inputMode);\n (_a3 = nextFocus == null ? void 0 : nextFocus.focus) == null ? void 0 : _a3.call(nextFocus);\n attr(control, \"inputmode\", inputMode);\n self._speak = \"\";\n if (IS_MOBILE)\n setTimeout(render, 100, self);\n else on(self, \"blur\", () => render(self), EVENT_ONCE);\n }, 100);\n }\n let idx = 0;\n const select = self.querySelector(\"select\");\n const remove = isDisabled(self) ? \"\" : _texts.remove;\n const itemsList = (_a2 = self.shadowRoot) == null ? void 0 : _a2.firstElementChild;\n if (itemsList) attr(itemsList, \"aria-label\", _texts.items);\n for (const item2 of items) {\n const option = select == null ? void 0 : select.options[idx++];\n const label2 = text(item2);\n const value = item2.value || label2;\n const aria = `${self._speak}${label2}, ${remove}`;\n attr(item2, \"aria-label\", aria);\n attr(item2, \"aria-selected\", \"true\");\n attr(item2, \"role\", \"option\");\n attr(item2, \"slot\", \"items\");\n attr(item2, \"tabindex\", \"-1\");\n attr(item2, \"value\", value);\n if (option) Object.assign(option, { textContent: label2, value });\n else select == null ? void 0 : select.appendChild(new Option(label2, value, true, true));\n if (IS_IOS) attr(item2, \"title\", `${idx} ${_texts.of} ${items.length}`);\n }\n if (select) attr(select, \"multiple\", multiple ? \"\" : null);\n for (const opt of [...(select == null ? void 0 : select.options) || []].slice(idx)) opt.remove();\n if (!multiple && idx > 1)\n console.warn(self, ` Multiple <data> found in single mode.`);\n if (list) {\n attr(list, \"aria-multiselectable\", `${multiple}`);\n attr(control, \"list\", useId(list));\n attr(control, \"aria-label\", `${self._speak}${label}${MODIFIED}`);\n if (list.hasAttribute(\"popover\")) {\n attr(control, \"popovertarget\", useId(list));\n attr(list, \"popover\", \"manual\");\n }\n list._of = _texts.of;\n }\n const item = text(items[0]);\n if (item !== self._item) syncInputValue(self);\n self._item = item;\n syncClearWithInput(self);\n syncOptionsWithItems(self);\n (_b = mutationObserver(self)) == null ? void 0 : _b.takeRecords();\n};\nvar syncClearWithInput = (self) => {\n var _a2;\n if (self.clear) attr(self.clear, \"role\", \"button\");\n if (self.clear) self.clear.hidden = !((_a2 = self.control) == null ? void 0 : _a2.value) || isDisabled(self);\n};\nvar syncOptionsWithItems = (self) => {\n var _a2;\n const { _speak, options = [], values } = self;\n for (const opt of options) {\n const value = (_a2 = attr(opt, \"value\")) != null ? _a2 : text(opt);\n attr(opt, \"aria-label\", _speak ? `${_speak}${text(opt)}` : null);\n attr(opt, \"selected\", values.includes(value) ? \"\" : null);\n }\n};\nvar syncInputValue = (self) => {\n const { multiple, control, items } = self;\n const value = text(items[0]);\n if (!multiple && control && value !== control.value)\n setValue(control, value, value ? VALUE_INSERT : VALUE_DELETE);\n};\nvar dispatchMatch = (self, change = true) => {\n var _a2;\n const { _texts, options = [], creatable, control, items, multiple } = self;\n const value = ((_a2 = control == null ? void 0 : control.value) == null ? void 0 : _a2.trim()) || \"\";\n const query = value.toLowerCase() || null;\n let match = [...options].find(\n (opt) => (attr(opt, \"label\") || text(opt)).trim().toLowerCase() === query\n );\n const event = { bubbles: true, cancelable: true, detail: match };\n if (!self.dispatchEvent(new CustomEvent(\"comboboxbeforematch\", event)))\n match = [...options].find((o) => o.selected);\n if (change) {\n syncOptionsWithItems(self);\n if (match) return dispatchChange(self, match, false);\n if (creatable && value) return dispatchChange(self, { value }, false);\n if (!multiple && !value && items[0]) dispatchChange(self, items[0]);\n else syncInputValue(self);\n return speak(_texts.invalid);\n }\n for (const opt of options) opt.selected = opt === match;\n};\nvar dispatchChange = (self, item, removable = true) => {\n var _a2, _b, _c;\n const { control, items, multiple } = self;\n const add = createElement(\"data\", item.label || item.value, {\n value: item.value\n });\n const remove = [...items].find((i) => i.value === item.value);\n const event = { bubbles: true, cancelable: true, detail: remove || add };\n const skip = remove && !removable;\n if (skip) return syncInputValue(self);\n if (remove === ((_a2 = getRoot(self)) == null ? void 0 : _a2.activeElement))\n (_c = (_b = self.shadowRoot) == null ? void 0 : _b.querySelector('[role=\"option\"]')) == null ? void 0 : _c.focus();\n if (self.dispatchEvent(new CustomEvent(\"comboboxbeforeselect\", event))) {\n if (!multiple) for (const item2 of [...items]) item2.remove();\n if (remove) remove.remove();\n else control == null ? void 0 : control.insertAdjacentElement(\"beforebegin\", add);\n self.dispatchEvent(new CustomEvent(\"comboboxafterselect\", event));\n }\n};\nvar onFocus = (self, { target }) => {\n const { _form, control, multiple } = self;\n if (target instanceof HTMLElement) self._focus = target;\n if (multiple && _form === void 0 && control && target === control) {\n self._form = attr(control, \"form\");\n attr(control, \"form\", \"#\");\n }\n speak();\n};\nvar onBlur = (self) => isMouseDown() || setTimeout(onBlurred, 0, self);\nvar onBlurred = (self) => {\n const { _focus, _root, _form, multiple, control } = self;\n if (!_focus || self.contains(_root == null ? void 0 : _root.activeElement)) return;\n if (!multiple) dispatchMatch(self);\n if (_form && control) attr(control, \"form\", _form);\n self._focus = self._form = void 0;\n};\nvar onClick = (self, event) => {\n const { clientX: x, clientY: y, target } = event;\n const { clear, control, items } = self;\n if (clear == null ? void 0 : clear.contains(target)) {\n if (control) setValue(control, \"\", VALUE_DELETE);\n return control == null ? void 0 : control.focus();\n }\n for (const item of items) {\n const { top, right, bottom, left } = item.getBoundingClientRect();\n if (item.contains(target)) return dispatchChange(self, item);\n if (y >= top && y <= bottom && x >= left && x <= right) return item.focus();\n }\n if (target === self) control == null ? void 0 : control.focus();\n};\nvar onInput = (self, event) => {\n var _a2;\n const { options = [], control, multiple } = self;\n const value = ((_a2 = control == null ? void 0 : control.value) == null ? void 0 : _a2.trim()) || \"\";\n const isClick = event instanceof InputEvent ? !event.inputType || event.inputType === \"insertReplacementText\" : !!value;\n if (isClick) {\n event.stopImmediatePropagation();\n if (control) control.value = self._value;\n for (const opt of options)\n if (opt.value && opt.value === value)\n return dispatchChange(self, opt, multiple);\n } else if (!multiple) dispatchMatch(self, false);\n syncClearWithInput(self);\n};\nvar onKeyDown = (self, event) => {\n var _a2;\n const { clear, control, items } = self;\n const { key, repeat, target } = event;\n const isControl = control && control === target;\n const inText = isControl && control.selectionEnd;\n const isModified = event.ctrlKey || event.metaKey || event.shiftKey || event.key === \"Alt\";\n let index = isControl ? items.length : [...items].indexOf(target);\n if (isControl && key === \"Tab\" && !event.shiftKey && clear && !clear.hidden) {\n event.preventDefault();\n clear.tabIndex = 0;\n clear.focus();\n on(clear, \"blur\", () => attr(clear, \"tabindex\", null), EVENT_ONCE);\n }\n if (!isControl && asButton(event) || index === -1 || isModified) return;\n if (key === \"ArrowRight\" && !isControl) index += 1;\n else if (key === \"ArrowLeft\" && !inText) index -= 1;\n else if (key === \"Enter\" && isControl) return dispatchMatch(self);\n else if (key === \"Backspace\" && !inText) {\n event.preventDefault();\n if (!repeat && items[index]) return dispatchChange(self, items[index]);\n if (isControl) index -= 1;\n } else return isControl || (control == null ? void 0 : control.focus());\n event.preventDefault();\n (_a2 = items[Math.max(0, index)] || control) == null ? void 0 : _a2.focus();\n};\ncustomElements.define(\"u-combobox\", UHTMLComboboxElement);\n\nexport { UHTMLComboboxElement, UHTMLComboboxShadowRoot, UHTMLComboboxStyle };\n"],"names":["__defProp","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","obj","key","value","__spreadValues","a","b","prop","IS_BROWSER","IS_ANDROID","IS_IOS","_a","FOCUS_OUTLINE","UHTMLElement","attr","el","name","events","action","element","rest","type","on","off","observers","mutationObserver","options","observer","detail","asButton","event","_a2","isClick","getRoot","node","root","id","useId","createElement","tagName","content","attrs","val","customElements","instance","getLabel","label","id2","acc","el2","_a3","LIVE","LIVE_SR_FIX","speak","text2","setValue","input","data","_b","proto","IS_PRESS","isMouseDown","declarativeShadowRoot","style","slot","UHTMLComboboxStyle","UHTMLComboboxShadowRoot","EVENTS","EVENT_ONCE","FALSE","IS_MOBILE","MODIFIED","VALUE_DELETE","VALUE_INSERT","WHITE_SPACE","TEXTS","UHTMLComboboxElement","render","syncInputValue","_","target","isDisabled","onBlur","onClick","onFocus","onInput","onKeyDown","tag","text","isData","control","self","_focus","_texts","items","list","multiple","prev","next","edits","addedNodes","removedNodes","shouldAnnounce","ariaExpanded","inputMode","nextFocus","isRemove","idx","select","remove","itemsList","item2","option","label2","aria","opt","item","syncClearWithInput","syncOptionsWithItems","_speak","values","dispatchMatch","change","creatable","query","match","o","dispatchChange","removable","_c","add","i","_form","onBlurred","_root","x","y","clear","top","right","bottom","left","repeat","isControl","inText","isModified","index"],"mappings":"AAAA,IAAIA,KAAY,OAAO,gBACnBC,IAAsB,OAAO,uBAC7BC,KAAe,OAAO,UAAU,gBAChCC,KAAe,OAAO,UAAU,sBAChCC,IAAkB,CAACC,GAAKC,GAA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