@oslokommune/punkt-elements 14.5.4 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/{accordionitem-DB3tAjIZ.js → accordionitem-BbeS44TD.js} +1 -1
- package/dist/{accordionitem-DHYmPA-o.cjs → accordionitem-DUWhTUEI.cjs} +1 -1
- package/dist/{alert-DVCenNTM.cjs → alert-B9flMht5.cjs} +1 -1
- package/dist/{alert-Cc5FtxHN.js → alert-BpFxQviu.js} +2 -2
- package/dist/{button-Ju4zPhVx.cjs → button-BgCKV0zW.cjs} +1 -1
- package/dist/{button-DrTXtc-n.js → button-CKgpX5QA.js} +1 -1
- package/dist/{calendar-CTx8PD1L.js → calendar-BMarIeVp.js} +332 -325
- package/dist/calendar-C6xgAJ7Z.cjs +90 -0
- package/dist/{card-DvHL7pNu.cjs → card-DI3KodEc.cjs} +1 -1
- package/dist/{card-CTtmPB2n.js → card-h8ekgJRr.js} +2 -2
- package/dist/{checkbox-B-0FOdwi.cjs → checkbox-B2t7wfxe.cjs} +1 -1
- package/dist/{checkbox-CkAwPK_E.js → checkbox-BJ9pz3kV.js} +1 -1
- package/dist/{combobox-DNPfpTjW.js → combobox-BjAvk8Y-.js} +5 -5
- package/dist/{combobox-DvL3SKz2.cjs → combobox-HNN7GTzh.cjs} +1 -1
- package/dist/{consent-DJW7YEat.cjs → consent-C37tuFwZ.cjs} +1 -1
- package/dist/{consent-OdhmtIK-.js → consent-DAk2BJ7I.js} +1 -1
- package/dist/datepicker-2bneToiA.cjs +275 -0
- package/dist/datepicker-DvcH2QD9.js +1160 -0
- package/dist/{helptext-7fyVJK2C.cjs → helptext-BG1P_9j0.cjs} +1 -1
- package/dist/{helptext-CfR0SYe9.js → helptext-Cm6FLBVf.js} +1 -1
- package/dist/index.d.ts +10 -42
- package/dist/input-element-BBv4xjPb.cjs +1 -0
- package/dist/{input-element-DVZhYDJ_.js → input-element-CbjYtVou.js} +143 -147
- package/dist/{input-wrapper-DVUh5rxv.js → input-wrapper-Bwmva-69.js} +3 -3
- package/dist/{input-wrapper-Bta4FZe3.cjs → input-wrapper-CJqmwe3I.cjs} +1 -1
- package/dist/{link-40XAFlYS.js → link-BKnT-97D.js} +1 -1
- package/dist/{link-CBQ7uKqb.cjs → link-DRPFqqEn.cjs} +1 -1
- package/dist/{linkcard-D8hxLedl.cjs → linkcard-02fxYQ2g.cjs} +1 -1
- package/dist/{linkcard-Opb42K2k.js → linkcard-C2UENcqo.js} +1 -1
- package/dist/{loader-Bv1R6-AA.js → loader-BW-AWQiE.js} +1 -1
- package/dist/{loader-Dh_5sihO.cjs → loader-Cj4kUNRE.cjs} +1 -1
- package/dist/{messagebox-B9MCodIz.cjs → messagebox-CK0sSRep.cjs} +1 -1
- package/dist/{messagebox-DEXCTOrz.js → messagebox-DB8tEXrV.js} +1 -1
- package/dist/{modal-Bw61rVrQ.cjs → modal-BzVQSQy2.cjs} +1 -1
- package/dist/{modal-B4adxB6X.js → modal-ClYfWW2a.js} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +4 -4
- 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 +22 -22
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-zn5cmMvL.js → pkt-options-controller-BcGywCmf.js} +1 -1
- package/dist/{pkt-options-controller-DjBCEHU4.cjs → pkt-options-controller-BnTmkl3g.cjs} +1 -1
- 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-slot-controller-D4nKlom5.cjs +1 -0
- package/dist/{pkt-slot-controller-BPGj-LC5.js → pkt-slot-controller-D7CrjM52.js} +27 -25
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{radiobutton-oA20HijB.js → radiobutton-CvKKNFMd.js} +1 -1
- package/dist/{radiobutton-iHuLnuAn.cjs → radiobutton-DWoYQn8H.cjs} +1 -1
- package/dist/{select--wvwpJ0_.cjs → select-BQUp88lY.cjs} +1 -1
- package/dist/{select-DfsNb_Yi.js → select-CFkxir_l.js} +4 -4
- package/dist/{tabitem-CypTmORF.js → tabitem-C8-tZyc_.js} +1 -1
- package/dist/{tabitem-CtltSqDK.cjs → tabitem-DaYfUaxw.cjs} +1 -1
- package/dist/{tag-Cw3OQqLW.js → tag-DIJMJhyp.js} +1 -1
- package/dist/{tag-P9lfQZbM.cjs → tag-h0vD2Na0.cjs} +1 -1
- package/dist/{textarea-CM_bj81t.js → textarea-CMuiBUee.js} +3 -3
- package/dist/{textarea-DcEKhXia.cjs → textarea-DcCOfNlr.cjs} +1 -1
- package/dist/{textinput-AVll6Nh7.js → textinput-D30TCADP.js} +3 -3
- package/dist/{textinput-BzuYzKZ6.cjs → textinput-DR3aaHTH.cjs} +1 -1
- package/package.json +4 -4
- 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 +32 -22
- package/src/components/datepicker/datepicker-popup.test.ts +1 -1
- package/src/components/datepicker/datepicker-popup.ts +73 -30
- package/src/components/datepicker/datepicker-range.ts +5 -1
- package/src/components/datepicker/datepicker-types.ts +4 -54
- package/src/components/datepicker/datepicker-utils.ts +38 -517
- package/src/components/datepicker/datepicker.core.test.ts +12 -10
- package/src/components/datepicker/datepicker.selection.test.ts +8 -6
- package/src/components/datepicker/datepicker.ts +26 -7
- package/src/components/icon/icon.test.ts +8 -8
- package/dist/calendar-5Obd0ZT3.cjs +0 -90
- package/dist/datepicker-CTCaZuZU.cjs +0 -271
- package/dist/datepicker-t0W9fA1e.js +0 -1444
- package/dist/input-element-RBQVA8i0.cjs +0 -1
- package/dist/pkt-slot-controller-BzddBp7z.cjs +0 -1
- package/src/components/calendar/helpers/calendar-grid.ts +0 -93
- package/src/components/calendar/helpers/date-validation.ts +0 -86
- package/src/components/calendar/helpers/index.ts +0 -49
- package/src/components/calendar/helpers/keyboard-navigation.ts +0 -54
- package/src/components/calendar/helpers/selection-manager.ts +0 -184
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./element-aUzIoa1s.cjs"),B=require("./state-GDzxl12x.cjs"),u=require("./calendar-5Obd0ZT3.cjs"),A=require("./input-element-RBQVA8i0.cjs"),p=require("./ref-C5iJMIE1.cjs");require("./icon-n4-ve48P.cjs");require("./input-wrapper-Bta4FZe3.cjs");const m=require("./class-map-CApIYSRo.cjs"),M=require("./repeat-DcYSFU2y.cjs");require("./tag-P9lfQZbM.cjs");const I=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-BElHLTlB.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs");var F=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&F(e,t,i),i};exports.PktDateTags=class extends r.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=I.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},r.x`
|
|
2
|
-
<div class=${m.e(this.classes)} aria-live="polite">
|
|
3
|
-
${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return r.x` <pkt-tag
|
|
4
|
-
id=${this.idBase+e+"-tag"}
|
|
5
|
-
closeTag
|
|
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)}`}
|
|
8
|
-
>
|
|
9
|
-
<time datetime=${e}>${u.fromISOtoLocal(e,this.dateformat)}</time>
|
|
10
|
-
</pkt-tag>`}):r.E}
|
|
11
|
-
</div>
|
|
12
|
-
`}};b([r.n({type:Array})],exports.PktDateTags.prototype,"dates",2);b([r.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);b([r.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);b([r.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=b([r.t("pkt-date-tags")],exports.PktDateTags);const L={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$={props:L},y=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},S={validateRangeOrder(s){return!s||s.length!==2?!0:u.isValidDateRange(s[0],s[1])},sortDates(s){return u.sortDateStrings(s)},filterSelectableDates(s,e,t,a,i){return u.filterSelectableDates(s,e,t,a,i)}},V={getInputType(){return y()?"text":"date"}},k={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,a,i){var l,h,R,E;const n=s.value;n&&(t&&t>n?e.setValidity({rangeUnderflow:!0},((h=(l=i==null?void 0:i.forms)==null?void 0:l.messages)==null?void 0:h.rangeUnderflow)||"Value is below minimum",s):a&&a<n&&e.setValidity({rangeOverflow:!0},((E=(R=i==null?void 0:i.forms)==null?void 0:R.messages)==null?void 0:E.rangeOverflow)||"Value is above maximum",s))}},D={addToSelected(s,e,t,a){const i=s.target;if(!i.value)return;const n=t?u.newDate(t):null,l=a?u.newDate(a):null,h=u.newDate(i.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!n||h>=n)&&(!l||h<=l)&&e.value&&e.value.handleDateSelect(h),i.value=""},handleCalendarPosition(s,e,t=!1){var h;if(!s.value||!e.value)return;const a=((h=e.value.parentElement)==null?void 0:h.getBoundingClientRect())||e.value.getBoundingClientRect(),i=t?a.height+30:a.height,n=s.value.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";a&&a.top+n>window.innerHeight&&a.top-n>0&&(l=`calc(100% - ${i}px - ${n}px)`),s.value.style.top=l}},T={getInputClasses(s,e,t,a,i,n){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":a,"ios-readonly-hack":i===!1&&n==="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(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},P={processDateSelection(s,e,t){return!e&&!t?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,e,t,a,i,n){s.value&&(a&&(e!=null&&e.value)?(s.value.value=t[0]??"",e.value.value=t[1]??"",n(s.value),n(e.value)):i||(s.value.value=t.length?t[0]:"",n(s.value)))},processRangeBlur(s,e,t,a,i){var l;const n=s.target;if(n.value){i(n);const h=u.fromISOToDate(n.value);h&&((l=t==null?void 0:t.value)==null||l.handleDateSelect(h))}else e[0]&&a()}},w={handleInputKeydown(s,e,t,a,i,n){const{key:l}=s;l===","&&(s.preventDefault(),n?n(s):i&&i()),(l==="Space"||l===" ")&&(s.preventDefault(),e(s)),l==="Enter"&&(s.preventDefault(),t?t():a?a():i&&i())},handleButtonKeydown(s,e){const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))}};var U=Object.defineProperty,K=Object.getOwnPropertyDescriptor,c=(s,e,t,a)=>{for(var i=a>1?void 0:a?K(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&U(e,t,i),i};let d=class extends r.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=s=>{if(!this.open)return;const e=s.composedPath(),t=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=s=>{this.open&&s.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 s;this.open=!0,(s=this.calendarRef.value)==null||s.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(s){var e;return!!s&&!!((e=this.popupRef.value)!=null&&e.contains(s))}focusOnCurrentDate(){const s=this.calendarRef.value;s&&typeof s.focusOnCurrentDate=="function"&&s.focusOnCurrentDate()}addToSelected(s,e,t){if(typeof D.addToSelected=="function")return D.addToSelected(s,this.calendarRef,e,t)}handleDateSelect(s){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(s)}render(){const s={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return r.x`
|
|
13
|
-
<div
|
|
14
|
-
class="${m.e(s)}"
|
|
15
|
-
${p.n(this.popupRef)}
|
|
16
|
-
id="date-popup"
|
|
17
|
-
?hidden=${!this.open}
|
|
18
|
-
aria-hidden="${!this.open}"
|
|
19
|
-
>
|
|
20
|
-
<pkt-calendar
|
|
21
|
-
${p.n(this.calendarRef)}
|
|
22
|
-
?multiple=${this.multiple}
|
|
23
|
-
?range=${this.range}
|
|
24
|
-
?weeknumbers=${this.weeknumbers}
|
|
25
|
-
?withcontrols=${this.withcontrols}
|
|
26
|
-
.maxMultiple=${this.maxMultiple}
|
|
27
|
-
.selected=${this.selected}
|
|
28
|
-
.earliest=${this.earliest}
|
|
29
|
-
.latest=${this.latest}
|
|
30
|
-
.excludedates=${this.excludedates}
|
|
31
|
-
.excludeweekdays=${this.excludeweekdays}
|
|
32
|
-
.currentmonth=${this.currentmonth}
|
|
33
|
-
@date-selected=${e=>{this.selected=e.detail,this.dispatchEvent(new CustomEvent("date-selected",{detail:e.detail,bubbles:!0,composed:!0}))}}
|
|
34
|
-
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
35
|
-
></pkt-calendar>
|
|
36
|
-
</div>
|
|
37
|
-
`}};c([r.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([r.n({type:Boolean})],d.prototype,"multiple",2);c([r.n({type:Boolean})],d.prototype,"range",2);c([r.n({type:Boolean})],d.prototype,"weeknumbers",2);c([r.n({type:Boolean})],d.prototype,"withcontrols",2);c([r.n({type:Number})],d.prototype,"maxMultiple",2);c([r.n({type:Array})],d.prototype,"selected",2);c([r.n({type:String})],d.prototype,"earliest",2);c([r.n({type:String})],d.prototype,"latest",2);c([r.n({type:Array})],d.prototype,"excludedates",2);c([r.n({type:Array})],d.prototype,"excludeweekdays",2);c([r.n({type:String})],d.prototype,"currentmonth",2);d=c([r.t("pkt-datepicker-popup")],d);var N=Object.defineProperty,v=(s,e,t,a)=>{for(var i=void 0,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=l(e,t,i)||i);return i&&N(e,t,i),i};class f extends r.PktElement{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},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}))}renderCalendarButton(){var e;return r.x`
|
|
38
|
-
<button
|
|
39
|
-
class="${m.e(T.getButtonClasses())}"
|
|
40
|
-
type="button"
|
|
41
|
-
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
42
|
-
@keydown=${t=>{const{key:a}=t;(a==="Enter"||a===" "||a==="Space")&&(t.preventDefault(),this.dispatchToggleCalendar(t))}}
|
|
43
|
-
?disabled=${this.disabled}
|
|
44
|
-
${this.btnRef}
|
|
45
|
-
>
|
|
46
|
-
<pkt-icon name="calendar"></pkt-icon>
|
|
47
|
-
<span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
|
|
48
|
-
</button>
|
|
49
|
-
`}createRenderRoot(){return this}}v([r.n({type:String})],f.prototype,"inputType");v([r.n({type:String})],f.prototype,"id");v([r.n({type:String})],f.prototype,"min");v([r.n({type:String})],f.prototype,"max");v([r.n({type:String})],f.prototype,"placeholder");v([r.n({type:Boolean})],f.prototype,"readonly");v([r.n({type:Boolean})],f.prototype,"disabled");v([r.n({type:Object})],f.prototype,"inputClasses");v([r.n({type:Object})],f.prototype,"internals");const O={calendar:{buttonAltText:"Åpne kalender"}},z={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var H=Object.defineProperty,W=Object.getOwnPropertyDescriptor,_=(s,e,t,a)=>{for(var i=a>1?void 0:a?W(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&H(e,t,i),i};exports.PktDatepickerSingle=class extends f{constructor(){super(...arguments),this.value="",this.strings=O}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return r.x`
|
|
50
|
-
<div class="pkt-input__container">
|
|
51
|
-
<input
|
|
52
|
-
class="${m.e(this.inputClasses)}"
|
|
53
|
-
.type=${this.inputType}
|
|
54
|
-
id="${this.id}-input"
|
|
55
|
-
.value=${this.value}
|
|
56
|
-
min=${g.o(this.min)}
|
|
57
|
-
max=${g.o(this.max)}
|
|
58
|
-
placeholder=${g.o(this.placeholder)}
|
|
59
|
-
?readonly=${this.isInputReadonly}
|
|
60
|
-
aria-describedby="${this.id}-helptext"
|
|
61
|
-
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
62
|
-
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
63
|
-
?disabled=${this.disabled}
|
|
64
|
-
@keydown=${e=>w.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>k.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()})}
|
|
65
|
-
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
66
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
67
|
-
@blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
|
|
68
|
-
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
69
|
-
${p.n(this.inputRef)}
|
|
70
|
-
/>
|
|
71
|
-
${this.renderCalendarButton()}
|
|
72
|
-
</div>
|
|
73
|
-
`}};_([r.n({type:String})],exports.PktDatepickerSingle.prototype,"value",2);_([r.n({type:Object})],exports.PktDatepickerSingle.prototype,"strings",2);exports.PktDatepickerSingle=_([r.t("pkt-datepicker-single")],exports.PktDatepickerSingle);var G=Object.defineProperty,J=Object.getOwnPropertyDescriptor,C=(s,e,t,a)=>{for(var i=a>1?void 0:a?J(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&G(e,t,i),i};exports.PktDatepickerRange=class extends f{constructor(){super(...arguments),this.value=[],this.showRangeLabels=!1,this.strings=z,this.inputRefTo=p.e()}get inputElementTo(){return this.inputRefTo.value}render(){var t,a;const e=T.getRangeLabelClasses(this.showRangeLabels);return r.x`
|
|
74
|
-
<div class="pkt-input__container">
|
|
75
|
-
${this.showRangeLabels?r.x` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:r.E}
|
|
76
|
-
<input
|
|
77
|
-
class=${m.e(this.inputClasses)}
|
|
78
|
-
.type=${this.inputType}
|
|
79
|
-
id="${this.id}-input"
|
|
80
|
-
.value=${this.value[0]??""}
|
|
81
|
-
min=${g.o(this.min)}
|
|
82
|
-
max=${g.o(this.max)}
|
|
83
|
-
placeholder=${g.o(this.placeholder)}
|
|
84
|
-
?readonly=${this.isInputReadonly}
|
|
85
|
-
?disabled=${this.disabled}
|
|
86
|
-
@click=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
87
|
-
@touchend=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
88
|
-
@keydown=${i=>w.handleInputKeydown(i,n=>this.dispatchToggleCalendar(n),()=>k.submitFormOrFallback(this.internals,()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.focus()}),()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.focus()},()=>{var n;return(n=this.inputRef.value)==null?void 0:n.blur()})}
|
|
89
|
-
@input=${i=>{this.dispatchInput(i),i.stopImmediatePropagation()}}
|
|
90
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
91
|
-
@blur=${i=>{this.dispatchBlur(i),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:i,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
92
|
-
@change=${i=>{this.dispatchChange(i),i.stopImmediatePropagation()}}
|
|
93
|
-
${p.n(this.inputRef)}
|
|
94
|
-
/>
|
|
95
|
-
<div class="${m.e(e)}" id="${this.id}-to-label">
|
|
96
|
-
${(a=this.strings.generic)==null?void 0:a.to}
|
|
97
|
-
</div>
|
|
98
|
-
${this.showRangeLabels?r.E:r.x` <div class="pkt-input-separator">–</div> `}
|
|
99
|
-
<input
|
|
100
|
-
class=${m.e(this.inputClasses)}
|
|
101
|
-
.type=${this.inputType}
|
|
102
|
-
id="${this.id}-to"
|
|
103
|
-
aria-labelledby="${this.id}-to-label"
|
|
104
|
-
.value=${this.value[1]??""}
|
|
105
|
-
min=${g.o(this.min)}
|
|
106
|
-
max=${g.o(this.max)}
|
|
107
|
-
placeholder=${g.o(this.placeholder)}
|
|
108
|
-
?readonly=${this.isInputReadonly}
|
|
109
|
-
?disabled=${this.disabled}
|
|
110
|
-
@click=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
111
|
-
@touchend=${i=>{i.preventDefault(),this.dispatchToggleCalendar(i)}}
|
|
112
|
-
@keydown=${i=>w.handleInputKeydown(i,n=>this.dispatchToggleCalendar(n),()=>k.submitFormOrFallback(this.internals,()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.blur()}),void 0,()=>{var n;return(n=this.inputRefTo.value)==null?void 0:n.blur()})}
|
|
113
|
-
@input=${i=>{this.dispatchInput(i),i.stopImmediatePropagation()}}
|
|
114
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
115
|
-
@blur=${i=>{this.dispatchBlur(i),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:i,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
116
|
-
@change=${i=>{this.dispatchChange(i),i.stopImmediatePropagation()}}
|
|
117
|
-
${p.n(this.inputRefTo)}
|
|
118
|
-
/>
|
|
119
|
-
${this.renderCalendarButton()}
|
|
120
|
-
</div>
|
|
121
|
-
`}};C([r.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);C([r.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);C([r.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=C([r.t("pkt-datepicker-range")],exports.PktDatepickerRange);var Q=Object.defineProperty,X=Object.getOwnPropertyDescriptor,x=(s,e,t,a)=>{for(var i=a>1?void 0:a?X(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&Q(e,t,i),i};exports.PktDatepickerMultiple=class extends f{constructor(){super(...arguments),this.value=[],this.strings=O}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return r.x`
|
|
122
|
-
<div class="pkt-input__container">
|
|
123
|
-
<input
|
|
124
|
-
class=${m.e(this.inputClasses)}
|
|
125
|
-
.type=${this.inputType}
|
|
126
|
-
id="${this.id}-input"
|
|
127
|
-
min=${g.o(this.min)}
|
|
128
|
-
max=${g.o(this.max)}
|
|
129
|
-
placeholder=${g.o(this.placeholder)}
|
|
130
|
-
?readonly=${this.isInputReadonly}
|
|
131
|
-
?disabled=${this.isInputDisabled}
|
|
132
|
-
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
133
|
-
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
134
|
-
@blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
|
|
135
|
-
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
136
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
137
|
-
@keydown=${e=>w.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>k.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
|
|
138
|
-
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
139
|
-
${p.n(this.inputRef)}
|
|
140
|
-
/>
|
|
141
|
-
${this.renderCalendarButton()}
|
|
142
|
-
</div>
|
|
143
|
-
`}};x([r.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);x([r.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);x([r.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=x([r.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var Y=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,o=(s,e,t,a)=>{for(var i=a>1?void 0:a?Z(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&Y(e,t,i),i};exports.PktDatepicker=class extends A.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):D.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new j.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 V.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(e===t)return;const a=u.valueToArray(e),i=this.multiple&&a.length>1?S.filterSelectableDates(a,this.min,this.max,this.excludedates,this.excludeweekdays):a;if(this.range&&!S.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const n=u.arrayToCsv(i);this._valueProperty!==n&&(this._valueProperty=n),super.valueChanged(n,t)}attributeChangedCallback(e,t,a){e==="value"&&this.value!==t&&this.valueChanged(a,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=u.valueToArray(a||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=u.valueToArray(a||"")),super.attributeChangedCallback(e,t,a)}updated(e){if(e.has("value")){const t=Array.isArray(this.value)?this.value.join(","):this.value,a=e.get("value"),i=Array.isArray(a)?a.join(","):a;this.valueChanged(t,i)}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,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(a=this.singleInputRef.value)==null?void 0:a.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,a;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(a=this.singleInputRef.value)==null?void 0:a.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return r.x`
|
|
144
|
-
<pkt-datepicker-single
|
|
145
|
-
.value=${this._value[0]??""}
|
|
146
|
-
.inputType=${this.inputType}
|
|
147
|
-
.id=${this.id}
|
|
148
|
-
.min=${this.min}
|
|
149
|
-
.max=${this.max}
|
|
150
|
-
.placeholder=${this.placeholder}
|
|
151
|
-
.readonly=${this.readonly}
|
|
152
|
-
.disabled=${this.disabled}
|
|
153
|
-
.inputClasses=${this.inputClasses}
|
|
154
|
-
.internals=${this.internals}
|
|
155
|
-
.strings=${this.strings}
|
|
156
|
-
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
157
|
-
@input-change=${()=>this.onInput()}
|
|
158
|
-
@input-focus=${()=>this.onFocus()}
|
|
159
|
-
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
160
|
-
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
161
|
-
@value-change=${e=>{this.value=e.detail}}
|
|
162
|
-
@input-changed=${()=>{this.touched=!0}}
|
|
163
|
-
${p.n(this.singleInputRef)}
|
|
164
|
-
></pkt-datepicker-single>
|
|
165
|
-
`}renderRangeInput(){return r.x`
|
|
166
|
-
<pkt-datepicker-range
|
|
167
|
-
.value=${this._value}
|
|
168
|
-
.inputType=${this.inputType}
|
|
169
|
-
.id=${this.id}
|
|
170
|
-
.min=${this.min}
|
|
171
|
-
.max=${this.max}
|
|
172
|
-
.placeholder=${this.placeholder}
|
|
173
|
-
.readonly=${this.readonly}
|
|
174
|
-
.disabled=${this.disabled}
|
|
175
|
-
.showRangeLabels=${this.showRangeLabels}
|
|
176
|
-
.inputClasses=${this.inputClasses}
|
|
177
|
-
.internals=${this.internals}
|
|
178
|
-
.strings=${this.strings}
|
|
179
|
-
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
180
|
-
@input-change=${()=>this.onInput()}
|
|
181
|
-
@input-focus=${()=>this.onFocus()}
|
|
182
|
-
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
183
|
-
@range-blur=${e=>{const t=this.currentInputElement,a=this.currentInputElementTo;if(t&&a){const i=t.value,n=a.value;if(i&&n&&i>n)a.value="",this._value=[i],this.value=i;else{const l=[i,n].filter(Boolean);l.length>0&&(l[0]!==this._value[0]||l[1]!==this._value[1])&&(this._value=l,this.value=l.join(","))}}P.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
|
|
184
|
-
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
185
|
-
@validate-date-input=${e=>{k.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
|
|
186
|
-
@handle-date-select=${e=>{var a,i;const t=u.fromISOToDate(e.detail);if(t){const n=u.formatISODate(t);this._value[0]!==n&&this._value[1]!==n&&((i=(a=this.calRef)==null?void 0:a.value)==null||i.handleDateSelect(t))}}}
|
|
187
|
-
@input-changed=${()=>{this.touched=!0}}
|
|
188
|
-
${p.n(this.rangeInputRef)}
|
|
189
|
-
></pkt-datepicker-range>
|
|
190
|
-
`}renderMultipleInput(){return r.x`
|
|
191
|
-
<pkt-datepicker-multiple
|
|
192
|
-
.value=${this._value}
|
|
193
|
-
.inputType=${this.inputType}
|
|
194
|
-
.id=${this.id}
|
|
195
|
-
.min=${this.min}
|
|
196
|
-
.max=${this.max}
|
|
197
|
-
.placeholder=${this.placeholder}
|
|
198
|
-
.readonly=${this.readonly}
|
|
199
|
-
.disabled=${this.disabled}
|
|
200
|
-
.maxlength=${this.maxlength}
|
|
201
|
-
.inputClasses=${this.inputClasses}
|
|
202
|
-
.internals=${this.internals}
|
|
203
|
-
.strings=${this.strings}
|
|
204
|
-
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
205
|
-
@input-change=${()=>this.onInput()}
|
|
206
|
-
@input-focus=${()=>this.onFocus()}
|
|
207
|
-
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
208
|
-
@add-to-selected=${e=>this.addToSelected(e.detail)}
|
|
209
|
-
@input-changed=${()=>{this.touched=!0}}
|
|
210
|
-
${p.n(this.multipleInputRef)}
|
|
211
|
-
></pkt-datepicker-multiple>
|
|
212
|
-
`}renderCalendar(){return r.x`
|
|
213
|
-
<pkt-datepicker-popup
|
|
214
|
-
class="pkt-contents"
|
|
215
|
-
?open=${this.calendarOpen}
|
|
216
|
-
?multiple=${this.multiple}
|
|
217
|
-
?range=${this.range}
|
|
218
|
-
?weeknumbers=${this.weeknumbers}
|
|
219
|
-
?withcontrols=${this.withcontrols}
|
|
220
|
-
.maxMultiple=${this.maxlength}
|
|
221
|
-
.selected=${this._value}
|
|
222
|
-
.earliest=${this.min}
|
|
223
|
-
.latest=${this.max}
|
|
224
|
-
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
225
|
-
.excludeweekdays=${this.excludeweekdays}
|
|
226
|
-
.currentmonth=${this.currentmonth?u.parseISODateString(this.currentmonth):null}
|
|
227
|
-
@date-selected=${e=>{this.value=P.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,P.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
|
|
228
|
-
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
229
|
-
${p.n(this.datepickerPopupRef)}
|
|
230
|
-
></pkt-datepicker-popup>
|
|
231
|
-
`}render(){return this.inputClasses=T.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),r.x`
|
|
232
|
-
<pkt-input-wrapper
|
|
233
|
-
label="${this.label}"
|
|
234
|
-
forId="${this.id}-input"
|
|
235
|
-
?counter=${this.multiple&&!!this.maxlength}
|
|
236
|
-
.counterCurrent=${this.value?this._value.length:0}
|
|
237
|
-
.counterMaxLength=${this.maxlength}
|
|
238
|
-
?disabled=${this.disabled}
|
|
239
|
-
?hasError=${this.hasError}
|
|
240
|
-
?hasFieldset=${this.hasFieldset}
|
|
241
|
-
?inline=${this.inline}
|
|
242
|
-
?required=${this.required}
|
|
243
|
-
?optionalTag=${this.optionalTag}
|
|
244
|
-
?requiredTag=${this.requiredTag}
|
|
245
|
-
useWrapper=${this.useWrapper}
|
|
246
|
-
.optionalText=${this.optionalText}
|
|
247
|
-
.requiredText=${this.requiredText}
|
|
248
|
-
.tagText=${this.tagText}
|
|
249
|
-
.errorMessage=${this.errorMessage}
|
|
250
|
-
.helptext=${this.helptext}
|
|
251
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
252
|
-
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
253
|
-
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
254
|
-
class="pkt-datepicker"
|
|
255
|
-
>
|
|
256
|
-
<div class="pkt-contents" ${p.n(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
257
|
-
${this.multiple?r.x`<pkt-date-tags
|
|
258
|
-
.dates=${this._value}
|
|
259
|
-
dateformat=${this.dateformat}
|
|
260
|
-
strings=${this.strings}
|
|
261
|
-
id-base=${this.id}
|
|
262
|
-
@date-tag-removed=${e=>{var i;const t=this.datepickerPopupRef.value,a=u.fromISOToDate(e.detail);t&&a&&typeof t.handleDateSelect=="function"?t.handleDateSelect(a):(i=this.calRef.value)==null||i.handleDateSelect(a)}}
|
|
263
|
-
></pkt-date-tags>`:r.E}
|
|
264
|
-
<div
|
|
265
|
-
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
266
|
-
>
|
|
267
|
-
${this.range?this.renderRangeInput():this.multiple?this.renderMultipleInput():this.renderInput()}
|
|
268
|
-
</div>
|
|
269
|
-
</pkt-input-wrapper>
|
|
270
|
-
${this.renderCalendar()}
|
|
271
|
-
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;D.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(),y()&&e.focusOnCurrentDate();return}await I.sleep(20),this.handleCalendarPosition(),y()&&((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 a=!!t.open;t.toggle(),this.calendarOpen=!a;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([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",1);o([r.n({type:Array})],exports.PktDatepicker.prototype,"_value",2);o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);o([r.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);o([r.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);o([r.n({type:Boolean})],exports.PktDatepicker.prototype,"showRangeLabels",2);o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);o([r.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);o([r.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);o([r.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);o([r.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);o([r.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);o([r.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"calendarOpen",2);o([r.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);o([B.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=o([r.t("pkt-datepicker")],exports.PktDatepicker);
|