@oslokommune/punkt-elements 12.32.0 → 12.32.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/dist/alert-C2WKLFow.cjs +27 -0
- package/dist/alert-XGjypFHe.js +115 -0
- package/dist/alert.d.ts +15 -15
- package/dist/{backlink-DdNgqA56.js → backlink-BX8HBhw5.js} +2 -2
- package/dist/{backlink-Q2HTG9jm.cjs → backlink-NJdC0FAO.cjs} +1 -1
- package/dist/backlink.d.ts +15 -15
- package/dist/{button-rArIL0-j.js → button-Bn8jVB0f.js} +33 -33
- package/dist/{button-BPyZeW73.cjs → button-Bpbh8A_a.cjs} +2 -2
- package/dist/button.d.ts +15 -15
- package/dist/{calendar-1ryAEdX3.js → calendar-BNHDEEwT.js} +20 -84
- package/dist/{calendar-2DqPLXdD.cjs → calendar-Ds13AKr5.cjs} +4 -4
- package/dist/calendar.d.ts +15 -15
- package/dist/card-CEv3DL-o.js +94 -0
- package/dist/card-c5EEPaNh.cjs +28 -0
- package/dist/card.d.ts +15 -15
- package/dist/{checkbox-BnDG6wIO.cjs → checkbox-DDBBDM85.cjs} +1 -1
- package/dist/{checkbox-Ceui2TLp.js → checkbox-DoMYxp83.js} +9 -9
- package/dist/checkbox.d.ts +15 -15
- package/dist/{class-map-ChuDQU5C.js → class-map-D4tSZX70.js} +2 -2
- package/dist/{class-map-D4rXyUxT.cjs → class-map-DvBKxTiW.cjs} +1 -1
- package/dist/combobox-BflWORVa.cjs +115 -0
- package/dist/combobox-l7LmWQYu.js +491 -0
- package/dist/combobox.d.ts +15 -15
- package/dist/datepicker-Bkiyh5P5.cjs +153 -0
- package/dist/datepicker-nWd89NwP.js +449 -0
- package/dist/datepicker.d.ts +15 -15
- package/dist/directive-C7oCP5Bh.cjs +5 -0
- package/dist/directive-helpers-BmXIK-1b.js +45 -0
- package/dist/directive-helpers-donnvcEO.cjs +5 -0
- package/dist/{directive-B76A7YXI.js → directive-oAbCiebi.js} +4 -4
- package/dist/element-DJpGVXjq.cjs +238 -0
- package/dist/{element-G8JoS0Lj.js → element-DiqKrDty.js} +8845 -8847
- package/dist/{helptext-Y4cSgTkd.js → helptext-DfRusn5R.js} +9 -9
- package/dist/{helptext-B4Uc-d56.cjs → helptext-aHD9icur.cjs} +1 -1
- package/dist/helptext.d.ts +15 -15
- package/dist/{icon-BJnwW0eh.js → icon-BdY52BIt.js} +2 -2
- package/dist/{icon-BTUCDPN5.cjs → icon-UtDKPH3R.cjs} +1 -1
- package/dist/icon.d.ts +15 -15
- package/dist/{if-defined-C1ZDVzYn.cjs → if-defined-CoBDkDGb.cjs} +1 -1
- package/dist/{if-defined-rCqT8Od1.js → if-defined-DeANa4n5.js} +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/{input-element-DM2uSYaW.js → input-element-C4mmTk6h.js} +3 -3
- package/dist/{input-element-AhnBdCb8.cjs → input-element-VNai8bsq.cjs} +1 -1
- package/dist/input-wrapper-8iKEzDRZ.js +40 -0
- package/dist/{input-wrapper-BdZxmQyO.cjs → input-wrapper-DWOw7Yn-.cjs} +1 -1
- package/dist/input-wrapper-EoSAbU-U.cjs +1 -0
- package/dist/{input-wrapper-DQmYzhcy.js → input-wrapper-P_oEi6dk.js} +8 -8
- package/dist/input-wrapper.d.ts +15 -15
- package/dist/link-D9dJ6F-R.js +73 -0
- package/dist/link-DBxXqsnP.cjs +8 -0
- package/dist/link.d.ts +15 -15
- package/dist/{linkcard-DDD92XfD.cjs → linkcard-D5O1hR7N.cjs} +1 -1
- package/dist/{linkcard-CvqqyHVW.js → linkcard-DcEE9IVw.js} +4 -4
- package/dist/linkcard.d.ts +15 -15
- package/dist/{listbox-BTVnrHWv.cjs → listbox-CK1GmwCE.cjs} +1 -1
- package/dist/{listbox-DX-Euxdm.js → listbox-CfJWJDrc.js} +5 -5
- package/dist/listbox.d.ts +15 -15
- package/dist/{loader-BudoV0yd.js → loader-DZvOlXzI.js} +6 -6
- package/dist/{loader-Csq0Yd1k.cjs → loader-SDXJp58K.cjs} +1 -1
- package/dist/loader.d.ts +15 -15
- package/dist/messagebox-Ce5e1gga.js +79 -0
- package/dist/messagebox-D2_-WZQG.cjs +12 -0
- package/dist/messagebox.d.ts +15 -15
- package/dist/modal-CCtUsYKk.cjs +33 -0
- package/dist/{modal-DnYn2Rlg.js → modal-CdgIOp8Q.js} +51 -94
- package/dist/modal.d.ts +15 -15
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.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-card.cjs +1 -1
- package/dist/pkt-card.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-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +27 -27
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-CZplGTgu.js → pkt-options-controller-BkWE4pZe.js} +1 -1
- package/dist/{pkt-options-controller-BtU1zEtG.cjs → pkt-options-controller-TJ1apYGF.cjs} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-slot-controller-BtVLTZb7.js +79 -0
- package/dist/pkt-slot-controller-plQxXRvV.cjs +1 -0
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.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/{progressbar-czvExwTL.js → progressbar-DvFz9KBo.js} +6 -6
- package/dist/{progressbar-BW_icNId.cjs → progressbar-jASTnhti.cjs} +1 -1
- package/dist/progressbar.d.ts +15 -15
- package/dist/{radiobutton-BeSuCrbp.cjs → radiobutton-C-Xd5sSq.cjs} +1 -1
- package/dist/{radiobutton-DKo27Stm.js → radiobutton-D03aN4yn.js} +5 -5
- package/dist/radiobutton.d.ts +15 -15
- package/dist/{ref-cRTOoM4R.js → ref-B70YZNXm.js} +11 -11
- package/dist/{ref-DsoUUoPU.cjs → ref-CLqTsViF.cjs} +3 -3
- package/dist/{repeat-CArTw6-s.js → repeat-CNLpCTun.js} +3 -3
- package/dist/{repeat-kruY8poV.cjs → repeat-t2oms1o6.cjs} +1 -1
- package/dist/{select-DxHhPEgD.js → select-BLDaK5Rd.js} +8 -8
- package/dist/{select-lvFnhEVg.cjs → select-Dvds7MzS.cjs} +1 -1
- package/dist/select.d.ts +15 -15
- package/dist/{state-BILlRnrD.cjs → state-C4LdlTYO.cjs} +1 -1
- package/dist/{state-gfUuUqVg.js → state-CDwPbiQj.js} +1 -1
- package/dist/tag-C52KeBmR.cjs +18 -0
- package/dist/{tag-CWx1XsGR.js → tag-DoS5S2Bq.js} +28 -77
- package/dist/tag.d.ts +15 -15
- package/dist/{textarea-BNNDbxxO.js → textarea-C9EvdPGi.js} +11 -11
- package/dist/{textarea-CDsLbogK.cjs → textarea-DJvNBmEL.cjs} +1 -1
- package/dist/textarea.d.ts +15 -15
- package/dist/{textinput-C3C088Ki.cjs → textinput-Cg3ObBuw.cjs} +1 -1
- package/dist/{textinput-M8I4dfoP.js → textinput-CxRSSYaN.js} +20 -20
- package/dist/textinput.d.ts +15 -15
- package/package.json +4 -4
- package/src/components/button/button.ts +3 -2
- package/src/components/datepicker/datepicker.ts +4 -4
- package/src/components/tag/tag.ts +1 -1
- package/dist/alert-D5G5UJuo.cjs +0 -27
- package/dist/alert-gERpVuB7.js +0 -163
- package/dist/card-BbMBpvJt.js +0 -176
- package/dist/card-ZX09f_ka.cjs +0 -28
- package/dist/combobox-DH-YlbNh.cjs +0 -115
- package/dist/combobox-DbO6I0GT.js +0 -694
- package/dist/datepicker-8MOgQsyL.js +0 -611
- package/dist/datepicker-BRH-59Q9.cjs +0 -153
- package/dist/directive-C_VV3qwo.cjs +0 -5
- package/dist/directive-helpers-D7XIyCQ_.js +0 -45
- package/dist/directive-helpers-mGjAtADc.cjs +0 -5
- package/dist/element-BBo3JZk5.cjs +0 -238
- package/dist/input-wrapper-Bw9tARAD.js +0 -125
- package/dist/input-wrapper-jPnKsfEC.cjs +0 -1
- package/dist/link-C3lW3z8X.js +0 -109
- package/dist/link-DOVlsg2S.cjs +0 -8
- package/dist/messagebox-8GwnNqb0.cjs +0 -12
- package/dist/messagebox-D6uexEhg.js +0 -114
- package/dist/modal-CLixB4Dz.cjs +0 -33
- package/dist/pkt-slot-controller-CqNvEpFd.cjs +0 -1
- package/dist/pkt-slot-controller-D1DakVrU.js +0 -95
- package/dist/tag-DThwKsrg.cjs +0 -18
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
const e = "pkt-inputwrapper";
|
|
2
|
-
const t = {
|
|
3
|
-
toggleHelpText: {
|
|
4
|
-
description: "Event for å vise eller skjule hjelpetekst i dropdown"
|
|
5
|
-
}
|
|
6
|
-
}, n = {
|
|
7
|
-
forId: {
|
|
8
|
-
name: "For ID",
|
|
9
|
-
description: "Id-en til skjemaelementet som dette wrapper rundt",
|
|
10
|
-
type: "string",
|
|
11
|
-
required: !0
|
|
12
|
-
},
|
|
13
|
-
label: {
|
|
14
|
-
name: "Merkelapp",
|
|
15
|
-
description: "Merkelapp for skjemaelementet",
|
|
16
|
-
type: "string",
|
|
17
|
-
required: !0
|
|
18
|
-
},
|
|
19
|
-
helptext: {
|
|
20
|
-
name: "Hjelpetekst",
|
|
21
|
-
description: "Hjelpetekst for skjemaelementet",
|
|
22
|
-
type: "string"
|
|
23
|
-
},
|
|
24
|
-
helptextDropdown: {
|
|
25
|
-
name: "Hjelpetekst i dropdown",
|
|
26
|
-
description: "Hjelpetekst som vises i ekspanderende felt",
|
|
27
|
-
type: "string"
|
|
28
|
-
},
|
|
29
|
-
helptextDropdownButton: {
|
|
30
|
-
name: "Tekst i hjelpetekst-knapp",
|
|
31
|
-
description: "Tekst som vises i knappen for å vise hjelpetekst i dropdown",
|
|
32
|
-
default: "Les mer <span class='pkt-sr-only'>om feltet</span>",
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
ariaDescribedby: {
|
|
36
|
-
name: "aria-describedby",
|
|
37
|
-
description: "Id-en til elementet som beskriver skjemaelementet",
|
|
38
|
-
type: "string"
|
|
39
|
-
},
|
|
40
|
-
counter: {
|
|
41
|
-
name: "Teller",
|
|
42
|
-
description: "Teller for antall tegn i skjemaelementet",
|
|
43
|
-
type: "boolean",
|
|
44
|
-
default: !1
|
|
45
|
-
},
|
|
46
|
-
counterCurrent: {
|
|
47
|
-
name: "Tellerverdi",
|
|
48
|
-
description: "Tellerens nåværende verdi",
|
|
49
|
-
type: "number"
|
|
50
|
-
},
|
|
51
|
-
counterMaxLength: {
|
|
52
|
-
name: "Maks tegn i teller",
|
|
53
|
-
description: "Maks antall tegn som kan skrives i skjemaelementet",
|
|
54
|
-
type: "number"
|
|
55
|
-
},
|
|
56
|
-
optionalTag: {
|
|
57
|
-
name: "Vise valgfritt-merking",
|
|
58
|
-
description: "Viser en merking som indikerer at feltet er valgfritt",
|
|
59
|
-
type: "boolean",
|
|
60
|
-
default: !1
|
|
61
|
-
},
|
|
62
|
-
optionalText: {
|
|
63
|
-
name: "Valgfritt-tekst",
|
|
64
|
-
description: "Tekst som vises i valgfritt-merkingen",
|
|
65
|
-
type: "string",
|
|
66
|
-
default: "Valgfritt"
|
|
67
|
-
},
|
|
68
|
-
requiredTag: {
|
|
69
|
-
name: "Vise påkrevd-merking",
|
|
70
|
-
description: "Viser en merking som indikerer at feltet er påkrevd",
|
|
71
|
-
type: "boolean",
|
|
72
|
-
default: !1
|
|
73
|
-
},
|
|
74
|
-
requiredText: {
|
|
75
|
-
name: "Påkrevd-tekst",
|
|
76
|
-
description: "Tekst som vises i påkrevd-merkingen",
|
|
77
|
-
type: "string",
|
|
78
|
-
default: "Må fylles ut"
|
|
79
|
-
},
|
|
80
|
-
hasError: {
|
|
81
|
-
name: "Feil",
|
|
82
|
-
description: "Indikerer at skjemaelementet har en feil",
|
|
83
|
-
type: "boolean",
|
|
84
|
-
default: !1
|
|
85
|
-
},
|
|
86
|
-
errorMessage: {
|
|
87
|
-
name: "Feilmelding",
|
|
88
|
-
description: "Feilmelding som vises i tilknytning til skjemaelementet",
|
|
89
|
-
type: "string"
|
|
90
|
-
},
|
|
91
|
-
disabled: {
|
|
92
|
-
name: "Deaktivert",
|
|
93
|
-
description: "Indikerer at skjemaelementet er deaktivert",
|
|
94
|
-
type: "boolean",
|
|
95
|
-
default: !1
|
|
96
|
-
},
|
|
97
|
-
inline: {
|
|
98
|
-
name: "Inline",
|
|
99
|
-
description: "Indikerer at skjemaelementet skal flyte sammen med sidens innhold",
|
|
100
|
-
type: "boolean",
|
|
101
|
-
default: !1
|
|
102
|
-
},
|
|
103
|
-
hasFieldset: {
|
|
104
|
-
name: "Har fieldset",
|
|
105
|
-
description: "Indikerer at skjemaelementet er en del av et fieldset",
|
|
106
|
-
type: "boolean",
|
|
107
|
-
default: !1
|
|
108
|
-
},
|
|
109
|
-
useWrapper: {
|
|
110
|
-
name: "Bruk wrapper",
|
|
111
|
-
description: "Indikerer om skjemaelementet skal bruke en wrapper",
|
|
112
|
-
type: "boolean",
|
|
113
|
-
displayAsFalse: !0,
|
|
114
|
-
default: !0
|
|
115
|
-
}
|
|
116
|
-
}, r = {
|
|
117
|
-
name: e,
|
|
118
|
-
"css-class": "pkt-inputwrapper",
|
|
119
|
-
isElement: !0,
|
|
120
|
-
events: t,
|
|
121
|
-
props: n
|
|
122
|
-
};
|
|
123
|
-
export {
|
|
124
|
-
r as s
|
|
125
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e="pkt-inputwrapper";const t={toggleHelpText:{description:"Event for å vise eller skjule hjelpetekst i dropdown"}},n={forId:{name:"For ID",description:"Id-en til skjemaelementet som dette wrapper rundt",type:"string",required:!0},label:{name:"Merkelapp",description:"Merkelapp for skjemaelementet",type:"string",required:!0},helptext:{name:"Hjelpetekst",description:"Hjelpetekst for skjemaelementet",type:"string"},helptextDropdown:{name:"Hjelpetekst i dropdown",description:"Hjelpetekst som vises i ekspanderende felt",type:"string"},helptextDropdownButton:{name:"Tekst i hjelpetekst-knapp",description:"Tekst som vises i knappen for å vise hjelpetekst i dropdown",default:"Les mer <span class='pkt-sr-only'>om feltet</span>",type:"string"},ariaDescribedby:{name:"aria-describedby",description:"Id-en til elementet som beskriver skjemaelementet",type:"string"},counter:{name:"Teller",description:"Teller for antall tegn i skjemaelementet",type:"boolean",default:!1},counterCurrent:{name:"Tellerverdi",description:"Tellerens nåværende verdi",type:"number"},counterMaxLength:{name:"Maks tegn i teller",description:"Maks antall tegn som kan skrives i skjemaelementet",type:"number"},optionalTag:{name:"Vise valgfritt-merking",description:"Viser en merking som indikerer at feltet er valgfritt",type:"boolean",default:!1},optionalText:{name:"Valgfritt-tekst",description:"Tekst som vises i valgfritt-merkingen",type:"string",default:"Valgfritt"},requiredTag:{name:"Vise påkrevd-merking",description:"Viser en merking som indikerer at feltet er påkrevd",type:"boolean",default:!1},requiredText:{name:"Påkrevd-tekst",description:"Tekst som vises i påkrevd-merkingen",type:"string",default:"Må fylles ut"},hasError:{name:"Feil",description:"Indikerer at skjemaelementet har en feil",type:"boolean",default:!1},errorMessage:{name:"Feilmelding",description:"Feilmelding som vises i tilknytning til skjemaelementet",type:"string"},disabled:{name:"Deaktivert",description:"Indikerer at skjemaelementet er deaktivert",type:"boolean",default:!1},inline:{name:"Inline",description:"Indikerer at skjemaelementet skal flyte sammen med sidens innhold",type:"boolean",default:!1},hasFieldset:{name:"Har fieldset",description:"Indikerer at skjemaelementet er en del av et fieldset",type:"boolean",default:!1},useWrapper:{name:"Bruk wrapper",description:"Indikerer om skjemaelementet skal bruke en wrapper",type:"boolean",displayAsFalse:!0,default:!0}},r={name:e,"css-class":"pkt-inputwrapper",isElement:!0,events:t,props:n};exports.specs=r;
|
package/dist/link-C3lW3z8X.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { P as f, x as k, E as h, n as i, a as m } from "./element-G8JoS0Lj.js";
|
|
2
|
-
import { P as d } from "./pkt-slot-controller-D1DakVrU.js";
|
|
3
|
-
import { e as u, n as P } from "./ref-cRTOoM4R.js";
|
|
4
|
-
import { e as y } from "./class-map-ChuDQU5C.js";
|
|
5
|
-
import "./icon-BJnwW0eh.js";
|
|
6
|
-
const g = "pkt-link", v = !0, _ = {
|
|
7
|
-
href: {
|
|
8
|
-
name: "URL",
|
|
9
|
-
description: "URL til lenken",
|
|
10
|
-
type: "string",
|
|
11
|
-
default: "#"
|
|
12
|
-
},
|
|
13
|
-
target: {
|
|
14
|
-
name: "Mål",
|
|
15
|
-
description: "Mål for lenken",
|
|
16
|
-
type: [
|
|
17
|
-
"_blank",
|
|
18
|
-
"_self",
|
|
19
|
-
"_parent",
|
|
20
|
-
"_top"
|
|
21
|
-
],
|
|
22
|
-
default: "_self"
|
|
23
|
-
},
|
|
24
|
-
iconName: {
|
|
25
|
-
name: "Ikon",
|
|
26
|
-
description: "Ikon som skal vises ved siden av lenketeksten",
|
|
27
|
-
type: "icon"
|
|
28
|
-
},
|
|
29
|
-
iconPosition: {
|
|
30
|
-
name: "Ikonposisjon",
|
|
31
|
-
description: "Posisjonen til ikonet i forhold til lenketeksten",
|
|
32
|
-
type: [
|
|
33
|
-
"left",
|
|
34
|
-
"right"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
external: {
|
|
38
|
-
name: "Ekstern lenke",
|
|
39
|
-
description: "Vis ikon for ekstern lenke",
|
|
40
|
-
type: "boolean",
|
|
41
|
-
default: !1
|
|
42
|
-
}
|
|
43
|
-
}, x = {
|
|
44
|
-
default: {
|
|
45
|
-
description: "Innholdet i lenken"
|
|
46
|
-
}
|
|
47
|
-
}, c = {
|
|
48
|
-
name: g,
|
|
49
|
-
"css-class": "pkt-link",
|
|
50
|
-
"dark-mode": !0,
|
|
51
|
-
isElement: v,
|
|
52
|
-
props: _,
|
|
53
|
-
slots: x
|
|
54
|
-
};
|
|
55
|
-
var $ = Object.defineProperty, N = Object.getOwnPropertyDescriptor, n = (o, s, l, r) => {
|
|
56
|
-
for (var t = r > 1 ? void 0 : r ? N(s, l) : s, a = o.length - 1, p; a >= 0; a--)
|
|
57
|
-
(p = o[a]) && (t = (r ? p(s, l, t) : p(t)) || t);
|
|
58
|
-
return r && t && $(s, l, t), t;
|
|
59
|
-
};
|
|
60
|
-
let e = class extends f {
|
|
61
|
-
constructor() {
|
|
62
|
-
super(), this.defaultSlot = u(), this.href = c.props.href.default, this.iconName = void 0, this.iconPosition = void 0, this.external = c.props.external.default, this.target = c.props.target.default, this.slotController = new d(this, this.defaultSlot);
|
|
63
|
-
}
|
|
64
|
-
render() {
|
|
65
|
-
const o = {
|
|
66
|
-
"pkt-link": !0,
|
|
67
|
-
"pkt-link--icon-left": !!this.iconName && this.iconPosition === "left" || !!(this.iconName && !this.iconPosition),
|
|
68
|
-
"pkt-link--icon-right": !!this.iconName && this.iconPosition === "right",
|
|
69
|
-
"pkt-link--external": this.external
|
|
70
|
-
};
|
|
71
|
-
return k`<a
|
|
72
|
-
class=${y(o)}
|
|
73
|
-
href=${this.href}
|
|
74
|
-
@click=${this.handleClick}
|
|
75
|
-
.target=${this.target}
|
|
76
|
-
.rel=${this.external ? "noopener noreferrer" : h}
|
|
77
|
-
>${this.iconName ? k`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span ${P(this.defaultSlot)}>Link</span></a
|
|
78
|
-
>`;
|
|
79
|
-
}
|
|
80
|
-
handleClick() {
|
|
81
|
-
this.dispatchEvent(
|
|
82
|
-
new CustomEvent("click", {
|
|
83
|
-
detail: "pkt-link-clicked",
|
|
84
|
-
bubbles: !0
|
|
85
|
-
})
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
n([
|
|
90
|
-
i({ type: String, reflect: !0 })
|
|
91
|
-
], e.prototype, "href", 2);
|
|
92
|
-
n([
|
|
93
|
-
i({ type: String, reflect: !0 })
|
|
94
|
-
], e.prototype, "iconName", 2);
|
|
95
|
-
n([
|
|
96
|
-
i({ type: String, reflect: !0 })
|
|
97
|
-
], e.prototype, "iconPosition", 2);
|
|
98
|
-
n([
|
|
99
|
-
i({ type: Boolean, reflect: !0 })
|
|
100
|
-
], e.prototype, "external", 2);
|
|
101
|
-
n([
|
|
102
|
-
i({ type: String, reflect: !0 })
|
|
103
|
-
], e.prototype, "target", 2);
|
|
104
|
-
e = n([
|
|
105
|
-
m("pkt-link")
|
|
106
|
-
], e);
|
|
107
|
-
export {
|
|
108
|
-
e as P
|
|
109
|
-
};
|
package/dist/link-DOVlsg2S.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./element-BBo3JZk5.cjs"),k=require("./pkt-slot-controller-CqNvEpFd.cjs"),p=require("./ref-DsoUUoPU.cjs"),h=require("./class-map-D4rXyUxT.cjs");require("./icon-BTUCDPN5.cjs");const f="pkt-link",u=!0,d={href:{name:"URL",description:"URL til lenken",type:"string",default:"#"},target:{name:"Mål",description:"Mål for lenken",type:["_blank","_self","_parent","_top"],default:"_self"},iconName:{name:"Ikon",description:"Ikon som skal vises ved siden av lenketeksten",type:"icon"},iconPosition:{name:"Ikonposisjon",description:"Posisjonen til ikonet i forhold til lenketeksten",type:["left","right"]},external:{name:"Ekstern lenke",description:"Vis ikon for ekstern lenke",type:"boolean",default:!1}},m={default:{description:"Innholdet i lenken"}},c={name:f,"css-class":"pkt-link","dark-mode":!0,isElement:u,props:d,slots:m};var P=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(s,n,r,o)=>{for(var t=o>1?void 0:o?y(n,r):n,l=s.length-1,a;l>=0;l--)(a=s[l])&&(t=(o?a(n,r,t):a(t))||t);return o&&t&&P(n,r,t),t};exports.PktLink=class extends e.PktElement{constructor(){super(),this.defaultSlot=p.e(),this.href=c.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=c.props.external.default,this.target=c.props.target.default,this.slotController=new k.PktSlotController(this,this.defaultSlot)}render(){const n={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return e.x`<a
|
|
2
|
-
class=${h.e(n)}
|
|
3
|
-
href=${this.href}
|
|
4
|
-
@click=${this.handleClick}
|
|
5
|
-
.target=${this.target}
|
|
6
|
-
.rel=${this.external?"noopener noreferrer":e.E}
|
|
7
|
-
>${this.iconName?e.x`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${p.n(this.defaultSlot)}>Link</span></a
|
|
8
|
-
>`}handleClick(){this.dispatchEvent(new CustomEvent("click",{detail:"pkt-link-clicked",bubbles:!0}))}};i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);i([e.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);i([e.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=i([e.t("pkt-link")],exports.PktLink);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./element-BBo3JZk5.cjs"),b=require("./pkt-slot-controller-CqNvEpFd.cjs"),c=require("./ref-DsoUUoPU.cjs"),d=require("./class-map-D4rXyUxT.cjs"),k=require("./state-BILlRnrD.cjs");require("./icon-BTUCDPN5.cjs");const u=require("./classutils-BwNK82ZQ.cjs"),m="pkt-messagebox",g=!0,h={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},f={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},x={default:{description:"Innholdet i meldingsboksen"}},p={name:m,"css-class":"pkt-messagebox",isElement:g,events:h,props:f,slots:x};var v=Object.defineProperty,_=Object.getOwnPropertyDescriptor,o=(i,e,n,l)=>{for(var t=l>1?void 0:l?_(e,n):e,a=i.length-1,r;a>=0;a--)(r=i[a])&&(t=(l?r(e,n,t):r(t))||t);return l&&t&&v(e,n,t),t};exports.PktMessagebox=class extends s.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closable=p.props.closable.default,this.compact=p.props.compact.default,this.title="",this.skin=p.props.skin.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0}))},this.slotController=new b.PktSlotController(this,this.defaultSlot),this._isClosed=!1}updated(e){super.updated(e),e.has("_isClosed")&&u.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return s.x`<div class=${d.e(e)}>
|
|
2
|
-
${this.closable?s.x`<div class="pkt-messagebox__close">
|
|
3
|
-
<button
|
|
4
|
-
@click=${this.close}
|
|
5
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
6
|
-
>
|
|
7
|
-
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
8
|
-
</button>
|
|
9
|
-
</div>`:s.E}
|
|
10
|
-
${this.title?s.x`<div class="pkt-messagebox__title">${this.title}</div>`:s.E}
|
|
11
|
-
<div class="pkt-messagebox__text" ${c.n(this.defaultSlot)}></div>
|
|
12
|
-
</div>`}};o([s.n({type:Boolean,reflect:!0})],exports.PktMessagebox.prototype,"closable",2);o([s.n({type:Boolean,reflect:!0})],exports.PktMessagebox.prototype,"compact",2);o([s.n({type:String,reflect:!0})],exports.PktMessagebox.prototype,"title",2);o([s.n({type:String,reflect:!0})],exports.PktMessagebox.prototype,"skin",2);o([k.r()],exports.PktMessagebox.prototype,"_isClosed",2);exports.PktMessagebox=o([s.t("pkt-messagebox")],exports.PktMessagebox);
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { P as b, x as c, E as m, n, a as u } from "./element-G8JoS0Lj.js";
|
|
2
|
-
import { P as k } from "./pkt-slot-controller-D1DakVrU.js";
|
|
3
|
-
import { e as h, n as f } from "./ref-cRTOoM4R.js";
|
|
4
|
-
import { e as g } from "./class-map-ChuDQU5C.js";
|
|
5
|
-
import { r as v } from "./state-gfUuUqVg.js";
|
|
6
|
-
import "./icon-BJnwW0eh.js";
|
|
7
|
-
import { u as _ } from "./classutils-RQs1k6D9.js";
|
|
8
|
-
const x = "pkt-messagebox", y = !0, C = {
|
|
9
|
-
onClose: {
|
|
10
|
-
description: "React: Event som trigges når meldingsboksen lukkes"
|
|
11
|
-
},
|
|
12
|
-
"on-close": {
|
|
13
|
-
description: "Vue: Event som trigges når meldingsboksen lukkes"
|
|
14
|
-
}
|
|
15
|
-
}, E = {
|
|
16
|
-
title: {
|
|
17
|
-
name: "Tittel",
|
|
18
|
-
description: "Tittelen på meldingsboksen",
|
|
19
|
-
type: "string"
|
|
20
|
-
},
|
|
21
|
-
skin: {
|
|
22
|
-
name: "Utseende",
|
|
23
|
-
description: "Velg farge på meldingsboksen",
|
|
24
|
-
type: [
|
|
25
|
-
"beige",
|
|
26
|
-
"blue",
|
|
27
|
-
"red",
|
|
28
|
-
"green"
|
|
29
|
-
],
|
|
30
|
-
default: "beige"
|
|
31
|
-
},
|
|
32
|
-
compact: {
|
|
33
|
-
name: "Kompakt",
|
|
34
|
-
description: "Gjør meldingsboksen mindre",
|
|
35
|
-
type: "boolean",
|
|
36
|
-
default: !1
|
|
37
|
-
},
|
|
38
|
-
closable: {
|
|
39
|
-
name: "Kan lukkes",
|
|
40
|
-
description: "Viser lukkeknapp",
|
|
41
|
-
type: "boolean",
|
|
42
|
-
default: !1
|
|
43
|
-
}
|
|
44
|
-
}, P = {
|
|
45
|
-
default: {
|
|
46
|
-
description: "Innholdet i meldingsboksen"
|
|
47
|
-
}
|
|
48
|
-
}, d = {
|
|
49
|
-
name: x,
|
|
50
|
-
"css-class": "pkt-messagebox",
|
|
51
|
-
isElement: y,
|
|
52
|
-
events: C,
|
|
53
|
-
props: E,
|
|
54
|
-
slots: P
|
|
55
|
-
};
|
|
56
|
-
var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, o = (e, i, p, l) => {
|
|
57
|
-
for (var t = l > 1 ? void 0 : l ? S(i, p) : i, a = e.length - 1, r; a >= 0; a--)
|
|
58
|
-
(r = e[a]) && (t = (l ? r(i, p, t) : r(t)) || t);
|
|
59
|
-
return l && t && $(i, p, t), t;
|
|
60
|
-
};
|
|
61
|
-
let s = class extends b {
|
|
62
|
-
constructor() {
|
|
63
|
-
super(), this.defaultSlot = h(), this.closable = d.props.closable.default, this.compact = d.props.compact.default, this.title = "", this.skin = d.props.skin.default, this._isClosed = !1, this.close = (e) => {
|
|
64
|
-
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", { detail: { origin: e }, bubbles: !0 })), this.dispatchEvent(new CustomEvent("on-close", { detail: { origin: e }, bubbles: !0 }));
|
|
65
|
-
}, this.slotController = new k(this, this.defaultSlot), this._isClosed = !1;
|
|
66
|
-
}
|
|
67
|
-
// Lifecycle
|
|
68
|
-
updated(e) {
|
|
69
|
-
super.updated(e), e.has("_isClosed") && _(this, "pkt-hide", this._isClosed);
|
|
70
|
-
}
|
|
71
|
-
// Render
|
|
72
|
-
render() {
|
|
73
|
-
const e = {
|
|
74
|
-
"pkt-messagebox": !0,
|
|
75
|
-
"pkt-messagebox--compact": this.compact,
|
|
76
|
-
[`pkt-messagebox--${this.skin}`]: this.skin,
|
|
77
|
-
"pkt-messagebox--closable": this.closable,
|
|
78
|
-
"pkt-hide": this._isClosed
|
|
79
|
-
};
|
|
80
|
-
return c`<div class=${g(e)}>
|
|
81
|
-
${this.closable ? c`<div class="pkt-messagebox__close">
|
|
82
|
-
<button
|
|
83
|
-
@click=${this.close}
|
|
84
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
85
|
-
>
|
|
86
|
-
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
87
|
-
</button>
|
|
88
|
-
</div>` : m}
|
|
89
|
-
${this.title ? c`<div class="pkt-messagebox__title">${this.title}</div>` : m}
|
|
90
|
-
<div class="pkt-messagebox__text" ${f(this.defaultSlot)}></div>
|
|
91
|
-
</div>`;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
o([
|
|
95
|
-
n({ type: Boolean, reflect: !0 })
|
|
96
|
-
], s.prototype, "closable", 2);
|
|
97
|
-
o([
|
|
98
|
-
n({ type: Boolean, reflect: !0 })
|
|
99
|
-
], s.prototype, "compact", 2);
|
|
100
|
-
o([
|
|
101
|
-
n({ type: String, reflect: !0 })
|
|
102
|
-
], s.prototype, "title", 2);
|
|
103
|
-
o([
|
|
104
|
-
n({ type: String, reflect: !0 })
|
|
105
|
-
], s.prototype, "skin", 2);
|
|
106
|
-
o([
|
|
107
|
-
v()
|
|
108
|
-
], s.prototype, "_isClosed", 2);
|
|
109
|
-
s = o([
|
|
110
|
-
u("pkt-messagebox")
|
|
111
|
-
], s);
|
|
112
|
-
export {
|
|
113
|
-
s as P
|
|
114
|
-
};
|
package/dist/modal-CLixB4Dz.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("./class-map-D4rXyUxT.cjs"),s=require("./element-BBo3JZk5.cjs"),k=require("./state-BILlRnrD.cjs"),m=require("./pkt-slot-controller-CqNvEpFd.cjs"),r=require("./ref-DsoUUoPU.cjs");require("./icon-BTUCDPN5.cjs");const h="pkt-modal",g=!0,f={"background-click":{description:"Event som trigges når bakgrunnen trykkes på"},close:{description:"Event som trigges når meldingsboksen lukkes"}},v={headingText:{name:"Heading text",description:"Heading tekst på modalen",type:"string"},hideCloseButton:{name:"Gjem 'Lukk'-knapp",description:"Gjemmer lukkeknappen. Dersom denne er satt til true, vil ikke lukkeknappen vises, og dermed er det viktig at man tilbyr en annen måte som f.eks. en knapp for å lukke modalen på.",type:"boolean",default:!1},closeOnBackdropClick:{name:"Lukk modalen når bakgrunnen trykkes på",description:"Lukk modalen når bakgrunnen trykkes på",type:"boolean",default:!1},closeButtonSkin:{name:"Stil på lukkeknappen",description:"Stil på lukkeknappen",type:["blue","yellow-filled"],default:"blue"},size:{name:"Størrelse",description:"Størrelsen på modalen",type:["small","medium","large"],default:"medium"}},b={default:{description:"Innholdet i meldingen. Her tilbyr vi støtteklasser for å style 1-3 knapper i modalen."}},u={name:h,"css-class":"pkt-modal",isElements:g,events:f,props:v,slots:b};var y=Object.defineProperty,_=Object.getOwnPropertyDescriptor,l=(c,e,t,n)=>{for(var o=n>1?void 0:n?_(e,t):e,i=c.length-1,a;i>=0;i--)(a=c[i])&&(o=(n?a(e,t,o):a(o))||o);return n&&o&&y(e,t,o),o};exports.PktModal=class extends s.PktElement{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=u.props.hideCloseButton.default,this.closeOnBackdropClick=u.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=u.props.size.default,this.defaultSlot=r.e(),this.dialogRef=r.e(),this._isOpen=!1,this.close=(e,t=!1)=>{var o;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),t||(o=this.dialogRef.value)==null||o.close(),this.requestUpdate()},this.showModal=e=>{var n;this._isOpen=!0,(n=this.dialogRef.value)==null||n.showModal();const t=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var o;this.dialogRef.value&&((o=this.dialogRef.value)==null||o.focus())}),t&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new m.PktSlotController(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("click",this.handleBackdropClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,[`pkt-modal--${this.size}`]:this.size!==void 0},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},n={"pkt-modal__content":!0,"pkt-txt-18-light":!0},o=this.closeButtonSkin==="blue",i={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},a={"pkt-btn":!0,[`pkt-btn--${o?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return s.x`
|
|
2
|
-
<dialog
|
|
3
|
-
class=${d.e(e)}
|
|
4
|
-
${r.n(this.dialogRef)}
|
|
5
|
-
aria-labelledby="pkt-modal__headingText"
|
|
6
|
-
aria-describedby="pkt-modal__content"
|
|
7
|
-
@close=${p=>this.close(p,!0)}
|
|
8
|
-
>
|
|
9
|
-
<div class="pkt-modal__header">
|
|
10
|
-
<div class="pkt-modal__header-background"></div>
|
|
11
|
-
${this.headingText?s.x`<h1 id="pkt-modal__headingText" class=${d.e(t)}>
|
|
12
|
-
${this.headingText}
|
|
13
|
-
</h1>`:s.E}
|
|
14
|
-
${this.hideCloseButton?s.E:s.x`<div class="${d.e(i)}">
|
|
15
|
-
<pkt-button
|
|
16
|
-
@click=${p=>this.close(p)}
|
|
17
|
-
class=${d.e(a)}
|
|
18
|
-
aria-label="close"
|
|
19
|
-
iconname="close"
|
|
20
|
-
variant="icon-only"
|
|
21
|
-
>
|
|
22
|
-
</pkt-button>
|
|
23
|
-
</div>`}
|
|
24
|
-
</div>
|
|
25
|
-
<div class="pkt-modal__container">
|
|
26
|
-
<div
|
|
27
|
-
id="pkt-modal__content"
|
|
28
|
-
class=${d.e(n)}
|
|
29
|
-
${r.n(this.defaultSlot)}
|
|
30
|
-
></div>
|
|
31
|
-
</div>
|
|
32
|
-
</dialog>
|
|
33
|
-
`}};l([s.n({type:String,reflect:!0})],exports.PktModal.prototype,"headingText",2);l([s.n({type:Boolean,reflect:!0})],exports.PktModal.prototype,"removePadding",2);l([s.n({type:Boolean,reflect:!0})],exports.PktModal.prototype,"hideCloseButton",2);l([s.n({type:Boolean,reflect:!0})],exports.PktModal.prototype,"closeOnBackdropClick",2);l([s.n({type:String,reflect:!0})],exports.PktModal.prototype,"closeButtonSkin",2);l([s.n({type:String,reflect:!0})],exports.PktModal.prototype,"size",2);l([k.r()],exports.PktModal.prototype,"_isOpen",2);exports.PktModal=l([s.t("pkt-modal")],exports.PktModal);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function a(s,e){return e.some(t=>t.value===s)}function d(s,e){var t;return s.hasAttribute("data-skip")?[]:s===((t=e.value)==null?void 0:t.parentNode)?[]:s instanceof HTMLTemplateElement?Array.from(s.content.childNodes):[s]}function h(s){return typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function r(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function u(s,e){return s.nodeType===Node.ELEMENT_NODE&&!a(s,e)}function f(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}class c{constructor(e,...t){this.nodes=[],this.filledSlots=new Set,this.skipOptions=!1,this.updatingSlots=!1,this.host=e,this.host.addController(this),this.slots=t,this.nodes=[],this.observer=new MutationObserver(o=>this.handleMutations(o)),this.contentObserver=new MutationObserver(o=>this.handleSlotMutations(o))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0}),this.contentObserver.observe(this.host,{childList:!0,subtree:!0})}hostDisconnected(){this.observer.disconnect(),this.contentObserver.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(t=>{var o;if(!h(t)&&!(r(t)&&this.skipOptions))if(t.nodeType===Node.TEXT_NODE&&((o=t.nodeValue)!=null&&o.trim())){const i=document==null?void 0:document.createElement("template");i.content.appendChild(t),this.nodes.push(i)}else a(t,this.slots)||this.nodes.push(t)})}updateSlots(){if(this.updatingSlots)return;this.updatingSlots=!0;const e=new Set;this.slots.forEach(t=>{if(!t.value)return;const o=t.value.getAttribute("name"),l=this.nodes.flatMap(n=>n.getAttribute&&n.getAttribute("slot")==o&&!n.hasAttribute("data-skip")?d(n,t):[]).filter(n=>t.value&&!t.value.contains(n)&&!n.contains(t.value));if(l.length>0)if(e.add(o),typeof t.value.replaceChildren!="function"){for(;t.value.firstChild;)t.value.removeChild(t.value.firstChild);t.value.append(...l)}else t.value.replaceChildren(...l)}),(this.filledSlots.size!==e.size||![...this.filledSlots].every(t=>e.has(t)))&&(this.filledSlots=e,Array.from(this.filledSlots).length&&!(Array.from(this.filledSlots).length===1&&Array.from(this.filledSlots)[0]!==null)&&this.host.requestUpdate()),this.updatingSlots=!1}handleMutations(e){let t=!1;e.forEach(o=>{o.type==="childList"&&(o.addedNodes.forEach(i=>{if(!h(i)&&!(r(i)&&this.skipOptions)){if(u(i,this.slots))this.nodes.push(i),t=!0;else if(f(i)){const l=document==null?void 0:document.createElement("template");l.content.appendChild(i),this.nodes.push(l),t=!0}}}),o.removedNodes.forEach(i=>{h(i)||r(i)&&this.skipOptions||(this.nodes=this.nodes.filter(l=>l!==i),t=!0)}))}),t&&this.updateSlots()}handleSlotMutations(e){let t=!1;e.forEach(o=>{const i=o.target.parentElement;if(i!=null&&i.hasAttribute("slot")){const l=i.getAttribute("slot"),n=i.hasChildNodes();n&&!this.filledSlots.has(l)?(this.filledSlots.add(l),t=!0):!n&&this.filledSlots.has(l)&&(this.filledSlots.delete(l),t=!0)}}),t&&typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)}}exports.PktSlotController=c;exports.isOptionElement=r;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
function a(s, e) {
|
|
2
|
-
return e.some((t) => t.value === s);
|
|
3
|
-
}
|
|
4
|
-
function d(s, e) {
|
|
5
|
-
var t;
|
|
6
|
-
return s.hasAttribute("data-skip") ? [] : s === ((t = e.value) == null ? void 0 : t.parentNode) ? [] : s instanceof HTMLTemplateElement ? Array.from(s.content.childNodes) : [s];
|
|
7
|
-
}
|
|
8
|
-
function r(s) {
|
|
9
|
-
return typeof s.hasAttribute == "function" && s.hasAttribute("data-skip");
|
|
10
|
-
}
|
|
11
|
-
function h(s) {
|
|
12
|
-
return s.nodeName === "OPTION" || s.nodeName === "DATA";
|
|
13
|
-
}
|
|
14
|
-
function u(s, e) {
|
|
15
|
-
return s.nodeType === Node.ELEMENT_NODE && !a(s, e);
|
|
16
|
-
}
|
|
17
|
-
function f(s) {
|
|
18
|
-
var e;
|
|
19
|
-
return s.nodeType === Node.TEXT_NODE && ((e = s.nodeValue) == null ? void 0 : e.trim()) !== "";
|
|
20
|
-
}
|
|
21
|
-
class c {
|
|
22
|
-
constructor(e, ...t) {
|
|
23
|
-
this.nodes = [], this.filledSlots = /* @__PURE__ */ new Set(), this.skipOptions = !1, this.updatingSlots = !1, this.host = e, this.host.addController(this), this.slots = t, this.nodes = [], this.observer = new MutationObserver((o) => this.handleMutations(o)), this.contentObserver = new MutationObserver((o) => this.handleSlotMutations(o));
|
|
24
|
-
}
|
|
25
|
-
hostConnected() {
|
|
26
|
-
this.updateNodes(), this.observer.observe(this.host, { childList: !0 }), this.contentObserver.observe(this.host, { childList: !0, subtree: !0 });
|
|
27
|
-
}
|
|
28
|
-
hostDisconnected() {
|
|
29
|
-
this.observer.disconnect(), this.contentObserver.disconnect();
|
|
30
|
-
}
|
|
31
|
-
hostUpdated() {
|
|
32
|
-
this.updateSlots();
|
|
33
|
-
}
|
|
34
|
-
updateNodes() {
|
|
35
|
-
this.nodes = [], Array.from(this.host.childNodes).forEach((t) => {
|
|
36
|
-
var o;
|
|
37
|
-
if (!r(t) && !(h(t) && this.skipOptions))
|
|
38
|
-
if (t.nodeType === Node.TEXT_NODE && ((o = t.nodeValue) != null && o.trim())) {
|
|
39
|
-
const i = document == null ? void 0 : document.createElement("template");
|
|
40
|
-
i.content.appendChild(t), this.nodes.push(i);
|
|
41
|
-
} else a(t, this.slots) || this.nodes.push(t);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
updateSlots() {
|
|
45
|
-
if (this.updatingSlots) return;
|
|
46
|
-
this.updatingSlots = !0;
|
|
47
|
-
const e = /* @__PURE__ */ new Set();
|
|
48
|
-
this.slots.forEach((t) => {
|
|
49
|
-
if (!t.value) return;
|
|
50
|
-
const o = t.value.getAttribute("name"), l = this.nodes.flatMap(
|
|
51
|
-
(n) => n.getAttribute && n.getAttribute("slot") == o && !n.hasAttribute("data-skip") ? d(n, t) : []
|
|
52
|
-
).filter(
|
|
53
|
-
(n) => t.value && !t.value.contains(n) && !n.contains(t.value)
|
|
54
|
-
);
|
|
55
|
-
if (l.length > 0)
|
|
56
|
-
if (e.add(o), typeof t.value.replaceChildren != "function") {
|
|
57
|
-
for (; t.value.firstChild; )
|
|
58
|
-
t.value.removeChild(t.value.firstChild);
|
|
59
|
-
t.value.append(...l);
|
|
60
|
-
} else
|
|
61
|
-
t.value.replaceChildren(...l);
|
|
62
|
-
}), (this.filledSlots.size !== e.size || ![...this.filledSlots].every((t) => e.has(t))) && (this.filledSlots = e, Array.from(this.filledSlots).length && !(Array.from(this.filledSlots).length === 1 && Array.from(this.filledSlots)[0] !== null) && this.host.requestUpdate()), this.updatingSlots = !1;
|
|
63
|
-
}
|
|
64
|
-
handleMutations(e) {
|
|
65
|
-
let t = !1;
|
|
66
|
-
e.forEach((o) => {
|
|
67
|
-
o.type === "childList" && (o.addedNodes.forEach((i) => {
|
|
68
|
-
if (!r(i) && !(h(i) && this.skipOptions)) {
|
|
69
|
-
if (u(i, this.slots))
|
|
70
|
-
this.nodes.push(i), t = !0;
|
|
71
|
-
else if (f(i)) {
|
|
72
|
-
const l = document == null ? void 0 : document.createElement("template");
|
|
73
|
-
l.content.appendChild(i), this.nodes.push(l), t = !0;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}), o.removedNodes.forEach((i) => {
|
|
77
|
-
r(i) || h(i) && this.skipOptions || (this.nodes = this.nodes.filter((l) => l !== i), t = !0);
|
|
78
|
-
}));
|
|
79
|
-
}), t && this.updateSlots();
|
|
80
|
-
}
|
|
81
|
-
handleSlotMutations(e) {
|
|
82
|
-
let t = !1;
|
|
83
|
-
e.forEach((o) => {
|
|
84
|
-
const i = o.target.parentElement;
|
|
85
|
-
if (i != null && i.hasAttribute("slot")) {
|
|
86
|
-
const l = i.getAttribute("slot"), n = i.hasChildNodes();
|
|
87
|
-
n && !this.filledSlots.has(l) ? (this.filledSlots.add(l), t = !0) : !n && this.filledSlots.has(l) && (this.filledSlots.delete(l), t = !0);
|
|
88
|
-
}
|
|
89
|
-
}), t && typeof this.host.updateSlots == "function" && this.host.updateSlots(this.filledSlots);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
export {
|
|
93
|
-
c as P,
|
|
94
|
-
h as i
|
|
95
|
-
};
|
package/dist/tag-DThwKsrg.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("./class-map-D4rXyUxT.cjs"),t=require("./element-BBo3JZk5.cjs"),g=require("./state-BILlRnrD.cjs"),d=require("./pkt-slot-controller-CqNvEpFd.cjs"),c=require("./ref-DsoUUoPU.cjs");require("./icon-BTUCDPN5.cjs");const h=require("./if-defined-C1ZDVzYn.cjs"),k="pkt-tag",f=!0,y={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"icon",required:!1},skin:{required:!1,default:"blue",type:["blue","blue-light","blue-dark","green","red","beige","yellow","gray"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1}},b={default:{description:"Teksten til tag"}},l={name:k,"css-class":"pkt-tag",isElement:f,props:y,slots:b};var m=Object.defineProperty,T=Object.getOwnPropertyDescriptor,i=(o,e,a,r)=>{for(var s=r>1?void 0:r?T(e,a):e,n=o.length-1,p;n>=0;n--)(p=o[n])&&(s=(r?p(e,a,s):p(s))||s);return r&&s&&m(e,a,s),s};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=l.props.closeTag.default,this.size=l.props.size.default,this.skin=l.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=l.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,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.slotController=new d.PktSlotController(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var a,r;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const s=(r=(a=this.defaultSlot.value)==null?void 0:a.textContent)==null?void 0:r.trim();s&&(this._ariaDescription=`Klikk for å fjerne ${s}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
|
|
2
|
-
<button
|
|
3
|
-
class=${u.e(a)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
@click=${this.close}
|
|
6
|
-
aria-label=${h.o(this.ariaLabel||void 0)}
|
|
7
|
-
aria-description=${h.o(this._ariaDescription||void 0)}
|
|
8
|
-
>
|
|
9
|
-
${this.iconName&&t.x`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
10
|
-
<span ${c.n(this.defaultSlot)}></span>
|
|
11
|
-
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
12
|
-
</button>
|
|
13
|
-
`:t.x`
|
|
14
|
-
<span class=${u.e(e)}>
|
|
15
|
-
${this.iconName&&t.x`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
16
|
-
<span ${c.n(this.defaultSlot)}></span>
|
|
17
|
-
</span>
|
|
18
|
-
`}};i([t.n({type:Boolean,reflect:!0})],exports.PktTag.prototype,"closeTag",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"size",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"skin",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"textStyle",2);i([t.n({type:String,reflect:!0})],exports.PktTag.prototype,"iconName",2);i([t.n({type:String})],exports.PktTag.prototype,"type",2);i([t.n({type:String})],exports.PktTag.prototype,"ariaLabel",2);i([g.r()],exports.PktTag.prototype,"_isClosed",2);i([g.r()],exports.PktTag.prototype,"_ariaDescription",2);exports.PktTag=i([t.t("pkt-tag")],exports.PktTag);
|