@helsevestikt/hviktor-angular 0.0.17 → 0.0.18
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/fesm2022/helsevestikt-hviktor-angular.mjs +517 -1147
- package/fesm2022/helsevestikt-hviktor-angular.mjs.map +1 -1
- package/package.json +10 -4
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +95 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +4 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +22 -0
- package/styles.css +5 -0
- package/types/helsevestikt-hviktor-angular.d.ts +134 -204
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, OnInit,
|
|
3
|
-
import { Placement } from '@floating-ui/dom';
|
|
2
|
+
import { EventEmitter, OnInit, TemplateRef, AfterContentInit, ElementRef, QueryList, OnDestroy } from '@angular/core';
|
|
4
3
|
import { FormGroup, ValidatorFn, ReactiveFormsModule, ControlValueAccessor } from '@angular/forms';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -347,12 +346,12 @@ declare class HviDivider {
|
|
|
347
346
|
|
|
348
347
|
/**
|
|
349
348
|
* @summary
|
|
350
|
-
* Dropdown er en generisk nedtrekksliste. Den legger grunnmuren for å bygge menyer og lister
|
|
349
|
+
* Dropdown er en generisk nedtrekksliste. Den legger grunnmuren for å bygge menyer og lister.
|
|
351
350
|
*
|
|
352
351
|
* @example
|
|
353
352
|
* ```html
|
|
354
|
-
* <button hviButton popovertarget="myDropdown">Åpne dropdown</button
|
|
355
|
-
* <hvi-dropdown id="myDropdown"
|
|
353
|
+
* <button hviButton popovertarget="myDropdown">Åpne dropdown</button>
|
|
354
|
+
* <hvi-dropdown id="myDropdown">
|
|
356
355
|
* <ul>
|
|
357
356
|
* <li>
|
|
358
357
|
* <button hviButton variant="tertiary">Menylenke</button>
|
|
@@ -366,36 +365,24 @@ declare class HviDivider {
|
|
|
366
365
|
*
|
|
367
366
|
* @see {@link https://designsystemet.no/en/components/docs/dropdown/code}
|
|
368
367
|
*/
|
|
369
|
-
declare class HviDropdown
|
|
370
|
-
|
|
371
|
-
private cleanupAutoUpdate?;
|
|
372
|
-
private boundHandleClick?;
|
|
373
|
-
private boundHandleKeydown?;
|
|
374
|
-
/**ID to target the popover */
|
|
368
|
+
declare class HviDropdown {
|
|
369
|
+
/** ID to target the popover */
|
|
375
370
|
id?: string;
|
|
376
|
-
/**
|
|
371
|
+
/** Popover type - 'auto' lukkes ved klikk utenfor, 'manual' krever manuell lukking */
|
|
372
|
+
type: 'auto' | 'manual';
|
|
373
|
+
/** Variant */
|
|
377
374
|
variant?: 'default' | 'tertiary';
|
|
378
|
-
/** Plassering av
|
|
379
|
-
dropdownPlacement:
|
|
375
|
+
/** Plassering av dropdown relativt til trigger */
|
|
376
|
+
dropdownPlacement: 'top' | 'right' | 'bottom' | 'left';
|
|
380
377
|
/** Aktiver automatisk repositjonering hvis det ikke er plass */
|
|
381
378
|
autoPlacement: boolean;
|
|
382
|
-
/** Event når
|
|
379
|
+
/** Event når dropdown åpnes */
|
|
383
380
|
opened: EventEmitter<void>;
|
|
384
|
-
/** Event når
|
|
381
|
+
/** Event når dropdown lukkes */
|
|
385
382
|
closed: EventEmitter<void>;
|
|
386
|
-
|
|
387
|
-
private get triggerElement();
|
|
388
|
-
ngOnInit(): void;
|
|
389
|
-
ngOnDestroy(): void;
|
|
390
|
-
private setupEventListeners;
|
|
391
|
-
private removeEventListeners;
|
|
392
|
-
private handleBeforeToggle;
|
|
393
|
-
private handleToggle;
|
|
394
|
-
private updatePosition;
|
|
395
|
-
private startAutoUpdate;
|
|
396
|
-
private stopAutoUpdate;
|
|
383
|
+
onToggle(event: ToggleEvent): void;
|
|
397
384
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviDropdown, never>;
|
|
398
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HviDropdown, "hvi-dropdown", never, { "id": { "alias": "id"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "dropdownPlacement": { "alias": "dropdownPlacement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
|
|
385
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviDropdown, "hvi-dropdown", never, { "id": { "alias": "id"; "required": false; }; "type": { "alias": "type"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "dropdownPlacement": { "alias": "dropdownPlacement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
|
|
399
386
|
}
|
|
400
387
|
|
|
401
388
|
type HviValidationMessages = Partial<Record<string, string>>;
|
|
@@ -497,6 +484,7 @@ type HviErrorSummaryMessages = Record<string, HviValidationMessages>;
|
|
|
497
484
|
* Documentation: https://designsystemet.no/en/components/docs/error-summary/code
|
|
498
485
|
*/
|
|
499
486
|
declare class HviErrorSummary {
|
|
487
|
+
private readonly el;
|
|
500
488
|
/** Heading text shown above the list */
|
|
501
489
|
heading: string;
|
|
502
490
|
/** Heading level for the heading element (1-6). Defaults to 2 per DS */
|
|
@@ -524,11 +512,8 @@ declare class HviErrorSummary {
|
|
|
524
512
|
idMap?: Record<string, string>;
|
|
525
513
|
/** Auto mode: error key priority (first match wins) */
|
|
526
514
|
errorPriority: readonly string[];
|
|
527
|
-
/** Used for aria-labelledby on the container */
|
|
528
|
-
headingId: string;
|
|
529
515
|
/** When to show errors from the form controls */
|
|
530
516
|
showWhen: 'submitted' | 'touched' | 'always';
|
|
531
|
-
private container?;
|
|
532
517
|
focus(): void;
|
|
533
518
|
/**
|
|
534
519
|
* Handles click on error links to prevent Angular Router navigation
|
|
@@ -541,14 +526,9 @@ declare class HviErrorSummary {
|
|
|
541
526
|
get shouldShow(): boolean;
|
|
542
527
|
private anyInvalidTouched;
|
|
543
528
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviErrorSummary, never>;
|
|
544
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HviErrorSummary, "hvi-error-summary", never, { "heading": { "alias": "heading"; "required": false; }; "headingLevel": { "alias": "headingLevel"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "form": { "alias": "form"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "idMap": { "alias": "idMap"; "required": false; }; "errorPriority": { "alias": "errorPriority"; "required": false; }; "
|
|
529
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviErrorSummary, "hvi-error-summary", never, { "heading": { "alias": "heading"; "required": false; }; "headingLevel": { "alias": "headingLevel"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "form": { "alias": "form"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "idMap": { "alias": "idMap"; "required": false; }; "errorPriority": { "alias": "errorPriority"; "required": false; }; "showWhen": { "alias": "showWhen"; "required": false; }; }, {}, never, never, true, never>;
|
|
545
530
|
}
|
|
546
531
|
|
|
547
|
-
declare function fieldObserver(fieldElement: HTMLElement | null): (() => void) | undefined;
|
|
548
|
-
declare const isElement: (node: Node) => node is Element;
|
|
549
|
-
declare const isLabel: (node: Node) => node is HTMLLabelElement;
|
|
550
|
-
declare const isInputLike: (node: unknown) => node is HTMLInputElement;
|
|
551
|
-
|
|
552
532
|
/**
|
|
553
533
|
* Decorative affix container displayed alongside a text input.
|
|
554
534
|
*
|
|
@@ -594,68 +574,32 @@ declare class HviFieldAffixes {
|
|
|
594
574
|
}
|
|
595
575
|
|
|
596
576
|
/**
|
|
597
|
-
* Counter
|
|
577
|
+
* Counter that displays remaining/exceeded character count for a field.
|
|
598
578
|
*
|
|
599
|
-
* @remarks
|
|
600
|
-
* Shows a visual counter and provides accessible announcements via aria-live.
|
|
601
579
|
* Must be used inside a `hvi-field` component alongside a textarea or input.
|
|
602
|
-
*
|
|
603
|
-
* The component automatically finds and tracks the input/textarea in the same field,
|
|
580
|
+
* The ds-field web component automatically tracks the input/textarea,
|
|
604
581
|
* so you only need to provide the `limit` property.
|
|
605
582
|
*
|
|
606
583
|
* @example
|
|
607
|
-
* Simple usage (auto-tracking):
|
|
608
584
|
* ```html
|
|
609
585
|
* <hvi-field>
|
|
610
586
|
* <label hviLabel for="description" weight="medium">Beskrivelse</label>
|
|
611
|
-
* <textarea hviInput id="description" rows="3"
|
|
587
|
+
* <textarea hviInput id="description" rows="3"></textarea>
|
|
612
588
|
* <hvi-field-counter [limit]="100" />
|
|
613
589
|
* </hvi-field>
|
|
614
590
|
* ```
|
|
615
591
|
*
|
|
616
|
-
* @example
|
|
617
|
-
* Manual tracking (for custom scenarios):
|
|
618
|
-
* ```html
|
|
619
|
-
* <hvi-field>
|
|
620
|
-
* <label hviLabel for="description" weight="medium">Beskrivelse</label>
|
|
621
|
-
* <textarea hviInput id="description" rows="3" #textarea></textarea>
|
|
622
|
-
* <hvi-field-counter [limit]="100" [count]="textarea.value.length" />
|
|
623
|
-
* </hvi-field>
|
|
624
|
-
* ```
|
|
625
|
-
*
|
|
626
592
|
* Documentation: https://designsystemet.no/en/components/docs/field/code
|
|
627
593
|
*/
|
|
628
|
-
declare class HviFieldCounter
|
|
629
|
-
private readonly el;
|
|
630
|
-
private readonly destroyRef;
|
|
631
|
-
/** Auto-tracked character count from the input/textarea in the same field */
|
|
632
|
-
private readonly autoCount;
|
|
633
|
-
/**
|
|
634
|
-
* Current character count. If not provided, the component will
|
|
635
|
-
* automatically track the input/textarea in the same hvi-field.
|
|
636
|
-
*/
|
|
637
|
-
count: i0.InputSignal<number | undefined>;
|
|
594
|
+
declare class HviFieldCounter {
|
|
638
595
|
/** Maximum allowed characters */
|
|
639
596
|
limit: i0.InputSignal<number>;
|
|
640
597
|
/** Label template when limit is exceeded. Use %d for the count. */
|
|
641
|
-
over: i0.InputSignal<string>;
|
|
598
|
+
over: i0.InputSignal<string | undefined>;
|
|
642
599
|
/** Label template for remaining characters. Use %d for the count. */
|
|
643
|
-
under: i0.InputSignal<string>;
|
|
644
|
-
/** Hint text for screen readers about max characters. Use %d for the limit. */
|
|
645
|
-
hint: i0.InputSignal<string>;
|
|
646
|
-
/** Effective count - uses manual count if provided, otherwise auto-tracked */
|
|
647
|
-
private readonly effectiveCount;
|
|
648
|
-
/** Computed difference between limit and current count */
|
|
649
|
-
remaining: i0.Signal<number>;
|
|
650
|
-
/** Whether the limit has been exceeded */
|
|
651
|
-
isOver: i0.Signal<boolean>;
|
|
652
|
-
/** The formatted message to display */
|
|
653
|
-
message: i0.Signal<string>;
|
|
654
|
-
/** The formatted hint for screen readers */
|
|
655
|
-
formattedHint: i0.Signal<string>;
|
|
656
|
-
ngAfterViewInit(): void;
|
|
600
|
+
under: i0.InputSignal<string | undefined>;
|
|
657
601
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldCounter, never>;
|
|
658
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldCounter, "hvi-field-counter", never, { "
|
|
602
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldCounter, "hvi-field-counter", never, { "limit": { "alias": "limit"; "required": true; "isSignal": true; }; "over": { "alias": "over"; "required": false; "isSignal": true; }; "under": { "alias": "under"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
659
603
|
}
|
|
660
604
|
|
|
661
605
|
declare class HviFieldDescription {
|
|
@@ -674,7 +618,8 @@ declare class HviFieldValidation {
|
|
|
674
618
|
}
|
|
675
619
|
|
|
676
620
|
/**
|
|
677
|
-
*
|
|
621
|
+
* @summary
|
|
622
|
+
* Field kobler automatisk sammen label, beskrivelse, validering og input via ds-field web component.
|
|
678
623
|
*
|
|
679
624
|
* @example
|
|
680
625
|
* ```html
|
|
@@ -686,14 +631,11 @@ declare class HviFieldValidation {
|
|
|
686
631
|
* </hvi-field>
|
|
687
632
|
* ```
|
|
688
633
|
*
|
|
689
|
-
*
|
|
634
|
+
* @see {@link https://designsystemet.no/en/components/docs/field/overview}
|
|
690
635
|
*/
|
|
691
|
-
declare class HviField
|
|
636
|
+
declare class HviField {
|
|
692
637
|
/** Position of toggle inputs (radio, checkbox, switch) in field */
|
|
693
638
|
position?: 'start' | 'end';
|
|
694
|
-
private readonly el;
|
|
695
|
-
private readonly destroyRef;
|
|
696
|
-
ngAfterViewInit(): void;
|
|
697
639
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviField, never>;
|
|
698
640
|
static ɵcmp: i0.ɵɵComponentDeclaration<HviField, "hvi-field", never, { "position": { "alias": "position"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
699
641
|
}
|
|
@@ -755,21 +697,39 @@ declare class HviInput {
|
|
|
755
697
|
static ngAcceptInputType_readonly: unknown;
|
|
756
698
|
}
|
|
757
699
|
|
|
700
|
+
/** Resultatet av required-analysen av en FormGroup. */
|
|
701
|
+
type FormRequiredMode = 'all-required' | 'mixed' | 'none';
|
|
758
702
|
/**
|
|
759
|
-
*
|
|
760
|
-
*
|
|
761
|
-
*
|
|
762
|
-
*
|
|
763
|
-
* -
|
|
703
|
+
* Analyserer en FormGroup og returnerer required-modus.
|
|
704
|
+
*
|
|
705
|
+
* Alle controls telles – også de uten validators (de regnes som optional).
|
|
706
|
+
*
|
|
707
|
+
* - `'all-required'` – alle controls har required/requiredTrue
|
|
708
|
+
* - `'mixed'` – noen controls er required, noen ikke
|
|
709
|
+
* - `'none'` – ingen controls har required
|
|
710
|
+
*/
|
|
711
|
+
declare function analyzeFormRequired(formGroup: FormGroup): FormRequiredMode;
|
|
712
|
+
/**
|
|
713
|
+
* Legges på `<form>` for å gi submit-håndtering og automatisk required-tag-analyse
|
|
714
|
+
* for Angular reactive forms.
|
|
715
|
+
*
|
|
716
|
+
* - Tracker submitted-state
|
|
717
|
+
* - Marker alle controls som touched ved submit
|
|
718
|
+
* - Analyserer FormGroup og eksponerer `requiredMode()` som child-komponenter
|
|
719
|
+
* (f.eks. `HviTextfield`) kan injisere for automatisk required/optional-tagging
|
|
720
|
+
* - Sett `[showRequiredTags]="false"` for å skru av automatisk tagging
|
|
764
721
|
*
|
|
765
722
|
* @example
|
|
766
723
|
* ```html
|
|
767
|
-
* <
|
|
724
|
+
* <form hviForm [formGroup]="myForm">
|
|
725
|
+
* @if (myHviForm.requiredMode() === 'all-required') {
|
|
726
|
+
* <hvi-required-tag mode="all-required" />
|
|
727
|
+
* }
|
|
728
|
+
* <hvi-textfield label="Navn" formControlName="name" />
|
|
729
|
+
* </form>
|
|
768
730
|
* ```
|
|
769
|
-
*
|
|
770
|
-
* Documentation: https://designsystemet.no/en/components/docs/form/code
|
|
771
731
|
*/
|
|
772
|
-
declare class HviForm {
|
|
732
|
+
declare class HviForm implements OnInit {
|
|
773
733
|
/** Emits when the form has been submitted */
|
|
774
734
|
hviSubmitted: EventEmitter<void>;
|
|
775
735
|
/** True after first submit attempt */
|
|
@@ -778,10 +738,28 @@ declare class HviForm {
|
|
|
778
738
|
focusOnInvalid?: {
|
|
779
739
|
focus?: () => void;
|
|
780
740
|
} | null;
|
|
741
|
+
/**
|
|
742
|
+
* Skru av/på automatisk required-tag-visning for child-komponenter.
|
|
743
|
+
* Default `true`. Sett til `false` for manuell kontroll.
|
|
744
|
+
*/
|
|
745
|
+
showRequiredTags: boolean;
|
|
781
746
|
private readonly formGroupDir;
|
|
747
|
+
/** Internal signal som oppdateres ved submit og init */
|
|
748
|
+
private readonly _requiredMode;
|
|
749
|
+
/**
|
|
750
|
+
* Analysert required-modus for FormGroup-en.
|
|
751
|
+
* - `'all-required'` – alle validerte controls er required
|
|
752
|
+
* - `'mixed'` – blanding av required og optional
|
|
753
|
+
* - `'none'` – ingen required-validering
|
|
754
|
+
*/
|
|
755
|
+
readonly requiredMode: i0.Signal<FormRequiredMode>;
|
|
756
|
+
/** Oppdater required-analyse. Kalles automatisk ved submit, men kan kalles manuelt. */
|
|
757
|
+
refreshRequiredMode(): void;
|
|
782
758
|
onSubmit(event: Event): void;
|
|
759
|
+
ngOnInit(): void;
|
|
783
760
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviForm, never>;
|
|
784
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HviForm, "form[hviForm]",
|
|
761
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviForm, "form[hviForm]", ["hviForm"], { "focusOnInvalid": { "alias": "focusOnInvalid"; "required": false; }; "showRequiredTags": { "alias": "showRequiredTags"; "required": false; }; }, { "hviSubmitted": "hviSubmitted"; }, never, never, true, never>;
|
|
762
|
+
static ngAcceptInputType_showRequiredTags: unknown;
|
|
785
763
|
}
|
|
786
764
|
|
|
787
765
|
/**
|
|
@@ -945,9 +923,40 @@ declare function hviCustom(key: string, validator: ValidatorFn, message: string)
|
|
|
945
923
|
*/
|
|
946
924
|
declare function hviNullValidator(): HviValidatorBundle;
|
|
947
925
|
|
|
948
|
-
|
|
926
|
+
/** Tilgjengelige modes for RequiredTag. */
|
|
927
|
+
type RequiredTagMode = 'all-required' | 'required' | 'optional';
|
|
928
|
+
/**
|
|
929
|
+
* RequiredTag brukes sammen med labels i skjema for å indikere om et felt er
|
|
930
|
+
* påkrevd, valgfritt, eller om alle felt må fylles ut.
|
|
931
|
+
*
|
|
932
|
+
* Komponenten wrapper `HviTag` med forhåndsdefinerte tekster og farger basert på mode.
|
|
933
|
+
* Bruker `display: contents` slik at den fungerer inline i `<label>` og frittstående.
|
|
934
|
+
*
|
|
935
|
+
* Kan brukes manuelt, eller automatisk via `HviForm` som analyserer FormGroup
|
|
936
|
+
* og lar child-komponenter som `HviTextfield` vise riktig tag.
|
|
937
|
+
*
|
|
938
|
+
* @example
|
|
939
|
+
* ```html
|
|
940
|
+
* <hvi-required-tag />
|
|
941
|
+
* <hvi-required-tag mode="optional" />
|
|
942
|
+
* <hvi-required-tag mode="all-required" />
|
|
943
|
+
* ```
|
|
944
|
+
*/
|
|
945
|
+
declare class HviRequiredTag {
|
|
946
|
+
/**
|
|
947
|
+
* Bestemmer tekst og farge på taggen.
|
|
948
|
+
* - `required` (default): "Må fylles ut" (warning)
|
|
949
|
+
* - `optional`: "Valgfritt" (info)
|
|
950
|
+
* - `all-required`: "Alle felt må fylles ut" (warning)
|
|
951
|
+
*/
|
|
952
|
+
mode: RequiredTagMode;
|
|
953
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviRequiredTag, never>;
|
|
954
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviRequiredTag, "hvi-required-tag", never, { "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
declare const HviFieldKit: readonly [typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviFieldCounter, typeof HviRequiredTag];
|
|
949
958
|
declare const HviValidationKit: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage];
|
|
950
|
-
declare const HviForms: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage, typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviFieldCounter, typeof HviInput, typeof HviFieldset, typeof HviErrorSummary];
|
|
959
|
+
declare const HviForms: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage, typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviFieldCounter, typeof HviRequiredTag, typeof HviInput, typeof HviFieldset, typeof HviErrorSummary];
|
|
951
960
|
|
|
952
961
|
/**
|
|
953
962
|
* Heading is used to structure content and create hierarchy on a page.
|
|
@@ -966,25 +975,6 @@ declare class HviHeading {
|
|
|
966
975
|
static ɵdir: i0.ɵɵDirectiveDeclaration<HviHeading, "h1[hviHeading], h2[hviHeading], h3[hviHeading], h4[hviHeading], h5[hviHeading], h6[hviHeading]", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
|
|
967
976
|
}
|
|
968
977
|
|
|
969
|
-
type IconName = 'ArrowRight' | 'ArrowLeft' | 'ArrowUp' | 'ArrowDown' | 'ExclamationmarkTriangle' | 'Triangle' | 'Person';
|
|
970
|
-
type IconSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
971
|
-
type IconColor = 'currentColor' | 'danger';
|
|
972
|
-
|
|
973
|
-
declare class HviIcon implements OnChanges {
|
|
974
|
-
icon: IconName;
|
|
975
|
-
color?: IconColor;
|
|
976
|
-
size: IconSize;
|
|
977
|
-
ariaHidden: boolean;
|
|
978
|
-
private readonly http;
|
|
979
|
-
private readonly elementRef;
|
|
980
|
-
private readonly cdr;
|
|
981
|
-
ngOnChanges(): void;
|
|
982
|
-
private loadIcon;
|
|
983
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HviIcon, never>;
|
|
984
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HviIcon, "hvi-icon", never, { "icon": { "alias": "icon"; "required": true; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "ariaHidden": { "alias": "ariaHidden"; "required": false; }; }, {}, never, never, true, never>;
|
|
985
|
-
static ngAcceptInputType_ariaHidden: unknown;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
978
|
/**
|
|
989
979
|
* Label functions as a clear and accessible text label that tells the user what an associated form element is about.
|
|
990
980
|
*
|
|
@@ -1242,65 +1232,26 @@ declare class HviParagraph {
|
|
|
1242
1232
|
*
|
|
1243
1233
|
* @see {@link https://designsystemet.no/en/components/docs/popover/code}
|
|
1244
1234
|
*/
|
|
1245
|
-
declare class HviPopover
|
|
1246
|
-
|
|
1247
|
-
private cleanupAutoUpdate?;
|
|
1248
|
-
private boundHandleClick?;
|
|
1249
|
-
private boundHandleKeydown?;
|
|
1250
|
-
/** Popover type - 'manual' krever manuell lukking, 'auto' lukkes ved klikk utenfor */
|
|
1235
|
+
declare class HviPopover {
|
|
1236
|
+
/** Popover type - 'auto' lukkes ved klikk utenfor eller Escape, 'manual' krever manuell lukking */
|
|
1251
1237
|
type: 'auto' | 'manual' | 'hint';
|
|
1252
1238
|
/** Visuell variant */
|
|
1253
1239
|
variant: 'default' | 'tinted';
|
|
1254
1240
|
/** Farge-tema */
|
|
1255
1241
|
color: 'neutral' | 'danger' | 'info' | 'success' | 'warning';
|
|
1256
1242
|
/** Plassering av popover relativt til trigger */
|
|
1257
|
-
placement:
|
|
1243
|
+
placement: 'top' | 'right' | 'bottom' | 'left';
|
|
1258
1244
|
/** Aktiver automatisk repositjonering hvis det ikke er plass */
|
|
1259
1245
|
autoPlacement: boolean;
|
|
1260
1246
|
/** Event når popover åpnes */
|
|
1261
1247
|
opened: EventEmitter<void>;
|
|
1262
1248
|
/** Event når popover lukkes */
|
|
1263
1249
|
closed: EventEmitter<void>;
|
|
1264
|
-
|
|
1265
|
-
private get triggerElement();
|
|
1266
|
-
ngOnInit(): void;
|
|
1267
|
-
ngOnDestroy(): void;
|
|
1268
|
-
private setupEventListeners;
|
|
1269
|
-
private removeEventListeners;
|
|
1270
|
-
private handleBeforeToggle;
|
|
1271
|
-
private handleToggle;
|
|
1272
|
-
private updatePosition;
|
|
1273
|
-
private startAutoUpdate;
|
|
1274
|
-
private stopAutoUpdate;
|
|
1250
|
+
onToggle(event: ToggleEvent): void;
|
|
1275
1251
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviPopover, never>;
|
|
1276
1252
|
static ɵcmp: i0.ɵɵComponentDeclaration<HviPopover, "hvi-popover", never, { "type": { "alias": "type"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; }, never, ["*"], true, never>;
|
|
1277
1253
|
}
|
|
1278
1254
|
|
|
1279
|
-
/**
|
|
1280
|
-
* RequiredTag brukes sammen med labels i skjema for å indikere om et felt er
|
|
1281
|
-
* påkrevd, valgfritt, eller om alle felt må fylles ut.
|
|
1282
|
-
*
|
|
1283
|
-
* Komponenten wrapper `HviTag` med forhåndsdefinerte tekster og farger basert på mode.
|
|
1284
|
-
*
|
|
1285
|
-
* @example
|
|
1286
|
-
* ```html
|
|
1287
|
-
* <hvi-required-tag />
|
|
1288
|
-
* <hvi-required-tag mode="optional" />
|
|
1289
|
-
* <hvi-required-tag mode="all-required" />
|
|
1290
|
-
* ```
|
|
1291
|
-
*/
|
|
1292
|
-
declare class HviRequiredTag {
|
|
1293
|
-
/**
|
|
1294
|
-
* Bestemmer tekst og farge på taggen.
|
|
1295
|
-
* - `required` (default): "Må fylles ut" (warning)
|
|
1296
|
-
* - `optional`: "Valgfritt" (info)
|
|
1297
|
-
* - `all-required`: "Alle felt må fylles ut" (warning)
|
|
1298
|
-
*/
|
|
1299
|
-
mode: 'all-required' | 'required' | 'optional';
|
|
1300
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HviRequiredTag, never>;
|
|
1301
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HviRequiredTag, "hvi-required-tag", never, { "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
1255
|
/**
|
|
1305
1256
|
* @summary
|
|
1306
1257
|
* SearchClear is a button directive for clearing the search input.
|
|
@@ -1820,12 +1771,26 @@ declare class HviTextfield implements ControlValueAccessor {
|
|
|
1820
1771
|
/** Character counter limit. Displays a counter below the field. */
|
|
1821
1772
|
counterLimit?: number;
|
|
1822
1773
|
/**
|
|
1823
|
-
*
|
|
1824
|
-
*
|
|
1774
|
+
* Manuell overstyring av required-tag-mode.
|
|
1775
|
+
* Når satt, vises taggen uavhengig av HviForm-kontekst.
|
|
1776
|
+
* - `'required'`: "Må fylles ut" (warning)
|
|
1777
|
+
* - `'optional'`: "Valgfritt" (info)
|
|
1778
|
+
*
|
|
1779
|
+
* Når IKKE satt og feltet er inne i en `<form hviForm>`, bestemmes mode automatisk:
|
|
1780
|
+
* - Form er `'all-required'` → ingen tag per felt (vis `all-required` øverst i form)
|
|
1781
|
+
* - Form er `'mixed'` → `'required'` hvis feltet er required, `'optional'` hvis ikke
|
|
1782
|
+
* - Form er `'none'` → ingen tag
|
|
1825
1783
|
*/
|
|
1826
|
-
|
|
1784
|
+
requiredMode?: RequiredTagMode;
|
|
1827
1785
|
/** Autocomplete attribute for the input, e.g. 'given-name', 'email'. */
|
|
1828
1786
|
autocomplete?: string;
|
|
1787
|
+
/** Injisert HviForm for automatisk required-tag-beregning */
|
|
1788
|
+
private readonly hviForm;
|
|
1789
|
+
/**
|
|
1790
|
+
* Beregnet required-tag-mode basert på manuell overstyring eller HviForm-kontekst.
|
|
1791
|
+
* Returnerer `null` hvis ingen tag skal vises.
|
|
1792
|
+
*/
|
|
1793
|
+
get effectiveRequiredMode(): RequiredTagMode | null;
|
|
1829
1794
|
/** Render a textarea instead of input for multiline support */
|
|
1830
1795
|
multiline: boolean;
|
|
1831
1796
|
/** Supported input types */
|
|
@@ -1861,7 +1826,7 @@ declare class HviTextfield implements ControlValueAccessor {
|
|
|
1861
1826
|
registerOnTouched(fn: () => void): void;
|
|
1862
1827
|
setDisabledState(isDisabled: boolean): void;
|
|
1863
1828
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviTextfield, never>;
|
|
1864
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<HviTextfield, "hvi-textfield", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "error": { "alias": "error"; "required": false; }; "counterLimit": { "alias": "counterLimit"; "required": false; }; "
|
|
1829
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviTextfield, "hvi-textfield", never, { "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "error": { "alias": "error"; "required": false; }; "counterLimit": { "alias": "counterLimit"; "required": false; }; "requiredMode": { "alias": "requiredMode"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "multiline": { "alias": "multiline"; "required": false; }; "type": { "alias": "type"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "size": { "alias": "size"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "value": { "alias": "value"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; }, {}, never, never, true, never>;
|
|
1865
1830
|
static ngAcceptInputType_multiline: unknown;
|
|
1866
1831
|
static ngAcceptInputType_required: unknown;
|
|
1867
1832
|
static ngAcceptInputType_disabled: unknown;
|
|
@@ -1982,51 +1947,16 @@ declare class HviToggleGroupItem implements OnInit, OnDestroy {
|
|
|
1982
1947
|
*
|
|
1983
1948
|
* @see {@link https://designsystemet.no/en/components/docs/tooltip/code}
|
|
1984
1949
|
*/
|
|
1985
|
-
declare class HviTooltip
|
|
1986
|
-
private el;
|
|
1987
|
-
private renderer;
|
|
1988
|
-
private tooltipElement;
|
|
1989
|
-
private tooltipId;
|
|
1990
|
-
private cleanupAutoUpdate?;
|
|
1991
|
-
private showTimeout?;
|
|
1992
|
-
private hideTimeout?;
|
|
1993
|
-
private isOpen;
|
|
1994
|
-
private listeners;
|
|
1950
|
+
declare class HviTooltip {
|
|
1995
1951
|
/** Tooltip content */
|
|
1996
1952
|
hviTooltip: string;
|
|
1997
1953
|
/** Placement of the tooltip relative to the trigger */
|
|
1998
|
-
tooltipPlacement:
|
|
1954
|
+
tooltipPlacement: 'top' | 'right' | 'bottom' | 'left';
|
|
1999
1955
|
/** Enable auto placement when there's not enough space */
|
|
2000
1956
|
tooltipAutoPlacement: boolean;
|
|
2001
|
-
/**
|
|
2002
|
-
* Override ARIA attribute type.
|
|
2003
|
-
* - 'describedby': tooltip describes the element (default for elements with text)
|
|
2004
|
-
* - 'labelledby': tooltip labels the element (default for icon-only buttons)
|
|
2005
|
-
*/
|
|
2006
|
-
tooltipType?: 'describedby' | 'labelledby';
|
|
2007
|
-
/** Delay before showing tooltip (ms) */
|
|
2008
|
-
tooltipShowDelay: number;
|
|
2009
|
-
/** Delay before hiding tooltip (ms) */
|
|
2010
|
-
tooltipHideDelay: number;
|
|
2011
|
-
private get hostElement();
|
|
2012
|
-
ngOnInit(): void;
|
|
2013
|
-
ngOnDestroy(): void;
|
|
2014
|
-
private createTooltipElement;
|
|
2015
|
-
private setupTriggerAttributes;
|
|
2016
|
-
private detectAriaType;
|
|
2017
|
-
private setupEventListeners;
|
|
2018
|
-
private scheduleShow;
|
|
2019
|
-
private scheduleHide;
|
|
2020
|
-
private clearTimeouts;
|
|
2021
|
-
private show;
|
|
2022
|
-
private hide;
|
|
2023
|
-
private updatePosition;
|
|
2024
|
-
private startAutoUpdate;
|
|
2025
|
-
private stopAutoUpdate;
|
|
2026
|
-
private cleanup;
|
|
2027
1957
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviTooltip, never>;
|
|
2028
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HviTooltip, "[hviTooltip]", never, { "hviTooltip": { "alias": "hviTooltip"; "required": true; }; "tooltipPlacement": { "alias": "tooltipPlacement"; "required": false; }; "tooltipAutoPlacement": { "alias": "tooltipAutoPlacement"; "required": false; };
|
|
1958
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviTooltip, "[hviTooltip]", never, { "hviTooltip": { "alias": "hviTooltip"; "required": true; }; "tooltipPlacement": { "alias": "tooltipPlacement"; "required": false; }; "tooltipAutoPlacement": { "alias": "tooltipAutoPlacement"; "required": false; }; }, {}, never, never, true, never>;
|
|
2029
1959
|
}
|
|
2030
1960
|
|
|
2031
|
-
export { HviAlert, HviAvatar, HviAvatarStack, HviBadge, HviBadgePosition, HviBreadcrumbs, HviButton, HviCard, HviCardBlock, HviChipButton, HviChipLabel, HviControlInvalid, HviDetails, HviDetailsContent, HviDetailsSummary, HviDialog, HviDialogBlock, HviDivider, HviDropdown, HviErrorSummary, HviField, HviFieldAffix, HviFieldAffixes, HviFieldCounter, HviFieldDescription, HviFieldKit, HviFieldOptional, HviFieldValidation, HviFieldset, HviForm, HviForms, HviHeading,
|
|
2032
|
-
export type { HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages, HviValidatorBundle, HviValidatorConfig, LogoCompany, LogoDefinition, LogoPath, LogoSize, PageChangeEvent, PaginationItem, SortDirection, SpinnerSize, TablePageEvent, TableSortEvent };
|
|
1961
|
+
export { HviAlert, HviAvatar, HviAvatarStack, HviBadge, HviBadgePosition, HviBreadcrumbs, HviButton, HviCard, HviCardBlock, HviChipButton, HviChipLabel, HviControlInvalid, HviDetails, HviDetailsContent, HviDetailsSummary, HviDialog, HviDialogBlock, HviDivider, HviDropdown, HviErrorSummary, HviField, HviFieldAffix, HviFieldAffixes, HviFieldCounter, HviFieldDescription, HviFieldKit, HviFieldOptional, HviFieldValidation, HviFieldset, HviForm, HviForms, HviHeading, HviInput, HviLabel, HviLink, HviList, HviLogo, HviPagination, HviParagraph, HviPopover, HviRequiredTag, HviSearch, HviSearchClear, HviSelect, HviSkeleton, HviSkipLink, HviSortableColumn, HviSpinner, HviTab, HviTabPanel, HviTable, HviTabs, HviTag, HviTextfield, HviToggleGroup, HviToggleGroupItem, HviToggleGroupItemToken, HviTooltip, HviValidationKit, HviValidationMessage, LOGOS, analyzeFormRequired, buildLogo, hviCustom, hviEmail, hviExtractMessages, hviExtractValidators, hviMax, hviMaxLength, hviMin, hviMinLength, hviNullValidator, hviPattern, hviRequired, hviRequiredTrue, hviValidators };
|
|
1962
|
+
export type { FormRequiredMode, HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages, HviValidatorBundle, HviValidatorConfig, LogoCompany, LogoDefinition, LogoPath, LogoSize, PageChangeEvent, PaginationItem, RequiredTagMode, SortDirection, SpinnerSize, TablePageEvent, TableSortEvent };
|