nve-designsystem 2.7.1 → 2.9.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/components/nve-option/nve-option.component.d.ts +4 -0
- package/components/nve-option/nve-option.component.js +23 -18
- package/components/nve-option/nve-option.styles.js +2 -4
- package/components/nve-select/nve-select.component.d.ts +4 -0
- package/components/nve-select/nve-select.component.js +12 -9
- package/custom-elements.json +19 -2
- package/package.json +1 -1
- package/vscode.html-custom-data.json +6 -1
|
@@ -10,6 +10,10 @@ export default class NveOption extends SlOption {
|
|
|
10
10
|
* Tekst som vises i select når denne er valgt. Default er at all råtekst vises.
|
|
11
11
|
*/
|
|
12
12
|
textLabel: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Setter filled attributt på option når parent-select er filled, for å få annen hover-farge
|
|
15
|
+
* Setter så hide-checkmark basert på samme logikk
|
|
16
|
+
*/
|
|
13
17
|
firstUpdated(changedProperties: PropertyValues): void;
|
|
14
18
|
/**
|
|
15
19
|
* Gir tilbake plain-tekst-label som vises i select
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { o as
|
|
1
|
+
import { o as a } from "../../chunks/chunk.JXOKFADN.js";
|
|
2
2
|
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
3
3
|
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
4
4
|
import "../../chunks/chunk.4TUIT776.js";
|
|
5
|
-
import { n as u, t as
|
|
6
|
-
import
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
(p =
|
|
10
|
-
return
|
|
5
|
+
import { n as u, t as h } from "../../chunks/property.js";
|
|
6
|
+
import c from "./nve-option.styles.js";
|
|
7
|
+
var b = Object.defineProperty, n = Object.getOwnPropertyDescriptor, f = (r, t, l, s) => {
|
|
8
|
+
for (var e = s > 1 ? void 0 : s ? n(t, l) : t, o = r.length - 1, p; o >= 0; o--)
|
|
9
|
+
(p = r[o]) && (e = (s ? p(t, l, e) : p(e)) || e);
|
|
10
|
+
return s && e && b(t, l, e), e;
|
|
11
11
|
};
|
|
12
|
-
let
|
|
12
|
+
let i = class extends a {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(), this.textLabel = void 0;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Setter filled attributt på option når parent-select er filled, for å få annen hover-farge
|
|
18
|
+
* Setter så hide-checkmark basert på samme logikk
|
|
19
|
+
*/
|
|
20
|
+
firstUpdated(r) {
|
|
21
|
+
super.firstUpdated(r);
|
|
22
|
+
const t = this.closest("nve-select");
|
|
23
|
+
t && (t.hasAttribute("filled") ? this.toggleAttribute("filled", !0) : this.toggleAttribute("filled", !1), t.hasAttribute("hide-checkmark") ? this.toggleAttribute("hide-checkmark", !0) : this.toggleAttribute("hide-checkmark", !1));
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Gir tilbake plain-tekst-label som vises i select
|
|
@@ -24,13 +29,13 @@ let l = class extends f {
|
|
|
24
29
|
return this.textLabel ? this.textLabel : super.getTextLabel();
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
i.styles = [a.styles, c];
|
|
33
|
+
f([
|
|
29
34
|
u()
|
|
30
|
-
],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
],
|
|
35
|
+
], i.prototype, "textLabel", 2);
|
|
36
|
+
i = f([
|
|
37
|
+
h("nve-option")
|
|
38
|
+
], i);
|
|
34
39
|
export {
|
|
35
|
-
|
|
40
|
+
i as default
|
|
36
41
|
};
|
|
@@ -15,8 +15,7 @@ const n = o`
|
|
|
15
15
|
color: var(--neutrals-foreground-primary, #0d0d0e);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
:host::part(checked-icon) {
|
|
18
|
+
:host([hide-checkmark])::part(checked-icon) {
|
|
20
19
|
display: none !important;
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -38,10 +37,9 @@ const n = o`
|
|
|
38
37
|
background-color: var(--neutrals-background-primary, #fff);
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
:host([filled]) .option{
|
|
40
|
+
:host([filled]) .option {
|
|
42
41
|
color: var(--neutrals-foreground-primary, #0d0d0e);
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
`;
|
|
46
44
|
export {
|
|
47
45
|
n as default
|
|
@@ -12,6 +12,10 @@ export default class NveSelect extends SlSelect {
|
|
|
12
12
|
* Tekst som vises for å markere at et felt er obligatorisk. Er satt til "*Obligatorisk" som standard.
|
|
13
13
|
*/
|
|
14
14
|
requiredLabel: string;
|
|
15
|
+
/**
|
|
16
|
+
* Settes dersom man ikke ønsker å ha checkmark på valgte options i dropdown
|
|
17
|
+
*/
|
|
18
|
+
hideCheckmark: boolean;
|
|
15
19
|
/**
|
|
16
20
|
* Brukes til enkel constraint validation til å overskrive default nettleser-melding
|
|
17
21
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as
|
|
1
|
+
import { s as u } from "../../chunks/chunk.TP2GB2HO.js";
|
|
2
2
|
import "../../chunks/chunk.SI4ACBFK.js";
|
|
3
3
|
import "../../chunks/chunk.5JY5FUCG.js";
|
|
4
4
|
import "../../chunks/chunk.3RPBFEDE.js";
|
|
@@ -6,17 +6,17 @@ import "../../chunks/chunk.RWUUFNUL.js";
|
|
|
6
6
|
import "../../chunks/chunk.6CTB5ZDJ.js";
|
|
7
7
|
import "../../chunks/chunk.YHLNUJ7P.js";
|
|
8
8
|
import "../../chunks/chunk.4TUIT776.js";
|
|
9
|
-
import { n as
|
|
9
|
+
import { n as p, t as h } from "../../chunks/property.js";
|
|
10
10
|
import { r as d } from "../../chunks/state.js";
|
|
11
11
|
import c from "./nve-select.styles.js";
|
|
12
12
|
var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, o = (e, t, s, i) => {
|
|
13
|
-
for (var r = i > 1 ? void 0 : i ? f(t, s) : t,
|
|
14
|
-
(
|
|
13
|
+
for (var r = i > 1 ? void 0 : i ? f(t, s) : t, a = e.length - 1, n; a >= 0; a--)
|
|
14
|
+
(n = e[a]) && (r = (i ? n(t, s, r) : n(r)) || r);
|
|
15
15
|
return i && r && v(t, s, r), r;
|
|
16
16
|
};
|
|
17
|
-
let l = class extends
|
|
17
|
+
let l = class extends u {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(), this.requiredLabel = "*Obligatorisk", this.slInvalidEventListener = (e) => {
|
|
19
|
+
super(), this.requiredLabel = "*Obligatorisk", this.hideCheckmark = !1, this.slInvalidEventListener = (e) => {
|
|
20
20
|
e.preventDefault();
|
|
21
21
|
}, this.valueHasChanged = !1;
|
|
22
22
|
}
|
|
@@ -59,12 +59,15 @@ let l = class extends p {
|
|
|
59
59
|
return this.querySelector("nve-option");
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
l.styles = [
|
|
62
|
+
l.styles = [u.styles, c];
|
|
63
63
|
o([
|
|
64
|
-
|
|
64
|
+
p()
|
|
65
65
|
], l.prototype, "requiredLabel", 2);
|
|
66
66
|
o([
|
|
67
|
-
|
|
67
|
+
p({ type: Boolean })
|
|
68
|
+
], l.prototype, "hideCheckmark", 2);
|
|
69
|
+
o([
|
|
70
|
+
p({ reflect: !0 })
|
|
68
71
|
], l.prototype, "errorMessage", 2);
|
|
69
72
|
o([
|
|
70
73
|
d()
|
package/custom-elements.json
CHANGED
|
@@ -3821,7 +3821,8 @@
|
|
|
3821
3821
|
"text": "PropertyValues"
|
|
3822
3822
|
}
|
|
3823
3823
|
}
|
|
3824
|
-
]
|
|
3824
|
+
],
|
|
3825
|
+
"description": "Setter filled attributt på option når parent-select er filled, for å få annen hover-farge\nSetter så hide-checkmark basert på samme logikk"
|
|
3825
3826
|
},
|
|
3826
3827
|
{
|
|
3827
3828
|
"kind": "method",
|
|
@@ -4303,6 +4304,15 @@
|
|
|
4303
4304
|
"default": "'*Obligatorisk'",
|
|
4304
4305
|
"description": "Tekst som vises for å markere at et felt er obligatorisk. Er satt til \"*Obligatorisk\" som standard."
|
|
4305
4306
|
},
|
|
4307
|
+
{
|
|
4308
|
+
"kind": "field",
|
|
4309
|
+
"name": "hideCheckmark",
|
|
4310
|
+
"type": {
|
|
4311
|
+
"text": "boolean"
|
|
4312
|
+
},
|
|
4313
|
+
"default": "false",
|
|
4314
|
+
"description": "Settes dersom man ikke ønsker å ha checkmark på valgte options i dropdown"
|
|
4315
|
+
},
|
|
4306
4316
|
{
|
|
4307
4317
|
"kind": "field",
|
|
4308
4318
|
"name": "errorMessage",
|
|
@@ -4400,6 +4410,13 @@
|
|
|
4400
4410
|
},
|
|
4401
4411
|
"description": "Tekst som vises for å markere at et felt er obligatorisk. Er satt til \"*Obligatorisk\" som standard."
|
|
4402
4412
|
},
|
|
4413
|
+
{
|
|
4414
|
+
"name": "hideCheckmark",
|
|
4415
|
+
"type": {
|
|
4416
|
+
"text": "boolean"
|
|
4417
|
+
},
|
|
4418
|
+
"description": "Settes dersom man ikke ønsker å ha checkmark på valgte options i dropdown"
|
|
4419
|
+
},
|
|
4403
4420
|
{
|
|
4404
4421
|
"name": "errorMessage",
|
|
4405
4422
|
"type": {
|
|
@@ -6670,7 +6687,7 @@
|
|
|
6670
6687
|
"package": {
|
|
6671
6688
|
"name": "nve-designsystem",
|
|
6672
6689
|
"description": "Designsystem for NVE",
|
|
6673
|
-
"version": "2.
|
|
6690
|
+
"version": "2.8.0",
|
|
6674
6691
|
"author": {
|
|
6675
6692
|
"name": "NVE",
|
|
6676
6693
|
"email": "nve@nve.no"
|
package/package.json
CHANGED
|
@@ -716,7 +716,7 @@
|
|
|
716
716
|
},
|
|
717
717
|
{
|
|
718
718
|
"name": "nve-option",
|
|
719
|
-
"description": "Representerer et valg i nve-select.\n---\n\n\n### **Metoder:**\n - **getTextLabel(): _string_** - Gir tilbake plain-tekst-label som vises i select",
|
|
719
|
+
"description": "Representerer et valg i nve-select.\n---\n\n\n### **Metoder:**\n - **firstUpdated(changedProperties: _PropertyValues_): _void_** - Setter filled attributt på option når parent-select er filled, for å få annen hover-farge\nSetter så hide-checkmark basert på samme logikk\n- **getTextLabel(): _string_** - Gir tilbake plain-tekst-label som vises i select",
|
|
720
720
|
"attributes": [
|
|
721
721
|
{
|
|
722
722
|
"name": "textLabel",
|
|
@@ -828,6 +828,11 @@
|
|
|
828
828
|
"description": "Tekst som vises for å markere at et felt er obligatorisk. Er satt til \"*Obligatorisk\" som standard.",
|
|
829
829
|
"values": []
|
|
830
830
|
},
|
|
831
|
+
{
|
|
832
|
+
"name": "hideCheckmark",
|
|
833
|
+
"description": "Settes dersom man ikke ønsker å ha checkmark på valgte options i dropdown",
|
|
834
|
+
"values": []
|
|
835
|
+
},
|
|
831
836
|
{
|
|
832
837
|
"name": "errorMessage",
|
|
833
838
|
"description": "Brukes til enkel constraint validation til å overskrive default nettleser-melding",
|