nve-designsystem 0.4.11 → 0.4.12

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.
@@ -1,11 +1,20 @@
1
1
  import { default as SlOption } from '@shoelace-style/shoelace/dist/components/option/option.js';
2
+ import { PropertyValues } from 'lit';
2
3
  /**
3
4
  * Representerer et valg i nve-select.
4
5
  */
5
6
  export default class NveOption extends SlOption {
6
7
  constructor();
7
8
  static styles: import('lit').CSSResultGroup[];
8
- firstUpdated(changedProperties: any): void;
9
+ /**
10
+ * Tekst som vises i select når denne er valgt. Default er at all råtekst vises.
11
+ */
12
+ textLabel: string | undefined;
13
+ firstUpdated(changedProperties: PropertyValues): void;
14
+ /**
15
+ * Gir tilbake plain-tekst-label som vises i select
16
+ */
17
+ getTextLabel(): string;
9
18
  }
10
19
  declare global {
11
20
  interface HTMLElementTagNameMap {
@@ -2,17 +2,16 @@ import { o as f } from "../../chunks/chunk.MXB57G5B.js";
2
2
  import "../../chunks/chunk.6CTB5ZDJ.js";
3
3
  import "../../chunks/chunk.QCFOL4VF.js";
4
4
  import "../../chunks/chunk.EVP45OG4.js";
5
- import { t as u } from "../../chunks/property.js";
6
- import "../../chunks/lit-element.js";
7
- import a from "./nve-option.styles.js";
8
- var m = Object.defineProperty, n = Object.getOwnPropertyDescriptor, v = (r, t, o, s) => {
9
- for (var e = s > 1 ? void 0 : s ? n(t, o) : t, i = r.length - 1, l; i >= 0; i--)
10
- (l = r[i]) && (e = (s ? l(t, o, e) : l(e)) || e);
11
- return s && e && m(t, o, e), e;
5
+ import { n as u, t as n } from "../../chunks/property.js";
6
+ import b from "./nve-option.styles.js";
7
+ var v = Object.defineProperty, d = Object.getOwnPropertyDescriptor, a = (r, t, o, s) => {
8
+ for (var e = s > 1 ? void 0 : s ? d(t, o) : t, i = r.length - 1, p; i >= 0; i--)
9
+ (p = r[i]) && (e = (s ? p(t, o, e) : p(e)) || e);
10
+ return s && e && v(t, o, e), e;
12
11
  };
13
- let p = class extends f {
12
+ let l = class extends f {
14
13
  constructor() {
15
- super();
14
+ super(), this.textLabel = void 0;
16
15
  }
17
16
  /* Setter filled attributt på option når parent-select er filled, for å få annen hover-farge*/
18
17
  firstUpdated(r) {
@@ -20,11 +19,20 @@ let p = class extends f {
20
19
  const t = this.closest("nve-select");
21
20
  t != null && t.hasAttribute("filled") ? this.toggleAttribute("filled", !0) : this.toggleAttribute("filled", !1);
22
21
  }
22
+ /**
23
+ * Gir tilbake plain-tekst-label som vises i select
24
+ */
25
+ getTextLabel() {
26
+ return this.textLabel ? this.textLabel : super.getTextLabel();
27
+ }
23
28
  };
24
- p.styles = [f.styles, a];
25
- p = v([
26
- u("nve-option")
27
- ], p);
29
+ l.styles = [f.styles, b];
30
+ a([
31
+ u()
32
+ ], l.prototype, "textLabel", 2);
33
+ l = a([
34
+ n("nve-option")
35
+ ], l);
28
36
  export {
29
- p as default
37
+ l as default
30
38
  };
@@ -1,4 +1,5 @@
1
1
  import { default as SlSelect } from '@shoelace-style/shoelace/dist/components/select/select.js';
2
+ import { PropertyValues } from 'lit';
2
3
  /**
3
4
  * En nedtrekksliste, også kjent som rullgardin eller drop-down list. Kjært barn har mange navn.
4
5
  * TODO: Klarte ikke å sette feil-ikonet når validering feiler. Eneste måte å gjøre det på kunne ha vært å bruke ::after pseudo-element på noen av sl-select partene, men
@@ -19,8 +20,8 @@ export default class NveSelect extends SlSelect {
19
20
  disconnectedCallback(): void;
20
21
  constructor();
21
22
  static styles: import('lit').CSSResultGroup[];
22
- protected firstUpdated(changedProperties: any): void;
23
- updated(changedProperties: any): void;
23
+ protected firstUpdated(changedProperties: PropertyValues): void;
24
+ updated(changedProperties: PropertyValues): void;
24
25
  focus(): void;
25
26
  private handleOptionClick;
26
27
  private handleDefaultSlotChange;
@@ -5956,6 +5956,15 @@
5956
5956
  "static": true,
5957
5957
  "default": "[SlOption.styles, styles]"
5958
5958
  },
5959
+ {
5960
+ "kind": "field",
5961
+ "name": "textLabel",
5962
+ "type": {
5963
+ "text": "string | undefined"
5964
+ },
5965
+ "default": "undefined",
5966
+ "description": "Tekst som vises i select når denne er valgt. Default er at all råtekst vises."
5967
+ },
5959
5968
  {
5960
5969
  "kind": "method",
5961
5970
  "name": "firstUpdated",
@@ -5968,11 +5977,21 @@
5968
5977
  {
5969
5978
  "name": "changedProperties",
5970
5979
  "type": {
5971
- "text": "any"
5980
+ "text": "PropertyValues"
5972
5981
  }
5973
5982
  }
5974
5983
  ]
5975
5984
  },
5985
+ {
5986
+ "kind": "method",
5987
+ "name": "getTextLabel",
5988
+ "return": {
5989
+ "type": {
5990
+ "text": "string"
5991
+ }
5992
+ },
5993
+ "description": "Gir tilbake plain-tekst-label som vises i select"
5994
+ },
5976
5995
  {
5977
5996
  "kind": "field",
5978
5997
  "name": "dependencies",
@@ -6076,14 +6095,6 @@
6076
6095
  "inheritedFrom": {
6077
6096
  "name": "SlOption"
6078
6097
  }
6079
- },
6080
- {
6081
- "kind": "method",
6082
- "name": "getTextLabel",
6083
- "description": "Returns a plain text label based on the option's content.",
6084
- "inheritedFrom": {
6085
- "name": "SlOption"
6086
- }
6087
6098
  }
6088
6099
  ],
6089
6100
  "superclass": {
@@ -8216,7 +8227,7 @@
8216
8227
  {
8217
8228
  "name": "changedProperties",
8218
8229
  "type": {
8219
- "text": "any"
8230
+ "text": "PropertyValues"
8220
8231
  }
8221
8232
  }
8222
8233
  ]
@@ -8228,7 +8239,7 @@
8228
8239
  {
8229
8240
  "name": "changedProperties",
8230
8241
  "type": {
8231
- "text": "any"
8242
+ "text": "PropertyValues"
8232
8243
  }
8233
8244
  }
8234
8245
  ]
@@ -11380,7 +11391,7 @@
11380
11391
  "package": {
11381
11392
  "name": "nve-designsystem",
11382
11393
  "description": "Designsystem for NVE",
11383
- "version": "0.4.10",
11394
+ "version": "0.4.11",
11384
11395
  "author": {
11385
11396
  "name": "NVE",
11386
11397
  "email": "nve@nve.no"
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "MIT",
9
9
  "homepage": "https://github.com/NVE/Designsystem/",
10
- "version": "0.4.11",
10
+ "version": "0.4.12",
11
11
  "customElements": "custom-elements.json",
12
12
  "exports": {
13
13
  ".": {