@oslokommune/punkt-elements 17.0.9 → 17.1.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 +36 -0
- package/dist/{accordion-CbXDxOho.cjs → accordion-B3GBlvUC.cjs} +2 -2
- package/dist/{accordion-DEUHQ4JD.js → accordion-BeLvLPrB.js} +12 -11
- package/dist/{alert-CkUnbPdA.cjs → alert-Cs4Rmq_J.cjs} +1 -1
- package/dist/{alert-CbtVGrHD.js → alert-DKK_Tb9J.js} +5 -5
- package/dist/{async-directive-Cw_7VW_-.js → async-directive-BPf6K-V2.js} +9 -6
- package/dist/async-directive-Da7TJpnq.cjs +1 -0
- package/dist/{backlink-DDGlLzk9.cjs → backlink-CMmrKTe4.cjs} +1 -1
- package/dist/{backlink-wMNLuQ0X.js → backlink-D1y26pj3.js} +3 -3
- package/dist/base-elements/input-element.d.ts +9 -4
- package/dist/booleanish-BF8l4scU.cjs +1 -0
- package/dist/{booleanish-MfutDT_4.js → booleanish-OQJTYSrw.js} +8 -1
- package/dist/{breadcrumbs-D3tfWqvC.cjs → breadcrumbs-B6JGhJgC.cjs} +1 -1
- package/dist/{breadcrumbs-CVTLNNsL.js → breadcrumbs-CcTQ3Grm.js} +2 -2
- package/dist/{button-Cod17rKo.js → button-2-OSPJkj.js} +10 -10
- package/dist/{button-gvDXtBMC.cjs → button-CE97NQIk.cjs} +2 -2
- package/dist/{calendar-BVXW8DqC.cjs → calendar-kn4SrtJy.cjs} +1 -1
- package/dist/{calendar-CjC4qlh6.js → calendar-pOW3R5Pw.js} +4 -4
- package/dist/{card-sydjK3Bb.cjs → card-CETDFkxR.cjs} +3 -3
- package/dist/{card-sDOe54um.js → card-zQ0eKRMV.js} +9 -8
- package/dist/{checkbox-DJDphhqz.js → checkbox-CH7NpINF.js} +12 -12
- package/dist/{checkbox-8uxbeU30.cjs → checkbox-CQNr_sEg.cjs} +8 -8
- package/dist/{class-map-CCZN5uS3.cjs → class-map-BeimMvPv.cjs} +1 -1
- package/dist/{class-map-CAQCRB1W.js → class-map-CnWCnBSX.js} +2 -2
- package/dist/combobox-Bvg0UO9w.cjs +139 -0
- package/dist/{combobox-CzZIf5hd.js → combobox-CRdYYlxu.js} +68 -37
- 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-utils.d.ts +2 -2
- package/dist/components/datepicker/datepicker.d.ts +5 -5
- package/dist/components/fileupload/fileupload-base.d.ts +1 -1
- package/dist/components/fileupload/fileupload-renderers.d.ts +2 -2
- package/dist/components/fileupload/fileupload.d.ts +3 -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/input-wrapper/tri-state.test.d.ts +0 -0
- package/dist/components/input-wrapper/wrapper-parity.test.d.ts +1 -0
- 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/select/select.test.d.ts +2 -2
- 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 +3 -2
- package/dist/components/textarea/textarea.test.d.ts +2 -2
- package/dist/components/textinput/textinput.d.ts +1 -1
- package/dist/components/textinput/textinput.test.d.ts +2 -2
- package/dist/components/timepicker/timepicker.d.ts +1 -1
- package/dist/{consent--Nw43WFU.cjs → consent-CyY3RyoC.cjs} +1 -1
- package/dist/{consent-B2hSTCGC.js → consent-DZEkhgJ1.js} +2 -2
- package/dist/{consume-BiOhrhEy.js → consume-BDnMAp2g.js} +6 -6
- package/dist/{consume-DKf5SmP9.cjs → consume-Le4HztPo.cjs} +1 -1
- package/dist/converters-BJ9Fe0kW.cjs +1 -0
- package/dist/{converters-BBfsEJV5.js → converters-CkjLSYpa.js} +200 -202
- package/dist/{datepicker-BMuplkDE.js → datepicker-ButIas85.js} +46 -22
- package/dist/{datepicker-DrB54Rhc.cjs → datepicker-VTqSDQk5.cjs} +7 -8
- package/dist/dialog-polyfill.esm-B-g35ove.cjs +1 -0
- package/dist/{dialog-polyfill.esm-ChZRzCVh.js → dialog-polyfill.esm-DHSvqor8.js} +2 -2
- package/dist/{directive-helpers-BshFvt7A.cjs → directive-helpers-BlAV5EQD.cjs} +1 -1
- package/dist/{directive-helpers-DIF5DwN4.js → directive-helpers-CI8YZqku.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 +1 -1
- package/dist/docs/components/fileupload.d.ts +1 -1
- package/dist/docs/components/footer.d.ts +1 -1
- package/dist/docs/components/form-sizes.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-global-full.d.ts +1 -1
- package/dist/docs/components/header-global.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/components/verifisering.d.ts +15 -0
- package/dist/docs/header.d.ts +1 -1
- package/dist/docs/punkt-docs.d.ts +1 -1
- package/dist/element-BA8v6S7z.cjs +2 -0
- package/dist/{element-BoJrqauR.js → element-ChsFgr_B.js} +19 -16
- package/dist/{element-with-slot-BY7Jc-q8.cjs → element-with-slot-Bj7nm7fO.cjs} +1 -1
- package/dist/{element-with-slot-mXLg8gg8.js → element-with-slot-BvG9ctC-.js} +2 -2
- package/dist/fetch-header-footer-data-CUKV0biS.cjs +1 -0
- package/dist/{fileupload-CGKUJrlj.cjs → fileupload-BeWiTAoW.cjs} +8 -8
- package/dist/{fileupload-D4gQN64T.js → fileupload-D5IQ9HDe.js} +25 -20
- package/dist/{footer-Ber-jqM1.cjs → footer-DbYQUYNR.cjs} +1 -1
- package/dist/{footer-BIrJeRuZ.js → footer-DrR64HiK.js} +6 -6
- package/dist/{header-BFk1an4z.cjs → header-ClgIac6n.cjs} +12 -12
- package/dist/{header-Deg_LGJo.js → header-KvJ1mGwA.js} +48 -38
- package/dist/{header-menu-BHqK4QA6.cjs → header-menu-BAsUNKSx.cjs} +3 -3
- package/dist/{header-menu-GFtJKM4j.js → header-menu-hVPXsb8g.js} +10 -8
- package/dist/{heading-DyJpBFT2.cjs → heading-CFmiSuCQ.cjs} +1 -1
- package/dist/{heading-CD0PhL8g.js → heading-g-_IUB5T.js} +2 -2
- package/dist/{helptext-Cq5rNaAC.cjs → helptext-CTtKJcML.cjs} +4 -1
- package/dist/{helptext-C_brWCIT.js → helptext-DZng1D5i.js} +18 -14
- package/dist/{icon-B8PVq2O6.cjs → icon-9iwd2F2l.cjs} +1 -1
- package/dist/{icon-DGFEIlco.js → icon-D-LA22xD.js} +2 -2
- package/dist/if-defined-B89_ZeCj.cjs +1 -0
- package/dist/if-defined-CGzIlZ9-.js +5 -0
- package/dist/{input-element-C0RnXi-J.js → input-element-DBMNBplu.js} +155 -129
- package/dist/{input-element-B0qLbEdF.cjs → input-element-DYmQw-fH.cjs} +1 -1
- package/dist/input-wrapper-BmxNvznr.js +128 -0
- package/dist/{input-wrapper-BweP6t3O.js → input-wrapper-D-fPaTbY.js} +2 -2
- package/dist/{input-wrapper-wh3fWIhk.cjs → input-wrapper-D5PR0rJn.cjs} +1 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +54 -0
- package/dist/{link-FmkQvSQL.js → link-D-Eqm5KH.js} +8 -7
- package/dist/{link-Geze7498.cjs → link-DK7gvmnj.cjs} +2 -2
- package/dist/{linkcard-6LCXRTR-.cjs → linkcard-B29cmZqh.cjs} +1 -1
- package/dist/{linkcard-BKdT0zU_.js → linkcard-zqbg7Oqm.js} +4 -4
- package/dist/{listbox-89wMuQVK.cjs → listbox-Dc4rGdPi.cjs} +2 -2
- package/dist/{listbox-LdyWPu7W.js → listbox-va_E8afs.js} +6 -10
- package/dist/{loader-CgW4Vst3.cjs → loader-CMUkVJmE.cjs} +1 -1
- package/dist/{loader-BA-i8CaQ.js → loader-D_RDICnw.js} +4 -4
- package/dist/{messagebox-VD5oEZ19.cjs → messagebox-Cv8LaSxv.cjs} +1 -1
- package/dist/{messagebox-fiaAyHLG.js → messagebox-Cw-OWDya.js} +7 -6
- package/dist/{modal-CPnFteYS.cjs → modal-BtInv031.cjs} +1 -1
- package/dist/{modal-xNK_wpHk.js → modal-D0t_X2dX.js} +6 -6
- 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-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +34 -34
- 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-DMxYwnnj.js → pkt-options-controller-B77vH3PE.js} +1 -1
- package/dist/{pkt-options-controller-CPrfqepu.cjs → pkt-options-controller-C5EBX2T0.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-mtjtbpCO.js → progressbar-CbcfLerF.js} +6 -6
- package/dist/progressbar-D5MmnQId.cjs +17 -0
- package/dist/{radiobutton-C6htwDrT.js → radiobutton-BUnf3EPi.js} +8 -8
- package/dist/{radiobutton-DjWBoSHv.cjs → radiobutton-DpsO1F-8.cjs} +4 -4
- package/dist/ref-CQoEIIp0.cjs +1 -0
- package/dist/{ref-WGS0u7i2.js → ref-CWD6PjVd.js} +9 -7
- package/dist/{repeat-BH0cL82q.js → repeat-C02g7d5S.js} +13 -12
- package/dist/{repeat-DRnLAg0O.cjs → repeat-sY6B7fAT.cjs} +1 -1
- package/dist/{searchinput-DGjeN1YI.cjs → searchinput-Bh975rjX.cjs} +1 -1
- package/dist/{searchinput-CfUVfpqL.js → searchinput-DwnjsvJ1.js} +4 -4
- package/dist/select-BOJi6H6T.cjs +49 -0
- package/dist/{select-CsBXXbLP.js → select-DMre80qs.js} +24 -20
- package/dist/shared-types/booleanish.d.ts +11 -0
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-utils/date-utils.d.ts +16 -16
- package/dist/shared-utils/datepicker-utils.d.ts +11 -11
- package/dist/shared-utils/device-utils.d.ts +1 -1
- package/dist/shared-utils/forms/described-by.d.ts +24 -0
- package/dist/shared-utils/utils.d.ts +2 -2
- package/dist/shared-utils/value-utils.d.ts +2 -2
- package/dist/{tabs-q62MK_-r.cjs → tabs-Cf9ai0FD.cjs} +2 -2
- package/dist/{tabs-BqrKLCjd.js → tabs-TvxgbrCF.js} +7 -7
- package/dist/{tag-XE-VRxT2.cjs → tag-CzojNU7z.cjs} +1 -1
- package/dist/{tag-BTiTXyf5.js → tag-Ds6n1LIs.js} +5 -5
- package/dist/textarea-BydiLM9Z.cjs +49 -0
- package/dist/{textarea-Cm392CEI.js → textarea-vfzIcXhX.js} +36 -29
- package/dist/{textinput-TSPcBcih.js → textinput-CMP2jPP_.js} +30 -25
- package/dist/{textinput-DqJbTglM.cjs → textinput-DGdicNSx.cjs} +10 -10
- package/dist/{timepicker-DWbgTDKq.js → timepicker-ClwgYywH.js} +19 -14
- package/dist/{timepicker-CqFYMV8q.cjs → timepicker-DYrnLHqN.cjs} +5 -2
- package/dist/translations/no.json.d.ts +2 -1
- package/package.json +7 -4
- package/src/components/combobox/combobox.core.test.ts +2 -2
- package/src/components/combobox/combobox.ts +7 -1
- package/src/components/datepicker/datepicker-single.ts +1 -1
- package/src/components/datepicker/datepicker.ts +5 -3
- package/src/components/fileupload/fileupload.ts +6 -1
- package/src/components/helptext/helptext.ts +3 -0
- package/src/components/input-wrapper/input-wrapper.test.ts +3 -3
- package/src/components/input-wrapper/input-wrapper.ts +31 -29
- package/src/components/input-wrapper/tri-state.test.ts +91 -0
- package/src/components/input-wrapper/wrapper-parity.test.ts +141 -0
- package/src/components/select/select.test.ts +8 -7
- package/src/components/select/select.ts +13 -5
- package/src/components/textarea/textarea.test.ts +6 -6
- package/src/components/textarea/textarea.ts +20 -11
- package/src/components/textinput/textinput.test.ts +6 -6
- package/src/components/textinput/textinput.ts +17 -11
- package/src/components/timepicker/timepicker.ts +12 -5
- package/dist/async-directive-HLXOyE4A.cjs +0 -1
- package/dist/booleanish-B9Kf0nES.cjs +0 -1
- package/dist/combobox-BH9lym0-.cjs +0 -136
- package/dist/converters-Cd0fPEly.cjs +0 -1
- package/dist/dialog-polyfill.esm-J-GKtwrS.cjs +0 -1
- package/dist/element-DJzurxgt.cjs +0 -2
- package/dist/fetch-header-footer-data-xohWFmYC.cjs +0 -1
- package/dist/if-defined-D0bnetLJ.js +0 -5
- package/dist/if-defined-DrwbxQOj.cjs +0 -1
- package/dist/input-wrapper-DPkkiG7S.cjs +0 -57
- package/dist/input-wrapper-fWV5P4MN.js +0 -126
- package/dist/progressbar-BN5y20CC.cjs +0 -17
- package/dist/ref-DO7TzO4O.cjs +0 -1
- package/dist/select-CZvAW7W2.cjs +0 -50
- package/dist/textarea-sTcZxOIB.cjs +0 -47
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),n=require("./ref-CQoEIIp0.cjs"),r=require("./input-element-DYmQw-fH.cjs");var i=class extends r.t{constructor(...e){super(...e),this.inputRef=n.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type=`radio`,this.tagText=null,this.optionalTag=!1,this.optionalText=`Valgfritt`,this.requiredTag=!1,this.requiredText=`Må fylles ut`,this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`defaultChecked`&&(this._checked=this.defaultChecked),e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let r=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),i=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),o=`pkt-tag pkt-tag--small pkt-tag--thin-text`;return e.p`
|
|
2
2
|
<div class="pkt-input-check">
|
|
3
3
|
<div class=${r}>
|
|
4
4
|
<input
|
|
@@ -19,9 +19,9 @@ const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs"),
|
|
|
19
19
|
${e.p`
|
|
20
20
|
<label class=${a} for=${this.id+`-internal`}>
|
|
21
21
|
${this.label} ${e.p`
|
|
22
|
-
${this.tagText?e.p`<span class=${
|
|
23
|
-
${this.optionalTag?e.p`<span class=${
|
|
24
|
-
${this.requiredTag?e.p`<span class=${
|
|
22
|
+
${this.tagText?e.p`<span class=${o+` pkt-tag--gray`}>${this.tagText}</span>`:e.d}
|
|
23
|
+
${this.optionalTag?e.p`<span class=${o+` pkt-tag--blue-light`}>${this.optionalText}</span>`:e.d}
|
|
24
|
+
${this.requiredTag?e.p`<span class=${o+` pkt-tag--beige`}>${this.requiredText}</span>`:e.d}
|
|
25
25
|
`}
|
|
26
26
|
${this.checkHelptext?e.p`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.d}
|
|
27
27
|
</label>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./async-directive-Da7TJpnq.cjs");var n=()=>new r,r=class{},i=new WeakMap,a=e.c(class extends t.t{render(t){return e.d}update(t,[n]){let r=n!==this.G;return r&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.d}rt(e){if(this.G!==void 0){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=i.get(t);n===void 0&&(n=new WeakMap,i.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}}get lt(){return typeof this.G==`function`?i.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as e, d as t } from "./element-
|
|
2
|
-
import { t as n } from "./async-directive-
|
|
3
|
-
//#region node_modules/lit
|
|
1
|
+
import { c as e, d as t } from "./element-ChsFgr_B.js";
|
|
2
|
+
import { t as n } from "./async-directive-BPf6K-V2.js";
|
|
3
|
+
//#region ../../node_modules/lit-html/directives/ref.js
|
|
4
4
|
var r = () => new i(), i = class {}, a = /* @__PURE__ */ new WeakMap(), o = e(class extends n {
|
|
5
5
|
render(e) {
|
|
6
6
|
return t;
|
|
@@ -10,10 +10,12 @@ var r = () => new i(), i = class {}, a = /* @__PURE__ */ new WeakMap(), o = e(cl
|
|
|
10
10
|
return r && this.rt(void 0), (r || this.lt !== this.ct) && (this.G = n, this.ht = e.options?.host, this.rt(this.ct = e.element)), t;
|
|
11
11
|
}
|
|
12
12
|
rt(e) {
|
|
13
|
-
if (this.G !== void 0)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
if (this.G !== void 0) {
|
|
14
|
+
if (this.isConnected || (e = void 0), typeof this.G == "function") {
|
|
15
|
+
let t = this.ht ?? globalThis, n = a.get(t);
|
|
16
|
+
n === void 0 && (n = /* @__PURE__ */ new WeakMap(), a.set(t, n)), n.get(this.G) !== void 0 && this.G.call(this.ht, void 0), n.set(this.G, e), e !== void 0 && this.G.call(this.ht, e);
|
|
17
|
+
} else this.G.value = e;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
get lt() {
|
|
19
21
|
return typeof this.G == "function" ? a.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
@@ -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 node_modules/lit
|
|
1
|
+
import { c as e, f as t, l as n, u as r } from "./element-ChsFgr_B.js";
|
|
2
|
+
import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-CI8YZqku.js";
|
|
3
|
+
//#region ../../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);
|
|
@@ -32,15 +32,16 @@ var l = (e, t, n) => {
|
|
|
32
32
|
else if (m[y] === p[x]) h[x] = i(d[y], f[x]), y--, x--;
|
|
33
33
|
else if (m[v] === p[x]) h[x] = i(d[v], f[x]), o(e, h[x + 1], d[v]), v++, x--;
|
|
34
34
|
else if (m[y] === p[b]) h[b] = i(d[y], f[b]), o(e, d[v], d[y]), y--, b++;
|
|
35
|
-
else if (g === void 0 && (g = l(p, b, x), _ = l(m, v, y)), g.has(m[v]))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
else if (g === void 0 && (g = l(p, b, x), _ = l(m, v, y)), g.has(m[v])) {
|
|
36
|
+
if (g.has(m[y])) {
|
|
37
|
+
let t = _.get(p[b]), n = t === void 0 ? null : d[t];
|
|
38
|
+
if (n === null) {
|
|
39
|
+
let t = o(e, d[v]);
|
|
40
|
+
i(t, f[b]), h[b] = t;
|
|
41
|
+
} else h[b] = i(n, f[b]), o(e, d[v], n), d[t] = null;
|
|
42
|
+
b++;
|
|
43
|
+
} else a(d[y]), y--;
|
|
44
|
+
} else a(d[v]), v++;
|
|
44
45
|
for (; b <= x;) {
|
|
45
46
|
let t = o(e, h[x + 1]);
|
|
46
47
|
i(t, f[b]), h[b++] = t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./directive-helpers-BlAV5EQD.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,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs");require("./icon-9iwd2F2l.cjs");const n=require("./if-defined-B89_ZeCj.cjs"),r=require("./focus-modality-controller-C1ocyv2J.cjs");var i=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=``,this.placeholder=`Søk…`,this.value=``,this.focusModality=new r.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}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`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import "./icon-
|
|
4
|
-
import { t as c } from "./if-defined-
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-ChsFgr_B.js";
|
|
2
|
+
import { t as s } from "./class-map-CnWCnBSX.js";
|
|
3
|
+
import "./icon-D-LA22xD.js";
|
|
4
|
+
import { t as c } from "./if-defined-CGzIlZ9-.js";
|
|
5
5
|
import { t as l } from "./focus-modality-controller-Dc2S-KqR.js";
|
|
6
6
|
//#region src/components/searchinput/searchinput.ts
|
|
7
7
|
var u = class extends o {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./element-with-slot-Bj7nm7fO.cjs"),n=require("./if-defined-B89_ZeCj.cjs"),r=require("./ref-CQoEIIp0.cjs"),i=require("./input-element-DYmQw-fH.cjs"),a=require("./pkt-options-controller-C5EBX2T0.cjs"),o=require("./input-wrapper-Q-B-aBeb.cjs");var s=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`})],s.prototype,`_optionsProp`,void 0),e.n([e.a()],s.prototype,`_options`,void 0);var c=class extends s{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.classList.add(`pkt-select`),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 pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e.p`
|
|
2
|
+
<pkt-input-wrapper
|
|
3
|
+
.size=${this.inputSize}
|
|
4
|
+
?disabled=${this.disabled}
|
|
5
|
+
?hasError=${this.hasError}
|
|
6
|
+
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
7
|
+
?inline=${this.inline}
|
|
8
|
+
?optionalTag=${this.optionalTag}
|
|
9
|
+
?requiredTag=${this.requiredTag}
|
|
10
|
+
useWrapper=${this.useWrapper}
|
|
11
|
+
.ariaDescribedby=${this.ariaDescribedby}
|
|
12
|
+
errorMessage=${n.t(this.errorMessage)}
|
|
13
|
+
forId=${this.id+`-input`}
|
|
14
|
+
helptext=${n.t(this.helptext)}
|
|
15
|
+
helptextDropdown=${n.t(this.helptextDropdown)}
|
|
16
|
+
helptextDropdownButton=${n.t(this.helptextDropdownButton)}
|
|
17
|
+
label=${n.t(this.label)}
|
|
18
|
+
optionalText=${n.t(this.optionalText)}
|
|
19
|
+
requiredText=${n.t(this.requiredText)}
|
|
20
|
+
tagText=${n.t(this.tagText)}
|
|
21
|
+
>
|
|
22
|
+
<select
|
|
23
|
+
class=${i}
|
|
24
|
+
aria-invalid=${this.hasError}
|
|
25
|
+
aria-errormessage=${n.t(this.hasError?`${this.id}-input-error`:void 0)}
|
|
26
|
+
aria-describedby=${n.t(o.r({id:this.id+`-input`,hasHelptext:!!this.helptext,hasCounter:!1,ariaDescribedby:this.ariaDescribedby}))}
|
|
27
|
+
aria-labelledby=${n.t(this.ariaLabelledby)}
|
|
28
|
+
?disabled=${this.disabled}
|
|
29
|
+
id=${this.id+`-input`}
|
|
30
|
+
name=${(this.name||this.id)+`-input`}
|
|
31
|
+
value=${this.value}
|
|
32
|
+
@change=${e=>{this.touched=!0,this.value=e.target.value,e.stopImmediatePropagation()}}
|
|
33
|
+
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
34
|
+
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
35
|
+
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
36
|
+
${r.n(this.inputRef)}
|
|
37
|
+
>
|
|
38
|
+
${this._options.length>0?this._options.map(t=>e.p`<option
|
|
39
|
+
value=${t.value}
|
|
40
|
+
?selected=${this.value==t.value||t.selected}
|
|
41
|
+
?disabled=${t.disabled}
|
|
42
|
+
?hidden=${t.hidden}
|
|
43
|
+
>
|
|
44
|
+
${t.label}
|
|
45
|
+
</option>`):``}
|
|
46
|
+
</select>
|
|
47
|
+
<div class="pkt-contents" slot="helptext">${t.n(this,`helptext`)}</div>
|
|
48
|
+
</pkt-input-wrapper>
|
|
49
|
+
`}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.o({type:String})],c.prototype,`value`,void 0);try{e.s(`pkt-select`)(c)}catch{console.warn(`Forsøker å definere <pkt-select>, 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,12 +1,12 @@
|
|
|
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-ChsFgr_B.js";
|
|
2
|
+
import { n as a } from "./element-with-slot-BvG9ctC-.js";
|
|
3
|
+
import { t as o } from "./if-defined-CGzIlZ9-.js";
|
|
4
|
+
import { n as s, t as c } from "./ref-CWD6PjVd.js";
|
|
5
|
+
import { t as l } from "./input-element-DBMNBplu.js";
|
|
6
|
+
import { t as u } from "./pkt-options-controller-B77vH3PE.js";
|
|
7
|
+
import { r as d } from "./input-wrapper-BmxNvznr.js";
|
|
8
8
|
//#region src/base-elements/options-input-element.ts
|
|
9
|
-
var
|
|
9
|
+
var f = class extends l {
|
|
10
10
|
constructor(...e) {
|
|
11
11
|
super(...e), this._optionsProp = [], this._options = [];
|
|
12
12
|
}
|
|
@@ -39,10 +39,10 @@ var d = class extends l {
|
|
|
39
39
|
t([n({
|
|
40
40
|
type: Array,
|
|
41
41
|
attribute: "options"
|
|
42
|
-
})],
|
|
42
|
+
})], f.prototype, "_optionsProp", void 0), t([e()], f.prototype, "_options", void 0);
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/components/select/select.ts
|
|
45
|
-
var
|
|
45
|
+
var p = class extends f {
|
|
46
46
|
constructor() {
|
|
47
47
|
super(), this.inputRef = c(), this.value = "", this.selectedIndex = -1, this.selectedOptions = void 0, this.optionsController = new u(this);
|
|
48
48
|
}
|
|
@@ -85,23 +85,21 @@ var f = class extends d {
|
|
|
85
85
|
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);
|
|
86
86
|
}
|
|
87
87
|
firstUpdated(e) {
|
|
88
|
-
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;
|
|
88
|
+
super.firstUpdated(e), this.classList.add("pkt-select"), 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;
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
91
91
|
let e = `pkt-input pkt-input--${this.inputSize} ${this.fullwidth ? "pkt-input--fullwidth" : ""}`;
|
|
92
92
|
return r`
|
|
93
93
|
<pkt-input-wrapper
|
|
94
94
|
.size=${this.inputSize}
|
|
95
|
-
?counter=${this.counter}
|
|
96
95
|
?disabled=${this.disabled}
|
|
97
96
|
?hasError=${this.hasError}
|
|
98
|
-
?hasFieldset=${this.
|
|
97
|
+
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
99
98
|
?inline=${this.inline}
|
|
100
99
|
?optionalTag=${this.optionalTag}
|
|
101
100
|
?requiredTag=${this.requiredTag}
|
|
102
101
|
useWrapper=${this.useWrapper}
|
|
103
|
-
|
|
104
|
-
class="pkt-select"
|
|
102
|
+
.ariaDescribedby=${this.ariaDescribedby}
|
|
105
103
|
errorMessage=${o(this.errorMessage)}
|
|
106
104
|
forId=${this.id + "-input"}
|
|
107
105
|
helptext=${o(this.helptext)}
|
|
@@ -115,7 +113,13 @@ var f = class extends d {
|
|
|
115
113
|
<select
|
|
116
114
|
class=${e}
|
|
117
115
|
aria-invalid=${this.hasError}
|
|
118
|
-
aria-errormessage=${`${this.id}-error`}
|
|
116
|
+
aria-errormessage=${o(this.hasError ? `${this.id}-input-error` : void 0)}
|
|
117
|
+
aria-describedby=${o(d({
|
|
118
|
+
id: this.id + "-input",
|
|
119
|
+
hasHelptext: !!this.helptext,
|
|
120
|
+
hasCounter: !1,
|
|
121
|
+
ariaDescribedby: this.ariaDescribedby
|
|
122
|
+
}))}
|
|
119
123
|
aria-labelledby=${o(this.ariaLabelledby)}
|
|
120
124
|
?disabled=${this.disabled}
|
|
121
125
|
id=${this.id + "-input"}
|
|
@@ -152,14 +156,14 @@ var f = class extends d {
|
|
|
152
156
|
return e == null || isNaN(e) ? null : e;
|
|
153
157
|
}
|
|
154
158
|
};
|
|
155
|
-
t([n({ type: String })],
|
|
159
|
+
t([n({ type: String })], p.prototype, "value", void 0);
|
|
156
160
|
try {
|
|
157
|
-
i("pkt-select")(
|
|
161
|
+
i("pkt-select")(p);
|
|
158
162
|
} catch {
|
|
159
163
|
console.warn("Forsøker å definere <pkt-select>, men den er allerede definert");
|
|
160
164
|
}
|
|
161
165
|
//#endregion
|
|
162
166
|
//#region src/components/select/index.ts
|
|
163
|
-
var
|
|
167
|
+
var m = p;
|
|
164
168
|
//#endregion
|
|
165
|
-
export {
|
|
169
|
+
export { p as n, m as t };
|
|
@@ -11,3 +11,14 @@ export declare const booleanishConverter: {
|
|
|
11
11
|
fromAttribute(value: string | boolean | null): boolean;
|
|
12
12
|
toAttribute(value: boolean): string | null;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Som booleanishConverter, men skiller «ikke satt» fra `false`.
|
|
16
|
+
*
|
|
17
|
+
* Brukes for props der komponenten skal utlede en fornuftig standard når
|
|
18
|
+
* forbrukeren ikke har sagt noe — for eksempel `counter`, som slås på av seg
|
|
19
|
+
* selv når det finnes noe å telle, men skal kunne skrus av eksplisitt.
|
|
20
|
+
*/
|
|
21
|
+
export declare const nullableBooleanishConverter: {
|
|
22
|
+
fromAttribute(value: string | boolean | null): boolean | null;
|
|
23
|
+
toAttribute(value: boolean | null): string | null;
|
|
24
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Booleanish } from './booleanish';
|
|
2
|
-
export { booleanishConverter } from './booleanish';
|
|
2
|
+
export { booleanishConverter, nullableBooleanishConverter } from './booleanish';
|
|
3
3
|
export type { TAriaBoolean, TAriaBooleanMixed, TAriaCurrent, TAriaHasPopup, TAriaInvalid, TAriaLive, TAriaRelevant, TAriaSort, TAriaAutoComplete, TAriaOrientation, IAriaAttributes, TAlertRole, } from './aria';
|
|
4
4
|
export type { THeadingLevel, THeadingSize, THeadingWeight } from './heading';
|
|
5
5
|
export type { User, Representing, UserMenuItem, InternalMenuItemBase, InternalMenuLink, InternalMenuButton, TInternalMenuItem, TSlotMenuVariant, THeaderMenu, TLogOutButtonPlacement, THeaderPosition, THeaderScrollBehavior, } from './header';
|
|
@@ -44,7 +44,7 @@ export declare const fromISOtoLocal: (date: string, dateformat: string) => strin
|
|
|
44
44
|
* @param timeOfDay - 'start' to set time to 00:00:00, 'end' to set time to 23:59:59
|
|
45
45
|
* @returns A Date object
|
|
46
46
|
*/
|
|
47
|
-
export declare const newDate: (date?: string | Date, timeOfDay?:
|
|
47
|
+
export declare const newDate: (date?: string | Date, timeOfDay?: 'start' | 'end') => Date;
|
|
48
48
|
/**
|
|
49
49
|
* Creates a new Date object based on the provided year, month, and day.
|
|
50
50
|
* If the inputs are invalid, returns the current date.
|
|
@@ -118,21 +118,21 @@ export declare const sortDateStrings: (dates: string[]) => string[];
|
|
|
118
118
|
*/
|
|
119
119
|
export declare const isValidDateRange: (startDate: string, endDate: string) => boolean;
|
|
120
120
|
declare const _default: {
|
|
121
|
-
todayInTz:
|
|
121
|
+
todayInTz: typeof todayInTz;
|
|
122
122
|
parseISODateString: typeof parseISODateString;
|
|
123
|
-
formatISODate:
|
|
124
|
-
fromISOToDate:
|
|
125
|
-
fromISOtoLocal:
|
|
126
|
-
newDate:
|
|
127
|
-
newDateYMD:
|
|
128
|
-
newDateFromDate:
|
|
129
|
-
formatReadableDate:
|
|
130
|
-
isDateInRange:
|
|
131
|
-
isDateExcluded:
|
|
132
|
-
isWeekdayExcluded:
|
|
133
|
-
isDateSelectable:
|
|
134
|
-
filterSelectableDates:
|
|
135
|
-
sortDateStrings:
|
|
136
|
-
isValidDateRange:
|
|
123
|
+
formatISODate: typeof formatISODate;
|
|
124
|
+
fromISOToDate: typeof fromISOToDate;
|
|
125
|
+
fromISOtoLocal: typeof fromISOtoLocal;
|
|
126
|
+
newDate: typeof newDate;
|
|
127
|
+
newDateYMD: typeof newDateYMD;
|
|
128
|
+
newDateFromDate: typeof newDateFromDate;
|
|
129
|
+
formatReadableDate: typeof formatReadableDate;
|
|
130
|
+
isDateInRange: typeof isDateInRange;
|
|
131
|
+
isDateExcluded: typeof isDateExcluded;
|
|
132
|
+
isWeekdayExcluded: typeof isWeekdayExcluded;
|
|
133
|
+
isDateSelectable: typeof isDateSelectable;
|
|
134
|
+
filterSelectableDates: typeof filterSelectableDates;
|
|
135
|
+
sortDateStrings: typeof sortDateStrings;
|
|
136
|
+
isValidDateRange: typeof isValidDateRange;
|
|
137
137
|
};
|
|
138
138
|
export default _default;
|
|
@@ -59,16 +59,16 @@ export declare const handleDatepickerKeydown: (event: KeyboardEvent, toggleCalen
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const handleDatepickerButtonKeydown: (event: KeyboardEvent, toggleCalendar: (e: Event) => void) => void;
|
|
61
61
|
declare const _default: {
|
|
62
|
-
getDatepickerInputType:
|
|
63
|
-
validateRangeOrder:
|
|
64
|
-
sortDates:
|
|
65
|
-
filterDates:
|
|
66
|
-
getDatepickerInputClasses:
|
|
67
|
-
getDatepickerButtonClasses:
|
|
68
|
-
getRangeLabelClasses:
|
|
69
|
-
processDateSelection:
|
|
70
|
-
handleCalendarPosition:
|
|
71
|
-
handleDatepickerKeydown:
|
|
72
|
-
handleDatepickerButtonKeydown:
|
|
62
|
+
getDatepickerInputType: typeof getDatepickerInputType;
|
|
63
|
+
validateRangeOrder: typeof validateRangeOrder;
|
|
64
|
+
sortDates: typeof sortDates;
|
|
65
|
+
filterDates: typeof filterDates;
|
|
66
|
+
getDatepickerInputClasses: typeof getDatepickerInputClasses;
|
|
67
|
+
getDatepickerButtonClasses: typeof getDatepickerButtonClasses;
|
|
68
|
+
getRangeLabelClasses: typeof getRangeLabelClasses;
|
|
69
|
+
processDateSelection: typeof processDateSelection;
|
|
70
|
+
handleCalendarPosition: typeof handleCalendarPosition;
|
|
71
|
+
handleDatepickerKeydown: typeof handleDatepickerKeydown;
|
|
72
|
+
handleDatepickerButtonKeydown: typeof handleDatepickerButtonKeydown;
|
|
73
73
|
};
|
|
74
74
|
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bygger `aria-describedby` for et skjemafelt.
|
|
3
|
+
*
|
|
4
|
+
* Beskrivelsen må ligge på selve kontrollen — `aria-describedby` på en `<label>`
|
|
5
|
+
* bidrar ikke til feltets tilgjengelige beskrivelse, og hjelpeteksten blir da
|
|
6
|
+
* aldri lest opp når fokus havner i feltet.
|
|
7
|
+
*
|
|
8
|
+
* Feilmeldingen er med vilje ikke med: den kobles gjennom `aria-errormessage`,
|
|
9
|
+
* som er den riktige kanalen, og ville ellers blitt lest opp to ganger.
|
|
10
|
+
*/
|
|
11
|
+
export declare const describedByIds: (options: {
|
|
12
|
+
/** Id-en feltet bruker (samme som wrapperens forId). */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Om det finnes en hjelpetekst å beskrive feltet med. */
|
|
15
|
+
hasHelptext?: boolean;
|
|
16
|
+
/** Om telleren er aktiv. Statusregionen leses bare opp når grensa er brutt. */
|
|
17
|
+
hasCounter?: boolean;
|
|
18
|
+
/** Forbrukerens egen `ariaDescribedby`, hvis satt. */
|
|
19
|
+
ariaDescribedby?: string | null;
|
|
20
|
+
}) => string | undefined;
|
|
21
|
+
/** Id-en til den skjulte statusregionen som melder at tellergrensa er brutt. */
|
|
22
|
+
export declare const counterStatusId: (id: string) => string;
|
|
23
|
+
/** Om tellergrensa er brutt. */
|
|
24
|
+
export declare const isCounterExceeded: (current: number | undefined, max: number | undefined) => boolean;
|
|
@@ -10,7 +10,7 @@ export declare const sleep: (ms: number) => Promise<void>;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const uuidish: () => string;
|
|
12
12
|
declare const _default: {
|
|
13
|
-
sleep:
|
|
14
|
-
uuidish:
|
|
13
|
+
sleep: typeof sleep;
|
|
14
|
+
uuidish: typeof uuidish;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export declare const valueToArray: (value: string | string[] | null | undefined)
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const arrayToCsv: (array: string[]) => string;
|
|
13
13
|
declare const _default: {
|
|
14
|
-
valueToArray:
|
|
15
|
-
arrayToCsv:
|
|
14
|
+
valueToArray: typeof valueToArray;
|
|
15
|
+
arrayToCsv: typeof arrayToCsv;
|
|
16
16
|
};
|
|
17
17
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const e=require("./element-
|
|
2
|
-
<div class=${
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./element-with-slot-Bj7nm7fO.cjs"),n=require("./if-defined-B89_ZeCj.cjs"),r=require("./consume-Le4HztPo.cjs"),i=require("./ref-CQoEIIp0.cjs");var a=r.r(Symbol(`pkt-tabs-context`)),o=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`,r=this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`;return e.p`
|
|
2
|
+
<div class=${r}>
|
|
3
3
|
<div class="pkt-tabs__list" role=${n}>${t.n(this)}</div>
|
|
4
4
|
</div>
|
|
5
5
|
`}};e.n([e.o({type:Boolean,reflect:!0,attribute:`arrow-nav`})],o.prototype,`arrowNav`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],o.prototype,`disableArrowNav`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`separator-icon-name`})],o.prototype,`separatorIconName`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`separator-icon-path`})],o.prototype,`separatorIconPath`,void 0),e.n([e.a()],o.prototype,`tabRefs`,void 0),e.n([e.a()],o.prototype,`disabledMap`,void 0),e.n([e.a()],o.prototype,`tabCount`,void 0),e.n([r.n({context:a}),e.a()],o.prototype,`context`,void 0);try{e.s(`pkt-tabs`)(o)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var s=class extends t.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=i.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let r=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=r?`tab`:void 0,c=r?a:void 0,l=this.disabled?-1:a||!r?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e.p`
|
|
@@ -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, r as l, t as u } from "./consume-
|
|
5
|
-
import { n as d, t as f } from "./ref-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-ChsFgr_B.js";
|
|
2
|
+
import { n as a, t as o } from "./element-with-slot-BvG9ctC-.js";
|
|
3
|
+
import { t as s } from "./if-defined-CGzIlZ9-.js";
|
|
4
|
+
import { n as c, r as l, t as u } from "./consume-BDnMAp2g.js";
|
|
5
|
+
import { n as d, t as f } from "./ref-CWD6PjVd.js";
|
|
6
6
|
//#region src/components/tabs/tabs-context.ts
|
|
7
7
|
var p = l(Symbol("pkt-tabs-context")), m = class extends o {
|
|
8
8
|
constructor(...e) {
|
|
@@ -75,9 +75,9 @@ var p = l(Symbol("pkt-tabs-context")), m = class extends o {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
|
-
let e = this.useArrowNav ? "tablist" : "navigation";
|
|
78
|
+
let e = this.useArrowNav ? "tablist" : "navigation", t = this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs";
|
|
79
79
|
return r`
|
|
80
|
-
<div class=${
|
|
80
|
+
<div class=${t}>
|
|
81
81
|
<div class="pkt-tabs__list" role=${e}>${a(this)}</div>
|
|
82
82
|
</div>
|
|
83
83
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),n=require("./element-with-slot-Bj7nm7fO.cjs");require("./icon-9iwd2F2l.cjs");const r=require("./if-defined-B89_ZeCj.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-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-hide":this._isClosed};return this.closeTag?e.p`
|
|
2
2
|
<button
|
|
3
3
|
class=${t.t(a)}
|
|
4
4
|
type=${this.type}
|
|
@@ -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-ChsFgr_B.js";
|
|
2
|
+
import { t as a } from "./class-map-CnWCnBSX.js";
|
|
3
|
+
import { n as o, t as s } from "./element-with-slot-BvG9ctC-.js";
|
|
4
|
+
import "./icon-D-LA22xD.js";
|
|
5
|
+
import { t as c } from "./if-defined-CGzIlZ9-.js";
|
|
6
6
|
var l = {
|
|
7
7
|
name: "pkt-tag",
|
|
8
8
|
react: "PktTag",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),n=require("./directive-helpers-BlAV5EQD.cjs"),r=require("./element-with-slot-Bj7nm7fO.cjs");require("./icon-9iwd2F2l.cjs");const i=require("./if-defined-B89_ZeCj.cjs"),a=require("./ref-CQoEIIp0.cjs"),o=require("./input-element-DYmQw-fH.cjs"),s=require("./input-wrapper-Q-B-aBeb.cjs");var c=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}}),l=class extends o.t{constructor(...e){super(...e),this.inputRef=a.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.cols=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`,`pkt-textarea`),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=this.effectiveCounter(this.counterMaxLength>0),o=t.t({"pkt-input":!0,[`pkt-input--${this.inputSize}`]:!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":n&&this.counterMaxLength>0&&this.value.length>this.counterMaxLength}),l=this.ariaLabelledby||`${this.id}-input-label`;return e.p`<pkt-input-wrapper
|
|
2
|
+
label=${this.label}
|
|
3
|
+
?counter=${n}
|
|
4
|
+
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
5
|
+
?disabled=${this.disabled}
|
|
6
|
+
?hasError=${this.hasError}
|
|
7
|
+
?inline=${this.inline}
|
|
8
|
+
?optionalTag=${this.optionalTag}
|
|
9
|
+
?required=${this.required}
|
|
10
|
+
?requiredTag=${this.requiredTag}
|
|
11
|
+
useWrapper=${this.useWrapper}
|
|
12
|
+
.ariaDescribedby=${this.ariaDescribedby}
|
|
13
|
+
.counterCurrent=${this.value?.length??0}
|
|
14
|
+
.counterMaxLength=${this.counterMaxLength}
|
|
15
|
+
.errorMessage=${this.errorMessage}
|
|
16
|
+
.forId="${this.id+`-input`}"
|
|
17
|
+
.helptext=${this.helptext}
|
|
18
|
+
.helptextDropdown=${this.helptextDropdown}
|
|
19
|
+
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
20
|
+
.optionalText=${this.optionalText}
|
|
21
|
+
.requiredText=${this.requiredText}
|
|
22
|
+
.tagText=${this.tagText}
|
|
23
|
+
.size=${this.inputSize}
|
|
24
|
+
>
|
|
25
|
+
<div class="pkt-contents" slot="helptext">${r.n(this,`helptext`)}</div>
|
|
26
|
+
<textarea
|
|
27
|
+
${a.n(this.inputRef)}
|
|
28
|
+
class=${o}
|
|
29
|
+
id=${this.id+`-input`}
|
|
30
|
+
name=${(this.name||this.id)+`-input`}
|
|
31
|
+
placeholder=${i.t(this.placeholder)}
|
|
32
|
+
.value=${c(this.value)}
|
|
33
|
+
minlength=${i.t(this.minlength)}
|
|
34
|
+
maxlength=${i.t(this.maxlength)}
|
|
35
|
+
?readonly=${this.readonly}
|
|
36
|
+
autocomplete=${this.autocomplete}
|
|
37
|
+
aria-labelledby=${l}
|
|
38
|
+
aria-invalid=${this.hasError}
|
|
39
|
+
aria-errormessage=${i.t(this.hasError?`${this.id}-input-error`:void 0)}
|
|
40
|
+
aria-describedby=${i.t(s.r({id:this.id+`-input`,hasHelptext:!!this.helptext,hasCounter:n,ariaDescribedby:this.ariaDescribedby}))}
|
|
41
|
+
rows=${i.t(this.rows??void 0)}
|
|
42
|
+
cols=${i.t(this.cols??void 0)}
|
|
43
|
+
?disabled=${this.disabled}
|
|
44
|
+
@input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
|
|
45
|
+
@change=${e=>{e.stopImmediatePropagation()}}
|
|
46
|
+
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
47
|
+
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
48
|
+
></textarea>
|
|
49
|
+
</pkt-input-wrapper>`}};e.n([e.o({type:String,reflect:!0})],l.prototype,`value`,void 0),e.n([e.o({type:String})],l.prototype,`autocomplete`,void 0),e.n([e.o({type:Number})],l.prototype,`rows`,void 0),e.n([e.o({type:Number})],l.prototype,`cols`,void 0),e.n([e.a()],l.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textarea`)(l)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var u=l;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|