@oslokommune/punkt-elements 19.15.0 → 19.17.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 +28 -0
- package/dist/{accordion-BlsqYbJf.js → accordion-B0zAUNUV.js} +5 -5
- package/dist/{accordion-DukAa2ED.cjs → accordion-Cx-Gh3hc.cjs} +1 -1
- package/dist/{alert-CuXM6TnC.cjs → alert-BRZDpVMt.cjs} +1 -1
- package/dist/{alert-Xt26J9yX.js → alert-JnRrtTOW.js} +5 -5
- package/dist/{async-directive-yh8hG41Q.js → async-directive-C4LocQwR.js} +2 -2
- package/dist/{backlink-ogvv493Y.js → backlink-D8Rv46lA.js} +3 -3
- package/dist/{breadcrumbs-53QVnTFP.js → breadcrumbs-ybOBe_op.js} +2 -2
- package/dist/{button-BFG-7bDB.cjs → button-Ca_V13cQ.cjs} +1 -1
- package/dist/{button-DhCqyX4D.js → button-ChdHZYBF.js} +5 -5
- package/dist/{calendar-D9w8M99G.js → calendar-BQCjUQvP.js} +51 -70
- package/dist/calendar-CFTrX0C5.cjs +85 -0
- package/dist/{card-Diivw_vm.cjs → card-COseC8ZL.cjs} +1 -1
- package/dist/{card-DCc3wfUb.js → card-DSTEL8Kv.js} +6 -6
- package/dist/{checkbox-BDwOYcNM.js → checkbox-CKYNnLDh.js} +5 -9
- package/dist/{checkbox-BwI9QNSh.cjs → checkbox-DkFswqr-.cjs} +2 -2
- package/dist/{checkbox-group-C8mo9dkO.js → checkbox-group-1ghi5uHp.js} +3 -3
- package/dist/{checkbox-group-adbFTj8y.cjs → checkbox-group-lcxR3cYR.cjs} +1 -1
- package/dist/{class-map-Bf-QzUpN.js → class-map-BkEYw5uE.js} +1 -1
- package/dist/combobox-CaWnlvTX.cjs +139 -0
- package/dist/{combobox-B8IeuEF0.js → combobox-iXYiaWbN.js} +63 -96
- package/dist/components/index.d.ts +1 -0
- package/dist/components/input-wrapper/index.d.ts +1 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +13 -6
- package/dist/{consent-DBYZaCTp.cjs → consent-CxcKuGi9.cjs} +1 -1
- package/dist/{consent-BUS6GEUu.js → consent-D2nfauO8.js} +3 -3
- package/dist/converters-CW6SN0TT.cjs +1 -0
- package/dist/{converters-CkjLSYpa.js → converters-CYgQrWVm.js} +138 -141
- package/dist/{datepicker-CjUY_mLR.js → datepicker-DTcow1ih.js} +15 -25
- package/dist/{datepicker-CZYpIyJd.cjs → datepicker-Da8SfyVG.cjs} +3 -3
- package/dist/{dialog-polyfill.esm-B-g35ove.cjs → dialog-polyfill.esm-CW51hN2p.cjs} +1 -1
- package/dist/{dialog-polyfill.esm-DHSvqor8.js → dialog-polyfill.esm-D39dWbRt.js} +2 -2
- package/dist/{directive-helpers-CwxFepWh.js → directive-helpers-BAinC437.js} +1 -1
- package/dist/{element-DBugHPKM.js → element-ckeMVgMz.js} +1 -1
- package/dist/{element-with-slot-CVmm0_IE.js → element-with-slot-C0bH0T0H.js} +27 -38
- package/dist/element-with-slot-DkyaNnm0.cjs +1 -0
- package/dist/{fileupload-BKk03Dq-.js → fileupload-BNAQ9tNR.js} +16 -23
- package/dist/{fileupload-CnjtgTlF.cjs → fileupload-Cb1c7ul0.cjs} +3 -3
- package/dist/{footer-C6ajmlq2.cjs → footer-Box90zhr.cjs} +1 -1
- package/dist/{footer-L2vhQTAS.js → footer-D2RpIbsD.js} +4 -4
- package/dist/{header-BCrefip0.cjs → header-CvER8wo6.cjs} +2 -2
- package/dist/{header-20rqKJFb.js → header-Cwr995oK.js} +13 -13
- package/dist/{header-menu-F3tZZ5vO.js → header-menu-CsL4DZE2.js} +5 -5
- package/dist/{header-menu-Cz7G7Q2R.cjs → header-menu-D-wOwG1V.cjs} +1 -1
- package/dist/{heading-BluavR6A.cjs → heading-D4Kkb6-N.cjs} +1 -1
- package/dist/{heading-y72aIgB8.js → heading-DhTyaJms.js} +2 -2
- package/dist/{helptext-Dujce_W9.js → helptext-DN0jjgVu.js} +4 -4
- package/dist/{helptext-Bdv80rcs.cjs → helptext-p0nwJsyf.cjs} +1 -1
- package/dist/{icon-Bao96Zb8.js → icon-CLMJYuTL.js} +1 -1
- package/dist/{if-defined-O59_I-e-.js → if-defined-D18nY_K_.js} +1 -1
- package/dist/{input-element-mTphzs9b.js → input-element-0yYtRu0p.js} +3 -3
- package/dist/{input-element-BjnKPikY.cjs → input-element-BOi7rBbw.cjs} +1 -1
- package/dist/input-wrapper-4PTk8aX3.cjs +62 -0
- package/dist/{input-wrapper-Bb6CZxmg.js → input-wrapper-BSjQc4Vx.js} +30 -199
- package/dist/{link-sO401Ieh.js → link-39EvU2ng.js} +5 -5
- package/dist/{link-CRLAhYi0.cjs → link-Dj6SbcaD.cjs} +1 -1
- package/dist/{linkcard-DnZgMzqL.cjs → linkcard-BoQIfci8.cjs} +1 -1
- package/dist/{linkcard-DdmGxzAP.js → linkcard-K9vvKg1u.js} +4 -4
- package/dist/{listbox-CvduK_YU.cjs → listbox-BbdUu-IV.cjs} +3 -3
- package/dist/{listbox-BDesthOp.js → listbox-DFd-1faX.js} +15 -16
- package/dist/{loader-Zo_VSsNw.cjs → loader-BRYL5kTN.cjs} +1 -1
- package/dist/{loader-Di5kHEQ4.js → loader-MoI2VRFr.js} +4 -4
- package/dist/{messagebox-CR59jv8N.cjs → messagebox-CiOQUt0C.cjs} +1 -1
- package/dist/{messagebox-CzaFlrYz.js → messagebox-Dr-k3pnZ.js} +4 -4
- package/dist/{modal-wEEmCcUx.cjs → modal-DGiq84MG.cjs} +1 -1
- package/dist/{modal-0D0paY70.js → modal-DbzEnZNF.js} +8 -8
- package/dist/option-group-element-CH0sgVIl.cjs +23 -0
- package/dist/{option-group-element-D5PgGNdt.js → option-group-element-DC364Rw_.js} +3 -3
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -2
- package/dist/pkt-backlink.js +1 -2
- package/dist/pkt-breadcrumbs.js +1 -2
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -2
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -2
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -2
- package/dist/pkt-checkbox-group.cjs +1 -1
- package/dist/pkt-checkbox-group.js +1 -2
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -2
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -2
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -2
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -2
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -2
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -2
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -2
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -2
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -2
- package/dist/pkt-icon.js +1 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +37 -37
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -2
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -2
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -2
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -2
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -2
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -2
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -2
- package/dist/{pkt-options-controller-CHosj1Oo.js → pkt-options-controller-BikFfGcZ.js} +1 -1
- package/dist/{pkt-options-controller-139UsV4h.cjs → pkt-options-controller-D1sKTkbR.cjs} +1 -1
- package/dist/pkt-progressbar.js +1 -2
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.js +1 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -2
- package/dist/pkt-searchinput.js +1 -2
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -2
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -2
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -2
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -2
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -2
- package/dist/{progressbar-DZHiq7B0.js → progressbar-t0zgEke0.js} +5 -5
- package/dist/{radio-group-CtZhXMF8.js → radio-group-DJikniZi.js} +3 -3
- package/dist/{radio-group-MxNLGu-0.cjs → radio-group-XCYKqoLD.cjs} +1 -1
- package/dist/{radiobutton-DwDErNo5.cjs → radiobutton-DgkML7sd.cjs} +1 -1
- package/dist/{radiobutton-BK-V6Itu.js → radiobutton-PYQKVnNQ.js} +4 -4
- package/dist/{ref-y_5qv9vU.js → ref-D4OwQYdf.js} +2 -2
- package/dist/{repeat-CV9S4zya.js → repeat-BGbBqnfz.js} +2 -2
- package/dist/{scroll-lock-BALd8hF9.js → scroll-lock-CR-g54ai.js} +1 -1
- package/dist/{scroll-lock-B46ur0FF.cjs → scroll-lock-x0VxhKWZ.cjs} +1 -1
- package/dist/{searchinput-Bkcr3Fby.js → searchinput-BzYifHBf.js} +4 -4
- package/dist/{select-Bs-Z5Thd.js → select-CorofYxz.js} +21 -21
- package/dist/{select-Czz1y2nI.cjs → select-D8TC1msV.cjs} +14 -14
- package/dist/shared-types/calendar.d.ts +0 -1
- package/dist/shared-types/icon.d.ts +2 -0
- package/dist/shared-types/index.d.ts +3 -1
- package/dist/shared-types/input-wrapper.d.ts +59 -0
- package/dist/shared-utils/calendar/calendar-grid.d.ts +0 -4
- package/dist/shared-utils/calendar/index.d.ts +1 -1
- package/dist/{tabs-R1Jzzj3-.cjs → tabs-B63J6MXb.cjs} +2 -2
- package/dist/{tabs-DBW3P90Z.js → tabs-DDakCTkY.js} +7 -15
- package/dist/{tag-BMtnaJ1A.cjs → tag-6IPe9bwQ.cjs} +1 -1
- package/dist/{tag-uVXp7uP-.js → tag-BPvGZcKf.js} +5 -5
- package/dist/{textarea-COHaMHpP.js → textarea-BZCUHjEj.js} +19 -19
- package/dist/{textarea-C-sdNBRk.cjs → textarea-BiCZBjOe.cjs} +10 -10
- package/dist/{textinput-BqBgsBZF.cjs → textinput-BZPGcxZV.cjs} +12 -12
- package/dist/{textinput-0DZeMqBr.js → textinput-D_oEaI41.js} +19 -19
- package/dist/{timepicker-C_k-K1jA.cjs → timepicker-C0d92R8u.cjs} +12 -12
- package/dist/{timepicker-CvdI7jDN.js → timepicker-JBOeZg-7.js} +24 -32
- package/package.json +2 -2
- package/src/components/calendar/calendar.constraints.test.ts +15 -0
- package/src/components/calendar/calendar.core.test.ts +15 -0
- package/src/components/calendar/calendar.ts +7 -15
- package/src/components/index.ts +1 -0
- package/src/components/input-wrapper/index.ts +1 -0
- package/src/components/input-wrapper/input-wrapper.test.ts +1 -0
- package/src/components/input-wrapper/input-wrapper.ts +38 -19
- package/src/components/input-wrapper/wrapper-parity.test.ts +4 -2
- package/dist/calendar-C5QwPrbk.cjs +0 -91
- package/dist/combobox-jsPpImVF.cjs +0 -139
- package/dist/converters-BJ9Fe0kW.cjs +0 -1
- package/dist/element-with-slot-CcJPCLgn.cjs +0 -1
- package/dist/input-wrapper-BwzajfFX.cjs +0 -63
- package/dist/option-group-element-CzehfgVZ.cjs +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,34 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [19.17.0](https://github.com/oslokommune/punkt/compare/19.16.2...19.17.0) (2026-10-20)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [19.15.3](https://github.com/oslokommune/punkt/compare/19.15.2...19.15.3) (2026-10-19)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
* Kalenderen viser ikke lenger datoer fra forrige og neste måned (#3064) (#3759). Datoene før og etter måneden var synlige, men kunne ikke velges, og musepekeren sa "ikke tillatt". Det så ut som datoene var sperret. Nå er de cellene tomme.
|
|
17
|
+
|
|
18
|
+
- Tomme celler i stedet for grå datoer fra måneden før og etter
|
|
19
|
+
- Vanlig musepeker over de tomme cellene. Datoer som faktisk ikke kan velges har fortsatt "ikke tillatt"
|
|
20
|
+
- Gjelder både React og Elements, også kalenderen i datepicker
|
|
21
|
+
|
|
22
|
+
**Bonusfikser i Elements**
|
|
23
|
+
- Skjermlesere får nå vite at kalenderen tillater flere datoer eller periode
|
|
24
|
+
- Tegntelleren i skjemafelt viser "0/100" som i React, ikke "0 /100"
|
|
25
|
+
- Månedsknappene og årfeltet i kalenderen har samme markup som i React
|
|
26
|
+
|
|
27
|
+
**Testing**
|
|
28
|
+
- Ny konformitetstest som sammenligner kalenderen i React og Elements
|
|
29
|
+
- Konformitetstestene fanger nå mellomrom som Lit tidligere skjulte
|
|
30
|
+
|
|
31
|
+
closes #3064
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
|
|
8
36
|
## [19.15.0](https://github.com/oslokommune/punkt/compare/19.14.3...19.15.0) (2026-10-16)
|
|
9
37
|
|
|
10
38
|
### Features
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as e, c as t, d as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { i as s, t as c } from "./element-with-slot-
|
|
4
|
-
import { t as l } from "./if-defined-
|
|
1
|
+
import { _ as e, c as t, d as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as o } from "./class-map-BkEYw5uE.js";
|
|
3
|
+
import { i as s, t as c } from "./element-with-slot-C0bH0T0H.js";
|
|
4
|
+
import { t as l } from "./if-defined-D18nY_K_.js";
|
|
5
5
|
import { n as u, t as d } from "./consume-Bp12si68.js";
|
|
6
6
|
import { t as f } from "./provide-_MnlMGnw.js";
|
|
7
|
-
import { n as p, t as m } from "./ref-
|
|
7
|
+
import { n as p, t as m } from "./ref-D4OwQYdf.js";
|
|
8
8
|
//#region ../../shared-types/accordion.ts
|
|
9
9
|
var h = ["beige", "blue"], g = u(Symbol("pkt-accordion-context")), _ = class extends t {
|
|
10
10
|
constructor(...e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DkyaNnm0.cjs"),r=require("./if-defined-CiML3MTM.cjs"),i=require("./consume-kEjgTrAp.cjs"),a=require("./provide-Cz18sYug.cjs"),o=require("./ref-CB7e9nMY.cjs");var s=[`beige`,`blue`],c=i.n(Symbol(`pkt-accordion-context`)),l=class extends e.c{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``,this.context={skin:this.skin}}willUpdate(e){e.has(`skin`)&&(this.context={...this.context,skin:this.skin})}updated(e){e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){let n={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e._`
|
|
2
2
|
<div
|
|
3
3
|
part="container"
|
|
4
4
|
class=${t.t(n)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./classutils-CbklAJDe.cjs"),a=require("./define-component-spec-DBNd2FJY.cjs");require("./button-Ca_V13cQ.cjs");var o=[`off`,`polite`,`assertive`],s=[`info`,`success`,`warning`,`error`],c=[`medium`,`small`,`xsmall`],l={compact:!1},u=a.t({name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{reactOnly:!0,description:`React: Klikk-event for 'Lukk'-knappen`},close:{elementsOnly:!0,description:`Elements: Klikk-event for 'Lukk'-knappen`},"on-close":{elementsOnly:!0,description:`Elements: Samme event som <code>close</code>, beholdt for eldre Vue-oppsett.`,deprecated:`Bruk <code>close</code>. <code>on-close</code> fjernes i en senere hovedversjon.`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[...s],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[...o],default:`polite`,category:`accessibility`},size:{name:`Størrelse`,description:`Endrer størrelsen på ulike elementer i alerten.`,type:[...c],default:`medium`,category:`ui`},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`},compact:{name:`Kompakt`,description:`Kompakt visning av alerten.`,deprecated:"Bruk `size` i stedet; uten eksplisitt `size` gir compact størrelsen 'small'.",type:`boolean`,category:`ui`,default:l.compact}},slots:{default:{description:`Innholdet i meldingen`}}}),d=class extends r.t{constructor(){super(),this.compact=l.compact,this.title=``,this.skin=u.props.skin.default,this.ariaLive=u.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=u.props.closeAlert.default,this.date=null,this.role=`status`,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&e.get(`ariaLive`)!==void 0&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&i.t(this,`pkt-hide`,this._isClosed)}render(){let i=this.size??(this.compact?`small`:`medium`),a={"pkt-alert":!0,[`pkt-alert--${i}`]:!0,[`pkt-alert--${this.skin}`]:!0,"pkt-hide":this._isClosed},o={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e._`
|
|
2
2
|
<div
|
|
3
3
|
class=${t.t(a)}
|
|
4
4
|
aria-live=${this.ariaLiveAttr}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as o } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { t as s } from "./format-BTeSVkED.js";
|
|
4
|
-
import { i as c, t as l } from "./element-with-slot-
|
|
5
|
-
import "./icon-
|
|
4
|
+
import { i as c, t as l } from "./element-with-slot-C0bH0T0H.js";
|
|
5
|
+
import "./icon-CLMJYuTL.js";
|
|
6
6
|
import { t as u } from "./classutils-DcYnSgfc.js";
|
|
7
7
|
import { t as d } from "./define-component-spec-BYOSeplU.js";
|
|
8
|
-
import "./button-
|
|
8
|
+
import "./button-ChdHZYBF.js";
|
|
9
9
|
//#region ../../shared-types/aria.ts
|
|
10
10
|
var f = [
|
|
11
11
|
"off",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as e, p as t } from "./element-
|
|
2
|
-
import { i as n } from "./directive-helpers-
|
|
1
|
+
import { m as e, p as t } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { i as n } from "./directive-helpers-BAinC437.js";
|
|
3
3
|
//#region ../../node_modules/lit-html/async-directive.js
|
|
4
4
|
var r = (e, t) => {
|
|
5
5
|
let n = e._$AN;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as e, d as t, n, t as r, u as i } from "./element-
|
|
2
|
-
import "./icon-
|
|
3
|
-
import { t as a } from "./if-defined-
|
|
1
|
+
import { _ as e, d as t, n, t as r, u as i } from "./element-ckeMVgMz.js";
|
|
2
|
+
import "./icon-CLMJYuTL.js";
|
|
3
|
+
import { t as a } from "./if-defined-D18nY_K_.js";
|
|
4
4
|
//#region src/components/backlink/backlink.ts
|
|
5
5
|
var o = class extends r {
|
|
6
6
|
constructor(...e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, n as r, t as i, u as a } from "./element-
|
|
2
|
-
import "./icon-
|
|
1
|
+
import { _ as e, d as t, h as n, n as r, t as i, u as a } from "./element-ckeMVgMz.js";
|
|
2
|
+
import "./icon-CLMJYuTL.js";
|
|
3
3
|
//#region src/components/breadcrumbs/breadcrumbs.ts
|
|
4
4
|
var o = class extends i {
|
|
5
5
|
constructor(...e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const r=require("./if-defined-CiML3MTM.cjs");var i=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||i);var a=class a extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=void 0,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:i,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}static{this.relocatedAriaAttributes=[`aria-haspopup`,`aria-expanded`,`aria-controls`,`aria-label`,`tabindex`]}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of a.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
|
|
2
2
|
<button
|
|
3
3
|
class=${t.t(a)}
|
|
4
4
|
type=${this.type}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { i as s, t as c } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as l } from "./if-defined-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as o } from "./class-map-BkEYw5uE.js";
|
|
3
|
+
import { i as s, t as c } from "./element-with-slot-C0bH0T0H.js";
|
|
4
|
+
import "./icon-CLMJYuTL.js";
|
|
5
|
+
import { t as l } from "./if-defined-D18nY_K_.js";
|
|
6
6
|
//#region src/components/button/button.ts
|
|
7
7
|
var u = "https://punkt-cdn.oslo.kommune.no/latest/animations/";
|
|
8
8
|
typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || u);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import "./icon-
|
|
4
|
-
import { _ as c, a as l, b as u, d, f, g as p, l as m, m as h, o as g, p as _, t as v, v as y, y as b } from "./converters-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as s } from "./class-map-BkEYw5uE.js";
|
|
3
|
+
import "./icon-CLMJYuTL.js";
|
|
4
|
+
import { _ as c, a as l, b as u, d, f, g as p, l as m, m as h, o as g, p as _, t as v, v as y, y as b } from "./converters-CYgQrWVm.js";
|
|
5
5
|
//#region ../../shared-types/calendar.ts
|
|
6
6
|
var x = {
|
|
7
7
|
multiple: !1,
|
|
@@ -70,7 +70,6 @@ function A(e, t) {
|
|
|
70
70
|
startingDay: i,
|
|
71
71
|
numDays: a,
|
|
72
72
|
numRows: Math.ceil((a + i) / 7),
|
|
73
|
-
numDaysPrevMonth: _(e, t, 0).getDate(),
|
|
74
73
|
initialWeek: c(n)
|
|
75
74
|
};
|
|
76
75
|
}
|
|
@@ -78,16 +77,12 @@ function j(e, t, n, r) {
|
|
|
78
77
|
let { startingDay: i, numDays: a } = r;
|
|
79
78
|
return e === 0 && t < i ? "prev-month" : n > a ? "next-month" : "current-month";
|
|
80
79
|
}
|
|
81
|
-
function M(e, t, n, r) {
|
|
82
|
-
let { startingDay: i, numDaysPrevMonth: a, numDays: o } = r;
|
|
83
|
-
return e === "prev-month" ? a - (i - t - 1) : e === "next-month" ? n - o : n;
|
|
84
|
-
}
|
|
85
80
|
//#endregion
|
|
86
81
|
//#region ../../shared-utils/calendar/selection-manager.ts
|
|
87
|
-
function
|
|
82
|
+
function M(e) {
|
|
88
83
|
return typeof e == "string" && (e = e.split(",")), e.length === 1 && e[0] === "" ? [] : e.map((e) => h(e));
|
|
89
84
|
}
|
|
90
|
-
function
|
|
85
|
+
function N(e, t) {
|
|
91
86
|
let n = w({
|
|
92
87
|
start: e,
|
|
93
88
|
end: t
|
|
@@ -98,7 +93,7 @@ function P(e, t) {
|
|
|
98
93
|
}
|
|
99
94
|
return r;
|
|
100
95
|
}
|
|
101
|
-
function
|
|
96
|
+
function P(e, t, n, r) {
|
|
102
97
|
if (t.length !== 1) return !0;
|
|
103
98
|
let i = w({
|
|
104
99
|
start: t[0],
|
|
@@ -111,50 +106,50 @@ function F(e, t, n, r) {
|
|
|
111
106
|
}
|
|
112
107
|
return !0;
|
|
113
108
|
}
|
|
114
|
-
function
|
|
109
|
+
function F(e, t) {
|
|
115
110
|
let n = l(e);
|
|
116
111
|
return t.includes(n) ? t : [...t, n];
|
|
117
112
|
}
|
|
118
|
-
function
|
|
113
|
+
function I(e, t) {
|
|
119
114
|
let n = l(e), r = t.indexOf(n);
|
|
120
115
|
if (r === -1) return t;
|
|
121
116
|
if (t.length === 1) return [];
|
|
122
117
|
let i = [...t];
|
|
123
118
|
return i.splice(r, 1), i;
|
|
124
119
|
}
|
|
125
|
-
function
|
|
120
|
+
function L(e, t, n) {
|
|
126
121
|
let r = l(e);
|
|
127
|
-
return t.includes(r) ?
|
|
122
|
+
return t.includes(r) ? I(e, t) : n > 0 && t.length >= n ? t : F(e, t);
|
|
128
123
|
}
|
|
129
|
-
function
|
|
130
|
-
let r = l(e), i =
|
|
131
|
-
return t.includes(r) ? t.indexOf(r) === 0 ? [] :
|
|
124
|
+
function R(e, t, n) {
|
|
125
|
+
let r = l(e), i = M(t);
|
|
126
|
+
return t.includes(r) ? t.indexOf(r) === 0 ? [] : I(e, t) : t.length > 1 || t.length === 1 && (!P(e, i, n.excludedates, n.excludeweekdays) || i[0] > e) ? [r] : F(e, t);
|
|
132
127
|
}
|
|
133
128
|
//#endregion
|
|
134
129
|
//#region ../../shared-utils/calendar/keyboard-navigation.ts
|
|
135
|
-
var
|
|
130
|
+
var z = {
|
|
136
131
|
ArrowLeft: -1,
|
|
137
132
|
ArrowRight: 1,
|
|
138
133
|
ArrowUp: -7,
|
|
139
134
|
ArrowDown: 7
|
|
140
135
|
};
|
|
141
|
-
function
|
|
136
|
+
function B(e) {
|
|
142
137
|
let t = e.nodeName;
|
|
143
138
|
return t === "INPUT" || t === "SELECT" || t === "BUTTON" && !e.dataset?.date;
|
|
144
139
|
}
|
|
145
|
-
function
|
|
140
|
+
function V(e, t, n) {
|
|
146
141
|
let r = S(e, t);
|
|
147
142
|
if (!r) return null;
|
|
148
143
|
let i = n(`button[data-date="${l(r)}"]`);
|
|
149
144
|
for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r = S(r, t), i = n(`button[data-date="${l(r)}"]`), !i) return null;
|
|
150
145
|
return r;
|
|
151
146
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
147
|
+
function H(e) {
|
|
148
|
+
return z[e] ?? null;
|
|
154
149
|
}
|
|
155
150
|
//#endregion
|
|
156
151
|
//#region src/components/calendar/calendar.ts
|
|
157
|
-
var
|
|
152
|
+
var U = class extends a {
|
|
158
153
|
constructor(...e) {
|
|
159
154
|
super(...e), this.selected = [], this.multiple = x.multiple, this.maxMultiple = x.maxMultiple, this.range = x.range, this.earliest = x.earliest, this.latest = x.latest, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = x.weeknumbers, this.withcontrols = x.withcontrols, this.currentmonth = null, this.today = null, this._selected = [], this.inRange = {}, this.rangeHovered = null, this.year = 0, this.month = 0, this.week = 0, this.currentmonthtouched = !1, this.focusedDate = null, this.selectableDates = [], this.tabIndexSet = 0;
|
|
160
155
|
}
|
|
@@ -182,7 +177,7 @@ var W = class extends a {
|
|
|
182
177
|
super.updated(e), e.has("selected") && this.convertSelected();
|
|
183
178
|
}
|
|
184
179
|
convertSelected() {
|
|
185
|
-
typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected =
|
|
180
|
+
typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected = M(this.selected), this.range && this.selected.length === 2 && (this.inRange = N(this._selected[0], this._selected[1])), this.setCurrentMonth();
|
|
186
181
|
}
|
|
187
182
|
setCurrentMonth() {
|
|
188
183
|
if (this.currentmonth === null && !this.currentmonthtouched && (this.currentmonthtouched = !0), this.selected.length && this.selected[0] !== "") {
|
|
@@ -192,17 +187,17 @@ var W = class extends a {
|
|
|
192
187
|
(!this.currentmonth || isNaN(this.currentmonth.getTime())) && (this.currentmonth = f(this.todayDate)), this.year = this.currentmonth.getFullYear(), this.month = this.currentmonth.getMonth();
|
|
193
188
|
}
|
|
194
189
|
handleKeydown(e) {
|
|
195
|
-
let t =
|
|
190
|
+
let t = H(e.key);
|
|
196
191
|
t !== null && this.handleArrowKey(e, t);
|
|
197
192
|
}
|
|
198
193
|
handleArrowKey(e, t) {
|
|
199
194
|
let n = e.target;
|
|
200
|
-
if (
|
|
195
|
+
if (B(n)) return;
|
|
201
196
|
if (e.preventDefault(), !this.focusedDate) {
|
|
202
197
|
this.focusOnCurrentDate();
|
|
203
198
|
return;
|
|
204
199
|
}
|
|
205
|
-
let r =
|
|
200
|
+
let r = V(this.focusedDate ? d(this.focusedDate) : _(this.year, this.month, 1), t, this.querySelector.bind(this));
|
|
206
201
|
if (r) {
|
|
207
202
|
let e = this.querySelector(`button[data-date="${l(r)}"]`);
|
|
208
203
|
e instanceof HTMLButtonElement && !e.dataset.disabled && (this.focusedDate = l(r), e.focus());
|
|
@@ -224,7 +219,7 @@ var W = class extends a {
|
|
|
224
219
|
<table
|
|
225
220
|
class="pkt-cal-days pkt-txt-12-medium pkt-calendar__body"
|
|
226
221
|
role="grid"
|
|
227
|
-
|
|
222
|
+
aria-multiselectable=${this.range || this.multiple ? "true" : n}
|
|
228
223
|
>
|
|
229
224
|
<thead>
|
|
230
225
|
${this.renderDayNames()}
|
|
@@ -247,8 +242,8 @@ var W = class extends a {
|
|
|
247
242
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i && u());
|
|
248
243
|
}}
|
|
249
244
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${l} ${i ? "" : "pkt-invisible"}"
|
|
250
|
-
|
|
251
|
-
|
|
245
|
+
data-disabled=${i ? n : "disabled"}
|
|
246
|
+
aria-disabled=${i ? n : "true"}
|
|
252
247
|
tabindex=${i ? "0" : "-1"}
|
|
253
248
|
>
|
|
254
249
|
<pkt-icon class="pkt-btn__icon" name="${c}"></pkt-icon>
|
|
@@ -296,6 +291,7 @@ var W = class extends a {
|
|
|
296
291
|
let t = e.target;
|
|
297
292
|
this.changeMonth(parseInt(t.value), this.month);
|
|
298
293
|
}}
|
|
294
|
+
value=${this.year}
|
|
299
295
|
.value=${this.year}
|
|
300
296
|
/>
|
|
301
297
|
</div>` : e`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
@@ -391,15 +387,8 @@ var W = class extends a {
|
|
|
391
387
|
</button>
|
|
392
388
|
</td>`;
|
|
393
389
|
}
|
|
394
|
-
renderEmptyDayCell(
|
|
395
|
-
return e`<td class="pkt-cal-other"
|
|
396
|
-
<div
|
|
397
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
398
|
-
data-disabled="disabled"
|
|
399
|
-
>
|
|
400
|
-
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
401
|
-
</div>
|
|
402
|
-
</td>`;
|
|
390
|
+
renderEmptyDayCell() {
|
|
391
|
+
return e`<td class="pkt-cal-other"></td>`;
|
|
403
392
|
}
|
|
404
393
|
renderWeekRow(t) {
|
|
405
394
|
return e`<tr class="pkt-cal-week-row" role="row">
|
|
@@ -417,11 +406,7 @@ var W = class extends a {
|
|
|
417
406
|
this.weeknumbers && o.push(e`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
|
|
418
407
|
for (let e = 0; e < 7; e++) {
|
|
419
408
|
let i = j(a, e, r, n);
|
|
420
|
-
|
|
421
|
-
else {
|
|
422
|
-
let t = M(i, e, r, n);
|
|
423
|
-
o.push(this.renderEmptyDayCell(t)), i === "next-month" && r++;
|
|
424
|
-
}
|
|
409
|
+
i === "current-month" ? (o.push(this.renderDayView(r, t)), r++) : (o.push(this.renderEmptyDayCell()), i === "next-month" && r++);
|
|
425
410
|
}
|
|
426
411
|
i.push(this.renderWeekRow(o));
|
|
427
412
|
}
|
|
@@ -454,36 +439,32 @@ var W = class extends a {
|
|
|
454
439
|
return typeof this.selected == "string" ? this.selected.split(",") : this.selected;
|
|
455
440
|
}
|
|
456
441
|
addToSelected(e) {
|
|
457
|
-
this.selected =
|
|
442
|
+
this.selected = F(e, this.normalizeSelected()), this._selected = M(this.selected), this.range && this.selected.length === 2 && (this.convertSelected(), this.close());
|
|
458
443
|
}
|
|
459
444
|
removeFromSelected(e) {
|
|
460
|
-
this.selected =
|
|
445
|
+
this.selected = I(e, this.normalizeSelected()), this._selected = M(this.selected);
|
|
461
446
|
}
|
|
462
447
|
toggleSelected(e) {
|
|
463
|
-
this.selected =
|
|
448
|
+
this.selected = L(e, this.normalizeSelected(), this.maxMultiple), this._selected = M(this.selected);
|
|
464
449
|
}
|
|
465
450
|
isRangeAllowed(e) {
|
|
466
|
-
return
|
|
451
|
+
return P(e, this._selected, this.excludedates, this.excludeweekdays);
|
|
467
452
|
}
|
|
468
453
|
handleRangeSelect(e) {
|
|
469
|
-
return this.selected =
|
|
454
|
+
return this.selected = R(e, this.normalizeSelected(), {
|
|
470
455
|
excludedates: this.excludedates,
|
|
471
456
|
excludeweekdays: this.excludeweekdays
|
|
472
|
-
}), this._selected =
|
|
457
|
+
}), this._selected = M(this.selected), this.selected.length === 2 ? (this.convertSelected(), this.close()) : this.selected.length === 1 && (this.inRange = {}), Promise.resolve();
|
|
473
458
|
}
|
|
474
459
|
handleRangeHover(e) {
|
|
475
|
-
|
|
476
|
-
this.rangeHovered = null;
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
this.rangeHovered = e, this.inRange = P(this._selected[0], e);
|
|
460
|
+
!this.range || this._selected.length !== 1 || !this.isRangeAllowed(e) || this._selected[0] >= e ? this.rangeHovered = null : (this.rangeHovered = e, this.inRange = N(this._selected[0], e));
|
|
480
461
|
}
|
|
481
462
|
handleDateSelect(e) {
|
|
482
|
-
return e
|
|
463
|
+
return e && (this.range ? this.handleRangeSelect(e) : this.multiple ? this.toggleSelected(e) : (this.selected.includes(l(e)) ? this.emptySelected() : (this.emptySelected(), this.addToSelected(e)), this.close()), this.dispatchEvent(new CustomEvent("date-selected", {
|
|
483
464
|
detail: this.selected,
|
|
484
465
|
bubbles: !0,
|
|
485
466
|
composed: !0
|
|
486
|
-
})), Promise.resolve()
|
|
467
|
+
}))), Promise.resolve();
|
|
487
468
|
}
|
|
488
469
|
focusOnCurrentDate() {
|
|
489
470
|
let e = l(f(this.todayDate)), t = this.querySelector(`button[data-date="${e}"]`);
|
|
@@ -509,35 +490,35 @@ var W = class extends a {
|
|
|
509
490
|
}));
|
|
510
491
|
}
|
|
511
492
|
};
|
|
512
|
-
i([o({ converter: v.csvToArray })],
|
|
493
|
+
i([o({ converter: v.csvToArray })], U.prototype, "selected", void 0), i([o({ type: Boolean })], U.prototype, "multiple", void 0), i([o({
|
|
513
494
|
type: Number,
|
|
514
495
|
attribute: "max-multiple"
|
|
515
|
-
})],
|
|
496
|
+
})], U.prototype, "maxMultiple", void 0), i([o({ type: Boolean })], U.prototype, "range", void 0), i([o({ type: String })], U.prototype, "earliest", void 0), i([o({ type: String })], U.prototype, "latest", void 0), i([o({ converter: v.stringsToDate })], U.prototype, "excludedates", void 0), i([o({ converter: v.csvToArray })], U.prototype, "excludeweekdays", void 0), i([o({ type: Boolean })], U.prototype, "weeknumbers", void 0), i([o({ type: Boolean })], U.prototype, "withcontrols", void 0), i([o({ converter: v.stringToDate })], U.prototype, "currentmonth", void 0), i([o({ type: String })], U.prototype, "today", void 0), i([o({
|
|
516
497
|
type: Array,
|
|
517
498
|
attribute: "day-strings"
|
|
518
|
-
})],
|
|
499
|
+
})], U.prototype, "dayStrings", void 0), i([o({
|
|
519
500
|
type: Array,
|
|
520
501
|
attribute: "day-strings-long"
|
|
521
|
-
})],
|
|
502
|
+
})], U.prototype, "dayStringsLong", void 0), i([o({
|
|
522
503
|
type: Array,
|
|
523
504
|
attribute: "month-strings"
|
|
524
|
-
})],
|
|
505
|
+
})], U.prototype, "monthStrings", void 0), i([o({
|
|
525
506
|
type: String,
|
|
526
507
|
attribute: "week-string"
|
|
527
|
-
})],
|
|
508
|
+
})], U.prototype, "weekString", void 0), i([o({
|
|
528
509
|
type: String,
|
|
529
510
|
attribute: "prev-month-string"
|
|
530
|
-
})],
|
|
511
|
+
})], U.prototype, "prevMonthString", void 0), i([o({
|
|
531
512
|
type: String,
|
|
532
513
|
attribute: "next-month-string"
|
|
533
|
-
})],
|
|
514
|
+
})], U.prototype, "nextMonthString", void 0), i([o({ type: Array })], U.prototype, "_selected", void 0), i([r()], U.prototype, "inRange", void 0), i([o({ type: Date })], U.prototype, "rangeHovered", void 0), i([o({ type: Number })], U.prototype, "year", void 0), i([o({ type: Number })], U.prototype, "month", void 0), i([o({ type: Number })], U.prototype, "week", void 0), i([r()], U.prototype, "currentmonthtouched", void 0), i([r()], U.prototype, "focusedDate", void 0);
|
|
534
515
|
try {
|
|
535
|
-
t("pkt-calendar")(
|
|
516
|
+
t("pkt-calendar")(U);
|
|
536
517
|
} catch {
|
|
537
518
|
console.warn("Forsøker å definere <pkt-calendar>, men den er allerede definert");
|
|
538
519
|
}
|
|
539
520
|
//#endregion
|
|
540
521
|
//#region src/components/calendar/index.ts
|
|
541
|
-
var
|
|
522
|
+
var W = U;
|
|
542
523
|
//#endregion
|
|
543
|
-
export {
|
|
524
|
+
export { U as n, W as t };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs");require("./icon-jPhyZD1z.cjs");const n=require("./converters-CW6SN0TT.cjs");var r={multiple:!1,maxMultiple:0,range:!1,earliest:null,latest:null,weeknumbers:!1,withcontrols:!1};function i(e,t,r){let i=n.y(e,r?.in);return isNaN(t)?n.b(r?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function a(e,t){let[r,i]=n.v(e,t.start,t.end);return{start:r,end:i}}function o(e,t){let{start:r,end:i}=a(t?.in,e),o=+r>+i,s=o?+r:+i,c=o?i:r;c.setHours(0,0,0,0);let l=t?.step??1;if(!l)return[];l<0&&(l=-l,o=!o);let u=[];for(;+c<=s;)u.push(n.b(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return o?u.reverse():u}function s(e,t){let r=n.y(e,t?.in).getDay();return r===0?7:r}function c(e,t){let r=(t.excludedates??[]).map(e=>typeof e==`string`?e:n.a(e));return!n.l(e,t.earliest,t.latest,r,t.excludeweekdays??[])}function l(e,t,n,r){return!!(c(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function u(e,t,r){let i=n.p(e,t,0);return!(r&&n.d(r)>i)}function d(e,t,r){let i=n.p(t===11?e+1:e,t===11?0:t+1,1);return!(r&&n.d(r)<i)}function f(e,t){let r=n.p(e,t,1),i=n.p(e,t+1,0),a=(r.getDay()+6)%7,o=i.getDate();return{firstDayOfMonth:r,lastDayOfMonth:i,startingDay:a,numDays:o,numRows:Math.ceil((o+a)/7),initialWeek:n._(r)}}function p(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function m(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>n.m(e))}function h(e,t){let r=o({start:e,end:t}),i={};if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++){let o=r[a],s=o>e&&o<t;i[n.a(o)]=s}return i}function g(e,t,n,r){if(t.length!==1)return!0;let i=o({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(s(i[a]).toString()))return!1}return!0}function _(e,t){let r=n.a(e);return t.includes(r)?t:[...t,r]}function v(e,t){let r=n.a(e),i=t.indexOf(r);if(i===-1)return t;if(t.length===1)return[];let a=[...t];return a.splice(i,1),a}function y(e,t,r){let i=n.a(e);return t.includes(i)?v(e,t):r>0&&t.length>=r?t:_(e,t)}function b(e,t,r){let i=n.a(e),a=m(t);return t.includes(i)?t.indexOf(i)===0?[]:v(e,t):t.length>1||t.length===1&&(!g(e,a,r.excludedates,r.excludeweekdays)||a[0]>e)?[i]:_(e,t)}var x={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function S(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function C(e,t,r){let a=i(e,t);if(!a)return null;let o=r(`button[data-date="${n.a(a)}"]`);for(;o instanceof HTMLButtonElement&&o.dataset.disabled;)if(a=i(a,t),o=r(`button[data-date="${n.a(a)}"]`),!o)return null;return a}function w(e){return x[e]??null}var T=class extends e.t{constructor(...e){super(...e),this.selected=[],this.multiple=r.multiple,this.maxMultiple=r.maxMultiple,this.range=r.range,this.earliest=r.earliest,this.latest=r.latest,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=r.weeknumbers,this.withcontrols=r.withcontrols,this.currentmonth=null,this.today=null,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get calendarStrings(){let e=this.pktStrings.get(`dates`),t=this.pktStrings.get(`calendar`);return{daysShort:this.dayStrings??e.daysShort,days:this.dayStringsLong??e.days,months:this.monthStrings??e.months,week:this.weekString??e.week,prevMonth:this.prevMonthString??t.prevMonth,nextMonth:this.nextMonthString??t.nextMonth}}get todayDate(){return this.today?n.m(this.today):n.g()}firstUpdated(e){this.addEventListener(`keydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has(`selected`)&&this.convertSelected()}convertSelected(){typeof this.selected==`string`&&(this.selected=this.selected.split(`,`)),this.selected.length===1&&this.selected[0]===``&&(this.selected=[]),this._selected=m(this.selected),this.range&&this.selected.length===2&&(this.inRange=h(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=n.m(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?n.f(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=n.f(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=n.f(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=w(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let r=e.target;if(S(r))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let i=C(this.focusedDate?n.d(this.focusedDate):n.p(this.year,this.month,1),t,this.querySelector.bind(this));if(i){let e=this.querySelector(`button[data-date="${n.a(i)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=n.a(i),e.focus())}}render(){return e._`
|
|
2
|
+
<div
|
|
3
|
+
class="pkt-calendar ${this.weeknumbers?`pkt-cal-weeknumbers`:``}"
|
|
4
|
+
@focusout=${this.closeEvent}
|
|
5
|
+
@keydown=${e=>{e.key===`Escape`&&(e.preventDefault(),this.close())}}
|
|
6
|
+
>
|
|
7
|
+
<nav class="pkt-cal-month-nav">
|
|
8
|
+
${this.renderMonthNavButton(`prev`)} ${this.renderMonthNav()}
|
|
9
|
+
${this.renderMonthNavButton(`next`)}
|
|
10
|
+
</nav>
|
|
11
|
+
<table
|
|
12
|
+
class="pkt-cal-days pkt-txt-12-medium pkt-calendar__body"
|
|
13
|
+
role="grid"
|
|
14
|
+
aria-multiselectable=${this.range||this.multiple?`true`:e.h}
|
|
15
|
+
>
|
|
16
|
+
<thead>
|
|
17
|
+
${this.renderDayNames()}
|
|
18
|
+
</thead>
|
|
19
|
+
<tbody>
|
|
20
|
+
${this.renderCalendarBody()}
|
|
21
|
+
</tbody>
|
|
22
|
+
</table>
|
|
23
|
+
</div>
|
|
24
|
+
`}renderMonthNavButton(t){let n=t===`prev`,r=n?this.isPrevMonthAllowed():this.isNextMonthAllowed(),{prevMonth:i,nextMonth:a}=this.calendarStrings,o=n?i:a,s=n?`chevron-thin-left`:`chevron-thin-right`,c=n?`pkt-calendar__prev-month`:`pkt-calendar__next-month`,l=n?()=>this.prevMonth():()=>this.nextMonth();return e._`<div>
|
|
25
|
+
<button
|
|
26
|
+
type="button"
|
|
27
|
+
aria-label="${o}"
|
|
28
|
+
@click=${()=>r&&l()}
|
|
29
|
+
@keydown=${e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r&&l())}}
|
|
30
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${c} ${r?``:`pkt-invisible`}"
|
|
31
|
+
data-disabled=${r?e.h:`disabled`}
|
|
32
|
+
aria-disabled=${r?e.h:`true`}
|
|
33
|
+
tabindex=${r?`0`:`-1`}
|
|
34
|
+
>
|
|
35
|
+
<pkt-icon class="pkt-btn__icon" name="${s}"></pkt-icon>
|
|
36
|
+
<span class="pkt-btn__text">${o}</span>
|
|
37
|
+
</button>
|
|
38
|
+
</div>`}renderDayNames(){let t=[];this.weeknumbers&&t.push(e._`<th><div class="pkt-calendar__week-number">${this.calendarStrings.week}</div></th>`);let{days:n,daysShort:r}=this.calendarStrings;for(let i=0;i<r.length;i++)t.push(e._`<th>
|
|
39
|
+
<div class="pkt-calendar__day-name" aria-label="${n[i]}">${r[i]}</div>
|
|
40
|
+
</th>`);return e._`<tr class="pkt-cal-week-row">
|
|
41
|
+
${t}
|
|
42
|
+
</tr>`}renderMonthNav(){let t=this.pktStrings.get(`dates`);return this.withcontrols?e._`<div class="pkt-cal-month-picker">
|
|
43
|
+
<label for="${this.id}-monthnav" class="pkt-hide">${t.month}</label>
|
|
44
|
+
<select
|
|
45
|
+
aria-label="${t.month}"
|
|
46
|
+
class="pkt-input pkt-input-compact"
|
|
47
|
+
id="${this.id}-monthnav"
|
|
48
|
+
@change=${e=>{e.stopImmediatePropagation();let t=e.target;this.changeMonth(this.year,parseInt(t.value))}}
|
|
49
|
+
>
|
|
50
|
+
${this.calendarStrings.months.map((t,n)=>e._`<option value=${n} ?selected=${this.month===n}>${t}</option>`)}
|
|
51
|
+
</select>
|
|
52
|
+
<label for="${this.id}-yearnav" class="pkt-hide">${t.year}</label>
|
|
53
|
+
<input
|
|
54
|
+
aria-label="${t.year}"
|
|
55
|
+
class="pkt-input pkt-cal-input-year pkt-input-compact"
|
|
56
|
+
id="${this.id}-yearnav"
|
|
57
|
+
type="number"
|
|
58
|
+
size="4"
|
|
59
|
+
placeholder="0000"
|
|
60
|
+
@change=${e=>{e.stopImmediatePropagation();let t=e.target;this.changeMonth(parseInt(t.value),this.month)}}
|
|
61
|
+
value=${this.year}
|
|
62
|
+
.value=${this.year}
|
|
63
|
+
/>
|
|
64
|
+
</div>`:e._`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
65
|
+
${this.calendarStrings.months[this.month]} ${this.year}
|
|
66
|
+
</div>`}getDayViewData(e,t){let r=n.p(this.year,this.month,e),i=n.a(r),a=i===n.a(t),o=this.selected.includes(i),s=this.isDayDisabled(r,o),c=this.calculateTabIndex(i,s,e);return{currentDate:r,currentDateISO:i,isToday:a,isSelected:o,isDisabled:s,ariaLabel:n.o(r),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return l(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?`0`:`-1`:!t&&this.tabIndexSet===0?(this.tabIndexSet=n,`0`):this.tabIndexSet===n?`0`:`-1`}getDayCellClasses(e){let{currentDateISO:t,isToday:r,isSelected:i}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],o=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":r,"pkt-cal-selected":i,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":o,"pkt-cal-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered)}}getDayButtonClasses(e){let{currentDateISO:t,isToday:r,isSelected:i,isDisabled:a}=e,o=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],s=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(n,r){let i=this.getDayViewData(n,r),{currentDate:a,currentDateISO:o,isSelected:s,isDisabled:c,ariaLabel:l,tabindex:u}=i;this.selectableDates.push({currentDateISO:o,isDisabled:c,tabindex:u});let d=this.getDayCellClasses(i),f=this.getDayButtonClasses(i);return e._`<td class=${t.t(d)}>
|
|
67
|
+
<button
|
|
68
|
+
type="button"
|
|
69
|
+
aria-pressed=${s?`true`:`false`}
|
|
70
|
+
?disabled=${c}
|
|
71
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${t.t(f)}"
|
|
72
|
+
@mouseover=${()=>this.range&&!this.isExcluded(a)&&this.handleRangeHover(a)}
|
|
73
|
+
@focus=${()=>this.handleDayFocus(a,o)}
|
|
74
|
+
aria-label="${l}"
|
|
75
|
+
tabindex=${u}
|
|
76
|
+
data-disabled=${c?`disabled`:e.h}
|
|
77
|
+
data-date=${o}
|
|
78
|
+
@keydown=${e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.handleDateSelect(a))}}
|
|
79
|
+
@click=${e=>{c||(e.preventDefault(),this.handleDateSelect(a))}}
|
|
80
|
+
>
|
|
81
|
+
<span class="pkt-btn__text pkt-txt-14-light">${n}</span>
|
|
82
|
+
</button>
|
|
83
|
+
</td>`}renderEmptyDayCell(){return e._`<td class="pkt-cal-other"></td>`}renderWeekRow(t){return e._`<tr class="pkt-cal-week-row" role="row">
|
|
84
|
+
${t}
|
|
85
|
+
</tr>`}renderCalendarBody(){let t=this.todayDate,n=f(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let r=1;this.week=n.initialWeek;let i=[];for(let a=0;a<n.numRows;a++){let o=[];this.weeknumbers&&o.push(e._`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let e=0;e<7;e++){let i=p(a,e,r,n);i===`current-month`?(o.push(this.renderDayView(r,t)),r++):(o.push(this.renderEmptyDayCell()),i===`next-month`&&r++)}i.push(this.renderWeekRow(o))}return i}isExcluded(e){return c(e,this.getDateConstraints())}isPrevMonthAllowed(){return u(this.year,this.month,this.earliest)}prevMonth(){let e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return d(this.year,this.month,this.latest)}nextMonth(){let e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e==`string`?parseInt(e):e,this.month=typeof t==`string`?parseInt(t):t,this.currentmonth=n.f(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected==`string`?this.selected.split(`,`):this.selected}addToSelected(e){this.selected=_(e,this.normalizeSelected()),this._selected=m(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=v(e,this.normalizeSelected()),this._selected=m(this.selected)}toggleSelected(e){this.selected=y(e,this.normalizeSelected(),this.maxMultiple),this._selected=m(this.selected)}isRangeAllowed(e){return g(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=b(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=m(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e?this.rangeHovered=null:(this.rangeHovered=e,this.inRange=h(this._selected[0],e))}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(n.a(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent(`date-selected`,{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){let e=n.a(n.f(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}let r=this.selectableDates.find(e=>!e.isDisabled);if(r){let e=this.querySelector(`button[data-date="${r.currentDateISO}"]`);e instanceof HTMLButtonElement&&(this.focusedDate=r.currentDateISO,e.focus())}}closeEvent(e){let t=e.target,n=e.relatedTarget;this.contains(n)||t.classList.contains(`pkt-invisible`)||t.closest(`.pkt-cal-month-picker`)||this.close()}close(){this.dispatchEvent(new CustomEvent(`close`,{detail:!0,bubbles:!0,composed:!0}))}};e.n([e.u({converter:n.t.csvToArray})],T.prototype,`selected`,void 0),e.n([e.u({type:Boolean})],T.prototype,`multiple`,void 0),e.n([e.u({type:Number,attribute:`max-multiple`})],T.prototype,`maxMultiple`,void 0),e.n([e.u({type:Boolean})],T.prototype,`range`,void 0),e.n([e.u({type:String})],T.prototype,`earliest`,void 0),e.n([e.u({type:String})],T.prototype,`latest`,void 0),e.n([e.u({converter:n.t.stringsToDate})],T.prototype,`excludedates`,void 0),e.n([e.u({converter:n.t.csvToArray})],T.prototype,`excludeweekdays`,void 0),e.n([e.u({type:Boolean})],T.prototype,`weeknumbers`,void 0),e.n([e.u({type:Boolean})],T.prototype,`withcontrols`,void 0),e.n([e.u({converter:n.t.stringToDate})],T.prototype,`currentmonth`,void 0),e.n([e.u({type:String})],T.prototype,`today`,void 0),e.n([e.u({type:Array,attribute:`day-strings`})],T.prototype,`dayStrings`,void 0),e.n([e.u({type:Array,attribute:`day-strings-long`})],T.prototype,`dayStringsLong`,void 0),e.n([e.u({type:Array,attribute:`month-strings`})],T.prototype,`monthStrings`,void 0),e.n([e.u({type:String,attribute:`week-string`})],T.prototype,`weekString`,void 0),e.n([e.u({type:String,attribute:`prev-month-string`})],T.prototype,`prevMonthString`,void 0),e.n([e.u({type:String,attribute:`next-month-string`})],T.prototype,`nextMonthString`,void 0),e.n([e.u({type:Array})],T.prototype,`_selected`,void 0),e.n([e.l()],T.prototype,`inRange`,void 0),e.n([e.u({type:Date})],T.prototype,`rangeHovered`,void 0),e.n([e.u({type:Number})],T.prototype,`year`,void 0),e.n([e.u({type:Number})],T.prototype,`month`,void 0),e.n([e.u({type:Number})],T.prototype,`week`,void 0),e.n([e.l()],T.prototype,`currentmonthtouched`,void 0),e.n([e.l()],T.prototype,`focusedDate`,void 0);try{e.d(`pkt-calendar`)(T)}catch{console.warn(`Forsøker å definere <pkt-calendar>, men den er allerede definert`)}var E=T;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return E}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./if-defined-CiML3MTM.cjs");require("./tag-6IPe9bwQ.cjs");var a=[`outlined`,`outlined-beige`,`gray`,`blue`,`beige`,`green`],o={headingLevel:3,layout:`vertical`,skin:`outlined`,padding:`default`,tagPosition:`top`,openLinkInNewTab:!1,borderOnHover:!0,zoom:!1,imageShape:`square`,restrictImageHeight:!1},s=class extends r.t{constructor(...e){super(...e),this.ariaLabel=``,this.metaLead=null,this.borderOnHover=o.borderOnHover,this.zoom=o.zoom,this.imageAspect=null,this.restrictImageHeight=o.restrictImageHeight,this.clickCardLink=null,this.metaTrail=null,this.layout=o.layout,this.heading=``,this.headingLevel=o.headingLevel,this.image={src:``,alt:``},this.imageShape=o.imageShape,this.openLinkInNewTab=o.openLinkInNewTab,this.padding=o.padding,this.skin=o.skin,this.subheading=``,this.tagPosition=`top`,this.tags=[]}connectedCallback(){super.connectedCallback()}render(){let n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover,"pkt-card--zoom":this.zoom},r=this.ariaLabel?.trim()||(this.heading?`${this.heading} lenkekort`:`lenkekort`),a=this.ariaLabel?.trim()||(this.heading?this.heading:`kort`);return e._`
|
|
2
2
|
<article
|
|
3
3
|
class=${t.t(n)}
|
|
4
4
|
aria-label=${i.t(this.clickCardLink?r:a)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, n as r, u as i } from "./element-
|
|
2
|
-
import { t as a } from "./class-map-
|
|
1
|
+
import { _ as e, d as t, h as n, n as r, u as i } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as a } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { n as o } from "./format-BTeSVkED.js";
|
|
4
|
-
import { i as s, t as c } from "./element-with-slot-
|
|
5
|
-
import "./icon-
|
|
6
|
-
import { t as l } from "./if-defined-
|
|
7
|
-
import "./tag-
|
|
4
|
+
import { i as s, t as c } from "./element-with-slot-C0bH0T0H.js";
|
|
5
|
+
import "./icon-CLMJYuTL.js";
|
|
6
|
+
import { t as l } from "./if-defined-D18nY_K_.js";
|
|
7
|
+
import "./tag-BPvGZcKf.js";
|
|
8
8
|
//#region ../../shared-types/card.ts
|
|
9
9
|
var u = [
|
|
10
10
|
"outlined",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
|
|
2
|
+
import { t as o } from "./class-map-BkEYw5uE.js";
|
|
3
3
|
import { n as s, t as c } from "./consume-Bp12si68.js";
|
|
4
|
-
import { n as l, t as u } from "./ref-
|
|
5
|
-
import { t as d } from "./input-element-
|
|
4
|
+
import { n as l, t as u } from "./ref-D4OwQYdf.js";
|
|
5
|
+
import { t as d } from "./input-element-0yYtRu0p.js";
|
|
6
6
|
//#region ../../shared-types/checkbox.ts
|
|
7
7
|
var f = {
|
|
8
8
|
defaultChecked: !1,
|
|
@@ -106,11 +106,7 @@ var f = {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
let t = e.target;
|
|
109
|
-
|
|
110
|
-
e.preventDefault(), e.stopImmediatePropagation();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this.checked = this.inputRef.value.matches(":checked"), this.valueChecked(this.checked));
|
|
109
|
+
t && t.disabled ? (e.preventDefault(), e.stopImmediatePropagation()) : (e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this.checked = this.inputRef.value.matches(":checked"), this.valueChecked(this.checked)));
|
|
114
110
|
}
|
|
115
111
|
};
|
|
116
112
|
i([a({
|