@oslokommune/punkt-elements 16.7.1 → 16.7.4
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 +35 -0
- package/dist/accordion-BB1JrONI.cjs +34 -0
- package/dist/accordion-nNH87Y60.js +130 -0
- package/dist/alert-BEEnTiCb.cjs +33 -0
- package/dist/alert-ePJuDtmm.js +171 -0
- package/dist/async-directive-B9P1Qa0k.cjs +1 -0
- package/dist/async-directive-CaQiqjyV.js +55 -0
- package/dist/backlink-Ba03LlbB.cjs +13 -0
- package/dist/backlink-CiwXrQYD.js +38 -0
- package/dist/booleanish-BmcOU-43.js +11 -0
- package/dist/booleanish-jJLlnr6-.cjs +1 -0
- package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
- package/dist/breadcrumbs-CpuVqWhF.js +76 -0
- package/dist/button-BIpd1xJh.js +95 -0
- package/dist/button-D-TOBaJB.cjs +27 -0
- package/dist/calendar-BzEtOJla.js +2031 -0
- package/dist/calendar-E5jJLt8D.cjs +90 -0
- package/dist/card-BYJu1MYm.js +339 -0
- package/dist/card-CUFhMVim.cjs +87 -0
- package/dist/checkbox-BARDb9iV.cjs +31 -0
- package/dist/checkbox-Cspxcvt_.js +111 -0
- package/dist/class-map-C8HuhNzZ.js +27 -0
- package/dist/class-map-CJ-msbHs.cjs +1 -0
- package/dist/classutils-DEL164Ur.js +7 -0
- package/dist/classutils-z8YsPlOf.cjs +1 -0
- package/dist/combobox-BcdLZRDU.js +984 -0
- package/dist/combobox-CGbFTWq_.cjs +135 -0
- package/dist/consent-DeB_5sWH.js +197 -0
- package/dist/consent-hwu7pp3S.cjs +11 -0
- package/dist/datepicker-DpmlsnH_.cjs +273 -0
- package/dist/datepicker-OVd8pmnZ.js +1125 -0
- package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
- package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
- package/dist/directive-3THFsVew.js +28 -0
- package/dist/directive-CJ2giQBZ.cjs +1 -0
- package/dist/directive-helpers-D1QSxY17.cjs +1 -0
- package/dist/directive-helpers-Dkv2gKgs.js +25 -0
- package/dist/element-DjtxO-1r.cjs +2 -0
- package/dist/element-cZ85T_aa.js +693 -0
- package/dist/element-with-slot-4J2o3SeU.js +166 -0
- package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
- package/dist/header-DWgPgGfS.cjs +304 -0
- package/dist/header-a6ztVNp3.js +782 -0
- package/dist/heading-BgSWIRii.cjs +1 -0
- package/dist/heading-DiQLPxdf.js +73 -0
- package/dist/helptext-CCBKKLus.js +65 -0
- package/dist/helptext-D-3QfZv5.cjs +24 -0
- package/dist/icon-Co72KtgF.js +86 -0
- package/dist/icon-Dr8sfT2X.cjs +1 -0
- package/dist/if-defined-Cjj8qN-Z.js +5 -0
- package/dist/if-defined-XKOD_t_V.cjs +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/input-element-B1yxcfz4.cjs +1 -0
- package/dist/input-element-Bw1s6NlF.js +643 -0
- package/dist/input-wrapper-BRuVELpK.cjs +54 -0
- package/dist/input-wrapper-CDyHTR1V.js +164 -0
- package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
- package/dist/input-wrapper-YfTmpSSY.js +117 -0
- package/dist/link-CKAFMz9j.js +89 -0
- package/dist/link-CyTCpI0k.cjs +7 -0
- package/dist/linkcard-B0KOGaGj.js +55 -0
- package/dist/linkcard-BE4-FewK.cjs +13 -0
- package/dist/listbox-DCA2JoPV.cjs +106 -0
- package/dist/listbox-DuBgTFvH.js +397 -0
- package/dist/loader-6kFZUErT.js +66 -0
- package/dist/loader-CX2rsC01.cjs +16 -0
- package/dist/messagebox-Cwlg5sOr.js +110 -0
- package/dist/messagebox-Din9X53b.cjs +13 -0
- package/dist/modal-C_wtsh9m.js +209 -0
- package/dist/modal-DS_wUOIv.cjs +36 -0
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -7
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +2 -6
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -6
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -79
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -6
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -6
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -6
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -6
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -6
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -6
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -10
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -855
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -6
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -6
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -6
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +30 -66
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -6
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -6
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -6
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -6
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -6
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -6
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -6
- package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
- package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -6
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -6
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -6
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -7
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +2 -6
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -6
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -6
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -558
- package/dist/progressbar-CdXtmOBb.cjs +17 -0
- package/dist/progressbar-Dy9AiYQz.js +113 -0
- package/dist/radiobutton-GOnpUbCW.cjs +31 -0
- package/dist/radiobutton-V_KPbup_.js +84 -0
- package/dist/ref-BaJ0mBT_.cjs +1 -0
- package/dist/ref-RS8Uv6uC.js +30 -0
- package/dist/repeat-Cepr3469.js +57 -0
- package/dist/repeat-CqcDYBxr.cjs +1 -0
- package/dist/select-BSAFd8Wa.js +164 -0
- package/dist/select-C2i8sOk5.cjs +49 -0
- package/dist/tabs-D8nL9rWx.cjs +37 -0
- package/dist/tabs-Y7utmJi9.js +318 -0
- package/dist/tag-DLthw5b4.cjs +27 -0
- package/dist/tag-VwykmuQR.js +179 -0
- package/dist/textarea-D7aGOyDf.cjs +46 -0
- package/dist/textarea-DYOBhJrN.js +115 -0
- package/dist/textinput-BUgntXnM.js +124 -0
- package/dist/textinput-DFh8_9cx.cjs +70 -0
- package/dist/timepicker-BIfE7KKJ.cjs +191 -0
- package/dist/timepicker-DaSwn1FA.js +503 -0
- package/dist/utils-CUqCKGvp.js +7 -0
- package/dist/utils-CjAbIttF.cjs +1 -0
- package/package.json +6 -6
- package/src/components/accordion/accordion.ts +6 -1
- package/src/components/accordion/accordionitem.ts +6 -1
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +12 -7
- package/src/components/backlink/backlink.ts +6 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
- package/src/components/button/button.ts +6 -1
- package/src/components/calendar/calendar.ts +6 -1
- package/src/components/card/card.ts +6 -1
- package/src/components/checkbox/checkbox.ts +6 -1
- package/src/components/combobox/combobox.ts +6 -1
- package/src/components/consent/consent.ts +6 -1
- package/src/components/datepicker/date-tags.ts +6 -1
- package/src/components/datepicker/datepicker-multiple.ts +6 -1
- package/src/components/datepicker/datepicker-popup.ts +6 -1
- package/src/components/datepicker/datepicker-range.ts +6 -1
- package/src/components/datepicker/datepicker-single.ts +6 -1
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/src/components/datepicker/datepicker.ts +6 -1
- package/src/components/header/header-service.ts +6 -1
- package/src/components/header/header-user-menu.ts +6 -1
- package/src/components/header/header.ts +6 -1
- package/src/components/heading/heading.ts +6 -1
- package/src/components/helptext/helptext.ts +6 -1
- package/src/components/icon/icon.ts +6 -1
- package/src/components/input-wrapper/input-wrapper.ts +6 -1
- package/src/components/link/link.ts +6 -1
- package/src/components/linkcard/linkcard.ts +6 -1
- package/src/components/listbox/listbox.ts +6 -1
- package/src/components/loader/loader.ts +6 -1
- package/src/components/messagebox/messagebox.ts +6 -1
- package/src/components/modal/modal.ts +6 -1
- package/src/components/progressbar/progressbar.ts +6 -1
- package/src/components/radiobutton/radiobutton.ts +6 -1
- package/src/components/select/select.ts +6 -1
- package/src/components/tabs/tabitem.ts +6 -1
- package/src/components/tabs/tabs.ts +6 -1
- package/src/components/tag/tag.ts +6 -1
- package/src/components/textarea/textarea.ts +6 -1
- package/src/components/textinput/textinput.ts +6 -1
- package/src/components/timepicker/timepicker.ts +6 -1
- package/dist/accordionitem-D1Agl1bB.cjs +0 -34
- package/dist/accordionitem-ZlaXvjt5.js +0 -138
- package/dist/alert-BuAXrnKl.js +0 -115
- package/dist/alert-DFkFNTxh.cjs +0 -33
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-EiAXUUZP.cjs +0 -13
- package/dist/backlink-V4DAt17e.js +0 -47
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-DEyvt1LI.js +0 -137
- package/dist/button-DYv5Dg4M.cjs +0 -27
- package/dist/calendar-HIE9nxcc.cjs +0 -90
- package/dist/calendar-S63oreVW.js +0 -2138
- package/dist/card-CyeH6l1c.cjs +0 -87
- package/dist/card-DDiLfuO4.js +0 -231
- package/dist/checkbox-BLlwTABj.cjs +0 -31
- package/dist/checkbox-ejBUa5qQ.js +0 -145
- package/dist/class-map-CEnykyO_.js +0 -34
- package/dist/class-map-CsENJXf1.cjs +0 -5
- package/dist/classutils-BwNK82ZQ.cjs +0 -1
- package/dist/classutils-RQs1k6D9.js +0 -7
- package/dist/combobox-BmxSecfE.js +0 -818
- package/dist/combobox-Hb2V-fPX.cjs +0 -135
- package/dist/consent-iXyx5v6J.js +0 -173
- package/dist/consent-ruWAEVXW.cjs +0 -11
- package/dist/datepicker-CZl7b8Na.js +0 -1158
- package/dist/datepicker-D2H7U6MS.cjs +0 -273
- package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
- package/dist/directive-C7oCP5Bh.cjs +0 -5
- package/dist/directive-helpers-BP2WOx60.cjs +0 -5
- package/dist/directive-helpers-rm-28gIj.js +0 -38
- package/dist/directive-oAbCiebi.js +0 -27
- package/dist/element-CPpT3rFQ.js +0 -638
- package/dist/element-gR_VtSiD.cjs +0 -27
- package/dist/element-with-slot-Dqk6-TRR.js +0 -240
- package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
- package/dist/heading-CKt7cVn7.js +0 -101
- package/dist/heading-Cvz8m1xL.cjs +0 -1
- package/dist/helptext-5Mzp65-F.cjs +0 -24
- package/dist/helptext-jIoWRcCF.js +0 -80
- package/dist/icon-BlKA8YuW.js +0 -103
- package/dist/icon-Bqj9oBbl.cjs +0 -9
- package/dist/if-defined-B0krMLad.js +0 -10
- package/dist/if-defined-BOW3ODSj.cjs +0 -5
- package/dist/input-element-8nLwuQS4.js +0 -837
- package/dist/input-element-DdVhUvva.cjs +0 -1
- package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
- package/dist/input-wrapper-B2JpK016.js +0 -179
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-R_lNhViF.cjs +0 -7
- package/dist/link-Z_GizclR.js +0 -53
- package/dist/linkcard-BlQvdB1a.js +0 -54
- package/dist/linkcard-C7HbSLlX.cjs +0 -13
- package/dist/listbox-BQKDZvZn.js +0 -438
- package/dist/listbox-CGgV9MAe.cjs +0 -106
- package/dist/loader-Ci3CHU8k.js +0 -93
- package/dist/loader-e2gs_1xz.cjs +0 -16
- package/dist/messagebox-Bf-XMlvW.js +0 -69
- package/dist/messagebox-D67w71VX.cjs +0 -13
- package/dist/modal-CyvEkbfQ.cjs +0 -36
- package/dist/modal-DzGe1g8Z.js +0 -154
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-By7e0lEI.js +0 -162
- package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
- package/dist/radiobutton-6frNG9J_.js +0 -111
- package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
- package/dist/ref-Bg_Swj5w.js +0 -42
- package/dist/ref-CL-Xk9Xm.cjs +0 -5
- package/dist/repeat-BD8TKgJb.js +0 -61
- package/dist/repeat-Cfq8CDlf.cjs +0 -5
- package/dist/select-CXZt1nHS.js +0 -228
- package/dist/select-WFhS4Vfp.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-CB8wkKmv.js +0 -332
- package/dist/tabitem-DZpspU4Q.cjs +0 -65
- package/dist/tag-BuCpqaks.js +0 -115
- package/dist/tag-X6xdjR0N.cjs +0 -27
- package/dist/textarea-Bzuymclz.js +0 -131
- package/dist/textarea-DoeHJ7HR.cjs +0 -50
- package/dist/textinput-9lHjs4ce.js +0 -150
- package/dist/textinput-BNsLd26i.cjs +0 -70
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("./element-gR_VtSiD.cjs"),I=require("./state-Dg-53wQ8.cjs"),u=require("./calendar-HIE9nxcc.cjs"),A=require("./input-element-DdVhUvva.cjs"),o=require("./ref-CL-Xk9Xm.cjs");require("./icon-Bqj9oBbl.cjs");require("./input-wrapper-B0MkQ0IZ.cjs");const m=require("./class-map-CsENJXf1.cjs"),M=require("./repeat-Cfq8CDlf.cjs");require("./tag-X6xdjR0N.cjs");const O=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-BOW3ODSj.cjs"),F=require("./element-with-slot-ZX-up7jO.cjs"),B={calendar:{buttonAltText:"Åpne kalender"}},j={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var q=Object.defineProperty,L=Object.getOwnPropertyDescriptor,k=(s,e,t,a)=>{for(var i=a>1?void 0:a?L(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&q(e,t,i),i};exports.PktDateTags=class extends l.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},l.b`
|
|
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 l.b` <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>`}):l.A}
|
|
11
|
-
</div>
|
|
12
|
-
`}};k([l.n({type:Array})],exports.PktDateTags.prototype,"dates",2);k([l.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);k([l.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);k([l.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=k([l.t("pkt-date-tags")],exports.PktDateTags);const V={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},$={props:V},y=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},K=()=>y()?"text":"date",U=s=>!s||s.length!==2?!0:u.isValidDateRange(s[0],s[1]),N=s=>u.sortDateStrings(s),z=(s,e,t,a,i)=>u.filterSelectableDates(s,e,t,a,i),W=(s,e,t,a,i,r)=>({"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&&r==="text"}),H=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),G=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),J=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,Q=(s,e,t=!1)=>{var p;if(!s||!e)return;const a=((p=e.parentElement)==null?void 0:p.getBoundingClientRect())||e.getBoundingClientRect(),i=t?a.height+30:a.height,r=s.getBoundingClientRect().height;let n=t?"calc(100% - 30px)":"100%";a&&a.top+r>window.innerHeight&&a.top-r>0&&(n=`calc(100% - ${i}px - ${r}px)`),s.style.top=n},X=(s,e,t,a,i,r)=>{const{key:n}=s;n===","&&(s.preventDefault(),r?r(s):i&&i()),(n==="Space"||n===" ")&&(s.preventDefault(),e(s)),n==="Enter"&&(s.preventDefault(),t?t():a?a():i&&i())},Y=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},E={validateRangeOrder:U,sortDates:N,filterSelectableDates:z},Z={getInputType:K},b={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 n,p,R,S;const r=s.value;r&&(t&&t>r?e.setValidity({rangeUnderflow:!0},((p=(n=i==null?void 0:i.forms)==null?void 0:n.messages)==null?void 0:p.rangeUnderflow)||"Value is below minimum",s):a&&a<r&&e.setValidity({rangeOverflow:!0},((S=(R=i==null?void 0:i.forms)==null?void 0:R.messages)==null?void 0:S.rangeOverflow)||"Value is above maximum",s))}},w={addToSelected(s,e,t,a){const i=s.target;if(!i.value)return;const r=t?u.newDate(t):null,n=a?u.newDate(a):null,p=u.newDate(i.value.split(",")[0]);p&&!isNaN(p.getTime())&&(!r||p>=r)&&(!n||p<=n)&&e.value&&e.value.handleDateSelect(p),i.value=""},handleCalendarPosition(s,e,t=!1){Q(s.value??null,e.value??null,t)}},x={getInputClasses:W,getButtonClasses:H,getRangeLabelClasses:G},T={processDateSelection:J,updateInputValues(s,e,t,a,i,r){s.value&&(a&&(e!=null&&e.value)?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):i||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,a,i){var n;const r=s.target;if(r.value){i(r);const p=u.fromISOToDate(r.value);p&&((n=t==null?void 0:t.value)==null||n.handleDateSelect(p))}else e[0]&&a()}},C={handleInputKeydown:X,handleButtonKeydown:Y};var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,c=(s,e,t,a)=>{for(var i=a>1?void 0:a?te(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ee(e,t,i),i};let d=class extends l.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.today=null,this._hasBeenOpened=!1,this.popupRef=o.e(),this.calendarRef=o.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}updated(s){super.updated(s),s.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}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(this.calendarRef.value&&typeof w.addToSelected=="function")return w.addToSelected(s,this.calendarRef,e,t);const i=s.target;if(!i.value)return;const r=e?u.newDate(e):null,n=t?u.newDate(t):null,p=u.newDate(i.value.split(",")[0]);p&&!isNaN(p.getTime())&&(!r||p>=r)&&(!n||p<=n)&&this.handleDateSelect(p),i.value=""}handleDateSelect(s){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(s);const t=u.formatISODate(s),i=this.selected.indexOf(t)>=0?this.selected.filter(r=>r!==t):[...this.selected,t];this.selected=i,this.dispatchEvent(new CustomEvent("date-selected",{detail:i,bubbles:!0,composed:!0}))}render(){const s={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return l.b`
|
|
13
|
-
<div
|
|
14
|
-
class="${m.e(s)}"
|
|
15
|
-
${o.n(this.popupRef)}
|
|
16
|
-
id="date-popup"
|
|
17
|
-
?hidden=${!this.open}
|
|
18
|
-
aria-hidden="${!this.open}"
|
|
19
|
-
>
|
|
20
|
-
${this.open||this._hasBeenOpened?l.b`<pkt-calendar
|
|
21
|
-
${o.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
|
-
.today=${this.today}
|
|
34
|
-
@date-selected=${e=>{this.selected=e.detail,this.dispatchEvent(new CustomEvent("date-selected",{detail:e.detail,bubbles:!0,composed:!0}))}}
|
|
35
|
-
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
36
|
-
></pkt-calendar>`:l.A}
|
|
37
|
-
</div>
|
|
38
|
-
`}};c([l.n({type:Boolean,reflect:!0})],d.prototype,"open",2);c([l.n({type:Boolean})],d.prototype,"multiple",2);c([l.n({type:Boolean})],d.prototype,"range",2);c([l.n({type:Boolean})],d.prototype,"weeknumbers",2);c([l.n({type:Boolean})],d.prototype,"withcontrols",2);c([l.n({type:Number})],d.prototype,"maxMultiple",2);c([l.n({type:Array})],d.prototype,"selected",2);c([l.n({type:String})],d.prototype,"earliest",2);c([l.n({type:String})],d.prototype,"latest",2);c([l.n({type:Array})],d.prototype,"excludedates",2);c([l.n({type:Array})],d.prototype,"excludeweekdays",2);c([l.n({type:String})],d.prototype,"currentmonth",2);c([l.n({type:String})],d.prototype,"today",2);c([I.r()],d.prototype,"_hasBeenOpened",2);d=c([l.t("pkt-datepicker-popup")],d);var se=Object.defineProperty,v=(s,e,t,a)=>{for(var i=void 0,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=n(e,t,i)||i);return i&&se(e,t,i),i};class f extends l.PktElement{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=o.e(),this.btnRef=o.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 l.b`
|
|
39
|
-
<button
|
|
40
|
-
class="${m.e(x.getButtonClasses())}"
|
|
41
|
-
type="button"
|
|
42
|
-
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
43
|
-
@keydown=${t=>{const{key:a}=t;(a==="Enter"||a===" "||a==="Space")&&(t.preventDefault(),this.dispatchToggleCalendar(t))}}
|
|
44
|
-
?disabled=${this.disabled}
|
|
45
|
-
${this.btnRef}
|
|
46
|
-
>
|
|
47
|
-
<pkt-icon name="calendar"></pkt-icon>
|
|
48
|
-
<span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
|
|
49
|
-
</button>
|
|
50
|
-
`}createRenderRoot(){return this}}v([l.n({type:String})],f.prototype,"inputType");v([l.n({type:String})],f.prototype,"id");v([l.n({type:String})],f.prototype,"min");v([l.n({type:String})],f.prototype,"max");v([l.n({type:String})],f.prototype,"placeholder");v([l.n({type:Boolean})],f.prototype,"readonly");v([l.n({type:Boolean})],f.prototype,"disabled");v([l.n({type:Object})],f.prototype,"inputClasses");v([l.n({type:Object})],f.prototype,"internals");var ie=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,_=(s,e,t,a)=>{for(var i=a>1?void 0:a?ae(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ie(e,t,i),i};exports.PktDatepickerSingle=class extends f{constructor(){super(...arguments),this.value="",this.strings=B}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return l.b`
|
|
51
|
-
<div class="pkt-input__container">
|
|
52
|
-
<input
|
|
53
|
-
class="${m.e(this.inputClasses)}"
|
|
54
|
-
.type=${this.inputType}
|
|
55
|
-
id="${this.id}-input"
|
|
56
|
-
.value=${this.value}
|
|
57
|
-
min=${g.o(this.min)}
|
|
58
|
-
max=${g.o(this.max)}
|
|
59
|
-
placeholder=${g.o(this.placeholder)}
|
|
60
|
-
?readonly=${this.isInputReadonly}
|
|
61
|
-
aria-describedby="${this.id}-helptext"
|
|
62
|
-
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
63
|
-
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
64
|
-
?disabled=${this.disabled}
|
|
65
|
-
@keydown=${e=>C.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>b.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()})}
|
|
66
|
-
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
67
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
68
|
-
@blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
|
|
69
|
-
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
70
|
-
${o.n(this.inputRef)}
|
|
71
|
-
/>
|
|
72
|
-
${this.renderCalendarButton()}
|
|
73
|
-
</div>
|
|
74
|
-
`}};_([l.n({type:String})],exports.PktDatepickerSingle.prototype,"value",2);_([l.n({type:Object})],exports.PktDatepickerSingle.prototype,"strings",2);exports.PktDatepickerSingle=_([l.t("pkt-datepicker-single")],exports.PktDatepickerSingle);var ne=Object.defineProperty,le=Object.getOwnPropertyDescriptor,D=(s,e,t,a)=>{for(var i=a>1?void 0:a?le(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ne(e,t,i),i};exports.PktDatepickerRange=class extends f{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=j,this.inputRefTo=o.e()}get inputElementTo(){return this.inputRefTo.value}render(){var t,a,i,r;const e=x.getRangeLabelClasses(this.showRangeLabels);return l.b`
|
|
75
|
-
<div class="pkt-input__container">
|
|
76
|
-
${this.showRangeLabels?l.b` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:l.A}
|
|
77
|
-
<input
|
|
78
|
-
class=${m.e(this.inputClasses)}
|
|
79
|
-
.type=${this.inputType}
|
|
80
|
-
id="${this.id}-input"
|
|
81
|
-
aria-label="${this.label} ${((a=this.strings.generic)==null?void 0:a.from)??"Fra"}"
|
|
82
|
-
.value=${this.value[0]??""}
|
|
83
|
-
min=${g.o(this.min)}
|
|
84
|
-
max=${g.o(this.max)}
|
|
85
|
-
placeholder=${g.o(this.placeholder)}
|
|
86
|
-
?readonly=${this.isInputReadonly}
|
|
87
|
-
?disabled=${this.disabled}
|
|
88
|
-
@click=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
89
|
-
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
90
|
-
@keydown=${n=>C.handleInputKeydown(n,p=>this.dispatchToggleCalendar(p),()=>b.submitFormOrFallback(this.internals,()=>{var p;return(p=this.inputRefTo.value)==null?void 0:p.focus()}),()=>{var p;return(p=this.inputRefTo.value)==null?void 0:p.focus()},()=>{var p;return(p=this.inputRef.value)==null?void 0:p.blur()})}
|
|
91
|
-
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
92
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
93
|
-
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
94
|
-
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
95
|
-
${o.n(this.inputRef)}
|
|
96
|
-
/>
|
|
97
|
-
<div class="${m.e(e)}" id="${this.id}-to-label">
|
|
98
|
-
${(i=this.strings.generic)==null?void 0:i.to}
|
|
99
|
-
</div>
|
|
100
|
-
${this.showRangeLabels?l.A:l.b` <div class="pkt-input-separator">–</div> `}
|
|
101
|
-
<input
|
|
102
|
-
class=${m.e(this.inputClasses)}
|
|
103
|
-
.type=${this.inputType}
|
|
104
|
-
id="${this.id}-to"
|
|
105
|
-
aria-label="${this.label} ${((r=this.strings.generic)==null?void 0:r.to)??"Til"}"
|
|
106
|
-
.value=${this.value[1]??""}
|
|
107
|
-
min=${g.o(this.min)}
|
|
108
|
-
max=${g.o(this.max)}
|
|
109
|
-
placeholder=${g.o(this.placeholder)}
|
|
110
|
-
?readonly=${this.isInputReadonly}
|
|
111
|
-
?disabled=${this.disabled}
|
|
112
|
-
@click=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
113
|
-
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
114
|
-
@keydown=${n=>C.handleInputKeydown(n,p=>this.dispatchToggleCalendar(p),()=>b.submitFormOrFallback(this.internals,()=>{var p;return(p=this.inputRefTo.value)==null?void 0:p.blur()}),void 0,()=>{var p;return(p=this.inputRefTo.value)==null?void 0:p.blur()})}
|
|
115
|
-
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
116
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
117
|
-
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
118
|
-
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
119
|
-
${o.n(this.inputRefTo)}
|
|
120
|
-
/>
|
|
121
|
-
${this.renderCalendarButton()}
|
|
122
|
-
</div>
|
|
123
|
-
`}};D([l.n({type:Array})],exports.PktDatepickerRange.prototype,"value",2);D([l.n({type:String})],exports.PktDatepickerRange.prototype,"label",2);D([l.n({type:Boolean})],exports.PktDatepickerRange.prototype,"showRangeLabels",2);D([l.n({type:Object})],exports.PktDatepickerRange.prototype,"strings",2);exports.PktDatepickerRange=D([l.t("pkt-datepicker-range")],exports.PktDatepickerRange);var re=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,P=(s,e,t,a)=>{for(var i=a>1?void 0:a?pe(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&re(e,t,i),i};exports.PktDatepickerMultiple=class extends f{constructor(){super(...arguments),this.value=[],this.strings=B}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 l.b`
|
|
124
|
-
<div class="pkt-input__container">
|
|
125
|
-
<input
|
|
126
|
-
class=${m.e(this.inputClasses)}
|
|
127
|
-
.type=${this.inputType}
|
|
128
|
-
id="${this.id}-input"
|
|
129
|
-
min=${g.o(this.min)}
|
|
130
|
-
max=${g.o(this.max)}
|
|
131
|
-
placeholder=${g.o(this.placeholder)}
|
|
132
|
-
?readonly=${this.isInputReadonly}
|
|
133
|
-
?disabled=${this.isInputDisabled}
|
|
134
|
-
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
135
|
-
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
136
|
-
@blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
|
|
137
|
-
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
138
|
-
@focus=${()=>{this.dispatchFocus(),y()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
139
|
-
@keydown=${e=>C.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>b.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
|
|
140
|
-
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
141
|
-
${o.n(this.inputRef)}
|
|
142
|
-
/>
|
|
143
|
-
${this.renderCalendarButton()}
|
|
144
|
-
</div>
|
|
145
|
-
`}};P([l.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);P([l.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);P([l.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=P([l.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var ue=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,h=(s,e,t,a)=>{for(var i=a>1?void 0:a?oe(e,t):e,r=s.length-1,n;r>=0;r--)(n=s[r])&&(i=(a?n(e,t,i):n(i))||i);return a&&i&&ue(e,t,i),i};exports.PktDatepicker=class extends A.PktInputElement{constructor(){super(...arguments),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=o.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.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=o.e(),this.popupRef=o.e(),this.singleInputRef=o.e(),this.rangeInputRef=o.e(),this.multipleInputRef=o.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):w.addToSelected(e,this.calRef,this.min,this.max)}}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 Z.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(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const a=u.valueToArray(e),i=this.multiple&&a.length>1?E.filterSelectableDates(a,this.min,this.max,this.excludedates,this.excludeweekdays):a;if(this.range&&!E.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const r=u.arrayToCsv(i);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&i.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}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")&&(e.has("multiple")||e.has("range"))){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 l.b`
|
|
146
|
-
<pkt-datepicker-single
|
|
147
|
-
.value=${this._value[0]??""}
|
|
148
|
-
.inputType=${this.inputType}
|
|
149
|
-
.id=${this.id}
|
|
150
|
-
.min=${this.min}
|
|
151
|
-
.max=${this.max}
|
|
152
|
-
.placeholder=${this.placeholder}
|
|
153
|
-
.readonly=${this.readonly}
|
|
154
|
-
.disabled=${this.disabled}
|
|
155
|
-
.inputClasses=${this.inputClasses}
|
|
156
|
-
.internals=${this.internals}
|
|
157
|
-
.strings=${this.strings}
|
|
158
|
-
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
159
|
-
@input-change=${()=>this.onInput()}
|
|
160
|
-
@input-focus=${()=>this.onFocus()}
|
|
161
|
-
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
162
|
-
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
163
|
-
@value-change=${e=>{this.value=e.detail}}
|
|
164
|
-
@input-changed=${()=>{this.touched=!0}}
|
|
165
|
-
${o.n(this.singleInputRef)}
|
|
166
|
-
></pkt-datepicker-single>
|
|
167
|
-
`}renderRangeInput(){return l.b`
|
|
168
|
-
<pkt-datepicker-range
|
|
169
|
-
.value=${this._value}
|
|
170
|
-
.inputType=${this.inputType}
|
|
171
|
-
.id=${this.id}
|
|
172
|
-
.label=${this.label}
|
|
173
|
-
.min=${this.min}
|
|
174
|
-
.max=${this.max}
|
|
175
|
-
.placeholder=${this.placeholder}
|
|
176
|
-
.readonly=${this.readonly}
|
|
177
|
-
.disabled=${this.disabled}
|
|
178
|
-
.showRangeLabels=${this.showRangeLabels}
|
|
179
|
-
.inputClasses=${this.inputClasses}
|
|
180
|
-
.internals=${this.internals}
|
|
181
|
-
.strings=${this.strings}
|
|
182
|
-
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
183
|
-
@input-change=${()=>this.onInput()}
|
|
184
|
-
@input-focus=${()=>this.onFocus()}
|
|
185
|
-
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
186
|
-
@range-blur=${e=>{const t=this.currentInputElement,a=this.currentInputElementTo;if(t&&a){const i=t.value,r=a.value;if(i&&r&&i>r)a.value="",this._value=[i],this.value=i;else{const n=[i,r].filter(Boolean);n.length>0&&(n[0]!==this._value[0]||n[1]!==this._value[1])&&(this._value=n,this.value=n.join(","))}}T.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
|
|
187
|
-
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
188
|
-
@validate-date-input=${e=>{b.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
|
|
189
|
-
@handle-date-select=${e=>{var a,i;const t=u.fromISOToDate(e.detail);if(t){const r=u.formatISODate(t);this._value[0]!==r&&this._value[1]!==r&&((i=(a=this.calRef)==null?void 0:a.value)==null||i.handleDateSelect(t))}}}
|
|
190
|
-
@input-changed=${()=>{this.touched=!0}}
|
|
191
|
-
${o.n(this.rangeInputRef)}
|
|
192
|
-
></pkt-datepicker-range>
|
|
193
|
-
`}renderMultipleInput(){return l.b`
|
|
194
|
-
<pkt-datepicker-multiple
|
|
195
|
-
.value=${this._value}
|
|
196
|
-
.inputType=${this.inputType}
|
|
197
|
-
.id=${this.id}
|
|
198
|
-
.min=${this.min}
|
|
199
|
-
.max=${this.max}
|
|
200
|
-
.placeholder=${this.placeholder}
|
|
201
|
-
.readonly=${this.readonly}
|
|
202
|
-
.disabled=${this.disabled}
|
|
203
|
-
.maxlength=${this.maxlength}
|
|
204
|
-
.inputClasses=${this.inputClasses}
|
|
205
|
-
.internals=${this.internals}
|
|
206
|
-
.strings=${this.strings}
|
|
207
|
-
@toggle-calendar=${e=>this.toggleCalendar(e.detail)}
|
|
208
|
-
@input-change=${()=>this.onInput()}
|
|
209
|
-
@input-focus=${()=>this.onFocus()}
|
|
210
|
-
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
211
|
-
@add-to-selected=${e=>this.addToSelected(e.detail)}
|
|
212
|
-
@input-changed=${()=>{this.touched=!0}}
|
|
213
|
-
${o.n(this.multipleInputRef)}
|
|
214
|
-
></pkt-datepicker-multiple>
|
|
215
|
-
`}renderCalendar(){return l.b`
|
|
216
|
-
<pkt-datepicker-popup
|
|
217
|
-
class="pkt-contents"
|
|
218
|
-
?open=${this.calendarOpen}
|
|
219
|
-
?multiple=${this.multiple}
|
|
220
|
-
?range=${this.range}
|
|
221
|
-
?weeknumbers=${this.weeknumbers}
|
|
222
|
-
?withcontrols=${this.withcontrols}
|
|
223
|
-
.maxMultiple=${this.maxlength}
|
|
224
|
-
.selected=${this._value}
|
|
225
|
-
.earliest=${this.min}
|
|
226
|
-
.latest=${this.max}
|
|
227
|
-
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
228
|
-
.excludeweekdays=${this.excludeweekdays}
|
|
229
|
-
.currentmonth=${this.currentmonth?u.parseISODateString(this.currentmonth):null}
|
|
230
|
-
.today=${this.today}
|
|
231
|
-
@date-selected=${e=>{this.value=T.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,T.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
|
|
232
|
-
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
233
|
-
${o.n(this.datepickerPopupRef)}
|
|
234
|
-
></pkt-datepicker-popup>
|
|
235
|
-
`}render(){return this.inputClasses=x.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),l.b`
|
|
236
|
-
<pkt-input-wrapper
|
|
237
|
-
label="${this.label}"
|
|
238
|
-
forId="${this.id}-input"
|
|
239
|
-
?counter=${this.multiple&&!!this.maxlength}
|
|
240
|
-
.counterCurrent=${this.value?this._value.length:0}
|
|
241
|
-
.counterMaxLength=${this.maxlength}
|
|
242
|
-
?disabled=${this.disabled}
|
|
243
|
-
?hasError=${this.hasError}
|
|
244
|
-
?hasFieldset=${this.hasFieldset}
|
|
245
|
-
?inline=${this.inline}
|
|
246
|
-
?required=${this.required}
|
|
247
|
-
?optionalTag=${this.optionalTag}
|
|
248
|
-
?requiredTag=${this.requiredTag}
|
|
249
|
-
useWrapper=${this.useWrapper}
|
|
250
|
-
.optionalText=${this.optionalText}
|
|
251
|
-
.requiredText=${this.requiredText}
|
|
252
|
-
.tagText=${this.tagText}
|
|
253
|
-
.errorMessage=${this.errorMessage}
|
|
254
|
-
.helptext=${this.helptext}
|
|
255
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
256
|
-
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
257
|
-
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
258
|
-
class="pkt-datepicker"
|
|
259
|
-
>
|
|
260
|
-
<div class="pkt-contents" slot="helptext">${F.slotContent(this,"helptext")}</div>
|
|
261
|
-
${this.multiple?l.b`<pkt-date-tags
|
|
262
|
-
.dates=${this._value}
|
|
263
|
-
dateformat=${this.dateformat}
|
|
264
|
-
strings=${this.strings}
|
|
265
|
-
id-base=${this.id}
|
|
266
|
-
@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)}}
|
|
267
|
-
></pkt-date-tags>`:l.A}
|
|
268
|
-
<div class="pkt-datepicker__inputs ${this.range?"pkt-input__range-inputs":""}">
|
|
269
|
-
${this.range?this.renderRangeInput():this.multiple?this.renderMultipleInput():this.renderInput()}
|
|
270
|
-
</div>
|
|
271
|
-
</pkt-input-wrapper>
|
|
272
|
-
${this.renderCalendar()}
|
|
273
|
-
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;w.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 O.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}))}};h([l.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",1);h([l.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);h([l.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);h([l.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);h([l.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);h([l.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);h([l.n({type:Boolean,attribute:"show-range-labels"})],exports.PktDatepicker.prototype,"showRangeLabels",2);h([l.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);h([l.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);h([l.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);h([l.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);h([l.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);h([l.n({converter:u.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);h([l.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);h([l.n({type:String})],exports.PktDatepicker.prototype,"today",2);h([l.n({type:Boolean,reflect:!0,attribute:"calendar-open"})],exports.PktDatepicker.prototype,"calendarOpen",2);h([l.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);h([I.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=h([l.t("pkt-datepicker")],exports.PktDatepicker);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var d=window.CustomEvent;(!d||typeof d=="object")&&(d=function(t,o){o=o||{};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),i},d.prototype=window.Event.prototype);function g(e,t){var o="on"+t.type.toLowerCase();return typeof e[o]=="function"&&e[o](t),e.dispatchEvent(t)}function E(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(i,a){return!(t[i]===void 0||t[i]===a)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;e=e.parentElement}return!1}function c(e){for(;e;){if(e.localName==="dialog")return e;e.parentElement?e=e.parentElement:e.parentNode?e=e.parentNode.host:e=null}return null}function b(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function M(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function h(e){return!e||!e.hasAttribute("method")?!1:e.getAttribute("method").toLowerCase()==="dialog"}function v(e){var t=["button","input","keygen","select","textarea"],o=t.map(function(s){return s+":not([disabled])"});o.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=e.querySelector(o.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var a=e.querySelectorAll("*"),r=0;r<a.length&&!(a[r].tagName&&a[r].shadowRoot&&(i=v(a[r].shadowRoot),i));r++);return i}function m(e){return e.isConnected||document.body.contains(e)}function y(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var o=n.formSubmitter;if(!o){var i=e.target,a="getRootNode"in i&&i.getRootNode()||document;o=a.activeElement}return!o||o.form!==t?null:o}function D(e){if(!e.defaultPrevented){var t=e.target,o=n.imagemapUseValue,i=y(e);o===null&&i&&(o=i.value);var a=c(t);if(a){var r=i&&i.getAttribute("formmethod")||t.getAttribute("method");r==="dialog"&&(e.preventDefault(),o!=null?a.close(o):a.close())}}}function _(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener("submit",D,!1),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(e,{attributes:!0,attributeFilter:["open"]})}else{var o=!1,i=(function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}).bind(this),a,r=function(s){if(s.target===e){var u="DOMNodeRemoved";o|=s.type.substr(0,u.length)===u,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(s){e.addEventListener(s,r)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}_.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&m(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),n.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents");o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||(e=v(this.dialog_)),b(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!m(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!n.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");E(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,n.needsCentering(this.dialog_)?(n.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new d("close",{bubbles:!1,cancelable:!1});g(this.dialog_,t)}};var n={};n.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"};n.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],i=null;try{i=o.cssRules}catch{}if(i)for(var a=0;a<i.length;++a){var r=i[a],s=null;try{s=document.querySelectorAll(r.selectorText)}catch{}if(!(!s||!M(s,e))){var u=r.style.getPropertyValue("top"),f=r.style.getPropertyValue("bottom");if(u&&u!=="auto"||f&&f!=="auto")return!0}}}return!1};n.needsCentering=function(e){var t=window.getComputedStyle(e);return t.position!=="absolute"||e.style.top!=="auto"&&e.style.top!==""||e.style.bottom!=="auto"&&e.style.bottom!==""?!1:!n.isInlinePositionSetByStylesheet(e)};n.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),e.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new _(e)};n.registerDialog=function(e){e.showModal||n.forceRegisterDialog(e)};n.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(i){for(var a=0,r;r=i.removedNodes[a];++a){if(r instanceof Element)r.localName==="dialog"&&o.push(r);else continue;o=o.concat(r.querySelectorAll("dialog"))}}),o.length&&e(o)}))};n.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};n.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()};n.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,o;o=this.pendingDialogStack[t];++t)o.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var i=this.pendingDialogStack[0];if(i){var a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};n.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=c(e);){for(var t=0,o;o=this.pendingDialogStack[t];++t)if(o.dialog===e)return t===0;e=e.parentElement}return!1};n.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),b(t),this.forwardTab_!==void 0)){var o=this.pendingDialogStack[0],i=o.dialog,a=i.compareDocumentPosition(t);return a&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?o.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}};n.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new d("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&g(o.dialog,t)&&o.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)};n.DialogManager.prototype.checkDOM_=function(e){var t=this.pendingDialogStack.slice();t.forEach(function(o){e.indexOf(o.dialog)!==-1?o.downgradeModal():o.maybeHideModal()})};n.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)};n.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())};n.dm=new n.DialogManager;n.formSubmitter=null;n.imagemapUseValue=null;if(window.HTMLDialogElement===void 0){var p=document.createElement("form");if(p.setAttribute("method","dialog"),p.method!=="dialog"){var l=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(l){var k=l.get;l.get=function(){return h(this)?"dialog":k.call(this)};var S=l.set;l.set=function(e){return typeof e=="string"&&e.toLowerCase()==="dialog"?this.setAttribute("method",e):S.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",l)}}document.addEventListener("click",function(e){if(n.formSubmitter=null,n.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if("composedPath"in e){var o=e.composedPath();t=o.shift()||t}if(!(!t||!h(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;n.imagemapUseValue=e.offsetX+","+e.offsetY}var a=c(t);a&&(n.formSubmitter=t)}}},!1),document.addEventListener("submit",function(e){var t=e.target,o=c(t);if(!o){var i=y(e),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&e.preventDefault()}});var T=HTMLFormElement.prototype.submit,x=function(){if(!h(this))return T.call(this);var e=c(this);e&&e.close()};HTMLFormElement.prototype.submit=x}exports.default=n;
|