nve-designsystem 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/chunk.2PCBEMQZ.js +163 -226
- package/chunks/chunk.36O46B5H.js +15 -15
- package/chunks/chunk.4TUIT776.js +78 -96
- package/chunks/chunk.5JY5FUCG.js +965 -1245
- package/chunks/chunk.5P45LHIX.js +668 -96
- package/chunks/chunk.6CTB5ZDJ.js +107 -100
- package/chunks/chunk.B4BZKR24.js +29 -39
- package/chunks/chunk.D5YQDJ7X.js +122 -166
- package/chunks/chunk.EA437WHD.js +5 -5
- package/chunks/chunk.GI7VDIWX.js +14 -15
- package/chunks/chunk.GMYPQTFK.js +18 -20
- package/chunks/chunk.HVTXQL7M.js +191 -215
- package/chunks/chunk.IKV4VH3T.js +18 -16
- package/chunks/chunk.IVVHNXMC.js +26 -27
- package/chunks/chunk.JHOXTQXA.js +65 -74
- package/chunks/chunk.JXOKFADN.js +63 -90
- package/chunks/chunk.K7JGTRV7.js +24 -23
- package/chunks/chunk.KPLQLAWP.js +132 -147
- package/chunks/chunk.LD4M4QGE.js +61 -74
- package/chunks/chunk.MSKEYBDI.js +53 -71
- package/chunks/chunk.NYIIDP5N.js +39 -45
- package/chunks/chunk.RWUUFNUL.js +91 -114
- package/chunks/chunk.SAPQLUO4.js +249 -228
- package/chunks/chunk.SI4ACBFK.js +139 -5
- package/chunks/chunk.TP2GB2HO.js +361 -460
- package/chunks/chunk.UDWRA64J.js +185 -223
- package/chunks/chunk.URTPIBTY.js +119 -151
- package/chunks/chunk.VESXC477.js +63 -66
- package/chunks/chunk.XA43ZQPC.js +198 -313
- package/chunks/chunk.XQ2OKYYA.js +25 -26
- package/chunks/chunk.XZNBUGX7.js +6 -6
- package/chunks/chunk.YHLNUJ7P.js +93 -116
- package/chunks/chunk.ZH2AND3P.js +340 -399
- package/chunks/chunk.ZL53POKZ.js +61 -156
- package/chunks/chunk.js +20 -0
- package/chunks/class-map.js +49 -45
- package/chunks/decorate.js +105 -0
- package/chunks/directive-helpers.js +5 -7
- package/chunks/if-defined.js +5 -5
- package/chunks/lit.js +525 -0
- package/chunks/live.js +24 -24
- package/chunks/nve-alert.component.js +163 -0
- package/chunks/nve-carousel-item.component.js +36 -0
- package/chunks/nve-carousel.component.js +41 -0
- package/chunks/nve-checkbox-group.component.js +114 -0
- package/chunks/nve-checkbox.component.js +28 -0
- package/chunks/nve-dialog.component.js +39 -0
- package/chunks/nve-divider.component.js +23 -0
- package/chunks/nve-drawer.component.js +40 -0
- package/chunks/nve-dropdown.component.js +83 -0
- package/chunks/nve-input.component.js +80 -0
- package/chunks/nve-label.component.js +89 -0
- package/chunks/nve-menu-item.component.js +35 -0
- package/chunks/nve-menu.component.js +17 -0
- package/chunks/nve-option.component.js +27 -0
- package/chunks/nve-popup.component.js +15 -0
- package/chunks/nve-radio-button.component.js +20 -0
- package/chunks/nve-radio-group.component.js +78 -0
- package/chunks/nve-radio.component.js +18 -0
- package/chunks/nve-select.component.js +58 -0
- package/chunks/nve-skeleton.component.js +20 -0
- package/chunks/nve-spinner.component.js +23 -0
- package/chunks/nve-tooltip.component.js +20 -0
- package/chunks/nve-warning-level.component.js +57 -0
- package/chunks/ref.js +75 -84
- package/chunks/shoelace.js +10006 -0
- package/chunks/static-html.js +27 -0
- package/chunks/unsafe-html.js +24 -20
- package/chunks/updateInvalidProperty.js +7 -7
- package/chunks/watch.js +20 -20
- package/components/nve-accordion/nve-accordion.component.js +24 -30
- package/components/nve-accordion-item/nve-accordion-item.component.js +30 -64
- package/components/nve-accordion-item/nve-accordion-item.styles.js +5 -5
- package/components/nve-alert/nve-alert.component.js +2 -227
- package/components/nve-alert/nve-alert.styles.js +45 -27
- package/components/nve-badge/nve-badge.component.js +41 -45
- package/components/nve-badge/nve-badge.styles.js +33 -31
- package/components/nve-button/nve-button.component.d.ts +110 -10
- package/components/nve-button/nve-button.component.js +146 -39
- package/components/nve-button/nve-button.styles.js +214 -157
- package/components/nve-carousel/nve-carousel.component.js +2 -47
- package/components/nve-carousel/nve-carousel.styles.js +6 -6
- package/components/nve-carousel-item/nve-carousel-item.component.js +2 -40
- package/components/nve-carousel-item/nve-carousel-item.styles.js +5 -5
- package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.component.js +44 -54
- package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.styles.js +5 -5
- package/components/nve-checkbox/nve-checkbox.component.js +2 -34
- package/components/nve-checkbox/nve-checkbox.styles.js +7 -7
- package/components/nve-checkbox-group/nve-checkbox-group.component.js +2 -152
- package/components/nve-checkbox-group/nve-checkbox-group.styles.js +5 -5
- package/components/nve-combobox/nve-combobox.component.js +222 -440
- package/components/nve-combobox/nve-combobox.styles.js +6 -6
- package/components/nve-darkmode-switch/nve-darkmode-switch.component.js +32 -38
- package/components/nve-dialog/nve-dialog-styles.js +6 -6
- package/components/nve-dialog/nve-dialog.component.js +2 -54
- package/components/nve-divider/nve-divider.component.js +2 -30
- package/components/nve-drawer/nve-drawer.component.js +2 -44
- package/components/nve-drawer/nve-drawer.styles.js +6 -6
- package/components/nve-dropdown/nve-dropdown.component.js +2 -79
- package/components/nve-dropdown/nve-dropdown.styles.js +5 -5
- package/components/nve-heading/nve-heading.component.d.ts +29 -0
- package/components/nve-heading/nve-heading.component.js +45 -0
- package/components/nve-heading/nve-heading.styles.d.ts +2 -0
- package/components/nve-heading/nve-heading.styles.js +41 -0
- package/components/nve-icon/nve-icon.component.js +145 -164
- package/components/nve-icon/nve-icon.styles.js +11 -6
- package/components/nve-icon/offline-icons.js +16 -13
- package/components/nve-input/nve-input.component.js +2 -100
- package/components/nve-input/nve-input.styles.js +5 -5
- package/components/nve-label/nve-label.component.js +2 -115
- package/components/nve-label/nve-label.styles.js +5 -5
- package/components/nve-link-card/nve-link-card.component.d.ts +5 -2
- package/components/nve-link-card/nve-link-card.component.js +44 -80
- package/components/nve-link-card/nve-link-card.styles.js +71 -66
- package/components/nve-menu/nve-menu.component.js +2 -22
- package/components/nve-menu/nve-menu.styles.js +5 -5
- package/components/nve-menu-item/nve-menu-item.component.js +2 -43
- package/components/nve-menu-item/nve-menu-item.styles.js +7 -7
- package/components/nve-message-card/nve-message-card.component.js +61 -91
- package/components/nve-message-card/nve-message-card.styles.js +24 -27
- package/components/nve-navigation-card/nve-navigation-card.component.d.ts +52 -0
- package/components/nve-navigation-card/nve-navigation-card.component.js +60 -0
- package/components/nve-navigation-card/nve-navigation-card.styles.d.ts +2 -0
- package/components/nve-navigation-card/nve-navigation-card.styles.js +112 -0
- package/components/nve-option/nve-option.component.js +2 -41
- package/components/nve-option/nve-option.styles.js +5 -5
- package/components/nve-paragraph/nve-paragraph.component.d.ts +26 -0
- package/components/nve-paragraph/nve-paragraph.component.js +26 -0
- package/components/nve-paragraph/nve-paragraph.styles.d.ts +2 -0
- package/components/nve-paragraph/nve-paragraph.styles.js +105 -0
- package/components/nve-popup/nve-popup.component.js +2 -22
- package/components/nve-radio/nve-radio.component.js +2 -23
- package/components/nve-radio/nve-radio.styles.js +5 -5
- package/components/nve-radio-button/nve-radio-button.component.js +2 -25
- package/components/nve-radio-button/nve-radio-button.styles.js +5 -5
- package/components/nve-radio-group/nve-radio-group.component.js +2 -119
- package/components/nve-radio-group/nve-radio-group.styles.js +5 -5
- package/components/nve-relative-time/nve-relative-time.component.js +21 -56
- package/components/nve-relative-time/nve-relative-time.styles.js +5 -5
- package/components/nve-select/nve-select.component.js +2 -80
- package/components/nve-select/nve-select.styles.js +6 -6
- package/components/nve-skeleton/nve-skeleton.component.js +2 -27
- package/components/nve-skeleton/nve-skeleton.styles.js +5 -5
- package/components/nve-spinner/nve-spinner.component.js +2 -31
- package/components/nve-stepper/nve-step/nve-step.component.js +113 -173
- package/components/nve-stepper/nve-step/nve-step.styles.js +12 -12
- package/components/nve-stepper/nve-stepper-mobile.component.js +37 -49
- package/components/nve-stepper/nve-stepper-mobile.styles.js +7 -7
- package/components/nve-stepper/nve-stepper.component.js +94 -139
- package/components/nve-stepper/nve-stepper.styles.js +5 -5
- package/components/nve-switch/nve-switch.component.js +75 -107
- package/components/nve-switch/nve-switch.styles.js +7 -7
- package/components/nve-tab/nve-tab.component.js +30 -42
- package/components/nve-tab/nve-tab.styles.js +7 -7
- package/components/nve-tab-group/nve-tab-group.component.js +180 -260
- package/components/nve-tab-group/nve-tab-group.styles.js +5 -5
- package/components/nve-tab-panel/nve-tab-panel.component.js +21 -31
- package/components/nve-tab-panel/nve-tab-panel.styles.js +5 -5
- package/components/nve-tag/nve-tag.component.d.ts +3 -3
- package/components/nve-tag/nve-tag.component.js +71 -72
- package/components/nve-tag/nve-tag.styles.js +23 -22
- package/components/nve-textarea/nve-textarea.component.d.ts +3 -1
- package/components/nve-textarea/nve-textarea.component.js +112 -173
- package/components/nve-textarea/nve-textarea.styles.js +10 -5
- package/components/nve-tooltip/nve-tooltip.component.js +2 -30
- package/components/nve-tooltip/nve-tooltip.styles.js +5 -5
- package/components/nve-warning-level/nve-warning-level.component.js +2 -78
- package/components/nve-warning-level/nve-warning-level.styles.js +7 -7
- package/css/global.css +13 -55
- package/css/nve.css +1048 -393
- package/css/nve_dark.css +406 -305
- package/css/rme.css +1050 -395
- package/css/rme_dark.css +408 -307
- package/css/shoelace-styles.css +539 -0
- package/css/varsom.css +1046 -391
- package/css/varsom_dark.css +404 -303
- package/custom-elements.json +2905 -12389
- package/fonts/LICENSE.txt +37 -0
- package/fonts/SourceSans3-VariableFont_wght.woff2 +0 -0
- package/interfaces/NveComponent.interface.js +0 -1
- package/nve-designsystem.d.ts +5 -0
- package/nve-designsystem.js +46 -86
- package/package.json +26 -8
- package/registerIcons/systemLibraryCustomization.js +23 -91
- package/vite-env.d.js +0 -1
- package/chunks/chunk.3RPBFEDE.js +0 -162
- package/chunks/chunk.JCXLDPQF.js +0 -225
- package/chunks/chunk.JQBT7BOV.js +0 -8446
- package/chunks/chunk.MAQXLKQ7.js +0 -598
- package/chunks/lit-element.js +0 -508
- package/chunks/property.js +0 -37
- package/chunks/query.js +0 -13
- package/chunks/state.js +0 -7
- package/chunks/static.js +0 -26
- package/nve-designsystem.css +0 -1
- package/vscode.css-custom-data.json +0 -621
- package/vscode.html-custom-data.json +0 -2354
|
@@ -1,47 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
4
|
-
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
5
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
6
|
-
import m from "./nve-carousel.styles.js";
|
|
7
|
-
var p = Object.defineProperty, h = Object.getOwnPropertyDescriptor, l = (t, r, a, o) => {
|
|
8
|
-
for (var e = o > 1 ? void 0 : o ? h(r, a) : r, n = t.length - 1, i; n >= 0; n--)
|
|
9
|
-
(i = t[n]) && (e = (o ? i(r, a, e) : i(e)) || e);
|
|
10
|
-
return o && e && p(r, a, e), e;
|
|
11
|
-
};
|
|
12
|
-
let s = class extends u {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(), this.testId = void 0, this.paginationCounter = !1;
|
|
15
|
-
}
|
|
16
|
-
/* Overskrive metoden fra shoelace, slik den ser etter nve-carousel-item isteden for sl-carousel-item */
|
|
17
|
-
// @ts-expect-error overskriver private method
|
|
18
|
-
isCarouselItem(t) {
|
|
19
|
-
return t instanceof Element && t.tagName.toLowerCase() === "nve-carousel-item";
|
|
20
|
-
}
|
|
21
|
-
firstUpdated() {
|
|
22
|
-
super.firstUpdated();
|
|
23
|
-
const t = this.querySelectorAll("nve-carousel-item:not([data-clone])").length;
|
|
24
|
-
this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-num-items", t.toString()), this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-active-item", "1"), this.addEventListener("sl-slide-change", this.handeSlideChange.bind(this));
|
|
25
|
-
}
|
|
26
|
-
updated(t) {
|
|
27
|
-
super.updated(t);
|
|
28
|
-
const r = this.querySelectorAll("nve-carousel-item:not([data-clone])").length;
|
|
29
|
-
this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-num-items", r.toString());
|
|
30
|
-
}
|
|
31
|
-
handeSlideChange(t) {
|
|
32
|
-
this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-active-item", (t.detail.index + 1).toString());
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
s.styles = [u.styles, m];
|
|
36
|
-
l([
|
|
37
|
-
d({ reflect: !0, type: String })
|
|
38
|
-
], s.prototype, "testId", 2);
|
|
39
|
-
l([
|
|
40
|
-
d({ reflect: !0, type: Boolean })
|
|
41
|
-
], s.prototype, "paginationCounter", 2);
|
|
42
|
-
s = l([
|
|
43
|
-
c("nve-carousel")
|
|
44
|
-
], s);
|
|
45
|
-
export {
|
|
46
|
-
s as default
|
|
47
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-carousel.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-carousel/nve-carousel.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host::part(base) {
|
|
4
5
|
gap: 0rem 10px;
|
|
5
6
|
}
|
|
@@ -29,7 +30,7 @@ const o = a`
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
:host::part(navigation-button):hover {
|
|
32
|
-
background-color: var(--color-interactive-secondary-
|
|
33
|
+
background-color: var(--color-interactive-background-secondary-hover);
|
|
33
34
|
opacity: 70%;
|
|
34
35
|
transition: 0.3s;
|
|
35
36
|
color: var(--color-neutrals-background-primary);
|
|
@@ -64,6 +65,5 @@ const o = a`
|
|
|
64
65
|
background-color: var(--color-neutrals-background-primary);
|
|
65
66
|
}
|
|
66
67
|
`;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { t as default };
|
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { c as u } from "../../chunks/chunk.IKV4VH3T.js";
|
|
4
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
5
|
-
import f from "./nve-carousel-item.styles.js";
|
|
6
|
-
var m = Object.defineProperty, v = Object.getOwnPropertyDescriptor, c = (e, s, o, i) => {
|
|
7
|
-
for (var t = i > 1 ? void 0 : i ? v(s, o) : s, p = e.length - 1, l; p >= 0; p--)
|
|
8
|
-
(l = e[p]) && (t = (i ? l(s, o, t) : l(t)) || t);
|
|
9
|
-
return i && t && m(s, o, t), t;
|
|
10
|
-
};
|
|
11
|
-
let r = class extends u {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(), this.testId = void 0, this.description = "";
|
|
14
|
-
}
|
|
15
|
-
updated(e) {
|
|
16
|
-
super.updated(e), e.has("description") && this.style.setProperty("--nve-carousel-description", `"${this.description}"`);
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
return d`
|
|
20
|
-
<slot></slot>
|
|
21
|
-
${this.description ? d`
|
|
22
|
-
<div class="carousel-item__description">
|
|
23
|
-
<p>${this.description}</p>
|
|
24
|
-
</div>` : ""}
|
|
25
|
-
`;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
r.styles = [u.styles, f];
|
|
29
|
-
c([
|
|
30
|
-
n({ reflect: !0, type: String })
|
|
31
|
-
], r.prototype, "testId", 2);
|
|
32
|
-
c([
|
|
33
|
-
n({ type: String, reflect: !0 })
|
|
34
|
-
], r.prototype, "description", 2);
|
|
35
|
-
r = c([
|
|
36
|
-
a("nve-carousel-item")
|
|
37
|
-
], r);
|
|
38
|
-
export {
|
|
39
|
-
r as default
|
|
40
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-carousel-item.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-carousel-item/nve-carousel-item.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host(nve-carousel-item) {
|
|
4
5
|
aspect-ratio: 16/9;
|
|
5
6
|
object-fit: contain;
|
|
@@ -17,6 +18,5 @@ const r = o`
|
|
|
17
18
|
padding: 0 var(--spacing-medium);
|
|
18
19
|
}
|
|
19
20
|
`;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as default };
|
|
@@ -1,61 +1,51 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { n as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(a) => a instanceof HTMLImageElement && a.classList.contains("thumbnail__image")
|
|
35
|
-
), s = t.detail.index, o = e[s];
|
|
36
|
-
e?.forEach((a) => a.classList.remove("thumbnail__image--active")), o?.classList.add("thumbnail__image--active");
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
return u`
|
|
1
|
+
import { a as e, t } from "../../chunks/lit.js";
|
|
2
|
+
import { o as n, s as r, t as i } from "../../chunks/decorate.js";
|
|
3
|
+
import a from "./nve-carousel-thumbnail.styles.js";
|
|
4
|
+
//#region src/components/nve-carousel-thumbnail/nve-carousel-thumbnail.component.ts
|
|
5
|
+
var o = class extends t {
|
|
6
|
+
static {
|
|
7
|
+
this.styles = [a];
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super(), this.testId = void 0, this.carouselId = void 0;
|
|
11
|
+
}
|
|
12
|
+
handleSlotChange() {
|
|
13
|
+
let e = (this.shadowRoot?.querySelector("slot"))?.assignedNodes({ flatten: !0 });
|
|
14
|
+
e.forEach((e) => {
|
|
15
|
+
e instanceof HTMLImageElement && e.classList.add("thumbnail__image");
|
|
16
|
+
}), e.filter((e) => e instanceof HTMLImageElement)[0].classList.add("thumbnail__image--active");
|
|
17
|
+
}
|
|
18
|
+
handleClick(e) {
|
|
19
|
+
if (!this.carouselId) return;
|
|
20
|
+
let t = document.getElementById(this.carouselId), n = e.target, r = (this.shadowRoot?.querySelector("slot"))?.assignedNodes({ flatten: !0 }).filter((e) => e instanceof HTMLImageElement && e.classList.contains("thumbnail__image"));
|
|
21
|
+
if (n.matches(".thumbnail__image") && r && t) {
|
|
22
|
+
let e = r.indexOf(n);
|
|
23
|
+
t.goToSlide(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
firstUpdated() {
|
|
27
|
+
this.carouselId && document.getElementById(this.carouselId).addEventListener("sl-slide-change", (e) => {
|
|
28
|
+
let t = (this.shadowRoot?.querySelector("slot"))?.assignedNodes({ flatten: !0 }).filter((e) => e instanceof HTMLImageElement && e.classList.contains("thumbnail__image")), n = t[e.detail.index];
|
|
29
|
+
t?.forEach((e) => e.classList.remove("thumbnail__image--active")), n?.classList.add("thumbnail__image--active");
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return e`
|
|
41
34
|
<div class="thumbnail">
|
|
42
35
|
<div class="thumbnail__scroller" @click="${this.handleClick}">
|
|
43
36
|
<slot @slotchange="${this.handleSlotChange}"></slot>
|
|
44
37
|
</div>
|
|
45
38
|
</div>
|
|
46
39
|
`;
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
n.styles = [h];
|
|
50
|
-
r([
|
|
51
|
-
c({ reflect: !0, type: String })
|
|
52
|
-
], n.prototype, "testId", 2);
|
|
53
|
-
r([
|
|
54
|
-
c({ reflect: !0, type: String })
|
|
55
|
-
], n.prototype, "carouselId", 2);
|
|
56
|
-
n = r([
|
|
57
|
-
m("nve-carousel-thumbnail")
|
|
58
|
-
], n);
|
|
59
|
-
export {
|
|
60
|
-
n as default
|
|
40
|
+
}
|
|
61
41
|
};
|
|
42
|
+
i([n({
|
|
43
|
+
reflect: !0,
|
|
44
|
+
type: String
|
|
45
|
+
})], o.prototype, "testId", void 0), i([n({
|
|
46
|
+
reflect: !0,
|
|
47
|
+
type: String
|
|
48
|
+
})], o.prototype, "carouselId", void 0), o = i([r("nve-carousel-thumbnail")], o);
|
|
49
|
+
var s = o;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { s as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-carousel-thumbnail/nve-carousel-thumbnail.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
.thumbnail {
|
|
4
5
|
display: flex;
|
|
5
6
|
justify-content: center;
|
|
@@ -34,6 +35,5 @@ const i = t`
|
|
|
34
35
|
opacity: 1;
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { t as default };
|
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
3
|
-
import { c as n } from "../../chunks/chunk.D5YQDJ7X.js";
|
|
4
|
-
import "../../chunks/chunk.SI4ACBFK.js";
|
|
5
|
-
import "../../chunks/chunk.3RPBFEDE.js";
|
|
6
|
-
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
7
|
-
import "../../chunks/chunk.4TUIT776.js";
|
|
8
|
-
import p from "./nve-checkbox.styles.js";
|
|
9
|
-
var v = Object.getOwnPropertyDescriptor, d = (e, o, a, c) => {
|
|
10
|
-
for (var t = c > 1 ? void 0 : c ? v(o, a) : o, r = e.length - 1, l; r >= 0; r--)
|
|
11
|
-
(l = e[r]) && (t = l(t) || t);
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
let s = class extends n {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
}
|
|
18
|
-
connectedCallback() {
|
|
19
|
-
super.connectedCallback(), this.addEventListener("sl-invalid", (e) => {
|
|
20
|
-
e.preventDefault();
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
disconnectedCallback() {
|
|
24
|
-
super.disconnectedCallback(), this.removeEventListener("sl-invalid", () => {
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
s.styles = [n.styles, p];
|
|
29
|
-
s = d([
|
|
30
|
-
i("nve-checkbox")
|
|
31
|
-
], s);
|
|
32
|
-
export {
|
|
33
|
-
s as default
|
|
34
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-checkbox.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-checkbox/nve-checkbox.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
.error {
|
|
4
5
|
border-color: var(--color-feedback-background-emphasized-error) !important;
|
|
5
6
|
}
|
|
@@ -23,7 +24,7 @@ const a = r`
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
:host([data-invalid])::part(control) {
|
|
26
|
-
border-color: var(--color-feedback-
|
|
27
|
+
border-color: var(--color-feedback-border-emphasized-error);
|
|
27
28
|
}
|
|
28
29
|
:host([data-invalid])::part(control control--checked),
|
|
29
30
|
:host([data-user-invalid])::part(control control--indeterminate) {
|
|
@@ -31,7 +32,7 @@ const a = r`
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
:host(:not([disabled]):hover)::part(control) {
|
|
34
|
-
border-color: var(--color-neutrals-foreground-subtle
|
|
35
|
+
border-color: var(--color-neutrals-foreground-subtle) !important;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
sl-icon {
|
|
@@ -51,6 +52,5 @@ const a = r`
|
|
|
51
52
|
font: var(--typography-label-x-small-light);
|
|
52
53
|
}
|
|
53
54
|
`;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { t as default };
|
|
@@ -1,152 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { r as u } from "../../chunks/state.js";
|
|
4
|
-
import { e as v } from "../../chunks/query.js";
|
|
5
|
-
import "../nve-label/nve-label.component.js";
|
|
6
|
-
import g from "./nve-checkbox-group.styles.js";
|
|
7
|
-
import { t as m } from "../../chunks/updateInvalidProperty.js";
|
|
8
|
-
function b(e, t) {
|
|
9
|
-
if (e === t) return !0;
|
|
10
|
-
if (typeof e != "object" || e === null || typeof t != "object" || t === null)
|
|
11
|
-
return !1;
|
|
12
|
-
let s = Object.keys(e), o = Object.keys(t);
|
|
13
|
-
if (s.length !== o.length) return !1;
|
|
14
|
-
for (let l of s)
|
|
15
|
-
if (!o.includes(l) || !b(e[l], t[l])) return !1;
|
|
16
|
-
return !0;
|
|
17
|
-
}
|
|
18
|
-
var y = Object.defineProperty, k = Object.getOwnPropertyDescriptor, i = (e, t, s, o) => {
|
|
19
|
-
for (var l = o > 1 ? void 0 : o ? k(t, s) : t, n = e.length - 1, h; n >= 0; n--)
|
|
20
|
-
(h = e[n]) && (l = (o ? h(t, s, l) : h(l)) || l);
|
|
21
|
-
return o && l && y(t, s, l), l;
|
|
22
|
-
};
|
|
23
|
-
let r = class extends p {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(), this.disabled = !1, this.required = !1, this.orientation = "vertical", this.requiredLabel = "*Obligatorisk", this.showErrorMessage = !1, this.isCustomValidationError = !1, this.updateSelectedValues = (e) => {
|
|
26
|
-
const t = e.target;
|
|
27
|
-
if (t.checked)
|
|
28
|
-
this.selectedValues || (this.selectedValues = []), this.selectedValues.push(t.value);
|
|
29
|
-
else if (this.selectedValues) {
|
|
30
|
-
const s = this.selectedValues.findIndex((o) => b(o, t.value));
|
|
31
|
-
s !== -1 && this.selectedValues.splice(s, 1);
|
|
32
|
-
}
|
|
33
|
-
this.requestUpdate();
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
connectedCallback() {
|
|
37
|
-
super.connectedCallback(), this.closest("form")?.addEventListener("submit", this.handleSubmit.bind(this)), this.addEventListener("sl-change", this.handleChange.bind(this));
|
|
38
|
-
}
|
|
39
|
-
disconnectedCallback() {
|
|
40
|
-
super.disconnectedCallback(), this.removeEventListener("sl-change", this.handleChange), this.removeEventListener("submit", this.handleSubmit);
|
|
41
|
-
}
|
|
42
|
-
firstUpdated() {
|
|
43
|
-
if (this.requiredLabel && this.style.setProperty("--sl-checkbox-required-content", `"${this.requiredLabel}"`), !this.selectedValues?.length) return;
|
|
44
|
-
Array.from(this.querySelectorAll("nve-checkbox")).forEach((t) => {
|
|
45
|
-
this.selectedValues?.includes(t.value) ? t.checked = !0 : t.checked = !1;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
updated(e) {
|
|
49
|
-
if (super.updated(e), e.has("disabled")) {
|
|
50
|
-
const t = Array.from(this.querySelectorAll("nve-checkbox"));
|
|
51
|
-
m(t, this.disabled, "disabled");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/** En 'fake' metode som gjør custom validering enklere på checkbox-group komponent */
|
|
55
|
-
setCustomValidity(e = "") {
|
|
56
|
-
const t = !e.length;
|
|
57
|
-
t ? this.resetValidation() : (this.errorMessage = e, this.makeInvalid()), this.isCustomValidationError = !t, this.toggleValidationAttributes(t);
|
|
58
|
-
}
|
|
59
|
-
handleSubmit(e) {
|
|
60
|
-
e.preventDefault(), this.checkValidity();
|
|
61
|
-
}
|
|
62
|
-
handleChange(e) {
|
|
63
|
-
this.updateSelectedValues(e), this.checkValidity();
|
|
64
|
-
}
|
|
65
|
-
/** Sjekker validity basert på constraint validation. Man kan legge til flere properties. */
|
|
66
|
-
checkValidity() {
|
|
67
|
-
if (!this.required || this.isCustomValidationError) return;
|
|
68
|
-
let e = !0;
|
|
69
|
-
this.required && (e = this.checkIfRequiredValid()), e ? this.resetValidation() : this.makeInvalid(), this.toggleValidationAttributes(e);
|
|
70
|
-
}
|
|
71
|
-
/** Toggler riktig validering attribute for å vise riktig style */
|
|
72
|
-
toggleValidationAttributes(e) {
|
|
73
|
-
this.toggleAttribute("data-valid", e), this.toggleAttribute("data-user-valid", e), this.toggleAttribute("data-invalid", !e), this.toggleAttribute("data-user-invalid", !e);
|
|
74
|
-
}
|
|
75
|
-
resetValidation() {
|
|
76
|
-
Array.from(this.querySelectorAll("nve-checkbox")).forEach((t) => {
|
|
77
|
-
t.toggleAttribute("data-user-invalid", !1), t.setCustomValidity("");
|
|
78
|
-
}), this.showErrorMessage = !1;
|
|
79
|
-
}
|
|
80
|
-
makeInvalid() {
|
|
81
|
-
Array.from(this.querySelectorAll("nve-checkbox")).forEach((s) => {
|
|
82
|
-
s.toggleAttribute("data-user-invalid", !0), s.setCustomValidity(this.errorMessage || "Error");
|
|
83
|
-
}), this.showErrorMessage = !0;
|
|
84
|
-
const t = new Event("sl-invalid", {
|
|
85
|
-
bubbles: !0,
|
|
86
|
-
cancelable: !0
|
|
87
|
-
});
|
|
88
|
-
this.dispatchEvent(t);
|
|
89
|
-
}
|
|
90
|
-
checkIfRequiredValid() {
|
|
91
|
-
return Array.from(this.querySelectorAll("nve-checkbox")).some((s) => s.checked);
|
|
92
|
-
}
|
|
93
|
-
render() {
|
|
94
|
-
return d`
|
|
95
|
-
<fieldset
|
|
96
|
-
class="checkbox-group"
|
|
97
|
-
aria-required=${this.required}
|
|
98
|
-
aria-labelledby="label"
|
|
99
|
-
aria-describedby="error-message"
|
|
100
|
-
aria-errormessage="error-message"
|
|
101
|
-
>
|
|
102
|
-
${this.label ? d`<div class="checkbox-group__label">
|
|
103
|
-
<nve-label id="label" value=${this.label} size="small" tooltip=${this.tooltip}></nve-label>
|
|
104
|
-
</div>` : c}
|
|
105
|
-
<slot class="checkbox-group__checkboxes"></slot>
|
|
106
|
-
${this.showErrorMessage ? d`<span role="alert" id="error-message" class="checkbox-group__error-message"
|
|
107
|
-
>${this.errorMessage || c}</span
|
|
108
|
-
>` : c}
|
|
109
|
-
</fieldset>
|
|
110
|
-
`;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
r.styles = [g];
|
|
114
|
-
i([
|
|
115
|
-
a({ type: Boolean, reflect: !0 })
|
|
116
|
-
], r.prototype, "disabled", 2);
|
|
117
|
-
i([
|
|
118
|
-
a({ type: Boolean, reflect: !0 })
|
|
119
|
-
], r.prototype, "required", 2);
|
|
120
|
-
i([
|
|
121
|
-
a()
|
|
122
|
-
], r.prototype, "label", 2);
|
|
123
|
-
i([
|
|
124
|
-
a()
|
|
125
|
-
], r.prototype, "tooltip", 2);
|
|
126
|
-
i([
|
|
127
|
-
a({ type: String, reflect: !0 })
|
|
128
|
-
], r.prototype, "orientation", 2);
|
|
129
|
-
i([
|
|
130
|
-
a()
|
|
131
|
-
], r.prototype, "errorMessage", 2);
|
|
132
|
-
i([
|
|
133
|
-
a()
|
|
134
|
-
], r.prototype, "requiredLabel", 2);
|
|
135
|
-
i([
|
|
136
|
-
a({ type: Array })
|
|
137
|
-
], r.prototype, "selectedValues", 2);
|
|
138
|
-
i([
|
|
139
|
-
v("slot")
|
|
140
|
-
], r.prototype, "slot", 2);
|
|
141
|
-
i([
|
|
142
|
-
u()
|
|
143
|
-
], r.prototype, "showErrorMessage", 2);
|
|
144
|
-
i([
|
|
145
|
-
u()
|
|
146
|
-
], r.prototype, "isCustomValidationError", 2);
|
|
147
|
-
r = i([
|
|
148
|
-
f("nve-checkbox-group")
|
|
149
|
-
], r);
|
|
150
|
-
export {
|
|
151
|
-
r as default
|
|
152
|
-
};
|
|
1
|
+
import { t as e } from "../../chunks/nve-checkbox-group.component.js";
|
|
2
|
+
export { e as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { u as e } from "../../chunks/lit.js";
|
|
2
|
+
//#region src/components/nve-checkbox-group/nve-checkbox-group.styles.ts
|
|
3
|
+
var t = e`
|
|
3
4
|
:host {
|
|
4
5
|
--sl-checkbox-required-content: '*Obligatorisk';
|
|
5
6
|
}
|
|
@@ -53,6 +54,5 @@ const o = e`
|
|
|
53
54
|
width: unset;
|
|
54
55
|
}
|
|
55
56
|
`;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { t as default };
|