nve-designsystem 0.1.15 → 0.1.17

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.
@@ -11,7 +11,7 @@ import { SlDialog } from '@shoelace-style/shoelace';
11
11
  * @slot footer - feltet i bunden hvor knappene er plassert
12
12
  *
13
13
  */
14
- export declare class NveDialog extends SlDialog {
14
+ export default class NveDialog extends SlDialog {
15
15
  /**
16
16
  * Ikonet som skal vises
17
17
  */
@@ -1,5 +1,5 @@
1
1
  import { SlDropdown } from '@shoelace-style/shoelace';
2
- import { NveMenu } from '../nve-menu/nve-menu.component';
2
+ import NveMenu from '../nve-menu/nve-menu.component';
3
3
  /**
4
4
  * En Shoelace-dropdown i NVE-forkledning.
5
5
  * Se https://shoelace.style/components/dropdown
@@ -4,21 +4,36 @@ import { SlInput } from '@shoelace-style/shoelace';
4
4
  * Mer info: https://shoelace.style/components/input
5
5
  *
6
6
  * Vil du ha info-ikon med hjelpetekst etter ledeteksten, putt en nve-label i label-slot.
7
- *
8
7
  * Disse attributtene skal ikke brukes:
9
8
  * - pill
10
9
  *
11
- * TODO: Utropstegn-ikon ved valideringsfeil
12
- * TODO: Vise valideringsfeil med rød tekst under tekstfeltet
10
+ * TODO: Felte blir breddere når feil ikone vises. Alt på grunn av at det dukker opp i en slot. Hvis Vi bestemmer oss
11
+ * å ha en fast verdi sloten, kan det kanksje påvirke andre elementer som skal vises i sloten.
13
12
  */
14
13
  export default class NveInput extends SlInput {
15
14
  /**
16
15
  * Tekst som vises for å markere at et felt er obligatorisk. Er satt til "*Obligatorisk" som standard.
17
16
  */
18
17
  requiredLabel: string;
19
- constructor();
18
+ /**
19
+ * Brukes til enkel constraint validation til å overskrive default nettleseren melding
20
+ */
21
+ errorMessage?: string;
22
+ /**
23
+ * Hjelpe variabler som sjekker om input feltet er allerede invalid
24
+ */
25
+ protected alreadyInvalid: boolean;
20
26
  static styles: import("lit").CSSResultGroup[];
21
- updated(changedProperties: Map<string, unknown>): void;
27
+ constructor();
28
+ connectedCallback(): void;
29
+ disconnectedCallback(): void;
30
+ firstUpdated(): void;
31
+ updated(changedProperties: any): void;
32
+ private makeInvalid;
33
+ private resetValidation;
34
+ private showErrorMessage;
35
+ private showErrorIcon;
36
+ private hideErrorIcon;
22
37
  }
23
38
  declare global {
24
39
  interface HTMLElementTagNameMap {
@@ -1,5 +1,5 @@
1
1
  import { SlMenu } from '@shoelace-style/shoelace';
2
- export declare class NveMenu extends SlMenu {
2
+ export default class NveMenu extends SlMenu {
3
3
  constructor();
4
4
  static styles: import("lit").CSSResultGroup[];
5
5
  }
@@ -4,7 +4,7 @@ import { SlMenuItem } from '@shoelace-style/shoelace';
4
4
  * Mer info: https://shoelace.style/components/menu-item
5
5
  *
6
6
  */
7
- export declare class NveMenuItem extends SlMenuItem {
7
+ export default class NveMenuItem extends SlMenuItem {
8
8
  /**
9
9
  * Tekst som vises som subtext(undertekst).
10
10
  */
package/index.d.ts CHANGED
@@ -3,9 +3,13 @@ export { default as NveAlert } from './components/nve-alert/nve-alert.component'
3
3
  export { default as NveButton } from './components/nve-button/nve-button.component';
4
4
  export { default as NveCheckbox } from './components/nve-checkbox/nve-checkbox.component';
5
5
  export { default as NveCheckboxGroup } from './components/nve-checkbox-group/nve-checkbox-group.component';
6
+ export { default as NveDialog } from './components/nve-dialog/nve-dialog.component';
7
+ export { default as NveDropdown } from './components/nve-dropdown/nve-dropdown.component';
6
8
  export { default as NveIcon } from './components/nve-icon/nve-icon.component';
7
9
  export { default as NveInput } from './components/nve-input/nve-input.component';
8
10
  export { default as NveLabel } from './components/nve-label/nve-label.component';
11
+ export { default as NveMenu } from './components/nve-menu/nve-menu.component';
12
+ export { default as NveMenuItem } from './components/nve-menu-item/nve-menu-item.component';
9
13
  export { default as NveRadio } from './components/nve-radio/nve-radio.component';
10
14
  export { default as NveRadioButton } from './components/nve-radio-button/nve-radio-button.component';
11
15
  export { default as NveRadioGroup } from './components/nve-radio-group/nve-radio-group.component';