@oslokommune/punkt-elements 16.7.3 → 16.7.7
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/CHANGELOG.md +35 -0
- package/dist/accordion-BB1JrONI.cjs +34 -0
- package/dist/accordion-nNH87Y60.js +130 -0
- package/dist/alert-BEEnTiCb.cjs +33 -0
- package/dist/alert-ePJuDtmm.js +171 -0
- package/dist/async-directive-B9P1Qa0k.cjs +1 -0
- package/dist/async-directive-CaQiqjyV.js +55 -0
- package/dist/backlink-Ba03LlbB.cjs +13 -0
- package/dist/backlink-CiwXrQYD.js +38 -0
- package/dist/booleanish-BmcOU-43.js +11 -0
- package/dist/booleanish-jJLlnr6-.cjs +1 -0
- package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
- package/dist/breadcrumbs-CpuVqWhF.js +76 -0
- package/dist/button-BIpd1xJh.js +95 -0
- package/dist/button-D-TOBaJB.cjs +27 -0
- package/dist/calendar-BzEtOJla.js +2031 -0
- package/dist/calendar-E5jJLt8D.cjs +90 -0
- package/dist/card-BYJu1MYm.js +339 -0
- package/dist/card-CUFhMVim.cjs +87 -0
- package/dist/checkbox-BARDb9iV.cjs +31 -0
- package/dist/checkbox-Cspxcvt_.js +111 -0
- package/dist/class-map-C8HuhNzZ.js +27 -0
- package/dist/class-map-CJ-msbHs.cjs +1 -0
- package/dist/classutils-DEL164Ur.js +7 -0
- package/dist/classutils-z8YsPlOf.cjs +1 -0
- package/dist/combobox-BcdLZRDU.js +984 -0
- package/dist/combobox-CGbFTWq_.cjs +135 -0
- package/dist/consent-DeB_5sWH.js +197 -0
- package/dist/consent-hwu7pp3S.cjs +11 -0
- package/dist/datepicker-DpmlsnH_.cjs +273 -0
- package/dist/datepicker-OVd8pmnZ.js +1125 -0
- package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
- package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
- package/dist/directive-3THFsVew.js +28 -0
- package/dist/directive-CJ2giQBZ.cjs +1 -0
- package/dist/directive-helpers-D1QSxY17.cjs +1 -0
- package/dist/directive-helpers-Dkv2gKgs.js +25 -0
- package/dist/element-DjtxO-1r.cjs +2 -0
- package/dist/element-cZ85T_aa.js +693 -0
- package/dist/element-with-slot-4J2o3SeU.js +166 -0
- package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
- package/dist/header-DWgPgGfS.cjs +304 -0
- package/dist/header-a6ztVNp3.js +782 -0
- package/dist/heading-BgSWIRii.cjs +1 -0
- package/dist/heading-DiQLPxdf.js +73 -0
- package/dist/helptext-CCBKKLus.js +65 -0
- package/dist/helptext-D-3QfZv5.cjs +24 -0
- package/dist/icon-Co72KtgF.js +86 -0
- package/dist/icon-Dr8sfT2X.cjs +1 -0
- package/dist/if-defined-Cjj8qN-Z.js +5 -0
- package/dist/if-defined-XKOD_t_V.cjs +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/input-element-B1yxcfz4.cjs +1 -0
- package/dist/input-element-Bw1s6NlF.js +643 -0
- package/dist/input-wrapper-BRuVELpK.cjs +54 -0
- package/dist/input-wrapper-CDyHTR1V.js +164 -0
- package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
- package/dist/input-wrapper-YfTmpSSY.js +117 -0
- package/dist/link-CKAFMz9j.js +89 -0
- package/dist/link-CyTCpI0k.cjs +7 -0
- package/dist/linkcard-B0KOGaGj.js +55 -0
- package/dist/linkcard-BE4-FewK.cjs +13 -0
- package/dist/listbox-DCA2JoPV.cjs +106 -0
- package/dist/listbox-DuBgTFvH.js +397 -0
- package/dist/loader-6kFZUErT.js +66 -0
- package/dist/loader-CX2rsC01.cjs +16 -0
- package/dist/messagebox-Cwlg5sOr.js +110 -0
- package/dist/messagebox-Din9X53b.cjs +13 -0
- package/dist/modal-C_wtsh9m.js +209 -0
- package/dist/modal-DS_wUOIv.cjs +36 -0
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -7
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +2 -5
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -5
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -81
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -5
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -5
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -5
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -5
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -5
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -5
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -9
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -861
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -5
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -5
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -5
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +30 -66
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -5
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -5
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -5
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -5
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -5
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -5
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -5
- package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
- package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -5
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -5
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -5
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -7
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +2 -5
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -5
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -5
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -560
- package/dist/progressbar-CdXtmOBb.cjs +17 -0
- package/dist/progressbar-Dy9AiYQz.js +113 -0
- package/dist/radiobutton-GOnpUbCW.cjs +31 -0
- package/dist/radiobutton-V_KPbup_.js +84 -0
- package/dist/ref-BaJ0mBT_.cjs +1 -0
- package/dist/ref-RS8Uv6uC.js +30 -0
- package/dist/repeat-Cepr3469.js +57 -0
- package/dist/repeat-CqcDYBxr.cjs +1 -0
- package/dist/select-BSAFd8Wa.js +164 -0
- package/dist/select-C2i8sOk5.cjs +49 -0
- package/dist/tabs-D8nL9rWx.cjs +37 -0
- package/dist/tabs-Y7utmJi9.js +318 -0
- package/dist/tag-DLthw5b4.cjs +27 -0
- package/dist/tag-VwykmuQR.js +179 -0
- package/dist/textarea-D7aGOyDf.cjs +46 -0
- package/dist/textarea-DYOBhJrN.js +115 -0
- package/dist/textinput-BUgntXnM.js +124 -0
- package/dist/textinput-DFh8_9cx.cjs +70 -0
- package/dist/timepicker-BIfE7KKJ.cjs +191 -0
- package/dist/timepicker-DaSwn1FA.js +503 -0
- package/dist/utils-CUqCKGvp.js +7 -0
- package/dist/utils-CjAbIttF.cjs +1 -0
- package/package.json +6 -6
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +6 -6
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/dist/accordionitem-_9AiCIvd.cjs +0 -34
- package/dist/accordionitem-dCfSrxh5.js +0 -140
- package/dist/alert-BtOk8yRH.cjs +0 -33
- package/dist/alert-DlY2_grU.js +0 -117
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-Ce5Vldop.js +0 -49
- package/dist/backlink-y3dwjKPC.cjs +0 -13
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-B_TXwNzt.cjs +0 -27
- package/dist/button-BiY-wlKF.js +0 -139
- package/dist/calendar-B2pji2zn.cjs +0 -90
- package/dist/calendar-DhjQDC4C.js +0 -2140
- package/dist/card-BwMNB5Bb.cjs +0 -87
- package/dist/card-CGlmcMSR.js +0 -233
- package/dist/checkbox-BsJZYA26.js +0 -147
- package/dist/checkbox-CTY8f_qn.cjs +0 -31
- package/dist/class-map-CEnykyO_.js +0 -34
- package/dist/class-map-CsENJXf1.cjs +0 -5
- package/dist/classutils-BwNK82ZQ.cjs +0 -1
- package/dist/classutils-RQs1k6D9.js +0 -7
- package/dist/combobox-DSB5WOxg.js +0 -815
- package/dist/combobox-DbICIgKG.cjs +0 -135
- package/dist/consent-DkOQpbsg.cjs +0 -11
- package/dist/consent-SNWV_mMU.js +0 -175
- package/dist/datepicker-BEWl9iz3.cjs +0 -273
- package/dist/datepicker-euHyzXnb.js +0 -1170
- package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
- package/dist/directive-C7oCP5Bh.cjs +0 -5
- package/dist/directive-helpers-BP2WOx60.cjs +0 -5
- package/dist/directive-helpers-rm-28gIj.js +0 -38
- package/dist/directive-oAbCiebi.js +0 -27
- package/dist/element-CPpT3rFQ.js +0 -638
- package/dist/element-gR_VtSiD.cjs +0 -27
- package/dist/element-with-slot-Dqk6-TRR.js +0 -240
- package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
- package/dist/heading-D2tVS6lS.js +0 -103
- package/dist/heading-DrzbgDb6.cjs +0 -1
- package/dist/helptext-BKtU4mas.js +0 -82
- package/dist/helptext-DcRC7wW2.cjs +0 -24
- package/dist/icon-CxQcIa5F.js +0 -105
- package/dist/icon-q81vqPK_.cjs +0 -9
- package/dist/if-defined-B0krMLad.js +0 -10
- package/dist/if-defined-BOW3ODSj.cjs +0 -5
- package/dist/input-element-8nLwuQS4.js +0 -837
- package/dist/input-element-DdVhUvva.cjs +0 -1
- package/dist/input-wrapper-Bs4CRNst.js +0 -181
- package/dist/input-wrapper-Bv9aqqVq.cjs +0 -54
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-C0rl-86s.cjs +0 -7
- package/dist/link-Cdqgl60z.js +0 -55
- package/dist/linkcard-Dimu7Rlx.cjs +0 -13
- package/dist/linkcard-Lbq_UhjZ.js +0 -56
- package/dist/listbox-Bia4_tvN.js +0 -440
- package/dist/listbox-La2GZQei.cjs +0 -106
- package/dist/loader-D1ugDXGV.cjs +0 -16
- package/dist/loader-DyN6RGC5.js +0 -95
- package/dist/messagebox-BGMVm2t9.js +0 -71
- package/dist/messagebox-M0yIgCz9.cjs +0 -13
- package/dist/modal-CMO1RtIi.cjs +0 -36
- package/dist/modal-DjPQDE-Z.js +0 -156
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-BqlMzkM_.cjs +0 -21
- package/dist/progressbar-sbHDFC12.js +0 -162
- package/dist/radiobutton-5ZqVVtTT.cjs +0 -31
- package/dist/radiobutton-D8Ai8ETa.js +0 -113
- package/dist/ref-Bg_Swj5w.js +0 -42
- package/dist/ref-CL-Xk9Xm.cjs +0 -5
- package/dist/repeat-BD8TKgJb.js +0 -61
- package/dist/repeat-Cfq8CDlf.cjs +0 -5
- package/dist/select-De-n8on9.js +0 -230
- package/dist/select-dTWibR6_.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-B9-jeV97.js +0 -334
- package/dist/tabitem-BnhzqfW3.cjs +0 -65
- package/dist/tag-CbwO8yvD.cjs +0 -27
- package/dist/tag-D4FI5t3y.js +0 -117
- package/dist/textarea-BmLaKzsc.cjs +0 -50
- package/dist/textarea-CMiSJaYL.js +0 -133
- package/dist/textinput-em9y4yrL.cjs +0 -70
- package/dist/textinput-r8udK0IX.js +0 -152
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
|
@@ -1,837 +0,0 @@
|
|
|
1
|
-
import { s as g, n as o } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { u as Ft } from "./utils-DznhwRXm.js";
|
|
3
|
-
import { b as Tt } from "./booleanish-C9R0tdXH.js";
|
|
4
|
-
import { s as xt } from "./input-wrapper-CDgenrYA.js";
|
|
5
|
-
import { P as It } from "./element-with-slot-Dqk6-TRR.js";
|
|
6
|
-
var ct = {}, dt;
|
|
7
|
-
function Rt() {
|
|
8
|
-
return dt || (dt = 1, (function() {
|
|
9
|
-
(function(p) {
|
|
10
|
-
const a = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), R = {
|
|
11
|
-
ariaAtomic: "aria-atomic",
|
|
12
|
-
ariaAutoComplete: "aria-autocomplete",
|
|
13
|
-
ariaBusy: "aria-busy",
|
|
14
|
-
ariaChecked: "aria-checked",
|
|
15
|
-
ariaColCount: "aria-colcount",
|
|
16
|
-
ariaColIndex: "aria-colindex",
|
|
17
|
-
ariaColIndexText: "aria-colindextext",
|
|
18
|
-
ariaColSpan: "aria-colspan",
|
|
19
|
-
ariaCurrent: "aria-current",
|
|
20
|
-
ariaDescription: "aria-description",
|
|
21
|
-
ariaDisabled: "aria-disabled",
|
|
22
|
-
ariaExpanded: "aria-expanded",
|
|
23
|
-
ariaHasPopup: "aria-haspopup",
|
|
24
|
-
ariaHidden: "aria-hidden",
|
|
25
|
-
ariaInvalid: "aria-invalid",
|
|
26
|
-
ariaKeyShortcuts: "aria-keyshortcuts",
|
|
27
|
-
ariaLabel: "aria-label",
|
|
28
|
-
ariaLevel: "aria-level",
|
|
29
|
-
ariaLive: "aria-live",
|
|
30
|
-
ariaModal: "aria-modal",
|
|
31
|
-
ariaMultiLine: "aria-multiline",
|
|
32
|
-
ariaMultiSelectable: "aria-multiselectable",
|
|
33
|
-
ariaOrientation: "aria-orientation",
|
|
34
|
-
ariaPlaceholder: "aria-placeholder",
|
|
35
|
-
ariaPosInSet: "aria-posinset",
|
|
36
|
-
ariaPressed: "aria-pressed",
|
|
37
|
-
ariaReadOnly: "aria-readonly",
|
|
38
|
-
ariaRelevant: "aria-relevant",
|
|
39
|
-
ariaRequired: "aria-required",
|
|
40
|
-
ariaRoleDescription: "aria-roledescription",
|
|
41
|
-
ariaRowCount: "aria-rowcount",
|
|
42
|
-
ariaRowIndex: "aria-rowindex",
|
|
43
|
-
ariaRowIndexText: "aria-rowindextext",
|
|
44
|
-
ariaRowSpan: "aria-rowspan",
|
|
45
|
-
ariaSelected: "aria-selected",
|
|
46
|
-
ariaSetSize: "aria-setsize",
|
|
47
|
-
ariaSort: "aria-sort",
|
|
48
|
-
ariaValueMax: "aria-valuemax",
|
|
49
|
-
ariaValueMin: "aria-valuemin",
|
|
50
|
-
ariaValueNow: "aria-valuenow",
|
|
51
|
-
ariaValueText: "aria-valuetext",
|
|
52
|
-
role: "role"
|
|
53
|
-
}, ut = (e, t) => {
|
|
54
|
-
for (let i in R) {
|
|
55
|
-
t[i] = null;
|
|
56
|
-
let s = null;
|
|
57
|
-
const n = R[i];
|
|
58
|
-
Object.defineProperty(t, i, {
|
|
59
|
-
get() {
|
|
60
|
-
return s;
|
|
61
|
-
},
|
|
62
|
-
set(d) {
|
|
63
|
-
s = d, e.isConnected ? k(e, n, d) : A.set(e, t);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
function G(e) {
|
|
69
|
-
const t = u.get(e), { form: i } = t;
|
|
70
|
-
tt(e, i, t), Z(e, t.labels);
|
|
71
|
-
}
|
|
72
|
-
const J = (e, t = !1) => {
|
|
73
|
-
const i = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
74
|
-
acceptNode(d) {
|
|
75
|
-
return u.has(d) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
let s = i.nextNode();
|
|
79
|
-
const n = !t || e.disabled;
|
|
80
|
-
for (; s; )
|
|
81
|
-
s.formDisabledCallback && n && H(s, e.disabled), s = i.nextNode();
|
|
82
|
-
}, Q = { attributes: !0, attributeFilter: ["disabled", "name"] }, L = D() ? new MutationObserver((e) => {
|
|
83
|
-
for (const t of e) {
|
|
84
|
-
const i = t.target;
|
|
85
|
-
if (t.attributeName === "disabled" && (i.constructor.formAssociated ? H(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && J(i)), t.attributeName === "name" && i.constructor.formAssociated) {
|
|
86
|
-
const s = u.get(i), n = S.get(i);
|
|
87
|
-
s.setFormValue(n);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}) : {};
|
|
91
|
-
function B(e) {
|
|
92
|
-
e.forEach((t) => {
|
|
93
|
-
const { addedNodes: i, removedNodes: s } = t, n = Array.from(i), d = Array.from(s);
|
|
94
|
-
n.forEach((h) => {
|
|
95
|
-
var y;
|
|
96
|
-
if (u.has(h) && h.constructor.formAssociated && G(h), A.has(h)) {
|
|
97
|
-
const m = A.get(h);
|
|
98
|
-
Object.keys(R).filter((b) => m[b] !== null).forEach((b) => {
|
|
99
|
-
k(h, R[b], m[b]);
|
|
100
|
-
}), A.delete(h);
|
|
101
|
-
}
|
|
102
|
-
if (I.has(h)) {
|
|
103
|
-
const m = I.get(h);
|
|
104
|
-
k(h, "internals-valid", m.validity.valid.toString()), k(h, "internals-invalid", (!m.validity.valid).toString()), k(h, "aria-invalid", (!m.validity.valid).toString()), I.delete(h);
|
|
105
|
-
}
|
|
106
|
-
if (h.localName === "form") {
|
|
107
|
-
const m = v.get(h), M = document.createTreeWalker(h, NodeFilter.SHOW_ELEMENT, {
|
|
108
|
-
acceptNode(U) {
|
|
109
|
-
return u.has(U) && U.constructor.formAssociated && !(m && m.has(U)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
let b = M.nextNode();
|
|
113
|
-
for (; b; )
|
|
114
|
-
G(b), b = M.nextNode();
|
|
115
|
-
}
|
|
116
|
-
h.localName === "fieldset" && ((y = L.observe) === null || y === void 0 || y.call(L, h, Q), J(h, !0));
|
|
117
|
-
}), d.forEach((h) => {
|
|
118
|
-
const y = u.get(h);
|
|
119
|
-
y && f.get(y) && X(y), C.has(h) && C.get(h).disconnect();
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
function ft(e) {
|
|
124
|
-
e.forEach((t) => {
|
|
125
|
-
const { removedNodes: i } = t;
|
|
126
|
-
i.forEach((s) => {
|
|
127
|
-
const n = K.get(t.target);
|
|
128
|
-
u.has(s) && it(s), n.disconnect();
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const pt = (e) => {
|
|
133
|
-
var t, i;
|
|
134
|
-
const s = new MutationObserver(ft);
|
|
135
|
-
!((t = window == null ? void 0 : window.ShadyDOM) === null || t === void 0) && t.inUse && e.mode && e.host && (e = e.host), (i = s.observe) === null || i === void 0 || i.call(s, e, { childList: !0 }), K.set(e, s);
|
|
136
|
-
};
|
|
137
|
-
D() && new MutationObserver(B);
|
|
138
|
-
const _ = {
|
|
139
|
-
childList: !0,
|
|
140
|
-
subtree: !0
|
|
141
|
-
}, k = (e, t, i) => {
|
|
142
|
-
e.getAttribute(t) !== i && e.setAttribute(t, i);
|
|
143
|
-
}, H = (e, t) => {
|
|
144
|
-
e.toggleAttribute("internals-disabled", t), t ? k(e, "aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
|
|
145
|
-
}, X = (e) => {
|
|
146
|
-
f.get(e).forEach((i) => {
|
|
147
|
-
i.remove();
|
|
148
|
-
}), f.set(e, []);
|
|
149
|
-
}, Y = (e, t) => {
|
|
150
|
-
const i = document.createElement("input");
|
|
151
|
-
return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), f.get(t).push(i), i;
|
|
152
|
-
}, mt = (e, t) => {
|
|
153
|
-
var i;
|
|
154
|
-
f.set(t, []), (i = L.observe) === null || i === void 0 || i.call(L, e, Q);
|
|
155
|
-
}, Z = (e, t) => {
|
|
156
|
-
if (t.length) {
|
|
157
|
-
Array.from(t).forEach((s) => s.addEventListener("click", e.click.bind(e)));
|
|
158
|
-
let i = t[0].id;
|
|
159
|
-
t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), k(e, "aria-labelledby", i);
|
|
160
|
-
}
|
|
161
|
-
}, N = (e) => {
|
|
162
|
-
const t = Array.from(e.elements).filter((d) => !d.tagName.includes("-") && d.validity).map((d) => d.validity.valid), i = v.get(e) || [], s = Array.from(i).filter((d) => d.isConnected).map((d) => u.get(d).validity.valid), n = [...t, ...s].includes(!1);
|
|
163
|
-
e.toggleAttribute("internals-invalid", n), e.toggleAttribute("internals-valid", !n);
|
|
164
|
-
}, yt = (e) => {
|
|
165
|
-
N(O(e.target));
|
|
166
|
-
}, gt = (e) => {
|
|
167
|
-
N(O(e.target));
|
|
168
|
-
}, vt = (e) => {
|
|
169
|
-
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${e.id ? `,${i}[form='${e.id}']` : ""}`).join(",");
|
|
170
|
-
e.addEventListener("click", (i) => {
|
|
171
|
-
if (i.target.closest(t)) {
|
|
172
|
-
const n = v.get(e);
|
|
173
|
-
if (e.noValidate)
|
|
174
|
-
return;
|
|
175
|
-
n.size && Array.from(n).reverse().map((y) => u.get(y).reportValidity()).includes(!1) && i.preventDefault();
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}, bt = (e) => {
|
|
179
|
-
const t = v.get(e.target);
|
|
180
|
-
t && t.size && t.forEach((i) => {
|
|
181
|
-
i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
|
|
182
|
-
});
|
|
183
|
-
}, tt = (e, t, i) => {
|
|
184
|
-
if (t) {
|
|
185
|
-
const s = v.get(t);
|
|
186
|
-
if (s)
|
|
187
|
-
s.add(e);
|
|
188
|
-
else {
|
|
189
|
-
const n = /* @__PURE__ */ new Set();
|
|
190
|
-
n.add(e), v.set(t, n), vt(t), t.addEventListener("reset", bt), t.addEventListener("input", yt), t.addEventListener("change", gt);
|
|
191
|
-
}
|
|
192
|
-
V.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
193
|
-
e.formAssociatedCallback.apply(e, [t]);
|
|
194
|
-
}, 0), N(t);
|
|
195
|
-
}
|
|
196
|
-
}, O = (e) => {
|
|
197
|
-
let t = e.parentNode;
|
|
198
|
-
return t && t.tagName !== "FORM" && (t = O(t)), t;
|
|
199
|
-
}, E = (e, t, i = DOMException) => {
|
|
200
|
-
if (!e.constructor.formAssociated)
|
|
201
|
-
throw new i(t);
|
|
202
|
-
}, et = (e, t, i) => {
|
|
203
|
-
const s = v.get(e);
|
|
204
|
-
return s && s.size && s.forEach((n) => {
|
|
205
|
-
u.get(n)[i]() || (t = !1);
|
|
206
|
-
}), t;
|
|
207
|
-
}, it = (e) => {
|
|
208
|
-
if (e.constructor.formAssociated) {
|
|
209
|
-
const t = u.get(e), { labels: i, form: s } = t;
|
|
210
|
-
Z(e, i), tt(e, s, t);
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
function D() {
|
|
214
|
-
return typeof MutationObserver < "u";
|
|
215
|
-
}
|
|
216
|
-
class wt {
|
|
217
|
-
constructor() {
|
|
218
|
-
this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
const Et = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), Mt = (e, t, i) => (e.valid = kt(t), Object.keys(t).forEach((s) => e[s] = t[s]), i && N(i), e), kt = (e) => {
|
|
222
|
-
let t = !0;
|
|
223
|
-
for (let i in e)
|
|
224
|
-
i !== "valid" && e[i] !== !1 && (t = !1);
|
|
225
|
-
return t;
|
|
226
|
-
}, W = /* @__PURE__ */ new WeakMap();
|
|
227
|
-
function at(e, t) {
|
|
228
|
-
e.toggleAttribute(t, !0), e.part && e.part.add(t);
|
|
229
|
-
}
|
|
230
|
-
class q extends Set {
|
|
231
|
-
static get isPolyfilled() {
|
|
232
|
-
return !0;
|
|
233
|
-
}
|
|
234
|
-
constructor(t) {
|
|
235
|
-
if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
236
|
-
throw new TypeError("Illegal constructor");
|
|
237
|
-
W.set(this, t);
|
|
238
|
-
}
|
|
239
|
-
add(t) {
|
|
240
|
-
if (!/^--/.test(t) || typeof t != "string")
|
|
241
|
-
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
242
|
-
const i = super.add(t), s = W.get(this), n = `state${t}`;
|
|
243
|
-
return s.isConnected ? at(s, n) : setTimeout(() => {
|
|
244
|
-
at(s, n);
|
|
245
|
-
}), i;
|
|
246
|
-
}
|
|
247
|
-
clear() {
|
|
248
|
-
for (let [t] of this.entries())
|
|
249
|
-
this.delete(t);
|
|
250
|
-
super.clear();
|
|
251
|
-
}
|
|
252
|
-
delete(t) {
|
|
253
|
-
const i = super.delete(t), s = W.get(this);
|
|
254
|
-
return s.isConnected ? (s.toggleAttribute(`state${t}`, !1), s.part && s.part.remove(`state${t}`)) : setTimeout(() => {
|
|
255
|
-
s.toggleAttribute(`state${t}`, !1), s.part && s.part.remove(`state${t}`);
|
|
256
|
-
}), i;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
function st(e, t, i, s) {
|
|
260
|
-
if (typeof t == "function" ? e !== t || !s : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
261
|
-
return i === "m" ? s : i === "a" ? s.call(e) : s ? s.value : t.get(e);
|
|
262
|
-
}
|
|
263
|
-
function Vt(e, t, i, s, n) {
|
|
264
|
-
if (typeof t == "function" ? e !== t || !0 : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
265
|
-
return t.set(e, i), i;
|
|
266
|
-
}
|
|
267
|
-
var x;
|
|
268
|
-
class At {
|
|
269
|
-
constructor(t) {
|
|
270
|
-
x.set(this, void 0), Vt(this, x, t);
|
|
271
|
-
for (let i = 0; i < t.length; i++) {
|
|
272
|
-
let s = t[i];
|
|
273
|
-
this[i] = s, s.hasAttribute("name") && (this[s.getAttribute("name")] = s);
|
|
274
|
-
}
|
|
275
|
-
Object.freeze(this);
|
|
276
|
-
}
|
|
277
|
-
get length() {
|
|
278
|
-
return st(this, x, "f").length;
|
|
279
|
-
}
|
|
280
|
-
[(x = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
281
|
-
return st(this, x, "f")[Symbol.iterator]();
|
|
282
|
-
}
|
|
283
|
-
item(t) {
|
|
284
|
-
return this[t] == null ? null : this[t];
|
|
285
|
-
}
|
|
286
|
-
namedItem(t) {
|
|
287
|
-
return this[t] == null ? null : this[t];
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
function Ct() {
|
|
291
|
-
const e = HTMLFormElement.prototype.checkValidity;
|
|
292
|
-
HTMLFormElement.prototype.checkValidity = i;
|
|
293
|
-
const t = HTMLFormElement.prototype.reportValidity;
|
|
294
|
-
HTMLFormElement.prototype.reportValidity = s;
|
|
295
|
-
function i(...d) {
|
|
296
|
-
let h = e.apply(this, d);
|
|
297
|
-
return et(this, h, "checkValidity");
|
|
298
|
-
}
|
|
299
|
-
function s(...d) {
|
|
300
|
-
let h = t.apply(this, d);
|
|
301
|
-
return et(this, h, "reportValidity");
|
|
302
|
-
}
|
|
303
|
-
const { get: n } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
304
|
-
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
305
|
-
get(...d) {
|
|
306
|
-
const h = n.call(this, ...d), y = Array.from(v.get(this) || []);
|
|
307
|
-
if (y.length === 0)
|
|
308
|
-
return h;
|
|
309
|
-
const m = Array.from(h).concat(y).sort((M, b) => M.compareDocumentPosition ? M.compareDocumentPosition(b) & 2 ? 1 : -1 : 0);
|
|
310
|
-
return new At(m);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
class rt {
|
|
315
|
-
static get isPolyfilled() {
|
|
316
|
-
return !0;
|
|
317
|
-
}
|
|
318
|
-
constructor(t) {
|
|
319
|
-
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
320
|
-
throw new TypeError("Illegal constructor");
|
|
321
|
-
const i = t.getRootNode(), s = new wt();
|
|
322
|
-
this.states = new q(t), a.set(this, t), r.set(this, s), u.set(t, this), ut(t, this), mt(t, this), Object.seal(this), i instanceof DocumentFragment && pt(i);
|
|
323
|
-
}
|
|
324
|
-
checkValidity() {
|
|
325
|
-
const t = a.get(this);
|
|
326
|
-
if (E(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
327
|
-
return !0;
|
|
328
|
-
const i = r.get(this);
|
|
329
|
-
if (!i.valid) {
|
|
330
|
-
const s = new Event("invalid", {
|
|
331
|
-
bubbles: !1,
|
|
332
|
-
cancelable: !0,
|
|
333
|
-
composed: !1
|
|
334
|
-
});
|
|
335
|
-
t.dispatchEvent(s);
|
|
336
|
-
}
|
|
337
|
-
return i.valid;
|
|
338
|
-
}
|
|
339
|
-
get form() {
|
|
340
|
-
const t = a.get(this);
|
|
341
|
-
E(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
342
|
-
let i;
|
|
343
|
-
return t.constructor.formAssociated === !0 && (i = O(t)), i;
|
|
344
|
-
}
|
|
345
|
-
get labels() {
|
|
346
|
-
const t = a.get(this);
|
|
347
|
-
E(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
348
|
-
const i = t.getAttribute("id"), s = t.getRootNode();
|
|
349
|
-
return s && i ? s.querySelectorAll(`[for="${i}"]`) : [];
|
|
350
|
-
}
|
|
351
|
-
reportValidity() {
|
|
352
|
-
const t = a.get(this);
|
|
353
|
-
if (E(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
354
|
-
return !0;
|
|
355
|
-
const i = this.checkValidity(), s = T.get(this);
|
|
356
|
-
if (s && !t.constructor.formAssociated)
|
|
357
|
-
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
358
|
-
return !i && s && (t.focus(), s.focus()), i;
|
|
359
|
-
}
|
|
360
|
-
setFormValue(t) {
|
|
361
|
-
const i = a.get(this);
|
|
362
|
-
if (E(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), X(this), t != null && !(t instanceof FormData)) {
|
|
363
|
-
if (i.getAttribute("name")) {
|
|
364
|
-
const s = Y(i, this);
|
|
365
|
-
s.value = t;
|
|
366
|
-
}
|
|
367
|
-
} else t != null && t instanceof FormData && Array.from(t).reverse().forEach(([s, n]) => {
|
|
368
|
-
if (typeof n == "string") {
|
|
369
|
-
const d = Y(i, this);
|
|
370
|
-
d.name = s, d.value = n;
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
S.set(i, t);
|
|
374
|
-
}
|
|
375
|
-
setValidity(t, i, s) {
|
|
376
|
-
const n = a.get(this);
|
|
377
|
-
if (E(n, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
378
|
-
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
379
|
-
T.set(this, s);
|
|
380
|
-
const d = r.get(this), h = {};
|
|
381
|
-
for (const M in t)
|
|
382
|
-
h[M] = t[M];
|
|
383
|
-
Object.keys(h).length === 0 && Et(d);
|
|
384
|
-
const y = Object.assign(Object.assign({}, d), h);
|
|
385
|
-
delete y.valid;
|
|
386
|
-
const { valid: m } = Mt(d, y, this.form);
|
|
387
|
-
if (!m && !i)
|
|
388
|
-
throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
|
|
389
|
-
w.set(this, m ? "" : i), n.isConnected ? (n.toggleAttribute("internals-invalid", !m), n.toggleAttribute("internals-valid", m), k(n, "aria-invalid", `${!m}`)) : I.set(n, this);
|
|
390
|
-
}
|
|
391
|
-
get shadowRoot() {
|
|
392
|
-
const t = a.get(this), i = F.get(t);
|
|
393
|
-
return i || null;
|
|
394
|
-
}
|
|
395
|
-
get validationMessage() {
|
|
396
|
-
const t = a.get(this);
|
|
397
|
-
return E(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), w.get(this);
|
|
398
|
-
}
|
|
399
|
-
get validity() {
|
|
400
|
-
const t = a.get(this);
|
|
401
|
-
return E(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), r.get(this);
|
|
402
|
-
}
|
|
403
|
-
get willValidate() {
|
|
404
|
-
const t = a.get(this);
|
|
405
|
-
return E(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
function St() {
|
|
409
|
-
if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
|
|
410
|
-
return !1;
|
|
411
|
-
class e extends HTMLElement {
|
|
412
|
-
constructor() {
|
|
413
|
-
super(), this.internals = this.attachInternals();
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
|
|
417
|
-
customElements.define(t, e);
|
|
418
|
-
const i = new e();
|
|
419
|
-
return [
|
|
420
|
-
"shadowRoot",
|
|
421
|
-
"form",
|
|
422
|
-
"willValidate",
|
|
423
|
-
"validity",
|
|
424
|
-
"validationMessage",
|
|
425
|
-
"labels",
|
|
426
|
-
"setFormValue",
|
|
427
|
-
"setValidity",
|
|
428
|
-
"checkValidity",
|
|
429
|
-
"reportValidity"
|
|
430
|
-
].every((s) => s in i.internals);
|
|
431
|
-
}
|
|
432
|
-
let nt = !1, ot = !1;
|
|
433
|
-
function $(e) {
|
|
434
|
-
ot || (ot = !0, window.CustomStateSet = q, e && (HTMLElement.prototype.attachInternals = function(...t) {
|
|
435
|
-
const i = e.call(this, t);
|
|
436
|
-
return i.states = new q(this), i;
|
|
437
|
-
}));
|
|
438
|
-
}
|
|
439
|
-
function lt(e = !0) {
|
|
440
|
-
if (!nt) {
|
|
441
|
-
if (nt = !0, typeof window < "u" && (window.ElementInternals = rt), typeof CustomElementRegistry < "u") {
|
|
442
|
-
const t = CustomElementRegistry.prototype.define;
|
|
443
|
-
CustomElementRegistry.prototype.define = function(i, s, n) {
|
|
444
|
-
if (s.formAssociated) {
|
|
445
|
-
const d = s.prototype.connectedCallback;
|
|
446
|
-
s.prototype.connectedCallback = function() {
|
|
447
|
-
j.has(this) || (j.set(this, !0), this.hasAttribute("disabled") && H(this, !0)), d != null && d.apply(this), it(this);
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
t.call(this, i, s, n);
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
|
|
454
|
-
if (this.tagName) {
|
|
455
|
-
if (this.tagName.indexOf("-") === -1)
|
|
456
|
-
throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
|
|
457
|
-
} else return {};
|
|
458
|
-
if (u.has(this))
|
|
459
|
-
throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
460
|
-
return new rt(this);
|
|
461
|
-
}), typeof Element < "u") {
|
|
462
|
-
let t = function(...s) {
|
|
463
|
-
const n = i.apply(this, s);
|
|
464
|
-
if (F.set(this, n), D()) {
|
|
465
|
-
const d = new MutationObserver(B);
|
|
466
|
-
window.ShadyDOM ? d.observe(this, _) : d.observe(n, _), C.set(this, d);
|
|
467
|
-
}
|
|
468
|
-
return n;
|
|
469
|
-
};
|
|
470
|
-
const i = Element.prototype.attachShadow;
|
|
471
|
-
Element.prototype.attachShadow = t;
|
|
472
|
-
}
|
|
473
|
-
D() && typeof document < "u" && new MutationObserver(B).observe(document.documentElement, _), typeof HTMLFormElement < "u" && Ct(), (e || typeof window < "u" && !window.CustomStateSet) && $();
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
return !!customElements.polyfillWrapFlushCallback || (St() ? typeof window < "u" && !window.CustomStateSet && $(HTMLElement.prototype.attachInternals) : lt(!1)), p.forceCustomStateSetPolyfill = $, p.forceElementInternalsPolyfill = lt, Object.defineProperty(p, "__esModule", { value: !0 }), p;
|
|
477
|
-
})({});
|
|
478
|
-
})()), ct;
|
|
479
|
-
}
|
|
480
|
-
Rt();
|
|
481
|
-
var Lt = Object.defineProperty, l = (p, a, r, f) => {
|
|
482
|
-
for (var u = void 0, w = p.length - 1, V; w >= 0; w--)
|
|
483
|
-
(V = p[w]) && (u = V(a, r, u) || u);
|
|
484
|
-
return u && Lt(a, r, u), u;
|
|
485
|
-
};
|
|
486
|
-
const ht = "on", z = "--checked", P = ",";
|
|
487
|
-
class c extends It {
|
|
488
|
-
constructor() {
|
|
489
|
-
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = Ft(), this.counter = !1, this.hasError = !1, this.inline = !1, this.hasFieldset = !1, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = xt.props.helptextDropdownButton.default, this.label = null, this.optionalText = g.forms.labels.optional, this.requiredText = g.forms.labels.required, this.tagText = null, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
|
|
490
|
-
}
|
|
491
|
-
static get formAssociated() {
|
|
492
|
-
return !0;
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Manages form validation state based on input validity
|
|
496
|
-
* Called automatically by onChange, but can be called manually if needed
|
|
497
|
-
*
|
|
498
|
-
* @param input - The input element to validate (optional)
|
|
499
|
-
* @protected
|
|
500
|
-
*/
|
|
501
|
-
manageValidity(a) {
|
|
502
|
-
var r, f, u, w, V, C, v, S, A, F, T;
|
|
503
|
-
if (!a) {
|
|
504
|
-
console.warn("manageValidity called without valid input element");
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, g.forms.messages.required, a) : (r = a.validity) != null && r.typeMismatch || (f = a.validity) != null && f.badInput ? this.internals.setValidity({ typeMismatch: !0 }, g.forms.messages.invalid, a) : (u = a.validity) != null && u.patternMismatch ? this.internals.setValidity(
|
|
508
|
-
{ patternMismatch: !0 },
|
|
509
|
-
g.forms.messages.invalidPattern,
|
|
510
|
-
a
|
|
511
|
-
) : (w = a.validity) != null && w.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, g.forms.messages.tooShort, a) : (V = a.validity) != null && V.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, g.forms.messages.tooLong, a) : (C = a.validity) != null && C.rangeUnderflow ? this.internals.setValidity(
|
|
512
|
-
{ rangeUnderflow: !0 },
|
|
513
|
-
this.min ? g.forms.messages.rangeUnderflowMin.replace("{min}", (v = this.min) == null ? void 0 : v.toString()) : g.forms.messages.rangeUnderflow,
|
|
514
|
-
a
|
|
515
|
-
) : (S = a.validity) != null && S.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, g.forms.messages.invalid, a) : (A = a.validity) != null && A.rangeOverflow ? this.internals.setValidity(
|
|
516
|
-
{ rangeOverflow: !0 },
|
|
517
|
-
this.max ? g.forms.messages.rangeOverflowMax.replace("{max}", (F = this.max) == null ? void 0 : F.toString()) : g.forms.messages.rangeOverflow,
|
|
518
|
-
a
|
|
519
|
-
) : (T = a.validity) != null && T.customError ? this.internals.setValidity({ customError: !0 }, a.validationMessage, a) : this.internals.setValidity({});
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Updates the form value for this input
|
|
523
|
-
* Handles both single values and arrays (for multi-select)
|
|
524
|
-
*
|
|
525
|
-
* @param value - The value(s) to set in the form
|
|
526
|
-
* @protected
|
|
527
|
-
*/
|
|
528
|
-
setFormValue(a) {
|
|
529
|
-
if (this.internals)
|
|
530
|
-
if (Array.isArray(a)) {
|
|
531
|
-
const r = new FormData();
|
|
532
|
-
a.forEach((f) => {
|
|
533
|
-
r.append(this.name, f);
|
|
534
|
-
}), this.internals.setFormValue(r);
|
|
535
|
-
} else
|
|
536
|
-
this.internals.setFormValue(a);
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Coordinates radio button group by unchecking other radios with the same name
|
|
540
|
-
* Only affects radio inputs within the same form
|
|
541
|
-
*
|
|
542
|
-
* @protected
|
|
543
|
-
*/
|
|
544
|
-
coordinateRadioGroup() {
|
|
545
|
-
if (!this.form || !this.name || this.type !== "radio") return;
|
|
546
|
-
const a = `pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;
|
|
547
|
-
this.form.querySelectorAll(a).forEach((r) => {
|
|
548
|
-
var f;
|
|
549
|
-
if (r !== this && r.getAttribute("name") === this.name && r.getAttribute("value") !== this.value) {
|
|
550
|
-
const u = r;
|
|
551
|
-
u.checked && (u.checked = !1, u.internals && (u.internals.setFormValue(null), (f = u.internals.states) == null || f.delete(z)));
|
|
552
|
-
}
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* Updates checked state and form value for checkbox and radio inputs
|
|
557
|
-
* Triggers this when you want to set the value of the radio or checkbox input to the form
|
|
558
|
-
* Do not use valueChanged or onChange for radios and checkboxes!
|
|
559
|
-
*
|
|
560
|
-
* @param value - The checked state (string 'true'/'false', or boolean)
|
|
561
|
-
* @protected
|
|
562
|
-
*/
|
|
563
|
-
valueChecked(a) {
|
|
564
|
-
if (!this.touched) return;
|
|
565
|
-
const r = this.internals.form || this.closest("form"), f = r ? new FormData(r) : null;
|
|
566
|
-
if (this.type === "radio" && this.coordinateRadioGroup(), typeof a == "string" ? (this.checked = a === "true", this.internals.ariaChecked = String(a === "true")) : typeof a == "boolean" && (this.checked = a, this.internals.ariaChecked = String(a)), this.checked) {
|
|
567
|
-
const u = (typeof this.value == "string" ? this.value : "") || ht;
|
|
568
|
-
this.internals.setFormValue(u), f && f.append(this.name, u), this.internals.states.add(z);
|
|
569
|
-
} else
|
|
570
|
-
this.internals.setFormValue(null), f && f.delete(this.name), this.internals.states.delete(z);
|
|
571
|
-
this.dispatchChangeEvents(this.checked), this.internals.reportValidity();
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Called when value changes (text inputs, select, etc.)
|
|
575
|
-
* Subclasses can override to add custom value transformation logic
|
|
576
|
-
*
|
|
577
|
-
* @param value - The new value
|
|
578
|
-
* @param _old - The previous value
|
|
579
|
-
* @protected
|
|
580
|
-
* @example
|
|
581
|
-
* ```typescript
|
|
582
|
-
* protected valueChanged(value: string, old: string): void {
|
|
583
|
-
* const transformed = this.transformValue(value)
|
|
584
|
-
* super.valueChanged(transformed, old)
|
|
585
|
-
* }
|
|
586
|
-
* ```
|
|
587
|
-
*/
|
|
588
|
-
valueChanged(a, r) {
|
|
589
|
-
(r !== this.value || r !== this._value) && (typeof a == "string" ? ((this.multiple || this.range) && a.includes(P) && (a = a.split(P)), this.value = a, this._value = Array.isArray(a) ? a : [a]) : Array.isArray(a) ? (this.value = this.multiple || this.range ? a : a[0], this._value = a) : (this.value = "", this._value = []), (!this.value || this.value.length === 0) && r && r.length !== 0 ? this.clearInputValue() : this.value && this.value.toString() !== (r == null ? void 0 : r.toString()) && this.onChange(this.value));
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Dispatches change and value-change events
|
|
593
|
-
*
|
|
594
|
-
* @param value - The value to include in the event detail
|
|
595
|
-
* @protected
|
|
596
|
-
*/
|
|
597
|
-
dispatchChangeEvents(a) {
|
|
598
|
-
this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
|
|
599
|
-
new CustomEvent("value-change", {
|
|
600
|
-
detail: a,
|
|
601
|
-
bubbles: !0,
|
|
602
|
-
composed: !0
|
|
603
|
-
})
|
|
604
|
-
);
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* When input goes from content to no content
|
|
608
|
-
* @protected
|
|
609
|
-
*/
|
|
610
|
-
clearInputValue() {
|
|
611
|
-
const a = this.multiple || this.range ? [] : "";
|
|
612
|
-
this.value = a, this.setFormValue(a), this.dispatchChangeEvents(a);
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* When user enters the input, dispatch focus event
|
|
616
|
-
* @protected
|
|
617
|
-
*/
|
|
618
|
-
onFocus() {
|
|
619
|
-
this.dispatchEvent(new FocusEvent("focus", { bubbles: !0, composed: !0 }));
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* When user leaves the input, dispatch blur event
|
|
623
|
-
* @protected
|
|
624
|
-
*/
|
|
625
|
-
onBlur() {
|
|
626
|
-
this.dispatchEvent(new FocusEvent("blur", { bubbles: !0, composed: !0 }));
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Trigger this when user types in the input
|
|
630
|
-
* @protected
|
|
631
|
-
*/
|
|
632
|
-
onInput() {
|
|
633
|
-
this.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 }));
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* Normalizes value format based on multiple/range settings
|
|
637
|
-
*
|
|
638
|
-
* @param value - The value to normalize
|
|
639
|
-
* @returns Normalized value (array if multiple/range, string otherwise)
|
|
640
|
-
* @private
|
|
641
|
-
*/
|
|
642
|
-
normalizeValue(a) {
|
|
643
|
-
return (this.range || this.multiple) && typeof a == "string" && a.includes(P) ? a.split(P) : !this.multiple && !this.range && Array.isArray(a) ? a[0] || "" : a;
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Validates the input element(s)
|
|
647
|
-
* @private
|
|
648
|
-
*/
|
|
649
|
-
validate() {
|
|
650
|
-
var a, r;
|
|
651
|
-
(a = this.inputRef) != null && a.value && this.manageValidity(this.inputRef.value), (r = this.inputRefTo) != null && r.value && this.manageValidity(this.inputRefTo.value);
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* Trigger this when you want to set the value of the input out to the form
|
|
655
|
-
* Handles value normalization, form updates, validation, and event dispatching
|
|
656
|
-
*
|
|
657
|
-
* @param value - The value to set
|
|
658
|
-
* @protected
|
|
659
|
-
*/
|
|
660
|
-
onChange(a) {
|
|
661
|
-
if (!this.touched) {
|
|
662
|
-
this.touched = !0, a && this.setFormValue(a), this.validate();
|
|
663
|
-
return;
|
|
664
|
-
}
|
|
665
|
-
if (typeof a != "string" && !Array.isArray(a))
|
|
666
|
-
return;
|
|
667
|
-
const r = this.normalizeValue(a);
|
|
668
|
-
this.setFormValue(r), this.validate(), this.dispatchChangeEvents(r);
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* Called when the form is reset
|
|
672
|
-
* Resets the input to its default state
|
|
673
|
-
* @protected
|
|
674
|
-
*/
|
|
675
|
-
formResetCallback() {
|
|
676
|
-
var a;
|
|
677
|
-
if (this.touched = !1, this._options && this._options.length && this._options.forEach((r) => {
|
|
678
|
-
"selected" in r && (r.selected = !1);
|
|
679
|
-
}), this.checked !== void 0)
|
|
680
|
-
this.checked = !1, this.internals.ariaChecked = "false", this.internals.setFormValue(""), (a = this.inputRef) != null && a.value && "checked" in this.inputRef.value && (this.inputRef.value.checked = !1), this.valueChecked(this.checked);
|
|
681
|
-
else {
|
|
682
|
-
this.internals.setFormValue("");
|
|
683
|
-
const r = this.defaultValue || (this.multiple || this.range ? [] : "");
|
|
684
|
-
this.value = r, this._value = Array.isArray(r) ? r : [r], this.valueChanged(this.value, null);
|
|
685
|
-
}
|
|
686
|
-
this.internals.ariaInvalid = "false";
|
|
687
|
-
}
|
|
688
|
-
updated(a) {
|
|
689
|
-
super.updated(a), a.has("dataTestid") && this.dataTestid && this.inputRef.value && (this.skipForwardTestid ? this.hasAttribute("data-testid") || this.setAttribute("data-testid", this.dataTestid) : (this.inputRef.value.dataset.testid = this.dataTestid, this.removeAttribute("data-testid")));
|
|
690
|
-
}
|
|
691
|
-
firstUpdated(a) {
|
|
692
|
-
if (super.firstUpdated(a), !this.form) {
|
|
693
|
-
const r = this.internals.form || this.closest("form");
|
|
694
|
-
this.form = r;
|
|
695
|
-
}
|
|
696
|
-
if (this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null), this.defaultChecked && (this.internals.ariaChecked = "true", this.checked = !0), this.required && (this.internals.ariaRequired = "true"), this.disabled && (this.internals.ariaDisabled = "true"), this.id && !this.name && (this.name = this.id), this.checked !== void 0) {
|
|
697
|
-
const r = this.checked === "" || this.checked === "true" || this.checked === !0;
|
|
698
|
-
this.internals.ariaChecked = String(r);
|
|
699
|
-
const f = r ? (typeof this.value == "string" ? this.value : "") || ht : null;
|
|
700
|
-
this.internals.setFormValue(f);
|
|
701
|
-
} else
|
|
702
|
-
this.setFormValue(this.value);
|
|
703
|
-
this.inputRef && this.inputRef.value && (this.inputRef.value.setAttribute("form", ""), this.manageValidity(this.inputRef.value)), this.inputRefTo && this.inputRefTo.value && (this.inputRefTo.value.setAttribute("form", ""), this.manageValidity(this.inputRefTo.value));
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
l([
|
|
707
|
-
o({ type: Boolean, reflect: !0 })
|
|
708
|
-
], c.prototype, "checked");
|
|
709
|
-
l([
|
|
710
|
-
o({ type: Boolean })
|
|
711
|
-
], c.prototype, "defaultChecked");
|
|
712
|
-
l([
|
|
713
|
-
o({ type: Boolean })
|
|
714
|
-
], c.prototype, "multiple");
|
|
715
|
-
l([
|
|
716
|
-
o({ type: Boolean })
|
|
717
|
-
], c.prototype, "range");
|
|
718
|
-
l([
|
|
719
|
-
o({ type: String, reflect: !0 })
|
|
720
|
-
], c.prototype, "type");
|
|
721
|
-
l([
|
|
722
|
-
o()
|
|
723
|
-
], c.prototype, "defaultValue");
|
|
724
|
-
l([
|
|
725
|
-
o({ type: Boolean, reflect: !0 })
|
|
726
|
-
], c.prototype, "disabled");
|
|
727
|
-
l([
|
|
728
|
-
o({ type: Boolean, reflect: !0 })
|
|
729
|
-
], c.prototype, "readonly");
|
|
730
|
-
l([
|
|
731
|
-
o({ type: Boolean, reflect: !0 })
|
|
732
|
-
], c.prototype, "required");
|
|
733
|
-
l([
|
|
734
|
-
o({
|
|
735
|
-
reflect: !0,
|
|
736
|
-
converter: {
|
|
737
|
-
fromAttribute: (p) => p,
|
|
738
|
-
toAttribute: (p) => (p == null ? void 0 : p.toString()) ?? null
|
|
739
|
-
}
|
|
740
|
-
})
|
|
741
|
-
], c.prototype, "max");
|
|
742
|
-
l([
|
|
743
|
-
o({ type: Number, reflect: !0 })
|
|
744
|
-
], c.prototype, "maxlength");
|
|
745
|
-
l([
|
|
746
|
-
o({
|
|
747
|
-
reflect: !0,
|
|
748
|
-
converter: {
|
|
749
|
-
fromAttribute: (p) => p,
|
|
750
|
-
toAttribute: (p) => (p == null ? void 0 : p.toString()) ?? null
|
|
751
|
-
}
|
|
752
|
-
})
|
|
753
|
-
], c.prototype, "min");
|
|
754
|
-
l([
|
|
755
|
-
o({ type: Number, reflect: !0 })
|
|
756
|
-
], c.prototype, "minlength");
|
|
757
|
-
l([
|
|
758
|
-
o({ type: Number, reflect: !0 })
|
|
759
|
-
], c.prototype, "step");
|
|
760
|
-
l([
|
|
761
|
-
o({ type: String })
|
|
762
|
-
], c.prototype, "ariaDescribedBy");
|
|
763
|
-
l([
|
|
764
|
-
o({ type: String })
|
|
765
|
-
], c.prototype, "ariaLabelledby");
|
|
766
|
-
l([
|
|
767
|
-
o({ type: String, reflect: !0 })
|
|
768
|
-
], c.prototype, "name");
|
|
769
|
-
l([
|
|
770
|
-
o({ type: String, reflect: !0 })
|
|
771
|
-
], c.prototype, "pattern");
|
|
772
|
-
l([
|
|
773
|
-
o({ type: String, reflect: !0 })
|
|
774
|
-
], c.prototype, "placeholder");
|
|
775
|
-
l([
|
|
776
|
-
o({ type: String, reflect: !0 })
|
|
777
|
-
], c.prototype, "id");
|
|
778
|
-
l([
|
|
779
|
-
o({ type: Boolean })
|
|
780
|
-
], c.prototype, "counter");
|
|
781
|
-
l([
|
|
782
|
-
o({ type: Boolean })
|
|
783
|
-
], c.prototype, "hasError");
|
|
784
|
-
l([
|
|
785
|
-
o({ type: Boolean })
|
|
786
|
-
], c.prototype, "inline");
|
|
787
|
-
l([
|
|
788
|
-
o({ type: Boolean })
|
|
789
|
-
], c.prototype, "hasFieldset");
|
|
790
|
-
l([
|
|
791
|
-
o({ type: Boolean })
|
|
792
|
-
], c.prototype, "optionalTag");
|
|
793
|
-
l([
|
|
794
|
-
o({ type: Boolean })
|
|
795
|
-
], c.prototype, "requiredTag");
|
|
796
|
-
l([
|
|
797
|
-
o({ type: Boolean })
|
|
798
|
-
], c.prototype, "skipForwardTestid");
|
|
799
|
-
l([
|
|
800
|
-
o({ type: Boolean, reflect: !0, converter: Tt })
|
|
801
|
-
], c.prototype, "useWrapper");
|
|
802
|
-
l([
|
|
803
|
-
o({ type: Boolean, reflect: !0 })
|
|
804
|
-
], c.prototype, "fullwidth");
|
|
805
|
-
l([
|
|
806
|
-
o({ type: Number })
|
|
807
|
-
], c.prototype, "counterMaxLength");
|
|
808
|
-
l([
|
|
809
|
-
o({ type: String })
|
|
810
|
-
], c.prototype, "errorMessage");
|
|
811
|
-
l([
|
|
812
|
-
o({ type: String })
|
|
813
|
-
], c.prototype, "helptext");
|
|
814
|
-
l([
|
|
815
|
-
o({ type: String })
|
|
816
|
-
], c.prototype, "helptextDropdown");
|
|
817
|
-
l([
|
|
818
|
-
o({ type: String, reflect: !1 })
|
|
819
|
-
], c.prototype, "helptextDropdownButton");
|
|
820
|
-
l([
|
|
821
|
-
o({ type: String })
|
|
822
|
-
], c.prototype, "label");
|
|
823
|
-
l([
|
|
824
|
-
o({ type: String, reflect: !1 })
|
|
825
|
-
], c.prototype, "optionalText");
|
|
826
|
-
l([
|
|
827
|
-
o({ type: String, reflect: !1 })
|
|
828
|
-
], c.prototype, "requiredText");
|
|
829
|
-
l([
|
|
830
|
-
o({ type: String, reflect: !1 })
|
|
831
|
-
], c.prototype, "tagText");
|
|
832
|
-
l([
|
|
833
|
-
o({ type: String, attribute: "data-testid" })
|
|
834
|
-
], c.prototype, "dataTestid");
|
|
835
|
-
export {
|
|
836
|
-
c as P
|
|
837
|
-
};
|