@oslokommune/punkt-elements 13.6.12 → 13.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/{accordionitem-B_h5XGCo.js → accordionitem-C_URrDjP.js} +4 -4
- package/dist/{accordionitem-BOmnm80g.cjs → accordionitem-DCZrHVNR.cjs} +1 -1
- package/dist/{alert-ZP5-fqlt.cjs → alert-Ci7WvRXi.cjs} +1 -1
- package/dist/{alert-CTTm6ugp.js → alert-Dh1YhaBq.js} +13 -26
- package/dist/{backlink-BT7DO6rV.cjs → backlink-BzEvli8m.cjs} +1 -1
- package/dist/{backlink-Bq8O2bt8.js → backlink-CI_jMGzZ.js} +3 -3
- package/dist/{button-x6Xw-5w0.js → button-CCFAUJa0.js} +5 -5
- package/dist/{button-BfqxLnMT.cjs → button-CXJQ_Wgl.cjs} +1 -1
- package/dist/calendar-BaMrdMDZ.cjs +115 -0
- package/dist/{calendar-CodWwTHM.js → calendar-DtJh7UYD.js} +532 -480
- package/dist/{card-B9RPShvV.cjs → card-Cf-UcGAP.cjs} +1 -1
- package/dist/{card-en2KhOPO.js → card-M1X36b6i.js} +8 -26
- package/dist/{checkbox-CH8xeK-0.cjs → checkbox-CTxc8wQe.cjs} +1 -1
- package/dist/{checkbox-DSAcMC-D.js → checkbox-_5LbXU7N.js} +4 -4
- package/dist/class-map-C_erArZz.cjs +5 -0
- package/dist/{class-map-Dw6Wrxwi.js → class-map-wy7PUk0P.js} +3 -3
- package/dist/{combobox-BFOjlFIj.cjs → combobox-BJ1gA0f0.cjs} +1 -1
- package/dist/{combobox-DaiEdUKx.js → combobox-Ct0NNY1p.js} +12 -16
- package/dist/{consent-CXp0bLvg.js → consent-B2hIQh4b.js} +3 -3
- package/dist/{consent-DFrsiYGQ.cjs → consent-BeOjxQdR.cjs} +1 -1
- package/dist/datepicker-B8mifBAm.js +1374 -0
- package/dist/datepicker-DVqmQAOe.cjs +289 -0
- package/dist/directive-helpers-4oOjKnGY.cjs +5 -0
- package/dist/directive-helpers-BzAtj9by.js +38 -0
- package/dist/{element-D62wHiNU.cjs → element-CJ_QKaki.cjs} +6 -6
- package/dist/{element-DJZPsA_J.js → element-CRDRygXu.js} +47 -132
- package/dist/{heading-H_FWjo2k.cjs → heading--JKFppLS.cjs} +1 -1
- package/dist/{heading-DQ0R34j4.js → heading-Cs5yGnJg.js} +1 -1
- package/dist/{helptext-D1fkGmfT.cjs → helptext-CVQP3pis.cjs} +1 -1
- package/dist/{helptext-8ykxyegi.js → helptext-DuvVSH7d.js} +6 -6
- package/dist/icon-1dy7UZcu.js +89 -0
- package/dist/icon-BGuizDwk.cjs +9 -0
- package/dist/{if-defined-D3lgJqT7.js → if-defined-BWZGb3bh.js} +1 -1
- package/dist/{if-defined-CkVc_RJD.cjs → if-defined-Bc9-_I01.cjs} +1 -1
- package/dist/index.d.ts +98 -6
- package/dist/input-element-BcFmygSF.js +707 -0
- package/dist/input-element-j9znzLWz.cjs +1 -0
- package/dist/{input-wrapper-DVjNwf8-.cjs → input-wrapper-BsQ7oFMd.cjs} +1 -1
- package/dist/input-wrapper-CDgenrYA.js +6 -0
- package/dist/{input-wrapper-CQzXG44g.js → input-wrapper-CKJU0QWG.js} +8 -8
- package/dist/{link-CyiVlb-7.cjs → link-Da3pZ_CW.cjs} +1 -1
- package/dist/{link-DSSJYrtn.js → link-DzZCw8j2.js} +9 -16
- package/dist/{linkcard-fH9uydjS.cjs → linkcard-BM23gzhS.cjs} +1 -1
- package/dist/{linkcard-g8JtooPU.js → linkcard-RIK5xqbd.js} +4 -4
- package/dist/{listbox-L-iOSF7M.cjs → listbox-CsGiqzD0.cjs} +1 -1
- package/dist/{listbox-n4wjlLqD.js → listbox-DlJevu8O.js} +5 -5
- package/dist/{loader-Bzf1sPSg.js → loader-BVvBzaPI.js} +5 -5
- package/dist/{loader-C-3l7kb9.cjs → loader-Bo8RCbCJ.cjs} +1 -1
- package/dist/{messagebox---xPIAwR.cjs → messagebox-C76IcXTl.cjs} +1 -1
- package/dist/{messagebox-okJLeSpj.js → messagebox-DwdMXoAe.js} +6 -16
- package/dist/{modal-pohCsr_x.js → modal-BGXk3f9u.js} +6 -16
- package/dist/{modal-IjDRQfX1.cjs → modal-Cdz9JcCX.cjs} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- 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-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +8 -4
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +29 -29
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.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/{progressbar-DjsupQ7Y.js → progressbar-BbVei20_.js} +7 -7
- package/dist/{progressbar-DJzEC7cx.cjs → progressbar-CazcIzVT.cjs} +2 -2
- package/dist/{radiobutton-DEboKECm.cjs → radiobutton-D1fihs8R.cjs} +1 -1
- package/dist/{radiobutton-Bz_qApF3.js → radiobutton-DODROIBF.js} +5 -5
- package/dist/{ref-BfgcOXko.cjs → ref-BFa5Utho.cjs} +1 -1
- package/dist/{ref-BCGCor-j.js → ref-Xa5dbh--.js} +2 -2
- package/dist/repeat-BZb41H64.cjs +5 -0
- package/dist/{repeat-B6qPUgAq.js → repeat-CJ79egkN.js} +8 -8
- package/dist/{select-DKkoxmgj.js → select-BG2MBQbh.js} +6 -6
- package/dist/{select-DynzsPo0.cjs → select-D-m1PhpA.cjs} +1 -1
- package/dist/{state-CPQXJ4Ct.js → state-DS_kr2Fy.js} +1 -1
- package/dist/{state-BkE_Rxl7.cjs → state-DSjcvzDN.cjs} +1 -1
- package/dist/{tag-NZ5oeGfw.js → tag-CqMgt01I.js} +7 -20
- package/dist/{tag-BKq07hGI.cjs → tag-EFUKrc8q.cjs} +2 -2
- package/dist/{textarea-COG1CH_s.js → textarea-DCKKhs1B.js} +9 -9
- package/dist/{textarea-BS1tgktz.cjs → textarea-aUG3S7C2.cjs} +1 -1
- package/dist/{textinput-CTOtfcTR.js → textinput-B5Ai5R8L.js} +8 -8
- package/dist/{textinput-CCK8ti2y.cjs → textinput-mUERucRy.cjs} +1 -1
- package/package.json +15 -7
- package/src/components/combobox/combobox.ts +1 -1
- package/src/components/datepicker/datepicker-multiple.ts +202 -0
- package/src/components/datepicker/datepicker-range.ts +281 -0
- package/src/components/datepicker/datepicker-single.ts +198 -0
- package/src/components/datepicker/datepicker-utils.ts +9 -1
- package/src/components/datepicker/datepicker.ts +141 -213
- package/src/components/datepicker/index.ts +5 -1
- package/src/components/icon/icon.ts +16 -7
- package/src/components/select/select.ts +1 -1
- package/dist/calendar-DH-fCGyW.cjs +0 -115
- package/dist/class-map-CG3vIaNm.cjs +0 -5
- package/dist/datepicker-C244h82t.cjs +0 -190
- package/dist/datepicker-DwOkktaP.js +0 -859
- package/dist/directive-helpers-_qHew-gi.cjs +0 -5
- package/dist/directive-helpers-cAOIHg9K.js +0 -45
- package/dist/icon-B1-mkmwB.js +0 -88
- package/dist/icon-__Hjt2XZ.cjs +0 -9
- package/dist/input-element-DQOVrqUZ.js +0 -703
- package/dist/input-element-Y8sdrq9C.cjs +0 -1
- package/dist/input-wrapper-8iKEzDRZ.js +0 -40
- package/dist/repeat-DzibMwhi.cjs +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./element-D62wHiNU.cjs"),Mt=require("./state-BkE_Rxl7.cjs"),kt=require("./stringutils-CkVRq4jP.cjs"),Vt=require("./input-wrapper-EoSAbU-U.cjs");(function(){(function(E){const s=new WeakMap,h=new WeakMap,p=new WeakMap,u=new WeakMap,y=new WeakMap,k=new WeakMap,F=new WeakMap,g=new WeakMap,C=new WeakMap,V=new WeakMap,T=new WeakMap,S=new WeakMap,$=new WeakMap,U=new WeakMap,x=new WeakMap,I={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",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"},nt=(e,t)=>{for(let i in I){t[i]=null;let a=null;const n=I[i];Object.defineProperty(t,i,{get(){return a},set(o){a=o,e.isConnected?M(e,n,o):V.set(e,t)}})}};function z(e){const t=u.get(e),{form:i}=t;X(e,i,t),Q(e,t.labels)}const K=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return u.has(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let a=i.nextNode();const n=!t||e.disabled;for(;a;)a.formDisabledCallback&&n&&W(a,e.disabled),a=i.nextNode()},j={attributes:!0,attributeFilter:["disabled","name"]},L=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?W(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&K(i)),t.attributeName==="name"&&i.constructor.formAssociated){const a=u.get(i),n=C.get(i);a.setFormValue(n)}}}):{};function D(e){e.forEach(t=>{const{addedNodes:i,removedNodes:a}=t,n=Array.from(i),o=Array.from(a);n.forEach(l=>{var m;if(u.has(l)&&l.constructor.formAssociated&&z(l),V.has(l)){const f=V.get(l);Object.keys(I).filter(b=>f[b]!==null).forEach(b=>{M(l,I[b],f[b])}),V.delete(l)}if(x.has(l)){const f=x.get(l);M(l,"internals-valid",f.validity.valid.toString()),M(l,"internals-invalid",(!f.validity.valid).toString()),M(l,"aria-invalid",(!f.validity.valid).toString()),x.delete(l)}if(l.localName==="form"){const f=g.get(l),w=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(q){return u.has(q)&&q.constructor.formAssociated&&!(f&&f.has(q))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let b=w.nextNode();for(;b;)z(b),b=w.nextNode()}l.localName==="fieldset"&&((m=L.observe)===null||m===void 0||m.call(L,l,j),K(l,!0))}),o.forEach(l=>{const m=u.get(l);m&&p.get(m)&&G(m),F.has(l)&&F.get(l).disconnect()})})}function ot(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(a=>{const n=$.get(t.target);u.has(a)&&Z(a),n.disconnect()})})}const lt=e=>{var t,i;const a=new MutationObserver(ot);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=a.observe)===null||i===void 0||i.call(a,e,{childList:!0}),$.set(e,a)};O()&&new MutationObserver(D);const P={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},W=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},G=e=>{p.get(e).forEach(i=>{i.remove()}),p.set(e,[])},J=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),p.get(t).push(i),i},ct=(e,t)=>{var i;p.set(t,[]),(i=L.observe)===null||i===void 0||i.call(L,e,j)},Q=(e,t)=>{if(t.length){Array.from(t).forEach(a=>a.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},N=e=>{const t=Array.from(e.elements).filter(o=>!o.tagName.includes("-")&&o.validity).map(o=>o.validity.valid),i=g.get(e)||[],a=Array.from(i).filter(o=>o.isConnected).map(o=>u.get(o).validity.valid),n=[...t,...a].includes(!1);e.toggleAttribute("internals-invalid",n),e.toggleAttribute("internals-valid",!n)},dt=e=>{N(R(e.target))},ht=e=>{N(R(e.target))},ut=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const n=g.get(e);if(e.noValidate)return;n.size&&Array.from(n).reverse().map(m=>u.get(m).reportValidity()).includes(!1)&&i.preventDefault()}})},ft=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},X=(e,t,i)=>{if(t){const a=g.get(t);if(a)a.add(e);else{const n=new Set;n.add(e),g.set(t,n),ut(t),t.addEventListener("reset",ft),t.addEventListener("input",dt),t.addEventListener("change",ht)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),N(t)}},R=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=R(t)),t},v=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},Y=(e,t,i)=>{const a=g.get(e);return a&&a.size&&a.forEach(n=>{u.get(n)[i]()||(t=!1)}),t},Z=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:a}=t;Q(e,i),X(e,a,t)}};function O(){return typeof MutationObserver<"u"}class pt{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)}}const mt=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),yt=(e,t,i)=>(e.valid=gt(t),Object.keys(t).forEach(a=>e[a]=t[a]),i&&N(i),e),gt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},H=new WeakMap;function tt(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class B extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");H.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),a=H.get(this),n=`state${t}`;return a.isConnected?tt(a,n):setTimeout(()=>{tt(a,n)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),a=H.get(this);return a.isConnected?(a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)):setTimeout(()=>{a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)}),i}}function et(e,t,i,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)}function bt(e,t,i,a,n){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var A;class vt{constructor(t){A.set(this,void 0),bt(this,A,t);for(let i=0;i<t.length;i++){let a=t[i];this[i]=a,a.hasAttribute("name")&&(this[a.getAttribute("name")]=a)}Object.freeze(this)}get length(){return et(this,A,"f").length}[(A=new WeakMap,Symbol.iterator)](){return et(this,A,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function wt(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=a;function i(...o){let l=e.apply(this,o);return Y(this,l,"checkValidity")}function a(...o){let l=t.apply(this,o);return Y(this,l,"reportValidity")}const{get:n}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...o){const l=n.call(this,...o),m=Array.from(g.get(this)||[]);if(m.length===0)return l;const f=Array.from(l).concat(m).sort((w,b)=>w.compareDocumentPosition?w.compareDocumentPosition(b)&2?1:-1:0);return new vt(f)}})}class it{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),a=new pt;this.states=new B(t),s.set(this,t),h.set(this,a),u.set(t,this),nt(t,this),ct(t,this),Object.seal(this),i instanceof DocumentFragment&<(i)}checkValidity(){const t=s.get(this);if(v(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=h.get(this);if(!i.valid){const a=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(a)}return i.valid}get form(){const t=s.get(this);v(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=R(t)),i}get labels(){const t=s.get(this);v(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),a=t.getRootNode();return a&&i?a.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=s.get(this);if(v(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),a=S.get(this);if(a&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&a&&(t.focus(),a.focus()),i}setFormValue(t){const i=s.get(this);if(v(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),G(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const a=J(i,this);a.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([a,n])=>{if(typeof n=="string"){const o=J(i,this);o.name=a,o.value=n}});C.set(i,t)}setValidity(t,i,a){const n=s.get(this);if(v(n,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");S.set(this,a);const o=h.get(this),l={};for(const w in t)l[w]=t[w];Object.keys(l).length===0&&mt(o);const m=Object.assign(Object.assign({},o),l);delete m.valid;const{valid:f}=yt(o,m,this.form);if(!f&&!i)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.");y.set(this,f?"":i),n.isConnected?(n.toggleAttribute("internals-invalid",!f),n.toggleAttribute("internals-valid",f),M(n,"aria-invalid",`${!f}`)):x.set(n,this)}get shadowRoot(){const t=s.get(this),i=T.get(t);return i||null}get validationMessage(){const t=s.get(this);return v(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),y.get(this)}get validity(){const t=s.get(this);return v(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),h.get(this)}get willValidate(){const t=s.get(this);return v(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function Et(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(a=>a in i.internals)}let at=!1,st=!1;function _(e){st||(st=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new B(this),i}))}function rt(e=!0){if(!at){if(at=!0,typeof window<"u"&&(window.ElementInternals=it),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,a,n){if(a.formAssociated){const o=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){U.has(this)||(U.set(this,!0),this.hasAttribute("disabled")&&W(this,!0)),o!=null&&o.apply(this),Z(this)}}t.call(this,i,a,n)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new it(this)}),typeof Element<"u"){let t=function(...a){const n=i.apply(this,a);if(T.set(this,n),O()){const o=new MutationObserver(D);window.ShadyDOM?o.observe(this,P):o.observe(n,P),F.set(this,o)}return n};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(D).observe(document.documentElement,P),typeof HTMLFormElement<"u"&&wt(),(e||typeof window<"u"&&!window.CustomStateSet)&&_()}}return!!customElements.polyfillWrapFlushCallback||(Et()?typeof window<"u"&&!window.CustomStateSet&&_(HTMLElement.prototype.attachInternals):rt(!1)),E.forceCustomStateSetPolyfill=_,E.forceElementInternalsPolyfill=rt,Object.defineProperty(E,"__esModule",{value:!0}),E})({})})();var Ft=Object.defineProperty,d=(E,s,h,p)=>{for(var u=void 0,y=E.length-1,k;y>=0;y--)(k=E[y])&&(u=k(s,h,u)||u);return u&&Ft(s,h,u),u};class c extends r.PktElement{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=kt.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,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=Vt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.translations.forms.labels.optional,this.requiredText=r.translations.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(s){var h,p,u,y,k,F,g,C,V,T,S;s&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.translations.forms.messages.required,s):(h=s.validity)!=null&&h.typeMismatch||(p=s.validity)!=null&&p.badInput?this.internals.setValidity({typeMismatch:!0},r.translations.forms.messages.invalid,s):(u=s.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.translations.forms.messages.invalidPattern,s):(y=s.validity)!=null&&y.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.translations.forms.messages.tooShort,s):(k=s.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.translations.forms.messages.tooLong,s):(F=s.validity)!=null&&F.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.translations.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.translations.forms.messages.rangeUnderflow,s):(C=s.validity)!=null&&C.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.translations.forms.messages.invalid,s):(V=s.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.translations.forms.messages.rangeOverflowMax.replace("{max}",(T=this.max)==null?void 0:T.toString()):r.translations.forms.messages.rangeOverflow,s):(S=s.validity)!=null&&S.customError?this.internals.setValidity({customError:!0},s.validationMessage,s):this.internals.setValidity({}))}setFormValue(s){if(this.internals)if(Array.isArray(s)){const h=new FormData;s.forEach(p=>{h.append(this.name,p)}),this.internals.setFormValue(h)}else this.internals.setFormValue(s)}valueChecked(s){if(!this.touched)return;const h=this.internals.form||this.closest("form"),p=h?new FormData(h):null;h&&h.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(u=>{const y=u;y.name===this.name&&y.value!==this.value&&y.checked&&(y.checked=!1)}),typeof s=="string"?(this.checked=s==="true",this.internals.ariaChecked=s==="true"):typeof s=="boolean"&&(this.checked=s,this.internals.ariaChecked=s),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),p&&p.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),p&&p.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(s,h){(h!==this.value||h!==this._value)&&(typeof s=="string"?((this.multiple||this.range)&&s.includes(",")&&(s=s.split(",")),this.value=s,this._value=Array.isArray(s)?s:[s]):Array.isArray(s)?(this.value=this.multiple||this.range?s:s[0],this._value=s):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&h&&h.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(h==null?void 0:h.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const s=this.multiple||this.range?[]:"";this.value=s,this.internals.setFormValue(s),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0}))}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}))}onChange(s){if(!this.touched){this.touched=!0,s&&this.setFormValue(s);return}typeof s!="string"&&!Array.isArray(s)||((this.range||this.multiple)&&!Array.isArray(s)&&s.includes(",")&&(s=s.split(",")),!this.multiple&&!this.range&&Array.isArray(s)&&(s=s[0]),this.setFormValue(s),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(s=>{s.selected=!1}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(s){super.updated(s),s.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")))}firstUpdated(s){if(super.firstUpdated(s),!this.form){const h=this.internals.form||this.closest("form");this.form=h}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const h=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=h,this.internals.setFormValue(h?this.value||"on":"",h?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}d([r.n()],c.prototype,"defaultValue");d([r.n({type:Boolean,reflect:!0})],c.prototype,"disabled");d([r.n({type:Boolean,reflect:!0})],c.prototype,"readonly");d([r.n({type:Boolean,reflect:!0})],c.prototype,"required");d([r.n({type:Number,reflect:!0})],c.prototype,"max");d([r.n({type:Number,reflect:!0})],c.prototype,"maxlength");d([r.n({type:Number,reflect:!0})],c.prototype,"min");d([r.n({type:Number,reflect:!0})],c.prototype,"minlength");d([r.n({type:Number,reflect:!0})],c.prototype,"step");d([r.n({type:String})],c.prototype,"ariaDescribedBy");d([r.n({type:String})],c.prototype,"ariaLabelledby");d([r.n({type:String,reflect:!0})],c.prototype,"name");d([r.n({type:String,reflect:!0})],c.prototype,"pattern");d([r.n({type:String,reflect:!0})],c.prototype,"placeholder");d([r.n({type:String,reflect:!0})],c.prototype,"id");d([r.n({type:Boolean})],c.prototype,"counter");d([r.n({type:Boolean})],c.prototype,"hasError");d([r.n({type:Boolean})],c.prototype,"inline");d([r.n({type:Boolean})],c.prototype,"hasFieldset");d([r.n({type:Boolean})],c.prototype,"optionalTag");d([r.n({type:Boolean})],c.prototype,"requiredTag");d([r.n({type:Boolean})],c.prototype,"skipForwardTestid");d([r.n({type:Boolean,reflect:!1})],c.prototype,"useWrapper");d([r.n({type:Boolean,reflect:!0})],c.prototype,"fullwidth");d([r.n({type:Number})],c.prototype,"counterMaxLength");d([r.n({type:String})],c.prototype,"errorMessage");d([r.n({type:String})],c.prototype,"helptext");d([r.n({type:String})],c.prototype,"helptextDropdown");d([r.n({type:String,reflect:!1})],c.prototype,"helptextDropdownButton");d([r.n({type:String})],c.prototype,"label");d([r.n({type:String,reflect:!1})],c.prototype,"optionalText");d([r.n({type:String,reflect:!1})],c.prototype,"requiredText");d([r.n({type:String,reflect:!1})],c.prototype,"tagText");d([r.n({type:String,attribute:"data-testid"})],c.prototype,"dataTestid");d([Mt.r()],c.prototype,"touched");exports.PktInputElement=c;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const e = {
|
|
2
|
-
helptextDropdownButton: {
|
|
3
|
-
default: "Les mer <span class='pkt-sr-only'>om feltet</span>"
|
|
4
|
-
},
|
|
5
|
-
counter: {
|
|
6
|
-
default: !1
|
|
7
|
-
},
|
|
8
|
-
optionalTag: {
|
|
9
|
-
default: !1
|
|
10
|
-
},
|
|
11
|
-
optionalText: {
|
|
12
|
-
default: "Valgfritt"
|
|
13
|
-
},
|
|
14
|
-
requiredTag: {
|
|
15
|
-
default: !1
|
|
16
|
-
},
|
|
17
|
-
requiredText: {
|
|
18
|
-
default: "Må fylles ut"
|
|
19
|
-
},
|
|
20
|
-
hasError: {
|
|
21
|
-
default: !1
|
|
22
|
-
},
|
|
23
|
-
disabled: {
|
|
24
|
-
default: !1
|
|
25
|
-
},
|
|
26
|
-
inline: {
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
29
|
-
hasFieldset: {
|
|
30
|
-
default: !1
|
|
31
|
-
},
|
|
32
|
-
useWrapper: {
|
|
33
|
-
default: !0
|
|
34
|
-
}
|
|
35
|
-
}, a = {
|
|
36
|
-
props: e
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
a as s
|
|
40
|
-
};
|
package/dist/repeat-DzibMwhi.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";const m=require("./element-D62wHiNU.cjs"),x=require("./directive-C7oCP5Bh.cjs"),s=require("./directive-helpers-_qHew-gi.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const k=(l,v,d)=>{const h=new Map;for(let e=v;e<=d;e++)h.set(l[e],e);return h},q=x.e(class extends x.i{constructor(l){if(super(l),l.type!==x.t.CHILD)throw Error("repeat() can only be used in text expressions")}dt(l,v,d){let h;d===void 0?d=v:v!==void 0&&(h=v);const e=[],u=[];let n=0;for(const c of l)e[n]=h?h(c,n):n,u[n]=d(c,n),n++;return{values:u,keys:e}}render(l,v,d){return this.dt(l,v,d).values}update(l,[v,d,h]){const e=s.p(l),{values:u,keys:n}=this.dt(v,d,h);if(!Array.isArray(e))return this.ut=n,u;const c=this.ut??(this.ut=[]),f=[];let p,M,t=0,i=e.length-1,r=0,o=u.length-1;for(;t<=i&&r<=o;)if(e[t]===null)t++;else if(e[i]===null)i--;else if(c[t]===n[r])f[r]=s.v(e[t],u[r]),t++,r++;else if(c[i]===n[o])f[o]=s.v(e[i],u[o]),i--,o--;else if(c[t]===n[o])f[o]=s.v(e[t],u[o]),s.r(l,f[o+1],e[t]),t++,o--;else if(c[i]===n[r])f[r]=s.v(e[i],u[r]),s.r(l,e[t],e[i]),i--,r++;else if(p===void 0&&(p=k(n,r,o),M=k(c,t,i)),p.has(c[t]))if(p.has(c[i])){const a=M.get(n[r]),y=a!==void 0?e[a]:null;if(y===null){const g=s.r(l,e[t]);s.v(g,u[r]),f[r]=g}else f[r]=s.v(y,u[r]),s.r(l,e[t],y),e[a]=null;r++}else s.M(e[i]),i--;else s.M(e[t]),t++;for(;r<=o;){const a=s.r(l,f[o+1]);s.v(a,u[r]),f[r++]=a}for(;t<=i;){const a=e[t++];a!==null&&s.M(a)}return this.ut=n,s.m(l,f),m.T}});exports.c=q;
|