@helsevestikt/hviktor-angular 0.0.14 → 0.0.16
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,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, AfterViewInit, OnChanges, OnInit, OnDestroy } from '@angular/core';
|
|
3
|
-
import { FormGroup, ValidatorFn, ReactiveFormsModule } from '@angular/forms';
|
|
2
|
+
import { EventEmitter, AfterViewInit, OnChanges, OnInit, OnDestroy, TemplateRef, AfterContentInit, ElementRef, QueryList } from '@angular/core';
|
|
3
|
+
import { FormGroup, ValidatorFn, ReactiveFormsModule, ControlValueAccessor } from '@angular/forms';
|
|
4
4
|
import { Placement } from '@floating-ui/dom';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -518,6 +518,71 @@ declare class HviFieldAffixes {
|
|
|
518
518
|
static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldAffixes, "hvi-field-affixes", never, {}, {}, never, ["*"], true, never>;
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
+
/**
|
|
522
|
+
* Counter component that displays remaining/exceeded character count for a field.
|
|
523
|
+
*
|
|
524
|
+
* @remarks
|
|
525
|
+
* Shows a visual counter and provides accessible announcements via aria-live.
|
|
526
|
+
* Must be used inside a `hvi-field` component alongside a textarea or input.
|
|
527
|
+
*
|
|
528
|
+
* The component automatically finds and tracks the input/textarea in the same field,
|
|
529
|
+
* so you only need to provide the `limit` property.
|
|
530
|
+
*
|
|
531
|
+
* @example
|
|
532
|
+
* Simple usage (auto-tracking):
|
|
533
|
+
* ```html
|
|
534
|
+
* <hvi-field>
|
|
535
|
+
* <label hviLabel for="description" weight="medium">Beskrivelse</label>
|
|
536
|
+
* <textarea hviInput id="description" rows="3" maxlength="100"></textarea>
|
|
537
|
+
* <hvi-field-counter [limit]="100" />
|
|
538
|
+
* </hvi-field>
|
|
539
|
+
* ```
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* Manual tracking (for custom scenarios):
|
|
543
|
+
* ```html
|
|
544
|
+
* <hvi-field>
|
|
545
|
+
* <label hviLabel for="description" weight="medium">Beskrivelse</label>
|
|
546
|
+
* <textarea hviInput id="description" rows="3" #textarea></textarea>
|
|
547
|
+
* <hvi-field-counter [limit]="100" [count]="textarea.value.length" />
|
|
548
|
+
* </hvi-field>
|
|
549
|
+
* ```
|
|
550
|
+
*
|
|
551
|
+
* Documentation: https://designsystemet.no/en/components/docs/field/code
|
|
552
|
+
*/
|
|
553
|
+
declare class HviFieldCounter implements AfterViewInit {
|
|
554
|
+
private readonly el;
|
|
555
|
+
private readonly destroyRef;
|
|
556
|
+
/** Auto-tracked character count from the input/textarea in the same field */
|
|
557
|
+
private readonly autoCount;
|
|
558
|
+
/**
|
|
559
|
+
* Current character count. If not provided, the component will
|
|
560
|
+
* automatically track the input/textarea in the same hvi-field.
|
|
561
|
+
*/
|
|
562
|
+
count: i0.InputSignal<number | undefined>;
|
|
563
|
+
/** Maximum allowed characters */
|
|
564
|
+
limit: i0.InputSignal<number>;
|
|
565
|
+
/** Label template when limit is exceeded. Use %d for the count. */
|
|
566
|
+
over: i0.InputSignal<string>;
|
|
567
|
+
/** Label template for remaining characters. Use %d for the count. */
|
|
568
|
+
under: i0.InputSignal<string>;
|
|
569
|
+
/** Hint text for screen readers about max characters. Use %d for the limit. */
|
|
570
|
+
hint: i0.InputSignal<string>;
|
|
571
|
+
/** Effective count - uses manual count if provided, otherwise auto-tracked */
|
|
572
|
+
private readonly effectiveCount;
|
|
573
|
+
/** Computed difference between limit and current count */
|
|
574
|
+
remaining: i0.Signal<number>;
|
|
575
|
+
/** Whether the limit has been exceeded */
|
|
576
|
+
isOver: i0.Signal<boolean>;
|
|
577
|
+
/** The formatted message to display */
|
|
578
|
+
message: i0.Signal<string>;
|
|
579
|
+
/** The formatted hint for screen readers */
|
|
580
|
+
formattedHint: i0.Signal<string>;
|
|
581
|
+
ngAfterViewInit(): void;
|
|
582
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldCounter, never>;
|
|
583
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviFieldCounter, "hvi-field-counter", never, { "count": { "alias": "count"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": true; "isSignal": true; }; "over": { "alias": "over"; "required": false; "isSignal": true; }; "under": { "alias": "under"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
584
|
+
}
|
|
585
|
+
|
|
521
586
|
declare class HviFieldDescription {
|
|
522
587
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviFieldDescription, never>;
|
|
523
588
|
static ɵdir: i0.ɵɵDirectiveDeclaration<HviFieldDescription, "[hviFieldDescription]", never, {}, {}, never, never, true, never>;
|
|
@@ -605,11 +670,11 @@ declare class HviInput {
|
|
|
605
670
|
get readOnly(): boolean;
|
|
606
671
|
set readonly(value: boolean);
|
|
607
672
|
private get isToggle();
|
|
608
|
-
onClick(event:
|
|
673
|
+
onClick(event: Event): void;
|
|
609
674
|
onChange(event: Event): void;
|
|
610
|
-
onKeydown(event:
|
|
675
|
+
onKeydown(event: Event): void;
|
|
611
676
|
static ɵfac: i0.ɵɵFactoryDeclaration<HviInput, never>;
|
|
612
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HviInput, "input[hviInput]", never, { "type": { "alias": "type"; "required": false; }; "size": { "alias": "size"; "required": false; }; "role": { "alias": "role"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, {}, never, never, true, never>;
|
|
677
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviInput, "input[hviInput], textarea[hviInput]", never, { "type": { "alias": "type"; "required": false; }; "size": { "alias": "size"; "required": false; }; "role": { "alias": "role"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, {}, never, never, true, never>;
|
|
613
678
|
static ngAcceptInputType_disabled: unknown;
|
|
614
679
|
static ngAcceptInputType_readOnly: unknown;
|
|
615
680
|
static ngAcceptInputType_readonly: unknown;
|
|
@@ -805,9 +870,9 @@ declare function hviCustom(key: string, validator: ValidatorFn, message: string)
|
|
|
805
870
|
*/
|
|
806
871
|
declare function hviNullValidator(): HviValidatorBundle;
|
|
807
872
|
|
|
808
|
-
declare const HviFieldKit: readonly [typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes];
|
|
873
|
+
declare const HviFieldKit: readonly [typeof HviField, typeof HviFieldValidation, typeof HviFieldDescription, typeof HviFieldOptional, typeof HviFieldAffix, typeof HviFieldAffixes, typeof HviFieldCounter];
|
|
809
874
|
declare const HviValidationKit: readonly [typeof ReactiveFormsModule, typeof HviForm, typeof HviControlInvalid, typeof HviValidationMessage];
|
|
810
|
-
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 HviInput, typeof HviFieldset, typeof HviErrorSummary];
|
|
875
|
+
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];
|
|
811
876
|
|
|
812
877
|
/**
|
|
813
878
|
* Heading is used to structure content and create hierarchy on a page.
|
|
@@ -905,6 +970,92 @@ declare class HviList {
|
|
|
905
970
|
static ɵdir: i0.ɵɵDirectiveDeclaration<HviList, "ol[hviList], ul[hviList]", never, {}, {}, never, never, true, never>;
|
|
906
971
|
}
|
|
907
972
|
|
|
973
|
+
/** Type for hvert element i pagineringslisten */
|
|
974
|
+
type PaginationItem = {
|
|
975
|
+
type: 'page';
|
|
976
|
+
page: number;
|
|
977
|
+
} | {
|
|
978
|
+
type: 'ellipsis';
|
|
979
|
+
} | {
|
|
980
|
+
type: 'previous';
|
|
981
|
+
} | {
|
|
982
|
+
type: 'next';
|
|
983
|
+
};
|
|
984
|
+
/** Event som emitteres ved sideendring */
|
|
985
|
+
interface PageChangeEvent {
|
|
986
|
+
page: number;
|
|
987
|
+
previousPage: number;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* @summary
|
|
991
|
+
* Pagination er en liste med knapper som brukes for å navigere mellom
|
|
992
|
+
* ulike sider med innhold, for eksempel søkeresultater eller tabeller.
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* ```html
|
|
996
|
+
* <hvi-pagination
|
|
997
|
+
* [totalItems]="100"
|
|
998
|
+
* [pageSize]="10"
|
|
999
|
+
* [(currentPage)]="currentPage"
|
|
1000
|
+
* />
|
|
1001
|
+
* ```
|
|
1002
|
+
*
|
|
1003
|
+
* @see {@link https://designsystemet.no/no/components/docs/pagination/code}
|
|
1004
|
+
*/
|
|
1005
|
+
declare class HviPagination {
|
|
1006
|
+
/** Totalt antall elementer som pagineres */
|
|
1007
|
+
set totalItems(value: number);
|
|
1008
|
+
/** Antall elementer per side */
|
|
1009
|
+
set pageSize(value: number);
|
|
1010
|
+
/** Nåværende side (1-indeksert) */
|
|
1011
|
+
set currentPage(value: number);
|
|
1012
|
+
/** Antall sider som skal vises rundt nåværende side */
|
|
1013
|
+
siblingCount: number;
|
|
1014
|
+
/** Vis alltid første og siste side */
|
|
1015
|
+
showEdges: boolean;
|
|
1016
|
+
/** Vis "Forrige" og "Neste" tekst på knappene */
|
|
1017
|
+
showPreviousNextLabels: boolean;
|
|
1018
|
+
/** Aria-label for hele navigasjonen */
|
|
1019
|
+
ariaLabel: string;
|
|
1020
|
+
/** Tekst for forrige-knappen */
|
|
1021
|
+
previousLabel: string;
|
|
1022
|
+
/** Tekst for neste-knappen */
|
|
1023
|
+
nextLabel: string;
|
|
1024
|
+
/** Event som emitteres når siden endres */
|
|
1025
|
+
currentPageChange: EventEmitter<number>;
|
|
1026
|
+
/** Event som emitteres med mer detaljer om sideendring */
|
|
1027
|
+
pageChange: EventEmitter<PageChangeEvent>;
|
|
1028
|
+
readonly _totalItems: i0.WritableSignal<number>;
|
|
1029
|
+
readonly _pageSize: i0.WritableSignal<number>;
|
|
1030
|
+
readonly _currentPage: i0.WritableSignal<number>;
|
|
1031
|
+
/** Beregnet totalt antall sider */
|
|
1032
|
+
readonly totalPages: i0.Signal<number>;
|
|
1033
|
+
/** Er vi på første side? */
|
|
1034
|
+
readonly isFirstPage: i0.Signal<boolean>;
|
|
1035
|
+
/** Er vi på siste side? */
|
|
1036
|
+
readonly isLastPage: i0.Signal<boolean>;
|
|
1037
|
+
/** Beregner hvilke elementer som skal vises i pagineringen */
|
|
1038
|
+
readonly paginationItems: i0.Signal<PaginationItem[]>;
|
|
1039
|
+
/** Gå til en spesifikk side */
|
|
1040
|
+
goToPage(page: number): void;
|
|
1041
|
+
/** Gå til forrige side */
|
|
1042
|
+
goToPrevious(): void;
|
|
1043
|
+
/** Gå til neste side */
|
|
1044
|
+
goToNext(): void;
|
|
1045
|
+
/** Gå til første side */
|
|
1046
|
+
goToFirst(): void;
|
|
1047
|
+
/** Gå til siste side */
|
|
1048
|
+
goToLast(): void;
|
|
1049
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviPagination, never>;
|
|
1050
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviPagination, "hvi-pagination", never, { "totalItems": { "alias": "totalItems"; "required": true; }; "pageSize": { "alias": "pageSize"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "siblingCount": { "alias": "siblingCount"; "required": false; }; "showEdges": { "alias": "showEdges"; "required": false; }; "showPreviousNextLabels": { "alias": "showPreviousNextLabels"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "previousLabel": { "alias": "previousLabel"; "required": false; }; "nextLabel": { "alias": "nextLabel"; "required": false; }; }, { "currentPageChange": "currentPageChange"; "pageChange": "pageChange"; }, never, never, true, never>;
|
|
1051
|
+
static ngAcceptInputType_totalItems: unknown;
|
|
1052
|
+
static ngAcceptInputType_pageSize: unknown;
|
|
1053
|
+
static ngAcceptInputType_currentPage: unknown;
|
|
1054
|
+
static ngAcceptInputType_siblingCount: unknown;
|
|
1055
|
+
static ngAcceptInputType_showEdges: unknown;
|
|
1056
|
+
static ngAcceptInputType_showPreviousNextLabels: unknown;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
908
1059
|
/**
|
|
909
1060
|
* Paragraph is used for continuous text and is typically applied in articles, components, help text, and similar content.
|
|
910
1061
|
*
|
|
@@ -973,6 +1124,79 @@ declare class HviPopover implements OnInit, OnDestroy {
|
|
|
973
1124
|
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>;
|
|
974
1125
|
}
|
|
975
1126
|
|
|
1127
|
+
/**
|
|
1128
|
+
* @summary
|
|
1129
|
+
* SearchClear is a button directive for clearing the search input.
|
|
1130
|
+
* It automatically finds the input field inside the parent `hvi-search` component and clears it.
|
|
1131
|
+
*
|
|
1132
|
+
* @example
|
|
1133
|
+
* ```html
|
|
1134
|
+
* <hvi-search>
|
|
1135
|
+
* <input hviInput type="search" placeholder="" aria-label="Søk" />
|
|
1136
|
+
* <button hviSearchClear type="reset" aria-label="Tøm"></button>
|
|
1137
|
+
* <button hviButton variant="primary" type="submit">Søk</button>
|
|
1138
|
+
* </hvi-search>
|
|
1139
|
+
* ```
|
|
1140
|
+
*
|
|
1141
|
+
* @see {@link https://designsystemet.no/no/components/search}
|
|
1142
|
+
*/
|
|
1143
|
+
declare class HviSearchClear {
|
|
1144
|
+
private readonly elementRef;
|
|
1145
|
+
onClick(event: Event): void;
|
|
1146
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviSearchClear, never>;
|
|
1147
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviSearchClear, "button[hviSearchClear]", never, {}, {}, never, never, true, never>;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* @summary
|
|
1152
|
+
* Search allows users to quickly find relevant content on a website or in an application.
|
|
1153
|
+
* The component consists of a search field, with or without a search button.
|
|
1154
|
+
*
|
|
1155
|
+
* Use `hviInput` with `type="search"` for the input field.
|
|
1156
|
+
* Use `hviSearchClear` for the clear button.
|
|
1157
|
+
* Use `hviButton` for the submit button.
|
|
1158
|
+
*
|
|
1159
|
+
* Important: Add an empty `placeholder=""` on the input if you have a clear button.
|
|
1160
|
+
*
|
|
1161
|
+
* @example
|
|
1162
|
+
* Basic search with clear and submit button:
|
|
1163
|
+
* ```html
|
|
1164
|
+
* <hvi-search>
|
|
1165
|
+
* <input hviInput type="search" placeholder="" aria-label="Søk" />
|
|
1166
|
+
* <button hviSearchClear type="reset" aria-label="Tøm"></button>
|
|
1167
|
+
* <button hviButton variant="primary" type="submit">Søk</button>
|
|
1168
|
+
* </hvi-search>
|
|
1169
|
+
* ```
|
|
1170
|
+
*
|
|
1171
|
+
* @example
|
|
1172
|
+
* Search without submit button:
|
|
1173
|
+
* ```html
|
|
1174
|
+
* <hvi-search>
|
|
1175
|
+
* <input hviInput type="search" placeholder="" aria-label="Søk" />
|
|
1176
|
+
* <button hviSearchClear type="reset" aria-label="Tøm"></button>
|
|
1177
|
+
* </hvi-search>
|
|
1178
|
+
* ```
|
|
1179
|
+
*
|
|
1180
|
+
* @example
|
|
1181
|
+
* Search with label using hvi-field:
|
|
1182
|
+
* ```html
|
|
1183
|
+
* <hvi-field>
|
|
1184
|
+
* <label hviLabel>Søk etter katter</label>
|
|
1185
|
+
* <hvi-search>
|
|
1186
|
+
* <input hviInput type="search" placeholder="" name="cat-search" />
|
|
1187
|
+
* <button hviSearchClear type="reset" aria-label="Tøm"></button>
|
|
1188
|
+
* <button hviButton variant="primary" type="submit">Søk</button>
|
|
1189
|
+
* </hvi-search>
|
|
1190
|
+
* </hvi-field>
|
|
1191
|
+
* ```
|
|
1192
|
+
*
|
|
1193
|
+
* @see {@link https://designsystemet.no/no/components/search}
|
|
1194
|
+
*/
|
|
1195
|
+
declare class HviSearch {
|
|
1196
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviSearch, never>;
|
|
1197
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviSearch, "hvi-search", never, {}, {}, never, ["*"], true, never>;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
976
1200
|
/**
|
|
977
1201
|
* @summary
|
|
978
1202
|
* Select allows users to choose an option from a list.
|
|
@@ -1027,6 +1251,339 @@ declare class HviSkeleton {
|
|
|
1027
1251
|
static ɵcmp: i0.ɵɵComponentDeclaration<HviSkeleton, "hvi-skeleton", never, { "variant": { "alias": "variant"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
1028
1252
|
}
|
|
1029
1253
|
|
|
1254
|
+
/**
|
|
1255
|
+
* @summary
|
|
1256
|
+
* SkipLink hjelper folk som bruker tastaturnavigasjon til å navigere,
|
|
1257
|
+
* slik at de enkelt kan gå til det viktigste innholdet på en side.
|
|
1258
|
+
*
|
|
1259
|
+
* @example
|
|
1260
|
+
* ```html
|
|
1261
|
+
* <a hviSkipLink href="#main-content">Hopp til hovedinnhold</a>
|
|
1262
|
+
*
|
|
1263
|
+
* <main id="main-content" tabindex="-1">
|
|
1264
|
+
* Hovedinnhold her
|
|
1265
|
+
* </main>
|
|
1266
|
+
* ```
|
|
1267
|
+
*
|
|
1268
|
+
* @see {@link https://designsystemet.no/komponenter/skip-link}
|
|
1269
|
+
*/
|
|
1270
|
+
declare class HviSkipLink {
|
|
1271
|
+
private el;
|
|
1272
|
+
/**
|
|
1273
|
+
* Handles click to prevent Angular Router navigation
|
|
1274
|
+
* and instead focus/scroll to the target element.
|
|
1275
|
+
*/
|
|
1276
|
+
onClick(event: MouseEvent): void;
|
|
1277
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviSkipLink, never>;
|
|
1278
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviSkipLink, "a[hviSkipLink]", never, {}, {}, never, never, true, never>;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/** Available sizes for the Spinner */
|
|
1282
|
+
type SpinnerSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1283
|
+
/**
|
|
1284
|
+
* @summary
|
|
1285
|
+
* Spinner brukes for å indikere at innhold eller en handling er i ferd med å laste,
|
|
1286
|
+
* og at brukeren må vente før de kan fortsette.
|
|
1287
|
+
*
|
|
1288
|
+
* @example
|
|
1289
|
+
* ```html
|
|
1290
|
+
* <hvi-spinner label="Laster..." />
|
|
1291
|
+
* <hvi-spinner label="Henter data" size="lg" />
|
|
1292
|
+
* ```
|
|
1293
|
+
*
|
|
1294
|
+
* @see {@link https://designsystemet.no/komponenter/spinner}
|
|
1295
|
+
*/
|
|
1296
|
+
declare class HviSpinner {
|
|
1297
|
+
/** Accessible label describing what is loading */
|
|
1298
|
+
label: string;
|
|
1299
|
+
/** Size of the spinner */
|
|
1300
|
+
size?: SpinnerSize;
|
|
1301
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviSpinner, never>;
|
|
1302
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviSpinner, "hvi-spinner", never, { "label": { "alias": "label"; "required": true; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/** Sorteringsretninger for tabell-kolonner */
|
|
1306
|
+
type SortDirection = 'none' | 'ascending' | 'descending';
|
|
1307
|
+
/** Event som emitteres ved sorteringsendring */
|
|
1308
|
+
interface TableSortEvent {
|
|
1309
|
+
field: string;
|
|
1310
|
+
direction: SortDirection;
|
|
1311
|
+
}
|
|
1312
|
+
/** Event som emitteres ved sideendring */
|
|
1313
|
+
interface TablePageEvent {
|
|
1314
|
+
first: number;
|
|
1315
|
+
rows: number;
|
|
1316
|
+
page: number;
|
|
1317
|
+
pageCount: number;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* @summary
|
|
1321
|
+
* Table brukes for å vise strukturert informasjon på en ryddig og oversiktlig måte.
|
|
1322
|
+
* Tabeller kan gjøre det enklere for brukerne å skanne og sammenligne informasjon.
|
|
1323
|
+
*
|
|
1324
|
+
* @example
|
|
1325
|
+
* ```html
|
|
1326
|
+
* <!-- Enkel bruk med innebygd sortering og søk -->
|
|
1327
|
+
* <table hviTable [value]="persons" [globalFilterFields]="['navn', 'epost']" #table="hviTable">
|
|
1328
|
+
* <caption>
|
|
1329
|
+
* <input type="search" (input)="table.filterGlobal($event.target.value)" />
|
|
1330
|
+
* </caption>
|
|
1331
|
+
* <thead>
|
|
1332
|
+
* <tr>
|
|
1333
|
+
* <th hviSortableColumn="navn">
|
|
1334
|
+
* <button>Navn</button>
|
|
1335
|
+
* </th>
|
|
1336
|
+
* <th>Epost</th>
|
|
1337
|
+
* </tr>
|
|
1338
|
+
* </thead>
|
|
1339
|
+
* <tbody>
|
|
1340
|
+
* @for (person of table.filteredValue(); track person.id) {
|
|
1341
|
+
* <tr>
|
|
1342
|
+
* <td>{{ person.navn }}</td>
|
|
1343
|
+
* <td>{{ person.epost }}</td>
|
|
1344
|
+
* </tr>
|
|
1345
|
+
* }
|
|
1346
|
+
* </tbody>
|
|
1347
|
+
* </table>
|
|
1348
|
+
* ```
|
|
1349
|
+
*
|
|
1350
|
+
* @see {@link https://designsystemet.no/no/components/docs/table/code}
|
|
1351
|
+
*/
|
|
1352
|
+
declare class HviTable<T = unknown> {
|
|
1353
|
+
/** Gir tabellen zebrastriper (annenhver rad har alternativ bakgrunn) */
|
|
1354
|
+
zebra: boolean;
|
|
1355
|
+
/** Gir tabellen en avrundet kant rundt */
|
|
1356
|
+
border: boolean;
|
|
1357
|
+
/** Gir tabellen hover-effekt på rader */
|
|
1358
|
+
hover: boolean;
|
|
1359
|
+
/** Gjør tabellens header sticky (fester seg til toppen ved scrolling) */
|
|
1360
|
+
stickyHeader: boolean;
|
|
1361
|
+
/** Data som skal vises i tabellen */
|
|
1362
|
+
set value(data: T[] | null | undefined);
|
|
1363
|
+
/** Felt som data skal sorteres etter (valgfri initial verdi) */
|
|
1364
|
+
set sortField(field: string | null | undefined);
|
|
1365
|
+
/** Sorteringsretning: 1 = ascending, -1 = descending, 0 = none */
|
|
1366
|
+
set sortOrder(order: number);
|
|
1367
|
+
/** Felt som global søk skal søke i */
|
|
1368
|
+
globalFilterFields: string[];
|
|
1369
|
+
/** Aktiver paginering */
|
|
1370
|
+
paginator: boolean;
|
|
1371
|
+
/** Antall rader per side (når paginator er aktivert) */
|
|
1372
|
+
set rows(value: number);
|
|
1373
|
+
/** Indeks for første rad som vises (0-basert) */
|
|
1374
|
+
set first(value: number);
|
|
1375
|
+
/** Event som emitteres når sortering endres */
|
|
1376
|
+
sortChange: EventEmitter<TableSortEvent>;
|
|
1377
|
+
/** Event som emitteres når side endres */
|
|
1378
|
+
pageChange: EventEmitter<TablePageEvent>;
|
|
1379
|
+
/** Event som emitteres med nåværende side (1-basert, for two-way binding) */
|
|
1380
|
+
currentPageChange: EventEmitter<number>;
|
|
1381
|
+
private _value;
|
|
1382
|
+
private _sortField;
|
|
1383
|
+
private _sortOrder;
|
|
1384
|
+
private _globalFilter;
|
|
1385
|
+
private _rows;
|
|
1386
|
+
private _first;
|
|
1387
|
+
/** Kun sortert data (uten søk) - for bakoverkompatibilitet */
|
|
1388
|
+
readonly sortedValue: i0.Signal<T[]>;
|
|
1389
|
+
/** Filtrert og sortert data - bruk denne i template */
|
|
1390
|
+
readonly filteredValue: i0.Signal<T[]>;
|
|
1391
|
+
/** Paginert, filtrert og sortert data - bruk denne når paginator er aktivert */
|
|
1392
|
+
readonly paginatedValue: i0.Signal<T[]>;
|
|
1393
|
+
/** Antall rader etter søk */
|
|
1394
|
+
readonly totalFilteredRecords: i0.Signal<number>;
|
|
1395
|
+
/** Antall rader totalt (før søk) */
|
|
1396
|
+
readonly totalRecords: i0.Signal<number>;
|
|
1397
|
+
/** Totalt antall sider */
|
|
1398
|
+
readonly pageCount: i0.Signal<number>;
|
|
1399
|
+
/** Nåværende side (1-basert) */
|
|
1400
|
+
readonly currentPage: i0.Signal<number>;
|
|
1401
|
+
/** Er vi på første side? */
|
|
1402
|
+
readonly isFirstPage: i0.Signal<boolean>;
|
|
1403
|
+
/** Er vi på siste side? */
|
|
1404
|
+
readonly isLastPage: i0.Signal<boolean>;
|
|
1405
|
+
/** Nåværende sorteringsfelt */
|
|
1406
|
+
readonly currentSortField: i0.Signal<string | null>;
|
|
1407
|
+
/** Nåværende sorteringsretning som SortDirection */
|
|
1408
|
+
readonly currentSortDirection: i0.Signal<SortDirection>;
|
|
1409
|
+
/** Nåværende søkeverdi */
|
|
1410
|
+
readonly currentGlobalFilter: i0.Signal<string | null>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Global søk - søker på tvers av alle felt i globalFilterFields.
|
|
1413
|
+
* @param value Søkeverdi
|
|
1414
|
+
*/
|
|
1415
|
+
filterGlobal(value: string | null): void;
|
|
1416
|
+
/**
|
|
1417
|
+
* Nullstiller søk.
|
|
1418
|
+
*/
|
|
1419
|
+
clearFilter(): void;
|
|
1420
|
+
/**
|
|
1421
|
+
* Nullstiller hele tabellen (sortering og søk).
|
|
1422
|
+
*/
|
|
1423
|
+
clear(): void;
|
|
1424
|
+
/**
|
|
1425
|
+
* Gå til en spesifikk side (1-basert).
|
|
1426
|
+
*/
|
|
1427
|
+
goToPage(page: number): void;
|
|
1428
|
+
/**
|
|
1429
|
+
* Gå til første side.
|
|
1430
|
+
*/
|
|
1431
|
+
goToFirstPage(): void;
|
|
1432
|
+
/**
|
|
1433
|
+
* Gå til siste side.
|
|
1434
|
+
*/
|
|
1435
|
+
goToLastPage(): void;
|
|
1436
|
+
/**
|
|
1437
|
+
* Gå til forrige side.
|
|
1438
|
+
*/
|
|
1439
|
+
goToPreviousPage(): void;
|
|
1440
|
+
/**
|
|
1441
|
+
* Gå til neste side.
|
|
1442
|
+
*/
|
|
1443
|
+
goToNextPage(): void;
|
|
1444
|
+
/**
|
|
1445
|
+
* Endre antall rader per side.
|
|
1446
|
+
*/
|
|
1447
|
+
setRows(rows: number): void;
|
|
1448
|
+
private emitPageEvent;
|
|
1449
|
+
/**
|
|
1450
|
+
* Sorterer tabellen etter et felt.
|
|
1451
|
+
* Kalles av hviSortableColumn directive.
|
|
1452
|
+
*/
|
|
1453
|
+
sort(field: string): void;
|
|
1454
|
+
/**
|
|
1455
|
+
* Henter sorteringsretning for et spesifikt felt.
|
|
1456
|
+
* Brukes av hviSortableColumn for å vise riktig aria-sort.
|
|
1457
|
+
*/
|
|
1458
|
+
getSortDirection(field: string): SortDirection;
|
|
1459
|
+
private applyGlobalFilter;
|
|
1460
|
+
private applySorting;
|
|
1461
|
+
/**
|
|
1462
|
+
* Henter verdi fra et objekt basert på felt-path (støtter nested: "user.name")
|
|
1463
|
+
*/
|
|
1464
|
+
private getFieldValue;
|
|
1465
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviTable<any>, never>;
|
|
1466
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviTable<any>, "[hviTable]", ["hviTable"], { "zebra": { "alias": "zebra"; "required": false; }; "border": { "alias": "border"; "required": false; }; "hover": { "alias": "hover"; "required": false; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; }; "value": { "alias": "value"; "required": false; }; "sortField": { "alias": "sortField"; "required": false; }; "sortOrder": { "alias": "sortOrder"; "required": false; }; "globalFilterFields": { "alias": "globalFilterFields"; "required": false; }; "paginator": { "alias": "paginator"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "first": { "alias": "first"; "required": false; }; }, { "sortChange": "sortChange"; "pageChange": "pageChange"; "currentPageChange": "currentPageChange"; }, never, never, true, never>;
|
|
1467
|
+
static ngAcceptInputType_zebra: unknown;
|
|
1468
|
+
static ngAcceptInputType_border: unknown;
|
|
1469
|
+
static ngAcceptInputType_hover: unknown;
|
|
1470
|
+
static ngAcceptInputType_stickyHeader: unknown;
|
|
1471
|
+
static ngAcceptInputType_paginator: unknown;
|
|
1472
|
+
static ngAcceptInputType_rows: unknown;
|
|
1473
|
+
static ngAcceptInputType_first: unknown;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
/**
|
|
1477
|
+
* @summary
|
|
1478
|
+
* Directive for sorterbare tabell-header celler.
|
|
1479
|
+
* Kommuniserer automatisk med parent HviTable for å håndtere sortering.
|
|
1480
|
+
*
|
|
1481
|
+
* @example
|
|
1482
|
+
* ```html
|
|
1483
|
+
* <table hviTable [value]="persons" #table>
|
|
1484
|
+
* <thead>
|
|
1485
|
+
* <tr>
|
|
1486
|
+
* <th hviSortableColumn="navn">
|
|
1487
|
+
* <button>Navn</button>
|
|
1488
|
+
* </th>
|
|
1489
|
+
* <th>Epost</th>
|
|
1490
|
+
* </tr>
|
|
1491
|
+
* </thead>
|
|
1492
|
+
* <tbody>
|
|
1493
|
+
* @for (person of table.sortedValue(); track person.id) {
|
|
1494
|
+
* <tr>
|
|
1495
|
+
* <td>{{ person.navn }}</td>
|
|
1496
|
+
* <td>{{ person.epost }}</td>
|
|
1497
|
+
* </tr>
|
|
1498
|
+
* }
|
|
1499
|
+
* </tbody>
|
|
1500
|
+
* </table>
|
|
1501
|
+
* ```
|
|
1502
|
+
*
|
|
1503
|
+
* @see {@link https://designsystemet.no/no/components/docs/table/code}
|
|
1504
|
+
*/
|
|
1505
|
+
declare class HviSortableColumn {
|
|
1506
|
+
private table;
|
|
1507
|
+
/**
|
|
1508
|
+
* Feltet som denne kolonnen sorterer etter.
|
|
1509
|
+
* Må matche property-navn i data-objektene.
|
|
1510
|
+
*/
|
|
1511
|
+
field: string;
|
|
1512
|
+
/**
|
|
1513
|
+
* Henter sorteringsretning fra parent table.
|
|
1514
|
+
*/
|
|
1515
|
+
get sortDirection(): SortDirection;
|
|
1516
|
+
onClick(event: MouseEvent): void;
|
|
1517
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviSortableColumn, never>;
|
|
1518
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviSortableColumn, "th[hviSortableColumn]", never, { "field": { "alias": "hviSortableColumn"; "required": true; }; }, {}, never, never, true, never>;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
/**
|
|
1522
|
+
* TabPanel inneholder innholdet som vises når en tilhørende Tab er aktiv.
|
|
1523
|
+
*
|
|
1524
|
+
* @example
|
|
1525
|
+
* ```html
|
|
1526
|
+
* <hvi-tab-panel value="tab1">
|
|
1527
|
+
* Innhold for tab 1
|
|
1528
|
+
* </hvi-tab-panel>
|
|
1529
|
+
* ```
|
|
1530
|
+
*/
|
|
1531
|
+
declare class HviTabPanel {
|
|
1532
|
+
templateRef: TemplateRef<unknown>;
|
|
1533
|
+
/** When this value is selected, render this TabPanel. Must match the value of a Tab. */
|
|
1534
|
+
value: string;
|
|
1535
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviTabPanel, never>;
|
|
1536
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviTabPanel, "hvi-tab-panel", never, { "value": { "alias": "value"; "required": true; }; }, {}, never, ["*"], true, never>;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/**
|
|
1540
|
+
* Tab er en enkelt fane som kan klikkes for å vise tilhørende TabPanel.
|
|
1541
|
+
*
|
|
1542
|
+
* @example
|
|
1543
|
+
* ```html
|
|
1544
|
+
* <hvi-tab value="tab1">Tab 1</hvi-tab>
|
|
1545
|
+
* ```
|
|
1546
|
+
*/
|
|
1547
|
+
declare class HviTab {
|
|
1548
|
+
templateRef: TemplateRef<unknown>;
|
|
1549
|
+
/** Unique value that will be set in the Tabs components state when the tab is activated */
|
|
1550
|
+
value: string;
|
|
1551
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviTab, never>;
|
|
1552
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviTab, "hvi-tab", never, { "value": { "alias": "value"; "required": true; }; }, {}, never, ["*"], true, never>;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* Tabs lar brukerne navigere mellom relaterte deler av innholdet,
|
|
1557
|
+
* der én del vises om gangen.
|
|
1558
|
+
*
|
|
1559
|
+
* @example
|
|
1560
|
+
* ```html
|
|
1561
|
+
* <hvi-tabs defaultValue="tab1">
|
|
1562
|
+
* <hvi-tab value="tab1">Tab 1</hvi-tab>
|
|
1563
|
+
* <hvi-tab value="tab2">Tab 2</hvi-tab>
|
|
1564
|
+
* <hvi-tab-panel value="tab1">Content 1</hvi-tab-panel>
|
|
1565
|
+
* <hvi-tab-panel value="tab2">Content 2</hvi-tab-panel>
|
|
1566
|
+
* </hvi-tabs>
|
|
1567
|
+
* ```
|
|
1568
|
+
*
|
|
1569
|
+
* @see {@link https://designsystemet.no/no/components/docs/tabs/overview}
|
|
1570
|
+
*/
|
|
1571
|
+
declare class HviTabs implements AfterContentInit {
|
|
1572
|
+
uTabsRef: ElementRef;
|
|
1573
|
+
tabs: QueryList<HviTab>;
|
|
1574
|
+
panels: QueryList<HviTabPanel>;
|
|
1575
|
+
/** Controlled state for Tabs component */
|
|
1576
|
+
value?: string;
|
|
1577
|
+
/** Default selected tab value */
|
|
1578
|
+
defaultValue?: string;
|
|
1579
|
+
/** Callback when selected tab changes */
|
|
1580
|
+
valueChange: EventEmitter<string>;
|
|
1581
|
+
ngAfterContentInit(): void;
|
|
1582
|
+
private setupTabs;
|
|
1583
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviTabs, never>;
|
|
1584
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviTabs, "hvi-tabs", never, { "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; }, { "valueChange": "valueChange"; }, ["tabs", "panels"], ["*"], true, never>;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1030
1587
|
/**
|
|
1031
1588
|
* @summary
|
|
1032
1589
|
* Tag is a label that can be used to categorize items or communicate progress, status, or process. Tags can provide users with a quicker overview of content.
|
|
@@ -1049,5 +1606,165 @@ declare class HviTag {
|
|
|
1049
1606
|
static ɵcmp: i0.ɵɵComponentDeclaration<HviTag, "hvi-tag", never, { "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
1050
1607
|
}
|
|
1051
1608
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1609
|
+
/**
|
|
1610
|
+
* @summary
|
|
1611
|
+
* ToggleGroup collects related options. The component consists of a group of
|
|
1612
|
+
* buttons that are connected, where only one button can be selected at a time.
|
|
1613
|
+
*
|
|
1614
|
+
* @example
|
|
1615
|
+
* ```html
|
|
1616
|
+
* <hvi-toggle-group [(value)]="selected" variant="primary">
|
|
1617
|
+
* <button hviToggleGroupItem value="innboks">Innboks</button>
|
|
1618
|
+
* <button hviToggleGroupItem value="utkast">Utkast</button>
|
|
1619
|
+
* <button hviToggleGroupItem value="sendt">Sendt</button>
|
|
1620
|
+
* </hvi-toggle-group>
|
|
1621
|
+
* ```
|
|
1622
|
+
*
|
|
1623
|
+
* @example
|
|
1624
|
+
* With reactive forms:
|
|
1625
|
+
* ```html
|
|
1626
|
+
* <hvi-toggle-group formControlName="view" variant="secondary">
|
|
1627
|
+
* <button hviToggleGroupItem value="list">Liste</button>
|
|
1628
|
+
* <button hviToggleGroupItem value="grid">Rutenett</button>
|
|
1629
|
+
* </hvi-toggle-group>
|
|
1630
|
+
* ```
|
|
1631
|
+
*
|
|
1632
|
+
* @see {@link https://designsystemet.no/no/components/toggle-group}
|
|
1633
|
+
*/
|
|
1634
|
+
declare class HviToggleGroup implements ControlValueAccessor {
|
|
1635
|
+
private items;
|
|
1636
|
+
private readonly registeredItems;
|
|
1637
|
+
/** The variant of the toggle group */
|
|
1638
|
+
readonly _variant: i0.WritableSignal<"primary" | "secondary">;
|
|
1639
|
+
/** Form element name */
|
|
1640
|
+
readonly _name: i0.WritableSignal<string>;
|
|
1641
|
+
/** The currently selected value */
|
|
1642
|
+
private readonly _value;
|
|
1643
|
+
/** Event emitted when value changes */
|
|
1644
|
+
valueChange: EventEmitter<string>;
|
|
1645
|
+
private onChange;
|
|
1646
|
+
private onTouched;
|
|
1647
|
+
set value(val: string | undefined);
|
|
1648
|
+
set variant(val: 'primary' | 'secondary');
|
|
1649
|
+
set name(val: string);
|
|
1650
|
+
/** Register an item with this group */
|
|
1651
|
+
registerItem(item: HviToggleGroupItem): void;
|
|
1652
|
+
/** Unregister an item from this group */
|
|
1653
|
+
unregisterItem(item: HviToggleGroupItem): void;
|
|
1654
|
+
/** Select an item and update all states */
|
|
1655
|
+
selectItem(item: HviToggleGroupItem): void;
|
|
1656
|
+
/** Handle keyboard navigation (roving tabindex) */
|
|
1657
|
+
handleKeydown(event: KeyboardEvent, currentItem: HviToggleGroupItem): void;
|
|
1658
|
+
private updateItemStates;
|
|
1659
|
+
writeValue(value: string): void;
|
|
1660
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
1661
|
+
registerOnTouched(fn: () => void): void;
|
|
1662
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviToggleGroup, never>;
|
|
1663
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HviToggleGroup, "hvi-toggle-group", never, { "value": { "alias": "value"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, { "valueChange": "valueChange"; }, ["items"], ["*"], true, never>;
|
|
1664
|
+
}
|
|
1665
|
+
declare const HviToggleGroupItemToken: unique symbol;
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* @summary
|
|
1669
|
+
* ToggleGroupItem is a button directive for use inside HviToggleGroup.
|
|
1670
|
+
*
|
|
1671
|
+
* @example
|
|
1672
|
+
* ```html
|
|
1673
|
+
* <hvi-toggle-group [(value)]="selected">
|
|
1674
|
+
* <button hviToggleGroupItem value="option1">Option 1</button>
|
|
1675
|
+
* <button hviToggleGroupItem value="option2">Option 2</button>
|
|
1676
|
+
* </hvi-toggle-group>
|
|
1677
|
+
* ```
|
|
1678
|
+
*
|
|
1679
|
+
* @see {@link https://designsystemet.no/no/components/toggle-group}
|
|
1680
|
+
*/
|
|
1681
|
+
declare class HviToggleGroupItem implements OnInit, OnDestroy {
|
|
1682
|
+
readonly group: HviToggleGroup;
|
|
1683
|
+
private readonly elementRef;
|
|
1684
|
+
/** Unique ID for this item */
|
|
1685
|
+
readonly id: string;
|
|
1686
|
+
/** The value of this toggle item */
|
|
1687
|
+
value: string;
|
|
1688
|
+
/** Toggle icon-only styling */
|
|
1689
|
+
icon: boolean;
|
|
1690
|
+
/** Internal signal for tracking selection state */
|
|
1691
|
+
private readonly _isSelected;
|
|
1692
|
+
/** Whether this item is currently selected */
|
|
1693
|
+
readonly isSelected: i0.Signal<boolean>;
|
|
1694
|
+
/** Computed variant based on selection state */
|
|
1695
|
+
readonly computedVariant: i0.Signal<"primary" | "secondary" | "tertiary">;
|
|
1696
|
+
ngOnInit(): void;
|
|
1697
|
+
ngOnDestroy(): void;
|
|
1698
|
+
/** Update the selected state (called by parent group) */
|
|
1699
|
+
setSelected(selected: boolean): void;
|
|
1700
|
+
/** Focus this item's button element */
|
|
1701
|
+
focus(): void;
|
|
1702
|
+
protected onClick(): void;
|
|
1703
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1704
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviToggleGroupItem, never>;
|
|
1705
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviToggleGroupItem, "button[hviToggleGroupItem]", never, { "value": { "alias": "value"; "required": true; }; "icon": { "alias": "icon"; "required": false; }; }, {}, never, never, true, never>;
|
|
1706
|
+
static ngAcceptInputType_icon: unknown;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* @summary
|
|
1711
|
+
* Tooltip viser kort informasjon når brukeren holder musepekeren over
|
|
1712
|
+
* eller fokuserer på et element. Den brukes til sekundær informasjon,
|
|
1713
|
+
* for eksempel til å forklare hva et symbol betyr.
|
|
1714
|
+
*
|
|
1715
|
+
* @example
|
|
1716
|
+
* ```html
|
|
1717
|
+
* <button hviButton hviTooltip="Kopier">📋</button>
|
|
1718
|
+
* <span hviTooltip="Organisasjonsnummer">Org.nr.</span>
|
|
1719
|
+
* ```
|
|
1720
|
+
*
|
|
1721
|
+
* @see {@link https://designsystemet.no/en/components/docs/tooltip/code}
|
|
1722
|
+
*/
|
|
1723
|
+
declare class HviTooltip implements OnInit, OnDestroy {
|
|
1724
|
+
private el;
|
|
1725
|
+
private renderer;
|
|
1726
|
+
private tooltipElement;
|
|
1727
|
+
private tooltipId;
|
|
1728
|
+
private cleanupAutoUpdate?;
|
|
1729
|
+
private showTimeout?;
|
|
1730
|
+
private hideTimeout?;
|
|
1731
|
+
private isOpen;
|
|
1732
|
+
private listeners;
|
|
1733
|
+
/** Tooltip content */
|
|
1734
|
+
hviTooltip: string;
|
|
1735
|
+
/** Placement of the tooltip relative to the trigger */
|
|
1736
|
+
tooltipPlacement: Placement;
|
|
1737
|
+
/** Enable auto placement when there's not enough space */
|
|
1738
|
+
tooltipAutoPlacement: boolean;
|
|
1739
|
+
/**
|
|
1740
|
+
* Override ARIA attribute type.
|
|
1741
|
+
* - 'describedby': tooltip describes the element (default for elements with text)
|
|
1742
|
+
* - 'labelledby': tooltip labels the element (default for icon-only buttons)
|
|
1743
|
+
*/
|
|
1744
|
+
tooltipType?: 'describedby' | 'labelledby';
|
|
1745
|
+
/** Delay before showing tooltip (ms) */
|
|
1746
|
+
tooltipShowDelay: number;
|
|
1747
|
+
/** Delay before hiding tooltip (ms) */
|
|
1748
|
+
tooltipHideDelay: number;
|
|
1749
|
+
private get hostElement();
|
|
1750
|
+
ngOnInit(): void;
|
|
1751
|
+
ngOnDestroy(): void;
|
|
1752
|
+
private createTooltipElement;
|
|
1753
|
+
private setupTriggerAttributes;
|
|
1754
|
+
private detectAriaType;
|
|
1755
|
+
private setupEventListeners;
|
|
1756
|
+
private scheduleShow;
|
|
1757
|
+
private scheduleHide;
|
|
1758
|
+
private clearTimeouts;
|
|
1759
|
+
private show;
|
|
1760
|
+
private hide;
|
|
1761
|
+
private updatePosition;
|
|
1762
|
+
private startAutoUpdate;
|
|
1763
|
+
private stopAutoUpdate;
|
|
1764
|
+
private cleanup;
|
|
1765
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HviTooltip, never>;
|
|
1766
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HviTooltip, "[hviTooltip]", never, { "hviTooltip": { "alias": "hviTooltip"; "required": true; }; "tooltipPlacement": { "alias": "tooltipPlacement"; "required": false; }; "tooltipAutoPlacement": { "alias": "tooltipAutoPlacement"; "required": false; }; "tooltipType": { "alias": "tooltipType"; "required": false; }; "tooltipShowDelay": { "alias": "tooltipShowDelay"; "required": false; }; "tooltipHideDelay": { "alias": "tooltipHideDelay"; "required": false; }; }, {}, never, never, true, never>;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
export { HviAlert, HviAvatar, HviBadge, HviBadgePosition, HviBreadcrumbs, HviButton, HviCard, HviCardBlock, HviChipButton, HviChipLabel, HviControlInvalid, HviDetails, HviDetailsContent, HviDetailsSummary, HviDialog, HviDialogBlock, HviDivider, HviErrorSummary, HviField, HviFieldAffix, HviFieldAffixes, HviFieldCounter, HviFieldDescription, HviFieldKit, HviFieldOptional, HviFieldValidation, HviFieldset, HviForm, HviForms, HviHeading, HviIcon, HviInput, HviLabel, HviLink, HviList, HviPagination, HviParagraph, HviPopover, HviSearch, HviSearchClear, HviSelect, HviSkeleton, HviSkipLink, HviSortableColumn, HviSpinner, HviTab, HviTabPanel, HviTable, HviTabs, HviTag, HviToggleGroup, HviToggleGroupItem, HviToggleGroupItemToken, HviTooltip, HviValidationKit, HviValidationMessage, fieldObserver, hviCustom, hviEmail, hviExtractMessages, hviExtractValidators, hviMax, hviMaxLength, hviMin, hviMinLength, hviNullValidator, hviPattern, hviRequired, hviRequiredTrue, hviValidators, isElement, isInputLike, isLabel };
|
|
1770
|
+
export type { HviErrorSummaryItem, HviErrorSummaryMessages, HviValidationMessages, HviValidatorBundle, HviValidatorConfig, PageChangeEvent, PaginationItem, SortDirection, SpinnerSize, TablePageEvent, TableSortEvent };
|