@oslokommune/punkt-elements 16.7.3 → 16.7.7
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 -5
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -5
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -81
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -5
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -5
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -5
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -5
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -5
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -5
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -9
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -861
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -5
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -5
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -5
- 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 -5
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -5
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -5
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -5
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -5
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -5
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -5
- 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 -5
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -5
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -5
- 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 -5
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -5
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -5
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -560
- 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/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +6 -6
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/dist/accordionitem-_9AiCIvd.cjs +0 -34
- package/dist/accordionitem-dCfSrxh5.js +0 -140
- package/dist/alert-BtOk8yRH.cjs +0 -33
- package/dist/alert-DlY2_grU.js +0 -117
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-Ce5Vldop.js +0 -49
- package/dist/backlink-y3dwjKPC.cjs +0 -13
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-B_TXwNzt.cjs +0 -27
- package/dist/button-BiY-wlKF.js +0 -139
- package/dist/calendar-B2pji2zn.cjs +0 -90
- package/dist/calendar-DhjQDC4C.js +0 -2140
- package/dist/card-BwMNB5Bb.cjs +0 -87
- package/dist/card-CGlmcMSR.js +0 -233
- package/dist/checkbox-BsJZYA26.js +0 -147
- package/dist/checkbox-CTY8f_qn.cjs +0 -31
- 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-DSB5WOxg.js +0 -815
- package/dist/combobox-DbICIgKG.cjs +0 -135
- package/dist/consent-DkOQpbsg.cjs +0 -11
- package/dist/consent-SNWV_mMU.js +0 -175
- package/dist/datepicker-BEWl9iz3.cjs +0 -273
- package/dist/datepicker-euHyzXnb.js +0 -1170
- 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-D2tVS6lS.js +0 -103
- package/dist/heading-DrzbgDb6.cjs +0 -1
- package/dist/helptext-BKtU4mas.js +0 -82
- package/dist/helptext-DcRC7wW2.cjs +0 -24
- package/dist/icon-CxQcIa5F.js +0 -105
- package/dist/icon-q81vqPK_.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-Bs4CRNst.js +0 -181
- package/dist/input-wrapper-Bv9aqqVq.cjs +0 -54
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-C0rl-86s.cjs +0 -7
- package/dist/link-Cdqgl60z.js +0 -55
- package/dist/linkcard-Dimu7Rlx.cjs +0 -13
- package/dist/linkcard-Lbq_UhjZ.js +0 -56
- package/dist/listbox-Bia4_tvN.js +0 -440
- package/dist/listbox-La2GZQei.cjs +0 -106
- package/dist/loader-D1ugDXGV.cjs +0 -16
- package/dist/loader-DyN6RGC5.js +0 -95
- package/dist/messagebox-BGMVm2t9.js +0 -71
- package/dist/messagebox-M0yIgCz9.cjs +0 -13
- package/dist/modal-CMO1RtIi.cjs +0 -36
- package/dist/modal-DjPQDE-Z.js +0 -156
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-BqlMzkM_.cjs +0 -21
- package/dist/progressbar-sbHDFC12.js +0 -162
- package/dist/radiobutton-5ZqVVtTT.cjs +0 -31
- package/dist/radiobutton-D8Ai8ETa.js +0 -113
- 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-De-n8on9.js +0 -230
- package/dist/select-dTWibR6_.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-B9-jeV97.js +0 -334
- package/dist/tabitem-BnhzqfW3.cjs +0 -65
- package/dist/tag-CbwO8yvD.cjs +0 -27
- package/dist/tag-D4FI5t3y.js +0 -117
- package/dist/textarea-BmLaKzsc.cjs +0 -50
- package/dist/textarea-CMiSJaYL.js +0 -133
- package/dist/textinput-em9y4yrL.cjs +0 -70
- package/dist/textinput-r8udK0IX.js +0 -152
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
|
@@ -11,6 +11,12 @@ import {
|
|
|
11
11
|
} from './datepicker-utils'
|
|
12
12
|
import { createRef } from 'lit/directives/ref.js'
|
|
13
13
|
|
|
14
|
+
const mockIsIOS = vi.hoisted(() => vi.fn(() => false))
|
|
15
|
+
|
|
16
|
+
vi.mock('shared-utils/device-utils', () => ({
|
|
17
|
+
isIOS: mockIsIOS,
|
|
18
|
+
}))
|
|
19
|
+
|
|
14
20
|
describe('datepicker-utils', () => {
|
|
15
21
|
describe('valueUtils', () => {
|
|
16
22
|
describe('validateRangeOrder', () => {
|
|
@@ -71,18 +77,15 @@ describe('datepicker-utils', () => {
|
|
|
71
77
|
describe('inputTypeUtils', () => {
|
|
72
78
|
describe('getInputType', () => {
|
|
73
79
|
it('should return "text" for iOS devices', () => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}))
|
|
78
|
-
// Note: This test is limited by how vitest handles module mocking
|
|
79
|
-
// In a real scenario, you'd need proper mocking setup
|
|
80
|
+
mockIsIOS.mockReturnValue(true)
|
|
81
|
+
const type = inputTypeUtils.getInputType()
|
|
82
|
+
expect(type).toBe('text')
|
|
80
83
|
})
|
|
81
84
|
|
|
82
85
|
it('should return "date" for non-iOS devices', () => {
|
|
83
|
-
|
|
86
|
+
mockIsIOS.mockReturnValue(false)
|
|
84
87
|
const type = inputTypeUtils.getInputType()
|
|
85
|
-
expect(
|
|
88
|
+
expect(type).toBe('date')
|
|
86
89
|
})
|
|
87
90
|
})
|
|
88
91
|
})
|
|
@@ -223,7 +226,9 @@ describe('datepicker-utils', () => {
|
|
|
223
226
|
it('should return early if refs are not available', () => {
|
|
224
227
|
const popupRef = createRef()
|
|
225
228
|
const inputRef = createRef()
|
|
226
|
-
expect(() =>
|
|
229
|
+
expect(() =>
|
|
230
|
+
calendarUtils.handleCalendarPosition(popupRef as any, inputRef as any),
|
|
231
|
+
).not.toThrow()
|
|
227
232
|
})
|
|
228
233
|
|
|
229
234
|
it('should position calendar below input by default', () => {
|
|
@@ -629,13 +634,7 @@ describe('datepicker-utils', () => {
|
|
|
629
634
|
const blurInput = vi.fn()
|
|
630
635
|
const event = { key: 'Enter', preventDefault: vi.fn() } as any
|
|
631
636
|
|
|
632
|
-
keyboardUtils.handleInputKeydown(
|
|
633
|
-
event,
|
|
634
|
-
toggleCalendar,
|
|
635
|
-
undefined,
|
|
636
|
-
undefined,
|
|
637
|
-
blurInput,
|
|
638
|
-
)
|
|
637
|
+
keyboardUtils.handleInputKeydown(event, toggleCalendar, undefined, undefined, blurInput)
|
|
639
638
|
expect(event.preventDefault).toHaveBeenCalled()
|
|
640
639
|
expect(blurInput).toHaveBeenCalled()
|
|
641
640
|
})
|
|
@@ -662,13 +661,7 @@ describe('datepicker-utils', () => {
|
|
|
662
661
|
const blurInput = vi.fn()
|
|
663
662
|
const event = { key: ',', preventDefault: vi.fn() } as any
|
|
664
663
|
|
|
665
|
-
keyboardUtils.handleInputKeydown(
|
|
666
|
-
event,
|
|
667
|
-
toggleCalendar,
|
|
668
|
-
undefined,
|
|
669
|
-
undefined,
|
|
670
|
-
blurInput,
|
|
671
|
-
)
|
|
664
|
+
keyboardUtils.handleInputKeydown(event, toggleCalendar, undefined, undefined, blurInput)
|
|
672
665
|
expect(event.preventDefault).toHaveBeenCalled()
|
|
673
666
|
expect(blurInput).toHaveBeenCalled()
|
|
674
667
|
})
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./element-gR_VtSiD.cjs"),u=require("./class-map-CsENJXf1.cjs"),m=require("./element-with-slot-ZX-up7jO.cjs"),h=require("./ref-CL-Xk9Xm.cjs"),f=require("./if-defined-BOW3ODSj.cjs");var k=Object.defineProperty,p=(n,t,r,l)=>{for(var e=void 0,s=n.length-1,d;s>=0;s--)(d=n[s])&&(e=d(t,r,e)||e);return e&&k(t,r,e),e};class a 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 r=(t=this.renderRoot)==null?void 0:t.querySelector("slot");r&&r.assignedElements().forEach(e=>{e.tagName.toLowerCase()==="pkt-accordion-item"&&(e.hasAttribute("name")||e.setAttribute("name",this.name))})}}firstUpdated(){var r;const t=(r=this.renderRoot)==null?void 0:r.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=${u.e(t)}
|
|
5
|
-
data-testid="pkt-accordion"
|
|
6
|
-
aria-labelledby=${this.ariaLabelledBy}
|
|
7
|
-
>
|
|
8
|
-
<slot></slot>
|
|
9
|
-
</div>
|
|
10
|
-
`}}p([i.n({type:String,reflect:!0,attribute:"aria-labelledby"})],a.prototype,"ariaLabelledBy");p([i.n({type:Boolean,reflect:!0,attribute:"compact"})],a.prototype,"compact");p([i.n({type:String,reflect:!0,attribute:"skin"})],a.prototype,"skin");p([i.n({type:String,reflect:!0,attribute:"name"})],a.prototype,"name");try{i.t("pkt-accordion")(a)}catch{console.warn("Forsøker å definere <pkt-accordion>, men den er allerede definert")}var y=Object.defineProperty,c=(n,t,r,l)=>{for(var e=void 0,s=n.length-1,d;s>=0;s--)(d=n[s])&&(e=d(t,r,e)||e);return e&&y(t,r,e),e};class o 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=h.e()}firstUpdated(t){this.defaultOpen&&(this.isOpen=!0)}render(){const t={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return i.b`
|
|
11
|
-
<details
|
|
12
|
-
class=${u.e(t)}
|
|
13
|
-
id=${this.id}
|
|
14
|
-
?open=${this.isOpen}
|
|
15
|
-
${h.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
|
-
`}}c([i.n({type:Boolean})],o.prototype,"defaultOpen");c([i.n({type:String})],o.prototype,"title");c([i.n({type:String,reflect:!0})],o.prototype,"skin");c([i.n({type:Boolean,reflect:!0})],o.prototype,"compact");c([i.n({type:Boolean,reflect:!0})],o.prototype,"isOpen");c([i.n({type:String,reflect:!0})],o.prototype,"name");try{i.t("pkt-accordion-item")(o)}catch{console.warn("Forsøker å definere <pkt-accordion-item>, men den er allerede definert")}exports.PktAccordion=a;exports.PktAccordionItem=o;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { t as m, i as u, b as h, n as r } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { e as f } from "./class-map-CEnykyO_.js";
|
|
3
|
-
import { P as k, s as y } from "./element-with-slot-Dqk6-TRR.js";
|
|
4
|
-
import { e as v, n as _ } from "./ref-Bg_Swj5w.js";
|
|
5
|
-
import { o as $ } from "./if-defined-B0krMLad.js";
|
|
6
|
-
var b = Object.defineProperty, p = (o, t, i, l) => {
|
|
7
|
-
for (var e = void 0, s = o.length - 1, c; s >= 0; s--)
|
|
8
|
-
(c = o[s]) && (e = c(t, i, e) || e);
|
|
9
|
-
return e && b(t, i, e), e;
|
|
10
|
-
};
|
|
11
|
-
class d 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 i = (t = this.renderRoot) == null ? void 0 : t.querySelector("slot");
|
|
22
|
-
i && i.assignedElements().forEach((e) => {
|
|
23
|
-
e.tagName.toLowerCase() === "pkt-accordion-item" && (e.hasAttribute("name") || e.setAttribute("name", this.name));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
firstUpdated() {
|
|
28
|
-
var i;
|
|
29
|
-
const t = (i = this.renderRoot) == null ? void 0 : i.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 h`
|
|
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
|
-
p([
|
|
53
|
-
r({ type: String, reflect: !0, attribute: "aria-labelledby" })
|
|
54
|
-
], d.prototype, "ariaLabelledBy");
|
|
55
|
-
p([
|
|
56
|
-
r({ type: Boolean, reflect: !0, attribute: "compact" })
|
|
57
|
-
], d.prototype, "compact");
|
|
58
|
-
p([
|
|
59
|
-
r({ type: String, reflect: !0, attribute: "skin" })
|
|
60
|
-
], d.prototype, "skin");
|
|
61
|
-
p([
|
|
62
|
-
r({ type: String, reflect: !0, attribute: "name" })
|
|
63
|
-
], d.prototype, "name");
|
|
64
|
-
try {
|
|
65
|
-
m("pkt-accordion")(d);
|
|
66
|
-
} catch {
|
|
67
|
-
console.warn("Forsøker å definere <pkt-accordion>, men den er allerede definert");
|
|
68
|
-
}
|
|
69
|
-
var g = Object.defineProperty, n = (o, t, i, l) => {
|
|
70
|
-
for (var e = void 0, s = o.length - 1, c; s >= 0; s--)
|
|
71
|
-
(c = o[s]) && (e = c(t, i, e) || e);
|
|
72
|
-
return e && g(t, i, e), e;
|
|
73
|
-
};
|
|
74
|
-
class a extends k {
|
|
75
|
-
constructor() {
|
|
76
|
-
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef = v();
|
|
77
|
-
}
|
|
78
|
-
firstUpdated(t) {
|
|
79
|
-
this.defaultOpen && (this.isOpen = !0);
|
|
80
|
-
}
|
|
81
|
-
render() {
|
|
82
|
-
const t = {
|
|
83
|
-
"pkt-accordion-item": !0,
|
|
84
|
-
"pkt-accordion-item--compact": this.compact,
|
|
85
|
-
[`pkt-accordion-item--${this.skin}`]: !!this.skin
|
|
86
|
-
};
|
|
87
|
-
return h`
|
|
88
|
-
<details
|
|
89
|
-
class=${f(t)}
|
|
90
|
-
id=${this.id}
|
|
91
|
-
?open=${this.isOpen}
|
|
92
|
-
${_(this.accordionItemRef)}
|
|
93
|
-
name=${$(this.name)}
|
|
94
|
-
>
|
|
95
|
-
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
96
|
-
${this.title}
|
|
97
|
-
<pkt-icon
|
|
98
|
-
name="chevron-thin-down"
|
|
99
|
-
class="pkt-accordion-item__icon"
|
|
100
|
-
aria-hidden="true"
|
|
101
|
-
></pkt-icon>
|
|
102
|
-
</summary>
|
|
103
|
-
<div
|
|
104
|
-
class="pkt-accordion-item__content"
|
|
105
|
-
id="pkt-accordion-item__content-${this.id}"
|
|
106
|
-
role="region"
|
|
107
|
-
>
|
|
108
|
-
<div class="pkt-accordion-item__content-inner">${y(this)}</div>
|
|
109
|
-
</div>
|
|
110
|
-
</details>
|
|
111
|
-
`;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
n([
|
|
115
|
-
r({ type: Boolean })
|
|
116
|
-
], a.prototype, "defaultOpen");
|
|
117
|
-
n([
|
|
118
|
-
r({ type: String })
|
|
119
|
-
], a.prototype, "title");
|
|
120
|
-
n([
|
|
121
|
-
r({ type: String, reflect: !0 })
|
|
122
|
-
], a.prototype, "skin");
|
|
123
|
-
n([
|
|
124
|
-
r({ type: Boolean, reflect: !0 })
|
|
125
|
-
], a.prototype, "compact");
|
|
126
|
-
n([
|
|
127
|
-
r({ type: Boolean, reflect: !0 })
|
|
128
|
-
], a.prototype, "isOpen");
|
|
129
|
-
n([
|
|
130
|
-
r({ type: String, reflect: !0 })
|
|
131
|
-
], a.prototype, "name");
|
|
132
|
-
try {
|
|
133
|
-
m("pkt-accordion-item")(a);
|
|
134
|
-
} catch {
|
|
135
|
-
console.warn("Forsøker å definere <pkt-accordion-item>, men den er allerede definert");
|
|
136
|
-
}
|
|
137
|
-
export {
|
|
138
|
-
d as P,
|
|
139
|
-
a
|
|
140
|
-
};
|
package/dist/alert-BtOk8yRH.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("./class-map-CsENJXf1.cjs"),t=require("./element-gR_VtSiD.cjs"),h=require("./state-Dg-53wQ8.cjs"),u=require("./element-with-slot-ZX-up7jO.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-q81vqPK_.cjs");require("./button-B_TXwNzt.cjs");const v={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},o={props:v};var f=Object.defineProperty,s=(l,e,r,n)=>{for(var a=void 0,p=l.length-1,c;p>=0;p--)(c=l[p])&&(a=c(e,r,a)||a);return a&&f(e,r,a),a};class i extends u.PktElementWithSlot{constructor(){super(),this.compact=o.props.compact.default,this.title="",this.skin=o.props.skin.default,this.ariaLive=o.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=o.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["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,r,n){e==="ariaLive"&&(this["aria-live"]=n),super.attributeChangedCallback(e,r,n)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},r={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return t.b`
|
|
2
|
-
<div class=${d.e(e)} aria-live=${this["aria-live"]}>
|
|
3
|
-
<div class=${d.e(r)}>
|
|
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?t.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
|
-
`:t.A}
|
|
26
|
-
${this.title?t.b`<div class="pkt-alert__title">${this.title}</div>`:t.A}
|
|
27
|
-
|
|
28
|
-
<div class="pkt-alert__text">${u.slotContent(this)}</div>
|
|
29
|
-
|
|
30
|
-
${this.date?t.b`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:t.A}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
`}}s([t.n({type:Boolean,reflect:!1})],i.prototype,"compact");s([t.n({type:String,reflect:!0})],i.prototype,"title");s([t.n({type:String,reflect:!0})],i.prototype,"skin");s([t.n({type:String})],i.prototype,"ariaLive");s([t.n({type:String,reflect:!0})],i.prototype,"aria-live");s([t.n({type:Boolean,reflect:!0})],i.prototype,"closeAlert");s([t.n({type:String,reflect:!0})],i.prototype,"date");s([t.n({type:String,reflect:!0})],i.prototype,"role");s([h.r()],i.prototype,"_isClosed");try{t.t("pkt-alert")(i)}catch{console.warn("Forsøker å definere <pkt-alert>, men den er allerede definert")}exports.PktAlert=i;
|
package/dist/alert-DlY2_grU.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { e as u } from "./class-map-CEnykyO_.js";
|
|
2
|
-
import { t as f, A as d, b as o, n as s } from "./element-CPpT3rFQ.js";
|
|
3
|
-
import { r as k } from "./state-C_1EOo3D.js";
|
|
4
|
-
import { P as v, s as m } from "./element-with-slot-Dqk6-TRR.js";
|
|
5
|
-
import { u as _ } from "./classutils-RQs1k6D9.js";
|
|
6
|
-
import "./icon-CxQcIa5F.js";
|
|
7
|
-
import "./button-BiY-wlKF.js";
|
|
8
|
-
const y = { skin: { default: "info" }, ariaLive: { default: "polite" }, compact: { default: !1 }, closeAlert: { default: !1 } }, p = {
|
|
9
|
-
props: y
|
|
10
|
-
};
|
|
11
|
-
var b = Object.defineProperty, i = (l, t, a, n) => {
|
|
12
|
-
for (var r = void 0, c = l.length - 1, h; c >= 0; c--)
|
|
13
|
-
(h = l[c]) && (r = h(t, a, r) || r);
|
|
14
|
-
return r && b(t, a, r), r;
|
|
15
|
-
};
|
|
16
|
-
class e extends v {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(), this.compact = p.props.compact.default, this.title = "", this.skin = p.props.skin.default, this.ariaLive = p.props.ariaLive.default, this["aria-live"] = null, this.closeAlert = p.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, a, n) {
|
|
31
|
-
t === "ariaLive" && (this["aria-live"] = n), super.attributeChangedCallback(t, a, n);
|
|
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
|
-
}, a = {
|
|
44
|
-
"pkt-alert__grid": !0,
|
|
45
|
-
"pkt-alert__noTitle": !this.title,
|
|
46
|
-
"pkt-alert__noDate": !this.date
|
|
47
|
-
};
|
|
48
|
-
return o`
|
|
49
|
-
<div class=${u(t)} aria-live=${this["aria-live"]}>
|
|
50
|
-
<div class=${u(a)}>
|
|
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 ? o`
|
|
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
|
-
` : d}
|
|
73
|
-
${this.title ? o`<div class="pkt-alert__title">${this.title}</div>` : d}
|
|
74
|
-
|
|
75
|
-
<div class="pkt-alert__text">${m(this)}</div>
|
|
76
|
-
|
|
77
|
-
${this.date ? o`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : d}
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
i([
|
|
84
|
-
s({ type: Boolean, reflect: !1 })
|
|
85
|
-
], e.prototype, "compact");
|
|
86
|
-
i([
|
|
87
|
-
s({ type: String, reflect: !0 })
|
|
88
|
-
], e.prototype, "title");
|
|
89
|
-
i([
|
|
90
|
-
s({ type: String, reflect: !0 })
|
|
91
|
-
], e.prototype, "skin");
|
|
92
|
-
i([
|
|
93
|
-
s({ type: String })
|
|
94
|
-
], e.prototype, "ariaLive");
|
|
95
|
-
i([
|
|
96
|
-
s({ type: String, reflect: !0 })
|
|
97
|
-
], e.prototype, "aria-live");
|
|
98
|
-
i([
|
|
99
|
-
s({ type: Boolean, reflect: !0 })
|
|
100
|
-
], e.prototype, "closeAlert");
|
|
101
|
-
i([
|
|
102
|
-
s({ type: String, reflect: !0 })
|
|
103
|
-
], e.prototype, "date");
|
|
104
|
-
i([
|
|
105
|
-
s({ type: String, reflect: !0 })
|
|
106
|
-
], e.prototype, "role");
|
|
107
|
-
i([
|
|
108
|
-
k()
|
|
109
|
-
], e.prototype, "_isClosed");
|
|
110
|
-
try {
|
|
111
|
-
f("pkt-alert")(e);
|
|
112
|
-
} catch {
|
|
113
|
-
console.warn("Forsøker å definere <pkt-alert>, men den er allerede definert");
|
|
114
|
-
}
|
|
115
|
-
export {
|
|
116
|
-
e as P
|
|
117
|
-
};
|
|
@@ -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,49 +0,0 @@
|
|
|
1
|
-
import { t as p, P as c, b as h, n as l } from "./element-CPpT3rFQ.js";
|
|
2
|
-
import { o as b } from "./if-defined-B0krMLad.js";
|
|
3
|
-
import "./icon-CxQcIa5F.js";
|
|
4
|
-
var f = Object.defineProperty, s = (r, t, i, k) => {
|
|
5
|
-
for (var e = void 0, n = r.length - 1, o; n >= 0; n--)
|
|
6
|
-
(o = r[n]) && (e = o(t, i, e) || e);
|
|
7
|
-
return e && f(t, i, e), e;
|
|
8
|
-
};
|
|
9
|
-
class a extends c {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments), this.href = "", this.text = "Forsiden", this.ariaLabel = "";
|
|
12
|
-
}
|
|
13
|
-
// Lifecycle
|
|
14
|
-
attributeChangedCallback(t, i, k) {
|
|
15
|
-
t === "arialabel" && this.removeAttribute("arialabel"), t === "href" && this.removeAttribute("href"), t === "text" && this.removeAttribute("text"), super.attributeChangedCallback(t, i, k);
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return h`<nav
|
|
19
|
-
class="pkt-back-link"
|
|
20
|
-
aria-label=${this.ariaLabel || "Gå tilbake til forrige side"}
|
|
21
|
-
>
|
|
22
|
-
<a href=${b(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
|
-
s([
|
|
34
|
-
l({ type: String })
|
|
35
|
-
], a.prototype, "href");
|
|
36
|
-
s([
|
|
37
|
-
l({ type: String })
|
|
38
|
-
], a.prototype, "text");
|
|
39
|
-
s([
|
|
40
|
-
l({ type: String })
|
|
41
|
-
], a.prototype, "ariaLabel");
|
|
42
|
-
try {
|
|
43
|
-
p("pkt-backlink")(a);
|
|
44
|
-
} catch {
|
|
45
|
-
console.warn("Forsøker å definere <pkt-backlink>, men den er allerede definert");
|
|
46
|
-
}
|
|
47
|
-
export {
|
|
48
|
-
a as P
|
|
49
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("./element-gR_VtSiD.cjs"),o=require("./if-defined-BOW3ODSj.cjs");require("./icon-q81vqPK_.cjs");var p=Object.defineProperty,s=(a,e,n,k)=>{for(var t=void 0,l=a.length-1,c;l>=0;l--)(c=a[l])&&(t=c(e,n,t)||t);return t&&p(e,n,t),t};class i extends r.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,n,k){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,n,k)}render(){return r.b`<nav
|
|
2
|
-
class="pkt-back-link"
|
|
3
|
-
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
4
|
-
>
|
|
5
|
-
<a href=${o.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>`}}s([r.n({type:String})],i.prototype,"href");s([r.n({type:String})],i.prototype,"text");s([r.n({type:String})],i.prototype,"ariaLabel");try{r.t("pkt-backlink")(i)}catch{console.warn("Forsøker å definere <pkt-backlink>, men den er allerede definert")}exports.PktBackLink=i;
|
|
@@ -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-B_TXwNzt.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("./element-with-slot-ZX-up7jO.cjs"),t=require("./element-gR_VtSiD.cjs"),c=require("./class-map-CsENJXf1.cjs"),a=require("./if-defined-BOW3ODSj.cjs");require("./icon-q81vqPK_.cjs");var b=Object.defineProperty,n=(r,i,s,l)=>{for(var o=void 0,p=r.length-1,d;p>=0;p--)(d=r[p])&&(o=d(i,s,o)||o);return o&&b(i,s,o),o};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";class e extends h.PktElementWithSlot{constructor(){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}connectedCallback(){super.connectedCallback(),this.addEventListener("click",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.preventDefault(),i.stopImmediatePropagation())},!0),this.addEventListener("keydown",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopImmediatePropagation())},!0)}attributeChangedCallback(i,s,l){super.attributeChangedCallback(i,s,l),i==="disabled"&&l==="false"&&(this.disabled=!1),(i==="isloading"||i==="isLoading")&&l==="false"&&(this.isLoading=!1)}firstUpdated(i){super.firstUpdated(i),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const i=this.form??this.getAttribute("form")??void 0,s={"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--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return t.b`
|
|
2
|
-
<button
|
|
3
|
-
class=${c.e(s)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
?disabled=${!!this.disabled}
|
|
6
|
-
aria-busy=${a.o(this.isLoading?"true":void 0)}
|
|
7
|
-
aria-disabled=${a.o(this.disabled||this.isLoading?"true":void 0)}
|
|
8
|
-
form=${a.o(i)}
|
|
9
|
-
>
|
|
10
|
-
${this.isLoading?t.b`<pkt-icon
|
|
11
|
-
class="pkt-btn__icon pkt-btn__spinner"
|
|
12
|
-
name="spinner-blue"
|
|
13
|
-
path=${a.o(this.loadingAnimationPath)}
|
|
14
|
-
></pkt-icon>`:t.A}
|
|
15
|
-
${this.variant!=="label-only"?t.b`<pkt-icon
|
|
16
|
-
class="pkt-btn__icon pkt-icon"
|
|
17
|
-
name=${this.iconName}
|
|
18
|
-
path=${a.o(this.iconPath)}
|
|
19
|
-
></pkt-icon>`:t.A}
|
|
20
|
-
<span class="pkt-btn__text">${h.slotContent(this)}</span>
|
|
21
|
-
${this.variant==="icons-right-and-left"?t.b`<pkt-icon
|
|
22
|
-
class="pkt-btn__icon"
|
|
23
|
-
name=${this.secondIconName}
|
|
24
|
-
path=${a.o(this.secondIconPath)}
|
|
25
|
-
></pkt-icon>`:t.A}
|
|
26
|
-
</button>
|
|
27
|
-
`}}n([t.n({type:String})],e.prototype,"iconName");n([t.n({type:String})],e.prototype,"secondIconName");n([t.n({type:String})],e.prototype,"iconPath");n([t.n({type:String})],e.prototype,"secondIconPath");n([t.n({type:String})],e.prototype,"mode");n([t.n({type:String})],e.prototype,"size");n([t.n({type:Boolean,attribute:"full-width"})],e.prototype,"fullWidth");n([t.n({type:Boolean,attribute:"full-width-on-mobile"})],e.prototype,"fullWidthOnMobile");n([t.n({type:String})],e.prototype,"color");n([t.n({type:String})],e.prototype,"skin");n([t.n({type:String})],e.prototype,"variant");n([t.n({type:String,reflect:!0})],e.prototype,"state");n([t.n({type:String,reflect:!0})],e.prototype,"type");n([t.n({type:String})],e.prototype,"form");n([t.n({type:Boolean,reflect:!0})],e.prototype,"isLoading");n([t.n({type:Boolean,reflect:!0})],e.prototype,"disabled");n([t.n({type:String})],e.prototype,"loadingAnimationPath");try{t.t("pkt-button")(e)}catch{console.warn("Forsøker å definere <pkt-button>, men den er allerede definert")}exports.PktButton=e;
|