@oslokommune/punkt-elements 20.0.3 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/{accordion-5N_ptxrN.cjs → accordion-CSSp30G1.cjs} +1 -1
- package/dist/{accordion-C5cu1xXT.js → accordion-DIjltHSH.js} +11 -14
- package/dist/{alert-DkyTTo7S.cjs → alert-0a5lX0pL.cjs} +12 -12
- package/dist/{alert-CA1fDbyc.js → alert-ZrB-P881.js} +36 -38
- package/dist/{async-directive-DCLIOGR8.cjs → async-directive-Bn7zgxUy.cjs} +1 -1
- package/dist/{async-directive-BcS8rfeC.js → async-directive-Ct3Mrb1M.js} +10 -11
- package/dist/{backlink-CXOxMeyt.cjs → backlink-BAvqdPlG.cjs} +1 -1
- package/dist/{backlink-CDBRcaAu.js → backlink-MBTAhQuD.js} +5 -7
- package/dist/{booleanish-OQJTYSrw.js → booleanish-CBa3Cr2h.js} +1 -2
- package/dist/{breadcrumbs-5oUaCef3.js → breadcrumbs-DtEt1-wn.js} +3 -4
- package/dist/{button-Bswo1C0M.js → button-CJzu0l5A.js} +45 -35
- package/dist/button-DHVRpzpS.cjs +32 -0
- package/dist/{calendar-BOd-9PDd.js → calendar-CkAAgviq.js} +66 -76
- package/dist/calendar-xYEsKilS.cjs +85 -0
- package/dist/{card-CKStAH0Q.js → card-CsEfBJcP.js} +10 -12
- package/dist/{card-BbV4OBqb.cjs → card-XznwedEG.cjs} +1 -1
- package/dist/{checkbox-iMOdzpJ_.cjs → checkbox-Cg7wnn8U.cjs} +1 -1
- package/dist/{checkbox-DIJbuqWm.js → checkbox-XvlUQmg5.js} +8 -10
- package/dist/{checkbox-group-Kua6HuRE.cjs → checkbox-group-BF29zyLd.cjs} +1 -1
- package/dist/{checkbox-group-DLLbWgQb.js → checkbox-group-CRIV5CX0.js} +8 -10
- package/dist/{class-map-BDwVSgLb.js → class-map-C9n5CNC8.js} +2 -3
- package/dist/{classutils-DcYnSgfc.js → classutils-C4jETHHk.js} +1 -2
- package/dist/{combobox-Pxa80TeZ.js → combobox-CDJcIkNJ.js} +63 -66
- package/dist/combobox-DuXavWEY.cjs +139 -0
- package/dist/{consent-UkinU27V.cjs → consent-BOSXNt4Y.cjs} +1 -1
- package/dist/{consent-p-0n2b9x.js → consent-DwppvYBR.js} +5 -7
- package/dist/{consume-Bp12si68.js → consume-C6aWEFx-.js} +4 -8
- package/dist/{converters-CW6SN0TT.cjs → converters-Dp64-kF1.cjs} +1 -1
- package/dist/{converters-CYgQrWVm.js → converters-v_GK06o3.js} +36 -72
- package/dist/{datepicker-Cpiu_Nrf.cjs → datepicker-Cnrbqm62.cjs} +53 -53
- package/dist/{datepicker-BpxUWiIC.js → datepicker-DHdFA8Dx.js} +82 -88
- package/dist/define-component-spec-wHP10r2x.js +5 -0
- package/dist/{dialog-polyfill.esm-D39dWbRt.js → dialog-polyfill.esm-BGBREnq_.js} +2 -3
- package/dist/dialog-polyfill.esm-BPk0-8XP.cjs +1 -0
- package/dist/{directive-helpers-BoDzpPID.js → directive-helpers-KMRvtO9j.js} +2 -3
- package/dist/{element-DLgZkx5L.js → element-Bwc-likm.js} +9 -18
- package/dist/{element-with-slot-mG-h7Sjw.js → element-with-slot-47quDZRt.js} +4 -6
- package/dist/{element-with-slot-CeKuRE3_.cjs → element-with-slot-D_8fAzCW.cjs} +1 -1
- package/dist/{fetch-header-footer-data-Pc32etrk.js → fetch-header-footer-data-CPVt_P8s.js} +3 -6
- package/dist/{fileupload-vPDmtXiM.js → fileupload-BQw5nlzQ.js} +25 -36
- package/dist/{fileupload-DXJtAagE.cjs → fileupload-Cjde62AR.cjs} +1 -1
- package/dist/{focus-modality-controller-Dc2S-KqR.js → focus-modality-controller-DVsT6GeR.js} +1 -2
- package/dist/focus-trap-C-PcFOw6.js +42 -0
- package/dist/focus-trap-C9tsr-xL.cjs +1 -0
- package/dist/{footer-CpE05IW2.cjs → footer-NQaQc2DH.cjs} +9 -9
- package/dist/{footer-D8t0PCPC.js → footer-SbOYv50e.js} +20 -24
- package/dist/{format-BTeSVkED.js → format-DwjTfa9h.js} +1 -2
- package/dist/{header-ChT1hHNA.js → header-CZnKVVt4.js} +22 -26
- package/dist/{header-CiwHNHKD.cjs → header-YbbGgmsD.cjs} +2 -2
- package/dist/{header-menu-Dq9lwNr1.cjs → header-menu-BJMMwrCR.cjs} +1 -1
- package/dist/{header-menu-BrjsNjBH.js → header-menu-k2ACrfOv.js} +9 -11
- package/dist/{heading-DAkjw2Am.cjs → heading-BNlor2MU.cjs} +1 -1
- package/dist/{heading-CMZmPEL9.js → heading-SYKHysr8.js} +19 -21
- package/dist/{helptext-Bse1LpRd.cjs → helptext-CQaNvbiv.cjs} +9 -9
- package/dist/{helptext-BFQzrOw4.js → helptext-kKmVQkwo.js} +20 -22
- package/dist/{icon-C1oCGwEe.js → icon-CZDw42U7.js} +5 -8
- package/dist/if-defined-B3pYog2C.js +4 -0
- package/dist/{input-element-2LHxo0em.cjs → input-element-CfZIyfon.cjs} +1 -1
- package/dist/{input-element-De40zUox.js → input-element-DE0FzjgP.js} +19 -25
- package/dist/{input-wrapper-C_Rzwxx7.cjs → input-wrapper-CbYMk21W.cjs} +1 -1
- package/dist/{input-wrapper-DkpJS1hR.js → input-wrapper-DYg1VHPv.js} +13 -15
- package/dist/{link-DLPpwjq4.js → link-Bc4zf-Dj.js} +19 -22
- package/dist/link-lPrxhYq0.cjs +7 -0
- package/dist/{linkcard-DIG6VYpl.cjs → linkcard-Bih7HS2t.cjs} +1 -1
- package/dist/{linkcard-Dr-r8jBO.js → linkcard-LCFAdVsG.js} +7 -9
- package/dist/{listbox-HrH4JonS.cjs → listbox-Du8llYth.cjs} +10 -10
- package/dist/{listbox-DAvIBH4P.js → listbox-df8gHweY.js} +17 -19
- package/dist/{loader-CFidlqSG.js → loader-C-2b3bGK.js} +9 -12
- package/dist/{loader-DTIrOtTo.cjs → loader-DiQSwWpb.cjs} +1 -1
- package/dist/{messagebox-BLYx3AL7.cjs → messagebox-BiG-fJX9.cjs} +1 -1
- package/dist/{messagebox-B_07P0QA.js → messagebox-CH3bKoJO.js} +9 -11
- package/dist/modal-B3rnE83a.cjs +37 -0
- package/dist/{modal-CA_M2Ix6.js → modal-SBJ8aGvM.js} +33 -35
- package/dist/{option-group-element-DzM8YznZ.js → option-group-element-DtSw52Dr.js} +7 -8
- package/dist/{option-group-element-CVNaBIlP.cjs → option-group-element-dN0ntPZk.cjs} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox-group.cjs +1 -1
- package/dist/pkt-checkbox-group.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -3
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +37 -37
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-CzvBlEPD.js → pkt-options-controller-Dz7DP0wC.js} +2 -3
- package/dist/{pkt-options-controller-9zoH1OBW.cjs → pkt-options-controller-WsHVdPJA.cjs} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-CfCc2zhp.js → progressbar-DlbkKRgP.js} +9 -11
- package/dist/{progressbar-BdqIhC1Z.cjs → progressbar-Wyq_Q1Ur.cjs} +1 -1
- package/dist/{provide-_MnlMGnw.js → provide-DFu2tSv_.js} +3 -5
- package/dist/{radio-group-BRY_74od.js → radio-group-bRF8fnPW.js} +8 -10
- package/dist/{radio-group-CsUgnEv0.cjs → radio-group-u1IH7g-4.cjs} +1 -1
- package/dist/{radiobutton-CQhuG2lj.cjs → radiobutton-86ZvvDmJ.cjs} +1 -1
- package/dist/{radiobutton-lHnq8wX_.js → radiobutton-Bf6aFfYt.js} +8 -10
- package/dist/{ref-B6p6mQkO.cjs → ref-C6VUWwmF.cjs} +1 -1
- package/dist/{ref-BAegS9BR.js → ref-qE1RBrI7.js} +3 -4
- package/dist/{repeat-Cy1M16Di.js → repeat-c2P6osbb.js} +3 -4
- package/dist/{scroll-lock-CR-g54ai.js → scroll-lock-C9jzbJ4E.js} +1 -2
- package/dist/{searchinput-TAqMUJ0B.cjs → searchinput-D5l64Mkb.cjs} +7 -7
- package/dist/{searchinput-BLGaXkP6.js → searchinput-DN8kDZQ1.js} +18 -20
- package/dist/{select-Dle67Uwv.cjs → select-C7kAlSxs.cjs} +15 -15
- package/dist/{select-BvtUxW0Q.js → select-CXIEM2qY.js} +15 -18
- package/dist/shared-types/button.d.ts +13 -0
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-types-BvRk9kiK.js +0 -0
- package/dist/{tabs-BmmTUKuC.js → tabs-Cg16Sl3u.js} +57 -60
- package/dist/tabs-n7hQWwyI.cjs +40 -0
- package/dist/{tag-BZdC0voc.cjs → tag-BAikRN2Y.cjs} +1 -1
- package/dist/{tag-Cam7ISOF.js → tag-HXcXopyA.js} +9 -11
- package/dist/{textarea-Djp5L2Zd.js → textarea-12le8b4I.js} +12 -14
- package/dist/{textarea-DSX3jMlI.cjs → textarea-CRcSfWgX.cjs} +1 -1
- package/dist/{textinput-CBrOZcvL.js → textinput-CC0zxUBT.js} +11 -13
- package/dist/{textinput-CN2F3Q3H.cjs → textinput-Dooq2n8W.cjs} +1 -1
- package/dist/{timepicker-CkaJkIGn.cjs → timepicker-BM4I5w-i.cjs} +20 -20
- package/dist/{timepicker-CT4wfrgQ.js → timepicker-Cz81VQu3.js} +27 -28
- package/dist/{utils-BwF4QSrq.js → utils-Dn5ykFtS.js} +1 -2
- package/package.json +10 -10
- package/src/components/button/button.ts +14 -14
- package/dist/button-bVWAX98x.cjs +0 -32
- package/dist/calendar-CDTCgTJn.cjs +0 -85
- package/dist/combobox-CWL8T3UK.cjs +0 -139
- package/dist/define-component-spec-BYOSeplU.js +0 -6
- package/dist/dialog-polyfill.esm-CW51hN2p.cjs +0 -1
- package/dist/focus-trap-DG3pEuyJ.js +0 -60
- package/dist/focus-trap-DSv4Ifqm.cjs +0 -1
- package/dist/if-defined-DiYi2v_Q.js +0 -5
- package/dist/link-pkFJ11Zd.cjs +0 -7
- package/dist/modal-BvTfLfFq.cjs +0 -37
- package/dist/shared-types-A6iGIX-f.js +0 -1
- package/dist/tabs-B96Orh6O.cjs +0 -40
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-Bwc-likm.js";
|
|
2
|
+
import { n as o, t as s } from "./ref-qE1RBrI7.js";
|
|
3
|
+
import { t as c } from "./if-defined-B3pYog2C.js";
|
|
4
|
+
import { t as l } from "./class-map-C9n5CNC8.js";
|
|
5
|
+
import { t as u } from "./input-element-DE0FzjgP.js";
|
|
6
|
+
import { n as d } from "./element-with-slot-47quDZRt.js";
|
|
7
|
+
import { t as f } from "./format-DwjTfa9h.js";
|
|
8
|
+
import "./icon-CZDw42U7.js";
|
|
9
|
+
import { r as p } from "./input-wrapper-DYg1VHPv.js";
|
|
10
|
+
// ../../shared-utils/timepicker/time-utils.ts
|
|
11
11
|
var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && parseInt(e.slice(3), 10) <= 59, h = (e) => {
|
|
12
12
|
let [t, n] = e.split(":").map(Number);
|
|
13
13
|
return t * 60 + n;
|
|
@@ -23,9 +23,9 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
23
23
|
hours: String(i).padStart(2, "0"),
|
|
24
24
|
minutes: String(a).padStart(2, "0")
|
|
25
25
|
};
|
|
26
|
-
}, b = class extends
|
|
26
|
+
}, b = class extends u {
|
|
27
27
|
constructor(...e) {
|
|
28
|
-
super(...e), this.hiddenInputRef =
|
|
28
|
+
super(...e), this.hiddenInputRef = s(), this.hoursInputRef = s(), this.minutesInputRef = s(), this.buttonRef = s(), this.value = "", this.hidePicker = !1, this.stepArrows = !1, this._hours = "", this._minutes = "", this._isOpen = !1, this._hoursDigitCount = 0, this._hoursFirstDigit = -1, this._minutesDigitCount = 0, this._minutesFirstDigit = -1, this._hasFocus = !1, this._outsideClickHandler = (e) => {
|
|
29
29
|
this.contains(e.target) || this._closePopup();
|
|
30
30
|
}, this._handleComponentFocusIn = () => {
|
|
31
31
|
this._hasFocus || (this._hasFocus = !0, this.onFocus());
|
|
@@ -164,15 +164,15 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
let r = h(this.value), i = g(this.step);
|
|
167
|
-
if (this.min && r < h(String(this.min))) this.internals.setValidity({ rangeUnderflow: !0 },
|
|
168
|
-
else if (this.max && r > h(String(this.max))) this.internals.setValidity({ rangeOverflow: !0 },
|
|
167
|
+
if (this.min && r < h(String(this.min))) this.internals.setValidity({ rangeUnderflow: !0 }, f(n.rangeUnderflowMin, { min: String(this.min) }), t), this._setAriaInvalid(!0);
|
|
168
|
+
else if (this.max && r > h(String(this.max))) this.internals.setValidity({ rangeOverflow: !0 }, f(n.rangeOverflowMax, { max: String(this.max) }), t), this._setAriaInvalid(!0);
|
|
169
169
|
else if (this.step && r % i !== 0) {
|
|
170
|
-
let e = i === 60 ? n.timeStepMismatchHour : i === 30 ? n.timeStepMismatchHalfHour :
|
|
170
|
+
let e = i === 60 ? n.timeStepMismatchHour : i === 30 ? n.timeStepMismatchHalfHour : f(n.timeStepMismatch, { step: `${i}, ${i * 2}, ${i * 3}` });
|
|
171
171
|
this.internals.setValidity({ stepMismatch: !0 }, e, t), this._setAriaInvalid(!0);
|
|
172
172
|
} else this.internals.setValidity({}), this._setAriaInvalid(!1);
|
|
173
173
|
}
|
|
174
174
|
_describedBy() {
|
|
175
|
-
return
|
|
175
|
+
return p({
|
|
176
176
|
id: `${this.id}-hours`,
|
|
177
177
|
hasHelptext: !!this.helptext || this.hasSlotContent("helptext"),
|
|
178
178
|
ariaDescribedby: this.ariaDescribedby
|
|
@@ -267,7 +267,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
267
267
|
let r = String(t).padStart(2, "0"), i = t === (n === "hour" ? this._hours === "" ? NaN : parseInt(this._hours, 10) : this._minutes === "" ? NaN : parseInt(this._minutes, 10));
|
|
268
268
|
return e`
|
|
269
269
|
<button
|
|
270
|
-
class=${
|
|
270
|
+
class=${l({
|
|
271
271
|
"pkt-btn": !0,
|
|
272
272
|
"pkt-btn--tertiary": !0,
|
|
273
273
|
"pkt-btn--small": !0,
|
|
@@ -345,7 +345,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
345
345
|
</button>
|
|
346
346
|
` : n}
|
|
347
347
|
<input
|
|
348
|
-
${
|
|
348
|
+
${o(this.hoursInputRef)}
|
|
349
349
|
type="text"
|
|
350
350
|
inputmode="numeric"
|
|
351
351
|
maxlength="2"
|
|
@@ -360,7 +360,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
360
360
|
role="spinbutton"
|
|
361
361
|
aria-invalid=${this.hasError ? "true" : n}
|
|
362
362
|
aria-errormessage=${this.hasError ? `${this.id}-hours-error` : n}
|
|
363
|
-
aria-describedby=${
|
|
363
|
+
aria-describedby=${c(this._describedBy())}
|
|
364
364
|
aria-valuemin="0"
|
|
365
365
|
aria-valuemax="23"
|
|
366
366
|
aria-valuenow=${this._hours === "" ? n : this._hours}
|
|
@@ -375,7 +375,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
375
375
|
/>
|
|
376
376
|
<span class="pkt-timepicker__separator">:</span>
|
|
377
377
|
<input
|
|
378
|
-
${
|
|
378
|
+
${o(this.minutesInputRef)}
|
|
379
379
|
type="text"
|
|
380
380
|
inputmode="numeric"
|
|
381
381
|
maxlength="2"
|
|
@@ -390,7 +390,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
390
390
|
role="spinbutton"
|
|
391
391
|
aria-invalid=${this.hasError ? "true" : n}
|
|
392
392
|
aria-errormessage=${this.hasError ? `${this.id}-hours-error` : n}
|
|
393
|
-
aria-describedby=${
|
|
393
|
+
aria-describedby=${c(this._describedBy())}
|
|
394
394
|
aria-valuemin="0"
|
|
395
395
|
aria-valuemax="59"
|
|
396
396
|
aria-valuenow=${this._minutes === "" ? n : this._minutes}
|
|
@@ -410,7 +410,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
410
410
|
></pkt-icon>` : n}
|
|
411
411
|
${!this.hidePicker && !this.stepArrows ? e`
|
|
412
412
|
<button
|
|
413
|
-
${
|
|
413
|
+
${o(this.buttonRef)}
|
|
414
414
|
class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this.inputSize} pkt-timepicker__button"
|
|
415
415
|
type="button"
|
|
416
416
|
aria-label=${this.pktStrings.get("timepicker").openPicker}
|
|
@@ -441,15 +441,15 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
441
441
|
</button>
|
|
442
442
|
` : n}
|
|
443
443
|
<input
|
|
444
|
-
${
|
|
444
|
+
${o(this.hiddenInputRef)}
|
|
445
445
|
type="time"
|
|
446
446
|
hidden
|
|
447
447
|
name=${this.name || this.id}
|
|
448
448
|
id=${this.id + "-input"}
|
|
449
449
|
.value=${this.value}
|
|
450
|
-
min=${
|
|
451
|
-
max=${
|
|
452
|
-
step=${
|
|
450
|
+
min=${c(this.min ?? void 0)}
|
|
451
|
+
max=${c(this.max ?? void 0)}
|
|
452
|
+
step=${c(this.step ?? void 0)}
|
|
453
453
|
?required=${this.required}
|
|
454
454
|
?disabled=${this.isDisabled}
|
|
455
455
|
tabindex="-1"
|
|
@@ -460,7 +460,7 @@ var m = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
|
|
|
460
460
|
render() {
|
|
461
461
|
return e`
|
|
462
462
|
<pkt-input-wrapper
|
|
463
|
-
${
|
|
463
|
+
${d(this, ["helptext"])}
|
|
464
464
|
.strings=${this.strings}
|
|
465
465
|
label="${this.label}"
|
|
466
466
|
?disabled=${this.isDisabled}
|
|
@@ -509,5 +509,4 @@ try {
|
|
|
509
509
|
} catch {
|
|
510
510
|
console.warn("Forsøker å definere <pkt-timepicker>, men den er allerede definert");
|
|
511
511
|
}
|
|
512
|
-
//#endregion
|
|
513
512
|
export { b as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-utils/utils.ts
|
|
2
2
|
var e = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toString(16)).slice(-16), t = (e) => new Promise((t) => setTimeout(t, e)), n = () => {
|
|
3
3
|
let t = e(), n = e();
|
|
4
4
|
return t.slice(0, 8) + "-" + t.slice(8, 12) + "-4" + t.slice(13) + "-a" + n.slice(1, 4) + "-" + n.slice(4);
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { n, t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "20.0
|
|
3
|
+
"version": "20.1.0",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, designsystem for Oslo kommune",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo kommune",
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@lit-labs/router": "^0.1.4",
|
|
38
|
-
"@oslokommune/punkt-assets": "^20.0.
|
|
38
|
+
"@oslokommune/punkt-assets": "^20.0.5",
|
|
39
39
|
"@testing-library/dom": "^10.4.2",
|
|
40
40
|
"@testing-library/jest-dom": "^7.0.1",
|
|
41
41
|
"@types/jest-axe": "^3.5.9",
|
|
42
|
-
"@types/node": "^
|
|
42
|
+
"@types/node": "^26.6.6",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
44
44
|
"@typescript-eslint/parser": "^8.61.1",
|
|
45
|
-
"@vitest/ui": "^
|
|
46
|
-
"eslint": "^10.
|
|
45
|
+
"@vitest/ui": "^5.1.0",
|
|
46
|
+
"eslint": "^10.14.0",
|
|
47
47
|
"eslint-config-prettier": "^10.1.8",
|
|
48
48
|
"eslint-plugin-lit": "^2.3.1",
|
|
49
49
|
"jest-axe": "^11.0.0",
|
|
50
|
-
"jsdom": "^
|
|
51
|
-
"sass": "^1.
|
|
50
|
+
"jsdom": "^31.0.0",
|
|
51
|
+
"sass": "^1.108.1",
|
|
52
52
|
"typescript": "^7.0.2",
|
|
53
53
|
"urlpattern-polyfill": "^10.1.0",
|
|
54
|
-
"vite": "^8.
|
|
54
|
+
"vite": "^8.3.6",
|
|
55
55
|
"vite-plugin-dts": "^5.1.2",
|
|
56
|
-
"vitest": "^
|
|
56
|
+
"vitest": "^5.1.0"
|
|
57
57
|
},
|
|
58
58
|
"private": false,
|
|
59
59
|
"publishConfig": {
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": "^22.19.0 || ^24.0.0 || ^26.0.0"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "325fe848095a16e10dcc919ca113f003f44e3e30"
|
|
82
82
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PktElementWithSlot } from '@/base-elements/element-with-slot'
|
|
2
2
|
import { slotContent } from '@/directives/slot-content'
|
|
3
3
|
import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon'
|
|
4
|
+
import { ANIMATION_DEFAULT_PATH, BUTTON_DEFAULTS } from 'shared-types'
|
|
4
5
|
import type {
|
|
5
6
|
Booleanish,
|
|
6
7
|
IPktButtonBase,
|
|
@@ -18,11 +19,9 @@ import { ifDefined } from 'lit/directives/if-defined.js'
|
|
|
18
19
|
|
|
19
20
|
import '@/components/icon'
|
|
20
21
|
|
|
21
|
-
const defaultAnimationPath = 'https://punkt-cdn.oslo.kommune.no/latest/animations/'
|
|
22
|
-
|
|
23
22
|
// Allow global override of animation assets path
|
|
24
23
|
if (typeof window !== 'undefined') {
|
|
25
|
-
window.pktAnimationPath = window.pktAnimationPath ||
|
|
24
|
+
window.pktAnimationPath = window.pktAnimationPath || ANIMATION_DEFAULT_PATH
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
export type {
|
|
@@ -47,24 +46,25 @@ export interface IPktButton
|
|
|
47
46
|
}
|
|
48
47
|
export class PktButton extends PktElementWithSlot<IPktButton> implements IPktButton {
|
|
49
48
|
// Properties
|
|
50
|
-
@property({ type: String }) iconName: string =
|
|
51
|
-
@property({ type: String }) secondIconName: string =
|
|
49
|
+
@property({ type: String }) iconName: string = BUTTON_DEFAULTS.iconName
|
|
50
|
+
@property({ type: String }) secondIconName: string = BUTTON_DEFAULTS.secondIconName
|
|
52
51
|
@property({ type: String }) iconPath: string | undefined
|
|
53
52
|
@property({ type: String }) secondIconPath: string | undefined
|
|
54
|
-
@property({ type: String }) size: TPktButtonSize =
|
|
55
|
-
@property({ type: Boolean, attribute: 'full-width' }) fullWidth: Booleanish =
|
|
53
|
+
@property({ type: String }) size: TPktButtonSize = BUTTON_DEFAULTS.size
|
|
54
|
+
@property({ type: Boolean, attribute: 'full-width' }) fullWidth: Booleanish =
|
|
55
|
+
BUTTON_DEFAULTS.fullWidth
|
|
56
56
|
@property({ type: Boolean, attribute: 'full-width-on-mobile' }) fullWidthOnMobile: Booleanish =
|
|
57
|
-
|
|
57
|
+
BUTTON_DEFAULTS.fullWidthOnMobile
|
|
58
58
|
@property({ type: String }) color?: TPktButtonColor
|
|
59
|
-
@property({ type: String }) skin: TPktButtonSkin =
|
|
60
|
-
@property({ type: String }) variant: TPktButtonVariant =
|
|
59
|
+
@property({ type: String }) skin: TPktButtonSkin = BUTTON_DEFAULTS.skin
|
|
60
|
+
@property({ type: String }) variant: TPktButtonVariant = BUTTON_DEFAULTS.variant
|
|
61
61
|
@property({ type: String, reflect: true }) state?: TPktButtonState = undefined
|
|
62
|
-
@property({ type: String, reflect: true }) type: THTMLButtonType =
|
|
62
|
+
@property({ type: String, reflect: true }) type: THTMLButtonType = BUTTON_DEFAULTS.type
|
|
63
63
|
@property({ type: String }) form: string | undefined = undefined
|
|
64
|
-
@property({ type: Boolean, reflect: true }) isLoading: Booleanish =
|
|
65
|
-
@property({ type: Boolean, reflect: true }) disabled: Booleanish =
|
|
64
|
+
@property({ type: Boolean, reflect: true }) isLoading: Booleanish = BUTTON_DEFAULTS.isLoading
|
|
65
|
+
@property({ type: Boolean, reflect: true }) disabled: Booleanish = BUTTON_DEFAULTS.disabled
|
|
66
66
|
@property({ type: String }) loadingAnimationPath: string | undefined =
|
|
67
|
-
typeof window !== 'undefined' ? window.pktAnimationPath :
|
|
67
|
+
typeof window !== 'undefined' ? window.pktAnimationPath : ANIMATION_DEFAULT_PATH
|
|
68
68
|
|
|
69
69
|
// Lifecycle
|
|
70
70
|
|
package/dist/button-bVWAX98x.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-CeKuRE3_.cjs");require("./icon-5A378_yh.cjs");const r=require("./if-defined-Ci4ZQsgL.cjs");var i,a=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||a);var o=class i extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=void 0,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:a,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of i.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
|
|
2
|
-
<button
|
|
3
|
-
class=${t.t(a)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
?disabled=${!!this.disabled}
|
|
6
|
-
aria-busy=${r.t(this.isLoading?`true`:void 0)}
|
|
7
|
-
aria-disabled=${r.t(this.disabled||this.isLoading?`true`:void 0)}
|
|
8
|
-
aria-haspopup=${r.t(this.relocatedAria[`aria-haspopup`])}
|
|
9
|
-
aria-expanded=${r.t(this.relocatedAria[`aria-expanded`])}
|
|
10
|
-
aria-controls=${r.t(this.relocatedAria[`aria-controls`])}
|
|
11
|
-
aria-label=${r.t(this.relocatedAria[`aria-label`])}
|
|
12
|
-
tabindex=${r.t(this.relocatedAria.tabindex)}
|
|
13
|
-
form=${r.t(i)}
|
|
14
|
-
>
|
|
15
|
-
${this.isLoading?e._`<pkt-icon
|
|
16
|
-
class="pkt-btn__icon pkt-btn__spinner"
|
|
17
|
-
name="spinner-blue"
|
|
18
|
-
path=${r.t(this.loadingAnimationPath)}
|
|
19
|
-
></pkt-icon>`:e.h}
|
|
20
|
-
${this.variant===`label-only`?e.h:e._`<pkt-icon
|
|
21
|
-
class="pkt-btn__icon pkt-icon"
|
|
22
|
-
name=${this.iconName}
|
|
23
|
-
path=${r.t(this.iconPath)}
|
|
24
|
-
></pkt-icon>`}
|
|
25
|
-
<span class="pkt-btn__text">${n.i(this)}</span>
|
|
26
|
-
${this.variant===`icons-right-and-left`?e._`<pkt-icon
|
|
27
|
-
class="pkt-btn__icon"
|
|
28
|
-
name=${this.secondIconName}
|
|
29
|
-
path=${r.t(this.secondIconPath)}
|
|
30
|
-
></pkt-icon>`:e.h}
|
|
31
|
-
</button>
|
|
32
|
-
`}};i=o,i.relocatedAriaAttributes=[`aria-haspopup`,`aria-expanded`,`aria-controls`,`aria-label`,`tabindex`],e.n([e.u({type:String})],o.prototype,`iconName`,void 0),e.n([e.u({type:String})],o.prototype,`secondIconName`,void 0),e.n([e.u({type:String})],o.prototype,`iconPath`,void 0),e.n([e.u({type:String})],o.prototype,`secondIconPath`,void 0),e.n([e.u({type:String})],o.prototype,`size`,void 0),e.n([e.u({type:Boolean,attribute:`full-width`})],o.prototype,`fullWidth`,void 0),e.n([e.u({type:Boolean,attribute:`full-width-on-mobile`})],o.prototype,`fullWidthOnMobile`,void 0),e.n([e.u({type:String})],o.prototype,`color`,void 0),e.n([e.u({type:String})],o.prototype,`skin`,void 0),e.n([e.u({type:String})],o.prototype,`variant`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`state`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`type`,void 0),e.n([e.u({type:String})],o.prototype,`form`,void 0),e.n([e.u({type:Boolean,reflect:!0})],o.prototype,`isLoading`,void 0),e.n([e.u({type:Boolean,reflect:!0})],o.prototype,`disabled`,void 0),e.n([e.u({type:String})],o.prototype,`loadingAnimationPath`,void 0),e.n([e.l()],o.prototype,`relocatedAria`,void 0);try{e.d(`pkt-button`)(o)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs");require("./icon-5A378_yh.cjs");const n=require("./converters-CW6SN0TT.cjs");var r={multiple:!1,maxMultiple:0,range:!1,earliest:null,latest:null,weeknumbers:!1,withcontrols:!1};function i(e,t,r){let i=n.y(e,r?.in);return isNaN(t)?n.b(r?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function a(e,t){let[r,i]=n.v(e,t.start,t.end);return{start:r,end:i}}function o(e,t){let{start:r,end:i}=a(t?.in,e),o=+r>+i,s=o?+r:+i,c=o?i:r;c.setHours(0,0,0,0);let l=t?.step??1;if(!l)return[];l<0&&(l=-l,o=!o);let u=[];for(;+c<=s;)u.push(n.b(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return o?u.reverse():u}function s(e,t){let r=n.y(e,t?.in).getDay();return r===0?7:r}function c(e,t){let r=(t.excludedates??[]).map(e=>typeof e==`string`?e:n.a(e));return!n.l(e,t.earliest,t.latest,r,t.excludeweekdays??[])}function l(e,t,n,r){return!!(c(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function u(e,t,r){let i=n.p(e,t,0);return!(r&&n.d(r)>i)}function d(e,t,r){let i=n.p(t===11?e+1:e,t===11?0:t+1,1);return!(r&&n.d(r)<i)}function f(e,t){let r=n.p(e,t,1),i=n.p(e,t+1,0),a=(r.getDay()+6)%7,o=i.getDate();return{firstDayOfMonth:r,lastDayOfMonth:i,startingDay:a,numDays:o,numRows:Math.ceil((o+a)/7),initialWeek:n._(r)}}function p(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function m(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>n.m(e))}function h(e,t){let r=o({start:e,end:t}),i={};if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++){let o=r[a],s=o>e&&o<t;i[n.a(o)]=s}return i}function g(e,t,n,r){if(t.length!==1)return!0;let i=o({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(s(i[a]).toString()))return!1}return!0}function _(e,t){let r=n.a(e);return t.includes(r)?t:[...t,r]}function v(e,t){let r=n.a(e),i=t.indexOf(r);if(i===-1)return t;if(t.length===1)return[];let a=[...t];return a.splice(i,1),a}function y(e,t,r){let i=n.a(e);return t.includes(i)?v(e,t):r>0&&t.length>=r?t:_(e,t)}function b(e,t,r){let i=n.a(e),a=m(t);return t.includes(i)?t.indexOf(i)===0?[]:v(e,t):t.length>1||t.length===1&&(!g(e,a,r.excludedates,r.excludeweekdays)||a[0]>e)?[i]:_(e,t)}var x={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function S(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function C(e,t,r){let a=i(e,t);if(!a)return null;let o=r(`button[data-date="${n.a(a)}"]`);for(;o instanceof HTMLButtonElement&&o.dataset.disabled;)if(a=i(a,t),o=r(`button[data-date="${n.a(a)}"]`),!o)return null;return a}function w(e){return x[e]??null}var T=class extends e.t{constructor(...e){super(...e),this.selected=[],this.multiple=r.multiple,this.maxMultiple=r.maxMultiple,this.range=r.range,this.earliest=r.earliest,this.latest=r.latest,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=r.weeknumbers,this.withcontrols=r.withcontrols,this.currentmonth=null,this.today=null,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get calendarStrings(){let e=this.pktStrings.get(`dates`),t=this.pktStrings.get(`calendar`);return{daysShort:this.dayStrings??e.daysShort,days:this.dayStringsLong??e.days,months:this.monthStrings??e.months,week:this.weekString??e.week,prevMonth:this.prevMonthString??t.prevMonth,nextMonth:this.nextMonthString??t.nextMonth}}get todayDate(){return this.today?n.m(this.today):n.g()}firstUpdated(e){this.addEventListener(`keydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),super.disconnectedCallback()}willUpdate(e){super.willUpdate(e),e.has(`selected`)&&this.convertSelected()}convertSelected(){typeof this.selected==`string`&&(this.selected=this.selected.split(`,`)),this.selected.length===1&&this.selected[0]===``&&(this.selected=[]),this._selected=m(this.selected),this.range&&this.selected.length===2&&(this.inRange=h(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=n.m(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?n.f(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=n.f(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=n.f(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=w(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let r=e.target;if(S(r))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let i=C(this.focusedDate?n.d(this.focusedDate):n.p(this.year,this.month,1),t,this.querySelector.bind(this));if(i){let e=this.querySelector(`button[data-date="${n.a(i)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=n.a(i),e.focus())}}render(){return e._`
|
|
2
|
-
<div
|
|
3
|
-
class="pkt-calendar ${this.weeknumbers?`pkt-cal-weeknumbers`:``}"
|
|
4
|
-
@focusout=${this.closeEvent}
|
|
5
|
-
@keydown=${e=>{e.key===`Escape`&&(e.preventDefault(),this.close())}}
|
|
6
|
-
>
|
|
7
|
-
<nav class="pkt-cal-month-nav">
|
|
8
|
-
${this.renderMonthNavButton(`prev`)} ${this.renderMonthNav()}
|
|
9
|
-
${this.renderMonthNavButton(`next`)}
|
|
10
|
-
</nav>
|
|
11
|
-
<table
|
|
12
|
-
class="pkt-cal-days pkt-txt-12-medium pkt-calendar__body"
|
|
13
|
-
role="grid"
|
|
14
|
-
aria-multiselectable=${this.range||this.multiple?`true`:e.h}
|
|
15
|
-
>
|
|
16
|
-
<thead>
|
|
17
|
-
${this.renderDayNames()}
|
|
18
|
-
</thead>
|
|
19
|
-
<tbody>
|
|
20
|
-
${this.renderCalendarBody()}
|
|
21
|
-
</tbody>
|
|
22
|
-
</table>
|
|
23
|
-
</div>
|
|
24
|
-
`}renderMonthNavButton(t){let n=t===`prev`,r=n?this.isPrevMonthAllowed():this.isNextMonthAllowed(),{prevMonth:i,nextMonth:a}=this.calendarStrings,o=n?i:a,s=n?`chevron-thin-left`:`chevron-thin-right`,c=n?`pkt-calendar__prev-month`:`pkt-calendar__next-month`,l=n?()=>this.prevMonth():()=>this.nextMonth();return e._`<div>
|
|
25
|
-
<button
|
|
26
|
-
type="button"
|
|
27
|
-
aria-label="${o}"
|
|
28
|
-
@click=${()=>r&&l()}
|
|
29
|
-
@keydown=${e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r&&l())}}
|
|
30
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${c} ${r?``:`pkt-invisible`}"
|
|
31
|
-
data-disabled=${r?e.h:`disabled`}
|
|
32
|
-
aria-disabled=${r?e.h:`true`}
|
|
33
|
-
tabindex=${r?`0`:`-1`}
|
|
34
|
-
>
|
|
35
|
-
<pkt-icon class="pkt-btn__icon" name="${s}"></pkt-icon>
|
|
36
|
-
<span class="pkt-btn__text">${o}</span>
|
|
37
|
-
</button>
|
|
38
|
-
</div>`}renderDayNames(){let t=[];this.weeknumbers&&t.push(e._`<th><div class="pkt-calendar__week-number">${this.calendarStrings.week}</div></th>`);let{days:n,daysShort:r}=this.calendarStrings;for(let i=0;i<r.length;i++)t.push(e._`<th>
|
|
39
|
-
<div class="pkt-calendar__day-name" aria-label="${n[i]}">${r[i]}</div>
|
|
40
|
-
</th>`);return e._`<tr class="pkt-cal-week-row">
|
|
41
|
-
${t}
|
|
42
|
-
</tr>`}renderMonthNav(){let t=this.pktStrings.get(`dates`);return this.withcontrols?e._`<div class="pkt-cal-month-picker">
|
|
43
|
-
<label for="${this.id}-monthnav" class="pkt-hide">${t.month}</label>
|
|
44
|
-
<select
|
|
45
|
-
aria-label="${t.month}"
|
|
46
|
-
class="pkt-input pkt-input-compact"
|
|
47
|
-
id="${this.id}-monthnav"
|
|
48
|
-
@change=${e=>{e.stopImmediatePropagation();let t=e.target;this.changeMonth(this.year,parseInt(t.value))}}
|
|
49
|
-
>
|
|
50
|
-
${this.calendarStrings.months.map((t,n)=>e._`<option value=${n} ?selected=${this.month===n}>${t}</option>`)}
|
|
51
|
-
</select>
|
|
52
|
-
<label for="${this.id}-yearnav" class="pkt-hide">${t.year}</label>
|
|
53
|
-
<input
|
|
54
|
-
aria-label="${t.year}"
|
|
55
|
-
class="pkt-input pkt-cal-input-year pkt-input-compact"
|
|
56
|
-
id="${this.id}-yearnav"
|
|
57
|
-
type="number"
|
|
58
|
-
size="4"
|
|
59
|
-
placeholder="0000"
|
|
60
|
-
@change=${e=>{e.stopImmediatePropagation();let t=e.target;this.changeMonth(parseInt(t.value),this.month)}}
|
|
61
|
-
value=${this.year}
|
|
62
|
-
.value=${this.year}
|
|
63
|
-
/>
|
|
64
|
-
</div>`:e._`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
65
|
-
${this.calendarStrings.months[this.month]} ${this.year}
|
|
66
|
-
</div>`}getDayViewData(e,t){let r=n.p(this.year,this.month,e),i=n.a(r),a=i===n.a(t),o=this.selected.includes(i),s=this.isDayDisabled(r,o),c=this.calculateTabIndex(i,s,e);return{currentDate:r,currentDateISO:i,isToday:a,isSelected:o,isDisabled:s,ariaLabel:n.o(r),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return l(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?`0`:`-1`:!t&&this.tabIndexSet===0?(this.tabIndexSet=n,`0`):this.tabIndexSet===n?`0`:`-1`}getDayCellClasses(e){let{currentDateISO:t,isToday:r,isSelected:i}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],o=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":r,"pkt-cal-selected":i,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":o,"pkt-cal-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered)}}getDayButtonClasses(e){let{currentDateISO:t,isToday:r,isSelected:i,isDisabled:a}=e,o=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],s=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(n,r){let i=this.getDayViewData(n,r),{currentDate:a,currentDateISO:o,isSelected:s,isDisabled:c,ariaLabel:l,tabindex:u}=i;this.selectableDates.push({currentDateISO:o,isDisabled:c,tabindex:u});let d=this.getDayCellClasses(i),f=this.getDayButtonClasses(i);return e._`<td class=${t.t(d)}>
|
|
67
|
-
<button
|
|
68
|
-
type="button"
|
|
69
|
-
aria-pressed=${s?`true`:`false`}
|
|
70
|
-
?disabled=${c}
|
|
71
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${t.t(f)}"
|
|
72
|
-
@mouseover=${()=>this.range&&!this.isExcluded(a)&&this.handleRangeHover(a)}
|
|
73
|
-
@focus=${()=>this.handleDayFocus(a,o)}
|
|
74
|
-
aria-label="${l}"
|
|
75
|
-
tabindex=${u}
|
|
76
|
-
data-disabled=${c?`disabled`:e.h}
|
|
77
|
-
data-date=${o}
|
|
78
|
-
@keydown=${e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.handleDateSelect(a))}}
|
|
79
|
-
@click=${e=>{c||(e.preventDefault(),this.handleDateSelect(a))}}
|
|
80
|
-
>
|
|
81
|
-
<span class="pkt-btn__text pkt-txt-14-light">${n}</span>
|
|
82
|
-
</button>
|
|
83
|
-
</td>`}renderEmptyDayCell(){return e._`<td class="pkt-cal-other"></td>`}renderWeekRow(t){return e._`<tr class="pkt-cal-week-row" role="row">
|
|
84
|
-
${t}
|
|
85
|
-
</tr>`}renderCalendarBody(){let t=this.todayDate,n=f(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let r=1,i=n.initialWeek,a=[];for(let o=0;o<n.numRows;o++){let s=[];this.weeknumbers&&s.push(e._`<td class="pkt-cal-week">${i}</td>`),i++;for(let e=0;e<7;e++){let i=p(o,e,r,n);i===`current-month`?(s.push(this.renderDayView(r,t)),r++):(s.push(this.renderEmptyDayCell()),i===`next-month`&&r++)}a.push(this.renderWeekRow(s))}return a}isExcluded(e){return c(e,this.getDateConstraints())}isPrevMonthAllowed(){return u(this.year,this.month,this.earliest)}prevMonth(){let e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return d(this.year,this.month,this.latest)}nextMonth(){let e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e==`string`?parseInt(e):e,this.month=typeof t==`string`?parseInt(t):t,this.currentmonth=n.f(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected==`string`?this.selected.split(`,`):this.selected}addToSelected(e){this.selected=_(e,this.normalizeSelected()),this._selected=m(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=v(e,this.normalizeSelected()),this._selected=m(this.selected)}toggleSelected(e){this.selected=y(e,this.normalizeSelected(),this.maxMultiple),this._selected=m(this.selected)}isRangeAllowed(e){return g(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=b(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=m(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e?this.rangeHovered=null:(this.rangeHovered=e,this.inRange=h(this._selected[0],e))}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(n.a(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent(`date-selected`,{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){let e=n.a(n.f(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}let r=this.selectableDates.find(e=>!e.isDisabled);if(r){let e=this.querySelector(`button[data-date="${r.currentDateISO}"]`);e instanceof HTMLButtonElement&&(this.focusedDate=r.currentDateISO,e.focus())}}closeEvent(e){let t=e.target,n=e.relatedTarget;this.contains(n)||t.classList.contains(`pkt-invisible`)||t.closest(`.pkt-cal-month-picker`)||this.close()}close(){this.dispatchEvent(new CustomEvent(`close`,{detail:!0,bubbles:!0,composed:!0}))}};e.n([e.u({converter:n.t.csvToArray})],T.prototype,`selected`,void 0),e.n([e.u({type:Boolean})],T.prototype,`multiple`,void 0),e.n([e.u({type:Number,attribute:`max-multiple`})],T.prototype,`maxMultiple`,void 0),e.n([e.u({type:Boolean})],T.prototype,`range`,void 0),e.n([e.u({type:String})],T.prototype,`earliest`,void 0),e.n([e.u({type:String})],T.prototype,`latest`,void 0),e.n([e.u({converter:n.t.stringsToDate})],T.prototype,`excludedates`,void 0),e.n([e.u({converter:n.t.csvToArray})],T.prototype,`excludeweekdays`,void 0),e.n([e.u({type:Boolean})],T.prototype,`weeknumbers`,void 0),e.n([e.u({type:Boolean})],T.prototype,`withcontrols`,void 0),e.n([e.u({converter:n.t.stringToDate})],T.prototype,`currentmonth`,void 0),e.n([e.u({type:String})],T.prototype,`today`,void 0),e.n([e.u({type:Array,attribute:`day-strings`})],T.prototype,`dayStrings`,void 0),e.n([e.u({type:Array,attribute:`day-strings-long`})],T.prototype,`dayStringsLong`,void 0),e.n([e.u({type:Array,attribute:`month-strings`})],T.prototype,`monthStrings`,void 0),e.n([e.u({type:String,attribute:`week-string`})],T.prototype,`weekString`,void 0),e.n([e.u({type:String,attribute:`prev-month-string`})],T.prototype,`prevMonthString`,void 0),e.n([e.u({type:String,attribute:`next-month-string`})],T.prototype,`nextMonthString`,void 0),e.n([e.u({type:Array})],T.prototype,`_selected`,void 0),e.n([e.l()],T.prototype,`inRange`,void 0),e.n([e.u({type:Date})],T.prototype,`rangeHovered`,void 0),e.n([e.u({type:Number})],T.prototype,`year`,void 0),e.n([e.u({type:Number})],T.prototype,`month`,void 0),e.n([e.l()],T.prototype,`currentmonthtouched`,void 0),e.n([e.l()],T.prototype,`focusedDate`,void 0);try{e.d(`pkt-calendar`)(T)}catch{console.warn(`Forsøker å definere <pkt-calendar>, men den er allerede definert`)}var E=T;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return E}});
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-CeKuRE3_.cjs");require("./icon-5A378_yh.cjs");const i=require("./input-wrapper-C_Rzwxx7.cjs");require("./tag-BZdC0voc.cjs");const a=require("./if-defined-Ci4ZQsgL.cjs"),o=require("./ref-B6p6mQkO.cjs"),s=require("./repeat-CjvNrcUr.cjs"),c=require("./listbox-HrH4JonS.cjs"),l=require("./input-element-2LHxo0em.cjs"),u=require("./pkt-options-controller-9zoH1OBW.cjs");var d={multiple:!1,typeahead:!1,includeSearch:!1,allowUserInput:!1,displayValueAs:`label`,inputSize:`medium`,disabled:!1,hasError:!1,required:!1,requiredTag:!1,optionalTag:!1,fullwidth:!1,inline:!1,useWrapper:!0},f=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},p=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=c.i(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},m=(e,t,n,r,i)=>e.trim().toLowerCase()?{...c.c(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},h=(e,t,n)=>{let r=c.i(t,e);return n===`label`&&r?.label?r.label:e},g={markOptionSelected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!0;break}}},markOptionDeselected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!1;break}}},markAllSelected(e){for(let t of e)t.selected=!0},markAllDeselected(e){for(let t of e)t.selected=!1},removeUserAddedOptions(e){return e.filter(e=>!e.userAdded)}},_={parseOptionsFromSlot(e){let t=[];return e.forEach(e=>{if(!e.textContent&&!e.getAttribute(`value`))return;let n={value:e.getAttribute(`value`)||e.textContent||``,label:e.textContent||e.getAttribute(`value`)||``};e.getAttribute(`data-prefix`)&&(n.prefix=e.getAttribute(`data-prefix`)||void 0),e.getAttribute(`tagskincolor`)&&(n.tagSkinColor=e.getAttribute(`tagskincolor`)),e.getAttribute(`description`)&&(n.description=e.getAttribute(`description`)||void 0),n.fulltext=c.r(n),t.push(n)}),t}},v={cloneOptions(e){return Array.isArray(e)?e.map(e=>({...e})):[]},syncOptionsWithValues(e,t){let n=[...t];return e.forEach(e=>{e.value&&!e.label&&(e.label=e.value),e.selected&&!n.includes(e.value)&&n.push(e.value),e.fulltext=c.r(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t,n){return[...t.filter(e=>e?.userAdded&&n.includes(e.value)).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},y=class extends l.t{constructor(){super(),this.value=``,this.options=[],this.defaultOptions=[],this.allowUserInput=d.allowUserInput,this.typeahead=d.typeahead,this.includeSearch=d.includeSearch,this.searchPlaceholder=null,this.multiple=d.multiple,this.maxlength=null,this.displayValueAs=d.displayValueAs,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._messageValue=null,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._skipInputTab=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=o.t(),this.triggerRef=o.t(),this.listboxRef=o.t(),this._pendingDispatchFrom=null,this.optionsController=new u.t(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(this.multiple&&this._value.length!==0)return`${this._value.length} valgt`}focusTrigger(){this._hasTextInput?this.inputRef.value?.focus():this.triggerRef.value?.focus()}focusAfterCommit(){this._skipInputTab=!0;let e=this.inputRef.value;e&&e.type!==`hidden`&&e.setAttribute(`tabindex`,`-1`),this.triggerRef.value?.focus()}restoreInputTab(){this._skipInputTab=!1}parseValue(){return this.parseToValues(this.value)}parseToValues(e){return Array.isArray(e)?this.multiple?e:e.length>0?[e[0]]:[]:e&&this.multiple?e.split(`,`):e?[e]:[]}updateMaxReached(){this._maxIsReached=c.l(this._value.length,this.maxlength)}syncPublicValue(){let e=this.multiple?this._value.join(`,`):this._value[0]||``;e!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this.value=e)}dispatchValueChange(e){let t=this._value;if(e?.join(`,`)!==t.join(`,`)){let e=this.multiple?[...t]:t[0]||``;this.onChange(e)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};e.n([e.u({type:String,reflect:!0})],y.prototype,`value`,void 0),e.n([e.u({type:Array})],y.prototype,`options`,void 0),e.n([e.u({type:Array,attribute:`default-options`})],y.prototype,`defaultOptions`,void 0),e.n([e.u({type:Boolean,attribute:`allow-user-input`})],y.prototype,`allowUserInput`,void 0),e.n([e.u({type:Boolean})],y.prototype,`typeahead`,void 0),e.n([e.u({type:Boolean,attribute:`include-search`})],y.prototype,`includeSearch`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],y.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:Boolean})],y.prototype,`multiple`,void 0),e.n([e.u({type:Number})],y.prototype,`maxlength`,void 0),e.n([e.u({type:String,attribute:`display-value-as`})],y.prototype,`displayValueAs`,void 0),e.n([e.u({type:String,attribute:`tag-placement`})],y.prototype,`tagPlacement`,void 0),e.n([e.u({type:Boolean,attribute:`open`})],y.prototype,`isOpen`,void 0),e.n([e.l()],y.prototype,`_options`,void 0),e.n([e.l()],y.prototype,`_value`,void 0),e.n([e.l()],y.prototype,`_isOptionsOpen`,void 0),e.n([e.l()],y.prototype,`_userInfoMessage`,void 0),e.n([e.l()],y.prototype,`_messageValue`,void 0),e.n([e.l()],y.prototype,`_addValueText`,void 0),e.n([e.l()],y.prototype,`_maxIsReached`,void 0),e.n([e.l()],y.prototype,`_search`,void 0),e.n([e.l()],y.prototype,`_inputFocus`,void 0),e.n([e.l()],y.prototype,`_skipInputTab`,void 0);var b=class extends y{toggleValue(e){if(this.isDisabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=c.i(this.options,e)?.value||null,n=this._value.includes(e||t||``),r=!!t,i=this._options.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!this.multiple,s=this.multiple,l=c.l(this._value.length,this.maxlength),u=!1,d=!0,f=``,p=null,m=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),f=`valueAdded`,u=s):!r&&!this.allowUserInput?(o&&this._value[0]&&this.removeValue(this._value[0]),d=!1,u=!0,f=`noResults`):n?(this.removeValue(t),u=!0,o&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&o?(this.removeAllSelected(),u=!0):o?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),u=!1,f=`valueSelected`,p=this._hasTextInput?h(t||``,this.options,this.displayValueAs):c.s(c.i(this.options,t),this.displayValueAs)):s&&!l?(this.setSelected(t),u=!0):s&&l?(f=`maxSelected`,d=!1,m=e):(o&&this.removeAllSelected(),f=`noValidValue`,d=!1,u=!0,m=e),this._isOptionsOpen=u,u||window.setTimeout(()=>{this.focusAfterCommit()},0),this._search=m||``,this.resetComboboxInput(d),this._userInfoMessage=f,this._messageValue=p,s&&this.updateMaxReached())}setSelected(e){this._value.includes(e)||(this.multiple&&c.l(this._value.length,this.maxlength)?this._userInfoMessage=`maxSelected`:(!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,g.markOptionSelected(this._options,e),this.resetComboboxInput(!0)))}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=c.i(this.options,e);t&&(g.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(t=>t.value!==e)],this.options=[...this.options.filter(t=>t.value!==e)]):this._options.some(t=>t.value===e)?this.refreshOptionsFromValue():this._options=[...this._options,t])}addAllOptions(){this.multiple&&(this.maxlength&&this._options.length>this.maxlength?this._userInfoMessage=`tooManySelected`:(this._value=this._options.map(e=>e.value),g.markAllSelected(this._options),this.requestUpdate()))}removeAllSelected(){this._value=[],g.markAllDeselected(this._options),this._options=g.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;this._search=e,e&&this._value.includes(e)?(this.resetComboboxInput(!0),this._userInfoMessage=`alreadySelected`):this.toggleValue(e)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()===``)return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e];else if(!c.i(this.options,e)){if(c.l(this._value.length,this.maxlength))return;this._value=[...this._value,e]}let t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,window.setTimeout(()=>{this.focusAfterCommit()},0)),this.requestUpdate()}refreshOptionsFromValue(){let e=v.cloneOptions(this.options);e.forEach(e=>e.selected=this._value.includes(e.value)),this._options=v.syncOptionsWithValues(e,this._value).options}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!==`hidden`&&e&&(this._search=``,this.multiple?this.inputRef.value.value=``:(this.inputRef.value.value=this._value[0]?h(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this.refreshOptionsFromValue()}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},x=class extends b{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.isDisabled)return;this.touched=!0;let t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead){if(this._search){let{filtered:n,suggestion:r}=c.o(this.options,this._search);this._options=n,e.inputType!==`deleteContentBackward`&&r?.label&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(t.value=r.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection=`backward`)}else this.refreshOptionsFromValue()}}handleFocus(){this.isDisabled||(this._skipInputTab=!1,this._suppressNextOpen?(this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate()):(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=h(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this.refreshOptionsFromValue(),this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()))}handleCloseOptions(){this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),this.focusTrigger()}handleFocusOut(e){if(this.isDisabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.classList?.contains(`pkt-combobox__value`)||t===this.inputRef.value||t===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage=``,this._search=``,this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this.inputRef.value.value;if(!this.multiple){if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{let t=c.i(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}}else if(e!==``){let{action:t,value:n}=p(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case`addUserValue`:this.addNewUserValue(n);break;case`selectOption`:this.setSelected(n);break;case`removeValue`:this.removeValue(n)}}!this.multiple&&this._value[0]?this.inputRef.value.value=h(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){this.isDisabled?(e.preventDefault(),e.stopImmediatePropagation()):this._hasTextInput?(this.inputRef.value?.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&this.listboxRef.value?.focusFirstOrSelectedOption())}handlePlaceholderClick(e){this.isDisabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){if(!this.isDisabled)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,this.listboxRef.value?.focusFirstOrSelectedOption());break;case`Escape`:this._isOptionsOpen&&=(e.preventDefault(),!1);break;case`Home`:case`End`:e.preventDefault(),this._isOptionsOpen||=!0,this.listboxRef.value?.focusFirstOrSelectedOption();break;case`ArrowLeft`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case`Backspace`:case`Delete`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]))}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){if(e.key===`Backspace`){let t=!this.inputRef.value?.value;!this._search&&t&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key===`ArrowLeft`&&this.multiple&&this._value.length>0){let t=this.inputRef.value;if(t&&t.selectionStart===0&&!t.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}let t=f(e.key,e.shiftKey,this.multiple);if(t&&(e.key!==`Tab`||this._isOptionsOpen)){if(t===`focusListbox`&&e.key===`Tab`&&!this.listboxRef.value?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`))this.closeAndProcessInput();else switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(`.pkt-combobox__input .pkt-combobox__tag-list pkt-tag`))}focusTag(e){let t=this.getInsideTags();t.forEach((t,n)=>{t.buttonTabindex=n===e?0:-1}),(t[e]?.querySelector(`button`))?.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();let n=()=>{this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():this.triggerRef.value?.focus()};switch(e.key){case`ArrowLeft`:e.preventDefault(),t>0&&this.focusTag(t-1);break;case`ArrowRight`:e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case`Backspace`:case`Delete`:e.preventDefault();{let e=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(e),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case`Tab`:this.resetTagTabindices();break;case`Escape`:e.preventDefault(),n()}}checkForMatches(){let e=m(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput?this.resetComboboxInput(!1):(this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage)}},S=class extends x{constructor(...e){super(...e),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){if(super.connectedCallback(),document?.body.addEventListener(`click`,this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){let e=this.options?.filter(e=>e.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=v.cloneOptions(this.options)}if(this.optionsController?.nodes&&this.optionsController.nodes.length){let e=_.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=_.parseOptionsFromSlot(this.optionsController.nodes),n=this._options.filter(e=>e.userAdded);this.options=[...n,...t]}}if(super.willUpdate(e),e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen),e.has(`defaultOptions`)&&this.defaultOptions.length){let e=(Array.isArray(this.options)?this.options:[]).filter(e=>e.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=v.cloneOptions(this.options)}let t=e.has(`value`),n=e.has(`_value`);if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t,this._options.forEach(e=>e.selected=t.includes(e.value)),this._options=[...this._options]),this._pendingDispatchFrom??=e}else n&&(this._pendingDispatchFrom??=e.get(`_value`)??[]);if(e.has(`defaultValue`)&&this.defaultValue!=null&&!this._value.length){let e=this.parseToValues(this.defaultValue);e.length&&(this._pendingDispatchFrom??=[...this._value],this._value=e,this._options.forEach(t=>t.selected=e.includes(t.value)),this._options=[...this._options])}if(e.has(`options`)){let t=e.get(`options`)||this._options||[],n=v.mergeWithUserAdded(v.cloneOptions(this.options),t,this._value);this._options=n,n.length>this.options.length&&(this.options=n);let r=v.syncOptionsWithValues(this._options,this._value);this._options=r.options,r.newValues.length>this._value.length&&(this._pendingDispatchFrom??=[...this._value],this._value=r.newValues)}(t||n||e.has(`options`)||e.has(`defaultValue`))&&this.updateMaxReached(),this._pendingDispatchFrom&&this.syncPublicValue()}updated(e){if(this._pendingDispatchFrom){let e=this._pendingDispatchFrom;this._pendingDispatchFrom=null,this.dispatchValueChange(e)}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=!this.multiple&&this._value[0]?h(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}this.classList.add(`pkt-combobox-component`),this.classList.toggle(`pkt-combobox-component--fullwidth`,!!this.fullwidth),super.updated(e)}formResetCallback(){this.touched=!1;let e=this.defaultValue||(this.multiple,``);this.value=e,this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search=``,this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``),this.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=v.cloneOptions(this.options);let e=v.syncOptionsWithValues(this._options,this._value);this._options=e.options,e.newValues.length>this._value.length&&(this._value=e.newValues),this._search=``}super.attributeChangedCallback(e,t,n)}render(){return e._`
|
|
2
|
-
<pkt-input-wrapper
|
|
3
|
-
${r.n(this,[`helptext`])}
|
|
4
|
-
.strings=${this.strings}
|
|
5
|
-
.size=${this.inputSize}
|
|
6
|
-
.label=${this.label}
|
|
7
|
-
.helptext=${this.helptext}
|
|
8
|
-
.helptextDropdown=${a.t(this.helptextDropdown)}
|
|
9
|
-
.helptextDropdownButton=${a.t(this.helptextDropdownButton)}
|
|
10
|
-
?fullwidth=${this.fullwidth}
|
|
11
|
-
?counter=${this.effectiveCounter(!!this.multiple&&this.maxlength!=null)}
|
|
12
|
-
.counterCurrent=${this._value.length}
|
|
13
|
-
.counterMaxLength=${this.maxlength??0}
|
|
14
|
-
?hasError=${this.hasError}
|
|
15
|
-
?inline=${this.inline}
|
|
16
|
-
?disabled=${this.isDisabled}
|
|
17
|
-
.errorMessage=${this.errorMessage}
|
|
18
|
-
?optionalTag=${this.optionalTag}
|
|
19
|
-
.optionalText=${this.optionalText}
|
|
20
|
-
?requiredTag=${this.requiredTag}
|
|
21
|
-
.requiredText=${this.requiredText}
|
|
22
|
-
.tagText=${this.tagText}
|
|
23
|
-
useWrapper=${this.useWrapper}
|
|
24
|
-
.forId=${this._hasTextInput?this.id+`-input`:this.id+`-combobox`}
|
|
25
|
-
?hasFieldset=${this.effectiveHasFieldset(!this._hasTextInput)}
|
|
26
|
-
class="pkt-combobox__wrapper"
|
|
27
|
-
@labelClick=${this.handleInputClick}
|
|
28
|
-
>
|
|
29
|
-
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
30
|
-
<div
|
|
31
|
-
class=${t.t({"pkt-combobox__input":!0,[`pkt-combobox__input--${this.inputSize}`]:!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.isDisabled})}
|
|
32
|
-
id=${a.t(this._hasTextInput?void 0:`${this.id}-combobox`)}
|
|
33
|
-
role=${a.t(this._hasTextInput?void 0:`combobox`)}
|
|
34
|
-
aria-expanded=${a.t(this._hasTextInput?void 0:this._isOptionsOpen?`true`:`false`)}
|
|
35
|
-
aria-controls=${a.t(this._hasTextInput?void 0:`${this.id}-listbox`)}
|
|
36
|
-
aria-haspopup=${a.t(this._hasTextInput?void 0:`listbox`)}
|
|
37
|
-
aria-describedby=${a.t(this._hasTextInput?void 0:this._describedBy())}
|
|
38
|
-
aria-labelledby=${a.t(this._hasTextInput?void 0:`${this.id}-combobox-label`)}
|
|
39
|
-
aria-activedescendant=${a.t(!this._hasTextInput&&this._isOptionsOpen&&this._value[0]&&c.i(this.options,this._value[0])?`${this.id}-listbox-${c.a(this._options,this._value[0])}`:void 0)}
|
|
40
|
-
aria-description=${a.t(this._selectionDescription||void 0)}
|
|
41
|
-
tabindex=${this._hasTextInput||this.isDisabled?`-1`:`0`}
|
|
42
|
-
@click=${this.handleInputClick}
|
|
43
|
-
@keydown=${this._hasTextInput?e.h:this.handleSelectOnlyKeydown}
|
|
44
|
-
@blur=${this.restoreInputTab}
|
|
45
|
-
${o.n(this.triggerRef)}
|
|
46
|
-
>
|
|
47
|
-
${!this._hasTextInput&&this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement==`outside`)&&!this._inputFocus?e._`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
|
|
48
|
-
>${this.placeholder}</span
|
|
49
|
-
>`:this.tagPlacement===`outside`?e.h:this.renderSingleOrMultipleValues()}
|
|
50
|
-
${this.renderInputField()}
|
|
51
|
-
<pkt-icon
|
|
52
|
-
class=${t.t({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
|
|
53
|
-
name="chevron-thin-down"
|
|
54
|
-
aria-hidden="true"
|
|
55
|
-
></pkt-icon>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<pkt-listbox
|
|
59
|
-
id="${this.id}-listbox"
|
|
60
|
-
.options=${this._options}
|
|
61
|
-
.isOpen=${this._isOptionsOpen}
|
|
62
|
-
.searchPlaceholder=${this.searchPlaceholder}
|
|
63
|
-
.label="Liste: ${this.label||``}"
|
|
64
|
-
?disabled=${this.isDisabled}
|
|
65
|
-
?include-search=${this.includeSearch}
|
|
66
|
-
?is-multi-select=${this.multiple}
|
|
67
|
-
?allow-user-input=${this.allowUserInput&&!this._maxIsReached}
|
|
68
|
-
?max-is-reached=${this._maxIsReached}
|
|
69
|
-
.customUserInput=${a.t(this._addValueText)}
|
|
70
|
-
.userMessage=${this._userInfoMessage?n.t(this.pktStrings.get(`combobox`)[this._userInfoMessage],{value:this._messageValue??``}):``}
|
|
71
|
-
@search=${this.handleSearch}
|
|
72
|
-
@option-toggle=${this.handleOptionToggled}
|
|
73
|
-
@select-all=${this.addAllOptions}
|
|
74
|
-
@close-options=${this.handleCloseOptions}
|
|
75
|
-
@tab-close=${()=>this.closeAndProcessInput()}
|
|
76
|
-
.searchValue=${this._search||null}
|
|
77
|
-
.maxLength=${this.maxlength||0}
|
|
78
|
-
${o.n(this.listboxRef)}
|
|
79
|
-
></pkt-listbox>
|
|
80
|
-
</div>
|
|
81
|
-
|
|
82
|
-
${this.tagPlacement===`outside`&&this.multiple?e._`<div class="pkt-combobox__tags-outside">
|
|
83
|
-
${this.renderSingleOrMultipleValues()}
|
|
84
|
-
</div>`:e.h}
|
|
85
|
-
</pkt-input-wrapper>
|
|
86
|
-
`}_describedBy(){return i.r({id:this._hasTextInput?`${this.id}-input`:`${this.id}-combobox`,hasHelptext:!!this.helptext||this.hasSlotContent(`helptext`),ariaDescribedby:this.ariaDescribedby})}renderInputField(){return this.typeahead||this.allowUserInput?e._`
|
|
87
|
-
<div class="pkt-combobox__input-div combobox__input">
|
|
88
|
-
<input
|
|
89
|
-
type="text"
|
|
90
|
-
id="${this.id}-input"
|
|
91
|
-
name=${(this.name||this.id)+`-input`}
|
|
92
|
-
placeholder=${a.t(!this._value.length||this.multiple&&this.tagPlacement===`outside`?this.placeholder:void 0)}
|
|
93
|
-
@input=${this.handleInput}
|
|
94
|
-
@change=${e=>{e.stopPropagation(),e.stopImmediatePropagation()}}
|
|
95
|
-
tabindex=${a.t(this._skipInputTab?`-1`:void 0)}
|
|
96
|
-
@keydown=${this.handleInputKeydown}
|
|
97
|
-
@focus=${this.handleFocus}
|
|
98
|
-
@blur=${this.handleBlur}
|
|
99
|
-
autocomplete="off"
|
|
100
|
-
role="combobox"
|
|
101
|
-
aria-expanded=${this._isOptionsOpen?`true`:`false`}
|
|
102
|
-
aria-label=${a.t(this.label)}
|
|
103
|
-
aria-describedby=${a.t(this._describedBy())}
|
|
104
|
-
aria-autocomplete=${this.typeahead?`both`:this.allowUserInput?`list`:`none`}
|
|
105
|
-
aria-controls="${this.id}-listbox"
|
|
106
|
-
aria-activedescendant=${a.t(this._isOptionsOpen&&this._value[0]&&c.i(this.options,this._value[0])?`${this.id}-listbox-${c.a(this._options,this._value[0])}`:void 0)}
|
|
107
|
-
aria-description=${a.t(this._selectionDescription||void 0)}
|
|
108
|
-
${o.n(this.inputRef)}
|
|
109
|
-
/>
|
|
110
|
-
</div>
|
|
111
|
-
`:e._`
|
|
112
|
-
<input
|
|
113
|
-
type="hidden"
|
|
114
|
-
id="${this.id}-input"
|
|
115
|
-
name=${(this.name||this.id)+`-input`}
|
|
116
|
-
.value=${this._value.join(`,`)}
|
|
117
|
-
${o.n(this.inputRef)}
|
|
118
|
-
/>
|
|
119
|
-
`}renderSingleOrMultipleValues(){if(!this.multiple&&this._hasTextInput)return e.h;let t=!this.multiple,n=this.renderValueTag(c.i(this.options,this._value[0])),r=this.tagPlacement===`outside`,i=e._`
|
|
120
|
-
<ul role="list" class="pkt-combobox__tag-list">
|
|
121
|
-
${s.t(this._value,e=>e,(t,n)=>{let i=c.i(this.options,t),a=i?.tagSkinColor;return e._`
|
|
122
|
-
<li
|
|
123
|
-
role="listitem"
|
|
124
|
-
@click=${r?e.h:e=>e.stopPropagation()}
|
|
125
|
-
@mousedown=${r?e.h:e=>e.preventDefault()}
|
|
126
|
-
>
|
|
127
|
-
<pkt-tag
|
|
128
|
-
skin=${a||`blue`}
|
|
129
|
-
?closeTag=${!this.isDisabled}
|
|
130
|
-
.buttonTabindex=${r?void 0:-1}
|
|
131
|
-
@close=${()=>this.handleTagRemove(t)}
|
|
132
|
-
@keydown=${r?e.h:e=>this.handleTagKeydown(e,n)}
|
|
133
|
-
>
|
|
134
|
-
${this.renderValueTag(i)}
|
|
135
|
-
</pkt-tag>
|
|
136
|
-
</li>
|
|
137
|
-
`})}
|
|
138
|
-
</ul>
|
|
139
|
-
`;return!t&&this._value.length===0?e.h:t?n:i}renderValueTag(t){if(!t)return``;switch(this.displayValueAs){case`prefixAndValue`:return e._`<span class="pkt-combobox__value">${t.prefix||``} ${t.value}</span>`;case`value`:return e._`<span class="pkt-combobox__value">${t.value}</span>`;default:return e._`<span class="pkt-combobox__value">${t.label||t.value}</span>`}}};try{e.d(`pkt-combobox`)(S)}catch{console.warn(`Forsøker å definere <pkt-combobox>, men den er allerede definert`)}var C=S;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return C}});
|