@oslokommune/punkt-elements 16.25.2 → 16.26.4
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 +45 -0
- package/dist/{accordion-BjYsEbSM.js → accordion-CBdIk9gw.js} +5 -5
- package/dist/{accordion-DaeWPWod.cjs → accordion-FISAiAbX.cjs} +2 -2
- package/dist/{alert-C8OpU_Un.cjs → alert-B8dLsiTz.cjs} +2 -2
- package/dist/{alert-B5Y841vH.js → alert-HHTGY0sp.js} +6 -6
- package/dist/{async-directive-Cz6tcqge.js → async-directive-Cw_7VW_-.js} +3 -3
- package/dist/{async-directive-DO1QtVmf.cjs → async-directive-HLXOyE4A.cjs} +1 -1
- package/dist/{backlink-C42-3OG3.cjs → backlink-DDGlLzk9.cjs} +2 -2
- package/dist/{backlink-BXAdgAte.js → backlink-wMNLuQ0X.js} +3 -3
- package/dist/base-elements/input-element.d.ts +1 -0
- package/dist/{booleanish-jJLlnr6-.cjs → booleanish-B9Kf0nES.cjs} +1 -1
- package/dist/{breadcrumbs-Dkb9TxMp.js → breadcrumbs-CVTLNNsL.js} +2 -2
- package/dist/{breadcrumbs-CkjeLh3U.cjs → breadcrumbs-D3tfWqvC.cjs} +2 -2
- package/dist/{button-Bqk9wjme.cjs → button-B5tQpKeG.cjs} +2 -2
- package/dist/{button-CAZEaEW9.js → button-C_YzTSuU.js} +5 -5
- package/dist/{calendar-CRIp36hn.js → calendar-CjlUA-Lb.js} +4 -4
- package/dist/{calendar-64LmbIdR.cjs → calendar-DIzGBdbh.cjs} +2 -2
- package/dist/{card-C__IlsUa.cjs → card-BSZs5lRF.cjs} +2 -2
- package/dist/{card-5PydU247.js → card-D3jVkwxJ.js} +7 -7
- package/dist/{checkbox-CC1X7fw4.js → checkbox-D3uflJEb.js} +16 -12
- package/dist/{checkbox-DzMc0AJX.cjs → checkbox-DfIvuwAj.cjs} +10 -9
- package/dist/{class-map-DH9hlJny.js → class-map-CAQCRB1W.js} +2 -2
- package/dist/{class-map-B8Ja0q7n.cjs → class-map-CCZN5uS3.cjs} +1 -1
- package/dist/{classutils-CVTzKF0J.cjs → classutils-CbklAJDe.cjs} +1 -1
- package/dist/{combobox-BuBvoK-N.js → combobox-B9YSsRZB.js} +27 -17
- package/dist/{combobox-DJITmrnM.cjs → combobox-BhIqExJZ.cjs} +2 -2
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordionitem.d.ts +1 -1
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/backlink/backlink.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/card/card.d.ts +9 -9
- package/dist/components/checkbox/checkbox.d.ts +2 -1
- package/dist/components/combobox/combobox.d.ts +1 -1
- package/dist/components/consent/consent.d.ts +1 -1
- package/dist/components/datepicker/date-tags.d.ts +1 -1
- package/dist/components/datepicker/datepicker-multiple.d.ts +1 -1
- package/dist/components/datepicker/datepicker-popup.d.ts +1 -1
- package/dist/components/datepicker/datepicker-range.d.ts +1 -1
- package/dist/components/datepicker/datepicker-single.d.ts +1 -1
- package/dist/components/datepicker/datepicker.d.ts +5 -5
- package/dist/components/fileupload/fileupload-renderers.d.ts +2 -2
- package/dist/components/fileupload/fileupload.d.ts +1 -1
- package/dist/components/header/header-user-menu.d.ts +1 -1
- package/dist/components/header/header.d.ts +1 -1
- package/dist/components/helptext/helptext.d.ts +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/input-wrapper/input-wrapper.d.ts +1 -1
- package/dist/components/link/link.d.ts +1 -1
- package/dist/components/linkcard/linkcard.d.ts +1 -1
- package/dist/components/listbox/listbox.d.ts +1 -1
- package/dist/components/loader/loader.d.ts +1 -1
- package/dist/components/messagebox/messagebox.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/progressbar/progressbar.d.ts +1 -1
- package/dist/components/radiobutton/radiobutton.d.ts +2 -1
- package/dist/components/searchinput/searchinput.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/tabs/tabitem.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textinput/textinput.d.ts +1 -1
- package/dist/components/timepicker/timepicker.d.ts +1 -1
- package/dist/{consent-CCesjQ_e.js → consent-D5sY6JK3.js} +3 -3
- package/dist/{consent-DkCihETp.cjs → consent-X3wvhteO.cjs} +2 -2
- package/dist/converters-9jHlXDyy.cjs +1 -0
- package/dist/{converters-BQnj7OJE.js → converters-BKGBRBpS.js} +191 -176
- package/dist/{datepicker-zOOhs9JK.js → datepicker-B_J5APcK.js} +14 -14
- package/dist/{datepicker-ChEi_INm.cjs → datepicker-DXxTiHJd.cjs} +3 -3
- package/dist/{dialog-polyfill.esm-CYs2AHP1.cjs → dialog-polyfill.esm-J-GKtwrS.cjs} +1 -1
- package/dist/{directive-helpers-f36YZFOG.cjs → directive-helpers-BshFvt7A.cjs} +1 -1
- package/dist/{directive-helpers-Cep_4cpj.js → directive-helpers-DIF5DwN4.js} +2 -2
- package/dist/directives/slot-content.d.ts +1 -1
- package/dist/docs/backlink.d.ts +1 -1
- package/dist/docs/components/accordion.d.ts +1 -1
- package/dist/docs/components/alert.d.ts +1 -1
- package/dist/docs/components/backlink.d.ts +1 -1
- package/dist/docs/components/breadcrumbs.d.ts +1 -1
- package/dist/docs/components/button.d.ts +1 -1
- package/dist/docs/components/calendar.d.ts +1 -1
- package/dist/docs/components/card.d.ts +1 -1
- package/dist/docs/components/checkbox.d.ts +1 -1
- package/dist/docs/components/combobox.d.ts +1 -1
- package/dist/docs/components/comboboxdemo.d.ts +1 -1
- package/dist/docs/components/consent.d.ts +1 -1
- package/dist/docs/components/datepicker.d.ts +1 -1
- package/dist/docs/components/datepickermultiple.d.ts +1 -1
- package/dist/docs/components/event-log.d.ts +20 -0
- package/dist/docs/components/fileupload.d.ts +1 -1
- package/dist/docs/components/form.d.ts +1 -1
- package/dist/docs/components/header-full.d.ts +1 -1
- package/dist/docs/components/header-menu.d.ts +1 -1
- package/dist/docs/components/header.d.ts +1 -1
- package/dist/docs/components/heading.d.ts +1 -1
- package/dist/docs/components/icon.d.ts +1 -1
- package/dist/docs/components/input-wrapper.d.ts +1 -1
- package/dist/docs/components/link.d.ts +1 -1
- package/dist/docs/components/linkcard.d.ts +1 -1
- package/dist/docs/components/loader.d.ts +1 -1
- package/dist/docs/components/messagebox.d.ts +1 -1
- package/dist/docs/components/modal.d.ts +1 -1
- package/dist/docs/components/progressbar.d.ts +1 -1
- package/dist/docs/components/radiobutton.d.ts +1 -1
- package/dist/docs/components/searchinput.d.ts +1 -1
- package/dist/docs/components/select.d.ts +1 -1
- package/dist/docs/components/slots.d.ts +1 -1
- package/dist/docs/components/tabs.d.ts +1 -1
- package/dist/docs/components/tag.d.ts +1 -1
- package/dist/docs/components/textarea.d.ts +1 -1
- package/dist/docs/components/textinput.d.ts +2 -1
- package/dist/docs/components/timepicker.d.ts +1 -1
- package/dist/docs/header.d.ts +1 -1
- package/dist/docs/punkt-docs.d.ts +1 -1
- package/dist/{element-CduG0XyF.js → element-BoJrqauR.js} +6 -6
- package/dist/{element-CXAtr6Gu.cjs → element-DJzurxgt.cjs} +1 -1
- package/dist/{element-with-slot-Cmxb9h4H.cjs → element-with-slot-BY7Jc-q8.cjs} +1 -1
- package/dist/{element-with-slot-BVj9MXzi.js → element-with-slot-mXLg8gg8.js} +2 -2
- package/dist/{fileupload-CGaJlMG9.cjs → fileupload-BMHJaAKR.cjs} +2 -2
- package/dist/{fileupload-BBph8gH3.js → fileupload-DpvQ3e_T.js} +10 -10
- package/dist/{focus-modality-controller-wI5SR8wH.cjs → focus-modality-controller-C1ocyv2J.cjs} +1 -1
- package/dist/{header-C8dCoJpr.js → header-CFzvRT3j.js} +10 -10
- package/dist/{header-C6z1KhOR.cjs → header-DaFGbtLu.cjs} +2 -2
- package/dist/{header-menu-BU-ylGrJ.js → header-menu-C8b5vd3n.js} +5 -5
- package/dist/{header-menu-CnW7nzmF.cjs → header-menu-DMdP_c6X.cjs} +2 -2
- package/dist/{heading-3o4Dk0Wn.js → heading-CD0PhL8g.js} +2 -2
- package/dist/{heading-C40-NX0r.cjs → heading-DyJpBFT2.cjs} +1 -1
- package/dist/{helptext-C2aQBBo_.js → helptext-OfqH5npD.js} +6 -6
- package/dist/{helptext-DNLg43eI.cjs → helptext-eckq4JEX.cjs} +2 -2
- package/dist/{icon-Dw6I0HDV.cjs → icon-B8PVq2O6.cjs} +1 -1
- package/dist/{icon-LaKyBKON.js → icon-DGFEIlco.js} +2 -2
- package/dist/if-defined-D0bnetLJ.js +5 -0
- package/dist/if-defined-DrwbxQOj.cjs +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/input-element-DZLXF2rI.cjs +1 -0
- package/dist/input-element-DgylI1GK.js +654 -0
- package/dist/{input-wrapper-CvtU-Ksb.cjs → input-wrapper-BRjQB4zM.cjs} +21 -21
- package/dist/{input-wrapper-C93MmOIg.js → input-wrapper-DaA98B5l.js} +32 -32
- package/dist/{input-wrapper-CYCCx8MP.cjs → input-wrapper-LcZjpt0L.cjs} +1 -1
- package/dist/{link-DauiNRMq.js → link-FmkQvSQL.js} +4 -4
- package/dist/{link-EZ0-lS3W.cjs → link-Geze7498.cjs} +2 -2
- package/dist/{linkcard-BIcCW-qw.cjs → linkcard-6LCXRTR-.cjs} +2 -2
- package/dist/{linkcard-DNJm5FvA.js → linkcard-BKdT0zU_.js} +4 -4
- package/dist/{listbox-DbEobJNx.cjs → listbox-89wMuQVK.cjs} +2 -2
- package/dist/{listbox-DXMIBv3y.js → listbox-LdyWPu7W.js} +5 -5
- package/dist/{loader-B3ToraVk.js → loader-BA-i8CaQ.js} +4 -4
- package/dist/{loader-CLf_Phfg.cjs → loader-CgW4Vst3.cjs} +2 -2
- package/dist/{messagebox-BqBxXK8c.cjs → messagebox-VD5oEZ19.cjs} +2 -2
- package/dist/{messagebox-XRFecqyS.js → messagebox-fiaAyHLG.js} +5 -5
- package/dist/{modal-CWgeT-RP.js → modal-C6pScpdG.js} +6 -6
- package/dist/{modal-CrYHKOmr.cjs → modal-DKU7PnjJ.cjs} +2 -2
- 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.cjs +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.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 +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.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.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +32 -32
- 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-BTNtjEIS.js → pkt-options-controller-Cis62vGe.js} +1 -1
- package/dist/{pkt-options-controller-CBM8xHwR.cjs → pkt-options-controller-DHKHMyXM.cjs} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.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-BN5y20CC.cjs +17 -0
- package/dist/{progressbar-B0P_vmGD.js → progressbar-mtjtbpCO.js} +7 -7
- package/dist/radiobutton-BH6rl98w.cjs +31 -0
- package/dist/{radiobutton-C6zERHoy.js → radiobutton-DFCA9V07.js} +12 -9
- package/dist/ref-DO7TzO4O.cjs +1 -0
- package/dist/{ref-BgoHEsEt.js → ref-WGS0u7i2.js} +5 -5
- package/dist/{repeat-CKIii8Mi.js → repeat-BH0cL82q.js} +3 -3
- package/dist/{repeat-CRRgmzVn.cjs → repeat-DRnLAg0O.cjs} +1 -1
- package/dist/{searchinput-fPvXHu2O.js → searchinput-CyO5k4Q4.js} +7 -6
- package/dist/{searchinput-BrxfRzez.cjs → searchinput-DG6YetL1.cjs} +2 -2
- package/dist/{select-z3hBSk02.cjs → select-BVPcJEIz.cjs} +2 -2
- package/dist/{select-Dz3YiN7b.js → select-C1--vTZ2.js} +7 -7
- package/dist/{tabs-DxQy8U-0.cjs → tabs-CGo0ODPa.cjs} +2 -2
- package/dist/{tabs-BJx6wwXD.js → tabs-ChdR0D1C.js} +9 -9
- package/dist/{tag-CBFz0R9N.cjs → tag-C4fEuT-r.cjs} +2 -2
- package/dist/{tag-CzlnHhho.js → tag-DBNga0hg.js} +5 -5
- package/dist/{textarea-rHlURXh5.cjs → textarea-Cb0pj6ki.cjs} +2 -2
- package/dist/{textarea-BxBfLk3N.js → textarea-DNitIoWX.js} +11 -11
- package/dist/{textinput-DSYABvB6.cjs → textinput-CaIDCB2J.cjs} +2 -2
- package/dist/{textinput-Bs8DwHwR.js → textinput-CurFrsfQ.js} +9 -9
- package/dist/{timepicker-DVisPbGX.cjs → timepicker-BcHEEtpX.cjs} +2 -2
- package/dist/{timepicker-Cb9pxkJa.js → timepicker-Ch-ums4R.js} +8 -8
- package/dist/{utils-CjAbIttF.cjs → utils-63cRpWut.cjs} +1 -1
- package/package.json +28 -27
- package/src/components/checkbox/checkbox.ts +6 -0
- package/src/components/datepicker/datepicker.selection.test.ts +33 -0
- package/src/components/datepicker/datepicker.ts +0 -4
- package/src/components/radiobutton/radiobutton.ts +6 -1
- package/src/components/textarea/textarea.ts +1 -1
- package/src/components/textinput/textinput.ts +1 -1
- package/dist/converters-CkqZ02TI.cjs +0 -1
- package/dist/if-defined-LTjAScFG.cjs +0 -1
- package/dist/if-defined-VShASPdu.js +0 -5
- package/dist/input-element-BHQVt4Q9.cjs +0 -1
- package/dist/input-element-BrmkXIXi.js +0 -643
- package/dist/progressbar-DADdvDl5.cjs +0 -17
- package/dist/radiobutton-BfURufrZ.cjs +0 -31
- package/dist/ref-CBdWMlde.cjs +0 -1
- /package/dist/{booleanish-BmcOU-43.js → booleanish-MfutDT_4.js} +0 -0
- /package/dist/{classutils-lVbGcvjN.js → classutils-DcYnSgfc.js} +0 -0
- /package/dist/{dialog-polyfill.esm-0dVT8G1o.js → dialog-polyfill.esm-ChZRzCVh.js} +0 -0
- /package/dist/{focus-modality-controller-CaUqYdk0.js → focus-modality-controller-Dc2S-KqR.js} +0 -0
- /package/dist/{input-wrapper-kw2y6Jp_.js → input-wrapper-DwwE0JcO.js} +0 -0
- /package/dist/{utils-CUqCKGvp.js → utils-BwF4QSrq.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as e, d as t, n, o as r, p as i, s as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { n as s } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as c } from "./if-defined-
|
|
6
|
-
import { n as l, t as u } from "./ref-
|
|
7
|
-
import "./tag-
|
|
8
|
-
import { t as d } from "./repeat-
|
|
9
|
-
import { a as f, c as p, i as m, o as h, r as g, s as _ } from "./listbox-
|
|
10
|
-
import { t as v } from "./input-element-
|
|
11
|
-
import { t as y } from "./pkt-options-controller-
|
|
12
|
-
import "./input-wrapper-
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, s as a } from "./element-BoJrqauR.js";
|
|
2
|
+
import { t as o } from "./class-map-CAQCRB1W.js";
|
|
3
|
+
import { n as s } from "./element-with-slot-mXLg8gg8.js";
|
|
4
|
+
import "./icon-DGFEIlco.js";
|
|
5
|
+
import { t as c } from "./if-defined-D0bnetLJ.js";
|
|
6
|
+
import { n as l, t as u } from "./ref-WGS0u7i2.js";
|
|
7
|
+
import "./tag-DBNga0hg.js";
|
|
8
|
+
import { t as d } from "./repeat-BH0cL82q.js";
|
|
9
|
+
import { a as f, c as p, i as m, o as h, r as g, s as _ } from "./listbox-LdyWPu7W.js";
|
|
10
|
+
import { t as v } from "./input-element-DgylI1GK.js";
|
|
11
|
+
import { t as y } from "./pkt-options-controller-Cis62vGe.js";
|
|
12
|
+
import "./input-wrapper-DaA98B5l.js";
|
|
13
13
|
//#region ../../shared-utils/combobox/input-utils.ts
|
|
14
14
|
var b = (e, t, n) => {
|
|
15
15
|
switch (e) {
|
|
@@ -739,7 +739,11 @@ var k = class extends O {
|
|
|
739
739
|
};
|
|
740
740
|
}
|
|
741
741
|
connectedCallback() {
|
|
742
|
-
if (super.connectedCallback(), document?.body.addEventListener("click", this.handleBodyClick), this._options = [], this.defaultOptions && this.defaultOptions.length
|
|
742
|
+
if (super.connectedCallback(), document?.body.addEventListener("click", this.handleBodyClick), this._options = [], this.defaultOptions && this.defaultOptions.length) {
|
|
743
|
+
let e = this.options?.filter((e) => e.userAdded) || [];
|
|
744
|
+
this.options = [...e, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = Array.isArray(this.options) ? [...this.options] : [];
|
|
745
|
+
}
|
|
746
|
+
if (this.optionsController?.nodes && this.optionsController.nodes.length) {
|
|
743
747
|
let e = T.parseOptionsFromSlot(this.optionsController.nodes);
|
|
744
748
|
e.length && (this.options = [...e], this._options = [...e], this._optionsFromSlot = !0, this._lastSlotGeneration = this.optionsController.generation);
|
|
745
749
|
}
|
|
@@ -749,8 +753,8 @@ var k = class extends O {
|
|
|
749
753
|
let e = this.optionsController.generation;
|
|
750
754
|
if (e !== this._lastSlotGeneration) {
|
|
751
755
|
this._lastSlotGeneration = e;
|
|
752
|
-
let t = T.parseOptionsFromSlot(this.optionsController.nodes);
|
|
753
|
-
this.options = [...
|
|
756
|
+
let t = T.parseOptionsFromSlot(this.optionsController.nodes), n = this._options.filter((e) => e.userAdded);
|
|
757
|
+
this.options = [...n, ...t];
|
|
754
758
|
}
|
|
755
759
|
}
|
|
756
760
|
super.willUpdate(e);
|
|
@@ -769,7 +773,11 @@ var k = class extends O {
|
|
|
769
773
|
let e = [...this._value], t = this.parseValue();
|
|
770
774
|
t.join(",") !== this._value.join(",") && (this._value = t), this.updateMaxReached(), this.syncValueAndDispatch(e);
|
|
771
775
|
} else n && this.syncValueAndDispatch(e.get("_value"));
|
|
772
|
-
if (e.has("defaultOptions") && this.defaultOptions.length
|
|
776
|
+
if (e.has("defaultOptions") && this.defaultOptions.length) {
|
|
777
|
+
let e = (Array.isArray(this.options) ? this.options : []).filter((e) => e.userAdded) || [];
|
|
778
|
+
this.options = [...e, ...JSON.parse(JSON.stringify(this.defaultOptions))], this._options = Array.isArray(this.options) ? [...this.options] : [];
|
|
779
|
+
}
|
|
780
|
+
if (e.has("options")) {
|
|
773
781
|
let t = e.get("options") || this._options || [], n = E.mergeWithUserAdded(this.options, t);
|
|
774
782
|
this._options = n, n.length > this.options.length && (this.options = n);
|
|
775
783
|
let r = E.syncOptionsWithValues(this._options, this._value);
|
|
@@ -788,7 +796,9 @@ var k = class extends O {
|
|
|
788
796
|
super.updated(e);
|
|
789
797
|
}
|
|
790
798
|
formResetCallback() {
|
|
791
|
-
this.touched = !1
|
|
799
|
+
this.touched = !1;
|
|
800
|
+
let e = this.defaultValue || (this.multiple, "");
|
|
801
|
+
this.value = e, this._value = this.parseValue(), this._options = this._options.filter((e) => !e.userAdded).map((e) => ({
|
|
792
802
|
...e,
|
|
793
803
|
selected: this._value.includes(e.value)
|
|
794
804
|
})), this.options = this.options.filter((e) => !e.userAdded).map((e) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./element-with-slot-Cmxb9h4H.cjs`);require(`./icon-Dw6I0HDV.cjs`);const r=require(`./if-defined-LTjAScFG.cjs`),i=require(`./ref-CBdWMlde.cjs`);require(`./tag-CBFz0R9N.cjs`);const a=require(`./repeat-CRRgmzVn.cjs`),o=require(`./listbox-DbEobJNx.cjs`),s=require(`./input-element-BHQVt4Q9.cjs`),c=require(`./pkt-options-controller-CBM8xHwR.cjs`);require(`./input-wrapper-CvtU-Ksb.cjs`);var l=(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}},u=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=o.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}},d=(e,t,n,r,i)=>e.trim().toLowerCase()?{...o.s(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},f=(e,t,n)=>{let r=o.i(t,e);return n===`label`&&r?.label?r.label:e},p={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)}},m={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=o.r(n),t.push(n)}),t}},h={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=o.r(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t){return[...t.filter(e=>e?.userAdded&&e.selected).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},g={name:`pkt-combobox`,react:`PktCombobox`,"css-class":`pkt-combobox`,isElement:!0,isPureReact:!0,props:{name:{type:`string`,name:`Navn`,description:`Navn som brukes i skjema ved innsending`,category:`tech`},id:{type:`string`,name:`ID`,description:`Unik ID for feltet`,category:`tech`},label:{type:`string`,name:`Etikett/label`,description:`Tekst som vises over feltet`,category:`contents`},placeholder:{name:`Hint`,description:`Spesifiserer en kort hint som beskriver forventet verdi av feltet.`,type:`string`,category:`contents`,required:!1},multiple:{type:`boolean`,name:`Flervalg`,default:!1,description:`Mulighet for å velge flere valg`,category:`functionality`},tagPlacement:{attribute:`tag-placement`,type:[`inside`,`outside`],name:`Plassering av tags i flervalg`,description:`Plassering av valgte verdier i feltet ved flervalg`,category:`functionality`,showIf:{multiple:!0}},maxlength:{type:`number`,name:`Maks antall i flervalg`,description:`Maks antall valg dersom flervalg er aktivert`,category:`functionality`,showIf:{multiple:!0}},typeahead:{type:`boolean`,name:`Typeahead`,default:!1,description:`Mulighet for automatisk utfylling av feltet fra listen over valg`,category:`functionality`},includeSearch:{attribute:`include-search`,type:`boolean`,name:`Inkluder søk`,description:`Mulighet for å søke etter valg inni dropdown`,category:`functionality`},allowUserInput:{attribute:`allow-user-input`,type:`boolean`,name:`Brukervalgte verdier`,description:`Mulighet for å skrive inn egne verdier`,category:`functionality`},searchPlaceholder:{attribute:`search-placeholder`,type:`string`,name:`Søke-plassholder`,description:`Plassholdertekst for søkefeltet i dropdown`,category:`contents`,showIf:{includeSearch:!0}},displayValueAs:{attribute:`display-value-as`,type:[`label`,`value`,`prefixAndValue`],name:`Visning av valgt verdi`,description:`Hvordan valgt verdi vises i feltet`,default:`label`,category:`ui`},value:{name:`Verdi`,type:`string`,description:`Valgt verdi. Streng ved enkelt valg, array av strenger ved flervalg.`,category:`tech`},helptext:{type:`string`,name:`Hjelpetekst`,description:`Hjelpetekst som vises over feltet`,category:`contents`},helptextDropdown:{type:`string`,name:`Utvidet hjelpetekst`,description:`Hjelpetekst som vises i en lukket boks man kan åpne`,category:`contents`},helptextDropdownButton:{type:`string`,name:`Knappetekst for hjelpetekst`,description:`Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst`,category:`contents`,default:`Les mer`},disabled:{type:`boolean`,name:`Deaktivert`,description:`Feltet er deaktivert`,category:`tech`},hasError:{type:`boolean`,name:`Feil`,description:`Feltet har en feil`,category:`ui`},errorMessage:{type:`string`,name:`Feilmelding`,description:`Tekst som vises under feltet ved feil`,category:`contents`},required:{type:`boolean`,name:`Påkrevd`,description:`Feltet må fylles ut`,category:`tech`},requiredTag:{type:`boolean`,name:`Påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,category:`ui`},requiredText:{type:`string`,name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,category:`contents`},optionalTag:{type:`boolean`,name:`Valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,category:`ui`},optionalText:{type:`string`,name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},fullwidth:{type:`boolean`,name:`Full bredde`,description:`Skal feltet ta opp hele bredden?`,category:`ui`},defaultOptions:{attribute:`default-options`,name:`Initielle valg (default options)`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter (denne vil ikke modifiseres ved endring innad i komponenten)`,type:`array`,default:[],previewDefault:[{value:`bfr`,label:`Frogner`},{value:`bgo`,label:`Gamle Oslo`},{value:`bgr`,label:`Grorud`},{value:`bxx`,label:`Andre bydeler`}],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`},options:{name:`Valg`,type:`array`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter`,default:[],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`}},events:{change:{type:`Event`,description:`Returnerer valgt verdi som streng. Ved flervalg returneres kommaseparerte verdier.`},"value-change":{type:`CustomEvent`,description:`Returnerer valgt verdi. Ved enkeltvalg en streng, ved flervalg en <code>string[]</code>.`},search:{type:`CustomEvent`,description:`Returnerer søketeksten som streng i <code>event.detail</code> når brukeren skriver i søkefeltet`},toggleHelpText:{type:`CustomEvent`,description:`Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes`}}},_=class extends s.t{constructor(){super(),this.value=``,this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder=``,this.multiple=!1,this.maxlength=null,this.displayValueAs=g.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=i.t(),this.triggerRef=i.t(),this.listboxRef=i.t(),this.optionsController=new c.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()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(`,`):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=o.c(this._value.length,this.maxlength)}syncValueAndDispatch(e){let t=this._value,n=this.multiple?t.join(`,`):t[0]||``;if(n!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this._internalValueSync=!0,this.value=n),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.o({type:String,reflect:!0})],_.prototype,`value`,void 0),e.n([e.o({type:Array})],_.prototype,`options`,void 0),e.n([e.o({type:Array,attribute:`default-options`})],_.prototype,`defaultOptions`,void 0),e.n([e.o({type:Boolean,attribute:`allow-user-input`})],_.prototype,`allowUserInput`,void 0),e.n([e.o({type:Boolean})],_.prototype,`typeahead`,void 0),e.n([e.o({type:Boolean,attribute:`include-search`})],_.prototype,`includeSearch`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],_.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:Boolean})],_.prototype,`multiple`,void 0),e.n([e.o({type:Number})],_.prototype,`maxlength`,void 0),e.n([e.o({type:String,attribute:`display-value-as`})],_.prototype,`displayValueAs`,void 0),e.n([e.o({type:String,attribute:`tag-placement`})],_.prototype,`tagPlacement`,void 0),e.n([e.o({type:Boolean,attribute:`open`})],_.prototype,`isOpen`,void 0),e.n([e.a()],_.prototype,`_options`,void 0),e.n([e.a()],_.prototype,`_value`,void 0),e.n([e.a()],_.prototype,`_isOptionsOpen`,void 0),e.n([e.a()],_.prototype,`_userInfoMessage`,void 0),e.n([e.a()],_.prototype,`_addValueText`,void 0),e.n([e.a()],_.prototype,`_maxIsReached`,void 0),e.n([e.a()],_.prototype,`_search`,void 0),e.n([e.a()],_.prototype,`_inputFocus`,void 0);var v=class extends _{toggleValue(e){if(this.disabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=o.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(),s=!this.multiple,c=this.multiple,l=o.c(this._value.length,this.maxlength),u=!1,d=!0,f=``,p=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),f=`Ny verdi lagt til`,u=c):!r&&!this.allowUserInput?(s&&this._value[0]&&this.removeValue(this._value[0]),d=!1,u=!0,f=`Ingen treff i søket`):n?(this.removeValue(t),u=!0,s&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&s?(this.removeAllSelected(),u=!0):s?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),u=!1):c&&!l?(this.setSelected(t),u=!0):c&&l?(f=`Maks antall valg nådd`,d=!1,p=e):(s&&this.removeAllSelected(),f=`Ingen gyldig verdi valgt`,d=!1,u=!0,p=e),this._isOptionsOpen=u,u||(s&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=f,this._search=p||``,this.resetComboboxInput(d),c&&this.updateMaxReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&o.c(this._value.length,this.maxlength)){this._userInfoMessage=`Maks antall valg nådd`;return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,p.markOptionSelected(this._options,e),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=o.i(this.options,e);t&&(p.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._options=[...this._options,t]))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage=`For mange valgt`;return}this._value=this._options.map(e=>e.value),p.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],p.markAllDeselected(this._options),this._options=p.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;if(this._search=e,e&&this._value.includes(e)){this.resetComboboxInput(!0),this._userInfoMessage=`Verdien er allerede valgt`;return}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(!o.i(this.options,e)){if(o.c(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,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}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]?f(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},y=class extends v{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)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}=o.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._options=[...this.options]}handleFocus(){if(!this.disabled){if(this._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=f(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){if(this.disabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.getAttribute(`data-focusfix`)===this.id||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=o.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}=u(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);break}}!this.multiple&&this._value[0]?this.inputRef.value.value=f(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}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.disabled||(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.disabled)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]));break}}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=l(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();return}switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1;break}}}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();break}}checkForMatches(){let e=d(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);if(e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage}},b=class extends y{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&&(this.options=[...this.options?.filter(e=>e.userAdded)||[],...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]),this.optionsController?.nodes&&this.optionsController.nodes.length){let e=m.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=m.parseOptionsFromSlot(this.optionsController.nodes);this.options=[...this._options.filter(e=>e.userAdded),...t]}}super.willUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}updated(e){e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen);let t=e.has(`value`),n=e.has(`_value`);if(t&&this._internalValueSync)this._internalValueSync=!1,n&&this.syncValueAndDispatch(e.get(`_value`));else if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t),this.updateMaxReached(),this.syncValueAndDispatch(e)}else n&&this.syncValueAndDispatch(e.get(`_value`));if(e.has(`defaultOptions`)&&this.defaultOptions.length&&(this.options=[...(Array.isArray(this.options)?this.options:[]).filter(e=>e.userAdded)||[],...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]),e.has(`options`)){let t=e.get(`options`)||this._options||[],n=h.mergeWithUserAdded(this.options,t);this._options=n,n.length>this.options.length&&(this.options=n);let r=h.syncOptionsWithValues(this._options,this._value);if(this._options=r.options,r.newValues.length>this._value.length){let e=[...this._value];this._value=r.newValues,this.syncValueAndDispatch(e)}}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this._value[0]?f(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}super.updated(e)}formResetCallback(){this.touched=!1,this.value=this.defaultValue||(this.multiple,``),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.internals.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=Array.isArray(this.options)?[...this.options]:[];let e=h.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.p`
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs"),n=require("./element-with-slot-BY7Jc-q8.cjs");require("./icon-B8PVq2O6.cjs");const r=require("./if-defined-DrwbxQOj.cjs"),i=require("./ref-DO7TzO4O.cjs");require("./tag-C4fEuT-r.cjs");const a=require("./repeat-DRnLAg0O.cjs"),o=require("./listbox-89wMuQVK.cjs"),s=require("./input-element-DZLXF2rI.cjs"),c=require("./pkt-options-controller-DHKHMyXM.cjs");require("./input-wrapper-BRjQB4zM.cjs");var l=(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}},u=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=o.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}},d=(e,t,n,r,i)=>e.trim().toLowerCase()?{...o.s(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},f=(e,t,n)=>{let r=o.i(t,e);return n===`label`&&r?.label?r.label:e},p={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)}},m={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=o.r(n),t.push(n)}),t}},h={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=o.r(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t){return[...t.filter(e=>e?.userAdded&&e.selected).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},g={name:`pkt-combobox`,react:`PktCombobox`,"css-class":`pkt-combobox`,isElement:!0,isPureReact:!0,props:{name:{type:`string`,name:`Navn`,description:`Navn som brukes i skjema ved innsending`,category:`tech`},id:{type:`string`,name:`ID`,description:`Unik ID for feltet`,category:`tech`},label:{type:`string`,name:`Etikett/label`,description:`Tekst som vises over feltet`,category:`contents`},placeholder:{name:`Hint`,description:`Spesifiserer en kort hint som beskriver forventet verdi av feltet.`,type:`string`,category:`contents`,required:!1},multiple:{type:`boolean`,name:`Flervalg`,default:!1,description:`Mulighet for å velge flere valg`,category:`functionality`},tagPlacement:{attribute:`tag-placement`,type:[`inside`,`outside`],name:`Plassering av tags i flervalg`,description:`Plassering av valgte verdier i feltet ved flervalg`,category:`functionality`,showIf:{multiple:!0}},maxlength:{type:`number`,name:`Maks antall i flervalg`,description:`Maks antall valg dersom flervalg er aktivert`,category:`functionality`,showIf:{multiple:!0}},typeahead:{type:`boolean`,name:`Typeahead`,default:!1,description:`Mulighet for automatisk utfylling av feltet fra listen over valg`,category:`functionality`},includeSearch:{attribute:`include-search`,type:`boolean`,name:`Inkluder søk`,description:`Mulighet for å søke etter valg inni dropdown`,category:`functionality`},allowUserInput:{attribute:`allow-user-input`,type:`boolean`,name:`Brukervalgte verdier`,description:`Mulighet for å skrive inn egne verdier`,category:`functionality`},searchPlaceholder:{attribute:`search-placeholder`,type:`string`,name:`Søke-plassholder`,description:`Plassholdertekst for søkefeltet i dropdown`,category:`contents`,showIf:{includeSearch:!0}},displayValueAs:{attribute:`display-value-as`,type:[`label`,`value`,`prefixAndValue`],name:`Visning av valgt verdi`,description:`Hvordan valgt verdi vises i feltet`,default:`label`,category:`ui`},value:{name:`Verdi`,type:`string`,description:`Valgt verdi. Streng ved enkelt valg, array av strenger ved flervalg.`,category:`tech`},helptext:{type:`string`,name:`Hjelpetekst`,description:`Hjelpetekst som vises over feltet`,category:`contents`},helptextDropdown:{type:`string`,name:`Utvidet hjelpetekst`,description:`Hjelpetekst som vises i en lukket boks man kan åpne`,category:`contents`},helptextDropdownButton:{type:`string`,name:`Knappetekst for hjelpetekst`,description:`Tekst som vises på knappen for å åpne/lukke utvidet hjelpetekst`,category:`contents`,default:`Les mer`},disabled:{type:`boolean`,name:`Deaktivert`,description:`Feltet er deaktivert`,category:`tech`},hasError:{type:`boolean`,name:`Feil`,description:`Feltet har en feil`,category:`ui`},errorMessage:{type:`string`,name:`Feilmelding`,description:`Tekst som vises under feltet ved feil`,category:`contents`},required:{type:`boolean`,name:`Påkrevd`,description:`Feltet må fylles ut`,category:`tech`},requiredTag:{type:`boolean`,name:`Påkrevd-merking`,description:`Viser en merking som indikerer at feltet er påkrevd`,category:`ui`},requiredText:{type:`string`,name:`Påkrevd-tekst`,description:`Tekst som vises i påkrevd-merkingen`,category:`contents`},optionalTag:{type:`boolean`,name:`Valgfritt-merking`,description:`Viser en merking som indikerer at feltet er valgfritt`,category:`ui`},optionalText:{type:`string`,name:`Valgfritt-tekst`,description:`Tekst som vises i valgfritt-merkingen`,category:`contents`},tagText:{type:`string`,name:`Tag-tekst`,description:`Tekst som vises i en tag ved siden av label`,category:`ui`},fullwidth:{type:`boolean`,name:`Full bredde`,description:`Skal feltet ta opp hele bredden?`,category:`ui`},defaultOptions:{attribute:`default-options`,name:`Initielle valg (default options)`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter (denne vil ikke modifiseres ved endring innad i komponenten)`,type:`array`,default:[],previewDefault:[{value:`bfr`,label:`Frogner`},{value:`bgo`,label:`Gamle Oslo`},{value:`bgr`,label:`Grorud`},{value:`bxx`,label:`Andre bydeler`}],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`},options:{name:`Valg`,type:`array`,description:`Liste over valg som kan velges, om options sendes inn som array med objekter`,default:[],items:{type:`object`,properties:{value:{type:`string`,description:`Verdi som sendes ved valg`},label:{type:`string`,description:`Tekst som vises for valget`},prefix:{type:`string`,description:`Tekst som vises før valget`},description:{type:`string`,description:`Beskrivelse av valget`},disabled:{type:`boolean`,description:`Valget er deaktivert`},selected:{type:`boolean`,description:`Valget er valgt`},tagSkinColor:{type:[`blue`,`blue-dark`,`blue-light`,`green`,`red`,`yellow`,`beige`,`gray`,`grey`],description:`Farge på tag`}},required:[`value`]},category:`contents`}},events:{change:{type:`Event`,description:`Returnerer valgt verdi som streng. Ved flervalg returneres kommaseparerte verdier.`},"value-change":{type:`CustomEvent`,description:`Returnerer valgt verdi. Ved enkeltvalg en streng, ved flervalg en <code>string[]</code>.`},search:{type:`CustomEvent`,description:`Returnerer søketeksten som streng i <code>event.detail</code> når brukeren skriver i søkefeltet`},toggleHelpText:{type:`CustomEvent`,description:`Returnerer <code>event.detail { isOpen: true }</code> eller <code>event.detail { isOpen: false }</code> når hjelpeteksten åpnes eller lukkes`}}},_=class extends s.t{constructor(){super(),this.value=``,this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder=``,this.multiple=!1,this.maxlength=null,this.displayValueAs=g.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=i.t(),this.triggerRef=i.t(),this.listboxRef=i.t(),this.optionsController=new c.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()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(`,`):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=o.c(this._value.length,this.maxlength)}syncValueAndDispatch(e){let t=this._value,n=this.multiple?t.join(`,`):t[0]||``;if(n!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this._internalValueSync=!0,this.value=n),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.o({type:String,reflect:!0})],_.prototype,`value`,void 0),e.n([e.o({type:Array})],_.prototype,`options`,void 0),e.n([e.o({type:Array,attribute:`default-options`})],_.prototype,`defaultOptions`,void 0),e.n([e.o({type:Boolean,attribute:`allow-user-input`})],_.prototype,`allowUserInput`,void 0),e.n([e.o({type:Boolean})],_.prototype,`typeahead`,void 0),e.n([e.o({type:Boolean,attribute:`include-search`})],_.prototype,`includeSearch`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],_.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:Boolean})],_.prototype,`multiple`,void 0),e.n([e.o({type:Number})],_.prototype,`maxlength`,void 0),e.n([e.o({type:String,attribute:`display-value-as`})],_.prototype,`displayValueAs`,void 0),e.n([e.o({type:String,attribute:`tag-placement`})],_.prototype,`tagPlacement`,void 0),e.n([e.o({type:Boolean,attribute:`open`})],_.prototype,`isOpen`,void 0),e.n([e.a()],_.prototype,`_options`,void 0),e.n([e.a()],_.prototype,`_value`,void 0),e.n([e.a()],_.prototype,`_isOptionsOpen`,void 0),e.n([e.a()],_.prototype,`_userInfoMessage`,void 0),e.n([e.a()],_.prototype,`_addValueText`,void 0),e.n([e.a()],_.prototype,`_maxIsReached`,void 0),e.n([e.a()],_.prototype,`_search`,void 0),e.n([e.a()],_.prototype,`_inputFocus`,void 0);var v=class extends _{toggleValue(e){if(this.disabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=o.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(),s=!this.multiple,c=this.multiple,l=o.c(this._value.length,this.maxlength),u=!1,d=!0,f=``,p=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),f=`Ny verdi lagt til`,u=c):!r&&!this.allowUserInput?(s&&this._value[0]&&this.removeValue(this._value[0]),d=!1,u=!0,f=`Ingen treff i søket`):n?(this.removeValue(t),u=!0,s&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&s?(this.removeAllSelected(),u=!0):s?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),u=!1):c&&!l?(this.setSelected(t),u=!0):c&&l?(f=`Maks antall valg nådd`,d=!1,p=e):(s&&this.removeAllSelected(),f=`Ingen gyldig verdi valgt`,d=!1,u=!0,p=e),this._isOptionsOpen=u,u||(s&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=f,this._search=p||``,this.resetComboboxInput(d),c&&this.updateMaxReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&o.c(this._value.length,this.maxlength)){this._userInfoMessage=`Maks antall valg nådd`;return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,p.markOptionSelected(this._options,e),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=o.i(this.options,e);t&&(p.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._options=[...this._options,t]))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage=`For mange valgt`;return}this._value=this._options.map(e=>e.value),p.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],p.markAllDeselected(this._options),this._options=p.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;if(this._search=e,e&&this._value.includes(e)){this.resetComboboxInput(!0),this._userInfoMessage=`Verdien er allerede valgt`;return}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(!o.i(this.options,e)){if(o.c(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,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}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]?f(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},y=class extends v{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)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}=o.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._options=[...this.options]}handleFocus(){if(!this.disabled){if(this._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=f(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){if(this.disabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.getAttribute(`data-focusfix`)===this.id||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=o.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}=u(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);break}}!this.multiple&&this._value[0]?this.inputRef.value.value=f(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}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.disabled||(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.disabled)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]));break}}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=l(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();return}switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1;break}}}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();break}}checkForMatches(){let e=d(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);if(e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage}},b=class extends y{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=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController?.nodes&&this.optionsController.nodes.length){let e=m.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=m.parseOptionsFromSlot(this.optionsController.nodes),n=this._options.filter(e=>e.userAdded);this.options=[...n,...t]}}super.willUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}updated(e){e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen);let t=e.has(`value`),n=e.has(`_value`);if(t&&this._internalValueSync)this._internalValueSync=!1,n&&this.syncValueAndDispatch(e.get(`_value`));else if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t),this.updateMaxReached(),this.syncValueAndDispatch(e)}else n&&this.syncValueAndDispatch(e.get(`_value`));if(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=Array.isArray(this.options)?[...this.options]:[]}if(e.has(`options`)){let t=e.get(`options`)||this._options||[],n=h.mergeWithUserAdded(this.options,t);this._options=n,n.length>this.options.length&&(this.options=n);let r=h.syncOptionsWithValues(this._options,this._value);if(this._options=r.options,r.newValues.length>this._value.length){let e=[...this._value];this._value=r.newValues,this.syncValueAndDispatch(e)}}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this._value[0]?f(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}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.internals.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=Array.isArray(this.options)?[...this.options]:[];let e=h.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.p`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helptext=${this.helptext}
|
|
@@ -132,4 +132,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
|
|
|
132
132
|
>${t.value}</span
|
|
133
133
|
>`;default:return e.p`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
134
134
|
>${t.label||t.value}</span
|
|
135
|
-
>`}}};try{e.s(`pkt-combobox`)(b)}catch{console.warn(`Forsøker å definere <pkt-combobox>, men den er allerede definert`)}var x=b;Object.defineProperty(exports
|
|
135
|
+
>`}}};try{e.s(`pkt-combobox`)(b)}catch{console.warn(`Forsøker å definere <pkt-combobox>, men den er allerede definert`)}var x=b;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return x}});
|
|
@@ -15,6 +15,6 @@ export declare class PktAccordion extends LitElement implements IPktAccordion {
|
|
|
15
15
|
updated(changedProperties: Map<string, any>): void;
|
|
16
16
|
private updateAccordionItemNames;
|
|
17
17
|
firstUpdated(): void;
|
|
18
|
-
render(): import('lit
|
|
18
|
+
render(): import('lit').TemplateResult<1>;
|
|
19
19
|
}
|
|
20
20
|
export default PktAccordion;
|
|
@@ -27,6 +27,6 @@ export declare class PktAccordionItem extends PktElementWithSlot implements IPkt
|
|
|
27
27
|
accordionItemRef: Ref<HTMLDivElement>;
|
|
28
28
|
constructor();
|
|
29
29
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
30
|
-
render(): import('lit
|
|
30
|
+
render(): import('lit').TemplateResult<1>;
|
|
31
31
|
}
|
|
32
32
|
export default PktAccordionItem;
|
|
@@ -25,6 +25,6 @@ export declare class PktAlert extends PktElementWithSlot implements IPktAlert {
|
|
|
25
25
|
connectedCallback(): void;
|
|
26
26
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
27
27
|
protected updated(_changedProperties: PropertyValues): void;
|
|
28
|
-
render(): import('lit
|
|
28
|
+
render(): import('lit').TemplateResult<1>;
|
|
29
29
|
private close;
|
|
30
30
|
}
|
|
@@ -9,6 +9,6 @@ export declare class PktBackLink extends PktElement<IPktBackLink> implements IPk
|
|
|
9
9
|
text: string;
|
|
10
10
|
ariaLabel: string;
|
|
11
11
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
12
|
-
render(): import('lit
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
13
|
}
|
|
14
14
|
export default PktBackLink;
|
|
@@ -10,6 +10,6 @@ export interface IPktBreadcrumbs {
|
|
|
10
10
|
export declare class PktBreadcrumbs extends PktElement implements IPktBreadcrumbs {
|
|
11
11
|
breadcrumbs: IBreadcrumbItem[];
|
|
12
12
|
private handleLinkClick;
|
|
13
|
-
render(): typeof nothing | import('lit
|
|
13
|
+
render(): typeof nothing | import('lit').TemplateResult<1>;
|
|
14
14
|
}
|
|
15
15
|
export default PktBreadcrumbs;
|
|
@@ -48,6 +48,6 @@ export declare class PktButton extends PktElementWithSlot<IPktButton> implements
|
|
|
48
48
|
connectedCallback(): void;
|
|
49
49
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
50
50
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
51
|
-
render(): import('lit
|
|
51
|
+
render(): import('lit').TemplateResult<1>;
|
|
52
52
|
}
|
|
53
53
|
export default PktButton;
|
|
@@ -52,13 +52,13 @@ export declare class PktCard extends PktElementWithSlot implements IPktCard {
|
|
|
52
52
|
text: string;
|
|
53
53
|
})[];
|
|
54
54
|
connectedCallback(): void;
|
|
55
|
-
render(): import('lit
|
|
56
|
-
renderImage(): import('lit
|
|
57
|
-
renderHeading(): import('lit
|
|
58
|
-
renderLinkHeading(): import('lit
|
|
59
|
-
renderSubheading(): import('lit
|
|
60
|
-
renderHeader(): import('lit
|
|
61
|
-
renderTags(): import('lit
|
|
62
|
-
renderSlot(): import('lit
|
|
63
|
-
renderMetadata(): import('lit
|
|
55
|
+
render(): import('lit').TemplateResult<1>;
|
|
56
|
+
renderImage(): import('lit').TemplateResult<1>;
|
|
57
|
+
renderHeading(): import('lit').TemplateResult<1>;
|
|
58
|
+
renderLinkHeading(): import('lit').TemplateResult<1>;
|
|
59
|
+
renderSubheading(): import('lit').TemplateResult<1>;
|
|
60
|
+
renderHeader(): import('lit').TemplateResult<1>;
|
|
61
|
+
renderTags(): import('lit').TemplateResult<1>;
|
|
62
|
+
renderSlot(): import('lit').TemplateResult<1>;
|
|
63
|
+
renderMetadata(): import('lit').TemplateResult<1>;
|
|
64
64
|
}
|
|
@@ -24,7 +24,8 @@ export declare class PktCheckbox extends PktInputElement<Props> {
|
|
|
24
24
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
25
25
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
26
26
|
protected updated(changedProperties: PropertyValues): void;
|
|
27
|
-
render(): import('lit
|
|
27
|
+
render(): import('lit').TemplateResult<1>;
|
|
28
|
+
private handleInput;
|
|
28
29
|
private handleClick;
|
|
29
30
|
private handleChange;
|
|
30
31
|
private toggleChecked;
|
|
@@ -53,7 +53,7 @@ export declare class PktCombobox extends ComboboxHandlers implements IPktCombobo
|
|
|
53
53
|
*/
|
|
54
54
|
protected formResetCallback(): void;
|
|
55
55
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
56
|
-
render(): import('lit
|
|
56
|
+
render(): import('lit').TemplateResult<1>;
|
|
57
57
|
private renderInputField;
|
|
58
58
|
private renderSingleOrMultipleValues;
|
|
59
59
|
private renderValueTag;
|
|
@@ -69,6 +69,6 @@ export declare class PktConsent extends PktElement<IPktConsent> implements IPktC
|
|
|
69
69
|
protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
|
|
70
70
|
triggerInit(): void;
|
|
71
71
|
openModal(e: Event): void;
|
|
72
|
-
render(): import('lit
|
|
72
|
+
render(): import('lit').TemplateResult<1>;
|
|
73
73
|
}
|
|
74
74
|
export {};
|
|
@@ -30,5 +30,5 @@ export declare class PktDatepickerPopup extends PktElement {
|
|
|
30
30
|
focusOnCurrentDate(): void;
|
|
31
31
|
addToSelected(e: Event, min?: string | null, max?: string | null): void;
|
|
32
32
|
handleDateSelect(date: Date): Promise<void> | undefined;
|
|
33
|
-
render(): import('lit
|
|
33
|
+
render(): import('lit').TemplateResult<1>;
|
|
34
34
|
}
|
|
@@ -8,5 +8,5 @@ export declare class PktDatepickerRange extends PktDatepickerBase {
|
|
|
8
8
|
strings: IDatepickerStrings;
|
|
9
9
|
inputRefTo: Ref<HTMLInputElement>;
|
|
10
10
|
get inputElementTo(): HTMLInputElement | undefined;
|
|
11
|
-
render(): import('lit
|
|
11
|
+
render(): import('lit').TemplateResult<1>;
|
|
12
12
|
}
|
|
@@ -65,11 +65,11 @@ export declare class PktDatepicker extends PktInputElement<Props> {
|
|
|
65
65
|
/**
|
|
66
66
|
* Rendering
|
|
67
67
|
*/
|
|
68
|
-
renderInput(): import('lit
|
|
69
|
-
renderRangeInput(): import('lit
|
|
70
|
-
renderMultipleInput(): import('lit
|
|
71
|
-
renderCalendar(): import('lit
|
|
72
|
-
render(): import('lit
|
|
68
|
+
renderInput(): import('lit').TemplateResult<1>;
|
|
69
|
+
renderRangeInput(): import('lit').TemplateResult<1>;
|
|
70
|
+
renderMultipleInput(): import('lit').TemplateResult<1>;
|
|
71
|
+
renderCalendar(): import('lit').TemplateResult<1>;
|
|
72
|
+
render(): import('lit').TemplateResult<1>;
|
|
73
73
|
/**
|
|
74
74
|
* Handlers
|
|
75
75
|
*/
|
|
@@ -23,6 +23,6 @@ type TRenderQueueItemProps = {
|
|
|
23
23
|
onOpenPreview?: (fileId: string) => void;
|
|
24
24
|
onThumbnailImageError?: (fileId: string) => void;
|
|
25
25
|
};
|
|
26
|
-
export declare const renderFilenameQueueItem: ({ file, inputName, disabled, fileSize, operations, activeOperationId, onActivateOperation, onCloseOperation, getFileAttribute, setFileAttribute, transferProgress, transferErrorMessage, transferShowProgress, transferLastProgress, loadingText, truncateTail, onCancel, }: TRenderQueueItemProps) => import('lit
|
|
27
|
-
export declare const renderThumbnailQueueItem: ({ file, inputName, disabled, fileSize, thumbnailUrl, previewEnabled, canOpenPreview, operations, activeOperationId, onActivateOperation, onCloseOperation, getFileAttribute, setFileAttribute, transferProgress, transferErrorMessage, transferShowProgress, transferLastProgress, loadingText, truncateTail, onCancel, onOpenPreview, onThumbnailImageError, }: TRenderQueueItemProps) => import('lit
|
|
26
|
+
export declare const renderFilenameQueueItem: ({ file, inputName, disabled, fileSize, operations, activeOperationId, onActivateOperation, onCloseOperation, getFileAttribute, setFileAttribute, transferProgress, transferErrorMessage, transferShowProgress, transferLastProgress, loadingText, truncateTail, onCancel, }: TRenderQueueItemProps) => import('lit').TemplateResult<1>;
|
|
27
|
+
export declare const renderThumbnailQueueItem: ({ file, inputName, disabled, fileSize, thumbnailUrl, previewEnabled, canOpenPreview, operations, activeOperationId, onActivateOperation, onCloseOperation, getFileAttribute, setFileAttribute, transferProgress, transferErrorMessage, transferShowProgress, transferLastProgress, loadingText, truncateTail, onCancel, onOpenPreview, onThumbnailImageError, }: TRenderQueueItemProps) => import('lit').TemplateResult<1>;
|
|
28
28
|
export {};
|
|
@@ -6,7 +6,7 @@ export declare class PktFileUpload extends PktFileUploadBase implements IPktFile
|
|
|
6
6
|
private isPreviewModalOpen;
|
|
7
7
|
private previewCurrentIndex;
|
|
8
8
|
private failedImageFileIds;
|
|
9
|
-
render(): import('lit
|
|
9
|
+
render(): import('lit').TemplateResult<1>;
|
|
10
10
|
private renderContent;
|
|
11
11
|
private renderQueueItem;
|
|
12
12
|
private markImageFailed;
|
|
@@ -20,7 +20,7 @@ export declare class PktHeaderUserMenu extends PktElement<IPktHeaderUserMenu> im
|
|
|
20
20
|
private handleMenuItemClick;
|
|
21
21
|
private renderLinkOrButton;
|
|
22
22
|
private renderLinkSection;
|
|
23
|
-
render(): import('lit
|
|
23
|
+
render(): import('lit').TemplateResult<1>;
|
|
24
24
|
}
|
|
25
25
|
declare global {
|
|
26
26
|
interface HTMLElementTagNameMap {
|
|
@@ -44,7 +44,7 @@ export declare class PktHeader extends PktElementWithSlot<IPktHeader> implements
|
|
|
44
44
|
* Convert deprecated props to new props
|
|
45
45
|
*/
|
|
46
46
|
private get effectiveUserMenu();
|
|
47
|
-
render(): import('lit
|
|
47
|
+
render(): import('lit').TemplateResult<1>;
|
|
48
48
|
}
|
|
49
49
|
declare global {
|
|
50
50
|
interface HTMLElementTagNameMap {
|
|
@@ -17,7 +17,7 @@ export declare class PktIcon extends PktElement<Props> {
|
|
|
17
17
|
protected updated(_changedProperties: PropertyValues): Promise<void>;
|
|
18
18
|
private applyAriaToSvg;
|
|
19
19
|
protected getIcon(name?: PktIconName): Promise<void>;
|
|
20
|
-
render(): import('lit
|
|
20
|
+
render(): import('lit').TemplateResult<1>;
|
|
21
21
|
}
|
|
22
22
|
declare global {
|
|
23
23
|
interface HTMLElementTagNameMap {
|
|
@@ -34,7 +34,7 @@ export declare class PktInputWrapper extends PktElementWithSlot<Props> {
|
|
|
34
34
|
useWrapper: Booleanish;
|
|
35
35
|
protected updated(changedProperties: PropertyValues): void;
|
|
36
36
|
focusModality: FocusModalityController;
|
|
37
|
-
render(): import('lit
|
|
37
|
+
render(): import('lit').TemplateResult<1>;
|
|
38
38
|
private toggleDropdown;
|
|
39
39
|
private handleLabelClick;
|
|
40
40
|
}
|
|
@@ -43,7 +43,7 @@ export declare class PktListbox extends PktElement implements IPktListbox {
|
|
|
43
43
|
updated(changedProperties: PropertyValues): void;
|
|
44
44
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
45
45
|
private get _hasOptions();
|
|
46
|
-
render(): import('lit
|
|
46
|
+
render(): import('lit').TemplateResult<1>;
|
|
47
47
|
private renderCheckboxOrCheckIcon;
|
|
48
48
|
private renderEmptyMessage;
|
|
49
49
|
private renderList;
|
|
@@ -46,7 +46,7 @@ export declare class PktLoader extends PktElementWithSlot implements IPktLoader
|
|
|
46
46
|
private _shouldDisplayLoader;
|
|
47
47
|
connectedCallback(): void;
|
|
48
48
|
updated(changedProperties: Map<string, unknown>): void;
|
|
49
|
-
render(): import('lit
|
|
49
|
+
render(): import('lit').TemplateResult<1>;
|
|
50
50
|
private getVariant;
|
|
51
51
|
private setupLoader;
|
|
52
52
|
}
|
|
@@ -16,6 +16,6 @@ export declare class PktMessagebox extends PktElementWithSlot implements IPktMes
|
|
|
16
16
|
skin: TMessageboxSkin;
|
|
17
17
|
_isClosed: boolean;
|
|
18
18
|
protected updated(_changedProperties: PropertyValues): void;
|
|
19
|
-
render(): import('lit
|
|
19
|
+
render(): import('lit').TemplateResult<1>;
|
|
20
20
|
private close;
|
|
21
21
|
}
|
|
@@ -39,6 +39,6 @@ export declare class PktModal extends PktElementWithSlot implements IPktModal {
|
|
|
39
39
|
private isElementInViewport;
|
|
40
40
|
close: (event: Event, bypassNativeClose?: boolean) => void;
|
|
41
41
|
showModal: (event?: Event | null) => void;
|
|
42
|
-
render(): import('lit
|
|
42
|
+
render(): import('lit').TemplateResult<1>;
|
|
43
43
|
}
|
|
44
44
|
export {};
|
|
@@ -41,7 +41,7 @@ export declare class PktProgressbar extends PktElement implements IPktProgressba
|
|
|
41
41
|
private progressBarRef;
|
|
42
42
|
firstUpdated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
43
43
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
44
|
-
render(): import('lit
|
|
44
|
+
render(): import('lit').TemplateResult<1>;
|
|
45
45
|
private setComputedValues;
|
|
46
46
|
private syncAttributes;
|
|
47
47
|
private _handleAttribute;
|
|
@@ -18,7 +18,8 @@ export declare class PktRadioButton extends PktInputElement<Props> {
|
|
|
18
18
|
_checked: boolean;
|
|
19
19
|
connectedCallback(): void;
|
|
20
20
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
21
|
-
render(): import('lit
|
|
21
|
+
render(): import('lit').TemplateResult<1>;
|
|
22
|
+
private handleInput;
|
|
22
23
|
private toggleChecked;
|
|
23
24
|
}
|
|
24
25
|
export {};
|
|
@@ -22,6 +22,6 @@ export declare class PktSearchInput extends PktElement<IPktSearchInput> implemen
|
|
|
22
22
|
private onSearchClick;
|
|
23
23
|
private onSuggestionClick;
|
|
24
24
|
private renderSuggestion;
|
|
25
|
-
render(): import('lit
|
|
25
|
+
render(): import('lit').TemplateResult<1>;
|
|
26
26
|
}
|
|
27
27
|
export default PktSearchInput;
|
|
@@ -38,6 +38,6 @@ export declare class PktSelect extends PktOptionsInputElement<{}, TSelectOption>
|
|
|
38
38
|
attributeChangedCallback(name: string, _old: string, value: string): void;
|
|
39
39
|
update(changedProperties: PropertyValues): void;
|
|
40
40
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
41
|
-
render(): import('lit
|
|
41
|
+
render(): import('lit').TemplateResult<1>;
|
|
42
42
|
private returnNumberOrNull;
|
|
43
43
|
}
|
|
@@ -28,6 +28,6 @@ export declare class PktTabItem extends PktElementWithSlot<IPktTabItem> implemen
|
|
|
28
28
|
updated(): void;
|
|
29
29
|
private handleClick;
|
|
30
30
|
private handleKeyDown;
|
|
31
|
-
render(): import('lit
|
|
31
|
+
render(): import('lit').TemplateResult<1>;
|
|
32
32
|
}
|
|
33
33
|
export default PktTabItem;
|
|
@@ -23,6 +23,6 @@ export declare class PktTabs extends PktElementWithSlot<IPktTabs> implements IPk
|
|
|
23
23
|
private findEnabledIndex;
|
|
24
24
|
private handleClick;
|
|
25
25
|
private handleKeyUp;
|
|
26
|
-
render(): import('lit
|
|
26
|
+
render(): import('lit').TemplateResult<1>;
|
|
27
27
|
}
|
|
28
28
|
export default PktTabs;
|
|
@@ -11,6 +11,6 @@ export declare class PktTextarea extends PktInputElement<Props> {
|
|
|
11
11
|
counterCurrent: number;
|
|
12
12
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
13
13
|
updated(changedProperties: PropertyValues): void;
|
|
14
|
-
render(): import('lit
|
|
14
|
+
render(): import('lit').TemplateResult<1>;
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
@@ -16,6 +16,6 @@ export declare class PktTextinput extends PktInputElement<Props> {
|
|
|
16
16
|
counterCurrent: number;
|
|
17
17
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
18
18
|
updated(changedProperties: PropertyValues): void;
|
|
19
|
-
render(): import('lit
|
|
19
|
+
render(): import('lit').TemplateResult<1>;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -89,6 +89,6 @@ export declare class PktTimepicker extends PktInputElement<Props> {
|
|
|
89
89
|
private _renderOption;
|
|
90
90
|
private _renderPopup;
|
|
91
91
|
private _renderContainer;
|
|
92
|
-
render(): import('lit
|
|
92
|
+
render(): import('lit').TemplateResult<1>;
|
|
93
93
|
}
|
|
94
94
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as e, o as t, p as n, s as r, t as i } from "./element-
|
|
2
|
-
import "./icon-
|
|
3
|
-
import "./button-
|
|
1
|
+
import { n as e, o as t, p as n, s as r, t as i } from "./element-BoJrqauR.js";
|
|
2
|
+
import "./icon-DGFEIlco.js";
|
|
3
|
+
import "./button-C_YzTSuU.js";
|
|
4
4
|
//#region src/components/consent/strings.ts
|
|
5
5
|
var a = {
|
|
6
6
|
i18n: {
|