@oslokommune/punkt-elements 16.26.7 → 17.0.2
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 +110 -0
- package/dist/accordion-CbXDxOho.cjs +47 -0
- package/dist/{accordion-CBdIk9gw.js → accordion-DEUHQ4JD.js} +45 -35
- package/dist/{alert-HHTGY0sp.js → alert-CbtVGrHD.js} +31 -17
- package/dist/{alert-B8dLsiTz.cjs → alert-CkUnbPdA.cjs} +5 -5
- package/dist/base-elements/input-element.d.ts +1 -0
- package/dist/button-Cod17rKo.js +115 -0
- package/dist/{button-B5tQpKeG.cjs → button-gvDXtBMC.cjs} +5 -2
- package/dist/{calendar-DIzGBdbh.cjs → calendar-BVXW8DqC.cjs} +1 -1
- package/dist/{calendar-CjlUA-Lb.js → calendar-CjC4qlh6.js} +1 -1
- package/dist/{checkbox-Bt_sC_90.cjs → checkbox-8uxbeU30.cjs} +1 -1
- package/dist/{checkbox-D03BC2Va.js → checkbox-DJDphhqz.js} +1 -1
- package/dist/{combobox-CoQBTWqL.js → combobox-Du5yr-xM.js} +16 -2
- package/dist/combobox-hKrbYLUe.cjs +136 -0
- package/dist/components/accordion/accordion-context.d.ts +7 -0
- package/dist/components/accordion/accordion.d.ts +2 -0
- package/dist/components/accordion/accordionitem.d.ts +1 -0
- package/dist/components/alert/alert.d.ts +5 -0
- package/dist/components/alert/alert.test.d.ts +1 -0
- package/dist/components/button/button.d.ts +4 -1
- package/dist/components/datepicker/datepicker-base.d.ts +2 -0
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -2
- package/dist/components/footer/footer-base.d.ts +44 -0
- package/dist/components/footer/footer-simple.d.ts +20 -0
- package/dist/components/footer/footer.accessibility.test.d.ts +0 -0
- package/dist/components/footer/footer.d.ts +22 -0
- package/dist/components/footer/footer.test.d.ts +0 -0
- package/dist/components/footer/index.d.ts +3 -0
- package/dist/components/footer/types.d.ts +16 -0
- package/dist/components/header/header-chrome-controller.d.ts +44 -0
- package/dist/components/header/header-global.accessibility.test.d.ts +0 -0
- package/dist/components/header/header-global.d.ts +78 -0
- package/dist/components/header/header-global.test.d.ts +0 -0
- package/dist/components/header/header-service.accessibility.test.d.ts +0 -0
- package/dist/components/header/header-service.d.ts +6 -21
- package/dist/components/header/header-service.test.d.ts +1 -1
- package/dist/components/header/header.d.ts +11 -3
- package/dist/components/header/header.test.d.ts +0 -0
- package/dist/components/header/index.d.ts +2 -1
- package/dist/components/header/types.d.ts +28 -2
- package/dist/components/header-menu/header-menu.d.ts +4 -5
- package/dist/components/header-menu/types.d.ts +1 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/input-wrapper/input-wrapper.d.ts +2 -0
- package/dist/components/input-wrapper/input-wrapper.test.d.ts +1 -0
- package/dist/components/searchinput/searchinput.d.ts +5 -0
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.test.d.ts +1 -0
- package/dist/components/textarea/textarea.test.d.ts +2 -0
- package/dist/components/textinput/textinput.test.d.ts +1 -0
- package/dist/components/timepicker/timepicker.d.ts +2 -0
- package/dist/components/timepicker/timepicker.test.d.ts +3 -0
- package/dist/consent--Nw43WFU.cjs +18 -0
- package/dist/{consent-D5sY6JK3.js → consent-B2hSTCGC.js} +14 -7
- package/dist/consume-BiOhrhEy.js +167 -0
- package/dist/consume-DKf5SmP9.cjs +1 -0
- package/dist/{converters-BKGBRBpS.js → converters-BBfsEJV5.js} +25 -25
- package/dist/{converters-9jHlXDyy.cjs → converters-Cd0fPEly.cjs} +1 -1
- package/dist/{datepicker-BE5Ll0W4.js → datepicker--Fq8q-J3.js} +30 -12
- package/dist/{datepicker-x4xM3KQz.cjs → datepicker-CEoBYTBU.cjs} +11 -7
- package/dist/docs/components/alert.d.ts +3 -0
- package/dist/docs/components/footer.d.ts +9 -0
- package/dist/docs/components/form-sizes.d.ts +10 -0
- package/dist/docs/components/header-global-full.d.ts +20 -0
- package/dist/docs/components/header-global.d.ts +14 -0
- package/dist/docs/components/searchinput.d.ts +6 -3
- package/dist/fetch-header-footer-data-Pc32etrk.js +88 -0
- package/dist/fetch-header-footer-data-xohWFmYC.cjs +1 -0
- package/dist/fileupload-CGKUJrlj.cjs +401 -0
- package/dist/{fileupload-2hf8YNhO.js → fileupload-D4gQN64T.js} +156 -176
- package/dist/focus-trap-DG3pEuyJ.js +60 -0
- package/dist/focus-trap-DSv4Ifqm.cjs +1 -0
- package/dist/footer-BIrJeRuZ.js +303 -0
- package/dist/footer-Ber-jqM1.cjs +114 -0
- package/dist/footer.d.ts +1 -0
- package/dist/header-BFk1an4z.cjs +465 -0
- package/dist/header-Deg_LGJo.js +1287 -0
- package/dist/header-menu-BHqK4QA6.cjs +126 -0
- package/dist/{header-menu-C8b5vd3n.js → header-menu-GFtJKM4j.js} +25 -97
- package/dist/{helptext-OfqH5npD.js → helptext-C_brWCIT.js} +1 -1
- package/dist/{helptext-eckq4JEX.cjs → helptext-Cq5rNaAC.cjs} +1 -1
- package/dist/{input-element-ZGOWsvKM.cjs → input-element-B0qLbEdF.cjs} +1 -1
- package/dist/{input-element-BFHpeoV8.js → input-element-C0RnXi-J.js} +5 -2
- package/dist/{input-wrapper-DwwE0JcO.js → input-wrapper-BweP6t3O.js} +12 -0
- package/dist/{input-wrapper-BRjQB4zM.cjs → input-wrapper-DPkkiG7S.cjs} +13 -11
- package/dist/{input-wrapper-DaA98B5l.js → input-wrapper-fWV5P4MN.js} +22 -15
- package/dist/{input-wrapper-LcZjpt0L.cjs → input-wrapper-wh3fWIhk.cjs} +1 -1
- package/dist/modal-CPnFteYS.cjs +35 -0
- package/dist/{modal-C6pScpdG.js → modal-xNK_wpHk.js} +11 -20
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -0
- package/dist/pkt-footer.js +2 -0
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +2 -2
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +27 -26
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{radiobutton-DGO6H2Ki.js → radiobutton-C6htwDrT.js} +1 -1
- package/dist/{radiobutton-DY1WWepJ.cjs → radiobutton-DjWBoSHv.cjs} +1 -1
- package/dist/scroll-lock-BN8lOhV5.cjs +1 -0
- package/dist/scroll-lock-DAbNKAUy.js +18 -0
- package/dist/searchinput-CfUVfpqL.js +156 -0
- package/dist/searchinput-DGjeN1YI.cjs +60 -0
- package/dist/{select-D4_HQFkh.cjs → select-CZvAW7W2.cjs} +2 -1
- package/dist/{select-BwHUIlwQ.js → select-CsBXXbLP.js} +4 -3
- package/dist/setupTests.d.ts +0 -0
- package/dist/shared-types/footer.d.ts +95 -0
- package/dist/shared-types/{header-menu.d.ts → header-footer.d.ts} +51 -4
- package/dist/shared-types/header.d.ts +1 -1
- package/dist/shared-types/index.d.ts +6 -4
- package/dist/shared-types/searchinput.d.ts +2 -0
- package/dist/shared-types/select.d.ts +3 -2
- package/dist/shared-types/size.d.ts +4 -0
- package/dist/shared-types/timepicker.d.ts +0 -6
- package/dist/shared-utils/datepicker-utils.d.ts +5 -4
- package/dist/shared-utils/fileupload/focus-trap.d.ts +4 -10
- package/dist/shared-utils/focus-trap/index.d.ts +22 -0
- package/dist/shared-utils/{header-menu → header-footer}/example-data.d.ts +5 -4
- package/dist/shared-utils/header-footer/external-domain.d.ts +26 -0
- package/dist/shared-utils/{header-menu → header-footer}/fetch-header-footer-data.d.ts +6 -2
- package/dist/shared-utils/{header-menu → header-footer}/index.d.ts +2 -1
- package/dist/shared-utils/{header-menu → header-footer}/select-megamenu.d.ts +1 -1
- package/dist/shared-utils/scroll-lock/index.d.ts +24 -0
- package/dist/tabs-BqrKLCjd.js +214 -0
- package/dist/tabs-q62MK_-r.cjs +40 -0
- package/dist/{textarea-D6M7ZhtA.js → textarea-Cm392CEI.js} +5 -3
- package/dist/{textarea-Bt_Zs8gq.cjs → textarea-sTcZxOIB.cjs} +3 -2
- package/dist/{textinput-EDKjcUdg.cjs → textinput-DqJbTglM.cjs} +3 -2
- package/dist/{textinput-oU2EvFsi.js → textinput-TSPcBcih.js} +5 -3
- package/dist/{timepicker-CgOL2sd9.cjs → timepicker-CqFYMV8q.cjs} +8 -7
- package/dist/{timepicker-_G0V_HV3.js → timepicker-DWbgTDKq.js} +10 -9
- package/package.json +3 -3
- package/src/components/accordion/accordion-context.ts +8 -0
- package/src/components/accordion/accordion.test.ts +44 -0
- package/src/components/accordion/accordion.ts +13 -3
- package/src/components/accordion/accordionitem.ts +9 -1
- package/src/components/alert/alert.test.ts +51 -2
- package/src/components/alert/alert.ts +11 -5
- package/src/components/breadcrumbs/breadcrumbs.test.ts +11 -3
- package/src/components/button/button.test.ts +23 -0
- package/src/components/button/button.ts +28 -3
- package/src/components/combobox/combobox.core.test.ts +20 -0
- package/src/components/combobox/combobox.ts +2 -0
- package/src/components/consent/consent.test.ts +6 -3
- package/src/components/consent/consent.ts +15 -7
- package/src/components/datepicker/datepicker-base.ts +5 -1
- package/src/components/datepicker/datepicker-utils.test.ts +10 -0
- package/src/components/datepicker/datepicker.core.test.ts +17 -0
- package/src/components/datepicker/datepicker.ts +8 -0
- package/src/components/footer/footer-base.ts +238 -0
- package/src/components/footer/footer-simple.ts +71 -0
- package/src/components/footer/footer.accessibility.test.ts +66 -0
- package/src/components/footer/footer.test.ts +238 -0
- package/src/components/footer/footer.ts +81 -0
- package/src/components/footer/index.ts +4 -0
- package/src/components/footer/types.ts +21 -0
- package/src/components/header/header-chrome-controller.ts +123 -0
- package/src/components/header/header-global.accessibility.test.ts +110 -0
- package/src/components/header/header-global.test.ts +329 -0
- package/src/components/header/header-global.ts +648 -0
- package/src/components/header/header-service.accessibility.test.ts +79 -0
- package/src/components/header/header-service.test.ts +32 -12
- package/src/components/header/header-service.ts +38 -162
- package/src/components/header/header-user-menu.ts +0 -1
- package/src/components/header/header.test.ts +84 -0
- package/src/components/header/header.ts +52 -5
- package/src/components/header/index.ts +6 -0
- package/src/components/header/types.ts +38 -0
- package/src/components/header-menu/header-menu.test.ts +131 -10
- package/src/components/header-menu/header-menu.ts +23 -24
- package/src/components/header-menu/types.ts +1 -1
- package/src/components/index.ts +18 -2
- package/src/components/input-wrapper/input-wrapper.test.ts +45 -0
- package/src/components/input-wrapper/input-wrapper.ts +17 -9
- package/src/components/modal/modal.ts +8 -9
- package/src/components/searchinput/searchinput.test.ts +43 -0
- package/src/components/searchinput/searchinput.ts +29 -12
- package/src/components/select/index.ts +1 -1
- package/src/components/select/select.test.ts +28 -0
- package/src/components/select/select.ts +4 -3
- package/src/components/textarea/textarea.test.ts +16 -0
- package/src/components/textarea/textarea.ts +3 -1
- package/src/components/textinput/textinput.test.ts +28 -0
- package/src/components/textinput/textinput.ts +3 -1
- package/src/components/timepicker/timepicker.test.ts +26 -0
- package/src/components/timepicker/timepicker.ts +12 -6
- package/dist/accordion-FISAiAbX.cjs +0 -47
- package/dist/button-C_YzTSuU.js +0 -96
- package/dist/combobox-D6H9rWPV.cjs +0 -135
- package/dist/consent-X3wvhteO.cjs +0 -10
- package/dist/fileupload-BLVrslUX.cjs +0 -401
- package/dist/header-CFrsaq0c.cjs +0 -310
- package/dist/header-D_xvPR4R.js +0 -801
- package/dist/header-menu-DMdP_c6X.cjs +0 -126
- package/dist/modal-DKU7PnjJ.cjs +0 -35
- package/dist/searchinput-CyO5k4Q4.js +0 -148
- package/dist/searchinput-DG6YetL1.cjs +0 -60
- package/dist/shared-utils/modal-scroll-lock.d.ts +0 -10
- package/dist/tabs-CGo0ODPa.cjs +0 -40
- package/dist/tabs-ChdR0D1C.js +0 -379
- /package/dist/shared-utils/{header-menu → header-footer}/icon-map.d.ts +0 -0
package/dist/tabs-ChdR0D1C.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import { a as e, n as t, o as n, p as r, s as i } from "./element-BoJrqauR.js";
|
|
2
|
-
import { n as a, t as o } from "./element-with-slot-mXLg8gg8.js";
|
|
3
|
-
import { t as s } from "./if-defined-D0bnetLJ.js";
|
|
4
|
-
import { n as c, t as l } from "./ref-WGS0u7i2.js";
|
|
5
|
-
//#region node_modules/@lit/context/lib/context-request-event.js
|
|
6
|
-
var u = class extends Event {
|
|
7
|
-
constructor(e, t, n, r) {
|
|
8
|
-
super("context-request", {
|
|
9
|
-
bubbles: !0,
|
|
10
|
-
composed: !0
|
|
11
|
-
}), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region node_modules/@lit/context/lib/create-context.js
|
|
16
|
-
function d(e) {
|
|
17
|
-
return e;
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region node_modules/@lit/context/lib/controllers/context-consumer.js
|
|
21
|
-
var f = class {
|
|
22
|
-
constructor(e, t, n, r) {
|
|
23
|
-
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (e, t) => {
|
|
24
|
-
this.unsubscribe && (this.unsubscribe !== t && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = e, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(e, t)), this.unsubscribe = t;
|
|
25
|
-
}, this.host = e, t.context !== void 0) {
|
|
26
|
-
let e = t;
|
|
27
|
-
this.context = e.context, this.callback = e.callback, this.subscribe = e.subscribe ?? !1;
|
|
28
|
-
} else this.context = t, this.callback = n, this.subscribe = r ?? !1;
|
|
29
|
-
this.host.addController(this);
|
|
30
|
-
}
|
|
31
|
-
hostConnected() {
|
|
32
|
-
this.dispatchRequest();
|
|
33
|
-
}
|
|
34
|
-
hostDisconnected() {
|
|
35
|
-
this.unsubscribe &&= (this.unsubscribe(), void 0);
|
|
36
|
-
}
|
|
37
|
-
dispatchRequest() {
|
|
38
|
-
this.host.dispatchEvent(new u(this.context, this.host, this.t, this.subscribe));
|
|
39
|
-
}
|
|
40
|
-
}, p = class {
|
|
41
|
-
get value() {
|
|
42
|
-
return this.o;
|
|
43
|
-
}
|
|
44
|
-
set value(e) {
|
|
45
|
-
this.setValue(e);
|
|
46
|
-
}
|
|
47
|
-
setValue(e, t = !1) {
|
|
48
|
-
let n = t || !Object.is(e, this.o);
|
|
49
|
-
this.o = e, n && this.updateObservers();
|
|
50
|
-
}
|
|
51
|
-
constructor(e) {
|
|
52
|
-
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
53
|
-
for (let [e, { disposer: t }] of this.subscriptions) e(this.o, t);
|
|
54
|
-
}, e !== void 0 && (this.value = e);
|
|
55
|
-
}
|
|
56
|
-
addCallback(e, t, n) {
|
|
57
|
-
if (!n) return void e(this.value);
|
|
58
|
-
this.subscriptions.has(e) || this.subscriptions.set(e, {
|
|
59
|
-
disposer: () => {
|
|
60
|
-
this.subscriptions.delete(e);
|
|
61
|
-
},
|
|
62
|
-
consumerHost: t
|
|
63
|
-
});
|
|
64
|
-
let { disposer: r } = this.subscriptions.get(e);
|
|
65
|
-
e(this.value, r);
|
|
66
|
-
}
|
|
67
|
-
clearCallbacks() {
|
|
68
|
-
this.subscriptions.clear();
|
|
69
|
-
}
|
|
70
|
-
}, m = class extends Event {
|
|
71
|
-
constructor(e, t) {
|
|
72
|
-
super("context-provider", {
|
|
73
|
-
bubbles: !0,
|
|
74
|
-
composed: !0
|
|
75
|
-
}), this.context = e, this.contextTarget = t;
|
|
76
|
-
}
|
|
77
|
-
}, h = class extends p {
|
|
78
|
-
constructor(e, t, n) {
|
|
79
|
-
super(t.context === void 0 ? n : t.initialValue), this.onContextRequest = (e) => {
|
|
80
|
-
if (e.context !== this.context) return;
|
|
81
|
-
let t = e.contextTarget ?? e.composedPath()[0];
|
|
82
|
-
t !== this.host && (e.stopPropagation(), this.addCallback(e.callback, t, e.subscribe));
|
|
83
|
-
}, this.onProviderRequest = (e) => {
|
|
84
|
-
if (e.context !== this.context || (e.contextTarget ?? e.composedPath()[0]) === this.host) return;
|
|
85
|
-
let t = /* @__PURE__ */ new Set();
|
|
86
|
-
for (let [e, { consumerHost: n }] of this.subscriptions) t.has(e) || (t.add(e), n.dispatchEvent(new u(this.context, n, e, !0)));
|
|
87
|
-
e.stopPropagation();
|
|
88
|
-
}, this.host = e, t.context === void 0 ? this.context = t : this.context = t.context, this.attachListeners(), this.host.addController?.(this);
|
|
89
|
-
}
|
|
90
|
-
attachListeners() {
|
|
91
|
-
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
92
|
-
}
|
|
93
|
-
hostConnected() {
|
|
94
|
-
this.host.dispatchEvent(new m(this.context, this.host));
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region node_modules/@lit/context/lib/decorators/provide.js
|
|
99
|
-
function g({ context: e }) {
|
|
100
|
-
return (t, n) => {
|
|
101
|
-
let r = /* @__PURE__ */ new WeakMap();
|
|
102
|
-
if (typeof n == "object") return {
|
|
103
|
-
get() {
|
|
104
|
-
return t.get.call(this);
|
|
105
|
-
},
|
|
106
|
-
set(e) {
|
|
107
|
-
return r.get(this).setValue(e), t.set.call(this, e);
|
|
108
|
-
},
|
|
109
|
-
init(t) {
|
|
110
|
-
return r.set(this, new h(this, {
|
|
111
|
-
context: e,
|
|
112
|
-
initialValue: t
|
|
113
|
-
})), t;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
{
|
|
117
|
-
t.constructor.addInitializer(((t) => {
|
|
118
|
-
r.set(t, new h(t, { context: e }));
|
|
119
|
-
}));
|
|
120
|
-
let i = Object.getOwnPropertyDescriptor(t, n), a;
|
|
121
|
-
if (i === void 0) {
|
|
122
|
-
let e = /* @__PURE__ */ new WeakMap();
|
|
123
|
-
a = {
|
|
124
|
-
get() {
|
|
125
|
-
return e.get(this);
|
|
126
|
-
},
|
|
127
|
-
set(t) {
|
|
128
|
-
r.get(this).setValue(t), e.set(this, t);
|
|
129
|
-
},
|
|
130
|
-
configurable: !0,
|
|
131
|
-
enumerable: !0
|
|
132
|
-
};
|
|
133
|
-
} else {
|
|
134
|
-
let e = i.set;
|
|
135
|
-
a = {
|
|
136
|
-
...i,
|
|
137
|
-
set(t) {
|
|
138
|
-
r.get(this).setValue(t), e?.call(this, t);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
Object.defineProperty(t, n, a);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region node_modules/@lit/context/lib/decorators/consume.js
|
|
149
|
-
function _({ context: e, subscribe: t }) {
|
|
150
|
-
return (n, r) => {
|
|
151
|
-
typeof r == "object" ? r.addInitializer((function() {
|
|
152
|
-
new f(this, {
|
|
153
|
-
context: e,
|
|
154
|
-
callback: (e) => {
|
|
155
|
-
n.set.call(this, e);
|
|
156
|
-
},
|
|
157
|
-
subscribe: t
|
|
158
|
-
});
|
|
159
|
-
})) : n.constructor.addInitializer(((n) => {
|
|
160
|
-
new f(n, {
|
|
161
|
-
context: e,
|
|
162
|
-
callback: (e) => {
|
|
163
|
-
n[r] = e;
|
|
164
|
-
},
|
|
165
|
-
subscribe: t
|
|
166
|
-
});
|
|
167
|
-
}));
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/components/tabs/tabs-context.ts
|
|
172
|
-
var v = d(Symbol("pkt-tabs-context")), y = class extends o {
|
|
173
|
-
constructor(...e) {
|
|
174
|
-
super(...e), this.arrowNav = !0, this.disableArrowNav = !1, this.separatorIconName = "", this.separatorIconPath = "", this.tabRefs = [], this.disabledMap = {}, this.tabCount = 0, this.context = {
|
|
175
|
-
useArrowNav: this.useArrowNav,
|
|
176
|
-
registerTab: this.registerTab.bind(this),
|
|
177
|
-
handleClick: this.handleClick.bind(this),
|
|
178
|
-
handleKeyUp: this.handleKeyUp.bind(this)
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
get useArrowNav() {
|
|
182
|
-
return this.arrowNav && !this.disableArrowNav;
|
|
183
|
-
}
|
|
184
|
-
updated(e) {
|
|
185
|
-
(e.has("arrowNav") || e.has("disableArrowNav")) && (this.context = {
|
|
186
|
-
...this.context,
|
|
187
|
-
useArrowNav: this.useArrowNav
|
|
188
|
-
}), this.updateComplete.then(() => this.syncSeparators());
|
|
189
|
-
}
|
|
190
|
-
syncSeparators() {
|
|
191
|
-
let e = this.querySelector(".pkt-tabs__list");
|
|
192
|
-
if (!e || (e.querySelectorAll(".pkt-tabs__separator").forEach((e) => e.remove()), !(this.separatorIconName || this.separatorIconPath))) return;
|
|
193
|
-
let t = Array.from(e.children).filter((e) => !e.classList.contains("pkt-tabs__separator"));
|
|
194
|
-
for (let e = 0; e < t.length - 1; e++) {
|
|
195
|
-
let n = document.createElement("span");
|
|
196
|
-
if (n.className = "pkt-tabs__separator", n.setAttribute("aria-hidden", "true"), n.setAttribute("role", "presentation"), this.separatorIconPath) {
|
|
197
|
-
let e = document.createElement("img");
|
|
198
|
-
e.setAttribute("src", this.separatorIconPath), e.setAttribute("alt", ""), e.setAttribute("aria-hidden", "true"), n.appendChild(e);
|
|
199
|
-
} else if (this.separatorIconName) {
|
|
200
|
-
let e = document.createElement("pkt-icon");
|
|
201
|
-
e.setAttribute("name", this.separatorIconName), e.classList.add("pkt-tabs__separator-icon"), n.appendChild(e);
|
|
202
|
-
}
|
|
203
|
-
t[e].after(n);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
registerTab(e, t, n = !1) {
|
|
207
|
-
this.tabRefs[t] = e, this.disabledMap[t] = n, this.tabCount = Math.max(this.tabCount, t + 1);
|
|
208
|
-
}
|
|
209
|
-
isTabDisabled(e) {
|
|
210
|
-
return !!this.disabledMap[e];
|
|
211
|
-
}
|
|
212
|
-
findEnabledIndex(e, t) {
|
|
213
|
-
let n = e + t;
|
|
214
|
-
for (; n >= 0 && n < this.tabCount;) {
|
|
215
|
-
if (!this.isTabDisabled(n)) return n;
|
|
216
|
-
n += t;
|
|
217
|
-
}
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
handleClick(e) {
|
|
221
|
-
this.isTabDisabled(e) || this.dispatchEvent(new CustomEvent("tab-selected", {
|
|
222
|
-
detail: { index: e },
|
|
223
|
-
bubbles: !0,
|
|
224
|
-
composed: !0
|
|
225
|
-
}));
|
|
226
|
-
}
|
|
227
|
-
handleKeyUp(e, t) {
|
|
228
|
-
if (this.useArrowNav) {
|
|
229
|
-
if (e.key === "ArrowLeft") {
|
|
230
|
-
e.preventDefault();
|
|
231
|
-
let n = this.findEnabledIndex(t, -1);
|
|
232
|
-
n !== null && this.tabRefs[n]?.focus();
|
|
233
|
-
}
|
|
234
|
-
if (e.key === "ArrowRight") {
|
|
235
|
-
e.preventDefault();
|
|
236
|
-
let n = this.findEnabledIndex(t, 1);
|
|
237
|
-
n !== null && this.tabRefs[n]?.focus();
|
|
238
|
-
}
|
|
239
|
-
(e.key === "Enter" || e.key === " " || e.key === "Spacebar" || e.key === "ArrowDown") && (e.preventDefault(), this.handleClick(t));
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
render() {
|
|
243
|
-
let e = this.useArrowNav ? "tablist" : "navigation";
|
|
244
|
-
return r`
|
|
245
|
-
<div class=${this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs"}>
|
|
246
|
-
<div class="pkt-tabs__list" role=${e}>${a(this)}</div>
|
|
247
|
-
</div>
|
|
248
|
-
`;
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
t([n({
|
|
252
|
-
type: Boolean,
|
|
253
|
-
reflect: !0,
|
|
254
|
-
attribute: "arrow-nav"
|
|
255
|
-
})], y.prototype, "arrowNav", void 0), t([n({
|
|
256
|
-
type: Boolean,
|
|
257
|
-
reflect: !0,
|
|
258
|
-
attribute: "disable-arrow-nav"
|
|
259
|
-
})], y.prototype, "disableArrowNav", void 0), t([n({
|
|
260
|
-
type: String,
|
|
261
|
-
reflect: !0,
|
|
262
|
-
attribute: "separator-icon-name"
|
|
263
|
-
})], y.prototype, "separatorIconName", void 0), t([n({
|
|
264
|
-
type: String,
|
|
265
|
-
reflect: !0,
|
|
266
|
-
attribute: "separator-icon-path"
|
|
267
|
-
})], y.prototype, "separatorIconPath", void 0), t([e()], y.prototype, "tabRefs", void 0), t([e()], y.prototype, "disabledMap", void 0), t([e()], y.prototype, "tabCount", void 0), t([g({ context: v }), e()], y.prototype, "context", void 0);
|
|
268
|
-
try {
|
|
269
|
-
i("pkt-tabs")(y);
|
|
270
|
-
} catch {
|
|
271
|
-
console.warn("Forsøker å definere <pkt-tabs>, men den er allerede definert");
|
|
272
|
-
}
|
|
273
|
-
//#endregion
|
|
274
|
-
//#region src/components/tabs/tabitem.ts
|
|
275
|
-
var b = class extends o {
|
|
276
|
-
constructor() {
|
|
277
|
-
super(), this.active = !1, this.disabled = !1, this.href = "", this.icon = "", this.controls = "", this.tag = "", this.tagSkin = "blue", this.index = 0, this.elementRef = l();
|
|
278
|
-
}
|
|
279
|
-
connectedCallback() {
|
|
280
|
-
super.connectedCallback(), this.updateComplete.then(() => {
|
|
281
|
-
this.elementRef.value && this.context && this.context.registerTab(this.elementRef.value, this.index, this.disabled);
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
updated() {
|
|
285
|
-
this.elementRef.value && this.context && this.context.registerTab(this.elementRef.value, this.index, this.disabled);
|
|
286
|
-
}
|
|
287
|
-
handleClick(e) {
|
|
288
|
-
if (this.disabled) {
|
|
289
|
-
e.preventDefault(), e.stopPropagation();
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
this.context && this.context.handleClick(this.index);
|
|
293
|
-
}
|
|
294
|
-
handleKeyDown(e) {
|
|
295
|
-
if (this.disabled && (e.key === "Enter" || e.key === " " || e.key === "Spacebar")) {
|
|
296
|
-
e.preventDefault(), e.stopPropagation();
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
this.context && this.context.handleKeyUp(e, this.index);
|
|
300
|
-
}
|
|
301
|
-
render() {
|
|
302
|
-
let e = this.context?.useArrowNav ?? !0, t = this.active && !this.disabled, n = [t ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = e ? "tab" : void 0, o = e ? t : void 0, l = this.disabled ? -1 : t || !e ? void 0 : -1, u = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, d = r`
|
|
303
|
-
${this.icon ? r`<pkt-icon name=${this.icon} class=${u}></pkt-icon>` : ""}
|
|
304
|
-
<span>${a(this)}</span>
|
|
305
|
-
${this.tag ? r`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
|
|
306
|
-
`;
|
|
307
|
-
return this.href ? r`
|
|
308
|
-
<a
|
|
309
|
-
${c(this.elementRef)}
|
|
310
|
-
href=${s(this.disabled ? void 0 : this.href)}
|
|
311
|
-
class="pkt-tabs__link ${n}"
|
|
312
|
-
role=${s(i)}
|
|
313
|
-
aria-selected=${s(o)}
|
|
314
|
-
aria-disabled=${s(this.disabled ? "true" : void 0)}
|
|
315
|
-
aria-controls=${s(this.controls || void 0)}
|
|
316
|
-
tabindex=${s(l)}
|
|
317
|
-
@click=${this.handleClick}
|
|
318
|
-
@keydown=${this.handleKeyDown}
|
|
319
|
-
>
|
|
320
|
-
${d}
|
|
321
|
-
</a>
|
|
322
|
-
` : r`
|
|
323
|
-
<button
|
|
324
|
-
${c(this.elementRef)}
|
|
325
|
-
type="button"
|
|
326
|
-
class="pkt-tabs__button pkt-link-button ${n}"
|
|
327
|
-
?disabled=${this.disabled}
|
|
328
|
-
aria-disabled=${s(this.disabled ? "true" : void 0)}
|
|
329
|
-
role=${s(i)}
|
|
330
|
-
aria-selected=${s(o)}
|
|
331
|
-
aria-controls=${s(this.controls || void 0)}
|
|
332
|
-
tabindex=${s(l)}
|
|
333
|
-
@click=${this.handleClick}
|
|
334
|
-
@keydown=${this.handleKeyDown}
|
|
335
|
-
>
|
|
336
|
-
${d}
|
|
337
|
-
</button>
|
|
338
|
-
`;
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
t([n({
|
|
342
|
-
type: Boolean,
|
|
343
|
-
reflect: !0
|
|
344
|
-
})], b.prototype, "active", void 0), t([n({
|
|
345
|
-
type: Boolean,
|
|
346
|
-
reflect: !0
|
|
347
|
-
})], b.prototype, "disabled", void 0), t([n({
|
|
348
|
-
type: String,
|
|
349
|
-
reflect: !0
|
|
350
|
-
})], b.prototype, "href", void 0), t([n({
|
|
351
|
-
type: String,
|
|
352
|
-
reflect: !0
|
|
353
|
-
})], b.prototype, "icon", void 0), t([n({
|
|
354
|
-
type: String,
|
|
355
|
-
reflect: !0
|
|
356
|
-
})], b.prototype, "controls", void 0), t([n({
|
|
357
|
-
type: String,
|
|
358
|
-
reflect: !0
|
|
359
|
-
})], b.prototype, "tag", void 0), t([n({
|
|
360
|
-
type: String,
|
|
361
|
-
reflect: !0,
|
|
362
|
-
attribute: "tag-skin"
|
|
363
|
-
})], b.prototype, "tagSkin", void 0), t([n({
|
|
364
|
-
type: Number,
|
|
365
|
-
reflect: !0
|
|
366
|
-
})], b.prototype, "index", void 0), t([_({
|
|
367
|
-
context: v,
|
|
368
|
-
subscribe: !0
|
|
369
|
-
}), n({ attribute: !1 })], b.prototype, "context", void 0);
|
|
370
|
-
try {
|
|
371
|
-
i("pkt-tab-item")(b);
|
|
372
|
-
} catch {
|
|
373
|
-
console.warn("Forsøker å definere <pkt-tab-item>, men den er allerede definert");
|
|
374
|
-
}
|
|
375
|
-
//#endregion
|
|
376
|
-
//#region src/components/tabs/index.ts
|
|
377
|
-
var x = y;
|
|
378
|
-
//#endregion
|
|
379
|
-
export { b as n, y as r, x as t };
|
|
File without changes
|