@oslokommune/punkt-elements 19.18.3 → 19.18.5
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 +21 -0
- package/dist/{accordion-D-mcyw_S.js → accordion-BHVzR-6Z.js} +2 -2
- package/dist/{accordion-t9p3qgCp.cjs → accordion-Bg4CMrUM.cjs} +1 -1
- package/dist/{alert-CdfTJcT2.js → alert-BAaZIR3e.js} +2 -2
- package/dist/{alert-CBW94-ku.cjs → alert-Dy5N7qK-.cjs} +1 -1
- package/dist/{backlink-GIyyoDoi.cjs → backlink-BnWruRuj.cjs} +1 -1
- package/dist/{backlink-D3rkJWkd.js → backlink-Dlkyj0ns.js} +1 -1
- package/dist/base-elements/input-element.d.ts +3 -0
- package/dist/{breadcrumbs-B4WdX4QR.js → breadcrumbs-Bfv8W2CF.js} +1 -1
- package/dist/{breadcrumbs-B7U57Zey.cjs → breadcrumbs-CyWtnx2B.cjs} +1 -1
- package/dist/{button-DdR_XzMY.cjs → button-BBFI3FuT.cjs} +1 -1
- package/dist/{button-DwcFG7bU.js → button-CF9k3ARf.js} +1 -1
- package/dist/{calendar-DGOwyX3o.js → calendar-BX3n3vhs.js} +1 -1
- package/dist/{calendar-DcenMWOQ.cjs → calendar-Dds9KFiE.cjs} +1 -1
- package/dist/{card-D4rpTD_e.js → card-Ddu0sQ0f.js} +2 -2
- package/dist/{card-CizBnD59.cjs → card-mi3VKIoy.cjs} +1 -1
- package/dist/{checkbox-B6BVu9BZ.cjs → checkbox-B8foyiOW.cjs} +1 -1
- package/dist/{checkbox-BTD7bz3U.js → checkbox-D9-KugOh.js} +1 -1
- package/dist/{checkbox-group-CREaHr24.cjs → checkbox-group-BlBgrzKG.cjs} +1 -1
- package/dist/{checkbox-group-4dLJ_HTY.js → checkbox-group-Dz1ypmbU.js} +2 -2
- package/dist/{combobox-CVg5vs-l.js → combobox-BAkblu9M.js} +4 -4
- package/dist/{combobox-B-bdCNiE.cjs → combobox-DLDvyuDh.cjs} +1 -1
- package/dist/components/accordion/accordionitem.d.ts +1 -1
- package/dist/components/datepicker/datepicker-popup.d.ts +1 -0
- package/dist/components/header/header-chrome-controller.d.ts +5 -0
- package/dist/components/header/header-service.d.ts +1 -0
- package/dist/components/loader/loader.d.ts +5 -36
- package/dist/components/progressbar/progressbar.d.ts +1 -0
- package/dist/components/select/select.d.ts +3 -1
- package/dist/{consent-Chtz1yL0.js → consent-BTw6uqFf.js} +1 -1
- package/dist/{consent-Dhh207Zz.cjs → consent-DNHRe0zV.cjs} +1 -1
- package/dist/{datepicker-DeTZy8NM.js → datepicker-9dmdHweu.js} +10 -7
- package/dist/{datepicker-DvI7BT4S.cjs → datepicker-C7F1Yc5N.cjs} +3 -3
- package/dist/{fileupload-pGOXdyL0.cjs → fileupload-BLAQqG3-.cjs} +1 -1
- package/dist/{fileupload-iGE2WK9e.js → fileupload-D7nEdIgL.js} +7 -7
- package/dist/{footer-D4R-9si6.js → footer-DZ4aA6fj.js} +2 -2
- package/dist/{footer-QGnujLm9.cjs → footer-HFL2sjAY.cjs} +1 -1
- package/dist/{header-B3TDAMMX.cjs → header-Cj08flhl.cjs} +2 -2
- package/dist/{header-A70TKzPE.js → header-Cptdf4fW.js} +18 -9
- package/dist/{header-menu-CWrw01rm.cjs → header-menu-De2DNAXd.cjs} +1 -1
- package/dist/{header-menu-BK36mG6a.js → header-menu-DxOSBiTJ.js} +2 -2
- package/dist/{helptext-BXryqHy5.js → helptext-BVYv8Lm9.js} +1 -1
- package/dist/{helptext-KrtUyA7H.cjs → helptext-BbrFE48Y.cjs} +1 -1
- package/dist/{icon-BVSiUQSL.js → icon-CUU42bZ0.js} +29 -28
- package/dist/icon-CrG6o7ZE.cjs +1 -0
- package/dist/{input-element-a5dcxOzs.cjs → input-element-D82laWtR.cjs} +1 -1
- package/dist/{input-element-8mrCxToc.js → input-element-DczlJQb1.js} +11 -8
- package/dist/{input-wrapper-7RSISZu6.js → input-wrapper-CHwWQgZP.js} +3 -3
- package/dist/{input-wrapper-DT9h0n2i.cjs → input-wrapper-QzdntWJX.cjs} +1 -1
- package/dist/{link-DL4dZoI5.js → link-BU6t5Tt9.js} +1 -1
- package/dist/{link-u69d_-Zh.cjs → link-a1ZK4J1j.cjs} +1 -1
- package/dist/{linkcard-B6N7xChn.cjs → linkcard-Cu4Rh71U.cjs} +1 -1
- package/dist/{linkcard-C_9NCgkD.js → linkcard-DM0CQbwD.js} +1 -1
- package/dist/loader-DwGMavG7.cjs +16 -0
- package/dist/{loader-DJGAd8c-.js → loader-Y8V3Q82X.js} +37 -9
- package/dist/{messagebox-YkknrtEM.cjs → messagebox-DR-s6tyr.cjs} +1 -1
- package/dist/{messagebox-V1Kszdop.js → messagebox-wJcXW5hI.js} +1 -1
- package/dist/{modal-EjPYLhS-.js → modal-Dt35SMQH.js} +30 -30
- package/dist/{modal--k988mEb.cjs → modal-DyaAoMeB.cjs} +2 -2
- package/dist/{option-group-element-BEGRouXw.cjs → option-group-element-CWjgrFwS.cjs} +1 -1
- package/dist/{option-group-element-CQViBzca.js → option-group-element-ZNyUoLcm.js} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.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-group.cjs +1 -1
- package/dist/pkt-checkbox-group.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +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-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 +36 -36
- 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-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-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-BJswle17.js → progressbar-BukfOcRk.js} +8 -4
- package/dist/{progressbar-BVeWeSLq.cjs → progressbar-YfHSPmqI.cjs} +3 -2
- package/dist/{radio-group-CYEnKuIM.js → radio-group-Bg6ODpT3.js} +2 -2
- package/dist/{radio-group-DI_5eAL4.cjs → radio-group-bpIEEMdL.cjs} +1 -1
- package/dist/{radiobutton-DY3tXJ8Z.js → radiobutton-DMvVv81Y.js} +1 -1
- package/dist/{radiobutton-Cf3ROHzB.cjs → radiobutton-IcDc6ze2.cjs} +1 -1
- package/dist/{searchinput-zxHqZ-jG.js → searchinput-BV2C1VbN.js} +1 -1
- package/dist/{searchinput-B1m241pF.cjs → searchinput-DqD_iLxV.cjs} +1 -1
- package/dist/{select-B2W70m_k.cjs → select-CHqM6kI-.cjs} +1 -1
- package/dist/{select-CeFVfjM-.js → select-DKBfPgJB.js} +9 -6
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/loader.d.ts +48 -0
- package/dist/{tabs-ZhYxE5fX.js → tabs-B2RjklQl.js} +1 -1
- package/dist/{tabs-fXlMzPFJ.cjs → tabs-BcnYrmjU.cjs} +1 -1
- package/dist/{tag-Bv5JRS69.js → tag-BOTH9kMz.js} +1 -1
- package/dist/{tag-B2EEjkjD.cjs → tag-DrFK8Wq3.cjs} +1 -1
- package/dist/{textarea-BBo8oZA-.cjs → textarea-B5OfR-QI.cjs} +1 -1
- package/dist/{textarea-BOOFnUFu.js → textarea-Du1Z9JUu.js} +4 -4
- package/dist/{textinput-GRYgsT0X.cjs → textinput-75MKBqas.cjs} +1 -1
- package/dist/{textinput-wzBD3Tk1.js → textinput-D_V3b327.js} +4 -4
- package/dist/{timepicker-x0PuqU-M.js → timepicker-DVqTAxt0.js} +3 -3
- package/dist/{timepicker-DLF0UN3M.cjs → timepicker-RxsG0mCF.cjs} +1 -1
- package/package.json +2 -3
- package/src/components/accordion/accordionitem.ts +3 -2
- package/src/components/datepicker/datepicker-popup.ts +5 -1
- package/src/components/datepicker/datepicker.ts +1 -0
- package/src/components/fileupload/fileupload-base.ts +6 -6
- package/src/components/header/header-chrome-controller.ts +18 -5
- package/src/components/header/header-service.ts +6 -3
- package/src/components/loader/loader.test.ts +32 -0
- package/src/components/loader/loader.ts +41 -48
- package/src/components/modal/modal.ts +2 -5
- package/src/components/progressbar/progressbar.ts +8 -2
- package/src/components/select/select.ts +22 -19
- package/src/components/textarea/textarea.ts +3 -0
- package/src/components/textinput/textinput.ts +3 -0
- package/dist/icon-BsRlhXU2.cjs +0 -1
- package/dist/loader-l7CLjzgI.cjs +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const i=require("./utils-63cRpWut.cjs");var a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},x=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?b(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},S=e=>{s.get(e).forEach(e=>{e.remove()}),s.set(e,[])},C=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),s.get(t).push(n),n},w=(e,t)=>{if(t.length){let n=Array.from(t);n.forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let[r]=n,i=r.id;r.id||=(i=`${r.htmlFor}_Label`,i),b(e,`aria-labelledby`,i)}},T=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=f.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>c.get(e).validity.valid),i=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,i),e.toggleAttribute(`internals-valid`,!i)},ee=e=>{T(E(e.target))},te=e=>{T(E(e.target))},ne=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=f.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>c.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},re=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},ie=(e,t,n)=>{if(t){let r=f.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),f.set(t,n),ne(t),t.addEventListener(`reset`,re),t.addEventListener(`input`,ee),t.addEventListener(`change`,te)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},E=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=E(t)),t},D=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},O=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},k=e=>{let t=!1;if(e.constructor.formAssociated){let n=c.get(e);n===void 0&&(e.attachInternals(),n=c.get(e),t=!0);let{labels:r,form:i}=n;w(e,r),ie(e,i,n)}return t};function A(){return typeof MutationObserver<`u`}var j={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,ariaBrailleLabel:`aria-braillelabel`,ariaBrailleRoleDescription:`aria-brailleroledescription`,ariaBusy:`aria-busy`,ariaChecked:`aria-checked`,ariaColCount:`aria-colcount`,ariaColIndex:`aria-colindex`,ariaColIndexText:`aria-colindextext`,ariaColSpan:`aria-colspan`,ariaCurrent:`aria-current`,ariaDescription:`aria-description`,ariaDisabled:`aria-disabled`,ariaExpanded:`aria-expanded`,ariaHasPopup:`aria-haspopup`,ariaHidden:`aria-hidden`,ariaInvalid:`aria-invalid`,ariaKeyShortcuts:`aria-keyshortcuts`,ariaLabel:`aria-label`,ariaLevel:`aria-level`,ariaLive:`aria-live`,ariaModal:`aria-modal`,ariaMultiLine:`aria-multiline`,ariaMultiSelectable:`aria-multiselectable`,ariaOrientation:`aria-orientation`,ariaPlaceholder:`aria-placeholder`,ariaPosInSet:`aria-posinset`,ariaPressed:`aria-pressed`,ariaReadOnly:`aria-readonly`,ariaRelevant:`aria-relevant`,ariaRequired:`aria-required`,ariaRoleDescription:`aria-roledescription`,ariaRowCount:`aria-rowcount`,ariaRowIndex:`aria-rowindex`,ariaRowIndexText:`aria-rowindextext`,ariaRowSpan:`aria-rowspan`,ariaSelected:`aria-selected`,ariaSetSize:`aria-setsize`,ariaSort:`aria-sort`,ariaValueMax:`aria-valuemax`,ariaValueMin:`aria-valuemin`,ariaValueNow:`aria-valuenow`,ariaValueText:`aria-valuetext`,role:`role`},ae=(e,t)=>{for(let n in j){t[n]=null;let r=null,i=j[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},oe=(e,t)=>{s.set(t,[]),F.observe?.(e,P)};function M(e){let t=c.get(e),{form:n}=t;ie(e,n,t),w(e,t.labels)}var N=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&x(r,e.disabled),r=n.nextNode()},P={attributes:!0,attributeFilter:[`disabled`,`name`]},F=A()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?x(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&N(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function I(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,r=Array.from(t),i=Array.from(n);r.forEach(e=>{if(c.has(e)&&e.constructor.formAssociated&&M(e),m.has(e)){let t=m.get(e);Object.keys(j).filter(e=>t[e]!==null).forEach(n=>{b(e,j[n],t[n])}),m.delete(e)}if(y.has(e)){let t=y.get(e);b(e,`internals-valid`,t.validity.valid.toString()),b(e,`internals-invalid`,(!t.validity.valid).toString()),b(e,`aria-invalid`,(!t.validity.valid).toString()),y.delete(e)}if(e.localName===`form`){let t=f.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)M(r),r=n.nextNode()}e.localName===`fieldset`&&(F.observe?.(e,P),N(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function se(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&k(t),n.disconnect()})})}var ce=e=>{let t=new MutationObserver(se);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};A()&&new MutationObserver(I);var L={childList:!0,subtree:!0},le=class{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}},ue=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),de=(e,t,n)=>(e.valid=fe(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),fe=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},R=new WeakMap;function z(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var B=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);R.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=R.get(this),r=`state${e}`;return n.isConnected?z(n,r):setTimeout(()=>{z(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=R.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}},pe=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},V=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},H,me=class{constructor(e){H.set(this,void 0),pe(this,H,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return V(this,H,`f`).length}[(H=new WeakMap,Symbol.iterator)](){return V(this,H,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function he(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return O(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return O(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...e){let t=i.call(this,...e),n=Array.from(f.get(this)||[]);return n.length===0?t:new me(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var U=class{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let t=e.getRootNode(),n=new le;this.states=new B(e),a.set(this,e),o.set(this,n),c.set(e,this),ae(e,this),oe(e,this),Object.seal(this),t instanceof DocumentFragment&&ce(t)}checkValidity(){let e=a.get(this);if(D(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=o.get(this);if(!t.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return t.valid}get form(){let e=a.get(this);D(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t;return e.constructor.formAssociated===!0&&(t=E(e)),t}get labels(){let e=a.get(this);D(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t=e.getAttribute(`id`),n=e.getRootNode();return n&&t?n.querySelectorAll(`[for="${t}"]`):[]}reportValidity(){let e=a.get(this);if(D(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=this.checkValidity(),n=g.get(this);if(n&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!t&&n&&(e.focus(),n.focus()),t}setFormValue(e){let t=a.get(this);if(D(t,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),S(this),e!=null&&!(e instanceof FormData)){if(t.getAttribute(`name`)){let n=C(t,this);n.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,n])=>{if(typeof n==`string`){let r=C(t,this);r.name=e,r.value=n}});p.set(t,e)}setValidity(e,t,n){let r=a.get(this);if(D(r,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);g.set(this,n);let i=o.get(this),s={};for(let t in e)s[t]=e[t];Object.keys(s).length===0&&ue(i);let c={...i,...s};delete c.valid;let{valid:u}=de(i,c,this.form);if(!u&&!t)throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);l.set(this,u?``:t),r.isConnected?(r.toggleAttribute(`internals-invalid`,!u),r.toggleAttribute(`internals-valid`,u),b(r,`aria-invalid`,`${!u}`)):y.set(r,this)}get shadowRoot(){let e=a.get(this);return h.get(e)||null}get validationMessage(){return D(a.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),l.get(this)}get validity(){return D(a.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),o.get(this)}get willValidate(){let e=a.get(this);return D(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.matches(`:disabled`)||e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}};function ge(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}var W=!1,G=!1;function K(e){G||(G=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new B(this),n}))}function _e(e=!0){let t=!1;if(!W){if(W=!0,typeof window<`u`&&(window.ElementInternals=U),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(n,r,i){if(r.formAssociated){let e=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){v.has(this)||(v.set(this,!0),this.hasAttribute(`disabled`)&&x(this,!0)),e?.apply(this),t=k(this)}}e.call(this,n,r,i)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(c.has(this)&&!t)throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new U(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),A()){let e=new MutationObserver(I);window.ShadyDOM?e.observe(this,L):e.observe(n,L),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}A()&&typeof document<`u`&&new MutationObserver(I).observe(document.documentElement,L),typeof HTMLFormElement<`u`&&he(),(e||typeof window<`u`&&!window.CustomStateSet)&&K()}}customElements.polyfillWrapFlushCallback||(ge()?typeof window<`u`&&!window.CustomStateSet&&K(HTMLElement.prototype.attachInternals):_e(!1));var q=`on`,J=`--checked`,Y=`,`,X=e=>e===!0||e===``||e===`true`,Z=new WeakMap,ve=0,ye=e=>{let t=Z.get(e);return t||(t=e.id||`form${++ve}`,Z.set(e,t)),t},Q=()=>!!globalThis.ElementInternals?.isPolyfilled,$=class e extends n.t{static get formAssociated(){return!0}get form(){let e=this.getAttribute(`form`);if(e!==null){if(!e)return null;let t=this.getRootNode(),n=typeof t.getElementById==`function`?t.getElementById(e):this.ownerDocument?.getElementById(e);return n instanceof HTMLFormElement?n:null}return this.internals?.form??this.closest(`form`)}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}formDisabledCallback(e){this.formDisabled=e}get isDisabled(){return this.disabled||this.formDisabled}get optionGroup(){return this.groupContext}setGroupValidity(e){this.groupValidityMessage!==e&&(this.groupValidityMessage=e,this.inputRef?.value&&this.manageValidity(this.inputRef.value))}syncGroupName(){let e=this.optionGroup?.name;if(!e)return;let t=!this.name||this.name===this.derivedName;t&&this.name!==e&&(this.name=e),t&&(this.derivedName=e)}effectiveCounter(e){return this.counter??e}effectiveHasFieldset(e){return this.hasFieldset??e}constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedby=null,this.ariaLabelledby=null,this.name=``,this.pattern=null,this.placeholder=null,this.id=i.n(),this.counter=null,this.hasError=!1,this.inline=!1,this.hasFieldset=null,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage=``,this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=null,this.label=null,this.tagText=null,this.inputSize=`medium`,this.dataTestid=``,this.formDisabled=!1,this.derivedName=null,this.groupValidityMessage=``,this.touched=!1,this._initialized=!1,this.polyfillFormValue=null,this._didInitDerivedState=!1,this._defaultCheckedState=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),Q()&&queueMicrotask(()=>{this.isConnected&&this.polyfillFormValue&&this.internals.setFormValue(this.polyfillFormValue.value)})}get internalName(){let e=this.form;return e?`${this.name}-internal-${ye(e)}`:`${this.name}-internal`}formAssociatedCallback(){this.requestUpdate()}writeFormValue(e){this.internals.setFormValue(e),Q()&&(this.polyfillFormValue={value:e})}manageValidity(e,n){if(!e){console.warn(`manageValidity called without valid input element`);return}let r=this.pktStrings.get(`validation`);(this.isCheckable?this.checkableValueMissing(n??this.checkableGroup()):this.required&&!this.value)?this.internals.setValidity(this.groupValidityMessage?{valueMissing:!0,customError:!0}:{valueMissing:!0},this.groupValidityMessage||r.valueMissing,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},r.typeMismatch,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.patternMismatch,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.valueLength<this.minlength?this.internals.setValidity({tooShort:!0},r.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.valueLength>this.maxlength?this.internals.setValidity({tooLong:!0},r.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?t.t(r.rangeUnderflowMin,{min:this.min.toString()}):r.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.typeMismatch,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?t.t(r.rangeOverflowMax,{max:this.max.toString()}):r.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.groupValidityMessage?this.internals.setValidity({customError:!0},this.groupValidityMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals){if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.writeFormValue(t)}else this.writeFormValue(e)}}radioGroupMembers(){let e=this.getRootNode();if(typeof e.querySelectorAll!=`function`)return[];let t=this.form;return Array.from(e.querySelectorAll(`pkt-radiobutton, input[type="radio"]`)).filter(e=>e!==this&&e.getAttribute(`name`)===this.name&&e.form===t)}get valueLength(){return!this.multiple||Array.isArray(this.value)?this.value.length:this.value?this.value.split(Y).length:0}get isCheckable(){return this.type===`checkbox`||this.type===`radio`}checkableGroup(){return this.type===`radio`?[this,...this.radioGroupMembers()]:[this]}get isRequired(){return this.required||this.type===`radio`&&!!this.optionGroup?.required}checkableValueMissing(t){return this.type===`radio`?t.some(t=>t instanceof e?t.isRequired:t.required)&&!t.some(e=>X(e.checked)):this.required&&!X(this.checked)}syncCheckedState(){if(!this.internals)return;let e=X(this.checked);this.internals.ariaChecked=String(e),e?(this.writeFormValue((typeof this.value==`string`?this.value:``)||q),this.internals.states?.add(J)):(this.writeFormValue(null),this.internals.states?.delete(J)),this.inputRef?.value&&this.inputRef.value.checked!==e&&(this.inputRef.value.checked=e)}validateCheckable(){let t=this.checkableGroup();t.forEach(n=>{if(!(n instanceof e))return;let r=n;r.inputRef?.value&&r.manageValidity(r.inputRef.value,t)})}coordinateRadioGroup(){this.name&&this.type===`radio`&&this.radioGroupMembers().forEach(t=>{t instanceof e?X(t.checked)&&(t.checked=!1,t.syncCheckedState()):t.checked&&=!1})}valueChecked(e){this.touched&&(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?this.checked=e===`true`:typeof e==`boolean`&&(this.checked=e),this.syncCheckedState(),this.validateCheckable(),this.onInput(),this.dispatchChangeEvents(this.checked))}valueChanged(e,t){let n=e;if(typeof n==`number`||typeof n==`boolean`)e=String(n);else if(n!=null&&typeof n!=`string`&&!Array.isArray(n)){let e=typeof n==`object`?n?.constructor?.name??`object`:typeof n;console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${e}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`)}(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(Y)&&(e=e.split(Y)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value=``,this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==t?.toString()&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){let e=this.multiple||this.range?[]:``;this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent(`focus`,{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent(`blur`,{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e==`string`&&e.includes(Y)?e.split(Y):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(this.touched=!0,typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this._initialized&&this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=this._defaultCheckedState,this.syncCheckedState(),this.validateCheckable();else{this.writeFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),this.isCheckable&&this._initialized&&(e.has(`defaultChecked`)&&e.get(`defaultChecked`)!==void 0&&(this._defaultCheckedState=!!this.defaultChecked),e.has(`groupContext`)&&this.isRequired&&(this.internals.ariaRequired=`true`),[`checked`,`value`,`required`,`name`,`groupContext`].some(t=>e.has(t))&&(this.syncCheckedState(),this.validateCheckable())),e.has(`dataTestid`)&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute(`data-testid`)||this.setAttribute(`data-testid`,this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute(`data-testid`)))}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.toggleAttribute(`disabled`,this.disabled),this.syncGroupName(),!this._didInitDerivedState&&(this._didInitDerivedState=!0,this.defaultChecked&&(this.checked=!0),this.id&&!this.name&&(this.name=this.id,this.derivedName=this.id),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null))}firstUpdated(e){if(super.firstUpdated(e),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=`true`),this.isRequired&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.checked!==void 0){let e=X(this.checked);this._defaultCheckedState=e,this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||q:null;this.writeFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.isCheckable?this.validateCheckable():this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value)),this.updateComplete.then(()=>{this._initialized=!0})}};e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`checked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`defaultChecked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`multiple`,void 0),e.n([e.u({type:Boolean})],$.prototype,`range`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`type`,void 0),e.n([e.u()],$.prototype,`defaultValue`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`required`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`max`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`maxlength`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`min`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`minlength`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`step`,void 0),e.n([e.u({type:String,attribute:`aria-describedby`})],$.prototype,`ariaDescribedby`,void 0),e.n([e.u({type:String,attribute:`aria-labelledby`})],$.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`name`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`pattern`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`placeholder`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`id`,void 0),e.n([e.u({type:Boolean,converter:r.n})],$.prototype,`counter`,void 0),e.n([e.u({type:Boolean})],$.prototype,`hasError`,void 0),e.n([e.u({type:Boolean})],$.prototype,`inline`,void 0),e.n([e.u({type:Boolean,converter:r.n})],$.prototype,`hasFieldset`,void 0),e.n([e.u({type:Boolean})],$.prototype,`optionalTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`requiredTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`skipForwardTestid`,void 0),e.n([e.u({type:Boolean,reflect:!0,converter:r.t})],$.prototype,`useWrapper`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`fullwidth`,void 0),e.n([e.u({type:Number})],$.prototype,`counterMaxLength`,void 0),e.n([e.u({type:String})],$.prototype,`errorMessage`,void 0),e.n([e.u({type:String})],$.prototype,`helptext`,void 0),e.n([e.u({type:String})],$.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:String})],$.prototype,`label`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`optionalText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`requiredText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`tagText`,void 0),e.n([e.u({type:String,attribute:`input-size`})],$.prototype,`inputSize`,void 0),e.n([e.u({type:String,attribute:`data-testid`})],$.prototype,`dataTestid`,void 0),e.n([e.l()],$.prototype,`formDisabled`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const i=require("./utils-63cRpWut.cjs");var a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},x=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?b(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},S=e=>{s.get(e).forEach(e=>{e.remove()}),s.set(e,[])},C=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),s.get(t).push(n),n},w=(e,t)=>{if(t.length){let n=Array.from(t);n.forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let[r]=n,i=r.id;r.id||=(i=`${r.htmlFor}_Label`,i),b(e,`aria-labelledby`,i)}},T=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=f.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>c.get(e).validity.valid),i=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,i),e.toggleAttribute(`internals-valid`,!i)},ee=e=>{T(E(e.target))},te=e=>{T(E(e.target))},ne=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=f.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>c.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},re=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},ie=(e,t,n)=>{if(t){let r=f.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),f.set(t,n),ne(t),t.addEventListener(`reset`,re),t.addEventListener(`input`,ee),t.addEventListener(`change`,te)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},E=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=E(t)),t},D=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},O=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},k=e=>{let t=!1;if(e.constructor.formAssociated){let n=c.get(e);n===void 0&&(e.attachInternals(),n=c.get(e),t=!0);let{labels:r,form:i}=n;w(e,r),ie(e,i,n)}return t};function A(){return typeof MutationObserver<`u`}var j={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,ariaBrailleLabel:`aria-braillelabel`,ariaBrailleRoleDescription:`aria-brailleroledescription`,ariaBusy:`aria-busy`,ariaChecked:`aria-checked`,ariaColCount:`aria-colcount`,ariaColIndex:`aria-colindex`,ariaColIndexText:`aria-colindextext`,ariaColSpan:`aria-colspan`,ariaCurrent:`aria-current`,ariaDescription:`aria-description`,ariaDisabled:`aria-disabled`,ariaExpanded:`aria-expanded`,ariaHasPopup:`aria-haspopup`,ariaHidden:`aria-hidden`,ariaInvalid:`aria-invalid`,ariaKeyShortcuts:`aria-keyshortcuts`,ariaLabel:`aria-label`,ariaLevel:`aria-level`,ariaLive:`aria-live`,ariaModal:`aria-modal`,ariaMultiLine:`aria-multiline`,ariaMultiSelectable:`aria-multiselectable`,ariaOrientation:`aria-orientation`,ariaPlaceholder:`aria-placeholder`,ariaPosInSet:`aria-posinset`,ariaPressed:`aria-pressed`,ariaReadOnly:`aria-readonly`,ariaRelevant:`aria-relevant`,ariaRequired:`aria-required`,ariaRoleDescription:`aria-roledescription`,ariaRowCount:`aria-rowcount`,ariaRowIndex:`aria-rowindex`,ariaRowIndexText:`aria-rowindextext`,ariaRowSpan:`aria-rowspan`,ariaSelected:`aria-selected`,ariaSetSize:`aria-setsize`,ariaSort:`aria-sort`,ariaValueMax:`aria-valuemax`,ariaValueMin:`aria-valuemin`,ariaValueNow:`aria-valuenow`,ariaValueText:`aria-valuetext`,role:`role`},ae=(e,t)=>{for(let n in j){t[n]=null;let r=null,i=j[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},oe=(e,t)=>{s.set(t,[]),F.observe?.(e,P)};function M(e){let t=c.get(e),{form:n}=t;ie(e,n,t),w(e,t.labels)}var N=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&x(r,e.disabled),r=n.nextNode()},P={attributes:!0,attributeFilter:[`disabled`,`name`]},F=A()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?x(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&N(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function I(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,r=Array.from(t),i=Array.from(n);r.forEach(e=>{if(c.has(e)&&e.constructor.formAssociated&&M(e),m.has(e)){let t=m.get(e);Object.keys(j).filter(e=>t[e]!==null).forEach(n=>{b(e,j[n],t[n])}),m.delete(e)}if(y.has(e)){let t=y.get(e);b(e,`internals-valid`,t.validity.valid.toString()),b(e,`internals-invalid`,(!t.validity.valid).toString()),b(e,`aria-invalid`,(!t.validity.valid).toString()),y.delete(e)}if(e.localName===`form`){let t=f.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)M(r),r=n.nextNode()}e.localName===`fieldset`&&(F.observe?.(e,P),N(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function se(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&k(t),n.disconnect()})})}var ce=e=>{let t=new MutationObserver(se);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};A()&&new MutationObserver(I);var L={childList:!0,subtree:!0},le=class{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}},ue=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),de=(e,t,n)=>(e.valid=fe(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),fe=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},R=new WeakMap;function z(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var B=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);R.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=R.get(this),r=`state${e}`;return n.isConnected?z(n,r):setTimeout(()=>{z(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=R.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}},pe=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},V=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},H,me=class{constructor(e){H.set(this,void 0),pe(this,H,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return V(this,H,`f`).length}[(H=new WeakMap,Symbol.iterator)](){return V(this,H,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function he(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return O(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return O(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...e){let t=i.call(this,...e),n=Array.from(f.get(this)||[]);return n.length===0?t:new me(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var U=class{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let t=e.getRootNode(),n=new le;this.states=new B(e),a.set(this,e),o.set(this,n),c.set(e,this),ae(e,this),oe(e,this),Object.seal(this),t instanceof DocumentFragment&&ce(t)}checkValidity(){let e=a.get(this);if(D(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=o.get(this);if(!t.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return t.valid}get form(){let e=a.get(this);D(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t;return e.constructor.formAssociated===!0&&(t=E(e)),t}get labels(){let e=a.get(this);D(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t=e.getAttribute(`id`),n=e.getRootNode();return n&&t?n.querySelectorAll(`[for="${t}"]`):[]}reportValidity(){let e=a.get(this);if(D(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=this.checkValidity(),n=g.get(this);if(n&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!t&&n&&(e.focus(),n.focus()),t}setFormValue(e){let t=a.get(this);if(D(t,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),S(this),e!=null&&!(e instanceof FormData)){if(t.getAttribute(`name`)){let n=C(t,this);n.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,n])=>{if(typeof n==`string`){let r=C(t,this);r.name=e,r.value=n}});p.set(t,e)}setValidity(e,t,n){let r=a.get(this);if(D(r,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);g.set(this,n);let i=o.get(this),s={};for(let t in e)s[t]=e[t];Object.keys(s).length===0&&ue(i);let c={...i,...s};delete c.valid;let{valid:u}=de(i,c,this.form);if(!u&&!t)throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);l.set(this,u?``:t),r.isConnected?(r.toggleAttribute(`internals-invalid`,!u),r.toggleAttribute(`internals-valid`,u),b(r,`aria-invalid`,`${!u}`)):y.set(r,this)}get shadowRoot(){let e=a.get(this);return h.get(e)||null}get validationMessage(){return D(a.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),l.get(this)}get validity(){return D(a.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),o.get(this)}get willValidate(){let e=a.get(this);return D(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.matches(`:disabled`)||e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}};function ge(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}var W=!1,G=!1;function K(e){G||(G=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new B(this),n}))}function _e(e=!0){let t=!1;if(!W){if(W=!0,typeof window<`u`&&(window.ElementInternals=U),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(n,r,i){if(r.formAssociated){let e=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){v.has(this)||(v.set(this,!0),this.hasAttribute(`disabled`)&&x(this,!0)),e?.apply(this),t=k(this)}}e.call(this,n,r,i)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(c.has(this)&&!t)throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new U(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),A()){let e=new MutationObserver(I);window.ShadyDOM?e.observe(this,L):e.observe(n,L),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}A()&&typeof document<`u`&&new MutationObserver(I).observe(document.documentElement,L),typeof HTMLFormElement<`u`&&he(),(e||typeof window<`u`&&!window.CustomStateSet)&&K()}}customElements.polyfillWrapFlushCallback||(ge()?typeof window<`u`&&!window.CustomStateSet&&K(HTMLElement.prototype.attachInternals):_e(!1));var q=`on`,J=`--checked`,Y=`,`,X=e=>e===!0||e===``||e===`true`,Z=new WeakMap,ve=0,ye=e=>{let t=Z.get(e);return t||(t=e.id||`form${++ve}`,Z.set(e,t)),t},Q=()=>!!globalThis.ElementInternals?.isPolyfilled,$=class e extends n.t{static get formAssociated(){return!0}get form(){let e=this.getAttribute(`form`);if(e!==null){if(!e)return null;let t=this.getRootNode(),n=typeof t.getElementById==`function`?t.getElementById(e):this.ownerDocument?.getElementById(e);return n instanceof HTMLFormElement?n:null}return this.internals?.form??this.closest(`form`)}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}formDisabledCallback(e){this.formDisabled=e}get isDisabled(){return this.disabled||this.formDisabled}get optionGroup(){return this.groupContext}setGroupValidity(e){this.groupValidityMessage!==e&&(this.groupValidityMessage=e,this.inputRef?.value&&this.manageValidity(this.inputRef.value))}syncGroupName(){let e=this.optionGroup?.name;if(!e)return;let t=!this.name||this.name===this.derivedName;t&&this.name!==e&&(this.name=e),t&&(this.derivedName=e)}effectiveCounter(e){return this.counter??e}effectiveHasFieldset(e){return this.hasFieldset??e}constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedby=null,this.ariaLabelledby=null,this.name=``,this.pattern=null,this.placeholder=null,this.id=i.n(),this.counter=null,this.hasError=!1,this.inline=!1,this.hasFieldset=null,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage=``,this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=null,this.label=null,this.tagText=null,this.inputSize=`medium`,this.dataTestid=``,this.formDisabled=!1,this.derivedName=null,this.groupValidityMessage=``,this.touched=!1,this._initialized=!1,this.polyfillFormValue=null,this._didInitDerivedState=!1,this._defaultCheckedState=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),Q()&&queueMicrotask(()=>{this.isConnected&&this.polyfillFormValue&&this.internals.setFormValue(this.polyfillFormValue.value)})}get internalName(){let e=this.form;return e?`${this.name}-internal-${ye(e)}`:`${this.name}-internal`}formAssociatedCallback(){this.requestUpdate()}writeFormValue(e){this.internals.setFormValue(e),Q()&&(this.polyfillFormValue={value:e})}manageValidity(e,n){if(!e){console.warn(`manageValidity called without valid input element`);return}let r=this.pktStrings.get(`validation`);(this.isCheckable?this.checkableValueMissing(n??this.checkableGroup()):this.required&&!this.value)?this.internals.setValidity(this.groupValidityMessage?{valueMissing:!0,customError:!0}:{valueMissing:!0},this.groupValidityMessage||r.valueMissing,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},r.typeMismatch,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.patternMismatch,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.valueLength<this.minlength?this.internals.setValidity({tooShort:!0},r.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.valueLength>this.maxlength?this.internals.setValidity({tooLong:!0},r.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?t.t(r.rangeUnderflowMin,{min:this.min.toString()}):r.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.typeMismatch,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?t.t(r.rangeOverflowMax,{max:this.max.toString()}):r.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.groupValidityMessage?this.internals.setValidity({customError:!0},this.groupValidityMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals){if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.writeFormValue(t)}else this.writeFormValue(e)}}radioGroupMembers(){let e=this.getRootNode();if(typeof e.querySelectorAll!=`function`)return[];let t=this.form;return Array.from(e.querySelectorAll(`pkt-radiobutton, input[type="radio"]`)).filter(e=>e!==this&&e.getAttribute(`name`)===this.name&&e.form===t)}get valueLength(){return!this.multiple||Array.isArray(this.value)?this.value.length:this.value?this.value.split(Y).length:0}get isCheckable(){return this.type===`checkbox`||this.type===`radio`}checkableGroup(){return this.type===`radio`?[this,...this.radioGroupMembers()]:[this]}get isRequired(){return this.required||this.type===`radio`&&!!this.optionGroup?.required}checkableValueMissing(t){return this.type===`radio`?t.some(t=>t instanceof e?t.isRequired:t.required)&&!t.some(e=>X(e.checked)):this.required&&!X(this.checked)}syncCheckedState(){if(!this.internals)return;let e=X(this.checked);this.internals.ariaChecked=String(e),e?(this.writeFormValue((typeof this.value==`string`?this.value:``)||q),this.internals.states?.add(J)):(this.writeFormValue(null),this.internals.states?.delete(J)),this.inputRef?.value&&this.inputRef.value.checked!==e&&(this.inputRef.value.checked=e)}validateCheckable(){let t=this.checkableGroup();t.forEach(n=>{if(!(n instanceof e))return;let r=n;r.inputRef?.value&&r.manageValidity(r.inputRef.value,t)})}coordinateRadioGroup(){this.name&&this.type===`radio`&&this.radioGroupMembers().forEach(t=>{t instanceof e?X(t.checked)&&(t.checked=!1,t.syncCheckedState()):t.checked&&=!1})}valueChecked(e){this.touched&&(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?this.checked=e===`true`:typeof e==`boolean`&&(this.checked=e),this.syncCheckedState(),this.validateCheckable(),this.onInput(),this.dispatchChangeEvents(this.checked))}warnInvalidValue(e){let t=typeof e==`object`?e?.constructor?.name??`object`:typeof e;console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${t}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`)}coerceToString(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):(e!=null&&this.warnInvalidValue(e),``)}valueChanged(e,t){let n=e;typeof n==`number`||typeof n==`boolean`?e=String(n):n!=null&&typeof n!=`string`&&!Array.isArray(n)&&this.warnInvalidValue(n),(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(Y)&&(e=e.split(Y)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value=``,this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==t?.toString()&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){let e=this.multiple||this.range?[]:``;this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent(`focus`,{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent(`blur`,{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e==`string`&&e.includes(Y)?e.split(Y):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(this.touched=!0,typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this._initialized&&this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=this._defaultCheckedState,this.syncCheckedState(),this.validateCheckable();else{this.writeFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),this.isCheckable&&this._initialized&&(e.has(`defaultChecked`)&&e.get(`defaultChecked`)!==void 0&&(this._defaultCheckedState=!!this.defaultChecked),e.has(`groupContext`)&&this.isRequired&&(this.internals.ariaRequired=`true`),[`checked`,`value`,`required`,`name`,`groupContext`].some(t=>e.has(t))&&(this.syncCheckedState(),this.validateCheckable())),e.has(`dataTestid`)&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute(`data-testid`)||this.setAttribute(`data-testid`,this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute(`data-testid`)))}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.toggleAttribute(`disabled`,this.disabled),this.syncGroupName(),!this._didInitDerivedState&&(this._didInitDerivedState=!0,this.defaultChecked&&(this.checked=!0),this.id&&!this.name&&(this.name=this.id,this.derivedName=this.id),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null))}firstUpdated(e){if(super.firstUpdated(e),this.defaultChecked&&(this.internals.ariaChecked=`true`),this.isRequired&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.checked!==void 0){let e=X(this.checked);this._defaultCheckedState=e,this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||q:null;this.writeFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.isCheckable?this.validateCheckable():this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value)),this.updateComplete.then(()=>{this._initialized=!0})}};e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`checked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`defaultChecked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`multiple`,void 0),e.n([e.u({type:Boolean})],$.prototype,`range`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`type`,void 0),e.n([e.u()],$.prototype,`defaultValue`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`required`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`max`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`maxlength`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`min`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`minlength`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`step`,void 0),e.n([e.u({type:String,attribute:`aria-describedby`})],$.prototype,`ariaDescribedby`,void 0),e.n([e.u({type:String,attribute:`aria-labelledby`})],$.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`name`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`pattern`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`placeholder`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`id`,void 0),e.n([e.u({type:Boolean,converter:r.n})],$.prototype,`counter`,void 0),e.n([e.u({type:Boolean})],$.prototype,`hasError`,void 0),e.n([e.u({type:Boolean})],$.prototype,`inline`,void 0),e.n([e.u({type:Boolean,converter:r.n})],$.prototype,`hasFieldset`,void 0),e.n([e.u({type:Boolean})],$.prototype,`optionalTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`requiredTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`skipForwardTestid`,void 0),e.n([e.u({type:Boolean,reflect:!0,converter:r.t})],$.prototype,`useWrapper`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`fullwidth`,void 0),e.n([e.u({type:Number})],$.prototype,`counterMaxLength`,void 0),e.n([e.u({type:String})],$.prototype,`errorMessage`,void 0),e.n([e.u({type:String})],$.prototype,`helptext`,void 0),e.n([e.u({type:String})],$.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:String})],$.prototype,`label`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`optionalText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`requiredText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`tagText`,void 0),e.n([e.u({type:String,attribute:`input-size`})],$.prototype,`inputSize`,void 0),e.n([e.u({type:String,attribute:`data-testid`,hasChanged:(e,t)=>!!e&&e!==t})],$.prototype,`dataTestid`,void 0),e.n([e.l()],$.prototype,`formDisabled`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
@@ -590,14 +590,16 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
|
|
|
590
590
|
valueChecked(e) {
|
|
591
591
|
this.touched && (this.type === "radio" && this.coordinateRadioGroup(), typeof e == "string" ? this.checked = e === "true" : typeof e == "boolean" && (this.checked = e), this.syncCheckedState(), this.validateCheckable(), this.onInput(), this.dispatchChangeEvents(this.checked));
|
|
592
592
|
}
|
|
593
|
+
warnInvalidValue(e) {
|
|
594
|
+
let t = typeof e == "object" ? e?.constructor?.name ?? "object" : typeof e;
|
|
595
|
+
console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${t}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`);
|
|
596
|
+
}
|
|
597
|
+
coerceToString(e) {
|
|
598
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : (e != null && this.warnInvalidValue(e), "");
|
|
599
|
+
}
|
|
593
600
|
valueChanged(e, t) {
|
|
594
601
|
let n = e;
|
|
595
|
-
|
|
596
|
-
else if (n != null && typeof n != "string" && !Array.isArray(n)) {
|
|
597
|
-
let e = typeof n == "object" ? n?.constructor?.name ?? "object" : typeof n;
|
|
598
|
-
console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${e}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`);
|
|
599
|
-
}
|
|
600
|
-
(t !== this.value || t !== this._value) && (typeof e == "string" ? ((this.multiple || this.range) && e.includes(Z) && (e = e.split(Z)), this.value = e, this._value = Array.isArray(e) ? e : [e]) : Array.isArray(e) ? (this.value = this.multiple || this.range ? e : e[0], this._value = e) : (this.value = "", this._value = []), (!this.value || this.value.length === 0) && t && t.length !== 0 ? this.clearInputValue() : this.value && this.value.toString() !== t?.toString() && this.onChange(this.value));
|
|
602
|
+
typeof n == "number" || typeof n == "boolean" ? e = String(n) : n != null && typeof n != "string" && !Array.isArray(n) && this.warnInvalidValue(n), (t !== this.value || t !== this._value) && (typeof e == "string" ? ((this.multiple || this.range) && e.includes(Z) && (e = e.split(Z)), this.value = e, this._value = Array.isArray(e) ? e : [e]) : Array.isArray(e) ? (this.value = this.multiple || this.range ? e : e[0], this._value = e) : (this.value = "", this._value = []), (!this.value || this.value.length === 0) && t && t.length !== 0 ? this.clearInputValue() : this.value && this.value.toString() !== t?.toString() && this.onChange(this.value));
|
|
601
603
|
}
|
|
602
604
|
dispatchChangeEvents(e) {
|
|
603
605
|
this.dispatchEvent(new Event("change", {
|
|
@@ -666,7 +668,7 @@ var X = "on", ve = "--checked", Z = ",", Q = (e) => e === !0 || e === "" || e ==
|
|
|
666
668
|
super.willUpdate(e), e.has("disabled") && this.toggleAttribute("disabled", this.disabled), this.syncGroupName(), !this._didInitDerivedState && (this._didInitDerivedState = !0, this.defaultChecked && (this.checked = !0), this.id && !this.name && (this.name = this.id, this.derivedName = this.id), this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null));
|
|
667
669
|
}
|
|
668
670
|
firstUpdated(e) {
|
|
669
|
-
if (super.firstUpdated(e), this.
|
|
671
|
+
if (super.firstUpdated(e), this.defaultChecked && (this.internals.ariaChecked = "true"), this.isRequired && (this.internals.ariaRequired = "true"), this.disabled && (this.internals.ariaDisabled = "true"), this.checked !== void 0) {
|
|
670
672
|
let e = Q(this.checked);
|
|
671
673
|
this._defaultCheckedState = e, this.internals.ariaChecked = String(e);
|
|
672
674
|
let t = e ? (typeof this.value == "string" ? this.value : "") || X : null;
|
|
@@ -761,7 +763,8 @@ t([n({
|
|
|
761
763
|
attribute: "input-size"
|
|
762
764
|
})], $.prototype, "inputSize", void 0), t([n({
|
|
763
765
|
type: String,
|
|
764
|
-
attribute: "data-testid"
|
|
766
|
+
attribute: "data-testid",
|
|
767
|
+
hasChanged: (e, t) => !!e && e !== t
|
|
765
768
|
})], $.prototype, "dataTestid", void 0), t([e()], $.prototype, "formDisabled", void 0);
|
|
766
769
|
//#endregion
|
|
767
770
|
export { $ as t };
|
|
@@ -3,11 +3,11 @@ import { t as a } from "./format-BTeSVkED.js";
|
|
|
3
3
|
import { i as o, n as s, t as c } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
4
4
|
import { t as l } from "./booleanish-OQJTYSrw.js";
|
|
5
5
|
import "./shared-types-A6iGIX-f.js";
|
|
6
|
-
import "./alert-
|
|
7
|
-
import { r as u } from "./icon-
|
|
6
|
+
import "./alert-BAaZIR3e.js";
|
|
7
|
+
import { r as u } from "./icon-CUU42bZ0.js";
|
|
8
8
|
import { t as d } from "./if-defined-D18nY_K_.js";
|
|
9
9
|
import { n as f } from "./utils-BwF4QSrq.js";
|
|
10
|
-
import "./helptext-
|
|
10
|
+
import "./helptext-BVYv8Lm9.js";
|
|
11
11
|
import { t as p } from "./focus-modality-controller-Dc2S-KqR.js";
|
|
12
12
|
//#region ../../shared-types/input-wrapper.ts
|
|
13
13
|
var m = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./alert-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./alert-Dy5N7qK-.cjs");const i=require("./icon-CrG6o7ZE.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./utils-63cRpWut.cjs");require("./helptext-BbrFE48Y.cjs");const s=require("./focus-modality-controller-C1ocyv2J.cjs");var c={counter:!1,counterCurrent:0,counterPosition:`bottom`,optionalTag:!1,requiredTag:!1,hasError:!1,disabled:!1,inline:!1,hasFieldset:!1,layout:`vertical`,useWrapper:!0,size:`medium`},l=e=>{let t=[];return e.hasHelptext&&t.push(`${e.id}-helptext`),e.hasCounter&&t.push(`${e.id}-counter-status`),e.ariaDescribedby&&t.push(e.ariaDescribedby),t.length?t.join(` `):void 0},u=e=>`${e}-counter-status`,d=(e,t)=>!!t&&t>0&&(e??0)>t,f=class extends n.t{constructor(...e){super(...e),this.forId=o.n(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=c.counter,this.counterCurrent=c.counterCurrent,this.counterMaxLength=0,this.counterError=null,this.counterPosition=c.counterPosition,this.optionalTag=c.optionalTag,this.requiredTag=c.requiredTag,this.tagText=null,this.hasError=c.hasError,this.errorMessage=``,this.disabled=c.disabled,this.inline=c.inline,this.ariaDescribedby=void 0,this.hasFieldset=c.hasFieldset,this.layout=c.layout,this.role=null,this.useWrapper=c.useWrapper,this.size=c.size,this.focusModality=new s.t(this)}updated(e){super.updated(e),this.classList.add(`pkt-inputwrapper`),this.classList.toggle(`pkt-inputwrapper--error`,this.hasError),this.classList.toggle(`pkt-inputwrapper--disabled`,this.disabled),this.classList.toggle(`pkt-inputwrapper--inline`,this.inline),this.classList.toggle(`pkt-inputwrapper--medium`,this.size===`medium`),this.classList.toggle(`pkt-inputwrapper--small`,this.size===`small`),this.classList.toggle(`pkt-inputwrapper--xsmall`,this.size===`xsmall`),this.role?this.setAttribute(`aria-labelledby`,`${this.forId}-label`):this.removeAttribute(`aria-labelledby`)}render(){let r=`pkt-tag pkt-tag--small pkt-tag--thin-text`,o=!!this.helptext||this.hasSlotContent(`helptext`),s=new Set([this.ariaDescribedby||(o?`${this.forId}-helptext`:``),this.hasError&&this.errorMessage?`${this.forId}-error`:``].join(` `).split(` `).filter(Boolean)),c=s.size?[...s].join(` `):e.h,l=this.pktStrings.get(`forms`),f=()=>e._`
|
|
2
2
|
${this.tagText?e._`<span class=${r+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
|
|
3
3
|
${this.optionalTag?e._`<span class=${r+` pkt-tag--blue-light`}
|
|
4
4
|
>${this.optionalText??l.optional}</span
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, n as r, u as i } from "./element-ckeMVgMz.js";
|
|
2
2
|
import { t as a } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { i as o, t as s } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
4
|
-
import "./icon-
|
|
4
|
+
import "./icon-CUU42bZ0.js";
|
|
5
5
|
import { t as c } from "./define-component-spec-BYOSeplU.js";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/components/link/link.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-CrG6o7ZE.cjs");const r=require("./define-component-spec-DBNd2FJY.cjs");var i={href:{type:`string`,description:`Mål-URL for lenken.`,required:!0,reactOnly:!0},className:{type:`string`,description:`CSS-klasser Punkt har satt på lenken.`,required:!0,reactOnly:!0},children:{type:`ReactNode`,description:`Innhold/label som skal rendres inni lenken.`,required:!0,reactOnly:!0},props:{type:`AnchorHTMLAttributes<HTMLAnchorElement>`,description:`Resten av anchor-attributter (f.eks. <code>onClick</code>, <code>aria-*</code>) som skal spreades på lenken.`,required:!0,reactOnly:!0}},a={name:`Egendefinert lenkekomponent`,description:`React: Funksjon for å rendre en egendefinert lenkekomponent (f.eks. Next.js Link eller React Router Link). Mottar et <code>IRenderLink</code>-objekt med href, className, children og props. Standard er et vanlig <code><a></code>-element.`,type:`(args: IRenderLink) => ReactNode`,relatedTypes:[`IRenderLink`],category:`tech`,reactOnly:!0},o={IRenderLink:{title:`IRenderLink`,description:`Objektet som sendes til <code>renderLink</code> i Link, BackLink og Breadcrumbs. Kun React — brukes til å bytte ut standard <code><a></code> med f.eks. Next.js Link eller React Router Link.`,properties:i}},s=r.t({name:`pkt-link`,react:`PktLink`,"css-class":`pkt-link`,"dark-mode":!0,isElement:!0,props:{href:{name:`URL`,description:`URL til lenken`,type:`string`,default:`#`,category:`contents`},target:{name:`Mål`,description:`Mål for lenken`,type:[`_blank`,`_self`,`_parent`,`_top`],default:`_self`,category:`tech`},iconName:{name:`Ikon`,description:`Ikon som skal vises ved siden av lenketeksten`,type:`icon`,category:`ui`},iconPosition:{name:`Ikonposisjon`,description:`Posisjonen til ikonet i forhold til lenketeksten`,type:[`left`,`right`],category:`ui`},renderLink:a},types:{...o},slots:{default:{description:`Innholdet i lenken`}}}).props,c=class extends n.t{constructor(...e){super(...e),this.href=s.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=s.target.default}render(){let r={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition===`left`||!(!this.iconName||this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition===`right`,"pkt-link--external":this.external},i=this.target&&this.target!==`_self`?this.target:e.h;return e._`<a
|
|
2
2
|
class=${t.t(r)}
|
|
3
3
|
href=${this.href}
|
|
4
4
|
target=${i}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-CrG6o7ZE.cjs");const n=require("./if-defined-CiML3MTM.cjs");var r=class extends t.t{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.external=!1,this.openInNewTab=!1,this.skin=void 0}render(){let r=[`pkt-linkcard`,this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(` `),i=[`pkt-linkcard__title`,this.external&&`pkt-link pkt-link--external`].filter(Boolean).join(` `),a=this.pktStrings.get(`linkcard`),o=this.openInNewTab?a.openInNewTab:``;return e._`
|
|
2
2
|
<a
|
|
3
3
|
href=${this.href}
|
|
4
4
|
class=${r}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as e, d as t, n, u as r } from "./element-ckeMVgMz.js";
|
|
2
2
|
import { i, t as a } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
3
|
-
import "./icon-
|
|
3
|
+
import "./icon-CUU42bZ0.js";
|
|
4
4
|
import { t as o } from "./if-defined-D18nY_K_.js";
|
|
5
5
|
//#region src/components/linkcard/linkcard.ts
|
|
6
6
|
var s = class extends a {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const i=require("./icon-CrG6o7ZE.cjs");var a={delay:0,inline:!1,isLoading:!0,message:null,size:`medium`,variant:`rainbow`};typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/latest/animations/`);var o=`isloading`,s=`loadinganimationpath`,c=class extends n.t{constructor(...e){super(...e),this.delay=a.delay,this.inline=a.inline,this.isLoading=a.isLoading,this.message=a.message,this.size=a.size,this.variant=a.variant,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:i.i,this._shouldDisplayLoader=!1}static get observedAttributes(){return[...super.observedAttributes,o,s]}attributeChangedCallback(e,t,n){e===o?this.isLoading=r.t.fromAttribute(n):e===s?this.loadingAnimationPath=n??void 0:super.attributeChangedCallback(e,t,n)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has(`delay`)&&this.setupLoader()}render(){let r=t.t({"pkt-loader":!0,[`pkt-loader--${this.inline?`inline`:`box`}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=t.t({"pkt-contents":!0,"pkt-hide":this.isLoading});return e._`<div
|
|
2
|
+
role="status"
|
|
3
|
+
aria-live="polite"
|
|
4
|
+
aria-busy=${this.isLoading?`true`:`false`}
|
|
5
|
+
class=${r}
|
|
6
|
+
>
|
|
7
|
+
${this.isLoading&&this._shouldDisplayLoader?e._`<div class="pkt-loader__spinner">
|
|
8
|
+
<pkt-icon
|
|
9
|
+
name=${this.getVariant(this.variant)}
|
|
10
|
+
path=${this.loadingAnimationPath}
|
|
11
|
+
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
12
|
+
></pkt-icon>
|
|
13
|
+
${this.message&&e._`<p>${this.message}</p>`}
|
|
14
|
+
</div>`:e.h}
|
|
15
|
+
<div class=${i}>${n.i(this)}</div>
|
|
16
|
+
</div>`}getVariant(e){switch(e){case`blue`:return`spinner-blue`;case`rainbow`:return`spinner`;default:return`loader`}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};e.n([e.u({type:Number})],c.prototype,`delay`,void 0),e.n([e.u({type:Boolean})],c.prototype,`inline`,void 0),e.n([e.u({type:Boolean,attribute:`is-loading`,converter:r.t})],c.prototype,`isLoading`,void 0),e.n([e.u({type:String})],c.prototype,`message`,void 0),e.n([e.u({type:String})],c.prototype,`size`,void 0),e.n([e.u({type:String})],c.prototype,`variant`,void 0),e.n([e.u({type:String,attribute:`loading-animation-path`})],c.prototype,`loadingAnimationPath`,void 0),e.n([e.l()],c.prototype,`_shouldDisplayLoader`,void 0);try{e.d(`pkt-loader`)(c)}catch{console.warn(`Forsøker å definere <pkt-loader>, 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,34 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
|
|
2
2
|
import { t as o } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { i as s, t as c } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
4
|
-
import "./
|
|
4
|
+
import { t as l } from "./booleanish-OQJTYSrw.js";
|
|
5
|
+
import "./shared-types-A6iGIX-f.js";
|
|
6
|
+
import { i as u } from "./icon-CUU42bZ0.js";
|
|
7
|
+
//#region ../../shared-types/loader.ts
|
|
8
|
+
var d = {
|
|
9
|
+
delay: 0,
|
|
10
|
+
inline: !1,
|
|
11
|
+
isLoading: !0,
|
|
12
|
+
message: null,
|
|
13
|
+
size: "medium",
|
|
14
|
+
variant: "rainbow"
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
5
17
|
//#region src/components/loader/loader.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var u = class extends c {
|
|
18
|
+
typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/");
|
|
19
|
+
var f = "isloading", p = "loadinganimationpath", m = class extends c {
|
|
9
20
|
constructor(...e) {
|
|
10
|
-
super(...e), this.delay =
|
|
21
|
+
super(...e), this.delay = d.delay, this.inline = d.inline, this.isLoading = d.isLoading, this.message = d.message, this.size = d.size, this.variant = d.variant, this.loadingAnimationPath = typeof window < "u" ? window.pktAnimationPath : u, this._shouldDisplayLoader = !1;
|
|
22
|
+
}
|
|
23
|
+
static get observedAttributes() {
|
|
24
|
+
return [
|
|
25
|
+
...super.observedAttributes,
|
|
26
|
+
f,
|
|
27
|
+
p
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
attributeChangedCallback(e, t, n) {
|
|
31
|
+
e === f ? this.isLoading = l.fromAttribute(n) : e === p ? this.loadingAnimationPath = n ?? void 0 : super.attributeChangedCallback(e, t, n);
|
|
11
32
|
}
|
|
12
33
|
connectedCallback() {
|
|
13
34
|
super.connectedCallback(), this._shouldDisplayLoader = this.delay === 0, this.delay > 0 && this.setupLoader();
|
|
@@ -54,14 +75,21 @@ var u = class extends c {
|
|
|
54
75
|
}, this.delay));
|
|
55
76
|
}
|
|
56
77
|
};
|
|
57
|
-
i([a({ type: Number })],
|
|
78
|
+
i([a({ type: Number })], m.prototype, "delay", void 0), i([a({ type: Boolean })], m.prototype, "inline", void 0), i([a({
|
|
79
|
+
type: Boolean,
|
|
80
|
+
attribute: "is-loading",
|
|
81
|
+
converter: l
|
|
82
|
+
})], m.prototype, "isLoading", void 0), i([a({ type: String })], m.prototype, "message", void 0), i([a({ type: String })], m.prototype, "size", void 0), i([a({ type: String })], m.prototype, "variant", void 0), i([a({
|
|
83
|
+
type: String,
|
|
84
|
+
attribute: "loading-animation-path"
|
|
85
|
+
})], m.prototype, "loadingAnimationPath", void 0), i([r()], m.prototype, "_shouldDisplayLoader", void 0);
|
|
58
86
|
try {
|
|
59
|
-
t("pkt-loader")(
|
|
87
|
+
t("pkt-loader")(m);
|
|
60
88
|
} catch {
|
|
61
89
|
console.warn("Forsøker å definere <pkt-loader>, men den er allerede definert");
|
|
62
90
|
}
|
|
63
91
|
//#endregion
|
|
64
92
|
//#region src/components/loader/index.ts
|
|
65
|
-
var
|
|
93
|
+
var h = m;
|
|
66
94
|
//#endregion
|
|
67
|
-
export {
|
|
95
|
+
export { m as n, h as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./icon-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./icon-CrG6o7ZE.cjs");const r=require("./classutils-CbklAJDe.cjs");var i={skin:`beige`,compact:!1,closable:!1},a=class extends n.t{constructor(){super(),this.closable=i.closable,this.compact=i.compact,this.title=``,this.skin=i.skin,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0}))},this._isClosed=!1}updated(e){super.updated(e),e.has(`_isClosed`)&&r.t(this,`pkt-hide`,this._isClosed)}render(){let r={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:!!this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e._`<div class=${t.t(r)}>
|
|
2
2
|
${this.closable?e._`<div class="pkt-messagebox__close">
|
|
3
3
|
<button
|
|
4
4
|
@click=${this.close}
|
|
@@ -2,7 +2,7 @@ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVg
|
|
|
2
2
|
import { t as o } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { i as s, t as c } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
4
4
|
import "./shared-types-A6iGIX-f.js";
|
|
5
|
-
import "./icon-
|
|
5
|
+
import "./icon-CUU42bZ0.js";
|
|
6
6
|
import { t as l } from "./classutils-DcYnSgfc.js";
|
|
7
7
|
//#region ../../shared-types/messagebox.ts
|
|
8
8
|
var u = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n,
|
|
2
|
-
import { t as
|
|
3
|
-
import { i as
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
var
|
|
1
|
+
import { _ as e, d as t, h as n, n as r, u as i } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as a } from "./class-map-BkEYw5uE.js";
|
|
3
|
+
import { i as o, t as s } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
4
|
+
import "./icon-CUU42bZ0.js";
|
|
5
|
+
import { t as c } from "./if-defined-D18nY_K_.js";
|
|
6
|
+
import { n as l, t as u } from "./ref-D4OwQYdf.js";
|
|
7
|
+
import { n as d } from "./utils-BwF4QSrq.js";
|
|
8
|
+
import { n as f, t as p } from "./scroll-lock-CR-g54ai.js";
|
|
9
|
+
var m = {
|
|
10
10
|
name: "pkt-modal",
|
|
11
11
|
react: "PktModal",
|
|
12
12
|
"css-class": "pkt-modal",
|
|
@@ -105,11 +105,11 @@ var h = {
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
slots: { default: { description: "Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen." } }
|
|
108
|
-
},
|
|
108
|
+
}, h = class extends s {
|
|
109
109
|
constructor() {
|
|
110
|
-
super(), this.open = !1, this.headingText = "", this.removePadding = !1, this.hideCloseButton =
|
|
110
|
+
super(), this.open = !1, this.headingText = "", this.removePadding = !1, this.hideCloseButton = m.props.hideCloseButton.default, this.closeOnBackdropClick = m.props.closeOnBackdropClick.default, this.closeButtonSkin = "blue", this.size = m.props.size.default, this.variant = "dialog", this.drawerPosition = "right", this.transparentBackdrop = !1, this.dialogRef = u(), this._scrollLockToken = p(), this._idSuffix = d(), this._headingId = `pkt-modal__headingText-${this._idSuffix}`, this._contentId = `pkt-modal__content-${this._idSuffix}`, this._isOpen = !1, this.close = (e, t = !1) => {
|
|
111
111
|
if (!this._isOpen) return;
|
|
112
|
-
this._isOpen = !1, this.open = !1,
|
|
112
|
+
this._isOpen = !1, this.open = !1, f(this._scrollLockToken, !1);
|
|
113
113
|
let n = document.activeElement;
|
|
114
114
|
n && !this.isElementInViewport(n) && n.scrollIntoView({
|
|
115
115
|
behavior: "smooth",
|
|
@@ -118,20 +118,20 @@ var h = {
|
|
|
118
118
|
detail: { origin: e },
|
|
119
119
|
bubbles: !0,
|
|
120
120
|
composed: !0
|
|
121
|
-
})), t || this.dialogRef.value?.close()
|
|
121
|
+
})), t || this.dialogRef.value?.close();
|
|
122
122
|
}, this.showModal = (e = null) => {
|
|
123
|
-
this._isOpen = !0, this.open = !0, this.dialogRef.value?.showModal(),
|
|
123
|
+
this._isOpen = !0, this.open = !0, this.dialogRef.value?.showModal(), f(this._scrollLockToken, !0), this.dispatchEvent(new CustomEvent("showModal", {
|
|
124
124
|
detail: { origin: e },
|
|
125
125
|
bubbles: !0,
|
|
126
126
|
composed: !0
|
|
127
|
-
}))
|
|
127
|
+
}));
|
|
128
128
|
}, this._isOpen = !1;
|
|
129
129
|
}
|
|
130
130
|
async connectedCallback() {
|
|
131
131
|
super.connectedCallback(), document.addEventListener("keydown", this.handleKeyDown.bind(this)), document.addEventListener("click", this.handleBackdropClick.bind(this));
|
|
132
132
|
}
|
|
133
133
|
disconnectedCallback() {
|
|
134
|
-
super.disconnectedCallback(), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("click", this.handleBackdropClick),
|
|
134
|
+
super.disconnectedCallback(), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("click", this.handleBackdropClick), f(this._scrollLockToken, !1);
|
|
135
135
|
}
|
|
136
136
|
updated(e) {
|
|
137
137
|
super.updated(e), e.has("open") && (this.open && !this._isOpen ? this.showModal() : !this.open && this._isOpen && this.close(new Event("close"), !1));
|
|
@@ -168,18 +168,18 @@ var h = {
|
|
|
168
168
|
}, i = this.headingIconName ? e`<pkt-icon
|
|
169
169
|
class="pkt-modal__headingIcon"
|
|
170
170
|
name=${this.headingIconName}
|
|
171
|
-
path=${
|
|
172
|
-
></pkt-icon>` : n,
|
|
171
|
+
path=${c(this.headingIconPath)}
|
|
172
|
+
></pkt-icon>` : n, s = {
|
|
173
173
|
"pkt-modal__content": !0,
|
|
174
174
|
"pkt-txt-18-light": !0
|
|
175
|
-
},
|
|
175
|
+
}, u = this.closeButtonSkin === "blue", d = {
|
|
176
176
|
"pkt-modal__closeButton": !0,
|
|
177
177
|
[`pkt-modal__closeButton--${this.closeButtonSkin}`]: !0
|
|
178
178
|
};
|
|
179
179
|
return e`
|
|
180
180
|
<dialog
|
|
181
|
-
class=${
|
|
182
|
-
${
|
|
181
|
+
class=${a(t)}
|
|
182
|
+
${l(this.dialogRef)}
|
|
183
183
|
aria-labelledby=${this.headingText ? this._headingId : n}
|
|
184
184
|
aria-describedby=${this._contentId}
|
|
185
185
|
@close=${(e) => this.close(e, !0)}
|
|
@@ -187,41 +187,41 @@ var h = {
|
|
|
187
187
|
<div class="pkt-modal__wrapper">
|
|
188
188
|
${this.headingText || !this.hideCloseButton ? e`<div class="pkt-modal__header">
|
|
189
189
|
<div class="pkt-modal__header-background"></div>
|
|
190
|
-
${this.headingText ? e`<h1 id=${this._headingId} class=${
|
|
190
|
+
${this.headingText ? e`<h1 id=${this._headingId} class=${a(r)}>
|
|
191
191
|
${i}${this.headingText}
|
|
192
192
|
</h1>` : e`<div class="pkt-modal__headingText"></div>`}
|
|
193
|
-
${this.hideCloseButton ? e`<div class="pkt-modal__noCloseButton"></div>` : e`<div class="${
|
|
193
|
+
${this.hideCloseButton ? e`<div class="pkt-modal__noCloseButton"></div>` : e`<div class="${a(d)}">
|
|
194
194
|
<pkt-button
|
|
195
195
|
@click=${(e) => this.close(e)}
|
|
196
196
|
aria-label=${this.pktStrings.get("generic").close}
|
|
197
197
|
iconname="close"
|
|
198
198
|
variant="icon-only"
|
|
199
199
|
size="medium"
|
|
200
|
-
skin=${
|
|
200
|
+
skin=${u ? "tertiary" : "primary"}
|
|
201
201
|
>
|
|
202
202
|
${this.pktStrings.get("generic").close}
|
|
203
203
|
</pkt-button>
|
|
204
204
|
</div>`}
|
|
205
205
|
</div>` : n}
|
|
206
206
|
<div class="pkt-modal__container">
|
|
207
|
-
<div id=${this._contentId} class=${
|
|
207
|
+
<div id=${this._contentId} class=${a(s)}>${o(this)}</div>
|
|
208
208
|
</div>
|
|
209
209
|
</div>
|
|
210
210
|
</dialog>
|
|
211
211
|
`;
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
|
-
|
|
214
|
+
r([i({
|
|
215
215
|
type: Boolean,
|
|
216
216
|
reflect: !0
|
|
217
|
-
})],
|
|
217
|
+
})], h.prototype, "open", void 0), r([i({ type: String })], h.prototype, "headingText", void 0), r([i({ type: String })], h.prototype, "headingIconName", void 0), r([i({ type: String })], h.prototype, "headingIconPath", void 0), r([i({ type: Boolean })], h.prototype, "removePadding", void 0), r([i({ type: Boolean })], h.prototype, "hideCloseButton", void 0), r([i({ type: Boolean })], h.prototype, "closeOnBackdropClick", void 0), r([i({ type: String })], h.prototype, "closeButtonSkin", void 0), r([i({ type: String })], h.prototype, "size", void 0), r([i({ type: String })], h.prototype, "variant", void 0), r([i({ type: String })], h.prototype, "drawerPosition", void 0), r([i({ type: Boolean })], h.prototype, "transparentBackdrop", void 0);
|
|
218
218
|
try {
|
|
219
|
-
t("pkt-modal")(
|
|
219
|
+
t("pkt-modal")(h);
|
|
220
220
|
} catch {
|
|
221
221
|
console.warn("Forsøker å definere <pkt-modal>, men den er allerede definert");
|
|
222
222
|
}
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/components/modal/index.ts
|
|
225
|
-
var
|
|
225
|
+
var g = h;
|
|
226
226
|
//#endregion
|
|
227
|
-
export {
|
|
227
|
+
export { h as n, g as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-CrG6o7ZE.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./ref-CB7e9nMY.cjs"),a=require("./utils-63cRpWut.cjs"),o=require("./scroll-lock-x0VxhKWZ.cjs");var s={name:`pkt-modal`,react:`PktModal`,"css-class":`pkt-modal`,isElement:!0,isPureReact:!0,events:{"background-click":{description:`Event som trigges når bakgrunnen trykkes på`},close:{description:`Event som trigges når meldingsboksen lukkes`}},props:{open:{name:`Åpen`,description:`Deklarativ styring av modalens åpen/lukket-tilstand. Kan brukes i stedet for showModal()/close()-metodene.`,type:`boolean`,category:`tech`,default:!1},headingText:{name:`Heading text`,description:`Heading tekst på modalen`,type:`string`,category:`contents`},headingIconName:{name:`Ikon i overskriften`,description:`Navn på ikonet som vises foran overskriften. Vises bare når headingText er satt.`,type:`icon`,category:`ui`},headingIconPath:{name:`Ikon-sti for overskriften`,description:`Overstyr stien til ikonet i overskriften. Kan også settes globalt med window.pktIconPath.`,type:`string`,category:`tech`},hideCloseButton:{name:`Gjem 'Lukk'-knapp`,description:`Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.`,type:`boolean`,category:`ui`,default:!1},closeOnBackdropClick:{name:`Lukk modalen når bakgrunnen trykkes på`,description:`Lukk modalen når bakgrunnen trykkes på`,type:`boolean`,category:`tech`,default:!1},closeButtonSkin:{name:`Stil på lukkeknappen`,description:`Stil på lukkeknappen`,type:[`blue`,`yellow-filled`],category:`ui`,default:`blue`},size:{name:`Størrelse`,description:`Størrelsen på modalen`,type:[`small`,`medium`,`large`,`fit-content`],category:`ui`,default:`medium`},variant:{name:`Variant`,description:`Standard dialog eller skuff`,type:[`dialog`,`drawer`],category:`ui`,default:`dialog`},drawerPosition:{name:`Skuffposisjon`,description:`Posisjonen til skuffen`,type:[`left`,`right`],category:`ui`,default:`right`},transparentBackdrop:{name:`Gjennomsiktig bakgrunn`,description:`Bakgrunnen er gjennomsiktig`,type:`boolean`,category:`ui`,default:!1},removePadding:{name:`Fjern padding`,description:`Fjerner paddingen rundt innholdet i modalen`,type:`boolean`,category:`ui`,default:!1}},slots:{default:{description:`Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen.`}}},c=class extends n.t{constructor(){super(),this.open=!1,this.headingText=``,this.removePadding=!1,this.hideCloseButton=s.props.hideCloseButton.default,this.closeOnBackdropClick=s.props.closeOnBackdropClick.default,this.closeButtonSkin=`blue`,this.size=s.props.size.default,this.variant=`dialog`,this.drawerPosition=`right`,this.transparentBackdrop=!1,this.dialogRef=i.t(),this._scrollLockToken=o.t(),this._idSuffix=a.n(),this._headingId=`pkt-modal__headingText-${this._idSuffix}`,this._contentId=`pkt-modal__content-${this._idSuffix}`,this._isOpen=!1,this.close=(e,t=!1)=>{if(!this._isOpen)return;this._isOpen=!1,this.open=!1,o.n(this._scrollLockToken,!1);let n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:`smooth`,block:`nearest`}),this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),t||this.dialogRef.value?.close()},this.showModal=(e=null)=>{this._isOpen=!0,this.open=!0,this.dialogRef.value?.showModal(),o.n(this._scrollLockToken,!0),this.dispatchEvent(new CustomEvent(`showModal`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener(`keydown`,this.handleKeyDown.bind(this)),document.addEventListener(`click`,this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`click`,this.handleBackdropClick),o.n(this._scrollLockToken,!1)}updated(e){super.updated(e),e.has(`open`)&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event(`close`),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&(`document`in window&&`createElement`in document&&(await Promise.resolve().then(()=>require("./dialog-polyfill.esm-CW51hN2p.cjs")).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener(`close`,()=>{this.close(new Event(`close`),!0)}))}handleKeyDown(e){e.key===`Escape`&&this.close(e)}handleBackdropClick(e){this.closeOnBackdropClick&&e.target===this.dialogRef?.value&&this.close(e)}isElementInViewport(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){let a={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===``||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin===`yellow-filled`,"pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant===`drawer`},o={"pkt-modal__headingText":!0,"pkt-txt-24":!0,"pkt-modal__headingText--hasIcon":!!this.headingIconName},s=this.headingIconName?e._`<pkt-icon
|
|
2
2
|
class="pkt-modal__headingIcon"
|
|
3
3
|
name=${this.headingIconName}
|
|
4
4
|
path=${r.t(this.headingIconPath)}
|
|
@@ -34,4 +34,4 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
</dialog>
|
|
37
|
-
`}};e.n([e.u({type:Boolean,reflect:!0})],c.prototype,`open`,void 0),e.n([e.u({type:String})],c.prototype,`headingText`,void 0),e.n([e.u({type:String})],c.prototype,`headingIconName`,void 0),e.n([e.u({type:String})],c.prototype,`headingIconPath`,void 0),e.n([e.u({type:Boolean})],c.prototype,`removePadding`,void 0),e.n([e.u({type:Boolean})],c.prototype,`hideCloseButton`,void 0),e.n([e.u({type:Boolean})],c.prototype,`closeOnBackdropClick`,void 0),e.n([e.u({type:String})],c.prototype,`closeButtonSkin`,void 0),e.n([e.u({type:String})],c.prototype,`size`,void 0),e.n([e.u({type:String})],c.prototype,`variant`,void 0),e.n([e.u({type:String})],c.prototype,`drawerPosition`,void 0),e.n([e.u({type:Boolean})],c.prototype,`transparentBackdrop`,void 0)
|
|
37
|
+
`}};e.n([e.u({type:Boolean,reflect:!0})],c.prototype,`open`,void 0),e.n([e.u({type:String})],c.prototype,`headingText`,void 0),e.n([e.u({type:String})],c.prototype,`headingIconName`,void 0),e.n([e.u({type:String})],c.prototype,`headingIconPath`,void 0),e.n([e.u({type:Boolean})],c.prototype,`removePadding`,void 0),e.n([e.u({type:Boolean})],c.prototype,`hideCloseButton`,void 0),e.n([e.u({type:Boolean})],c.prototype,`closeOnBackdropClick`,void 0),e.n([e.u({type:String})],c.prototype,`closeButtonSkin`,void 0),e.n([e.u({type:String})],c.prototype,`size`,void 0),e.n([e.u({type:String})],c.prototype,`variant`,void 0),e.n([e.u({type:String})],c.prototype,`drawerPosition`,void 0),e.n([e.u({type:Boolean})],c.prototype,`transparentBackdrop`,void 0);try{e.d(`pkt-modal`)(c)}catch{console.warn(`Forsøker å definere <pkt-modal>, 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,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-B0Vp_OuR.cjs"),n=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./input-wrapper-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-B0Vp_OuR.cjs"),n=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./input-wrapper-QzdntWJX.cjs");const r=require("./utils-63cRpWut.cjs");var i={layout:`vertical`,inputSize:`medium`,hasTile:!1,required:!1,disabled:!1,hasError:!1,useWrapper:!0,requiredTag:!1,optionalTag:!1},a=[`change`,`input`,`value-change`,`focus`,`blur`];function o(e){return e.checked===void 0?e.hasAttribute(`checked`):e.checked===!0||e.checked===``||e.checked===`true`}function s(e){return(typeof e.value==`string`?e.value:e.getAttribute(`value`))||`on`}function c(e){return e.hasAttribute(`disabled`)||e.matches(`:disabled`)}var l=class extends t.t{get groupName(){return this.name||this.id||this.generatedId}options(){return Array.from(this.querySelectorAll(this.optionSelector))}createGroupContext(){return{name:this.groupName,hasTile:this.hasTile,hasError:this.hasError}}syncValidity(){}constructor(){super(),this.name=``,this.label=``,this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=null,this.hasError=i.hasError,this.errorMessage=``,this.disabled=i.disabled,this.required=i.required,this.hasTile=i.hasTile,this.layout=i.layout,this.inputSize=i.inputSize,this.useWrapper=i.useWrapper,this.optionalTag=i.optionalTag,this.requiredTag=i.requiredTag,this.tagText=null,this.generatedId=r.n(),this.knownOptions=new Set,this.resetForm=null,this.handleFormReset=()=>{setTimeout(()=>{this.hasStoredValue&&this.storeCurrentValue(),this.syncValidity()})},this.relayOptionEvent=e=>{let t=e.target;if(!t||t===this||!t.matches(this.optionSelector))return;e.stopImmediatePropagation();let n={bubbles:!0,composed:!0};e.type===`change`?(this.storeCurrentValue(),this.syncValidity(),this.dispatchEvent(new Event(`change`,n))):e.type===`input`?this.dispatchEvent(new InputEvent(`input`,n)):e.type===`value-change`&&this.dispatchEvent(new CustomEvent(`value-change`,{...n,detail:this.value}))},this.handleFocusIn=e=>{this.contains(e.relatedTarget)||this.dispatchEvent(new FocusEvent(`focus`,{bubbles:!0,composed:!0,relatedTarget:e.relatedTarget}))},this.handleFocusOut=e=>{this.contains(e.relatedTarget)||this.dispatchEvent(new FocusEvent(`blur`,{bubbles:!0,composed:!0,relatedTarget:e.relatedTarget}))};for(let e of a)this.addEventListener(e,this.relayOptionEvent);this.addEventListener(`focusin`,this.handleFocusIn),this.addEventListener(`focusout`,this.handleFocusOut)}disconnectedCallback(){super.disconnectedCallback(),this.watchFormReset(null)}focus(e){let t=this.options();(t.find(e=>o(e)&&!c(e))??t.find(e=>!c(e)))?.querySelector(`input`)?.focus(e)}willUpdate(e){super.willUpdate(e);let t=this.createGroupContext(),n=this.groupContext;(!n||Object.keys(t).some(e=>t[e]!==n[e]))&&(this.groupContext=t)}updated(e){super.updated(e);let t=this.options(),n=t.filter(e=>!this.knownOptions.has(e));this.knownOptions=new Set(t),this.hasStoredValue&&n.length&&this.applyStoredValue(n),this.syncValidity(),this.watchFormReset(t[0]?.form??null)}watchFormReset(e){e!==this.resetForm&&(this.resetForm?.removeEventListener(`reset`,this.handleFormReset),this.resetForm=e,this.resetForm?.addEventListener(`reset`,this.handleFormReset))}render(){return e._`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
${t.n(this,[null,`helptext`])}
|
|
4
4
|
.strings=${this.strings}
|
|
@@ -2,7 +2,7 @@ import { _ as e, n as t, u as n } from "./element-ckeMVgMz.js";
|
|
|
2
2
|
import { n as r, t as i } from "./element-with-slot-Dp2Gzv-Q.js";
|
|
3
3
|
import { t as a } from "./booleanish-OQJTYSrw.js";
|
|
4
4
|
import "./shared-types-A6iGIX-f.js";
|
|
5
|
-
import "./input-wrapper-
|
|
5
|
+
import "./input-wrapper-CHwWQgZP.js";
|
|
6
6
|
import { n as o } from "./utils-BwF4QSrq.js";
|
|
7
7
|
//#region ../../shared-types/option-group.ts
|
|
8
8
|
var s = {
|
package/dist/pkt-accordion.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./accordion-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./accordion-Bg4CMrUM.cjs");exports.PktAccordion=e.r,exports.PktAccordionItem=e.n,exports.default=e.t;
|
package/dist/pkt-accordion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as PktAccordion, n as PktAccordionItem, t as default } from "./accordion-
|
|
1
|
+
export { r as PktAccordion, n as PktAccordionItem, t as default } from "./accordion-BHVzR-6Z.js";
|