@mattilsynet/design 3.0.0 → 3.0.2

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.
@@ -24,7 +24,7 @@ class m extends C {
24
24
  "style",
25
25
  null,
26
26
  `@layer leaflet{${f}}
27
- @layer mt.v3-0-0design{${b}`
27
+ @layer mt.v3-0-2design{${b}`
28
28
  ),
29
29
  r("figure")
30
30
  );
@@ -1,32 +1,39 @@
1
- import { DSFieldElement as u } from "@digdir/designsystemet-web";
2
- import d from "./styles.module.css.js";
3
- import { getByCSSModule as n, isBrowser as i, onHotReload as p, on as g, onMutation as b, QUICK_EVENT as y, debounce as S, attr as s } from "./utils.js";
1
+ import { DSFieldElement as p } from "@digdir/designsystemet-web";
2
+ import l from "./styles.module.css.js";
3
+ import { getByCSSModule as n, isBrowser as i, onHotReload as g, on as b, onMutation as y, QUICK_EVENT as S, debounce as E, attr as s } from "./utils.js";
4
4
  const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (t, e, r) => window.dsWarnings === !1 || console.warn(
5
5
  `\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,
6
6
  r
7
- ), E = n("togglegroup"), D = () => {
8
- for (const t of E)
7
+ ), D = n("togglegroup"), u = l.button.split(" "), A = () => {
8
+ for (const t of D) {
9
9
  a(t) && !t.hasAttribute("data-toggle-group") && (s(t, "data-toggle-group", "Valgknapper"), o(
10
10
  'Only setting class="styles.togglegroup"',
11
11
  'data-toggle-group="LABEL-HERE" attribute also for better accessibility',
12
12
  t
13
13
  ));
14
- }, A = n("breadcrumbs"), R = () => {
15
- for (const t of A)
16
- a(t) && t.nodeName !== "DS-BREADCRUMBS" && (t.classList.add(...d.breadcrumbs.split(" ")), o(
14
+ for (const e of t.getElementsByTagName("label"))
15
+ a(e) && !e.classList.contains(u[0]) && (e.classList.add(...u), o(
16
+ 'Only setting class="styles.button"',
17
+ '<label class="styles.button">',
18
+ e
19
+ ));
20
+ }
21
+ }, L = n("breadcrumbs"), O = () => {
22
+ for (const t of L)
23
+ a(t) && t.nodeName !== "DS-BREADCRUMBS" && (t.classList.add(...l.breadcrumbs.split(" ")), o(
17
24
  'Only setting class="styles.breadcrumbs"',
18
25
  '<ds-breadcrumbs class="styles.breadcrumbs">',
19
26
  t
20
27
  ));
21
- }, w = n("errorsummary"), C = () => {
22
- for (const t of w)
28
+ }, C = n("errorsummary"), N = () => {
29
+ for (const t of C)
23
30
  a(t) && t.nodeName !== "DS-ERROR-SUMMARY" && o(
24
31
  'Only setting class="styles.errorsummary"',
25
32
  '<ds-error-summary class="styles.errorsummary">',
26
33
  t
27
34
  );
28
- }, L = n("dialog"), O = () => {
29
- for (const t of L)
35
+ }, R = n("dialog"), w = () => {
36
+ for (const t of R)
30
37
  if (a(t) && (t.hasAttribute("data-variant") && o(
31
38
  '<dialog data-variant="drawer">',
32
39
  '<dialog data-placement="center|left|right|top|bottom">',
@@ -43,17 +50,17 @@ const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (
43
50
  t
44
51
  ), s(t, "open", null), t.showModal()) : t.matches(":modal:not([open])") && (s(t, "open", ""), t.close());
45
52
  }
46
- }, h = () => {
53
+ }, B = () => {
47
54
  for (const t of document.querySelectorAll("[data-count]"))
48
55
  if (a(t)) {
49
56
  const e = s(t, "data-count");
50
- t.classList.add(...d.validation.split(" ")), s(t, "data-limit", e), o(
57
+ t.classList.add(...l.validation.split(" ")), s(t, "data-limit", e), o(
51
58
  `data-count="${e}"`,
52
59
  `class="styles.validation" data-field="counter" data-limit="${e}"`,
53
60
  t
54
61
  );
55
62
  }
56
- }, I = () => {
63
+ }, T = () => {
57
64
  for (const t of document.querySelectorAll("[data-command]"))
58
65
  if (a(t)) {
59
66
  const e = s(t, "data-command");
@@ -67,42 +74,42 @@ const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (
67
74
  t
68
75
  );
69
76
  }
70
- }, N = i() ? document.getElementsByTagName("u-tabs") : [], B = () => {
71
- for (const t of N) a(t) && o("u-tabs", "ds-tabs", t);
72
- }, l = d.suggestion.split(" "), T = i() ? document.getElementsByTagName("u-combobox") : [], v = i() ? document.getElementsByTagName("ds-suggestion") : [], $ = () => {
73
- for (const t of T)
74
- a(t) && (t.classList.add(...l), o("<u-combobox>", '<ds-suggestion class="styles.suggestion">', t));
77
+ }, h = i() ? document.getElementsByTagName("u-tabs") : [], I = () => {
78
+ for (const t of h) a(t) && o("u-tabs", "ds-tabs", t);
79
+ }, d = l.suggestion.split(" "), v = i() ? document.getElementsByTagName("u-combobox") : [], $ = i() ? document.getElementsByTagName("ds-suggestion") : [], M = () => {
75
80
  for (const t of v)
76
- a(t) && !t.classList.contains(l[0]) && (t.classList.add(...l), o(
81
+ a(t) && (t.classList.add(...d), o("<u-combobox>", '<ds-suggestion class="styles.suggestion">', t));
82
+ for (const t of $)
83
+ a(t) && !t.classList.contains(d[0]) && (t.classList.add(...d), o(
77
84
  "Only using <ds-suggestion>",
78
85
  '<ds-suggestion class="styles.suggestion">',
79
86
  t
80
87
  ));
81
- }, M = ({ target: t }) => {
88
+ }, U = ({ target: t }) => {
82
89
  if (!(t instanceof Element)) return;
83
90
  const e = t?.closest("tr")?.querySelector('[data-command="row"]');
84
91
  e && !t?.closest('a,button,label,input,select,textarea,[role="button"]') && e.click();
85
92
  const m = t?.closest("dialog");
86
93
  m && t?.closest('[data-command="close"]') && m.close();
87
- }, k = n("field"), c = /* @__PURE__ */ new Set(), U = () => {
94
+ }, k = n("field"), c = /* @__PURE__ */ new Set(), F = () => {
88
95
  for (const t of k)
89
96
  t.nodeName !== "DS-FIELD" && (a(t) || o(
90
97
  'Only setting class="styles.field"',
91
98
  '<ds-field class="styles.field">',
92
99
  t
93
- ), !c.has(t) && c.add(t) && u.prototype.connectedCallback.call(t));
94
- }, F = () => {
100
+ ), !c.has(t) && c.add(t) && p.prototype.connectedCallback.call(t));
101
+ }, G = () => {
95
102
  for (const t of c)
96
- u.prototype.disconnectedCallback.call(t), c.delete(t);
97
- }, G = `[data-description], .${d.field.split(" ")[0]} label + p`, x = () => {
98
- for (const t of document.querySelectorAll(G))
103
+ p.prototype.disconnectedCallback.call(t), c.delete(t);
104
+ }, x = `[data-description], .${l.field.split(" ")[0]} label + p`, q = () => {
105
+ for (const t of document.querySelectorAll(x))
99
106
  a(t) && t.getAttribute("data-field") !== "description" && (s(t, "data-field", "description"), o(
100
107
  "Descriptions created by data-description of <p> only",
101
108
  'data-field="data-description"',
102
109
  t
103
110
  ));
104
- }, q = n("validation"), P = () => {
105
- for (const t of q)
111
+ }, P = n("validation"), _ = () => {
112
+ for (const t of P)
106
113
  a(t) && !t.hasAttribute("data-field") && (s(t, "data-field", "validation"), o(
107
114
  'Only setting class="styles.validation"',
108
115
  'class="styles.validation" data-field="validation"',
@@ -111,14 +118,14 @@ const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (
111
118
  }, V = () => {
112
119
  for (const t of document.querySelectorAll("[popover][data-position]"))
113
120
  a(t) && (s(t, "data-placement", s(t, "data-position")), o("data-position", "data-placement", t));
114
- }, _ = S(() => {
115
- h(), I(), R(), O(), C(), x(), P(), V(), U(), D(), $(), B();
121
+ }, W = E(() => {
122
+ B(), T(), O(), w(), N(), q(), _(), V(), F(), A(), M(), I();
116
123
  }, 200);
117
- p("deprecations", () => [
118
- F,
124
+ g("deprecations", () => [
125
+ G,
119
126
  // Return as cleanup function
120
- g(document, "click", M, y),
121
- b(document, _, {
127
+ b(document, "click", U, S),
128
+ y(document, W, {
122
129
  attributeFilter: [
123
130
  "class",
124
131
  "data-command",
@@ -1 +1 @@
1
- {"version":3,"file":"deprecations.js","sources":["../designsystem/deprecations.ts"],"sourcesContent":["import { DSFieldElement } from \"@digdir/designsystemet-web\";\nimport styles from \"./styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tgetByCSSModule,\n\tisBrowser,\n\ton,\n\tonHotReload,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"./utils\";\n\nconst DEPRECATIONS = new WeakSet<Element>();\nconst deprecate = (el: Element) =>\n\t!DEPRECATIONS.has(el) && DEPRECATIONS.add(el);\n\nconst warn = (from: string, to: string, el: Element) =>\n\twindow.dsWarnings === false ||\n\tconsole.warn(\n\t\t`\\x1B[1m@mattilsynet/design:\\x1B[m ${from} is deprecated, please use ${to}:`,\n\t\tel,\n\t);\n\n// Deprecate togglegroup without data-toggle-group attribute\nconst TOGGLEGROUPS = getByCSSModule(\"togglegroup\");\nconst deprecateToggleGroup = () => {\n\tfor (const el of TOGGLEGROUPS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-toggle-group\")) {\n\t\t\tattr(el, \"data-toggle-group\", \"Valgknapper\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.togglegroup\"',\n\t\t\t\t'data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst BREADCRUMBS = getByCSSModule(\"breadcrumbs\");\nconst deprecateBreadcrumbs = () => {\n\tfor (const el of BREADCRUMBS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-BREADCRUMBS\") {\n\t\t\tel.classList.add(...styles.breadcrumbs.split(\" \"));\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.breadcrumbs\"',\n\t\t\t\t'<ds-breadcrumbs class=\"styles.breadcrumbs\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst ERRORSUMMARYS = getByCSSModule(\"errorsummary\");\nconst deprecateErrorSummary = () => {\n\tfor (const el of ERRORSUMMARYS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-ERROR-SUMMARY\") {\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.errorsummary\"',\n\t\t\t\t'<ds-error-summary class=\"styles.errorsummary\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-variant and data-modal and data-closedby on dialogs\nconst DIALOGS = getByCSSModule(\"dialog\") as HTMLCollectionOf<HTMLDialogElement>;\nconst deprecateDialog = () => {\n\tfor (const el of DIALOGS) {\n\t\tif (!deprecate(el)) continue;\n\t\tif (el.hasAttribute(\"data-variant\")) {\n\t\t\twarn(\n\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tif (el.isConnected && el.showModal && el.close) {\n\t\t\tconst closedby = attr(el, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(el, \"closedby\", closedby);\n\t\t\t\twarn(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (el.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t\tattr(el, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tel.showModal();\n\t\t\t} else if (el.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(el, \"open\", \"\"); // Set as open\n\t\t\t\tel.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate data-count in favor of data-limit\nconst deprecateCounter = () => {\n\tfor (const el of document.querySelectorAll(\"[data-count]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst count = attr(el, \"data-count\");\n\t\t\tel.classList.add(...styles.validation.split(\" \"));\n\t\t\tattr(el, \"data-limit\", count);\n\t\t\twarn(\n\t\t\t\t`data-count=\"${count}\"`,\n\t\t\t\t`class=\"styles.validation\" data-field=\"counter\" data-limit=\"${count}\"`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-command on buttons and other elements\nconst deprecateDataCommand = () => {\n\tfor (const el of document.querySelectorAll(\"[data-command]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst command = attr(el, \"data-command\");\n\n\t\t\tif (command === \"row\")\n\t\t\t\twarn(\n\t\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\twarn(\n\t\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t}\n};\n\n// Deprecate u-tabs\nconst TABS = isBrowser() ? document.getElementsByTagName(\"u-tabs\") : [];\nconst deprecateUTabs = () => {\n\tfor (const el of TABS) if (deprecate(el)) warn(\"u-tabs\", \"ds-tabs\", el);\n};\n\n// Deprecate u-combobox and add class to ds-suggestion\nconst CSS_SUGGESTION = styles.suggestion.split(\" \");\nconst OLD = isBrowser() ? document.getElementsByTagName(\"u-combobox\") : [];\nconst NEW = isBrowser() ? document.getElementsByTagName(\"ds-suggestion\") : [];\nconst deprecateUCombobox = () => {\n\tfor (const el of OLD)\n\t\tif (deprecate(el)) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\"<u-combobox>\", `<ds-suggestion class=\"styles.suggestion\">`, el);\n\t\t}\n\tfor (const el of NEW)\n\t\tif (deprecate(el) && !el.classList.contains(CSS_SUGGESTION[0])) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\n\t\t\t\t\"Only using <ds-suggestion>\",\n\t\t\t\t`<ds-suggestion class=\"styles.suggestion\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst handleCommandClick = ({ target: el }: Event) => {\n\tif (el instanceof Element === false) return;\n\tconst row = el?.closest(\"tr\")?.querySelector('[data-command=\"row\"]');\n\tconst click =\n\t\trow && !el?.closest('a,button,label,input,select,textarea,[role=\"button\"]');\n\tif (click) (row as HTMLElement).click(); // Forward click to data-command=\"row\" element\n\n\tconst dialog = el?.closest(\"dialog\");\n\tconst close = dialog && el?.closest('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\n// Deprecate fields without ds-field element\nconst FIELDS = getByCSSModule(\"field\");\nconst FIELD_UNBIND = new Set<Element>();\nconst deprecateField = () => {\n\tfor (const el of FIELDS)\n\t\tif (el.nodeName !== \"DS-FIELD\") {\n\t\t\tif (!deprecate(el))\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.field\"',\n\t\t\t\t\t'<ds-field class=\"styles.field\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\tif (!FIELD_UNBIND.has(el) && FIELD_UNBIND.add(el)) {\n\t\t\t\tDSFieldElement.prototype.connectedCallback.call(el as DSFieldElement);\n\t\t\t}\n\t\t}\n};\nconst unbindFields = () => {\n\tfor (const el of FIELD_UNBIND) {\n\t\tDSFieldElement.prototype.disconnectedCallback.call(el as DSFieldElement);\n\t\tFIELD_UNBIND.delete(el);\n\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst CSS_DESCRIPTIONS = `[data-description], .${styles.field.split(\" \")[0]} label + p`;\nconst deprecateFeildDescription = () => {\n\tfor (const el of document.querySelectorAll(CSS_DESCRIPTIONS))\n\t\tif (deprecate(el) && el.getAttribute(\"data-field\") !== \"description\") {\n\t\t\tattr(el, \"data-field\", \"description\");\n\t\t\twarn(\n\t\t\t\t\"Descriptions created by data-description of <p> only\",\n\t\t\t\t'data-field=\"data-description\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst VALIDATIONS = getByCSSModule(\"validation\");\nconst deprecateFieldValidation = () => {\n\tfor (const el of VALIDATIONS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-field\")) {\n\t\t\tattr(el, \"data-field\", \"validation\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.validation\"',\n\t\t\t\t'class=\"styles.validation\" data-field=\"validation\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst deprecatePopoverPosition = () => {\n\tfor (const el of document.querySelectorAll(\"[popover][data-position]\"))\n\t\tif (deprecate(el)) {\n\t\t\tattr(el, \"data-placement\", attr(el, \"data-position\"));\n\t\t\twarn(\"data-position\", \"data-placement\", el);\n\t\t}\n};\n\nconst handleDeprecations = debounce(() => {\n\tdeprecateCounter();\n\tdeprecateDataCommand();\n\tdeprecateBreadcrumbs();\n\tdeprecateDialog();\n\tdeprecateErrorSummary();\n\tdeprecateFeildDescription();\n\tdeprecateFieldValidation();\n\tdeprecatePopoverPosition();\n\tdeprecateField(); // Should run after other field deprecations to access correct data-attributes\n\tdeprecateToggleGroup();\n\tdeprecateUCombobox();\n\tdeprecateUTabs();\n}, 200);\n\nonHotReload(\"deprecations\", () => [\n\tunbindFields, // Return as cleanup function\n\ton(document, \"click\", handleCommandClick, QUICK_EVENT),\n\tonMutation(document, handleDeprecations, {\n\t\tattributeFilter: [\n\t\t\t\"class\",\n\t\t\t\"data-command\",\n\t\t\t\"data-count\",\n\t\t\t\"data-description\",\n\t\t\t\"data-variant\",\n\t\t\t\"open\",\n\t\t],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["DEPRECATIONS","deprecate","el","warn","from","to","TOGGLEGROUPS","getByCSSModule","deprecateToggleGroup","attr","BREADCRUMBS","deprecateBreadcrumbs","styles","ERRORSUMMARYS","deprecateErrorSummary","DIALOGS","deprecateDialog","closedby","deprecateCounter","count","deprecateDataCommand","command","TABS","isBrowser","deprecateUTabs","CSS_SUGGESTION","OLD","NEW","deprecateUCombobox","handleCommandClick","row","dialog","FIELDS","FIELD_UNBIND","deprecateField","DSFieldElement","unbindFields","CSS_DESCRIPTIONS","deprecateFeildDescription","VALIDATIONS","deprecateFieldValidation","deprecatePopoverPosition","handleDeprecations","debounce","onHotReload","on","QUICK_EVENT","onMutation"],"mappings":";;;AAaA,MAAMA,wBAAmB,QAAA,GACnBC,IAAY,CAACC,MAClB,CAACF,EAAa,IAAIE,CAAE,KAAKF,EAAa,IAAIE,CAAE,GAEvCC,IAAO,CAACC,GAAcC,GAAYH,MACvC,OAAO,eAAe,MACtB,QAAQ;AAAA,EACP,qCAAqCE,CAAI,8BAA8BC,CAAE;AAAA,EACzEH;AACD,GAGKI,IAAeC,EAAe,aAAa,GAC3CC,IAAuB,MAAM;AAClC,aAAWN,KAAMI;AAChB,IAAIL,EAAUC,CAAE,KAAK,CAACA,EAAG,aAAa,mBAAmB,MACxDO,EAAKP,GAAI,qBAAqB,aAAa,GAC3CC;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAGJ,GAGMQ,IAAcH,EAAe,aAAa,GAC1CI,IAAuB,MAAM;AAClC,aAAWT,KAAMQ;AAChB,IAAIT,EAAUC,CAAE,KAAKA,EAAG,aAAa,qBACpCA,EAAG,UAAU,IAAI,GAAGU,EAAO,YAAY,MAAM,GAAG,CAAC,GACjDT;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAGJ,GAGMW,IAAgBN,EAAe,cAAc,GAC7CO,IAAwB,MAAM;AACnC,aAAWZ,KAAMW;AAChB,IAAIZ,EAAUC,CAAE,KAAKA,EAAG,aAAa,sBACpCC;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAGJ,GAGMa,IAAUR,EAAe,QAAQ,GACjCS,IAAkB,MAAM;AAC7B,aAAWd,KAAMa;AAChB,QAAKd,EAAUC,CAAE,MACbA,EAAG,aAAa,cAAc,KACjCC;AAAA,MACC;AAAA,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AAAA,EACrDC,EAAW,UAAUL,GAAoB;AAAA,IACxC,iBAAiB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAED,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,CACT;AACF,CAAC;"}
1
+ {"version":3,"file":"deprecations.js","sources":["../designsystem/deprecations.ts"],"sourcesContent":["import { DSFieldElement } from \"@digdir/designsystemet-web\";\nimport styles from \"./styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tgetByCSSModule,\n\tisBrowser,\n\ton,\n\tonHotReload,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"./utils\";\n\nconst DEPRECATIONS = new WeakSet<Element>();\nconst deprecate = (el: Element) =>\n\t!DEPRECATIONS.has(el) && DEPRECATIONS.add(el);\n\nconst warn = (from: string, to: string, el: Element) =>\n\twindow.dsWarnings === false ||\n\tconsole.warn(\n\t\t`\\x1B[1m@mattilsynet/design:\\x1B[m ${from} is deprecated, please use ${to}:`,\n\t\tel,\n\t);\n\n// Deprecate togglegroup without data-toggle-group attribute\nconst TOGGLEGROUPS = getByCSSModule(\"togglegroup\");\nconst CSS_BUTTON = styles.button.split(\" \");\nconst deprecateToggleGroup = () => {\n\tfor (const el of TOGGLEGROUPS) {\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-toggle-group\")) {\n\t\t\tattr(el, \"data-toggle-group\", \"Valgknapper\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.togglegroup\"',\n\t\t\t\t'data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tfor (const label of el.getElementsByTagName(\"label\")) {\n\t\t\tif (deprecate(label) && !label.classList.contains(CSS_BUTTON[0])) {\n\t\t\t\tlabel.classList.add(...CSS_BUTTON);\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.button\"',\n\t\t\t\t\t`<label class=\"styles.button\">`,\n\t\t\t\t\tlabel,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst BREADCRUMBS = getByCSSModule(\"breadcrumbs\");\nconst deprecateBreadcrumbs = () => {\n\tfor (const el of BREADCRUMBS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-BREADCRUMBS\") {\n\t\t\tel.classList.add(...styles.breadcrumbs.split(\" \"));\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.breadcrumbs\"',\n\t\t\t\t'<ds-breadcrumbs class=\"styles.breadcrumbs\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst ERRORSUMMARYS = getByCSSModule(\"errorsummary\");\nconst deprecateErrorSummary = () => {\n\tfor (const el of ERRORSUMMARYS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-ERROR-SUMMARY\") {\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.errorsummary\"',\n\t\t\t\t'<ds-error-summary class=\"styles.errorsummary\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-variant and data-modal and data-closedby on dialogs\nconst DIALOGS = getByCSSModule(\"dialog\") as HTMLCollectionOf<HTMLDialogElement>;\nconst deprecateDialog = () => {\n\tfor (const el of DIALOGS) {\n\t\tif (!deprecate(el)) continue;\n\t\tif (el.hasAttribute(\"data-variant\")) {\n\t\t\twarn(\n\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tif (el.isConnected && el.showModal && el.close) {\n\t\t\tconst closedby = attr(el, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(el, \"closedby\", closedby);\n\t\t\t\twarn(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (el.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t\tattr(el, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tel.showModal();\n\t\t\t} else if (el.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(el, \"open\", \"\"); // Set as open\n\t\t\t\tel.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate data-count in favor of data-limit\nconst deprecateCounter = () => {\n\tfor (const el of document.querySelectorAll(\"[data-count]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst count = attr(el, \"data-count\");\n\t\t\tel.classList.add(...styles.validation.split(\" \"));\n\t\t\tattr(el, \"data-limit\", count);\n\t\t\twarn(\n\t\t\t\t`data-count=\"${count}\"`,\n\t\t\t\t`class=\"styles.validation\" data-field=\"counter\" data-limit=\"${count}\"`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-command on buttons and other elements\nconst deprecateDataCommand = () => {\n\tfor (const el of document.querySelectorAll(\"[data-command]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst command = attr(el, \"data-command\");\n\n\t\t\tif (command === \"row\")\n\t\t\t\twarn(\n\t\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\twarn(\n\t\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t}\n};\n\n// Deprecate u-tabs\nconst TABS = isBrowser() ? document.getElementsByTagName(\"u-tabs\") : [];\nconst deprecateUTabs = () => {\n\tfor (const el of TABS) if (deprecate(el)) warn(\"u-tabs\", \"ds-tabs\", el);\n};\n\n// Deprecate u-combobox and add class to ds-suggestion\nconst CSS_SUGGESTION = styles.suggestion.split(\" \");\nconst OLD = isBrowser() ? document.getElementsByTagName(\"u-combobox\") : [];\nconst NEW = isBrowser() ? document.getElementsByTagName(\"ds-suggestion\") : [];\nconst deprecateUCombobox = () => {\n\tfor (const el of OLD)\n\t\tif (deprecate(el)) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\"<u-combobox>\", `<ds-suggestion class=\"styles.suggestion\">`, el);\n\t\t}\n\tfor (const el of NEW)\n\t\tif (deprecate(el) && !el.classList.contains(CSS_SUGGESTION[0])) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\n\t\t\t\t\"Only using <ds-suggestion>\",\n\t\t\t\t`<ds-suggestion class=\"styles.suggestion\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst handleCommandClick = ({ target: el }: Event) => {\n\tif (el instanceof Element === false) return;\n\tconst row = el?.closest(\"tr\")?.querySelector('[data-command=\"row\"]');\n\tconst click =\n\t\trow && !el?.closest('a,button,label,input,select,textarea,[role=\"button\"]');\n\tif (click) (row as HTMLElement).click(); // Forward click to data-command=\"row\" element\n\n\tconst dialog = el?.closest(\"dialog\");\n\tconst close = dialog && el?.closest('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\n// Deprecate fields without ds-field element\nconst FIELDS = getByCSSModule(\"field\");\nconst FIELD_UNBIND = new Set<Element>();\nconst deprecateField = () => {\n\tfor (const el of FIELDS)\n\t\tif (el.nodeName !== \"DS-FIELD\") {\n\t\t\tif (!deprecate(el))\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.field\"',\n\t\t\t\t\t'<ds-field class=\"styles.field\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\tif (!FIELD_UNBIND.has(el) && FIELD_UNBIND.add(el)) {\n\t\t\t\tDSFieldElement.prototype.connectedCallback.call(el as DSFieldElement);\n\t\t\t}\n\t\t}\n};\nconst unbindFields = () => {\n\tfor (const el of FIELD_UNBIND) {\n\t\tDSFieldElement.prototype.disconnectedCallback.call(el as DSFieldElement);\n\t\tFIELD_UNBIND.delete(el);\n\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst CSS_DESCRIPTIONS = `[data-description], .${styles.field.split(\" \")[0]} label + p`;\nconst deprecateFeildDescription = () => {\n\tfor (const el of document.querySelectorAll(CSS_DESCRIPTIONS))\n\t\tif (deprecate(el) && el.getAttribute(\"data-field\") !== \"description\") {\n\t\t\tattr(el, \"data-field\", \"description\");\n\t\t\twarn(\n\t\t\t\t\"Descriptions created by data-description of <p> only\",\n\t\t\t\t'data-field=\"data-description\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst VALIDATIONS = getByCSSModule(\"validation\");\nconst deprecateFieldValidation = () => {\n\tfor (const el of VALIDATIONS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-field\")) {\n\t\t\tattr(el, \"data-field\", \"validation\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.validation\"',\n\t\t\t\t'class=\"styles.validation\" data-field=\"validation\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst deprecatePopoverPosition = () => {\n\tfor (const el of document.querySelectorAll(\"[popover][data-position]\"))\n\t\tif (deprecate(el)) {\n\t\t\tattr(el, \"data-placement\", attr(el, \"data-position\"));\n\t\t\twarn(\"data-position\", \"data-placement\", el);\n\t\t}\n};\n\nconst handleDeprecations = debounce(() => {\n\tdeprecateCounter();\n\tdeprecateDataCommand();\n\tdeprecateBreadcrumbs();\n\tdeprecateDialog();\n\tdeprecateErrorSummary();\n\tdeprecateFeildDescription();\n\tdeprecateFieldValidation();\n\tdeprecatePopoverPosition();\n\tdeprecateField(); // Should run after other field deprecations to access correct data-attributes\n\tdeprecateToggleGroup();\n\tdeprecateUCombobox();\n\tdeprecateUTabs();\n}, 200);\n\nonHotReload(\"deprecations\", () => [\n\tunbindFields, // Return as cleanup function\n\ton(document, \"click\", handleCommandClick, QUICK_EVENT),\n\tonMutation(document, handleDeprecations, {\n\t\tattributeFilter: [\n\t\t\t\"class\",\n\t\t\t\"data-command\",\n\t\t\t\"data-count\",\n\t\t\t\"data-description\",\n\t\t\t\"data-variant\",\n\t\t\t\"open\",\n\t\t],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["DEPRECATIONS","deprecate","el","warn","from","to","TOGGLEGROUPS","getByCSSModule","CSS_BUTTON","styles","deprecateToggleGroup","attr","label","BREADCRUMBS","deprecateBreadcrumbs","ERRORSUMMARYS","deprecateErrorSummary","DIALOGS","deprecateDialog","closedby","deprecateCounter","count","deprecateDataCommand","command","TABS","isBrowser","deprecateUTabs","CSS_SUGGESTION","OLD","NEW","deprecateUCombobox","handleCommandClick","row","dialog","FIELDS","FIELD_UNBIND","deprecateField","DSFieldElement","unbindFields","CSS_DESCRIPTIONS","deprecateFeildDescription","VALIDATIONS","deprecateFieldValidation","deprecatePopoverPosition","handleDeprecations","debounce","onHotReload","on","QUICK_EVENT","onMutation"],"mappings":";;;AAaA,MAAMA,wBAAmB,QAAA,GACnBC,IAAY,CAACC,MAClB,CAACF,EAAa,IAAIE,CAAE,KAAKF,EAAa,IAAIE,CAAE,GAEvCC,IAAO,CAACC,GAAcC,GAAYH,MACvC,OAAO,eAAe,MACtB,QAAQ;AAAA,EACP,qCAAqCE,CAAI,8BAA8BC,CAAE;AAAA,EACzEH;AACD,GAGKI,IAAeC,EAAe,aAAa,GAC3CC,IAAaC,EAAO,OAAO,MAAM,GAAG,GACpCC,IAAuB,MA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= 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,GAAKC,MAAUD,KAAOD,IAAML,GAAUK,GAAKC,GAAK,EAAE,YAAY,IAAM,cAAc,IAAM,UAAU,IAAM,OAAAC,EAAK,CAAE,IAAIF,EAAIC,CAAG,IAAIC,GACtJC,KAAiB,CAACC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