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
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./lit.js";
|
|
2
|
+
import { o as r, r as i, s as a, t as o } from "./decorate.js";
|
|
3
|
+
import { t as s } from "./class-map.js";
|
|
4
|
+
import c from "../components/nve-alert/nve-alert.styles.js";
|
|
5
|
+
import "../components/nve-icon/nve-icon.component.js";
|
|
6
|
+
//#region src/utils/animation.ts
|
|
7
|
+
function l(e, t, n) {
|
|
8
|
+
return new Promise((r) => {
|
|
9
|
+
if (n?.duration === Infinity) throw Error("Promise-based animations must be finite.");
|
|
10
|
+
let i = e.animate(t, {
|
|
11
|
+
...n,
|
|
12
|
+
duration: u() ? 0 : n?.duration ?? 300
|
|
13
|
+
});
|
|
14
|
+
i.addEventListener("cancel", r, { once: !0 }), i.addEventListener("finish", r, { once: !0 });
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function u() {
|
|
18
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/nve-alert/nve-alert.component.ts
|
|
22
|
+
var d, f = class extends n {
|
|
23
|
+
static {
|
|
24
|
+
d = this;
|
|
25
|
+
}
|
|
26
|
+
constructor(...e) {
|
|
27
|
+
super(...e), this.testId = void 0, this.leftStroke = !1, this.variant = "primary", this.closable = !1, this.open = !1, this.duration = Infinity, this.buttonLabel = "Lukk", this.showIcon = "true";
|
|
28
|
+
}
|
|
29
|
+
static get toastStack() {
|
|
30
|
+
return this.currentToastStack ||= Object.assign(document.createElement("div"), { className: "toast-stack" }), this.currentToastStack;
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
this.styles = [c];
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback();
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback(), this.clearAutoHideTimer();
|
|
40
|
+
}
|
|
41
|
+
firstUpdated() {
|
|
42
|
+
this.base && (this.base.hidden = !this.open);
|
|
43
|
+
}
|
|
44
|
+
async updated(e) {
|
|
45
|
+
super.updated(e), e.has("open") && (this.open ? this.dispatchEvent(new CustomEvent("sl-show", {
|
|
46
|
+
bubbles: !0,
|
|
47
|
+
composed: !0
|
|
48
|
+
})) : this.dispatchEvent(new CustomEvent("sl-hide", {
|
|
49
|
+
bubbles: !0,
|
|
50
|
+
composed: !0
|
|
51
|
+
}))), e.has("duration") && this.open && this.startAutoHideTimer();
|
|
52
|
+
}
|
|
53
|
+
startAutoHideTimer() {
|
|
54
|
+
this.clearAutoHideTimer(), this.duration !== Infinity && this.duration > 0 && (this._autoHideTimeout = setTimeout(() => {
|
|
55
|
+
this.hide();
|
|
56
|
+
}, this.duration));
|
|
57
|
+
}
|
|
58
|
+
clearAutoHideTimer() {
|
|
59
|
+
this._autoHideTimeout &&= (clearTimeout(this._autoHideTimeout), void 0);
|
|
60
|
+
}
|
|
61
|
+
async handleCloseClick() {
|
|
62
|
+
await this.hide();
|
|
63
|
+
}
|
|
64
|
+
async show() {
|
|
65
|
+
this.open || (this.open = !0, await l(this.base, this.getKeyframes().show, { easing: "ease" }), await this.updateComplete, this.dispatchEvent(new CustomEvent("sl-after-show", {
|
|
66
|
+
bubbles: !0,
|
|
67
|
+
composed: !0
|
|
68
|
+
})), this.startAutoHideTimer());
|
|
69
|
+
}
|
|
70
|
+
async hide() {
|
|
71
|
+
this.open && (await l(this.base, this.getKeyframes().hide, { easing: "ease" }), this.open = !1, await this.updateComplete, this.dispatchEvent(new CustomEvent("sl-after-hide", {
|
|
72
|
+
bubbles: !0,
|
|
73
|
+
composed: !0
|
|
74
|
+
})), this.clearAutoHideTimer());
|
|
75
|
+
}
|
|
76
|
+
async toast() {
|
|
77
|
+
return new Promise((e) => {
|
|
78
|
+
d.toastStack.parentElement === null && document.body.append(d.toastStack), d.toastStack.appendChild(this), requestAnimationFrame(() => {
|
|
79
|
+
this.show();
|
|
80
|
+
}), this.addEventListener("sl-after-hide", () => {
|
|
81
|
+
d.toastStack.removeChild(this), e(), d.toastStack.querySelector("nve-alert") === null && d.toastStack.remove();
|
|
82
|
+
}, { once: !0 });
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
getVariantIconName() {
|
|
86
|
+
if (this.showIcon === "false") return "";
|
|
87
|
+
if (this.iconName) return this.iconName;
|
|
88
|
+
switch (this.variant) {
|
|
89
|
+
case "primary": return "info";
|
|
90
|
+
case "success": return "check_circle";
|
|
91
|
+
case "neutral": return "info";
|
|
92
|
+
case "warning": return "warning";
|
|
93
|
+
case "danger": return "error";
|
|
94
|
+
default: return "";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
getKeyframes() {
|
|
98
|
+
return {
|
|
99
|
+
show: [{
|
|
100
|
+
opacity: 0,
|
|
101
|
+
transform: "scale(0.8)"
|
|
102
|
+
}, {
|
|
103
|
+
opacity: 1,
|
|
104
|
+
transform: "scale(1)"
|
|
105
|
+
}],
|
|
106
|
+
hide: [{
|
|
107
|
+
opacity: 1,
|
|
108
|
+
transform: "scale(1)"
|
|
109
|
+
}, {
|
|
110
|
+
opacity: 0,
|
|
111
|
+
transform: "scale(0.8)"
|
|
112
|
+
}]
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
render() {
|
|
116
|
+
return e`
|
|
117
|
+
<div
|
|
118
|
+
role="alert"
|
|
119
|
+
part="base"
|
|
120
|
+
class=${s({
|
|
121
|
+
alert: !0,
|
|
122
|
+
"alert--hidden": !this.open,
|
|
123
|
+
"alert--primary": this.variant === "primary",
|
|
124
|
+
"alert--success": this.variant === "success",
|
|
125
|
+
"alert--neutral": this.variant === "neutral",
|
|
126
|
+
"alert--warning": this.variant === "warning",
|
|
127
|
+
"alert--danger": this.variant === "danger",
|
|
128
|
+
"alert--left-stroke": this.leftStroke,
|
|
129
|
+
"alert--emphasized": this.saturation === "emphasized"
|
|
130
|
+
})}
|
|
131
|
+
>
|
|
132
|
+
<div part="icon" class="alert__icon">
|
|
133
|
+
${this.showIcon === "true" ? e`
|
|
134
|
+
<div part="icon" class="alert__icon">
|
|
135
|
+
${this.getVariantIconName() ? e`<nve-icon name="${this.getVariantIconName()}"></nve-icon>` : e`<slot name="icon"></slot>`}
|
|
136
|
+
</div>
|
|
137
|
+
` : t}
|
|
138
|
+
</div>
|
|
139
|
+
<div part="label">
|
|
140
|
+
${this.label ? e` <label part="label">${this.label}</label>` : e`<slot name="label"></slot>`}
|
|
141
|
+
</div>
|
|
142
|
+
<div part="message" class="alert__message">${this.text ? this.text : e`<slot></slot>`}</div>
|
|
143
|
+
${this.closable ? e`
|
|
144
|
+
<button
|
|
145
|
+
@click=${this.handleCloseClick}
|
|
146
|
+
class="alert__button"
|
|
147
|
+
title=${this.buttonLabel}
|
|
148
|
+
aria-label=${this.buttonLabel}
|
|
149
|
+
>
|
|
150
|
+
<nve-icon name="close"></nve-icon>
|
|
151
|
+
</button>
|
|
152
|
+
` : t}
|
|
153
|
+
</div>
|
|
154
|
+
`;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
o([r({ type: String })], f.prototype, "testId", void 0), o([r()], f.prototype, "label", void 0), o([r()], f.prototype, "text", void 0), o([r()], f.prototype, "saturation", void 0), o([r({ type: Boolean })], f.prototype, "leftStroke", void 0), o([r()], f.prototype, "variant", void 0), o([r({ type: Boolean })], f.prototype, "closable", void 0), o([r({
|
|
158
|
+
type: Boolean,
|
|
159
|
+
reflect: !0
|
|
160
|
+
})], f.prototype, "open", void 0), o([r({ type: Number })], f.prototype, "duration", void 0), o([r({ type: String })], f.prototype, "buttonLabel", void 0), o([r({ type: String })], f.prototype, "iconName", void 0), o([r({ type: String })], f.prototype, "showIcon", void 0), o([i("[part~=\"base\"]")], f.prototype, "base", void 0), f = d = o([a("nve-alert")], f);
|
|
161
|
+
var p = f;
|
|
162
|
+
//#endregion
|
|
163
|
+
export { p as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { a as e } from "./lit.js";
|
|
2
|
+
import { o as t, s as n, t as r } from "./decorate.js";
|
|
3
|
+
import "./chunk.4TUIT776.js";
|
|
4
|
+
import { t as i } from "./chunk.IKV4VH3T.js";
|
|
5
|
+
import a from "../components/nve-carousel-item/nve-carousel-item.styles.js";
|
|
6
|
+
//#region src/components/nve-carousel-item/nve-carousel-item.component.ts
|
|
7
|
+
var o = class extends i {
|
|
8
|
+
static {
|
|
9
|
+
this.styles = [i.styles, a];
|
|
10
|
+
}
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.testId = void 0, this.description = "";
|
|
13
|
+
}
|
|
14
|
+
updated(e) {
|
|
15
|
+
super.updated(e), e.has("description") && this.style.setProperty("--nve-carousel-description", `"${this.description}"`);
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return e`
|
|
19
|
+
<slot></slot>
|
|
20
|
+
${this.description ? e`
|
|
21
|
+
<div class="carousel-item__description">
|
|
22
|
+
<p>${this.description}</p>
|
|
23
|
+
</div>` : ""}
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
r([t({
|
|
28
|
+
reflect: !0,
|
|
29
|
+
type: String
|
|
30
|
+
})], o.prototype, "testId", void 0), r([t({
|
|
31
|
+
type: String,
|
|
32
|
+
reflect: !0
|
|
33
|
+
})], o.prototype, "description", void 0), o = r([n("nve-carousel-item")], o);
|
|
34
|
+
var s = o;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { s as t };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { o as e, s as t, t as n } from "./decorate.js";
|
|
2
|
+
import "./chunk.4TUIT776.js";
|
|
3
|
+
import "./chunk.YHLNUJ7P.js";
|
|
4
|
+
import "./chunk.6CTB5ZDJ.js";
|
|
5
|
+
import { t as r } from "./chunk.ZH2AND3P.js";
|
|
6
|
+
import i from "../components/nve-carousel/nve-carousel.styles.js";
|
|
7
|
+
//#region src/components/nve-carousel/nve-carousel.component.ts
|
|
8
|
+
var a = class extends r {
|
|
9
|
+
static {
|
|
10
|
+
this.styles = [r.styles, i];
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
super(), this.testId = void 0, this.paginationCounter = !1;
|
|
14
|
+
}
|
|
15
|
+
isCarouselItem(e) {
|
|
16
|
+
return e instanceof Element && e.tagName.toLowerCase() === "nve-carousel-item";
|
|
17
|
+
}
|
|
18
|
+
firstUpdated() {
|
|
19
|
+
super.firstUpdated();
|
|
20
|
+
let e = this.querySelectorAll("nve-carousel-item:not([data-clone])").length;
|
|
21
|
+
this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-num-items", e.toString()), this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-active-item", "1"), this.addEventListener("sl-slide-change", this.handeSlideChange.bind(this));
|
|
22
|
+
}
|
|
23
|
+
updated(e) {
|
|
24
|
+
super.updated(e);
|
|
25
|
+
let t = this.querySelectorAll("nve-carousel-item:not([data-clone])").length;
|
|
26
|
+
this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-num-items", t.toString());
|
|
27
|
+
}
|
|
28
|
+
handeSlideChange(e) {
|
|
29
|
+
this.shadowRoot?.getElementById("scroll-container")?.setAttribute("data-active-item", (e.detail.index + 1).toString());
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
n([e({
|
|
33
|
+
reflect: !0,
|
|
34
|
+
type: String
|
|
35
|
+
})], a.prototype, "testId", void 0), n([e({
|
|
36
|
+
reflect: !0,
|
|
37
|
+
type: Boolean
|
|
38
|
+
})], a.prototype, "paginationCounter", void 0), a = n([t("nve-carousel")], a);
|
|
39
|
+
var o = a;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { o as t };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./lit.js";
|
|
2
|
+
import { a as r, o as i, r as a, s as o, t as s } from "./decorate.js";
|
|
3
|
+
import "./nve-label.component.js";
|
|
4
|
+
import c from "../components/nve-checkbox-group/nve-checkbox-group.styles.js";
|
|
5
|
+
import { t as l } from "./updateInvalidProperty.js";
|
|
6
|
+
//#region src/utils/deepCompare.ts
|
|
7
|
+
function u(e, t) {
|
|
8
|
+
if (e === t) return !0;
|
|
9
|
+
if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
|
|
10
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
11
|
+
if (n.length !== r.length) return !1;
|
|
12
|
+
for (let i of n) if (!r.includes(i) || !u(e[i], t[i])) return !1;
|
|
13
|
+
return !0;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/nve-checkbox-group/nve-checkbox-group.component.ts
|
|
17
|
+
var d = class extends n {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(), this.disabled = !1, this.required = !1, this.orientation = "vertical", this.requiredLabel = "*Obligatorisk", this.showErrorMessage = !1, this.isCustomValidationError = !1, this.updateSelectedValues = (e) => {
|
|
20
|
+
let t = e.target;
|
|
21
|
+
if (t.checked) this.selectedValues ||= [], this.selectedValues.push(t.value);
|
|
22
|
+
else if (this.selectedValues) {
|
|
23
|
+
let e = this.selectedValues.findIndex((e) => u(e, t.value));
|
|
24
|
+
e !== -1 && this.selectedValues.splice(e, 1);
|
|
25
|
+
}
|
|
26
|
+
this.requestUpdate();
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
this.styles = [c];
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback(), this.closest("form")?.addEventListener("submit", this.handleSubmit.bind(this)), this.addEventListener("sl-change", this.handleChange.bind(this));
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
super.disconnectedCallback(), this.removeEventListener("sl-change", this.handleChange), this.removeEventListener("submit", this.handleSubmit);
|
|
37
|
+
}
|
|
38
|
+
firstUpdated() {
|
|
39
|
+
this.requiredLabel && this.style.setProperty("--sl-checkbox-required-content", `"${this.requiredLabel}"`), this.selectedValues?.length && Array.from(this.querySelectorAll("nve-checkbox")).forEach((e) => {
|
|
40
|
+
this.selectedValues?.includes(e.value) ? e.checked = !0 : e.checked = !1;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
updated(e) {
|
|
44
|
+
super.updated(e), e.has("disabled") && l(Array.from(this.querySelectorAll("nve-checkbox")), this.disabled, "disabled");
|
|
45
|
+
}
|
|
46
|
+
setCustomValidity(e = "") {
|
|
47
|
+
let t = !e.length;
|
|
48
|
+
t ? this.resetValidation() : (this.errorMessage = e, this.makeInvalid()), this.isCustomValidationError = !t, this.toggleValidationAttributes(t);
|
|
49
|
+
}
|
|
50
|
+
handleSubmit(e) {
|
|
51
|
+
e.preventDefault(), this.checkValidity();
|
|
52
|
+
}
|
|
53
|
+
handleChange(e) {
|
|
54
|
+
this.updateSelectedValues(e), this.checkValidity();
|
|
55
|
+
}
|
|
56
|
+
checkValidity() {
|
|
57
|
+
if (!this.required || this.isCustomValidationError) return;
|
|
58
|
+
let e = !0;
|
|
59
|
+
this.required && (e = this.checkIfRequiredValid()), e ? this.resetValidation() : this.makeInvalid(), this.toggleValidationAttributes(e);
|
|
60
|
+
}
|
|
61
|
+
toggleValidationAttributes(e) {
|
|
62
|
+
this.toggleAttribute("data-valid", e), this.toggleAttribute("data-user-valid", e), this.toggleAttribute("data-invalid", !e), this.toggleAttribute("data-user-invalid", !e);
|
|
63
|
+
}
|
|
64
|
+
resetValidation() {
|
|
65
|
+
Array.from(this.querySelectorAll("nve-checkbox")).forEach((e) => {
|
|
66
|
+
e.toggleAttribute("data-user-invalid", !1), e.setCustomValidity("");
|
|
67
|
+
}), this.showErrorMessage = !1;
|
|
68
|
+
}
|
|
69
|
+
makeInvalid() {
|
|
70
|
+
Array.from(this.querySelectorAll("nve-checkbox")).forEach((e) => {
|
|
71
|
+
e.toggleAttribute("data-user-invalid", !0), e.setCustomValidity(this.errorMessage || "Error");
|
|
72
|
+
}), this.showErrorMessage = !0;
|
|
73
|
+
let e = new Event("sl-invalid", {
|
|
74
|
+
bubbles: !0,
|
|
75
|
+
cancelable: !0
|
|
76
|
+
});
|
|
77
|
+
this.dispatchEvent(e);
|
|
78
|
+
}
|
|
79
|
+
checkIfRequiredValid() {
|
|
80
|
+
return Array.from(this.querySelectorAll("nve-checkbox")).some((e) => e.checked);
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return e`
|
|
84
|
+
<fieldset
|
|
85
|
+
class="checkbox-group"
|
|
86
|
+
aria-required=${this.required}
|
|
87
|
+
aria-labelledby="label"
|
|
88
|
+
aria-describedby="error-message"
|
|
89
|
+
aria-errormessage="error-message"
|
|
90
|
+
>
|
|
91
|
+
${this.label ? e`<div class="checkbox-group__label">
|
|
92
|
+
<nve-label id="label" value=${this.label} size="small" tooltip=${this.tooltip}></nve-label>
|
|
93
|
+
</div>` : t}
|
|
94
|
+
<slot class="checkbox-group__checkboxes"></slot>
|
|
95
|
+
${this.showErrorMessage ? e`<span role="alert" id="error-message" class="checkbox-group__error-message"
|
|
96
|
+
>${this.errorMessage || t}</span
|
|
97
|
+
>` : t}
|
|
98
|
+
</fieldset>
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
s([i({
|
|
103
|
+
type: Boolean,
|
|
104
|
+
reflect: !0
|
|
105
|
+
})], d.prototype, "disabled", void 0), s([i({
|
|
106
|
+
type: Boolean,
|
|
107
|
+
reflect: !0
|
|
108
|
+
})], d.prototype, "required", void 0), s([i()], d.prototype, "label", void 0), s([i()], d.prototype, "tooltip", void 0), s([i({
|
|
109
|
+
type: String,
|
|
110
|
+
reflect: !0
|
|
111
|
+
})], d.prototype, "orientation", void 0), s([i()], d.prototype, "errorMessage", void 0), s([i()], d.prototype, "requiredLabel", void 0), s([i({ type: Array })], d.prototype, "selectedValues", void 0), s([a("slot")], d.prototype, "slot", void 0), s([r()], d.prototype, "showErrorMessage", void 0), s([r()], d.prototype, "isCustomValidationError", void 0), d = s([o("nve-checkbox-group")], d);
|
|
112
|
+
var f = d;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { f as t };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { s as e, t } from "./decorate.js";
|
|
2
|
+
import "./chunk.4TUIT776.js";
|
|
3
|
+
import "./chunk.SI4ACBFK.js";
|
|
4
|
+
import { t as n } from "./chunk.D5YQDJ7X.js";
|
|
5
|
+
import "./chunk.GI7VDIWX.js";
|
|
6
|
+
import "./chunk.YHLNUJ7P.js";
|
|
7
|
+
import r from "../components/nve-checkbox/nve-checkbox.styles.js";
|
|
8
|
+
//#region src/components/nve-checkbox/nve-checkbox.component.ts
|
|
9
|
+
var i = class extends n {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
this.styles = [n.styles, r];
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback(), this.addEventListener("sl-invalid", (e) => {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
super.disconnectedCallback(), this.removeEventListener("sl-invalid", () => {});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
i = t([e("nve-checkbox")], i);
|
|
26
|
+
var a = i;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { a as t };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { o as e, s as t, t as n } from "./decorate.js";
|
|
2
|
+
import "./chunk.4TUIT776.js";
|
|
3
|
+
import "./chunk.YHLNUJ7P.js";
|
|
4
|
+
import "./chunk.6CTB5ZDJ.js";
|
|
5
|
+
import "./chunk.RWUUFNUL.js";
|
|
6
|
+
import { t as r } from "./chunk.KPLQLAWP.js";
|
|
7
|
+
import i from "../components/nve-dialog/nve-dialog-styles.js";
|
|
8
|
+
//#region src/components/nve-dialog/nve-dialog.component.ts
|
|
9
|
+
var a = class extends r {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(), this.icon = "", this.disableBackground = !1;
|
|
12
|
+
}
|
|
13
|
+
handleRequestClose(e) {
|
|
14
|
+
this.disableBackground && e.detail.source === "overlay" && e.preventDefault();
|
|
15
|
+
}
|
|
16
|
+
updated(e) {
|
|
17
|
+
super.updated(e), e.has("disableBackground") && this.addEventListener("sl-request-close", this.handleRequestClose), this.updateIcon();
|
|
18
|
+
}
|
|
19
|
+
updateIcon() {
|
|
20
|
+
let e = this.shadowRoot?.querySelector(".dialog__title");
|
|
21
|
+
if (e instanceof HTMLElement) {
|
|
22
|
+
let t = this.icon ? `"${this.icon}"` : null;
|
|
23
|
+
e.style.setProperty("--title-icon", t);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
static {
|
|
27
|
+
this.styles = [r.styles, i];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
n([e({
|
|
31
|
+
type: String,
|
|
32
|
+
reflect: !0
|
|
33
|
+
})], a.prototype, "icon", void 0), n([e({
|
|
34
|
+
type: Boolean,
|
|
35
|
+
reflect: !0
|
|
36
|
+
})], a.prototype, "disableBackground", void 0), a = n([t("nve-dialog")], a);
|
|
37
|
+
var o = a;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { o as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { u as e } from "./lit.js";
|
|
2
|
+
import { s as t, t as n } from "./decorate.js";
|
|
3
|
+
import "./chunk.4TUIT776.js";
|
|
4
|
+
import { t as r } from "./chunk.IVVHNXMC.js";
|
|
5
|
+
//#region src/components/nve-divider/nve-divider.component.ts
|
|
6
|
+
var i = class extends r {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
}
|
|
10
|
+
static {
|
|
11
|
+
this.styles = [r.styles, e`
|
|
12
|
+
:host {
|
|
13
|
+
--color: var(--color-neutrals-border-subtle);
|
|
14
|
+
--width: var(--border-width-default, 1px);
|
|
15
|
+
--spacing: var(--spacing-2x-small, 0.25rem);
|
|
16
|
+
}
|
|
17
|
+
`];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
i = n([t("nve-divider")], i);
|
|
21
|
+
var a = i;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as t };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { o as e, s as t, t as n } from "./decorate.js";
|
|
2
|
+
import "./chunk.4TUIT776.js";
|
|
3
|
+
import "./chunk.YHLNUJ7P.js";
|
|
4
|
+
import "./chunk.6CTB5ZDJ.js";
|
|
5
|
+
import "./chunk.RWUUFNUL.js";
|
|
6
|
+
import { t as r } from "./chunk.SAPQLUO4.js";
|
|
7
|
+
import i from "../components/nve-drawer/nve-drawer.styles.js";
|
|
8
|
+
//#region src/components/nve-drawer/nve-drawer.component.ts
|
|
9
|
+
var a = class extends r {
|
|
10
|
+
static {
|
|
11
|
+
this.styles = [r.styles, i];
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super(), this.testId = void 0;
|
|
15
|
+
}
|
|
16
|
+
firstUpdated() {
|
|
17
|
+
super.firstUpdated(), this.updateCloseIcon();
|
|
18
|
+
}
|
|
19
|
+
updateCloseIcon() {
|
|
20
|
+
requestAnimationFrame(() => {
|
|
21
|
+
let e = (this?.shadowRoot?.querySelector("[part=\"close-button\"]"))?.shadowRoot?.querySelector("button");
|
|
22
|
+
if (!e) return;
|
|
23
|
+
e.setAttribute("title", "Lukk"), e.style.color = "inherit";
|
|
24
|
+
let t = {
|
|
25
|
+
start: "left_panel_close",
|
|
26
|
+
end: "right_panel_close",
|
|
27
|
+
top: "top_panel_close",
|
|
28
|
+
bottom: "bottom_panel_close"
|
|
29
|
+
}, n = document.createElement("nve-icon");
|
|
30
|
+
n.setAttribute("name", t[this.placement]), e.replaceChildren(n);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
n([e({
|
|
35
|
+
reflect: !0,
|
|
36
|
+
type: String
|
|
37
|
+
})], a.prototype, "testId", void 0), a = n([t("nve-drawer")], a);
|
|
38
|
+
var o = a;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { o as t };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { o as e, s as t, t as n } from "./decorate.js";
|
|
2
|
+
import "./chunk.4TUIT776.js";
|
|
3
|
+
import "./chunk.6CTB5ZDJ.js";
|
|
4
|
+
import "./chunk.5JY5FUCG.js";
|
|
5
|
+
import { t as r } from "./chunk.UDWRA64J.js";
|
|
6
|
+
import i from "../components/nve-dropdown/nve-dropdown.styles.js";
|
|
7
|
+
//#region src/utils/tabbable.ts
|
|
8
|
+
function a(e) {
|
|
9
|
+
return !!(e.offsetParent || e.offsetWidth || e.offsetHeight || e.getClientRects().length);
|
|
10
|
+
}
|
|
11
|
+
function o(e) {
|
|
12
|
+
let t = e.tagName.toLowerCase();
|
|
13
|
+
return e.getAttribute("tabindex") === "-1" || e.hasAttribute("disabled") || t === "input" && e.getAttribute("type") === "radio" && !e.hasAttribute("checked") || !a(e) || window.getComputedStyle(e).visibility === "hidden" ? !1 : (t === "audio" || t === "video") && e.hasAttribute("controls") || e.hasAttribute("tabindex") || e.hasAttribute("contenteditable") && e.getAttribute("contenteditable") !== "false" ? !0 : [
|
|
14
|
+
"button",
|
|
15
|
+
"input",
|
|
16
|
+
"select",
|
|
17
|
+
"textarea",
|
|
18
|
+
"a",
|
|
19
|
+
"audio",
|
|
20
|
+
"video",
|
|
21
|
+
"summary"
|
|
22
|
+
].includes(t);
|
|
23
|
+
}
|
|
24
|
+
function s(e) {
|
|
25
|
+
let t = c(e);
|
|
26
|
+
return {
|
|
27
|
+
start: t[0] ?? null,
|
|
28
|
+
end: t[t.length - 1] ?? null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function c(e) {
|
|
32
|
+
let t = [];
|
|
33
|
+
function n(r) {
|
|
34
|
+
if (r instanceof Element) {
|
|
35
|
+
if (r.hasAttribute("inert")) return;
|
|
36
|
+
!t.includes(r) && o(r) && t.push(r), r instanceof HTMLSlotElement && ((t) => t.getRootNode({ composed: !0 })?.host !== e)(r) && r.assignedElements({ flatten: !0 }).forEach((e) => {
|
|
37
|
+
e instanceof HTMLElement && n(e);
|
|
38
|
+
}), r.shadowRoot !== null && r.shadowRoot.mode === "open" && n(r.shadowRoot);
|
|
39
|
+
}
|
|
40
|
+
[...r.children].forEach((e) => {
|
|
41
|
+
e instanceof HTMLElement && n(e);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return n(e), t.sort((e, t) => {
|
|
45
|
+
let n = Number(e.getAttribute("tabindex")) || 0;
|
|
46
|
+
return (Number(t.getAttribute("tabindex")) || 0) - n;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/nve-dropdown/nve-dropdown.component.ts
|
|
51
|
+
var l = class extends r {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(), this.testId = "", this.handlePanelSelect = (e) => {
|
|
54
|
+
let t = e.target;
|
|
55
|
+
!this.stayOpenOnSelect && t.tagName.toLowerCase() === "nve-menu" && this.focusOnTrigger();
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static {
|
|
59
|
+
this.styles = [r.styles, i];
|
|
60
|
+
}
|
|
61
|
+
getMenu() {
|
|
62
|
+
return this.panel.assignedElements({ flatten: !0 }).find((e) => e.tagName.toLowerCase() === "nve-menu");
|
|
63
|
+
}
|
|
64
|
+
updateAccessibleTrigger() {
|
|
65
|
+
let e = this.trigger.assignedElements({ flatten: !0 }).find((e) => s(e).start), t;
|
|
66
|
+
if (e) {
|
|
67
|
+
switch (e.tagName.toLowerCase()) {
|
|
68
|
+
case "nve-button":
|
|
69
|
+
t = e.button;
|
|
70
|
+
break;
|
|
71
|
+
default: t = e;
|
|
72
|
+
}
|
|
73
|
+
t.setAttribute("aria-haspopup", "true"), t.setAttribute("aria-expanded", this.open ? "true" : "false");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
n([e({
|
|
78
|
+
reflect: !0,
|
|
79
|
+
type: String
|
|
80
|
+
})], l.prototype, "testId", void 0), l = n([t("nve-dropdown")], l);
|
|
81
|
+
var u = l;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { u as t };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { a as e, o as t, s as n, t as r } from "./decorate.js";
|
|
2
|
+
import "./chunk.4TUIT776.js";
|
|
3
|
+
import "./chunk.SI4ACBFK.js";
|
|
4
|
+
import "./chunk.GI7VDIWX.js";
|
|
5
|
+
import "./chunk.YHLNUJ7P.js";
|
|
6
|
+
import { t as i } from "./if-defined.js";
|
|
7
|
+
import "./chunk.6CTB5ZDJ.js";
|
|
8
|
+
import { t as a } from "./chunk.XA43ZQPC.js";
|
|
9
|
+
import o from "../components/nve-input/nve-input.styles.js";
|
|
10
|
+
//#region src/components/nve-input/nve-input.component.ts
|
|
11
|
+
var s = class extends a {
|
|
12
|
+
static {
|
|
13
|
+
this.styles = [a.styles, o];
|
|
14
|
+
}
|
|
15
|
+
constructor() {
|
|
16
|
+
super(), this.requiredLabel = "*Obligatorisk", this.testId = "", this.noValidation = !1, this.alreadyInvalid = !1;
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
super.connectedCallback(), this.addEventListener("sl-invalid", (e) => {
|
|
20
|
+
e.preventDefault(), this.alreadyInvalid || this.makeInvalid();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
super.disconnectedCallback(), this.removeEventListener("sl-invalid", this.makeInvalid);
|
|
25
|
+
}
|
|
26
|
+
firstUpdated() {
|
|
27
|
+
super.firstUpdated(), this.requiredLabel && this.style.setProperty("--sl-input-required-content", `"${this.requiredLabel}"`);
|
|
28
|
+
let e = this.shadowRoot?.querySelector("input");
|
|
29
|
+
e && i(this.autocomplete) && this.autocomplete === "false" && e.setAttribute("aria-autocomplete", "none");
|
|
30
|
+
}
|
|
31
|
+
updated(e) {
|
|
32
|
+
super.updated(e);
|
|
33
|
+
let t = this.hasAttribute("data-user-invalid");
|
|
34
|
+
if (e.has("inputId") && this.updateInputId(), t && !this.alreadyInvalid && this.makeInvalid(), t || this.resetValidation(), e.has("readonly") && this.shadowRoot) {
|
|
35
|
+
let t = e.get("readonly"), n = this.readonly;
|
|
36
|
+
if (!t && n) {
|
|
37
|
+
if (!this.shadowRoot.querySelector("slot[name=suffix]").assignedElements().length) {
|
|
38
|
+
let e = document.createElement("nve-icon");
|
|
39
|
+
e.setAttribute("id", "readonly-icon"), e.setAttribute("name", "visibility"), e.setAttribute("slot", "suffix"), this.appendChild(e);
|
|
40
|
+
}
|
|
41
|
+
} else if (!n && t) {
|
|
42
|
+
let e = this.shadowRoot.querySelector("slot[name=suffix]").assignedElements().find((e) => e.id === "readonly-icon");
|
|
43
|
+
e && e.remove();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
updateInputId() {
|
|
48
|
+
let e = this.shadowRoot?.querySelector("input");
|
|
49
|
+
e && this.inputId && (e.id = this.inputId);
|
|
50
|
+
}
|
|
51
|
+
makeInvalid() {
|
|
52
|
+
this.noValidation || (this.showErrorIcon(), this.showErrorMessage(), this.alreadyInvalid = !0);
|
|
53
|
+
}
|
|
54
|
+
resetValidation() {
|
|
55
|
+
this.hideErrorIcon(), this.style.setProperty("--nve-input-error-message", ""), this.alreadyInvalid = !1;
|
|
56
|
+
}
|
|
57
|
+
showErrorMessage() {
|
|
58
|
+
this.errorMessage ||= this.validationMessage, this.style.setProperty("--nve-input-error-message", `"${this.errorMessage}"`);
|
|
59
|
+
}
|
|
60
|
+
showErrorIcon() {
|
|
61
|
+
let e = document.createElement("nve-icon");
|
|
62
|
+
e.setAttribute("id", "error-icon"), e.setAttribute("name", "error"), e.setAttribute("slot", "suffix");
|
|
63
|
+
let t = getComputedStyle(document.documentElement).getPropertyValue("--color-feedback-background-emphasized-error");
|
|
64
|
+
e.style.color = t.trim(), this.appendChild(e);
|
|
65
|
+
}
|
|
66
|
+
hideErrorIcon() {
|
|
67
|
+
let e = this.querySelector("#error-icon");
|
|
68
|
+
e && e.remove();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
r([t()], s.prototype, "requiredLabel", void 0), r([t({ reflect: !0 })], s.prototype, "errorMessage", void 0), r([t({
|
|
72
|
+
reflect: !0,
|
|
73
|
+
type: String
|
|
74
|
+
})], s.prototype, "testId", void 0), r([t({
|
|
75
|
+
type: String,
|
|
76
|
+
reflect: !0
|
|
77
|
+
})], s.prototype, "inputId", void 0), r([t({ type: Boolean })], s.prototype, "noValidation", void 0), r([e()], s.prototype, "alreadyInvalid", void 0), s = r([n("nve-input")], s);
|
|
78
|
+
var c = s;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { c as t };
|