@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
|
@@ -13,7 +13,6 @@ import { ElementProps } from '@/types/typeUtils'
|
|
|
13
13
|
|
|
14
14
|
type Props = ElementProps<PktTextarea, 'autocomplete' | 'rows'>
|
|
15
15
|
|
|
16
|
-
@customElement('pkt-textarea')
|
|
17
16
|
export class PktTextarea extends PktInputElement<Props> {
|
|
18
17
|
inputRef: Ref<HTMLTextAreaElement> = createRef()
|
|
19
18
|
|
|
@@ -115,3 +114,9 @@ export class PktTextarea extends PktInputElement<Props> {
|
|
|
115
114
|
</pkt-input-wrapper>`
|
|
116
115
|
}
|
|
117
116
|
}
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
customElement('pkt-textarea')(PktTextarea)
|
|
120
|
+
} catch (e) {
|
|
121
|
+
console.warn('Forsøker å definere <pkt-textarea>, men den er allerede definert')
|
|
122
|
+
}
|
|
@@ -22,7 +22,6 @@ type Props = ElementProps<
|
|
|
22
22
|
| 'omitSearchIcon'
|
|
23
23
|
>
|
|
24
24
|
|
|
25
|
-
@customElement('pkt-textinput')
|
|
26
25
|
export class PktTextinput extends PktInputElement<Props> {
|
|
27
26
|
inputRef: Ref<HTMLTextAreaElement> = createRef()
|
|
28
27
|
|
|
@@ -174,3 +173,9 @@ export class PktTextinput extends PktInputElement<Props> {
|
|
|
174
173
|
`
|
|
175
174
|
}
|
|
176
175
|
}
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
customElement('pkt-textinput')(PktTextinput)
|
|
179
|
+
} catch (e) {
|
|
180
|
+
console.warn('Forsøker å definere <pkt-textinput>, men den er allerede definert')
|
|
181
|
+
}
|
|
@@ -41,7 +41,6 @@ export interface IPktTimepicker {
|
|
|
41
41
|
inline?: boolean
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
@customElement('pkt-timepicker')
|
|
45
44
|
export class PktTimepicker extends PktInputElement<Props> {
|
|
46
45
|
hiddenInputRef: Ref<HTMLInputElement> = createRef()
|
|
47
46
|
hoursInputRef: Ref<HTMLInputElement> = createRef()
|
|
@@ -792,3 +791,9 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
792
791
|
`
|
|
793
792
|
}
|
|
794
793
|
}
|
|
794
|
+
|
|
795
|
+
try {
|
|
796
|
+
customElement('pkt-timepicker')(PktTimepicker)
|
|
797
|
+
} catch (e) {
|
|
798
|
+
console.warn('Forsøker å definere <pkt-timepicker>, men den er allerede definert')
|
|
799
|
+
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./element-gR_VtSiD.cjs"),h=require("./class-map-CsENJXf1.cjs"),m=require("./element-with-slot-ZX-up7jO.cjs"),u=require("./ref-CL-Xk9Xm.cjs"),f=require("./if-defined-BOW3ODSj.cjs");var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(s,t,o,r)=>{for(var e=r>1?void 0:r?k(t,o):t,c=s.length-1,a;c>=0;c--)(a=s[c])&&(e=(r?a(t,o,e):a(e))||e);return r&&e&&y(t,o,e),e};let p=class extends i.i{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const o=(t=this.renderRoot)==null?void 0:t.querySelector("slot");o&&o.assignedElements().forEach(e=>{e.tagName.toLowerCase()==="pkt-accordion-item"&&(e.hasAttribute("name")||e.setAttribute("name",this.name))})}}firstUpdated(){var o;const t=(o=this.renderRoot)==null?void 0:o.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return i.b`
|
|
2
|
-
<div
|
|
3
|
-
part="container"
|
|
4
|
-
class=${h.e(t)}
|
|
5
|
-
data-testid="pkt-accordion"
|
|
6
|
-
aria-labelledby=${this.ariaLabelledBy}
|
|
7
|
-
>
|
|
8
|
-
<slot></slot>
|
|
9
|
-
</div>
|
|
10
|
-
`}};l([i.n({type:String,reflect:!0,attribute:"aria-labelledby"})],p.prototype,"ariaLabelledBy",2);l([i.n({type:Boolean,reflect:!0,attribute:"compact"})],p.prototype,"compact",2);l([i.n({type:String,reflect:!0,attribute:"skin"})],p.prototype,"skin",2);l([i.n({type:String,reflect:!0,attribute:"name"})],p.prototype,"name",2);p=l([i.t("pkt-accordion")],p);const _=p;var v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,d=(s,t,o,r)=>{for(var e=r>1?void 0:r?b(t,o):t,c=s.length-1,a;c>=0;c--)(a=s[c])&&(e=(r?a(t,o,e):a(e))||e);return r&&e&&v(t,o,e),e};let n=class extends m.PktElementWithSlot{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=u.e()}firstUpdated(s){this.defaultOpen&&(this.isOpen=!0)}render(){const s={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return i.b`
|
|
11
|
-
<details
|
|
12
|
-
class=${h.e(s)}
|
|
13
|
-
id=${this.id}
|
|
14
|
-
?open=${this.isOpen}
|
|
15
|
-
${u.n(this.accordionItemRef)}
|
|
16
|
-
name=${f.o(this.name)}
|
|
17
|
-
>
|
|
18
|
-
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
19
|
-
${this.title}
|
|
20
|
-
<pkt-icon
|
|
21
|
-
name="chevron-thin-down"
|
|
22
|
-
class="pkt-accordion-item__icon"
|
|
23
|
-
aria-hidden="true"
|
|
24
|
-
></pkt-icon>
|
|
25
|
-
</summary>
|
|
26
|
-
<div
|
|
27
|
-
class="pkt-accordion-item__content"
|
|
28
|
-
id="pkt-accordion-item__content-${this.id}"
|
|
29
|
-
role="region"
|
|
30
|
-
>
|
|
31
|
-
<div class="pkt-accordion-item__content-inner">${m.slotContent(this)}</div>
|
|
32
|
-
</div>
|
|
33
|
-
</details>
|
|
34
|
-
`}};d([i.n({type:Boolean})],n.prototype,"defaultOpen",2);d([i.n({type:String})],n.prototype,"title",2);d([i.n({type:String,reflect:!0})],n.prototype,"skin",2);d([i.n({type:Boolean,reflect:!0})],n.prototype,"compact",2);d([i.n({type:Boolean,reflect:!0})],n.prototype,"isOpen",2);d([i.n({type:String,reflect:!0})],n.prototype,"name",2);n=d([i.t("pkt-accordion-item")],n);const $=n;exports.PktAccordion=_;exports.PktAccordionItem_default=$;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { i as u, b as m, n as r, t as h } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { e as f } from "./class-map-CEnykyO_.js";
|
|
3
|
-
import { P as y, s as _ } from "./element-with-slot-Dqk6-TRR.js";
|
|
4
|
-
import { e as k, n as v } from "./ref-Bg_Swj5w.js";
|
|
5
|
-
import { o as $ } from "./if-defined-B0krMLad.js";
|
|
6
|
-
var b = Object.defineProperty, O = Object.getOwnPropertyDescriptor, l = (t, e, a, o) => {
|
|
7
|
-
for (var i = o > 1 ? void 0 : o ? O(e, a) : e, n = t.length - 1, c; n >= 0; n--)
|
|
8
|
-
(c = t[n]) && (i = (o ? c(e, a, i) : c(i)) || i);
|
|
9
|
-
return o && i && b(e, a, i), i;
|
|
10
|
-
};
|
|
11
|
-
let p = class extends u {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments), this.ariaLabelledBy = "", this.compact = !1, this.skin = "borderless", this.name = "";
|
|
14
|
-
}
|
|
15
|
-
updated(t) {
|
|
16
|
-
t.has("skin") && this.requestUpdate(), t.has("name") && this.updateAccordionItemNames();
|
|
17
|
-
}
|
|
18
|
-
updateAccordionItemNames() {
|
|
19
|
-
var t;
|
|
20
|
-
if (this.name) {
|
|
21
|
-
const e = (t = this.renderRoot) == null ? void 0 : t.querySelector("slot");
|
|
22
|
-
e && e.assignedElements().forEach((o) => {
|
|
23
|
-
o.tagName.toLowerCase() === "pkt-accordion-item" && (o.hasAttribute("name") || o.setAttribute("name", this.name));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
firstUpdated() {
|
|
28
|
-
var e;
|
|
29
|
-
const t = (e = this.renderRoot) == null ? void 0 : e.querySelector("slot");
|
|
30
|
-
t && t.addEventListener("slotchange", () => {
|
|
31
|
-
this.updateAccordionItemNames();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
const t = {
|
|
36
|
-
"pkt-accordion": !0,
|
|
37
|
-
"pkt-accordion--compact": this.compact,
|
|
38
|
-
[`pkt-accordion--${this.skin}`]: this.skin
|
|
39
|
-
};
|
|
40
|
-
return m`
|
|
41
|
-
<div
|
|
42
|
-
part="container"
|
|
43
|
-
class=${f(t)}
|
|
44
|
-
data-testid="pkt-accordion"
|
|
45
|
-
aria-labelledby=${this.ariaLabelledBy}
|
|
46
|
-
>
|
|
47
|
-
<slot></slot>
|
|
48
|
-
</div>
|
|
49
|
-
`;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
l([
|
|
53
|
-
r({ type: String, reflect: !0, attribute: "aria-labelledby" })
|
|
54
|
-
], p.prototype, "ariaLabelledBy", 2);
|
|
55
|
-
l([
|
|
56
|
-
r({ type: Boolean, reflect: !0, attribute: "compact" })
|
|
57
|
-
], p.prototype, "compact", 2);
|
|
58
|
-
l([
|
|
59
|
-
r({ type: String, reflect: !0, attribute: "skin" })
|
|
60
|
-
], p.prototype, "skin", 2);
|
|
61
|
-
l([
|
|
62
|
-
r({ type: String, reflect: !0, attribute: "name" })
|
|
63
|
-
], p.prototype, "name", 2);
|
|
64
|
-
p = l([
|
|
65
|
-
h("pkt-accordion")
|
|
66
|
-
], p);
|
|
67
|
-
const C = p;
|
|
68
|
-
var P = Object.defineProperty, g = Object.getOwnPropertyDescriptor, d = (t, e, a, o) => {
|
|
69
|
-
for (var i = o > 1 ? void 0 : o ? g(e, a) : e, n = t.length - 1, c; n >= 0; n--)
|
|
70
|
-
(c = t[n]) && (i = (o ? c(e, a, i) : c(i)) || i);
|
|
71
|
-
return o && i && P(e, a, i), i;
|
|
72
|
-
};
|
|
73
|
-
let s = class extends y {
|
|
74
|
-
constructor() {
|
|
75
|
-
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef = k();
|
|
76
|
-
}
|
|
77
|
-
firstUpdated(t) {
|
|
78
|
-
this.defaultOpen && (this.isOpen = !0);
|
|
79
|
-
}
|
|
80
|
-
render() {
|
|
81
|
-
const t = {
|
|
82
|
-
"pkt-accordion-item": !0,
|
|
83
|
-
"pkt-accordion-item--compact": this.compact,
|
|
84
|
-
[`pkt-accordion-item--${this.skin}`]: !!this.skin
|
|
85
|
-
};
|
|
86
|
-
return m`
|
|
87
|
-
<details
|
|
88
|
-
class=${f(t)}
|
|
89
|
-
id=${this.id}
|
|
90
|
-
?open=${this.isOpen}
|
|
91
|
-
${v(this.accordionItemRef)}
|
|
92
|
-
name=${$(this.name)}
|
|
93
|
-
>
|
|
94
|
-
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
95
|
-
${this.title}
|
|
96
|
-
<pkt-icon
|
|
97
|
-
name="chevron-thin-down"
|
|
98
|
-
class="pkt-accordion-item__icon"
|
|
99
|
-
aria-hidden="true"
|
|
100
|
-
></pkt-icon>
|
|
101
|
-
</summary>
|
|
102
|
-
<div
|
|
103
|
-
class="pkt-accordion-item__content"
|
|
104
|
-
id="pkt-accordion-item__content-${this.id}"
|
|
105
|
-
role="region"
|
|
106
|
-
>
|
|
107
|
-
<div class="pkt-accordion-item__content-inner">${_(this)}</div>
|
|
108
|
-
</div>
|
|
109
|
-
</details>
|
|
110
|
-
`;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
d([
|
|
114
|
-
r({ type: Boolean })
|
|
115
|
-
], s.prototype, "defaultOpen", 2);
|
|
116
|
-
d([
|
|
117
|
-
r({ type: String })
|
|
118
|
-
], s.prototype, "title", 2);
|
|
119
|
-
d([
|
|
120
|
-
r({ type: String, reflect: !0 })
|
|
121
|
-
], s.prototype, "skin", 2);
|
|
122
|
-
d([
|
|
123
|
-
r({ type: Boolean, reflect: !0 })
|
|
124
|
-
], s.prototype, "compact", 2);
|
|
125
|
-
d([
|
|
126
|
-
r({ type: Boolean, reflect: !0 })
|
|
127
|
-
], s.prototype, "isOpen", 2);
|
|
128
|
-
d([
|
|
129
|
-
r({ type: String, reflect: !0 })
|
|
130
|
-
], s.prototype, "name", 2);
|
|
131
|
-
s = d([
|
|
132
|
-
h("pkt-accordion-item")
|
|
133
|
-
], s);
|
|
134
|
-
const E = s;
|
|
135
|
-
export {
|
|
136
|
-
C as P,
|
|
137
|
-
E as a
|
|
138
|
-
};
|
package/dist/alert-BuAXrnKl.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { e as h } from "./class-map-CEnykyO_.js";
|
|
2
|
-
import { A as u, b as p, n as a, t as v } from "./element-CPpT3rFQ.js";
|
|
3
|
-
import { r as f } from "./state-C_1EOo3D.js";
|
|
4
|
-
import { P as k, s as m } from "./element-with-slot-Dqk6-TRR.js";
|
|
5
|
-
import { u as _ } from "./classutils-RQs1k6D9.js";
|
|
6
|
-
import "./icon-BlKA8YuW.js";
|
|
7
|
-
import "./button-DEyvt1LI.js";
|
|
8
|
-
const b = { skin: { default: "info" }, ariaLive: { default: "polite" }, compact: { default: !1 }, closeAlert: { default: !1 } }, c = {
|
|
9
|
-
props: b
|
|
10
|
-
};
|
|
11
|
-
var y = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (t, s, l, o) => {
|
|
12
|
-
for (var r = o > 1 ? void 0 : o ? C(s, l) : s, n = t.length - 1, d; n >= 0; n--)
|
|
13
|
-
(d = t[n]) && (r = (o ? d(s, l, r) : d(r)) || r);
|
|
14
|
-
return o && r && y(s, l, r), r;
|
|
15
|
-
};
|
|
16
|
-
let e = class extends k {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(), this.compact = c.props.compact.default, this.title = "", this.skin = c.props.skin.default, this.ariaLive = c.props.ariaLive.default, this["aria-live"] = null, this.closeAlert = c.props.closeAlert.default, this.date = null, this.role = "status", this._isClosed = !1, this.close = (t) => {
|
|
19
|
-
this._isClosed = !0, this.dispatchEvent(
|
|
20
|
-
new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
21
|
-
), this.dispatchEvent(
|
|
22
|
-
new CustomEvent("on-close", { detail: { origin: t }, bubbles: !0, composed: !0 })
|
|
23
|
-
);
|
|
24
|
-
}, this._isClosed = !1;
|
|
25
|
-
}
|
|
26
|
-
// Lifecycle
|
|
27
|
-
connectedCallback() {
|
|
28
|
-
super.connectedCallback(), this["aria-live"] = this.getAttribute("aria-live") || this.ariaLive;
|
|
29
|
-
}
|
|
30
|
-
attributeChangedCallback(t, s, l) {
|
|
31
|
-
t === "ariaLive" && (this["aria-live"] = l), super.attributeChangedCallback(t, s, l);
|
|
32
|
-
}
|
|
33
|
-
updated(t) {
|
|
34
|
-
super.updated(t), t.has("ariaLive") && (this["aria-live"] = this.ariaLive), t.has("_isClosed") && _(this, "pkt-hide", this._isClosed);
|
|
35
|
-
}
|
|
36
|
-
// Render
|
|
37
|
-
render() {
|
|
38
|
-
const t = {
|
|
39
|
-
"pkt-alert": !0,
|
|
40
|
-
"pkt-alert--compact": this.compact,
|
|
41
|
-
[`pkt-alert--${this.skin}`]: this.skin,
|
|
42
|
-
"pkt-hide": this._isClosed
|
|
43
|
-
}, s = {
|
|
44
|
-
"pkt-alert__grid": !0,
|
|
45
|
-
"pkt-alert__noTitle": !this.title,
|
|
46
|
-
"pkt-alert__noDate": !this.date
|
|
47
|
-
};
|
|
48
|
-
return p`
|
|
49
|
-
<div class=${h(t)} aria-live=${this["aria-live"]}>
|
|
50
|
-
<div class=${h(s)}>
|
|
51
|
-
<pkt-icon
|
|
52
|
-
class="pkt-alert__icon"
|
|
53
|
-
aria-hidden="true"
|
|
54
|
-
name=${this.skin === "info" ? "alert-information" : `alert-${this.skin}`}
|
|
55
|
-
></pkt-icon>
|
|
56
|
-
|
|
57
|
-
${this.closeAlert ? p`
|
|
58
|
-
<div class="pkt-alert__close">
|
|
59
|
-
<pkt-button
|
|
60
|
-
tabindex="0"
|
|
61
|
-
aria-label="close"
|
|
62
|
-
size=${this.compact ? "small" : "medium"}
|
|
63
|
-
type="button"
|
|
64
|
-
skin="tertiary"
|
|
65
|
-
iconName="close"
|
|
66
|
-
variant="icon-only"
|
|
67
|
-
@click=${this.close}
|
|
68
|
-
>
|
|
69
|
-
<span class="sr-only">Lukk</span>
|
|
70
|
-
</pkt-button>
|
|
71
|
-
</div>
|
|
72
|
-
` : u}
|
|
73
|
-
${this.title ? p`<div class="pkt-alert__title">${this.title}</div>` : u}
|
|
74
|
-
|
|
75
|
-
<div class="pkt-alert__text">${m(this)}</div>
|
|
76
|
-
|
|
77
|
-
${this.date ? p`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : u}
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
i([
|
|
84
|
-
a({ type: Boolean, reflect: !1 })
|
|
85
|
-
], e.prototype, "compact", 2);
|
|
86
|
-
i([
|
|
87
|
-
a({ type: String, reflect: !0 })
|
|
88
|
-
], e.prototype, "title", 2);
|
|
89
|
-
i([
|
|
90
|
-
a({ type: String, reflect: !0 })
|
|
91
|
-
], e.prototype, "skin", 2);
|
|
92
|
-
i([
|
|
93
|
-
a({ type: String })
|
|
94
|
-
], e.prototype, "ariaLive", 2);
|
|
95
|
-
i([
|
|
96
|
-
a({ type: String, reflect: !0 })
|
|
97
|
-
], e.prototype, "aria-live", 2);
|
|
98
|
-
i([
|
|
99
|
-
a({ type: Boolean, reflect: !0 })
|
|
100
|
-
], e.prototype, "closeAlert", 2);
|
|
101
|
-
i([
|
|
102
|
-
a({ type: String, reflect: !0 })
|
|
103
|
-
], e.prototype, "date", 2);
|
|
104
|
-
i([
|
|
105
|
-
a({ type: String, reflect: !0 })
|
|
106
|
-
], e.prototype, "role", 2);
|
|
107
|
-
i([
|
|
108
|
-
f()
|
|
109
|
-
], e.prototype, "_isClosed", 2);
|
|
110
|
-
e = i([
|
|
111
|
-
v("pkt-alert")
|
|
112
|
-
], e);
|
|
113
|
-
export {
|
|
114
|
-
e as P
|
|
115
|
-
};
|
package/dist/alert-DFkFNTxh.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-CsENJXf1.cjs"),e=require("./element-gR_VtSiD.cjs"),d=require("./state-Dg-53wQ8.cjs"),u=require("./element-with-slot-ZX-up7jO.cjs"),h=require("./classutils-BwNK82ZQ.cjs");require("./icon-Bqj9oBbl.cjs");require("./button-DYv5Dg4M.cjs");const k={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:k};var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=(o,t,s,r)=>{for(var l=r>1?void 0:r?f(t,s):t,p=o.length-1,n;p>=0;p--)(n=o[p])&&(l=(r?n(t,s,l):n(l))||l);return r&&l&&v(t,s,l),l};exports.PktAlert=class extends u.PktElementWithSlot{constructor(){super(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,s,r){t==="ariaLive"&&(this["aria-live"]=r),super.attributeChangedCallback(t,s,r)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&h.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e.b`
|
|
2
|
-
<div class=${c.e(t)} aria-live=${this["aria-live"]}>
|
|
3
|
-
<div class=${c.e(s)}>
|
|
4
|
-
<pkt-icon
|
|
5
|
-
class="pkt-alert__icon"
|
|
6
|
-
aria-hidden="true"
|
|
7
|
-
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
8
|
-
></pkt-icon>
|
|
9
|
-
|
|
10
|
-
${this.closeAlert?e.b`
|
|
11
|
-
<div class="pkt-alert__close">
|
|
12
|
-
<pkt-button
|
|
13
|
-
tabindex="0"
|
|
14
|
-
aria-label="close"
|
|
15
|
-
size=${this.compact?"small":"medium"}
|
|
16
|
-
type="button"
|
|
17
|
-
skin="tertiary"
|
|
18
|
-
iconName="close"
|
|
19
|
-
variant="icon-only"
|
|
20
|
-
@click=${this.close}
|
|
21
|
-
>
|
|
22
|
-
<span class="sr-only">Lukk</span>
|
|
23
|
-
</pkt-button>
|
|
24
|
-
</div>
|
|
25
|
-
`:e.A}
|
|
26
|
-
${this.title?e.b`<div class="pkt-alert__title">${this.title}</div>`:e.A}
|
|
27
|
-
|
|
28
|
-
<div class="pkt-alert__text">${u.slotContent(this)}</div>
|
|
29
|
-
|
|
30
|
-
${this.date?e.b`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:e.A}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
`}};i([e.n({type:Boolean,reflect:!1})],exports.PktAlert.prototype,"compact",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"title",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"skin",2);i([e.n({type:String})],exports.PktAlert.prototype,"ariaLive",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"aria-live",2);i([e.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"closeAlert",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"date",2);i([e.n({type:String,reflect:!0})],exports.PktAlert.prototype,"role",2);i([d.r()],exports.PktAlert.prototype,"_isClosed",2);exports.PktAlert=i([e.t("pkt-alert")],exports.PktAlert);
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { r as _ } from "./directive-helpers-rm-28gIj.js";
|
|
2
|
-
import { i as A, t as c } from "./directive-oAbCiebi.js";
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2017 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
-
*/
|
|
8
|
-
const n = (e, t) => {
|
|
9
|
-
var i;
|
|
10
|
-
const s = e._$AN;
|
|
11
|
-
if (s === void 0) return !1;
|
|
12
|
-
for (const o of s) (i = o._$AO) == null || i.call(o, t, !1), n(o, t);
|
|
13
|
-
return !0;
|
|
14
|
-
}, h = (e) => {
|
|
15
|
-
let t, s;
|
|
16
|
-
do {
|
|
17
|
-
if ((t = e._$AM) === void 0) break;
|
|
18
|
-
s = t._$AN, s.delete(e), e = t;
|
|
19
|
-
} while ((s == null ? void 0 : s.size) === 0);
|
|
20
|
-
}, $ = (e) => {
|
|
21
|
-
for (let t; t = e._$AM; e = t) {
|
|
22
|
-
let s = t._$AN;
|
|
23
|
-
if (s === void 0) t._$AN = s = /* @__PURE__ */ new Set();
|
|
24
|
-
else if (s.has(e)) break;
|
|
25
|
-
s.add(e), l(t);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
function f(e) {
|
|
29
|
-
this._$AN !== void 0 ? (h(this), this._$AM = e, $(this)) : this._$AM = e;
|
|
30
|
-
}
|
|
31
|
-
function d(e, t = !1, s = 0) {
|
|
32
|
-
const i = this._$AH, o = this._$AN;
|
|
33
|
-
if (o !== void 0 && o.size !== 0) if (t) if (Array.isArray(i)) for (let r = s; r < i.length; r++) n(i[r], !1), h(i[r]);
|
|
34
|
-
else i != null && (n(i, !1), h(i));
|
|
35
|
-
else n(this, e);
|
|
36
|
-
}
|
|
37
|
-
const l = (e) => {
|
|
38
|
-
e.type == c.CHILD && (e._$AP ?? (e._$AP = d), e._$AQ ?? (e._$AQ = f));
|
|
39
|
-
};
|
|
40
|
-
class C extends A {
|
|
41
|
-
constructor() {
|
|
42
|
-
super(...arguments), this._$AN = void 0;
|
|
43
|
-
}
|
|
44
|
-
_$AT(t, s, i) {
|
|
45
|
-
super._$AT(t, s, i), $(this), this.isConnected = t._$AU;
|
|
46
|
-
}
|
|
47
|
-
_$AO(t, s = !0) {
|
|
48
|
-
var i, o;
|
|
49
|
-
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (o = this.disconnected) == null || o.call(this)), s && (n(this, t), h(this));
|
|
50
|
-
}
|
|
51
|
-
setValue(t) {
|
|
52
|
-
if (_(this._$Ct)) this._$Ct._$AI(t, this);
|
|
53
|
-
else {
|
|
54
|
-
const s = [...this._$Ct._$AH];
|
|
55
|
-
s[this._$Ci] = t, this._$Ct._$AI(s, this, 0);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
disconnected() {
|
|
59
|
-
}
|
|
60
|
-
reconnected() {
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
export {
|
|
64
|
-
C as f
|
|
65
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";const $=require("./directive-helpers-BP2WOx60.cjs"),c=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const r=(t,e)=>{var i;const s=t._$AN;if(s===void 0)return!1;for(const n of s)(i=n._$AO)==null||i.call(n,e,!1),r(n,e);return!0},h=t=>{let e,s;do{if((e=t._$AM)===void 0)break;s=e._$AN,s.delete(t),t=e}while((s==null?void 0:s.size)===0)},_=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(s===void 0)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),f(e)}};function A(t){this._$AN!==void 0?(h(this),this._$AM=t,_(this)):this._$AM=t}function d(t,e=!1,s=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let o=s;o<i.length;o++)r(i[o],!1),h(i[o]);else i!=null&&(r(i,!1),h(i));else r(this,t)}const f=t=>{t.type==c.t.CHILD&&(t._$AP??(t._$AP=d),t._$AQ??(t._$AQ=A))};class l extends c.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,s,i){super._$AT(e,s,i),_(this),this.isConnected=e._$AU}_$AO(e,s=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),s&&(r(this,e),h(this))}setValue(e){if($.r(this._$Ct))this._$Ct._$AI(e,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=e,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}exports.f=l;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./element-gR_VtSiD.cjs"),c=require("./if-defined-BOW3ODSj.cjs");require("./icon-Bqj9oBbl.cjs");var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(k,t,a,i)=>{for(var e=i>1?void 0:i?o(t,a):t,s=k.length-1,l;s>=0;s--)(l=k[s])&&(e=(i?l(t,a,e):l(e))||e);return i&&e&&p(t,a,e),e};exports.PktBackLink=class extends r.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,a,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,a,i)}render(){return r.b`<nav
|
|
2
|
-
class="pkt-back-link"
|
|
3
|
-
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
4
|
-
>
|
|
5
|
-
<a href=${c.o(this.href||"/")} class="pkt-link pkt-link--icon-left"
|
|
6
|
-
><pkt-icon
|
|
7
|
-
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
8
|
-
name="chevron-thin-left"
|
|
9
|
-
aria-hidden="true"
|
|
10
|
-
></pkt-icon
|
|
11
|
-
><span class="pkt-back-link__text">${this.text}</span></a
|
|
12
|
-
>
|
|
13
|
-
</nav>`}};n([r.n({type:String})],exports.PktBackLink.prototype,"href",2);n([r.n({type:String})],exports.PktBackLink.prototype,"text",2);n([r.n({type:String})],exports.PktBackLink.prototype,"ariaLabel",2);exports.PktBackLink=n([r.t("pkt-backlink")],exports.PktBackLink);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { P as c, b as k, n as o, t as b } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { o as h } from "./if-defined-B0krMLad.js";
|
|
3
|
-
import "./icon-BlKA8YuW.js";
|
|
4
|
-
var f = Object.defineProperty, u = Object.getOwnPropertyDescriptor, n = (t, r, i, l) => {
|
|
5
|
-
for (var e = l > 1 ? void 0 : l ? u(r, i) : r, s = t.length - 1, p; s >= 0; s--)
|
|
6
|
-
(p = t[s]) && (e = (l ? p(r, i, e) : p(e)) || e);
|
|
7
|
-
return l && e && f(r, i, e), e;
|
|
8
|
-
};
|
|
9
|
-
let a = class extends c {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments), this.href = "", this.text = "Forsiden", this.ariaLabel = "";
|
|
12
|
-
}
|
|
13
|
-
// Lifecycle
|
|
14
|
-
attributeChangedCallback(t, r, i) {
|
|
15
|
-
t === "arialabel" && this.removeAttribute("arialabel"), t === "href" && this.removeAttribute("href"), t === "text" && this.removeAttribute("text"), super.attributeChangedCallback(t, r, i);
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return k`<nav
|
|
19
|
-
class="pkt-back-link"
|
|
20
|
-
aria-label=${this.ariaLabel || "Gå tilbake til forrige side"}
|
|
21
|
-
>
|
|
22
|
-
<a href=${h(this.href || "/")} class="pkt-link pkt-link--icon-left"
|
|
23
|
-
><pkt-icon
|
|
24
|
-
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
25
|
-
name="chevron-thin-left"
|
|
26
|
-
aria-hidden="true"
|
|
27
|
-
></pkt-icon
|
|
28
|
-
><span class="pkt-back-link__text">${this.text}</span></a
|
|
29
|
-
>
|
|
30
|
-
</nav>`;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
n([
|
|
34
|
-
o({ type: String })
|
|
35
|
-
], a.prototype, "href", 2);
|
|
36
|
-
n([
|
|
37
|
-
o({ type: String })
|
|
38
|
-
], a.prototype, "text", 2);
|
|
39
|
-
n([
|
|
40
|
-
o({ type: String })
|
|
41
|
-
], a.prototype, "ariaLabel", 2);
|
|
42
|
-
a = n([
|
|
43
|
-
b("pkt-backlink")
|
|
44
|
-
], a);
|
|
45
|
-
export {
|
|
46
|
-
a as P
|
|
47
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t={fromAttribute(r){return r==null?!1:r===""||r==="true"||r===!0?!0:r==="false"||r===!1?!1:!!r},toAttribute(r){return r?"true":"false"}};exports.booleanishConverter=t;
|
package/dist/button-DEyvt1LI.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { P as c, s as f } from "./element-with-slot-Dqk6-TRR.js";
|
|
2
|
-
import { A as b, b as l, n as s, t as u } from "./element-CPpT3rFQ.js";
|
|
3
|
-
import { e as y } from "./class-map-CEnykyO_.js";
|
|
4
|
-
import { o as r } from "./if-defined-B0krMLad.js";
|
|
5
|
-
import "./icon-BlKA8YuW.js";
|
|
6
|
-
var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (t, o, n, p) => {
|
|
7
|
-
for (var a = p > 1 ? void 0 : p ? g(o, n) : o, d = t.length - 1, h; d >= 0; d--)
|
|
8
|
-
(h = t[d]) && (a = (p ? h(o, n, a) : h(a)) || a);
|
|
9
|
-
return p && a && m(o, n, a), a;
|
|
10
|
-
};
|
|
11
|
-
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/";
|
|
12
|
-
let i = class extends c {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.fullWidth = !1, this.fullWidthOnMobile = !1, this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath;
|
|
15
|
-
}
|
|
16
|
-
// Lifecycle
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback(), this.addEventListener(
|
|
19
|
-
"click",
|
|
20
|
-
(t) => {
|
|
21
|
-
(this.disabled || this.hasAttribute("disabled") || this.isLoading) && (t.preventDefault(), t.stopImmediatePropagation());
|
|
22
|
-
},
|
|
23
|
-
!0
|
|
24
|
-
), this.addEventListener(
|
|
25
|
-
"keydown",
|
|
26
|
-
(t) => {
|
|
27
|
-
(this.disabled || this.hasAttribute("disabled") || this.isLoading) && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopImmediatePropagation());
|
|
28
|
-
},
|
|
29
|
-
!0
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
attributeChangedCallback(t, o, n) {
|
|
33
|
-
super.attributeChangedCallback(t, o, n), t === "disabled" && n === "false" && (this.disabled = !1), (t === "isloading" || t === "isLoading") && n === "false" && (this.isLoading = !1);
|
|
34
|
-
}
|
|
35
|
-
firstUpdated(t) {
|
|
36
|
-
super.firstUpdated(t), this.disabled === "false" && (this.disabled = !1), this.isLoading === "false" && (this.isLoading = !1);
|
|
37
|
-
}
|
|
38
|
-
// Render
|
|
39
|
-
render() {
|
|
40
|
-
const t = this.form ?? this.getAttribute("form") ?? void 0, o = {
|
|
41
|
-
"pkt-btn": !0,
|
|
42
|
-
[`pkt-btn--${this.size}`]: !!this.size,
|
|
43
|
-
[`pkt-btn--${this.skin}`]: !!this.skin,
|
|
44
|
-
[`pkt-btn--${this.variant}`]: !!this.variant,
|
|
45
|
-
[`pkt-btn--${this.color}`]: !!this.color,
|
|
46
|
-
[`pkt-btn--${this.state}`]: !!this.state,
|
|
47
|
-
"pkt-btn--full": !!this.fullWidth,
|
|
48
|
-
"pkt-btn--full-small": !!this.fullWidthOnMobile,
|
|
49
|
-
"pkt-btn--disabled": !!this.disabled,
|
|
50
|
-
"pkt-btn--isLoading": !!this.isLoading
|
|
51
|
-
};
|
|
52
|
-
return l`
|
|
53
|
-
<button
|
|
54
|
-
class=${y(o)}
|
|
55
|
-
type=${this.type}
|
|
56
|
-
?disabled=${!!this.disabled}
|
|
57
|
-
aria-busy=${r(this.isLoading ? "true" : void 0)}
|
|
58
|
-
aria-disabled=${r(this.disabled || this.isLoading ? "true" : void 0)}
|
|
59
|
-
form=${r(t)}
|
|
60
|
-
>
|
|
61
|
-
${this.isLoading ? l`<pkt-icon
|
|
62
|
-
class="pkt-btn__icon pkt-btn__spinner"
|
|
63
|
-
name="spinner-blue"
|
|
64
|
-
path=${r(this.loadingAnimationPath)}
|
|
65
|
-
></pkt-icon>` : b}
|
|
66
|
-
${this.variant !== "label-only" ? l`<pkt-icon
|
|
67
|
-
class="pkt-btn__icon pkt-icon"
|
|
68
|
-
name=${this.iconName}
|
|
69
|
-
path=${r(this.iconPath)}
|
|
70
|
-
></pkt-icon>` : b}
|
|
71
|
-
<span class="pkt-btn__text">${f(this)}</span>
|
|
72
|
-
${this.variant === "icons-right-and-left" ? l`<pkt-icon
|
|
73
|
-
class="pkt-btn__icon"
|
|
74
|
-
name=${this.secondIconName}
|
|
75
|
-
path=${r(this.secondIconPath)}
|
|
76
|
-
></pkt-icon>` : b}
|
|
77
|
-
</button>
|
|
78
|
-
`;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
e([
|
|
82
|
-
s({ type: String })
|
|
83
|
-
], i.prototype, "iconName", 2);
|
|
84
|
-
e([
|
|
85
|
-
s({ type: String })
|
|
86
|
-
], i.prototype, "secondIconName", 2);
|
|
87
|
-
e([
|
|
88
|
-
s({ type: String })
|
|
89
|
-
], i.prototype, "iconPath", 2);
|
|
90
|
-
e([
|
|
91
|
-
s({ type: String })
|
|
92
|
-
], i.prototype, "secondIconPath", 2);
|
|
93
|
-
e([
|
|
94
|
-
s({ type: String })
|
|
95
|
-
], i.prototype, "mode", 2);
|
|
96
|
-
e([
|
|
97
|
-
s({ type: String })
|
|
98
|
-
], i.prototype, "size", 2);
|
|
99
|
-
e([
|
|
100
|
-
s({ type: Boolean, attribute: "full-width" })
|
|
101
|
-
], i.prototype, "fullWidth", 2);
|
|
102
|
-
e([
|
|
103
|
-
s({ type: Boolean, attribute: "full-width-on-mobile" })
|
|
104
|
-
], i.prototype, "fullWidthOnMobile", 2);
|
|
105
|
-
e([
|
|
106
|
-
s({ type: String })
|
|
107
|
-
], i.prototype, "color", 2);
|
|
108
|
-
e([
|
|
109
|
-
s({ type: String })
|
|
110
|
-
], i.prototype, "skin", 2);
|
|
111
|
-
e([
|
|
112
|
-
s({ type: String })
|
|
113
|
-
], i.prototype, "variant", 2);
|
|
114
|
-
e([
|
|
115
|
-
s({ type: String, reflect: !0 })
|
|
116
|
-
], i.prototype, "state", 2);
|
|
117
|
-
e([
|
|
118
|
-
s({ type: String, reflect: !0 })
|
|
119
|
-
], i.prototype, "type", 2);
|
|
120
|
-
e([
|
|
121
|
-
s({ type: String })
|
|
122
|
-
], i.prototype, "form", 2);
|
|
123
|
-
e([
|
|
124
|
-
s({ type: Boolean, reflect: !0 })
|
|
125
|
-
], i.prototype, "isLoading", 2);
|
|
126
|
-
e([
|
|
127
|
-
s({ type: Boolean, reflect: !0 })
|
|
128
|
-
], i.prototype, "disabled", 2);
|
|
129
|
-
e([
|
|
130
|
-
s({ type: String })
|
|
131
|
-
], i.prototype, "loadingAnimationPath", 2);
|
|
132
|
-
i = e([
|
|
133
|
-
u("pkt-button")
|
|
134
|
-
], i);
|
|
135
|
-
export {
|
|
136
|
-
i as P
|
|
137
|
-
};
|