@oslokommune/punkt-elements 13.15.3 → 13.15.6
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 +18 -0
- package/dist/{calendar-DtJh7UYD.js → calendar-Bz27nuTP.js} +161 -158
- package/dist/calendar-Dz1Cnzx5.cjs +115 -0
- package/dist/{checkbox-DgTtlDZM.js → checkbox-CCFBIf44.js} +1 -1
- package/dist/{checkbox-BIph-958.cjs → checkbox-UT6D1Wi0.cjs} +1 -1
- package/dist/{combobox-BX1YbDHV.cjs → combobox-6WP1urZS.cjs} +1 -1
- package/dist/{combobox-BdDZU1bk.js → combobox-CtHgl1n2.js} +3 -3
- package/dist/{datepicker-C4joeEiQ.cjs → datepicker-DEO1C69C.cjs} +47 -47
- package/dist/{datepicker-lnxklOi4.js → datepicker-q9haFM81.js} +178 -203
- package/dist/{helptext-DuvVSH7d.js → helptext-Cs3QHeEy.js} +1 -1
- package/dist/helptext-EPTR9AIl.cjs +24 -0
- package/dist/{input-element-BcFmygSF.js → input-element-Dqu8udwd.js} +1 -1
- package/dist/input-element-KUsQQ-1d.cjs +1 -0
- package/dist/{input-wrapper-D9kFsTCN.cjs → input-wrapper-B-Qseywc.cjs} +2 -2
- package/dist/{input-wrapper-CiqUL7my.js → input-wrapper-Wu3Yv-bn.js} +2 -2
- package/dist/{listbox-CsGiqzD0.cjs → listbox-DnoqOo5u.cjs} +1 -1
- package/dist/{listbox-DlJevu8O.js → listbox-mvKKzH-v.js} +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.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-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +12 -12
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.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-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-CazcIzVT.cjs → progressbar-8gzOtJyh.cjs} +1 -1
- package/dist/{progressbar-BbVei20_.js → progressbar-kxcBEspG.js} +1 -1
- package/dist/{radiobutton-DODROIBF.js → radiobutton-DuAo3CdN.js} +1 -1
- package/dist/{radiobutton-D1fihs8R.cjs → radiobutton-FwxpKELo.cjs} +1 -1
- package/dist/{select-D7Ne5gv0.cjs → select-BbmLn1qh.cjs} +1 -1
- package/dist/{select-_KoHkDbx.js → select-wak-jukY.js} +2 -2
- package/dist/{textarea-DuOBX5is.js → textarea-CIb4VWtN.js} +2 -2
- package/dist/{textarea-CYHYvdCf.cjs → textarea-CzN0E0TV.cjs} +1 -1
- package/dist/{textinput-CrcXv_is.js → textinput-D5_RTkRY.js} +2 -2
- package/dist/{textinput-DYVtoRMy.cjs → textinput-D8v6D6ie.cjs} +1 -1
- package/dist/utils-DznhwRXm.js +8 -0
- package/dist/utils-byXsEz1u.cjs +1 -0
- package/package.json +3 -5
- package/src/components/calendar/calendar.constraints.test.ts +1 -1
- package/src/components/calendar/calendar.core.test.ts +1 -1
- package/src/components/calendar/calendar.selection.test.ts +1 -1
- package/src/components/calendar/calendar.ts +1 -1
- package/src/components/datepicker/date-tags.ts +4 -4
- package/src/components/datepicker/datepicker-multiple.ts +3 -2
- package/src/components/datepicker/datepicker-range.ts +4 -3
- package/src/components/datepicker/datepicker-single.ts +3 -2
- package/src/components/datepicker/datepicker-utils.ts +7 -69
- package/src/components/datepicker/datepicker.core.test.ts +1 -1
- package/src/components/datepicker/datepicker.ts +11 -10
- package/src/components/helptext/helptext.ts +1 -1
- package/src/components/input-wrapper/input-wrapper.ts +1 -1
- package/src/components/listbox/listbox.ts +1 -1
- package/src/components/progressbar/progressbar.ts +1 -1
- package/dist/calendar-BaMrdMDZ.cjs +0 -115
- package/dist/helptext-CVQP3pis.cjs +0 -24
- package/dist/input-element-j9znzLWz.cjs +0 -1
- package/dist/stringutils-CkVRq4jP.cjs +0 -1
- package/dist/stringutils-DJjRa8dG.js +0 -7
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";const a=require("./element-CJ_QKaki.cjs"),
|
|
2
|
-
<div class=${
|
|
3
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
1
|
+
"use strict";const a=require("./element-CJ_QKaki.cjs"),_=require("./state-DSjcvzDN.cjs"),u=require("./calendar-Dz1Cnzx5.cjs"),I=require("./input-element-KUsQQ-1d.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-B-Qseywc.cjs");const f=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs");require("./tag-EFUKrc8q.cjs");const S=require("./utils-byXsEz1u.cjs"),y=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs");var A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,w=(i,e,t,s)=>{for(var n=s>1?void 0:s?M(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&A(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=S.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
|
|
2
|
+
<div class=${f.e(this.classes)} aria-live="polite">
|
|
3
|
+
${Array.isArray(this.dates)&&this.dates[0]?O.c(u.sortDateStrings((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} ${
|
|
7
|
+
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${u.fromISOtoLocal(e,this.dateformat)}`}
|
|
8
8
|
>
|
|
9
|
-
<time datetime=${e}>${
|
|
9
|
+
<time datetime=${e}>${u.fromISOtoLocal(e,this.dateformat)}</time>
|
|
10
10
|
</pkt-tag>`}):a.E}
|
|
11
11
|
</div>
|
|
12
|
-
`}};
|
|
12
|
+
`}};w([a.n({type:Array})],exports.PktDateTags.prototype,"dates",2);w([a.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);w([a.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);w([a.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=w([a.t("pkt-date-tags")],exports.PktDateTags);const F={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$={props:F},b=()=>{const i=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(i)||/Macintosh/.test(i)&&"ontouchend"in document)},P={normalizeNameForMultiple(i,e,t){return i?(e||t)&&!i.endsWith("[]")?i+"[]":i:null},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)}},j={getInputType(){return b()?"text":"date"}},D={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 r,h,T,E;const l=i.value;l&&(t&&t>l?e.setValidity({rangeUnderflow:!0},((h=(r=n==null?void 0:n.forms)==null?void 0:r.messages)==null?void 0:h.rangeUnderflow)||"Value is below minimum",i):s&&s<l&&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 l=t?u.newDate(t):null,r=s?u.newDate(s):null,h=u.newDate(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!l||h>=l)&&(!r||h<=r)&&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,l=i.value.getBoundingClientRect().height;let r=t?"calc(100% - 30px)":"100%";s&&s.top+l>window.innerHeight&&s.top-l>0&&(r=`calc(100% - ${n}px - ${l}px)`),i.value.style.top=r}},C={getInputClasses(i,e,t,s,n,l){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&&l==="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,l){i.value&&(s&&(e!=null&&e.value)?(i.value.value=t[0]??"",e.value.value=t[1]??"",l(i.value),l(e.value)):n||(i.value.value=t.length?t[0]:"",l(i.value)))},processRangeBlur(i,e,t,s,n){var r;const l=i.target;if(l.value){n(l);const h=u.fromISOToDate(l.value);h&&e[0]!==l.value&&e[1]&&(s(),(r=t==null?void 0:t.value)==null||r.handleDateSelect(h))}else e[0]&&s()}},k={handleInputKeydown(i,e,t,s,n,l){const{key:r}=i;r===","&&(i.preventDefault(),l?l(i):n&&n()),(r==="Space"||r===" ")&&(i.preventDefault(),e(i)),r==="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 q=Object.defineProperty,L=Object.getOwnPropertyDescriptor,c=(i,e,t,s)=>{for(var n=s>1?void 0:s?L(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&q(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
|
-
class="${
|
|
14
|
+
class="${f.e(i)}"
|
|
15
15
|
${p.n(this.popupRef)}
|
|
16
16
|
id="date-popup"
|
|
17
17
|
?hidden=${!this.open}
|
|
@@ -34,33 +34,33 @@
|
|
|
34
34
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
35
35
|
></pkt-calendar>
|
|
36
36
|
</div>
|
|
37
|
-
`}};c([a.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([a.n({type:Boolean})],d.prototype,"multiple",2);c([a.n({type:Boolean})],d.prototype,"range",2);c([a.n({type:Boolean})],d.prototype,"weeknumbers",2);c([a.n({type:Boolean})],d.prototype,"withcontrols",2);c([a.n({type:Number})],d.prototype,"maxMultiple",2);c([a.n({type:Array})],d.prototype,"selected",2);c([a.n({type:String})],d.prototype,"earliest",2);c([a.n({type:String})],d.prototype,"latest",2);c([a.n({type:Array})],d.prototype,"excludedates",2);c([a.n({type:Array})],d.prototype,"excludeweekdays",2);c([a.n({type:String})],d.prototype,"currentmonth",2);d=c([a.t("pkt-datepicker-popup")],d);var
|
|
37
|
+
`}};c([a.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([a.n({type:Boolean})],d.prototype,"multiple",2);c([a.n({type:Boolean})],d.prototype,"range",2);c([a.n({type:Boolean})],d.prototype,"weeknumbers",2);c([a.n({type:Boolean})],d.prototype,"withcontrols",2);c([a.n({type:Number})],d.prototype,"maxMultiple",2);c([a.n({type:Array})],d.prototype,"selected",2);c([a.n({type:String})],d.prototype,"earliest",2);c([a.n({type:String})],d.prototype,"latest",2);c([a.n({type:Array})],d.prototype,"excludedates",2);c([a.n({type:Array})],d.prototype,"excludeweekdays",2);c([a.n({type:String})],d.prototype,"currentmonth",2);d=c([a.t("pkt-datepicker-popup")],d);var V=Object.defineProperty,K=Object.getOwnPropertyDescriptor,v=(i,e,t,s)=>{for(var n=s>1?void 0:s?K(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&V(e,t,n),n};exports.PktDatepickerSingle=class extends a.PktElement{constructor(){super(...arguments),this.value="",this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=p.e(),this.btnRef=p.e()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return a.x`
|
|
38
38
|
<div class="pkt-input__container">
|
|
39
39
|
<input
|
|
40
|
-
class="${
|
|
40
|
+
class="${f.e(this.inputClasses)}"
|
|
41
41
|
.type=${this.inputType}
|
|
42
42
|
id="${this.id}-input"
|
|
43
43
|
.value=${this.value}
|
|
44
|
-
min=${
|
|
45
|
-
max=${
|
|
46
|
-
placeholder=${
|
|
44
|
+
min=${y.o(this.min)}
|
|
45
|
+
max=${y.o(this.max)}
|
|
46
|
+
placeholder=${y.o(this.placeholder)}
|
|
47
47
|
?readonly=${this.isInputReadonly}
|
|
48
48
|
aria-describedby="${this.id}-helptext"
|
|
49
49
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
50
50
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
51
51
|
?disabled=${this.disabled}
|
|
52
|
-
@keydown=${e=>
|
|
52
|
+
@keydown=${e=>k.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>D.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()})}
|
|
53
53
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
54
|
-
@focus=${()=>{this.dispatchFocus()
|
|
54
|
+
@focus=${()=>{this.dispatchFocus(),b()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
55
55
|
@blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
|
|
56
56
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
57
57
|
${p.n(this.inputRef)}
|
|
58
58
|
/>
|
|
59
59
|
<button
|
|
60
|
-
class="${
|
|
60
|
+
class="${f.e(C.getButtonClasses())}"
|
|
61
61
|
type="button"
|
|
62
62
|
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
63
|
-
@keydown=${e=>
|
|
63
|
+
@keydown=${e=>k.handleButtonKeydown(e,t=>this.dispatchToggleCalendar(t))}
|
|
64
64
|
?disabled=${this.disabled}
|
|
65
65
|
${p.n(this.btnRef)}
|
|
66
66
|
>
|
|
@@ -68,57 +68,57 @@
|
|
|
68
68
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
69
69
|
</button>
|
|
70
70
|
</div>
|
|
71
|
-
`}};
|
|
71
|
+
`}};v([a.n({type:String})],exports.PktDatepickerSingle.prototype,"value",2);v([a.n({type:String})],exports.PktDatepickerSingle.prototype,"inputType",2);v([a.n({type:String})],exports.PktDatepickerSingle.prototype,"id",2);v([a.n({type:String})],exports.PktDatepickerSingle.prototype,"min",2);v([a.n({type:String})],exports.PktDatepickerSingle.prototype,"max",2);v([a.n({type:String})],exports.PktDatepickerSingle.prototype,"placeholder",2);v([a.n({type:Boolean})],exports.PktDatepickerSingle.prototype,"readonly",2);v([a.n({type:Boolean})],exports.PktDatepickerSingle.prototype,"disabled",2);v([a.n({type:Object})],exports.PktDatepickerSingle.prototype,"inputClasses",2);v([a.n({type:Object})],exports.PktDatepickerSingle.prototype,"internals",2);v([a.n({type:Object})],exports.PktDatepickerSingle.prototype,"strings",2);exports.PktDatepickerSingle=v([a.t("pkt-datepicker-single")],exports.PktDatepickerSingle);var N=Object.defineProperty,U=Object.getOwnPropertyDescriptor,g=(i,e,t,s)=>{for(var n=s>1?void 0:s?U(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&N(e,t,n),n};exports.PktDatepickerRange=class extends a.PktElement{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.showRangeLabels=!1,this.inputClasses={},this.strings={generic:{from:"Fra",to:"Til"}},this.inputRef=p.e(),this.inputRefTo=p.e(),this.btnRef=p.e()}get inputElement(){return this.inputRef.value}get inputElementTo(){return this.inputRefTo.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){const e=C.getRangeLabelClasses(this.showRangeLabels);return a.x`
|
|
72
72
|
<div class="pkt-input__container">
|
|
73
73
|
${this.showRangeLabels?a.x` <div class="pkt-input-prefix">${this.strings.generic.from}</div> `:a.E}
|
|
74
74
|
<input
|
|
75
|
-
class=${
|
|
75
|
+
class=${f.e(this.inputClasses)}
|
|
76
76
|
.type=${this.inputType}
|
|
77
77
|
id="${this.id}-input"
|
|
78
78
|
.value=${this.value[0]??""}
|
|
79
|
-
min=${
|
|
80
|
-
max=${
|
|
81
|
-
placeholder=${
|
|
79
|
+
min=${y.o(this.min)}
|
|
80
|
+
max=${y.o(this.max)}
|
|
81
|
+
placeholder=${y.o(this.placeholder)}
|
|
82
82
|
?readonly=${this.isInputReadonly}
|
|
83
83
|
?disabled=${this.disabled}
|
|
84
84
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
85
85
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
86
|
-
@keydown=${t=>
|
|
86
|
+
@keydown=${t=>k.handleInputKeydown(t,s=>this.dispatchToggleCalendar(s),()=>D.submitFormOrFallback(this.internals,()=>{var s;return(s=this.inputRefTo.value)==null?void 0:s.focus()}),()=>{var s;return(s=this.inputRefTo.value)==null?void 0:s.focus()},()=>{var s;return(s=this.inputRef.value)==null?void 0:s.blur()})}
|
|
87
87
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
88
|
-
@focus=${()=>{this.dispatchFocus()
|
|
88
|
+
@focus=${()=>{this.dispatchFocus(),b()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
89
89
|
@blur=${t=>{this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:t,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
90
90
|
@change=${t=>{t.stopImmediatePropagation()}}
|
|
91
91
|
${p.n(this.inputRef)}
|
|
92
92
|
/>
|
|
93
|
-
<div class="${
|
|
93
|
+
<div class="${f.e(e)}" id="${this.id}-to-label">
|
|
94
94
|
${this.strings.generic.to}
|
|
95
95
|
</div>
|
|
96
96
|
${this.showRangeLabels?a.E:a.x` <div class="pkt-input-separator">–</div> `}
|
|
97
97
|
<input
|
|
98
|
-
class=${
|
|
98
|
+
class=${f.e(this.inputClasses)}
|
|
99
99
|
.type=${this.inputType}
|
|
100
100
|
id="${this.id}-to"
|
|
101
101
|
aria-labelledby="${this.id}-to-label"
|
|
102
102
|
.value=${this.value[1]??""}
|
|
103
|
-
min=${
|
|
104
|
-
max=${
|
|
105
|
-
placeholder=${
|
|
103
|
+
min=${y.o(this.min)}
|
|
104
|
+
max=${y.o(this.max)}
|
|
105
|
+
placeholder=${y.o(this.placeholder)}
|
|
106
106
|
?readonly=${this.isInputReadonly}
|
|
107
107
|
?disabled=${this.disabled}
|
|
108
108
|
@click=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
109
109
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
110
|
-
@keydown=${t=>
|
|
110
|
+
@keydown=${t=>k.handleInputKeydown(t,s=>this.dispatchToggleCalendar(s),()=>D.submitFormOrFallback(this.internals,()=>{var s;return(s=this.inputRefTo.value)==null?void 0:s.blur()}),void 0,()=>{var s;return(s=this.inputRefTo.value)==null?void 0:s.blur()})}
|
|
111
111
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
112
|
-
@focus=${()=>{this.dispatchFocus()
|
|
112
|
+
@focus=${()=>{this.dispatchFocus(),b()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
113
113
|
@blur=${t=>{this.dispatchBlur(t),t.target.value&&(this.dispatchManageValidity(t.target),this.dispatchEvent(new CustomEvent("validate-date-input",{detail:t.target,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("handle-date-select",{detail:t.target.value,bubbles:!0,composed:!0})))}}
|
|
114
114
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
115
115
|
${p.n(this.inputRefTo)}
|
|
116
116
|
/>
|
|
117
117
|
<button
|
|
118
|
-
class="${
|
|
118
|
+
class="${f.e(C.getButtonClasses())}"
|
|
119
119
|
type="button"
|
|
120
120
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
121
|
-
@keydown=${t=>
|
|
121
|
+
@keydown=${t=>k.handleButtonKeydown(t,s=>this.dispatchToggleCalendar(s))}
|
|
122
122
|
?disabled=${this.disabled}
|
|
123
123
|
${p.n(this.btnRef)}
|
|
124
124
|
>
|
|
@@ -126,31 +126,31 @@
|
|
|
126
126
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
127
127
|
</button>
|
|
128
128
|
</div>
|
|
129
|
-
`}};g([a.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"inputType",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"id",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"min",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"max",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"placeholder",2);g([a.n({type:Boolean})],exports.PktDatepickerRange.prototype,"readonly",2);g([a.n({type:Boolean})],exports.PktDatepickerRange.prototype,"disabled",2);g([a.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);g([a.n({type:Object})],exports.PktDatepickerRange.prototype,"inputClasses",2);g([a.n({type:Object})],exports.PktDatepickerRange.prototype,"internals",2);g([a.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=g([a.t("pkt-datepicker-range")],exports.PktDatepickerRange);var
|
|
129
|
+
`}};g([a.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"inputType",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"id",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"min",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"max",2);g([a.n({type:String})],exports.PktDatepickerRange.prototype,"placeholder",2);g([a.n({type:Boolean})],exports.PktDatepickerRange.prototype,"readonly",2);g([a.n({type:Boolean})],exports.PktDatepickerRange.prototype,"disabled",2);g([a.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);g([a.n({type:Object})],exports.PktDatepickerRange.prototype,"inputClasses",2);g([a.n({type:Object})],exports.PktDatepickerRange.prototype,"internals",2);g([a.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=g([a.t("pkt-datepicker-range")],exports.PktDatepickerRange);var z=Object.defineProperty,W=Object.getOwnPropertyDescriptor,m=(i,e,t,s)=>{for(var n=s>1?void 0:s?W(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&z(e,t,n),n};exports.PktDatepickerMultiple=class extends a.PktElement{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=p.e(),this.btnRef=p.e()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return a.x`
|
|
130
130
|
<div class="pkt-input__container">
|
|
131
131
|
<input
|
|
132
|
-
class=${
|
|
132
|
+
class=${f.e(this.inputClasses)}
|
|
133
133
|
.type=${this.inputType}
|
|
134
134
|
id="${this.id}-input"
|
|
135
|
-
min=${
|
|
136
|
-
max=${
|
|
137
|
-
placeholder=${
|
|
135
|
+
min=${y.o(this.min)}
|
|
136
|
+
max=${y.o(this.max)}
|
|
137
|
+
placeholder=${y.o(this.placeholder)}
|
|
138
138
|
?readonly=${this.isInputReadonly}
|
|
139
139
|
?disabled=${this.isInputDisabled}
|
|
140
140
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
141
141
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
142
142
|
@blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
|
|
143
143
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
144
|
-
@focus=${()=>{this.dispatchFocus()
|
|
145
|
-
@keydown=${e=>
|
|
144
|
+
@focus=${()=>{this.dispatchFocus(),b()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
145
|
+
@keydown=${e=>k.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>D.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
|
|
146
146
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
147
147
|
${p.n(this.inputRef)}
|
|
148
148
|
/>
|
|
149
149
|
<button
|
|
150
|
-
class="${
|
|
150
|
+
class="${f.e(C.getButtonClasses())}"
|
|
151
151
|
type="button"
|
|
152
152
|
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
153
|
-
@keydown=${e=>
|
|
153
|
+
@keydown=${e=>k.handleButtonKeydown(e,t=>this.dispatchToggleCalendar(t))}
|
|
154
154
|
?disabled=${this.disabled}
|
|
155
155
|
${p.n(this.btnRef)}
|
|
156
156
|
>
|
|
@@ -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
|
|
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 H=Object.defineProperty,G=Object.getOwnPropertyDescriptor,o=(i,e,t,s)=>{for(var n=s>1?void 0:s?G(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&H(e,t,n),n};exports.PktDatepicker=class extends I.PktInputElement{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=p.e(),this._value=[],this.label="Datovelger",this.dateformat=$.props.dateformat.default,this.multiple=$.props.multiple.default,this.maxlength=null,this.range=$.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=$.props.weeknumbers.default,this.withcontrols=$.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 j.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=P.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=u.valueToArray(e),n=this.multiple&&s.length>1?P.filterSelectableDates(s,this.min,this.max,this.excludedates,this.excludeweekdays):s;if(this.range&&!P.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const l=u.arrayToCsv(n);this._valueProperty!==l&&(this._valueProperty=l),super.valueChanged(l,t)}attributeChangedCallback(e,t,s){e==="value"&&this.value!==t&&this.valueChanged(s,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=u.valueToArray(s||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=u.valueToArray(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=P.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=u.valueToArray(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}
|
|
@@ -200,8 +200,8 @@
|
|
|
200
200
|
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
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
|
-
@validate-date-input=${e=>{
|
|
204
|
-
@handle-date-select=${e=>{var s,n;const t=
|
|
203
|
+
@validate-date-input=${e=>{D.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))}}
|
|
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?
|
|
244
|
+
.currentmonth=${this.currentmonth?u.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=
|
|
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)}}
|
|
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()
|
|
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(),b()&&e.focusOnCurrentDate();return}await S.sleep(20),this.handleCalendarPosition(),b()&&((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}))}};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([_.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=o([a.t("pkt-datepicker")],exports.PktDatepicker);
|