@oslokommune/punkt-elements 16.25.1 → 16.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-D_45dWPn.cjs → alert-B8dLsiTz.cjs} +2 -2
- package/dist/{alert-BkzC5mVu.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/{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-B5tQpKeG.cjs +27 -0
- package/dist/{button-CR-KWhTT.js → button-C_YzTSuU.js} +19 -18
- 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-DB_ZAuJJ.js} +12 -12
- package/dist/{checkbox-DzMc0AJX.cjs → checkbox-HKXLLpXq.cjs} +9 -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-x4tBGP3F.cjs → combobox-DsqvSokZ.cjs} +2 -2
- package/dist/{combobox-D-DY7YcW.js → combobox-vaCanZCq.js} +27 -17
- 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 +1 -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 +2 -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 +1 -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-BFdURuBl.js → consent-D5sY6JK3.js} +3 -3
- package/dist/{consent-DVt6sMvB.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-DxkcKevq.js → datepicker-CKghFMu2.js} +13 -13
- package/dist/{datepicker-Bs95HYGc.cjs → datepicker-DNEUkbB0.cjs} +2 -2
- 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/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 +1 -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-BLto9H17.cjs → fileupload-BMHJaAKR.cjs} +2 -2
- package/dist/{fileupload-bykWTtA6.js → fileupload-DpvQ3e_T.js} +10 -10
- package/dist/{focus-modality-controller-wI5SR8wH.cjs → focus-modality-controller-C1ocyv2J.cjs} +1 -1
- package/dist/{header-CQ5mC0D1.js → header-C7kSI9zP.js} +14 -10
- package/dist/{header-CShtWwBc.cjs → header-VfLyhEYL.cjs} +3 -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-C_zP_x4a.js +656 -0
- package/dist/input-element-Df9FHnfn.cjs +1 -0
- package/dist/{input-wrapper-Dhkt20WW.cjs → input-wrapper-BRjQB4zM.cjs} +21 -21
- package/dist/{input-wrapper-B6WowlWG.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-gKdQpOOQ.js → loader-BA-i8CaQ.js} +12 -11
- package/dist/loader-CgW4Vst3.cjs +16 -0
- 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-C6zERHoy.js → radiobutton-CKhWm7CI.js} +8 -8
- package/dist/{radiobutton-BfURufrZ.cjs → radiobutton-DbezjeDT.cjs} +5 -5
- 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-DzZHv6Bz.cjs → select-3689MFnH.cjs} +2 -2
- package/dist/{select-BIgFPp42.js → select-CrTmkOw0.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-M_S9WK7s.cjs → textarea-BWOuU6m6.cjs} +2 -2
- package/dist/{textarea-qHtkhelz.js → textarea-tKZakgjC.js} +10 -10
- package/dist/{textinput-C_6kvf87.cjs → textinput-CqvE701N.cjs} +2 -2
- package/dist/{textinput-CZrBM-Fj.js → textinput-D-gsl53I.js} +8 -8
- package/dist/{timepicker-O0iCeJyW.js → timepicker-D2KJmxrZ.js} +8 -8
- package/dist/{timepicker-WiYLAncb.cjs → timepicker-DTI6LY0j.cjs} +2 -2
- package/dist/{utils-CjAbIttF.cjs → utils-63cRpWut.cjs} +1 -1
- package/package.json +28 -27
- package/src/components/button/button.ts +7 -3
- package/src/components/header/header.ts +2 -0
- package/src/components/loader/loader.ts +7 -3
- package/dist/button-Dwv11n6R.cjs +0 -27
- 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/loader-Uap9qDsV.cjs +0 -16
- package/dist/progressbar-DADdvDl5.cjs +0 -17
- 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,6 +1,6 @@
|
|
|
1
|
-
import { c as e, f as t, l as n, u as r } from "./element-
|
|
2
|
-
import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-
|
|
3
|
-
//#region
|
|
1
|
+
import { c as e, f as t, l as n, u as r } from "./element-BoJrqauR.js";
|
|
2
|
+
import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-DIF5DwN4.js";
|
|
3
|
+
//#region node_modules/lit/node_modules/lit-html/directives/repeat.js
|
|
4
4
|
var l = (e, t, n) => {
|
|
5
5
|
let r = /* @__PURE__ */ new Map();
|
|
6
6
|
for (let i = t; i <= n; i++) r.set(e[i], i);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./directive-helpers-BshFvt7A.cjs");var n=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},r=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(r,[i,a,o]){let s=t.t(r),{values:c,keys:l}=this.dt(i,a,o);if(!Array.isArray(s))return this.ut=l,c;let u=this.ut??=[],d=[],f,p,m=0,h=s.length-1,g=0,_=c.length-1;for(;m<=h&&g<=_;)if(s[m]===null)m++;else if(s[h]===null)h--;else if(u[m]===l[g])d[g]=t.a(s[m],c[g]),m++,g++;else if(u[h]===l[_])d[_]=t.a(s[h],c[_]),h--,_--;else if(u[m]===l[_])d[_]=t.a(s[m],c[_]),t.o(r,d[_+1],s[m]),m++,_--;else if(u[h]===l[g])d[g]=t.a(s[h],c[g]),t.o(r,s[m],s[h]),h--,g++;else if(f===void 0&&(f=n(l,g,_),p=n(u,m,h)),f.has(u[m]))if(f.has(u[h])){let e=p.get(l[g]),n=e===void 0?null:s[e];if(n===null){let e=t.o(r,s[m]);t.a(e,c[g]),d[g]=e}else d[g]=t.a(n,c[g]),t.o(r,s[m],n),s[e]=null;g++}else t.n(s[h]),h--;else t.n(s[m]),m++;for(;g<=_;){let e=t.o(r,d[_+1]);t.a(e,c[g]),d[g++]=e}for(;m<=h;){let e=s[m++];e!==null&&t.n(e)}return this.ut=l,t.r(r,d),e.f}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as e, n as t, o as n, p as r, s as i, t as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import "./icon-
|
|
4
|
-
import { t as s } from "./if-defined-
|
|
5
|
-
import { t as c } from "./focus-modality-controller-
|
|
1
|
+
import { d as e, n as t, o as n, p as r, s as i, t as a } from "./element-BoJrqauR.js";
|
|
2
|
+
import { t as o } from "./class-map-CAQCRB1W.js";
|
|
3
|
+
import "./icon-DGFEIlco.js";
|
|
4
|
+
import { t as s } from "./if-defined-D0bnetLJ.js";
|
|
5
|
+
import { t as c } from "./focus-modality-controller-Dc2S-KqR.js";
|
|
6
6
|
//#region src/components/searchinput/searchinput.ts
|
|
7
7
|
var l = class extends a {
|
|
8
8
|
constructor(...e) {
|
|
@@ -19,7 +19,8 @@ var l = class extends a {
|
|
|
19
19
|
}));
|
|
20
20
|
}
|
|
21
21
|
onInput(e) {
|
|
22
|
-
|
|
22
|
+
let t = e.target;
|
|
23
|
+
this.value = t.value;
|
|
23
24
|
}
|
|
24
25
|
onInputKeydown(e) {
|
|
25
26
|
e.key === "Enter" && (e.preventDefault(), this.dispatchSearch());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs");require("./icon-B8PVq2O6.cjs");const n=require("./if-defined-DrwbxQOj.cjs"),r=require("./focus-modality-controller-C1ocyv2J.cjs");var i=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.disabled=!1,this.fullwidth=!1,this.id=``,this.placeholder=`Søk…`,this.value=``,this.focusModality=new r.t(this,`.pkt-searchinput`)}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(e.preventDefault(),this.dispatchSearch())}onSearchClick(e){e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e.p`
|
|
2
2
|
${t.title?e.p`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>`:e.d}
|
|
3
3
|
${t.text?e.p`<p class="pkt-searchinput__suggestion-text">${t.text}</p>`:e.d}
|
|
4
4
|
`;return t.href?e.p`<a
|
|
@@ -57,4 +57,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);
|
|
|
57
57
|
@submit=${e=>{e.preventDefault()}}
|
|
58
58
|
>
|
|
59
59
|
${s}
|
|
60
|
-
</form>`:e.p`<div role="search" class=${r}>${s}</div>`}};e.n([e.o({type:String})],i.prototype,`appearance`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`disabled`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`fullwidth`,void 0),e.n([e.o({type:String,reflect:!0})],i.prototype,`id`,void 0),e.n([e.o({type:String})],i.prototype,`label`,void 0),e.n([e.o({type:String})],i.prototype,`name`,void 0),e.n([e.o({type:String})],i.prototype,`placeholder`,void 0),e.n([e.o({type:String})],i.prototype,`value`,void 0),e.n([e.o({type:Array})],i.prototype,`suggestions`,void 0),e.n([e.o({type:String})],i.prototype,`action`,void 0),e.n([e.o({type:String})],i.prototype,`method`,void 0);try{e.s(`pkt-searchinput`)(i)}catch{console.warn(`Forsøker å definere <pkt-searchinput>, men den er allerede definert`)}var a=i;Object.defineProperty(exports
|
|
60
|
+
</form>`:e.p`<div role="search" class=${r}>${s}</div>`}};e.n([e.o({type:String})],i.prototype,`appearance`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`disabled`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`fullwidth`,void 0),e.n([e.o({type:String,reflect:!0})],i.prototype,`id`,void 0),e.n([e.o({type:String})],i.prototype,`label`,void 0),e.n([e.o({type:String})],i.prototype,`name`,void 0),e.n([e.o({type:String})],i.prototype,`placeholder`,void 0),e.n([e.o({type:String})],i.prototype,`value`,void 0),e.n([e.o({type:Array})],i.prototype,`suggestions`,void 0),e.n([e.o({type:String})],i.prototype,`action`,void 0),e.n([e.o({type:String})],i.prototype,`method`,void 0);try{e.s(`pkt-searchinput`)(i)}catch{console.warn(`Forsøker å definere <pkt-searchinput>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./element-with-slot-BY7Jc-q8.cjs"),n=require("./if-defined-DrwbxQOj.cjs"),r=require("./ref-DO7TzO4O.cjs"),i=require("./input-element-Df9FHnfn.cjs"),a=require("./pkt-options-controller-DHKHMyXM.cjs");require("./input-wrapper-BRjQB4zM.cjs");var o=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.o({type:Array,attribute:`options`})],o.prototype,`_optionsProp`,void 0),e.n([e.a()],o.prototype,`_options`,void 0);var s=class extends o{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e.p`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
?counter=${this.counter}
|
|
4
4
|
?disabled=${this.disabled}
|
|
@@ -46,4 +46,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4
|
|
|
46
46
|
</select>
|
|
47
47
|
<div class="pkt-contents" slot="helptext">${t.n(this,`helptext`)}</div>
|
|
48
48
|
</pkt-input-wrapper>
|
|
49
|
-
`}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.o({type:String})],s.prototype,`value`,void 0);try{e.s(`pkt-select`)(s)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var c=s;Object.defineProperty(exports
|
|
49
|
+
`}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.o({type:String})],s.prototype,`value`,void 0);try{e.s(`pkt-select`)(s)}catch{console.warn(`Forsøker å definere <pkt-select>, 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}});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as e, n as t, o as n, p as r, s as i } from "./element-
|
|
2
|
-
import { n as a } from "./element-with-slot-
|
|
3
|
-
import { t as o } from "./if-defined-
|
|
4
|
-
import { n as s, t as c } from "./ref-
|
|
5
|
-
import { t as l } from "./input-element-
|
|
6
|
-
import { t as u } from "./pkt-options-controller-
|
|
7
|
-
import "./input-wrapper-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-BoJrqauR.js";
|
|
2
|
+
import { n as a } from "./element-with-slot-mXLg8gg8.js";
|
|
3
|
+
import { t as o } from "./if-defined-D0bnetLJ.js";
|
|
4
|
+
import { n as s, t as c } from "./ref-WGS0u7i2.js";
|
|
5
|
+
import { t as l } from "./input-element-C_zP_x4a.js";
|
|
6
|
+
import { t as u } from "./pkt-options-controller-Cis62vGe.js";
|
|
7
|
+
import "./input-wrapper-DaA98B5l.js";
|
|
8
8
|
//#region src/base-elements/options-input-element.ts
|
|
9
9
|
var d = class extends l {
|
|
10
10
|
constructor(...e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./element-with-slot-BY7Jc-q8.cjs"),n=require("./if-defined-DrwbxQOj.cjs"),r=require("./ref-DO7TzO4O.cjs");var i=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function a(e){return e}var o=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new i(this.context,this.host,this.t,this.subscribe))}},s=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},c=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},l=class extends s{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new i(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new c(this.context,this.host))}};function u({context:e}){return(t,n)=>{let r=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return r.get(this).setValue(e),t.set.call(this,e)},init(t){return r.set(this,new l(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new l(t,{context:e}))}));let i=Object.getOwnPropertyDescriptor(t,n),a;if(i===void 0){let e=new WeakMap;a={get(){return e.get(this)},set(t){r.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=i.set;a={...i,set(t){r.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,a);return}}}function d({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new o(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new o(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var f=a(Symbol(`pkt-tabs-context`)),p=class extends t.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let n=this.useArrowNav?`tablist`:`navigation`;return e.p`
|
|
2
2
|
<div class=${this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`}>
|
|
3
3
|
<div class="pkt-tabs__list" role=${n}>${t.n(this)}</div>
|
|
4
4
|
</div>
|
|
@@ -37,4 +37,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4
|
|
|
37
37
|
>
|
|
38
38
|
${d}
|
|
39
39
|
</button>
|
|
40
|
-
`}};e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`active`,void 0),e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`disabled`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`href`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`icon`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`controls`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`tag`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`tag-skin`})],m.prototype,`tagSkin`,void 0),e.n([e.o({type:Number,reflect:!0})],m.prototype,`index`,void 0),e.n([d({context:f,subscribe:!0}),e.o({attribute:!1})],m.prototype,`context`,void 0);try{e.s(`pkt-tab-item`)(m)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var h=p;Object.defineProperty(exports
|
|
40
|
+
`}};e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`active`,void 0),e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`disabled`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`href`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`icon`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`controls`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`tag`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`tag-skin`})],m.prototype,`tagSkin`,void 0),e.n([e.o({type:Number,reflect:!0})],m.prototype,`index`,void 0),e.n([d({context:f,subscribe:!0}),e.o({attribute:!1})],m.prototype,`context`,void 0);try{e.s(`pkt-tab-item`)(m)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var h=p;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as e, n as t, o as n, p as r, s as i } from "./element-
|
|
2
|
-
import { n as a, t as o } from "./element-with-slot-
|
|
3
|
-
import { t as s } from "./if-defined-
|
|
4
|
-
import { n as c, t as l } from "./ref-
|
|
5
|
-
//#region
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-BoJrqauR.js";
|
|
2
|
+
import { n as a, t as o } from "./element-with-slot-mXLg8gg8.js";
|
|
3
|
+
import { t as s } from "./if-defined-D0bnetLJ.js";
|
|
4
|
+
import { n as c, t as l } from "./ref-WGS0u7i2.js";
|
|
5
|
+
//#region node_modules/@lit/context/lib/context-request-event.js
|
|
6
6
|
var u = class extends Event {
|
|
7
7
|
constructor(e, t, n, r) {
|
|
8
8
|
super("context-request", {
|
|
@@ -12,12 +12,12 @@ var u = class extends Event {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region
|
|
15
|
+
//#region node_modules/@lit/context/lib/create-context.js
|
|
16
16
|
function d(e) {
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
|
-
//#region
|
|
20
|
+
//#region node_modules/@lit/context/lib/controllers/context-consumer.js
|
|
21
21
|
var f = class {
|
|
22
22
|
constructor(e, t, n, r) {
|
|
23
23
|
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (e, t) => {
|
|
@@ -95,7 +95,7 @@ var f = class {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
//#endregion
|
|
98
|
-
//#region
|
|
98
|
+
//#region node_modules/@lit/context/lib/decorators/provide.js
|
|
99
99
|
function g({ context: e }) {
|
|
100
100
|
return (t, n) => {
|
|
101
101
|
let r = /* @__PURE__ */ new WeakMap();
|
|
@@ -145,7 +145,7 @@ function g({ context: e }) {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
|
-
//#region
|
|
148
|
+
//#region node_modules/@lit/context/lib/decorators/consume.js
|
|
149
149
|
function _({ context: e, subscribe: t }) {
|
|
150
150
|
return (n, r) => {
|
|
151
151
|
typeof r == "object" ? r.addInitializer((function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(
|
|
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");var i={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},a=class extends n.t{constructor(){super(),this.closeTag=i.props.closeTag.default,this.size=i.props.size.default,this.skin=i.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=i.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}firstUpdated(e){if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){let e=this.querySelector(`button span, .pkt-tag > span`)?.textContent?.trim();e&&(this._ariaDescription=`Klikk for å fjerne ${e}`)}}render(){let i={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?e.p`
|
|
2
2
|
<button
|
|
3
3
|
class=${t.t(a)}
|
|
4
4
|
type=${this.type}
|
|
@@ -24,4 +24,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
|
|
|
24
24
|
></pkt-icon>`}
|
|
25
25
|
<span>${n.n(this)}</span>
|
|
26
26
|
</span>
|
|
27
|
-
`}};e.n([e.o({type:Boolean,reflect:!0})],a.prototype,`closeTag`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`size`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`textStyle`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`iconName`,void 0),e.n([e.o({type:String})],a.prototype,`type`,void 0),e.n([e.o({type:String})],a.prototype,`ariaLabel`,void 0),e.n([e.o({type:Number,attribute:`button-tabindex`})],a.prototype,`buttonTabindex`,void 0),e.n([e.a()],a.prototype,`_isClosed`,void 0),e.n([e.a()],a.prototype,`_ariaDescription`,void 0);try{e.s(`pkt-tag`)(a)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var o=a;Object.defineProperty(exports
|
|
27
|
+
`}};e.n([e.o({type:Boolean,reflect:!0})],a.prototype,`closeTag`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`size`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`textStyle`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`iconName`,void 0),e.n([e.o({type:String})],a.prototype,`type`,void 0),e.n([e.o({type:String})],a.prototype,`ariaLabel`,void 0),e.n([e.o({type:Number,attribute:`button-tabindex`})],a.prototype,`buttonTabindex`,void 0),e.n([e.a()],a.prototype,`_isClosed`,void 0),e.n([e.a()],a.prototype,`_ariaDescription`,void 0);try{e.s(`pkt-tag`)(a)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as e, n as t, o as n, p as r, s as i } from "./element-
|
|
2
|
-
import { t as a } from "./class-map-
|
|
3
|
-
import { n as o, t as s } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as c } from "./if-defined-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-BoJrqauR.js";
|
|
2
|
+
import { t as a } from "./class-map-CAQCRB1W.js";
|
|
3
|
+
import { n as o, t as s } from "./element-with-slot-mXLg8gg8.js";
|
|
4
|
+
import "./icon-DGFEIlco.js";
|
|
5
|
+
import { t as c } from "./if-defined-D0bnetLJ.js";
|
|
6
6
|
var l = {
|
|
7
7
|
name: "pkt-tag",
|
|
8
8
|
react: "PktTag",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs"),n=require("./directive-helpers-BshFvt7A.cjs"),r=require("./element-with-slot-BY7Jc-q8.cjs");require("./icon-B8PVq2O6.cjs");const i=require("./if-defined-DrwbxQOj.cjs"),a=require("./ref-DO7TzO4O.cjs"),o=require("./input-element-Df9FHnfn.cjs");require("./input-wrapper-BRjQB4zM.cjs");var s=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.PROPERTY&&t.type!==e.u.ATTRIBUTE&&t.type!==e.u.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.f||r===e.d)return r;let i=t.element,a=t.name;if(t.type===e.u.PROPERTY){if(r===i[a])return e.f}else if(t.type===e.u.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.f}else if(t.type===e.u.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.f;return n.r(t),r}}),c=class extends o.t{constructor(...e){super(...e),this.inputRef=a.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let n=t.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),o=this.ariaLabelledby||`${this.id}-input-label`;return e.p`<pkt-input-wrapper
|
|
2
2
|
label=${this.label}
|
|
3
3
|
?counter=${this.counter}
|
|
4
4
|
?disabled=${this.disabled}
|
|
@@ -43,4 +43,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
|
|
|
43
43
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
44
44
|
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
45
45
|
></textarea>
|
|
46
|
-
</pkt-input-wrapper>`}};e.n([e.o({type:String,reflect:!0})],c.prototype,`value`,void 0),e.n([e.o({type:String})],c.prototype,`autocomplete`,void 0),e.n([e.o({type:Number})],c.prototype,`rows`,void 0),e.n([e.a()],c.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textarea`)(c)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var l=c;Object.defineProperty(exports
|
|
46
|
+
</pkt-input-wrapper>`}};e.n([e.o({type:String,reflect:!0})],c.prototype,`value`,void 0),e.n([e.o({type:String})],c.prototype,`autocomplete`,void 0),e.n([e.o({type:Number})],c.prototype,`rows`,void 0),e.n([e.a()],c.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textarea`)(c)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, l as i, n as a, o, p as s, s as c, u as l } from "./element-
|
|
2
|
-
import { t as u } from "./class-map-
|
|
3
|
-
import { i as d, r as f } from "./directive-helpers-
|
|
4
|
-
import { n as p } from "./element-with-slot-
|
|
5
|
-
import "./icon-
|
|
6
|
-
import { t as m } from "./if-defined-
|
|
7
|
-
import { n as h, t as g } from "./ref-
|
|
8
|
-
import { t as _ } from "./input-element-
|
|
9
|
-
import "./input-wrapper-
|
|
10
|
-
//#region
|
|
1
|
+
import { a as e, c as t, d as n, f as r, l as i, n as a, o, p as s, s as c, u as l } from "./element-BoJrqauR.js";
|
|
2
|
+
import { t as u } from "./class-map-CAQCRB1W.js";
|
|
3
|
+
import { i as d, r as f } from "./directive-helpers-DIF5DwN4.js";
|
|
4
|
+
import { n as p } from "./element-with-slot-mXLg8gg8.js";
|
|
5
|
+
import "./icon-DGFEIlco.js";
|
|
6
|
+
import { t as m } from "./if-defined-D0bnetLJ.js";
|
|
7
|
+
import { n as h, t as g } from "./ref-WGS0u7i2.js";
|
|
8
|
+
import { t as _ } from "./input-element-C_zP_x4a.js";
|
|
9
|
+
import "./input-wrapper-DaA98B5l.js";
|
|
10
|
+
//#region node_modules/lit/node_modules/lit-html/directives/live.js
|
|
11
11
|
var v = t(class extends i {
|
|
12
12
|
constructor(e) {
|
|
13
13
|
if (super(e), e.type !== l.PROPERTY && e.type !== l.ATTRIBUTE && e.type !== l.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(
|
|
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"),a=require("./input-element-Df9FHnfn.cjs");require("./input-wrapper-BRjQB4zM.cjs");var o=class extends a.t{constructor(...e){super(...e),this.inputRef=i.t(),this.value=``,this.type=`text`,this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let a=this.type===`search`&&!this.iconNameRight&&!this.omitSearchIcon,o=t.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),s=this.ariaLabelledby||`${this.id}-input-label`;return e.p`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
label="${this.label}"
|
|
4
4
|
?counter=${this.counter}
|
|
@@ -67,4 +67,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
|
|
|
67
67
|
${!this.suffix&&a?e.p`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:e.d}
|
|
68
68
|
</div>
|
|
69
69
|
</pkt-input-wrapper>
|
|
70
|
-
`}};e.n([e.o({type:String,reflect:!0})],o.prototype,`value`,void 0),e.n([e.o({type:String})],o.prototype,`type`,void 0),e.n([e.o({type:Number})],o.prototype,`size`,void 0),e.n([e.o({type:String})],o.prototype,`autocomplete`,void 0),e.n([e.o({type:String})],o.prototype,`iconNameRight`,void 0),e.n([e.o({type:String})],o.prototype,`prefix`,void 0),e.n([e.o({type:String})],o.prototype,`suffix`,void 0),e.n([e.o({type:Boolean})],o.prototype,`omitSearchIcon`,void 0),e.n([e.a()],o.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textinput`)(o)}catch{console.warn(`Forsøker å definere <pkt-textinput>, men den er allerede definert`)}var s=o;Object.defineProperty(exports
|
|
70
|
+
`}};e.n([e.o({type:String,reflect:!0})],o.prototype,`value`,void 0),e.n([e.o({type:String})],o.prototype,`type`,void 0),e.n([e.o({type:Number})],o.prototype,`size`,void 0),e.n([e.o({type:String})],o.prototype,`autocomplete`,void 0),e.n([e.o({type:String})],o.prototype,`iconNameRight`,void 0),e.n([e.o({type:String})],o.prototype,`prefix`,void 0),e.n([e.o({type:String})],o.prototype,`suffix`,void 0),e.n([e.o({type:Boolean})],o.prototype,`omitSearchIcon`,void 0),e.n([e.a()],o.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textinput`)(o)}catch{console.warn(`Forsøker å definere <pkt-textinput>, 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,11 +1,11 @@
|
|
|
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 { t as d } from "./input-element-
|
|
8
|
-
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 { t as d } from "./input-element-C_zP_x4a.js";
|
|
8
|
+
import "./input-wrapper-DaA98B5l.js";
|
|
9
9
|
//#region src/components/textinput/textinput.ts
|
|
10
10
|
var f = class extends d {
|
|
11
11
|
constructor(...e) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as e, d as t, n, o as r, p as i, r as a, s as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import { n as c } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as l } from "./if-defined-
|
|
6
|
-
import { n as u, t as d } from "./ref-
|
|
7
|
-
import { t as f } from "./input-element-
|
|
8
|
-
import "./input-wrapper-
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, r as a, s as o } from "./element-BoJrqauR.js";
|
|
2
|
+
import { t as s } from "./class-map-CAQCRB1W.js";
|
|
3
|
+
import { n as c } from "./element-with-slot-mXLg8gg8.js";
|
|
4
|
+
import "./icon-DGFEIlco.js";
|
|
5
|
+
import { t as l } from "./if-defined-D0bnetLJ.js";
|
|
6
|
+
import { n as u, t as d } from "./ref-WGS0u7i2.js";
|
|
7
|
+
import { t as f } from "./input-element-C_zP_x4a.js";
|
|
8
|
+
import "./input-wrapper-DaA98B5l.js";
|
|
9
9
|
//#region ../../shared-utils/timepicker/time-utils.ts
|
|
10
10
|
var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && parseInt(e.slice(3), 10) <= 59, m = (e) => {
|
|
11
11
|
let [t, n] = e.split(":").map(Number);
|
|
@@ -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`),a=require(`./input-element-BHQVt4Q9.cjs`);require(`./input-wrapper-Dhkt20WW.cjs`);var o=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,s=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},c=e=>e?Math.max(1,Math.round(e/60)):1,l=(e,t)=>{let n=e?parseInt(String(e).split(`:`)[0],10):0,r=t?parseInt(String(t).split(`:`)[0],10):23;return Array.from({length:r-n+1},(e,t)=>t+n)},u=e=>{let t=c(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},d=(e,t,n,r)=>{let i=e===``?n===1?0:23:parseInt(e,10),a=t===``?n===1?0:Math.floor(59/r)*r:parseInt(t,10);return a+=n*r,a>59?(a=0,i=(i+1)%24):a<0&&(a=Math.floor(59/r)*r,i=(i-1+24)%24),{hours:String(i).padStart(2,`0`),minutes:String(a).padStart(2,`0`)}},f=class extends a.t{constructor(...e){super(...e),this.hiddenInputRef=i.t(),this.hoursInputRef=i.t(),this.minutesInputRef=i.t(),this.buttonRef=i.t(),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=>{this.contains(e.target)||this._closePopup()},this._handleComponentFocusIn=()=>{this._hasFocus||(this._hasFocus=!0,this.onFocus())},this._handleComponentFocusOut=e=>{this.contains(e.relatedTarget)||(this._hasFocus=!1,this.onBlur())},this._handleHoursKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t+1)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t-1+24)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowRight`:e.preventDefault(),this.minutesInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._hoursDigitCount=0,this._hoursFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._hoursDigitCount===0)this._hoursFirstDigit=t,this._hours=String(t).padStart(2,`0`),this._hoursDigitCount=1,this.onInput(),t>=3&&(this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.minutesInputRef.value?.focus());else{let e=this._hoursFirstDigit*10+t;this._hours=e<=23?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.onInput(),this.minutesInputRef.value?.focus()}}else e.preventDefault()}},this._handleHoursBlur=()=>{this._hours!==``&&(this._hours=String(parseInt(this._hours,10)).padStart(2,`0`)),this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._syncValueFromDisplay()},this._handleMinutesKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t+this._minuteStep)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t-this._minuteStep+60)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowLeft`:e.preventDefault(),this.hoursInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._minutesDigitCount=0,this._minutesFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._minutesDigitCount===0)this._minutesFirstDigit=t,this._minutes=String(t).padStart(2,`0`),this._minutesDigitCount=1,this.onInput(),t>=6&&(this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay());else{let e=this._minutesFirstDigit*10+t;this._minutes=e<=59?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay(),this.onInput()}}else e.preventDefault()}},this._handleMinutesBlur=()=>{this._minutes!==``&&(this._minutes=String(parseInt(this._minutes,10)).padStart(2,`0`)),this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._syncValueFromDisplay()},this._handlePopupKeydown=e=>{let t=document.activeElement,n=t.closest(`.pkt-timepicker-popup__col`);if(!n)return;let r=Array.from(n.querySelectorAll(`.pkt-timepicker-popup__option`)),i=r.indexOf(t),a=t.dataset.type??``;switch(e.key){case`ArrowDown`:e.preventDefault(),this._focusOptionAndSync(r[Math.min(i+1,r.length-1)],a);break;case`ArrowUp`:e.preventDefault(),this._focusOptionAndSync(r[Math.max(i-1,0)],a);break;case`Home`:e.preventDefault(),this._focusOptionAndSync(r[0],a);break;case`End`:e.preventDefault(),this._focusOptionAndSync(r[r.length-1],a);break;case`ArrowRight`:e.preventDefault(),a===`hour`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`minute`)}));break;case`ArrowLeft`:e.preventDefault(),a===`minute`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)}));break;case`Enter`:case` `:e.preventDefault(),t.click();break;case`Escape`:e.preventDefault(),this._closePopup(),this.buttonRef.value?.focus();break}}}get inputRef(){return this.hiddenInputRef}manageValidity(t){let n=this.hoursInputRef.value;if(!n)return;if(this.required&&!this.value){this.internals.setValidity({valueMissing:!0},e.r.forms.messages.required,n),this._setAriaInvalid(!0);return}if(!this.value){this.internals.setValidity({}),this._setAriaInvalid(!1);return}let r=s(this.value),i=c(this.step);if(this.min&&r<s(String(this.min))){this.internals.setValidity({rangeUnderflow:!0},e.r.forms.messages.rangeUnderflowMin.replace(`{min}`,String(this.min)),n),this._setAriaInvalid(!0);return}if(this.max&&r>s(String(this.max))){this.internals.setValidity({rangeOverflow:!0},e.r.forms.messages.rangeOverflowMax.replace(`{max}`,String(this.max)),n),this._setAriaInvalid(!0);return}if(this.step&&r%i!==0){let t=i===60?e.r.forms.messages.timeStepMismatchHour:i===30?e.r.forms.messages.timeStepMismatchHalfHour:e.r.forms.messages.timeStepMismatch.replace(`{step}`,`${i}, ${i*2}, ${i*3}`);this.internals.setValidity({stepMismatch:!0},t,n),this._setAriaInvalid(!0);return}this.internals.setValidity({}),this._setAriaInvalid(!1)}_setAriaInvalid(e){if(!this.touched&&e)return;let t=this.hoursInputRef.value,n=this.minutesInputRef.value;e?(t?.setAttribute(`aria-invalid`,`true`),n?.setAttribute(`aria-invalid`,`true`)):(t?.removeAttribute(`aria-invalid`),n?.removeAttribute(`aria-invalid`))}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,this._handleComponentFocusIn),this.addEventListener(`focusout`,this._handleComponentFocusOut),document.addEventListener(`click`,this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`focusin`,this._handleComponentFocusIn),this.removeEventListener(`focusout`,this._handleComponentFocusOut),document.removeEventListener(`click`,this._outsideClickHandler)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&this._syncDisplayFromValue()}updated(e){super.updated(e),this.classList.toggle(`pkt-timepicker--stepper`,this.stepArrows),this.classList.toggle(`pkt-timepicker--fullwidth`,this.fullwidth),e.has(`step`)&&this.step!==null&&!this._isValidStep(this.step)&&console.warn(`pkt-timepicker: step="${this.step}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)}formResetCallback(){super.formResetCallback(),this._hours=``,this._minutes=``,this._isOpen=!1}_isValidStep(e){return e===3600||e<3600&&3600%e==0&&e%60==0}_syncDisplayFromValue(){let e=o(this.value)?this.value.split(`:`):null;e?(this._hours=e[0],this._minutes=e[1]):(this._hours=``,this._minutes=``)}_syncValueFromDisplay(){if(this._hours!==``&&this._minutes!==``){let e=`${this._hours}:${this._minutes}`;e!==this.value&&(this.value=e,this.onChange(e))}else this.value!==``&&(this.value=``,this.onChange(``))}get _minuteStep(){return c(this.step)}get _hourOptions(){return l(this.min,this.max)}get _minuteOptions(){return u(this.step)}_openPopup(){this._isOpen=!0,this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)})}_closePopup(){this._isOpen=!1,this._syncValueFromDisplay()}_togglePopup(){this._isOpen?this._closePopup():this._openPopup()}_scrollToSelected(){let e=this.querySelector(`.pkt-timepicker-popup`);e&&e.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{let t=e.querySelector(`.pkt-timepicker-popup__option--selected`);t&&t.scrollIntoView({block:`center`})})}_focusSelectedOrFirst(e){let t=this.querySelector(`.pkt-timepicker-popup`);if(!t)return;let n=t.querySelectorAll(`.pkt-timepicker-popup__col`),r=e===`hour`?n[0]:n[1];if(!r)return;let i=r.querySelector(`.pkt-timepicker-popup__option--selected`),a=r.querySelector(`.pkt-timepicker-popup__option`);(i||a)?.focus()}_handleOptionClick(e,t){let n=String(e).padStart(2,`0`);t===`hour`?(this._hours=n,this.updateComplete.then(()=>this._focusSelectedOrFirst(`minute`))):(this._minutes=n,this._closePopup(),this.buttonRef.value?.focus())}_focusOptionAndSync(e,t){if(!e)return;let n=parseInt(e.dataset.value??`0`,10);t===`hour`?this._hours=String(n).padStart(2,`0`):this._minutes=String(n).padStart(2,`0`),e.focus()}_stepTime(e){let t=d(this._hours,this._minutes,e,this._minuteStep);this._hours=t.hours,this._minutes=t.minutes,this._syncValueFromDisplay()}_renderOption(n,r){let i=String(n).padStart(2,`0`),a=n===(r===`hour`?this._hours===``?NaN:parseInt(this._hours,10):this._minutes===``?NaN:parseInt(this._minutes,10));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"),a=require("./input-element-Df9FHnfn.cjs");require("./input-wrapper-BRjQB4zM.cjs");var o=e=>/^\d{2}:\d{2}$/.test(e)&&parseInt(e.slice(0,2),10)<=23&&parseInt(e.slice(3),10)<=59,s=e=>{let[t,n]=e.split(`:`).map(Number);return t*60+n},c=e=>e?Math.max(1,Math.round(e/60)):1,l=(e,t)=>{let n=e?parseInt(String(e).split(`:`)[0],10):0,r=t?parseInt(String(t).split(`:`)[0],10):23;return Array.from({length:r-n+1},(e,t)=>t+n)},u=e=>{let t=c(e);return Array.from({length:Math.floor(60/t)},(e,n)=>n*t)},d=(e,t,n,r)=>{let i=e===``?n===1?0:23:parseInt(e,10),a=t===``?n===1?0:Math.floor(59/r)*r:parseInt(t,10);return a+=n*r,a>59?(a=0,i=(i+1)%24):a<0&&(a=Math.floor(59/r)*r,i=(i-1+24)%24),{hours:String(i).padStart(2,`0`),minutes:String(a).padStart(2,`0`)}},f=class extends a.t{constructor(...e){super(...e),this.hiddenInputRef=i.t(),this.hoursInputRef=i.t(),this.minutesInputRef=i.t(),this.buttonRef=i.t(),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=>{this.contains(e.target)||this._closePopup()},this._handleComponentFocusIn=()=>{this._hasFocus||(this._hasFocus=!0,this.onFocus())},this._handleComponentFocusOut=e=>{this.contains(e.relatedTarget)||(this._hasFocus=!1,this.onBlur())},this._handleHoursKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t+1)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._hours===``?0:parseInt(this._hours,10);this._hours=String((t-1+24)%24).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowRight`:e.preventDefault(),this.minutesInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._hoursDigitCount=0,this._hoursFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._hoursDigitCount===0)this._hoursFirstDigit=t,this._hours=String(t).padStart(2,`0`),this._hoursDigitCount=1,this.onInput(),t>=3&&(this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.minutesInputRef.value?.focus());else{let e=this._hoursFirstDigit*10+t;this._hours=e<=23?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.onInput(),this.minutesInputRef.value?.focus()}}else e.preventDefault()}},this._handleHoursBlur=()=>{this._hours!==``&&(this._hours=String(parseInt(this._hours,10)).padStart(2,`0`)),this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._syncValueFromDisplay()},this._handleMinutesKeydown=e=>{let t=e.target;switch(e.key){case`ArrowUp`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t+this._minuteStep)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowDown`:{e.preventDefault();let t=this._minutes===``?0:parseInt(this._minutes,10);this._minutes=String((t-this._minuteStep+60)%60).padStart(2,`0`),this._syncValueFromDisplay(),this.onInput();break}case`ArrowLeft`:e.preventDefault(),this.hoursInputRef.value?.focus();break;case`Backspace`:case`Delete`:this._minutesDigitCount=0,this._minutesFirstDigit=-1;break;case`Tab`:break;case`Enter`:{e.preventDefault();let n=this.internals.form;n?n.requestSubmit():t.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();let t=parseInt(e.key,10);if(this._minutesDigitCount===0)this._minutesFirstDigit=t,this._minutes=String(t).padStart(2,`0`),this._minutesDigitCount=1,this.onInput(),t>=6&&(this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay());else{let e=this._minutesFirstDigit*10+t;this._minutes=e<=59?String(e).padStart(2,`0`):String(t).padStart(2,`0`),this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay(),this.onInput()}}else e.preventDefault()}},this._handleMinutesBlur=()=>{this._minutes!==``&&(this._minutes=String(parseInt(this._minutes,10)).padStart(2,`0`)),this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._syncValueFromDisplay()},this._handlePopupKeydown=e=>{let t=document.activeElement,n=t.closest(`.pkt-timepicker-popup__col`);if(!n)return;let r=Array.from(n.querySelectorAll(`.pkt-timepicker-popup__option`)),i=r.indexOf(t),a=t.dataset.type??``;switch(e.key){case`ArrowDown`:e.preventDefault(),this._focusOptionAndSync(r[Math.min(i+1,r.length-1)],a);break;case`ArrowUp`:e.preventDefault(),this._focusOptionAndSync(r[Math.max(i-1,0)],a);break;case`Home`:e.preventDefault(),this._focusOptionAndSync(r[0],a);break;case`End`:e.preventDefault(),this._focusOptionAndSync(r[r.length-1],a);break;case`ArrowRight`:e.preventDefault(),a===`hour`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`minute`)}));break;case`ArrowLeft`:e.preventDefault(),a===`minute`&&(this._focusOptionAndSync(t,a),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)}));break;case`Enter`:case` `:e.preventDefault(),t.click();break;case`Escape`:e.preventDefault(),this._closePopup(),this.buttonRef.value?.focus();break}}}get inputRef(){return this.hiddenInputRef}manageValidity(t){let n=this.hoursInputRef.value;if(!n)return;if(this.required&&!this.value){this.internals.setValidity({valueMissing:!0},e.r.forms.messages.required,n),this._setAriaInvalid(!0);return}if(!this.value){this.internals.setValidity({}),this._setAriaInvalid(!1);return}let r=s(this.value),i=c(this.step);if(this.min&&r<s(String(this.min))){this.internals.setValidity({rangeUnderflow:!0},e.r.forms.messages.rangeUnderflowMin.replace(`{min}`,String(this.min)),n),this._setAriaInvalid(!0);return}if(this.max&&r>s(String(this.max))){this.internals.setValidity({rangeOverflow:!0},e.r.forms.messages.rangeOverflowMax.replace(`{max}`,String(this.max)),n),this._setAriaInvalid(!0);return}if(this.step&&r%i!==0){let t=i===60?e.r.forms.messages.timeStepMismatchHour:i===30?e.r.forms.messages.timeStepMismatchHalfHour:e.r.forms.messages.timeStepMismatch.replace(`{step}`,`${i}, ${i*2}, ${i*3}`);this.internals.setValidity({stepMismatch:!0},t,n),this._setAriaInvalid(!0);return}this.internals.setValidity({}),this._setAriaInvalid(!1)}_setAriaInvalid(e){if(!this.touched&&e)return;let t=this.hoursInputRef.value,n=this.minutesInputRef.value;e?(t?.setAttribute(`aria-invalid`,`true`),n?.setAttribute(`aria-invalid`,`true`)):(t?.removeAttribute(`aria-invalid`),n?.removeAttribute(`aria-invalid`))}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,this._handleComponentFocusIn),this.addEventListener(`focusout`,this._handleComponentFocusOut),document.addEventListener(`click`,this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`focusin`,this._handleComponentFocusIn),this.removeEventListener(`focusout`,this._handleComponentFocusOut),document.removeEventListener(`click`,this._outsideClickHandler)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&this._syncDisplayFromValue()}updated(e){super.updated(e),this.classList.toggle(`pkt-timepicker--stepper`,this.stepArrows),this.classList.toggle(`pkt-timepicker--fullwidth`,this.fullwidth),e.has(`step`)&&this.step!==null&&!this._isValidStep(this.step)&&console.warn(`pkt-timepicker: step="${this.step}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)}formResetCallback(){super.formResetCallback(),this._hours=``,this._minutes=``,this._isOpen=!1}_isValidStep(e){return e===3600||e<3600&&3600%e==0&&e%60==0}_syncDisplayFromValue(){let e=o(this.value)?this.value.split(`:`):null;e?(this._hours=e[0],this._minutes=e[1]):(this._hours=``,this._minutes=``)}_syncValueFromDisplay(){if(this._hours!==``&&this._minutes!==``){let e=`${this._hours}:${this._minutes}`;e!==this.value&&(this.value=e,this.onChange(e))}else this.value!==``&&(this.value=``,this.onChange(``))}get _minuteStep(){return c(this.step)}get _hourOptions(){return l(this.min,this.max)}get _minuteOptions(){return u(this.step)}_openPopup(){this._isOpen=!0,this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst(`hour`)})}_closePopup(){this._isOpen=!1,this._syncValueFromDisplay()}_togglePopup(){this._isOpen?this._closePopup():this._openPopup()}_scrollToSelected(){let e=this.querySelector(`.pkt-timepicker-popup`);e&&e.querySelectorAll(`.pkt-timepicker-popup__col`).forEach(e=>{let t=e.querySelector(`.pkt-timepicker-popup__option--selected`);t&&t.scrollIntoView({block:`center`})})}_focusSelectedOrFirst(e){let t=this.querySelector(`.pkt-timepicker-popup`);if(!t)return;let n=t.querySelectorAll(`.pkt-timepicker-popup__col`),r=e===`hour`?n[0]:n[1];if(!r)return;let i=r.querySelector(`.pkt-timepicker-popup__option--selected`),a=r.querySelector(`.pkt-timepicker-popup__option`);(i||a)?.focus()}_handleOptionClick(e,t){let n=String(e).padStart(2,`0`);t===`hour`?(this._hours=n,this.updateComplete.then(()=>this._focusSelectedOrFirst(`minute`))):(this._minutes=n,this._closePopup(),this.buttonRef.value?.focus())}_focusOptionAndSync(e,t){if(!e)return;let n=parseInt(e.dataset.value??`0`,10);t===`hour`?this._hours=String(n).padStart(2,`0`):this._minutes=String(n).padStart(2,`0`),e.focus()}_stepTime(e){let t=d(this._hours,this._minutes,e,this._minuteStep);this._hours=t.hours,this._minutes=t.minutes,this._syncValueFromDisplay()}_renderOption(n,r){let i=String(n).padStart(2,`0`),a=n===(r===`hour`?this._hours===``?NaN:parseInt(this._hours,10):this._minutes===``?NaN:parseInt(this._minutes,10));return e.p`
|
|
2
2
|
<button
|
|
3
3
|
class=${t.t({"pkt-btn":!0,"pkt-btn--tertiary":!0,"pkt-btn--small":!0,"pkt-btn--label-only":!0,"pkt-timepicker-popup__option":!0,"pkt-timepicker-popup__option--selected":a})}
|
|
4
4
|
type="button"
|
|
@@ -188,4 +188,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
|
|
|
188
188
|
</div>
|
|
189
189
|
`:this._renderContainer()}
|
|
190
190
|
</pkt-input-wrapper>
|
|
191
|
-
`}};e.n([e.o({type:String,reflect:!0})],f.prototype,`value`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`hide-picker`})],f.prototype,`hidePicker`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`step-arrows`})],f.prototype,`stepArrows`,void 0),e.n([e.a()],f.prototype,`_hours`,void 0),e.n([e.a()],f.prototype,`_minutes`,void 0),e.n([e.a()],f.prototype,`_isOpen`,void 0);try{e.s(`pkt-timepicker`)(f)}catch{console.warn(`Forsøker å definere <pkt-timepicker>, men den er allerede definert`)}Object.defineProperty(exports
|
|
191
|
+
`}};e.n([e.o({type:String,reflect:!0})],f.prototype,`value`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`hide-picker`})],f.prototype,`hidePicker`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`step-arrows`})],f.prototype,`stepArrows`,void 0),e.n([e.a()],f.prototype,`_hours`,void 0),e.n([e.a()],f.prototype,`_minutes`,void 0),e.n([e.a()],f.prototype,`_isOpen`,void 0);try{e.s(`pkt-timepicker`)(f)}catch{console.warn(`Forsøker å definere <pkt-timepicker>, men den er allerede definert`)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),t=e=>new Promise(t=>setTimeout(t,e)),n=()=>{let t=e(),n=e();return t.slice(0,8)+`-`+t.slice(8,12)+`-4`+t.slice(13)+`-a`+n.slice(1,4)+`-`+n.slice(4)};Object.defineProperty(exports
|
|
1
|
+
var e=()=>(`00000000000000000`+(Math.random()*0x10000000000000000).toString(16)).slice(-16),t=e=>new Promise(t=>setTimeout(t,e)),n=()=>{let t=e(),n=e();return t.slice(0,8)+`-`+t.slice(8,12)+`-4`+t.slice(13)+`-a`+n.slice(1,4)+`-`+n.slice(4)};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.26.2",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -27,37 +27,38 @@
|
|
|
27
27
|
"type-check": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@lit-labs/router": "^0.1.
|
|
30
|
+
"@lit-labs/router": "^0.1.4",
|
|
31
31
|
"@lit/context": "^1.1.6",
|
|
32
|
-
"@types/node": "^
|
|
32
|
+
"@types/node": "^25.9.3",
|
|
33
33
|
"dialog-polyfill": "^0.5.6",
|
|
34
|
-
"lit": "^3.3.
|
|
35
|
-
"urlpattern-polyfill": "^10.
|
|
36
|
-
"whatwg-fetch": "^3.6.
|
|
34
|
+
"lit": "^3.3.3",
|
|
35
|
+
"urlpattern-polyfill": "^10.1.0",
|
|
36
|
+
"whatwg-fetch": "^3.6.20"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/plugin-transform-class-properties": "^7.
|
|
40
|
-
"@babel/plugin-transform-private-methods": "^7.
|
|
41
|
-
"@babel/plugin-transform-private-property-in-object": "^7.
|
|
39
|
+
"@babel/plugin-transform-class-properties": "^7.28.3",
|
|
40
|
+
"@babel/plugin-transform-private-methods": "^7.28.3",
|
|
41
|
+
"@babel/plugin-transform-private-property-in-object": "^7.27.1",
|
|
42
42
|
"@babel/preset-env": "^7.28.3",
|
|
43
|
-
"@babel/preset-typescript": "^7.
|
|
44
|
-
"@oslokommune/punkt-assets": "^16.
|
|
45
|
-
"@testing-library/dom": "^10.4.
|
|
46
|
-
"@testing-library/jest-dom": "^6.
|
|
47
|
-
"@
|
|
48
|
-
"@typescript-eslint/
|
|
49
|
-
"@
|
|
50
|
-
"
|
|
51
|
-
"eslint
|
|
52
|
-
"eslint-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"vite
|
|
43
|
+
"@babel/preset-typescript": "^7.28.3",
|
|
44
|
+
"@oslokommune/punkt-assets": "^16.26.2",
|
|
45
|
+
"@testing-library/dom": "^10.4.1",
|
|
46
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
47
|
+
"@types/jest-axe": "^3.5.9",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
49
|
+
"@typescript-eslint/parser": "^8.61.1",
|
|
50
|
+
"@vitest/ui": "^4.1.9",
|
|
51
|
+
"eslint": "^10.5.0",
|
|
52
|
+
"eslint-config-prettier": "^10.1.8",
|
|
53
|
+
"eslint-plugin-lit": "^2.3.1",
|
|
54
|
+
"jest-axe": "^10.0.0",
|
|
55
|
+
"jsdom": "^29.1.1",
|
|
56
|
+
"sass": "^1.101.0",
|
|
57
|
+
"typescript": "^6.0.3",
|
|
58
|
+
"vite": "^8.0.16",
|
|
59
|
+
"vite-plugin-dts": "^5.0.2",
|
|
59
60
|
"vite-plugin-web-components-hmr": "^0.1.3",
|
|
60
|
-
"vitest": "^4.1.
|
|
61
|
+
"vitest": "^4.1.9"
|
|
61
62
|
},
|
|
62
63
|
"private": false,
|
|
63
64
|
"publishConfig": {
|
|
@@ -79,5 +80,5 @@
|
|
|
79
80
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
80
81
|
},
|
|
81
82
|
"license": "MIT",
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "b667fcd160da4b1c4e556fdd0bb23d50cc433827"
|
|
83
84
|
}
|
|
@@ -9,9 +9,12 @@ import { ifDefined } from 'lit/directives/if-defined.js'
|
|
|
9
9
|
|
|
10
10
|
import '@/components/icon'
|
|
11
11
|
|
|
12
|
+
const defaultAnimationPath = 'https://punkt-cdn.oslo.kommune.no/latest/animations/'
|
|
13
|
+
|
|
12
14
|
// Allow global override of animation assets path
|
|
13
|
-
window
|
|
14
|
-
window.pktAnimationPath ||
|
|
15
|
+
if (typeof window !== 'undefined') {
|
|
16
|
+
window.pktAnimationPath = window.pktAnimationPath || defaultAnimationPath
|
|
17
|
+
}
|
|
15
18
|
export type TPktButtonMode = 'light' | 'dark'
|
|
16
19
|
export type TPktButtonSize = 'small' | 'medium' | 'large'
|
|
17
20
|
export type TPktButtonColor =
|
|
@@ -75,7 +78,8 @@ export class PktButton extends PktElementWithSlot<IPktButton> implements IPktBut
|
|
|
75
78
|
@property({ type: String }) form: string | undefined = undefined
|
|
76
79
|
@property({ type: Boolean, reflect: true }) isLoading: Booleanish = false
|
|
77
80
|
@property({ type: Boolean, reflect: true }) disabled: Booleanish = false
|
|
78
|
-
@property({ type: String }) loadingAnimationPath: string | undefined =
|
|
81
|
+
@property({ type: String }) loadingAnimationPath: string | undefined =
|
|
82
|
+
typeof window !== 'undefined' ? window.pktAnimationPath : defaultAnimationPath
|
|
79
83
|
|
|
80
84
|
// Lifecycle
|
|
81
85
|
|
|
@@ -35,6 +35,7 @@ export class PktHeader extends PktElementWithSlot<IPktHeader> implements IPktHea
|
|
|
35
35
|
@property({ type: String, attribute: 'service-name' }) serviceName?: string
|
|
36
36
|
@property({ type: String, attribute: 'service-link' }) serviceLink?: string
|
|
37
37
|
@property({ type: String, attribute: 'logo-link' }) logoLink?: string
|
|
38
|
+
@property({ type: String, attribute: 'logo-path' }) logoPath?: string
|
|
38
39
|
@property({ type: String, attribute: 'search-placeholder' }) searchPlaceholder = 'Søk'
|
|
39
40
|
@property({ type: String, attribute: 'search-value' }) searchValue = ''
|
|
40
41
|
@property({ type: Number, attribute: 'mobile-breakpoint' }) mobileBreakpoint: number = 768
|
|
@@ -107,6 +108,7 @@ export class PktHeader extends PktElementWithSlot<IPktHeader> implements IPktHea
|
|
|
107
108
|
service-name=${ifDefined(this.serviceName)}
|
|
108
109
|
service-link=${ifDefined(this.serviceLink)}
|
|
109
110
|
logo-link=${ifDefined(this.logoLink)}
|
|
111
|
+
logo-path=${ifDefined(this.logoPath)}
|
|
110
112
|
search-placeholder=${this.searchPlaceholder}
|
|
111
113
|
search-value=${this.searchValue}
|
|
112
114
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
@@ -6,9 +6,12 @@ import { slotContent } from '@/directives/slot-content'
|
|
|
6
6
|
import { TPktSize } from '@/types/size'
|
|
7
7
|
import '@/components/icon'
|
|
8
8
|
|
|
9
|
+
const defaultAnimationPath = 'https://punkt-cdn.oslo.kommune.no/latest/animations/'
|
|
10
|
+
|
|
9
11
|
// Allow global override of animation assets path
|
|
10
|
-
window
|
|
11
|
-
window.pktAnimationPath ||
|
|
12
|
+
if (typeof window !== 'undefined') {
|
|
13
|
+
window.pktAnimationPath = window.pktAnimationPath || defaultAnimationPath
|
|
14
|
+
}
|
|
12
15
|
|
|
13
16
|
export type TPktLoaderVariant = 'blue' | 'rainbow' | 'shapes'
|
|
14
17
|
|
|
@@ -54,7 +57,8 @@ export class PktLoader extends PktElementWithSlot implements IPktLoader {
|
|
|
54
57
|
@property({ type: String }) message: string | null = null
|
|
55
58
|
@property({ type: String }) size: TPktSize = 'medium'
|
|
56
59
|
@property({ type: String }) variant: TPktLoaderVariant = 'shapes'
|
|
57
|
-
@property({ type: String }) loadingAnimationPath: string | undefined =
|
|
60
|
+
@property({ type: String }) loadingAnimationPath: string | undefined =
|
|
61
|
+
typeof window !== 'undefined' ? window.pktAnimationPath : defaultAnimationPath
|
|
58
62
|
|
|
59
63
|
@state() private _shouldDisplayLoader: boolean = false
|
|
60
64
|
|