@oslokommune/punkt-elements 13.13.2 → 13.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [13.15.2](https://github.com/oslokommune/punkt/compare/13.15.1...13.15.2) (2025-11-07)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ Ingen
18
+
19
+ ### Chores
20
+ Ingen
21
+
22
+ ---
23
+
24
+
8
25
  ## [13.13.2](https://github.com/oslokommune/punkt/compare/13.13.1...13.13.2) (2025-11-03)
9
26
 
10
27
  ### ⚠ BREAKING CHANGES
@@ -1,15 +1,15 @@
1
- "use strict";const a=require("./element-CJ_QKaki.cjs"),S=require("./state-DSjcvzDN.cjs"),u=require("./calendar-BaMrdMDZ.cjs"),_=require("./input-element-j9znzLWz.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-D9kFsTCN.cjs");const k=require("./class-map-C_erArZz.cjs"),I=require("./repeat-BZb41H64.cjs");require("./tag-EFUKrc8q.cjs");const O=require("./stringutils-CkVRq4jP.cjs"),f=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs"),A=i=>new Promise(e=>setTimeout(e,i)),$={isIOS(){const i=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(i)||/Macintosh/.test(i)&&"ontouchend"in document)}},v={parseValue(i){return i?Array.isArray(i)?i.filter(Boolean):typeof i=="string"?i.split(",").filter(Boolean):String(i).split(",").filter(Boolean):[]},formatValue(i){return i.join(",")},normalizeNameForMultiple(i,e,t){return i?(e||t)&&!i.endsWith("[]")?i+"[]":i:null},normalizeStringArray(i){return typeof i=="string"?i.split(",").filter(Boolean):Array.isArray(i)?i:[]},validateRangeOrder(i){return!i||i.length!==2?!0:u.isValidDateRange(i[0],i[1])},sortDates(i){return u.sortDateStrings(i)},filterSelectableDates(i,e,t,s,n){return u.filterSelectableDates(i,e,t,s,n)}},M={getInputType(){return $.isIOS()?"text":"date"}},w={submitForm(i){var t;const e=(t=i.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(i,e){const t=i==null?void 0:i.form;t?t.requestSubmit():e()},validateDateInput(i,e,t,s,n){var l,h,T,E;const r=i.value;r&&(t&&t>r?e.setValidity({rangeUnderflow:!0},((h=(l=n==null?void 0:n.forms)==null?void 0:l.messages)==null?void 0:h.rangeUnderflow)||"Value is below minimum",i):s&&s<r&&e.setValidity({rangeOverflow:!0},((E=(T=n==null?void 0:n.forms)==null?void 0:T.messages)==null?void 0:E.rangeOverflow)||"Value is above maximum",i))}},x={addToSelected(i,e,t,s){const n=i.target;if(!n.value)return;const r=t?u.newDate(t):null,l=s?u.newDate(s):null,h=u.newDate(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!r||h>=r)&&(!l||h<=l)&&e.value&&e.value.handleDateSelect(h),n.value=""},handleCalendarPosition(i,e,t=!1){var h;if(!i.value||!e.value)return;const s=((h=e.value.parentElement)==null?void 0:h.getBoundingClientRect())||e.value.getBoundingClientRect(),n=t?s.height+30:s.height,r=i.value.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";s&&s.top+r>window.innerHeight&&s.top-r>0&&(l=`calc(100% - ${n}px - ${r}px)`),i.value.style.top=l}},C={getInputClasses(i,e,t,s,n,r){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":i,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":s,"ios-readonly-hack":n===!1&&r==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(i){return{"pkt-input-prefix":i,"pkt-hide":!i}}},R={processDateSelection(i,e,t){return!e&&!t?i[0]||"":Array.isArray(i)?i.join(","):i},updateInputValues(i,e,t,s,n,r){i.value&&(s&&(e!=null&&e.value)?(i.value.value=t[0]??"",e.value.value=t[1]??"",r(i.value),r(e.value)):n||(i.value.value=t.length?t[0]:"",r(i.value)))},processRangeBlur(i,e,t,s,n){var l;const r=i.target;if(r.value){n(r);const h=u.fromISOToDate(r.value);h&&e[0]!==r.value&&e[1]&&(s(),(l=t==null?void 0:t.value)==null||l.handleDateSelect(h))}else e[0]&&s()}},b={handleInputKeydown(i,e,t,s,n,r){const{key:l}=i;l===","&&(i.preventDefault(),r?r(i):n&&n()),(l==="Space"||l===" ")&&(i.preventDefault(),e(i)),l==="Enter"&&(i.preventDefault(),t?t():s?s():n&&n())},handleButtonKeydown(i,e){const{key:t}=i;(t==="Enter"||t===" "||t==="Space")&&(i.preventDefault(),e(i))}};var j=Object.defineProperty,F=Object.getOwnPropertyDescriptor,P=(i,e,t,s)=>{for(var n=s>1?void 0:s?F(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&j(e,t,n),n};exports.PktDateTags=class extends a.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=O.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
1
+ "use strict";const a=require("./element-CJ_QKaki.cjs"),S=require("./state-DSjcvzDN.cjs"),o=require("./calendar-BaMrdMDZ.cjs"),_=require("./input-element-j9znzLWz.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-D9kFsTCN.cjs");const k=require("./class-map-C_erArZz.cjs"),I=require("./repeat-BZb41H64.cjs");require("./tag-EFUKrc8q.cjs");const O=require("./stringutils-CkVRq4jP.cjs"),f=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs"),A=i=>new Promise(e=>setTimeout(e,i)),$={isIOS(){const i=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(i)||/Macintosh/.test(i)&&"ontouchend"in document)}},v={parseValue(i){return i?Array.isArray(i)?i.filter(Boolean):typeof i=="string"?i.split(",").filter(Boolean):String(i).split(",").filter(Boolean):[]},formatValue(i){return i.join(",")},normalizeNameForMultiple(i,e,t){return i?(e||t)&&!i.endsWith("[]")?i+"[]":i:null},normalizeStringArray(i){return typeof i=="string"?i.split(",").filter(Boolean):Array.isArray(i)?i:[]},validateRangeOrder(i){return!i||i.length!==2?!0:o.isValidDateRange(i[0],i[1])},sortDates(i){return o.sortDateStrings(i)},filterSelectableDates(i,e,t,s,n){return o.filterSelectableDates(i,e,t,s,n)}},M={getInputType(){return $.isIOS()?"text":"date"}},w={submitForm(i){var t;const e=(t=i.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(i,e){const t=i==null?void 0:i.form;t?t.requestSubmit():e()},validateDateInput(i,e,t,s,n){var l,h,E,T;const r=i.value;r&&(t&&t>r?e.setValidity({rangeUnderflow:!0},((h=(l=n==null?void 0:n.forms)==null?void 0:l.messages)==null?void 0:h.rangeUnderflow)||"Value is below minimum",i):s&&s<r&&e.setValidity({rangeOverflow:!0},((T=(E=n==null?void 0:n.forms)==null?void 0:E.messages)==null?void 0:T.rangeOverflow)||"Value is above maximum",i))}},x={addToSelected(i,e,t,s){const n=i.target;if(!n.value)return;const r=t?o.newDate(t):null,l=s?o.newDate(s):null,h=o.newDate(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!r||h>=r)&&(!l||h<=l)&&e.value&&e.value.handleDateSelect(h),n.value=""},handleCalendarPosition(i,e,t=!1){var h;if(!i.value||!e.value)return;const s=((h=e.value.parentElement)==null?void 0:h.getBoundingClientRect())||e.value.getBoundingClientRect(),n=t?s.height+30:s.height,r=i.value.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";s&&s.top+r>window.innerHeight&&s.top-r>0&&(l=`calc(100% - ${n}px - ${r}px)`),i.value.style.top=l}},C={getInputClasses(i,e,t,s,n,r){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":i,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":s,"ios-readonly-hack":n===!1&&r==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(i){return{"pkt-input-prefix":i,"pkt-hide":!i}}},R={processDateSelection(i,e,t){return!e&&!t?i[0]||"":Array.isArray(i)?i.join(","):i},updateInputValues(i,e,t,s,n,r){i.value&&(s&&(e!=null&&e.value)?(i.value.value=t[0]??"",e.value.value=t[1]??"",r(i.value),r(e.value)):n||(i.value.value=t.length?t[0]:"",r(i.value)))},processRangeBlur(i,e,t,s,n){var l;const r=i.target;if(r.value){n(r);const h=o.fromISOToDate(r.value);h&&e[0]!==r.value&&e[1]&&(s(),(l=t==null?void 0:t.value)==null||l.handleDateSelect(h))}else e[0]&&s()}},b={handleInputKeydown(i,e,t,s,n,r){const{key:l}=i;l===","&&(i.preventDefault(),r?r(i):n&&n()),(l==="Space"||l===" ")&&(i.preventDefault(),e(i)),l==="Enter"&&(i.preventDefault(),t?t():s?s():n&&n())},handleButtonKeydown(i,e){const{key:t}=i;(t==="Enter"||t===" "||t==="Space")&&(i.preventDefault(),e(i))}};var F=Object.defineProperty,j=Object.getOwnPropertyDescriptor,P=(i,e,t,s)=>{for(var n=s>1?void 0:s?j(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&F(e,t,n),n};exports.PktDateTags=class extends a.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=O.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
2
2
  <div class=${k.e(this.classes)} aria-live="polite">
3
3
  ${Array.isArray(this.dates)&&this.dates[0]?I.c(v.sortDates((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return a.x` <pkt-tag
4
4
  id=${this.idBase+e+"-tag"}
5
5
  closeTag
6
6
  @close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
7
- .ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${u.fromISOtoLocal(e,this.dateformat)}`}
7
+ .ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${o.fromISOtoLocal(e,this.dateformat)}`}
8
8
  >
9
- <time datetime=${e}>${u.fromISOtoLocal(e,this.dateformat)}</time>
9
+ <time datetime=${e}>${o.fromISOtoLocal(e,this.dateformat)}</time>
10
10
  </pkt-tag>`}):a.E}
11
11
  </div>
12
- `}};P([a.n({type:Array})],exports.PktDateTags.prototype,"dates",2);P([a.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);P([a.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);P([a.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=P([a.t("pkt-date-tags")],exports.PktDateTags);const q={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},D={props:q};var L=Object.defineProperty,V=Object.getOwnPropertyDescriptor,c=(i,e,t,s)=>{for(var n=s>1?void 0:s?V(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&L(e,t,n),n};let d=class extends a.PktElement{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=p.e(),this.calendarRef=p.e(),this.handleDocumentClick=i=>{if(!this.open)return;const e=i.composedPath(),t=this.parentElement,s=this.popupRef.value;!e.includes(this)&&!e.includes(s)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=i=>{this.open&&i.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var i;this.open=!0,(i=this.calendarRef.value)==null||i.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(i){var e;return!!i&&!!((e=this.popupRef.value)!=null&&e.contains(i))}focusOnCurrentDate(){const i=this.calendarRef.value;i&&typeof i.focusOnCurrentDate=="function"&&i.focusOnCurrentDate()}addToSelected(i,e,t){if(typeof x.addToSelected=="function")return x.addToSelected(i,this.calendarRef,e,t)}handleDateSelect(i){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(i)}render(){const i={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return a.x`
12
+ `}};P([a.n({type:Array})],exports.PktDateTags.prototype,"dates",2);P([a.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);P([a.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);P([a.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=P([a.t("pkt-date-tags")],exports.PktDateTags);const q={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},D={props:q};var V=Object.defineProperty,L=Object.getOwnPropertyDescriptor,c=(i,e,t,s)=>{for(var n=s>1?void 0:s?L(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&V(e,t,n),n};let d=class extends a.PktElement{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=p.e(),this.calendarRef=p.e(),this.handleDocumentClick=i=>{if(!this.open)return;const e=i.composedPath(),t=this.parentElement,s=this.popupRef.value;!e.includes(this)&&!e.includes(s)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=i=>{this.open&&i.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var i;this.open=!0,(i=this.calendarRef.value)==null||i.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(i){var e;return!!i&&!!((e=this.popupRef.value)!=null&&e.contains(i))}focusOnCurrentDate(){const i=this.calendarRef.value;i&&typeof i.focusOnCurrentDate=="function"&&i.focusOnCurrentDate()}addToSelected(i,e,t){if(typeof x.addToSelected=="function")return x.addToSelected(i,this.calendarRef,e,t)}handleDateSelect(i){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(i)}render(){const i={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return a.x`
13
13
  <div
14
14
  class="${k.e(i)}"
15
15
  ${p.n(this.popupRef)}
@@ -158,7 +158,7 @@
158
158
  <span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
159
159
  </button>
160
160
  </div>
161
- `}};m([a.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"inputType",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"id",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"min",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"max",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"placeholder",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"readonly",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"disabled",2);m([a.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"inputClasses",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"internals",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=m([a.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var G=Object.defineProperty,J=Object.getOwnPropertyDescriptor,o=(i,e,t,s)=>{for(var n=s>1?void 0:s?J(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&G(e,t,n),n};exports.PktDatepicker=class extends _.PktInputElement{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=p.e(),this._value=[],this.label="Datovelger",this.dateformat=D.props.dateformat.default,this.multiple=D.props.multiple.default,this.maxlength=null,this.range=D.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=D.props.weeknumbers.default,this.withcontrols=D.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=p.e(),this.popupRef=p.e(),this.helptextSlot=p.e(),this.singleInputRef=p.e(),this.rangeInputRef=p.e(),this.multipleInputRef=p.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):x.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new B.PktSlotController(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return M.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=v.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(e===t)return;const s=v.parseValue(e),n=this.multiple&&s.length>1?v.filterSelectableDates(s,this.min,this.max,this.excludedates,this.excludeweekdays):s;if(this.range&&!v.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=v.formatValue(n);this._valueProperty!==r&&(this._valueProperty=r),super.valueChanged(r,t)}attributeChangedCallback(e,t,s){e==="value"&&this.value!==t&&this.valueChanged(s,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=v.normalizeStringArray(s||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=v.normalizeStringArray(s||"")),super.attributeChangedCallback(e,t,s)}updated(e){if(e.has("value")){const t=Array.isArray(this.value)?this.value.join(","):this.value,s=e.get("value"),n=Array.isArray(s)?s.join(","):s;this.valueChanged(t,n)}(e.has("multiple")||e.has("range"))&&(this.name=v.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=v.parseValue(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,s;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(s=this.singleInputRef.value)==null?void 0:s.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,s;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(s=this.singleInputRef.value)==null?void 0:s.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return a.x`
161
+ `}};m([a.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"inputType",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"id",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"min",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"max",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"placeholder",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"readonly",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"disabled",2);m([a.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"inputClasses",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"internals",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=m([a.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var G=Object.defineProperty,J=Object.getOwnPropertyDescriptor,u=(i,e,t,s)=>{for(var n=s>1?void 0:s?J(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&G(e,t,n),n};exports.PktDatepicker=class extends _.PktInputElement{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=p.e(),this._value=[],this.label="Datovelger",this.dateformat=D.props.dateformat.default,this.multiple=D.props.multiple.default,this.maxlength=null,this.range=D.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=D.props.weeknumbers.default,this.withcontrols=D.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=p.e(),this.popupRef=p.e(),this.helptextSlot=p.e(),this.singleInputRef=p.e(),this.rangeInputRef=p.e(),this.multipleInputRef=p.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):x.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new B.PktSlotController(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return M.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=v.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(e===t)return;const s=v.parseValue(e),n=this.multiple&&s.length>1?v.filterSelectableDates(s,this.min,this.max,this.excludedates,this.excludeweekdays):s;if(this.range&&!v.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=v.formatValue(n);this._valueProperty!==r&&(this._valueProperty=r),super.valueChanged(r,t)}attributeChangedCallback(e,t,s){e==="value"&&this.value!==t&&this.valueChanged(s,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=v.normalizeStringArray(s||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=v.normalizeStringArray(s||"")),super.attributeChangedCallback(e,t,s)}updated(e){if(e.has("value")){const t=Array.isArray(this.value)?this.value.join(","):this.value,s=e.get("value"),n=Array.isArray(s)?s.join(","):s;this.valueChanged(t,n)}(e.has("multiple")||e.has("range"))&&(this.name=v.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=v.parseValue(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,s;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(s=this.singleInputRef.value)==null?void 0:s.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,s;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(s=this.singleInputRef.value)==null?void 0:s.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return a.x`
162
162
  <pkt-datepicker-single
163
163
  .value=${this._value[0]??""}
164
164
  .inputType=${this.inputType}
@@ -201,7 +201,7 @@
201
201
  @range-blur=${e=>{R.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),t=>this.manageValidity(t))}}
202
202
  @manage-validity=${e=>this.manageValidity(e.detail)}
203
203
  @validate-date-input=${e=>{w.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
204
- @handle-date-select=${e=>{var s,n;const t=u.fromISOToDate(e.detail);t&&this._value[1]!==u.formatISODate(t)&&((n=(s=this.calRef)==null?void 0:s.value)==null||n.handleDateSelect(t))}}
204
+ @handle-date-select=${e=>{var s,n;const t=o.fromISOToDate(e.detail);t&&this._value[1]!==o.formatISODate(t)&&((n=(s=this.calRef)==null?void 0:s.value)==null||n.handleDateSelect(t))}}
205
205
  @input-changed=${()=>{this.touched=!0}}
206
206
  ${p.n(this.rangeInputRef)}
207
207
  ></pkt-datepicker-range>
@@ -241,7 +241,7 @@
241
241
  .latest=${this.max}
242
242
  .excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
243
243
  .excludeweekdays=${this.excludeweekdays}
244
- .currentmonth=${this.currentmonth?u.parseISODateString(this.currentmonth):null}
244
+ .currentmonth=${this.currentmonth?o.parseISODateString(this.currentmonth):null}
245
245
  @date-selected=${e=>{this.value=R.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,R.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
246
246
  @close=${()=>{this.onBlur(),this.hideCalendar()}}
247
247
  ${p.n(this.datepickerPopupRef)}
@@ -277,7 +277,7 @@
277
277
  dateformat=${this.dateformat}
278
278
  strings=${this.strings}
279
279
  id-base=${this.id}
280
- @date-tag-removed=${e=>{var n;const t=this.datepickerPopupRef.value,s=u.fromISOToDate(e.detail);t&&s&&typeof t.handleDateSelect=="function"?t.handleDateSelect(s):(n=this.calRef.value)==null||n.handleDateSelect(s)}}
280
+ @date-tag-removed=${e=>{var n;const t=this.datepickerPopupRef.value,s=o.fromISOToDate(e.detail);t&&s&&typeof t.handleDateSelect=="function"?t.handleDateSelect(s):(n=this.calRef.value)==null||n.handleDateSelect(s)}}
281
281
  ></pkt-date-tags>`:a.E}
282
282
  <div
283
283
  class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
@@ -286,4 +286,4 @@
286
286
  </div>
287
287
  </pkt-input-wrapper>
288
288
  ${this.renderCalendar()}
289
- `}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;x.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),$.isIOS()&&e.focusOnCurrentDate();return}await A(20),this.handleCalendarPosition(),$.isIOS()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const s=!!t.open;t.toggle(),this.calendarOpen=!s;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value=""}};o([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",1);o([a.n({type:Array})],exports.PktDatepicker.prototype,"_value",2);o([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);o([a.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);o([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);o([a.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);o([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);o([a.n({type:Boolean})],exports.PktDatepicker.prototype,"showRangeLabels",2);o([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);o([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);o([a.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);o([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);o([a.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);o([a.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);o([a.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);o([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"calendarOpen",2);o([a.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);o([S.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=o([a.t("pkt-datepicker")],exports.PktDatepicker);
289
+ `}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;x.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),$.isIOS()&&e.focusOnCurrentDate();return}await A(20),this.handleCalendarPosition(),$.isIOS()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const s=!!t.open;t.toggle(),this.calendarOpen=!s;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",1);u([a.n({type:Array})],exports.PktDatepicker.prototype,"_value",2);u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);u([a.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);u([a.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);u([a.n({type:Boolean})],exports.PktDatepicker.prototype,"showRangeLabels",2);u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);u([a.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);u([a.n({converter:o.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);u([a.n({converter:o.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);u([a.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"calendarOpen",2);u([a.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);u([S.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=u([a.t("pkt-datepicker")],exports.PktDatepicker);
@@ -1,6 +1,6 @@
1
1
  import { P as O, E as B, x as d, n as a, a as _ } from "./element-CRDRygXu.js";
2
2
  import { r as N } from "./state-DS_kr2Fy.js";
3
- import { f as U, s as q, i as W, n as j, a as M, b as z, d as H, p as G, e as K } from "./calendar-DtJh7UYD.js";
3
+ import { f as U, s as q, i as W, n as F, a as M, b as z, d as H, p as G, e as K } from "./calendar-DtJh7UYD.js";
4
4
  import { P as J } from "./input-element-BcFmygSF.js";
5
5
  import { e as u, n as c } from "./ref-Xa5dbh--.js";
6
6
  import "./icon-1dy7UZcu.js";
@@ -9,9 +9,9 @@ import { e as x } from "./class-map-wy7PUk0P.js";
9
9
  import { c as Q } from "./repeat-CJ79egkN.js";
10
10
  import "./tag-CqMgt01I.js";
11
11
  import { u as X } from "./stringutils-DJjRa8dG.js";
12
- import { o as C } from "./if-defined-BWZGb3bh.js";
12
+ import { o as w } from "./if-defined-BWZGb3bh.js";
13
13
  import { P as Y } from "./pkt-slot-controller-BPGj-LC5.js";
14
- const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
14
+ const Z = (t) => new Promise((e) => setTimeout(e, t)), T = {
15
15
  /**
16
16
  * Detects if the current device is iOS (iPhone, iPad, iPod)
17
17
  * Handles modern iPad Safari which uses desktop user agent since iOS 13
@@ -69,7 +69,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
69
69
  * Mobile Safari does not play well with type="date" amd custom datepickers
70
70
  */
71
71
  getInputType() {
72
- return R.isIOS() ? "text" : "date";
72
+ return T.isIOS() ? "text" : "date";
73
73
  }
74
74
  }, D = {
75
75
  /**
@@ -110,7 +110,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
110
110
  addToSelected(t, e, s, n) {
111
111
  const i = t.target;
112
112
  if (!i.value) return;
113
- const l = s ? j(s) : null, r = n ? j(n) : null, h = j(i.value.split(",")[0]);
113
+ const l = s ? F(s) : null, r = n ? F(n) : null, h = F(i.value.split(",")[0]);
114
114
  h && !isNaN(h.getTime()) && (!l || h >= l) && (!r || h <= r) && e.value && e.value.handleDateSelect(h), i.value = "";
115
115
  },
116
116
  /**
@@ -159,7 +159,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
159
159
  "pkt-hide": !t
160
160
  };
161
161
  }
162
- }, F = {
162
+ }, j = {
163
163
  /**
164
164
  * Handles date selection from calendar events
165
165
  */
@@ -184,7 +184,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
184
184
  h && e[0] !== l.value && e[1] && (n(), (r = s == null ? void 0 : s.value) == null || r.handleDateSelect(h));
185
185
  } else e[0] && n();
186
186
  }
187
- }, T = {
187
+ }, E = {
188
188
  /**
189
189
  * Handles common keyboard interactions for datepicker inputs
190
190
  */
@@ -205,7 +205,7 @@ var et = Object.defineProperty, st = Object.getOwnPropertyDescriptor, P = (t, e,
205
205
  (r = t[l]) && (i = (n ? r(e, s, i) : r(i)) || i);
206
206
  return n && i && et(e, s, i), i;
207
207
  };
208
- let E = class extends O {
208
+ let R = class extends O {
209
209
  constructor() {
210
210
  super(...arguments), this.dates = [], this.dateformat = "dd.MM.yyyy", this.className = "pkt-datepicker__tags", this.idBase = X();
211
211
  }
@@ -238,19 +238,19 @@ let E = class extends O {
238
238
  };
239
239
  P([
240
240
  a({ type: Array })
241
- ], E.prototype, "dates", 2);
241
+ ], R.prototype, "dates", 2);
242
242
  P([
243
243
  a({ type: String })
244
- ], E.prototype, "dateformat", 2);
244
+ ], R.prototype, "dateformat", 2);
245
245
  P([
246
246
  a({ type: String, attribute: "class" })
247
- ], E.prototype, "className", 2);
247
+ ], R.prototype, "className", 2);
248
248
  P([
249
249
  a({ type: String, attribute: "id-base" })
250
- ], E.prototype, "idBase", 2);
251
- E = P([
250
+ ], R.prototype, "idBase", 2);
251
+ R = P([
252
252
  _("pkt-date-tags")
253
- ], E);
253
+ ], R);
254
254
  const it = { dateformat: { default: "dd.MM.yyyy" }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, range: { default: !1 } }, S = {
255
255
  props: it
256
256
  };
@@ -376,7 +376,7 @@ v([
376
376
  g = v([
377
377
  _("pkt-datepicker-popup")
378
378
  ], g);
379
- var lt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, w = (t, e, s, n) => {
379
+ var lt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, C = (t, e, s, n) => {
380
380
  for (var i = n > 1 ? void 0 : n ? rt(e, s) : e, l = t.length - 1, r; l >= 0; l--)
381
381
  (r = t[l]) && (i = (n ? r(e, s, i) : r(i)) || i);
382
382
  return n && i && lt(e, s, i), i;
@@ -458,9 +458,9 @@ let y = class extends O {
458
458
  .type=${this.inputType}
459
459
  id="${this.id}-input"
460
460
  .value=${this.value}
461
- min=${C(this.min)}
462
- max=${C(this.max)}
463
- placeholder=${C(this.placeholder)}
461
+ min=${w(this.min)}
462
+ max=${w(this.max)}
463
+ placeholder=${w(this.placeholder)}
464
464
  ?readonly=${this.isInputReadonly}
465
465
  aria-describedby="${this.id}-helptext"
466
466
  @click=${(t) => {
@@ -470,7 +470,7 @@ let y = class extends O {
470
470
  t.preventDefault(), this.dispatchToggleCalendar(t);
471
471
  }}
472
472
  ?disabled=${this.disabled}
473
- @keydown=${(t) => T.handleInputKeydown(
473
+ @keydown=${(t) => E.handleInputKeydown(
474
474
  t,
475
475
  (e) => this.dispatchToggleCalendar(e),
476
476
  () => D.submitFormOrFallback(this.internals, () => {
@@ -487,7 +487,7 @@ let y = class extends O {
487
487
  this.dispatchInput(t), t.stopImmediatePropagation();
488
488
  }}
489
489
  @focus=${() => {
490
- this.dispatchFocus(), R.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
490
+ this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
491
491
  }}
492
492
  @blur=${(t) => {
493
493
  this.dispatchBlur(t), this.dispatchManageValidity(t.target), this.dispatchEvent(
@@ -507,7 +507,7 @@ let y = class extends O {
507
507
  class="${x(I.getButtonClasses())}"
508
508
  type="button"
509
509
  @click=${(t) => this.dispatchToggleCalendar(t)}
510
- @keydown=${(t) => T.handleButtonKeydown(t, (e) => this.dispatchToggleCalendar(e))}
510
+ @keydown=${(t) => E.handleButtonKeydown(t, (e) => this.dispatchToggleCalendar(e))}
511
511
  ?disabled=${this.disabled}
512
512
  ${c(this.btnRef)}
513
513
  >
@@ -518,40 +518,40 @@ let y = class extends O {
518
518
  `;
519
519
  }
520
520
  };
521
- w([
521
+ C([
522
522
  a({ type: String })
523
523
  ], y.prototype, "value", 2);
524
- w([
524
+ C([
525
525
  a({ type: String })
526
526
  ], y.prototype, "inputType", 2);
527
- w([
527
+ C([
528
528
  a({ type: String })
529
529
  ], y.prototype, "id", 2);
530
- w([
530
+ C([
531
531
  a({ type: String })
532
532
  ], y.prototype, "min", 2);
533
- w([
533
+ C([
534
534
  a({ type: String })
535
535
  ], y.prototype, "max", 2);
536
- w([
536
+ C([
537
537
  a({ type: String })
538
538
  ], y.prototype, "placeholder", 2);
539
- w([
539
+ C([
540
540
  a({ type: Boolean })
541
541
  ], y.prototype, "readonly", 2);
542
- w([
542
+ C([
543
543
  a({ type: Boolean })
544
544
  ], y.prototype, "disabled", 2);
545
- w([
545
+ C([
546
546
  a({ type: Object })
547
547
  ], y.prototype, "inputClasses", 2);
548
- w([
548
+ C([
549
549
  a({ type: Object })
550
550
  ], y.prototype, "internals", 2);
551
- w([
551
+ C([
552
552
  a({ type: Object })
553
553
  ], y.prototype, "strings", 2);
554
- y = w([
554
+ y = C([
555
555
  _("pkt-datepicker-single")
556
556
  ], y);
557
557
  var pt = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, b = (t, e, s, n) => {
@@ -641,9 +641,9 @@ let m = class extends O {
641
641
  .type=${this.inputType}
642
642
  id="${this.id}-input"
643
643
  .value=${this.value[0] ?? ""}
644
- min=${C(this.min)}
645
- max=${C(this.max)}
646
- placeholder=${C(this.placeholder)}
644
+ min=${w(this.min)}
645
+ max=${w(this.max)}
646
+ placeholder=${w(this.placeholder)}
647
647
  ?readonly=${this.isInputReadonly}
648
648
  ?disabled=${this.disabled}
649
649
  @click=${(e) => {
@@ -652,7 +652,7 @@ let m = class extends O {
652
652
  @touchend=${(e) => {
653
653
  e.preventDefault(), this.dispatchToggleCalendar(e);
654
654
  }}
655
- @keydown=${(e) => T.handleInputKeydown(
655
+ @keydown=${(e) => E.handleInputKeydown(
656
656
  e,
657
657
  (s) => this.dispatchToggleCalendar(s),
658
658
  () => D.submitFormOrFallback(
@@ -675,7 +675,7 @@ let m = class extends O {
675
675
  this.dispatchInput(e), e.stopImmediatePropagation();
676
676
  }}
677
677
  @focus=${() => {
678
- this.dispatchFocus(), R.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
678
+ this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
679
679
  }}
680
680
  @blur=${(e) => {
681
681
  this.dispatchEvent(
@@ -705,9 +705,9 @@ let m = class extends O {
705
705
  id="${this.id}-to"
706
706
  aria-labelledby="${this.id}-to-label"
707
707
  .value=${this.value[1] ?? ""}
708
- min=${C(this.min)}
709
- max=${C(this.max)}
710
- placeholder=${C(this.placeholder)}
708
+ min=${w(this.min)}
709
+ max=${w(this.max)}
710
+ placeholder=${w(this.placeholder)}
711
711
  ?readonly=${this.isInputReadonly}
712
712
  ?disabled=${this.disabled}
713
713
  @click=${(e) => {
@@ -716,7 +716,7 @@ let m = class extends O {
716
716
  @touchend=${(e) => {
717
717
  e.preventDefault(), this.dispatchToggleCalendar(e);
718
718
  }}
719
- @keydown=${(e) => T.handleInputKeydown(
719
+ @keydown=${(e) => E.handleInputKeydown(
720
720
  e,
721
721
  (s) => this.dispatchToggleCalendar(s),
722
722
  () => D.submitFormOrFallback(this.internals, () => {
@@ -733,7 +733,7 @@ let m = class extends O {
733
733
  this.dispatchInput(e), e.stopImmediatePropagation();
734
734
  }}
735
735
  @focus=${() => {
736
- this.dispatchFocus(), R.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
736
+ this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
737
737
  }}
738
738
  @blur=${(e) => {
739
739
  this.dispatchBlur(e), e.target.value && (this.dispatchManageValidity(e.target), this.dispatchEvent(
@@ -759,7 +759,7 @@ let m = class extends O {
759
759
  class="${x(I.getButtonClasses())}"
760
760
  type="button"
761
761
  @click=${(e) => this.dispatchToggleCalendar(e)}
762
- @keydown=${(e) => T.handleButtonKeydown(e, (s) => this.dispatchToggleCalendar(s))}
762
+ @keydown=${(e) => E.handleButtonKeydown(e, (s) => this.dispatchToggleCalendar(s))}
763
763
  ?disabled=${this.disabled}
764
764
  ${c(this.btnRef)}
765
765
  >
@@ -893,9 +893,9 @@ let f = class extends O {
893
893
  class=${x(this.inputClasses)}
894
894
  .type=${this.inputType}
895
895
  id="${this.id}-input"
896
- min=${C(this.min)}
897
- max=${C(this.max)}
898
- placeholder=${C(this.placeholder)}
896
+ min=${w(this.min)}
897
+ max=${w(this.max)}
898
+ placeholder=${w(this.placeholder)}
899
899
  ?readonly=${this.isInputReadonly}
900
900
  ?disabled=${this.isInputDisabled}
901
901
  @click=${(t) => {
@@ -911,9 +911,9 @@ let f = class extends O {
911
911
  this.dispatchInput(t), t.stopImmediatePropagation();
912
912
  }}
913
913
  @focus=${() => {
914
- this.dispatchFocus(), R.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
914
+ this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
915
915
  }}
916
- @keydown=${(t) => T.handleInputKeydown(
916
+ @keydown=${(t) => E.handleInputKeydown(
917
917
  t,
918
918
  (e) => this.dispatchToggleCalendar(e),
919
919
  () => D.submitFormOrFallback(this.internals, () => {
@@ -933,7 +933,7 @@ let f = class extends O {
933
933
  class="${x(I.getButtonClasses())}"
934
934
  type="button"
935
935
  @click=${(t) => this.dispatchToggleCalendar(t)}
936
- @keydown=${(t) => T.handleButtonKeydown(t, (e) => this.dispatchToggleCalendar(e))}
936
+ @keydown=${(t) => E.handleButtonKeydown(t, (e) => this.dispatchToggleCalendar(e))}
937
937
  ?disabled=${this.disabled}
938
938
  ${c(this.btnRef)}
939
939
  >
@@ -1133,7 +1133,7 @@ let p = class extends J {
1133
1133
  (e = this.calRef.value) != null && e.contains(t.detail.relatedTarget) || this.onBlur();
1134
1134
  }}
1135
1135
  @range-blur=${(t) => {
1136
- F.processRangeBlur(
1136
+ j.processRangeBlur(
1137
1137
  t.detail.event,
1138
1138
  t.detail.values,
1139
1139
  this.calRef,
@@ -1204,7 +1204,7 @@ let p = class extends J {
1204
1204
  .excludeweekdays=${this.excludeweekdays}
1205
1205
  .currentmonth=${this.currentmonth ? G(this.currentmonth) : null}
1206
1206
  @date-selected=${(t) => {
1207
- this.value = F.processDateSelection(t.detail, this.multiple, this.range), this._value = t.detail, F.updateInputValues(
1207
+ this.value = j.processDateSelection(t.detail, this.multiple, this.range), this._value = t.detail, j.updateInputValues(
1208
1208
  this.inputRef,
1209
1209
  this.inputRefTo,
1210
1210
  this._value,
@@ -1285,10 +1285,10 @@ let p = class extends J {
1285
1285
  var e;
1286
1286
  const t = this.datepickerPopupRef.value;
1287
1287
  if (this.calendarOpen = !0, t && typeof t.show == "function") {
1288
- t.show(), R.isIOS() && t.focusOnCurrentDate();
1288
+ t.show(), T.isIOS() && t.focusOnCurrentDate();
1289
1289
  return;
1290
1290
  }
1291
- await Z(20), this.handleCalendarPosition(), R.isIOS() && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
1291
+ await Z(20), this.handleCalendarPosition(), T.isIOS() && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
1292
1292
  }
1293
1293
  hideCalendar() {
1294
1294
  const t = this.datepickerPopupRef.value;
@@ -1305,7 +1305,13 @@ let p = class extends J {
1305
1305
  this.calendarOpen ? this.hideCalendar() : this.showCalendar();
1306
1306
  }
1307
1307
  clearInputValue() {
1308
- this._value = [], this.value = "";
1308
+ this._value = [], this.value = "", this.internals.setFormValue(this.value), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
1309
+ new CustomEvent("value-change", {
1310
+ detail: this._value,
1311
+ bubbles: !0,
1312
+ composed: !0
1313
+ })
1314
+ );
1309
1315
  }
1310
1316
  };
1311
1317
  o([
@@ -1366,7 +1372,7 @@ p = o([
1366
1372
  _("pkt-datepicker")
1367
1373
  ], p);
1368
1374
  export {
1369
- E as P,
1375
+ R as P,
1370
1376
  p as a,
1371
1377
  y as b,
1372
1378
  m as c,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-B4x9ou6w.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});Object.defineProperty(exports,"PktDatepickerMultiple",{enumerable:!0,get:()=>e.PktDatepickerMultiple});Object.defineProperty(exports,"PktDatepickerRange",{enumerable:!0,get:()=>e.PktDatepickerRange});Object.defineProperty(exports,"PktDatepickerSingle",{enumerable:!0,get:()=>e.PktDatepickerSingle});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-C4joeEiQ.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});Object.defineProperty(exports,"PktDatepickerMultiple",{enumerable:!0,get:()=>e.PktDatepickerMultiple});Object.defineProperty(exports,"PktDatepickerRange",{enumerable:!0,get:()=>e.PktDatepickerRange});Object.defineProperty(exports,"PktDatepickerSingle",{enumerable:!0,get:()=>e.PktDatepickerSingle});exports.default=t;
@@ -1,5 +1,5 @@
1
- import { a as e } from "./datepicker-BnNiUusB.js";
2
- import { d as p, c as i, b as c } from "./datepicker-BnNiUusB.js";
1
+ import { a as e } from "./datepicker-lnxklOi4.js";
2
+ import { d as p, c as i, b as c } from "./datepicker-lnxklOi4.js";
3
3
  const a = e;
4
4
  export {
5
5
  e as PktDatepicker,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-BaMrdMDZ.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-BX1YbDHV.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-CTxc8wQe.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-B4x9ou6w.cjs"),x=require("./helptext-CVQP3pis.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-D9kFsTCN.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-CazcIzVT.cjs"),p=require("./radiobutton-D1fihs8R.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-CYHYvdCf.cjs"),M=require("./textinput-DYVtoRMy.cjs"),R=require("./select-D7Ne5gv0.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-BaMrdMDZ.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-BX1YbDHV.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-CTxc8wQe.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-C4joeEiQ.cjs"),x=require("./helptext-CVQP3pis.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-D9kFsTCN.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-CazcIzVT.cjs"),p=require("./radiobutton-D1fihs8R.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-CYHYvdCf.cjs"),M=require("./textinput-DYVtoRMy.cjs"),R=require("./select-D7Ne5gv0.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${q.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -12,7 +12,7 @@ import { P as d, t as h, x as P, n, a as c } from "./element-CRDRygXu.js";
12
12
  import { P as x } from "./pkt-slot-controller-BPGj-LC5.js";
13
13
  import { e as m, n as k } from "./ref-Xa5dbh--.js";
14
14
  import { e as u } from "./class-map-wy7PUk0P.js";
15
- import { P as F, a as J } from "./datepicker-BnNiUusB.js";
15
+ import { P as F, a as J } from "./datepicker-lnxklOi4.js";
16
16
  import { P as V } from "./helptext-DuvVSH7d.js";
17
17
  import { P as Y } from "./heading-Cs5yGnJg.js";
18
18
  import { P as tt } from "./icon-1dy7UZcu.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "13.13.2",
3
+ "version": "13.15.2",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -81,5 +81,5 @@
81
81
  "url": "https://github.com/oslokommune/punkt/issues"
82
82
  },
83
83
  "license": "MIT",
84
- "gitHead": "7707f0d8e3d999702c6b5bf2d4986d8b75307ffb"
84
+ "gitHead": "b9f90e34e22049d0504e4583f464e86f288af2e8"
85
85
  }
@@ -567,5 +567,14 @@ export class PktDatepicker extends PktInputElement<Props> {
567
567
  public clearInputValue() {
568
568
  this._value = []
569
569
  this.value = ''
570
+ this.internals.setFormValue(this.value)
571
+ this.dispatchEvent(new Event('change', { bubbles: true, composed: true }))
572
+ this.dispatchEvent(
573
+ new CustomEvent('value-change', {
574
+ detail: this._value,
575
+ bubbles: true,
576
+ composed: true,
577
+ }),
578
+ )
570
579
  }
571
580
  }