@sebgroup/green-angular 4.6.1 → 4.6.2

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.
Files changed (133) hide show
  1. package/esm2022/src/v-angular/dropdown/typeahead/index.mjs +4 -1
  2. package/esm2022/src/v-angular/dropdown/typeahead/typeahead.directive.mjs +177 -0
  3. package/esm2022/v-angular/base-control-value-accessor/base-control-value-accessor.component.mjs +287 -0
  4. package/esm2022/v-angular/base-control-value-accessor/base-control-value-accessor.module.mjs +17 -0
  5. package/esm2022/v-angular/base-control-value-accessor/index.mjs +3 -0
  6. package/esm2022/v-angular/breadcrumbs/breadcrumbs.component.mjs +25 -0
  7. package/esm2022/v-angular/breadcrumbs/breadcrumbs.module.mjs +20 -0
  8. package/esm2022/v-angular/breadcrumbs/index.mjs +3 -0
  9. package/esm2022/v-angular/button/button.component.mjs +108 -0
  10. package/esm2022/v-angular/button/button.module.mjs +20 -0
  11. package/esm2022/v-angular/button/index.mjs +3 -0
  12. package/esm2022/v-angular/card/card.component.mjs +11 -0
  13. package/esm2022/v-angular/card/card.module.mjs +18 -0
  14. package/esm2022/v-angular/card/index.mjs +3 -0
  15. package/esm2022/v-angular/checkbox/checkbox.component.mjs +72 -0
  16. package/esm2022/v-angular/checkbox/checkbox.module.mjs +19 -0
  17. package/esm2022/v-angular/checkbox/index.mjs +3 -0
  18. package/esm2022/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +256 -0
  19. package/esm2022/v-angular/dropdown/dropdown-list/index.mjs +2 -0
  20. package/esm2022/v-angular/dropdown/dropdown.component.mjs +239 -0
  21. package/esm2022/v-angular/dropdown/dropdown.module.mjs +22 -0
  22. package/esm2022/v-angular/dropdown/index.mjs +6 -0
  23. package/esm2022/v-angular/dropdown/typeahead/index.mjs +6 -0
  24. package/esm2022/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.mjs +98 -0
  25. package/esm2022/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.mjs +85 -0
  26. package/esm2022/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +132 -0
  27. package/esm2022/v-angular/dropdown/typeahead/typeahead.directive.mjs +177 -0
  28. package/esm2022/v-angular/dropdown/typeahead/typeahead.module.mjs +33 -0
  29. package/esm2022/v-angular/i18n/i18n.json +12 -0
  30. package/esm2022/v-angular/i18n/i18n.module.mjs +83 -0
  31. package/esm2022/v-angular/i18n/i18n.test.module.mjs +89 -0
  32. package/esm2022/v-angular/i18n/index.mjs +3 -0
  33. package/esm2022/v-angular/index.mjs +17 -0
  34. package/esm2022/v-angular/info-circle/index.mjs +3 -0
  35. package/esm2022/v-angular/info-circle/info-circle.component.mjs +28 -0
  36. package/esm2022/v-angular/info-circle/info-circle.module.mjs +21 -0
  37. package/esm2022/v-angular/input/index.mjs +3 -0
  38. package/esm2022/v-angular/input/input.component.mjs +221 -0
  39. package/esm2022/v-angular/input/input.module.mjs +32 -0
  40. package/esm2022/v-angular/input-mask/config.mjs +9 -0
  41. package/esm2022/v-angular/input-mask/constants.mjs +2 -0
  42. package/esm2022/v-angular/input-mask/index.mjs +6 -0
  43. package/esm2022/v-angular/input-mask/input-mask-format.pipe.mjs +20 -0
  44. package/esm2022/v-angular/input-mask/input-mask.directive.mjs +165 -0
  45. package/esm2022/v-angular/input-mask/input-mask.module.mjs +35 -0
  46. package/esm2022/v-angular/input-mask/input-mask.types.mjs +2 -0
  47. package/esm2022/v-angular/modal/dialog/dialog.component.mjs +190 -0
  48. package/esm2022/v-angular/modal/fold-out/fold-out.component.mjs +56 -0
  49. package/esm2022/v-angular/modal/fold-out/fold-out.directive.mjs +19 -0
  50. package/esm2022/v-angular/modal/index.mjs +6 -0
  51. package/esm2022/v-angular/modal/modal.globals.mjs +20 -0
  52. package/esm2022/v-angular/modal/modal.module.mjs +40 -0
  53. package/esm2022/v-angular/modal/modal.types.mjs +2 -0
  54. package/esm2022/v-angular/modal/slide-out/slide-out.component.mjs +229 -0
  55. package/esm2022/v-angular/radio/index.mjs +3 -0
  56. package/esm2022/v-angular/radio/radio.component.mjs +130 -0
  57. package/esm2022/v-angular/radio/radio.module.mjs +20 -0
  58. package/esm2022/v-angular/sebgroup-green-angular-v-angular.mjs +5 -0
  59. package/esm2022/v-angular/textarea/index.mjs +3 -0
  60. package/esm2022/v-angular/textarea/textarea.component.mjs +101 -0
  61. package/esm2022/v-angular/textarea/textarea.module.mjs +18 -0
  62. package/esm2022/v-angular/tooltip/index.mjs +3 -0
  63. package/esm2022/v-angular/tooltip/tooltip.directive.mjs +273 -0
  64. package/esm2022/v-angular/tooltip/tooltip.module.mjs +18 -0
  65. package/esm2022/v-angular/v-angular.module.mjs +76 -0
  66. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs +172 -3
  67. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs.map +1 -1
  68. package/fesm2022/sebgroup-green-angular-v-angular.mjs +3341 -0
  69. package/fesm2022/sebgroup-green-angular-v-angular.mjs.map +1 -0
  70. package/package.json +8 -2
  71. package/src/v-angular/dropdown/typeahead/index.d.ts +3 -0
  72. package/src/v-angular/dropdown/typeahead/typeahead.directive.d.ts +76 -0
  73. package/v-angular/base-control-value-accessor/base-control-value-accessor.component.d.ts +124 -0
  74. package/v-angular/base-control-value-accessor/base-control-value-accessor.module.d.ts +7 -0
  75. package/v-angular/base-control-value-accessor/index.d.ts +2 -0
  76. package/v-angular/breadcrumbs/breadcrumbs.component.d.ts +18 -0
  77. package/v-angular/breadcrumbs/breadcrumbs.module.d.ts +10 -0
  78. package/v-angular/breadcrumbs/index.d.ts +2 -0
  79. package/v-angular/button/button.component.d.ts +62 -0
  80. package/v-angular/button/button.module.d.ts +10 -0
  81. package/v-angular/button/index.d.ts +2 -0
  82. package/v-angular/card/card.component.d.ts +5 -0
  83. package/v-angular/card/card.module.d.ts +8 -0
  84. package/v-angular/card/index.d.ts +2 -0
  85. package/v-angular/checkbox/checkbox.component.d.ts +27 -0
  86. package/v-angular/checkbox/checkbox.module.d.ts +9 -0
  87. package/v-angular/checkbox/index.d.ts +2 -0
  88. package/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +89 -0
  89. package/v-angular/dropdown/dropdown-list/index.d.ts +1 -0
  90. package/v-angular/dropdown/dropdown.component.d.ts +99 -0
  91. package/v-angular/dropdown/dropdown.module.d.ts +12 -0
  92. package/v-angular/dropdown/index.d.ts +5 -0
  93. package/v-angular/dropdown/typeahead/index.d.ts +5 -0
  94. package/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.d.ts +34 -0
  95. package/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.d.ts +34 -0
  96. package/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.d.ts +59 -0
  97. package/v-angular/dropdown/typeahead/typeahead.directive.d.ts +76 -0
  98. package/v-angular/dropdown/typeahead/typeahead.module.d.ts +11 -0
  99. package/v-angular/i18n/i18n.module.d.ts +15 -0
  100. package/v-angular/i18n/i18n.test.module.d.ts +27 -0
  101. package/v-angular/i18n/index.d.ts +2 -0
  102. package/v-angular/index.d.ts +16 -0
  103. package/v-angular/info-circle/index.d.ts +2 -0
  104. package/v-angular/info-circle/info-circle.component.d.ts +16 -0
  105. package/v-angular/info-circle/info-circle.module.d.ts +10 -0
  106. package/v-angular/input/index.d.ts +2 -0
  107. package/v-angular/input/input.component.d.ts +90 -0
  108. package/v-angular/input/input.module.d.ts +11 -0
  109. package/v-angular/input-mask/config.d.ts +6 -0
  110. package/v-angular/input-mask/constants.d.ts +2 -0
  111. package/v-angular/input-mask/index.d.ts +5 -0
  112. package/v-angular/input-mask/input-mask-format.pipe.d.ts +8 -0
  113. package/v-angular/input-mask/input-mask.directive.d.ts +39 -0
  114. package/v-angular/input-mask/input-mask.module.d.ts +11 -0
  115. package/v-angular/input-mask/input-mask.types.d.ts +20 -0
  116. package/v-angular/modal/dialog/dialog.component.d.ts +55 -0
  117. package/v-angular/modal/fold-out/fold-out.component.d.ts +24 -0
  118. package/v-angular/modal/fold-out/fold-out.directive.d.ts +6 -0
  119. package/v-angular/modal/index.d.ts +5 -0
  120. package/v-angular/modal/modal.globals.d.ts +13 -0
  121. package/v-angular/modal/modal.module.d.ts +13 -0
  122. package/v-angular/modal/modal.types.d.ts +5 -0
  123. package/v-angular/modal/slide-out/slide-out.component.d.ts +76 -0
  124. package/v-angular/radio/index.d.ts +2 -0
  125. package/v-angular/radio/radio.component.d.ts +48 -0
  126. package/v-angular/radio/radio.module.d.ts +9 -0
  127. package/v-angular/textarea/index.d.ts +2 -0
  128. package/v-angular/textarea/textarea.component.d.ts +44 -0
  129. package/v-angular/textarea/textarea.module.d.ts +8 -0
  130. package/v-angular/tooltip/index.d.ts +2 -0
  131. package/v-angular/tooltip/tooltip.directive.d.ts +106 -0
  132. package/v-angular/tooltip/tooltip.module.d.ts +8 -0
  133. package/v-angular/v-angular.module.d.ts +22 -0
@@ -0,0 +1,3341 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, TemplateRef, ElementRef, Injectable, Component, Self, Optional, Inject, ContentChild, ViewChild, HostBinding, Input, Output, NgModule, ViewChildren, HostListener, SkipSelf, Directive, Host, isDevMode, Pipe, CUSTOM_ELEMENTS_SCHEMA, InjectionToken, PLATFORM_ID } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { Validators, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
5
+ import { Subject, fromEvent, takeUntil as takeUntil$1, distinctUntilChanged, tap, from, withLatestFrom, lastValueFrom, of, delay } from 'rxjs';
6
+ import { takeUntil, debounceTime } from 'rxjs/operators';
7
+ import * as i3$1 from '@ngneat/transloco';
8
+ import { TRANSLOCO_SCOPE, TRANSLOCO_TRANSPILER, TranslocoModule, provideTransloco, provideTranslocoMissingHandler, TRANSLOCO_INTERCEPTOR, TRANSLOCO_FALLBACK_STRATEGY, TRANSLOCO_MISSING_HANDLER } from '@ngneat/transloco';
9
+ import * as i2 from '@angular/common';
10
+ import { CommonModule, isPlatformServer } from '@angular/common';
11
+ import * as i2$1 from '@sebgroup/green-angular/src/v-angular/external-link';
12
+ import { NgvExternalLinkDirectiveModule } from '@sebgroup/green-angular/src/v-angular/external-link';
13
+ import * as i3 from '@angular/router';
14
+ import { RouterModule } from '@angular/router';
15
+ import { NgvBaseControlValueAccessorComponent as NgvBaseControlValueAccessorComponent$1 } from '@sebgroup/green-angular/src/v-angular/base-control-value-accessor';
16
+ import { NgvI18nModule as NgvI18nModule$1 } from '@sebgroup/green-angular/src/v-angular/i18n';
17
+ import * as i2$2 from '@sebgroup/green-angular/src/v-angular/core';
18
+ import { DropdownUtils } from '@sebgroup/green-angular/src/v-angular/core';
19
+ import scrollIntoView from 'scroll-into-view-if-needed';
20
+ import * as i3$2 from '@sebgroup/green-angular/src/v-angular/tooltip';
21
+ import { NgvTooltipModule as NgvTooltipModule$1 } from '@sebgroup/green-angular/src/v-angular/tooltip';
22
+ import * as i2$3 from '@sebgroup/green-angular/src/v-angular/input';
23
+ import { NgvInputComponent as NgvInputComponent$1 } from '@sebgroup/green-angular/src/v-angular/input';
24
+ import '@sebgroup/green-core/components/icon/icons/circle-info';
25
+ import { NggCoreWrapperModule } from '@sebgroup/green-angular/src/lib/shared';
26
+ import * as i4 from '@sebgroup/green-angular/src/v-angular/input-mask';
27
+ import { NgvInputMaskModule as NgvInputMaskModule$1 } from '@sebgroup/green-angular/src/v-angular/input-mask';
28
+ import _Inputmask from 'inputmask';
29
+ import '@sebgroup/green-core/components/icon/icons/dot-grid-one-horizontal';
30
+ import { trigger, transition, query, style, group, animate } from '@angular/animations';
31
+ import { NgvButtonModule as NgvButtonModule$1 } from '@sebgroup/green-angular/src/v-angular/button';
32
+
33
+ // eslint-disable-next-line @angular-eslint/directive-class-suffix
34
+ class NgvBaseControlValueAccessorComponent {
35
+ /** Hides the input borders and displays current value as a text. */
36
+ set locked(value) {
37
+ this._locked = value;
38
+ this.cdr.detectChanges();
39
+ }
40
+ get locked() {
41
+ return this._locked;
42
+ }
43
+ /** Override the required flag of the component. */
44
+ set required(value) {
45
+ this._required = value;
46
+ }
47
+ /** Child input element is considered required and changes default label template accordingly. */
48
+ get required() {
49
+ // if required is set => return required
50
+ if (this._required !== undefined)
51
+ return this._required;
52
+ // if required can be determined from the control => return control.required
53
+ if (this.ngControl?.control?.validator) {
54
+ const validator = this.ngControl?.control?.validator({});
55
+ // returns true for any error that starts with required
56
+ return Object.keys(validator ?? {}).some((key) => key.startsWith('required'));
57
+ }
58
+ return;
59
+ }
60
+ /** Override the invalid state of the component. */
61
+ set invalid(value) {
62
+ this._invalid = value;
63
+ }
64
+ /** The component has the invalid state, usually decorating the elements red and shows the first error. */
65
+ get invalid() {
66
+ if (this._invalid === true || this._invalid === false)
67
+ return this._invalid;
68
+ return (!!this.ngControl?.control?.invalid && this.ngControl?.control?.touched);
69
+ }
70
+ /** Override the valid state of the component. */
71
+ set valid(value) {
72
+ this._valid = value;
73
+ }
74
+ /** The component has the valid state, usually decorating the elements green. */
75
+ get valid() {
76
+ if (this._valid === true || this._valid === false)
77
+ return this._valid;
78
+ return !!this.ngControl?.control?.valid && this.ngControl?.control?.touched;
79
+ }
80
+ /** Override the disabled state of the component. */
81
+ set disabled(value) {
82
+ this._disabled = value;
83
+ }
84
+ /** The component has the disabled state, usually muting the colors and removes interaction. */
85
+ get disabled() {
86
+ if (this._disabled === true || this._disabled === false)
87
+ return this._disabled;
88
+ return !!this.ngControl?.control?.disabled;
89
+ }
90
+ /**
91
+ * Creates a new BaseControlValueAccessorComponent.
92
+ * @param ngControl optional FormControl provided when component is used in a form, through dependency injection.
93
+ * @param translocoScope optional TranslocoScope provided if component is used within a scope.
94
+ */
95
+ constructor(ngControl, translocoScope, cdr) {
96
+ this.ngControl = ngControl;
97
+ this.translocoScope = translocoScope;
98
+ this.cdr = cdr;
99
+ /* ATTRIBUTES */
100
+ /** Id of the host element and is accessible by the children, automatically generated if not provided. */
101
+ this.id = window.ngv?.nextId();
102
+ /** If set to true, the browser will try to automatically set focus to the child input element. */
103
+ this.autofocus = false;
104
+ this._locked = undefined;
105
+ /* STATES */
106
+ this._required = undefined;
107
+ this._invalid = undefined;
108
+ this._valid = undefined;
109
+ /** The component has the focused state, updated by the child input element's focus state. */
110
+ this.focused = false;
111
+ this._disabled = undefined;
112
+ /* TRIGGERS */
113
+ /** Emits focus events triggered by the child elements. */
114
+ this.ngvFocus = new EventEmitter();
115
+ /** Emits focus events triggered by the child elements. */
116
+ this.ngvBlur = new EventEmitter();
117
+ /* VALUE HANDLERS */
118
+ this._state = null;
119
+ /** @internal */
120
+ this.onChange = (_) => {
121
+ // do nothing
122
+ };
123
+ /** @internal */
124
+ this.onTouched = () => {
125
+ // do nothing
126
+ };
127
+ /** @internal */
128
+ this.onValidatorChange = () => null;
129
+ /* LIFE CYCLE VARIABLES */
130
+ this._onDestroy$ = new Subject();
131
+ if (this.ngControl) {
132
+ // Note: we provide the value accessor through here, instead of
133
+ // the `providers` to avoid running into a circular import.
134
+ this.ngControl.valueAccessor = this;
135
+ }
136
+ if (this.translocoScope)
137
+ this.scope = this.translocoScope.toString();
138
+ }
139
+ // eslint-disable-next-line @angular-eslint/contextual-lifecycle
140
+ ngOnInit() {
141
+ if (this.ngControl && this.ngControl.control) {
142
+ this.ngControl.control.setValidators(Validators.compose([this.ngControl.control.validator, this.validate]));
143
+ }
144
+ // if reset observable has been passed, subscribe after updates
145
+ this.reset?.pipe(takeUntil(this._onDestroy$)).subscribe({
146
+ next: () => {
147
+ // reset value of controller
148
+ this.state = this.defaultValue;
149
+ this.onChange(this.state);
150
+ this.cdr.detectChanges();
151
+ },
152
+ });
153
+ }
154
+ // eslint-disable-next-line @angular-eslint/contextual-lifecycle
155
+ ngAfterViewInit() {
156
+ // if default value is set, then don't alter it. Otherwise, use
157
+ // current value of controller after initiation as default value
158
+ this.defaultValue = this.defaultValue ?? this.ngControl?.value;
159
+ }
160
+ ngOnDestroy() {
161
+ this._onDestroy$.next(true);
162
+ this._onDestroy$.complete();
163
+ }
164
+ detectChanges() {
165
+ this.cdr.detectChanges();
166
+ }
167
+ /** @internal */
168
+ onFocus(event) {
169
+ event.stopPropagation
170
+ ? event.stopPropagation()
171
+ : (event.cancelBubble = true);
172
+ this.focused = true;
173
+ this.ngvFocus.emit(event);
174
+ }
175
+ /** @internal */
176
+ onBlur(event) {
177
+ event.stopPropagation
178
+ ? event.stopPropagation()
179
+ : (event.cancelBubble = true);
180
+ this.onTouched();
181
+ this.focused = false;
182
+ this.ngvBlur.emit(event);
183
+ }
184
+ /** Sets the focus on the actual input element. */
185
+ setFocus() {
186
+ if (this.inputRef)
187
+ this.inputRef.nativeElement.focus();
188
+ }
189
+ // ----------------------------------------------------------------------------
190
+ // CONTROL VALUE ACCESSOR
191
+ // ----------------------------------------------------------------------------
192
+ /** Internal state/value that the native input element has. */
193
+ get state() {
194
+ return this._state;
195
+ }
196
+ /** Internal state/value that the native input element has. */
197
+ set state(value) {
198
+ if (typeof value === 'undefined')
199
+ value = null;
200
+ this._state = value;
201
+ }
202
+ /** Writes a new value to the child input element. */
203
+ writeValue(value) {
204
+ this.state = value;
205
+ }
206
+ /** Registers a callback function that is called when the child input element's value changes. */
207
+ registerOnChange(fn) {
208
+ this.onChange = fn;
209
+ }
210
+ /** Registers a callback function that is called when the child input element triggers on blur. */
211
+ registerOnTouched(fn) {
212
+ this.onTouched = fn;
213
+ }
214
+ /** Function that is called by the forms API when the control status changes to or from 'DISABLED'. */
215
+ setDisabledState(isDisabled) {
216
+ this.disabled = isDisabled;
217
+ // if displayDisabledAsLocked is enabled - update locked state based on disabled state
218
+ if (this.displayDisabledAsLocked) {
219
+ this.locked = isDisabled;
220
+ }
221
+ }
222
+ // ----------------------------------------------------------------------------
223
+ // VALIDATORS
224
+ // ----------------------------------------------------------------------------
225
+ /** Method that performs synchronous validation against the provided control. Used for internal validation. */
226
+ validate(_control) {
227
+ return null;
228
+ }
229
+ /** Registers a callback function to call when the validator inputs change. */
230
+ registerOnValidatorChange(fn) {
231
+ this.onValidatorChange = fn;
232
+ }
233
+ // ----------------------------------------------------------------------------
234
+ // HELPERS
235
+ // ----------------------------------------------------------------------------
236
+ /** Returns the first entry in an error object. */
237
+ get firstError() {
238
+ const errors = this.ngControl.errors;
239
+ if (!errors)
240
+ return null;
241
+ const code = Object.keys(errors)[0];
242
+ return { code, params: errors[code] };
243
+ }
244
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
245
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvBaseControlValueAccessorComponent, selector: "ng-component", inputs: { id: "id", name: "name", label: "label", role: "role", value: "value", error: "error", description: "description", autofocus: "autofocus", defaultValue: "defaultValue", reset: "reset", optional: "optional", locked: "locked", displayDisabledAsLocked: "displayDisabledAsLocked", required: "required", invalid: "invalid", valid: "valid", focused: "focused", disabled: "disabled" }, outputs: { ngvFocus: "ngvFocus", ngvBlur: "ngvBlur" }, host: { properties: { "attr.id": "this.id" } }, queries: [{ propertyName: "labelContentTpl", first: true, predicate: ["labelTpl"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, read: ElementRef }], ngImport: i0, template: '', isInline: true }); }
246
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorComponent }); }
247
+ }
248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorComponent, decorators: [{
249
+ type: Injectable
250
+ }, {
251
+ type: Component,
252
+ args: [{ template: '' }]
253
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
254
+ type: Self
255
+ }, {
256
+ type: Optional
257
+ }] }, { type: undefined, decorators: [{
258
+ type: Optional
259
+ }, {
260
+ type: Inject,
261
+ args: [TRANSLOCO_SCOPE]
262
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { labelContentTpl: [{
263
+ type: ContentChild,
264
+ args: ['labelTpl', { read: TemplateRef }]
265
+ }], inputRef: [{
266
+ type: ViewChild,
267
+ args: ['input', { read: ElementRef }]
268
+ }], id: [{
269
+ type: HostBinding,
270
+ args: ['attr.id']
271
+ }, {
272
+ type: Input
273
+ }], name: [{
274
+ type: Input
275
+ }], label: [{
276
+ type: Input
277
+ }], role: [{
278
+ type: Input
279
+ }], value: [{
280
+ type: Input
281
+ }], error: [{
282
+ type: Input
283
+ }], description: [{
284
+ type: Input
285
+ }], autofocus: [{
286
+ type: Input
287
+ }], defaultValue: [{
288
+ type: Input
289
+ }], reset: [{
290
+ type: Input
291
+ }], optional: [{
292
+ type: Input
293
+ }], locked: [{
294
+ type: Input
295
+ }], displayDisabledAsLocked: [{
296
+ type: Input
297
+ }], required: [{
298
+ type: Input
299
+ }], invalid: [{
300
+ type: Input
301
+ }], valid: [{
302
+ type: Input
303
+ }], focused: [{
304
+ type: Input
305
+ }], disabled: [{
306
+ type: Input
307
+ }], ngvFocus: [{
308
+ type: Output
309
+ }], ngvBlur: [{
310
+ type: Output
311
+ }] } });
312
+
313
+ class NgvBaseControlValueAccessorModule {
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
315
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorModule, declarations: [NgvBaseControlValueAccessorComponent], exports: [NgvBaseControlValueAccessorComponent] }); }
316
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorModule }); }
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBaseControlValueAccessorModule, decorators: [{
319
+ type: NgModule,
320
+ args: [{
321
+ declarations: [NgvBaseControlValueAccessorComponent],
322
+ imports: [],
323
+ exports: [NgvBaseControlValueAccessorComponent],
324
+ }]
325
+ }] });
326
+
327
+ class NgvBreadcrumbsComponent {
328
+ constructor() {
329
+ /** Special property used for selecting DOM elements during automated UI testing. */
330
+ this.thook = 'breadcrumbs';
331
+ }
332
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
333
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvBreadcrumbsComponent, selector: "nggv-breadcrumbs", inputs: { thook: "thook", breadcrumbs: "breadcrumbs" }, host: { properties: { "attr.data-thook": "this.thook" } }, ngImport: i0, template: "<nav aria-label=\"Breadcrumbs\">\n <ol class=\"gds-breadcrumbs\">\n <ng-container *ngFor=\"let breadcrumb of breadcrumbs; let i = index\">\n <li [attr.aria-current]=\"i === breadcrumbs.length - 1\">\n <a\n [routerLink]=\"breadcrumb.href\"\n [external]=\"!!breadcrumb.external\"\n *ngIf=\"i < breadcrumbs.length - 1; else currentPageRef\"\n >{{ breadcrumb.title }}</a\n >\n <ng-template #currentPageRef>\n <span>{{ breadcrumb.title }}</span>\n </ng-template>\n </li>\n <li class=\"icon\" *ngIf=\"i < breadcrumbs.length - 1\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M9.22817 5.19072L8.60942 5.80947C8.46255 5.95635 8.46255 6.19385 8.60942 6.34072L14.2563 12.0001L8.60942 17.6595C8.46255 17.8063 8.46255 18.0438 8.60942 18.1907L9.22817 18.8095C9.37505 18.9563 9.61255 18.9563 9.75942 18.8095L16.3032 12.2657C16.45 12.1188 16.45 11.8813 16.3032 11.7345L9.75942 5.19072C9.61255 5.04385 9.37505 5.04385 9.22817 5.19072Z\"\n fill=\"#000\"\n />\n </svg>\n </li>\n </ng-container>\n </ol>\n</nav>\n", styles: [":host ol{padding-left:0;margin-bottom:0;margin-top:0;display:flex;flex-direction:column;list-style:none;flex-direction:row!important;align-items:center;gap:4px}:host ol>li{padding-bottom:.5rem;padding-top:.5rem;border:0;display:block;position:relative}:host ol>li:before{font-weight:500;display:inline-block;left:0;position:absolute;text-align:center}:host ol>li{padding:0!important;font-weight:500}:host ol>li:before{display:none!important}:host ol>li.icon{display:flex}:host ol>li.icon>svg{height:1rem;width:1rem}:host ol a{text-decoration:underline;text-underline-offset:3px;color:#0062bc;font-weight:500;border:none;border-radius:.125rem}:host ol a:hover{text-underline-offset:2px;text-decoration-thickness:2px}:host ol a:active{text-underline-offset:1px}:host ol a:focus:not(:focus-visible){box-shadow:none;outline:0}:host ol a:focus,:host ol a:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host ol a:focus:not([aria-disabled]){color:#0092e1}:host ol a.link-history:visited{color:#673ab6}:host ol svg{width:1rem;height:1rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgvExternalLinkDirective, selector: "a[routerLink]", inputs: ["external"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] }); }
334
+ }
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBreadcrumbsComponent, decorators: [{
336
+ type: Component,
337
+ args: [{ selector: 'nggv-breadcrumbs', template: "<nav aria-label=\"Breadcrumbs\">\n <ol class=\"gds-breadcrumbs\">\n <ng-container *ngFor=\"let breadcrumb of breadcrumbs; let i = index\">\n <li [attr.aria-current]=\"i === breadcrumbs.length - 1\">\n <a\n [routerLink]=\"breadcrumb.href\"\n [external]=\"!!breadcrumb.external\"\n *ngIf=\"i < breadcrumbs.length - 1; else currentPageRef\"\n >{{ breadcrumb.title }}</a\n >\n <ng-template #currentPageRef>\n <span>{{ breadcrumb.title }}</span>\n </ng-template>\n </li>\n <li class=\"icon\" *ngIf=\"i < breadcrumbs.length - 1\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M9.22817 5.19072L8.60942 5.80947C8.46255 5.95635 8.46255 6.19385 8.60942 6.34072L14.2563 12.0001L8.60942 17.6595C8.46255 17.8063 8.46255 18.0438 8.60942 18.1907L9.22817 18.8095C9.37505 18.9563 9.61255 18.9563 9.75942 18.8095L16.3032 12.2657C16.45 12.1188 16.45 11.8813 16.3032 11.7345L9.75942 5.19072C9.61255 5.04385 9.37505 5.04385 9.22817 5.19072Z\"\n fill=\"#000\"\n />\n </svg>\n </li>\n </ng-container>\n </ol>\n</nav>\n", styles: [":host ol{padding-left:0;margin-bottom:0;margin-top:0;display:flex;flex-direction:column;list-style:none;flex-direction:row!important;align-items:center;gap:4px}:host ol>li{padding-bottom:.5rem;padding-top:.5rem;border:0;display:block;position:relative}:host ol>li:before{font-weight:500;display:inline-block;left:0;position:absolute;text-align:center}:host ol>li{padding:0!important;font-weight:500}:host ol>li:before{display:none!important}:host ol>li.icon{display:flex}:host ol>li.icon>svg{height:1rem;width:1rem}:host ol a{text-decoration:underline;text-underline-offset:3px;color:#0062bc;font-weight:500;border:none;border-radius:.125rem}:host ol a:hover{text-underline-offset:2px;text-decoration-thickness:2px}:host ol a:active{text-underline-offset:1px}:host ol a:focus:not(:focus-visible){box-shadow:none;outline:0}:host ol a:focus,:host ol a:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host ol a:focus:not([aria-disabled]){color:#0092e1}:host ol a.link-history:visited{color:#673ab6}:host ol svg{width:1rem;height:1rem}\n"] }]
338
+ }], propDecorators: { thook: [{
339
+ type: HostBinding,
340
+ args: ['attr.data-thook']
341
+ }, {
342
+ type: Input
343
+ }], breadcrumbs: [{
344
+ type: Input
345
+ }] } });
346
+
347
+ class NgvBreadcrumbsModule {
348
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBreadcrumbsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
349
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvBreadcrumbsModule, declarations: [NgvBreadcrumbsComponent], imports: [CommonModule, NgvExternalLinkDirectiveModule, RouterModule], exports: [NgvBreadcrumbsComponent] }); }
350
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBreadcrumbsModule, imports: [CommonModule, NgvExternalLinkDirectiveModule, RouterModule] }); }
351
+ }
352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvBreadcrumbsModule, decorators: [{
353
+ type: NgModule,
354
+ args: [{
355
+ declarations: [NgvBreadcrumbsComponent],
356
+ imports: [CommonModule, NgvExternalLinkDirectiveModule, RouterModule],
357
+ exports: [NgvBreadcrumbsComponent],
358
+ }]
359
+ }] });
360
+
361
+ var ButtonStyle;
362
+ (function (ButtonStyle) {
363
+ ButtonStyle[ButtonStyle["Primary"] = 0] = "Primary";
364
+ ButtonStyle[ButtonStyle["Secondary"] = 1] = "Secondary";
365
+ ButtonStyle[ButtonStyle["Alternative"] = 2] = "Alternative";
366
+ ButtonStyle[ButtonStyle["Delete"] = 3] = "Delete";
367
+ ButtonStyle[ButtonStyle["DeleteConfirm"] = 4] = "DeleteConfirm";
368
+ ButtonStyle[ButtonStyle["Ghost"] = 5] = "Ghost";
369
+ ButtonStyle[ButtonStyle["GhostDark"] = 6] = "GhostDark";
370
+ ButtonStyle[ButtonStyle["Link"] = 7] = "Link";
371
+ })(ButtonStyle || (ButtonStyle = {}));
372
+ /**
373
+ * Buttons allow users to take action with a single tap.
374
+ * https://designlibrary.sebgroup.com/components/component-button
375
+ */
376
+ class NgvButtonComponent extends NgvBaseControlValueAccessorComponent$1 {
377
+ constructor(ngControl, translocoScope, cdr) {
378
+ super(ngControl, translocoScope, cdr);
379
+ this.ngControl = ngControl;
380
+ this.translocoScope = translocoScope;
381
+ this.cdr = cdr;
382
+ /** Special property used for selecting DOM elements during automated UI testing. */
383
+ this.thook = 'button';
384
+ /** Type of button to one of button|submit|reset|link, where link creates an anchor tag. */
385
+ this.type = 'button';
386
+ /** Style of the button to one of Primary|Secondary|Alternative|Delete|DeleteConfirm|Ghost|GhostDark|Link. */
387
+ this.buttonStyle = this.type === 'link' ? ButtonStyle.Link : ButtonStyle.Primary;
388
+ /** Size of the button to be smaller. */
389
+ this.small = false;
390
+ /** @internal Determines if the the href property should use internal routing. */
391
+ this.external = false;
392
+ /** @internal The classes determined by the buttonStyle and small properties. */
393
+ this.buttonClasses = {};
394
+ /** Emits click events triggered by the button or link.
395
+ * Use instead of click to avoid triggering events on disabled buttons and links.
396
+ */
397
+ this.ngvClick = new EventEmitter();
398
+ }
399
+ /** @internal */
400
+ static buttonStyleClasses(type, small) {
401
+ return {
402
+ small: small,
403
+ primary: type === ButtonStyle.Primary || type === ButtonStyle.Delete,
404
+ secondary: type === ButtonStyle.Secondary,
405
+ tertiary: type === ButtonStyle.Alternative || type === ButtonStyle.Link,
406
+ danger: type === ButtonStyle.Delete || type === ButtonStyle.DeleteConfirm,
407
+ ghost: type === ButtonStyle.GhostDark,
408
+ 'ghost-light': type === ButtonStyle.Ghost,
409
+ };
410
+ }
411
+ ngOnInit() {
412
+ super.ngOnInit();
413
+ if (this.href)
414
+ this.external = /^\w+:\/\/.+$/.test(this.href);
415
+ this.buttonClasses = NgvButtonComponent.buttonStyleClasses(this.buttonStyle, this.small);
416
+ }
417
+ ngOnChanges(changes) {
418
+ if (changes.buttonStyle || changes.small) {
419
+ this.buttonClasses = NgvButtonComponent.buttonStyleClasses(this.buttonStyle, this.small);
420
+ }
421
+ }
422
+ /** @internal */
423
+ onClick(event) {
424
+ if (this.disabled)
425
+ return;
426
+ this.ngvClick.emit(event);
427
+ }
428
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvButtonComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
429
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvButtonComponent, selector: "nggv-button", inputs: { thook: "thook", type: "type", buttonStyle: "buttonStyle", small: "small", href: "href" }, outputs: { ngvClick: "ngvClick" }, host: { properties: { "attr.data-thook": "this.thook" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<button\n #input\n [ngClass]=\"buttonClasses\"\n [id]=\"id + '-button'\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [type]=\"type\"\n [autofocus]=\"autofocus\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"description\"\n (click)=\"onClick($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n *ngIf=\"type !== 'link'\"\n>\n <ng-container *ngTemplateOutlet=\"contentRef\"></ng-container>\n</button>\n\n<a\n #input\n [ngClass]=\"buttonClasses\"\n role=\"button\"\n [id]=\"id + '-link'\"\n [routerLink]=\"href\"\n [external]=\"external\"\n [attr.aria-label]=\"description\"\n (click)=\"onClick($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n *ngIf=\"type === 'link'\"\n>\n <ng-container *ngTemplateOutlet=\"contentRef\"></ng-container>\n</a>\n\n<ng-template #contentRef>\n <ng-content></ng-content>\n</ng-template>\n", styles: [":host button,:host a{background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}:host button:focus:not(:focus-visible),:host a:focus:not(:focus-visible){box-shadow:none;outline:0}:host button:focus,:host button:focus-visible,:host a:focus,:host a:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host button,:host a{min-width:100%}}@media screen and (-ms-high-contrast: active){:host button,:host a{border:2px solid currentcolor}}:host button.small,:host a.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host button.large,:host a.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .primary{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:#007ac7;border-color:#007ac7;color:#fff;--color: #fff}:host .primary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host .primary[aria-selected=true],:host .primary:active,:host .primary.active,:host .primary.active:hover,:host .primary:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host .primary:focus-visible{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3!important}:host .primary:disabled,:host .primary.disabled,:host .primary[aria-disabled=true]{background:var(--form-control-primary-bg-disabled)!important;color:var(--text-primary-disabled-color)!important;border-color:var(--border-primary-disabled-color)!important;cursor:not-allowed}:host .primary:disabled::placeholder,:host .primary.disabled::placeholder,:host .primary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .secondary{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:transparent;border-color:#007ac7;color:#007ac7;--color: rgb(0, 122, 199)}:host .secondary:focus:not(:focus-visible){box-shadow:none;outline:0}:host .secondary:focus,:host .secondary:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .secondary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host .secondary[aria-selected=true],:host .secondary:active,:host .secondary.active,:host .secondary.active:hover,:host .secondary:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host .secondary:disabled,:host .secondary.disabled,:host .secondary[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .secondary:disabled::placeholder,:host .secondary.disabled::placeholder,:host .secondary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .tertiary{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:transparent;border-color:transparent;color:#007ac7;--color: rgb(0, 122, 199)}:host .tertiary:focus:not(:focus-visible){box-shadow:none;outline:0}:host .tertiary:focus,:host .tertiary:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .tertiary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host .tertiary[aria-selected=true],:host .tertiary:active,:host .tertiary.active,:host .tertiary.active:hover,:host .tertiary:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host .tertiary:disabled,:host .tertiary.disabled,:host .tertiary[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .tertiary:disabled::placeholder,:host .tertiary.disabled::placeholder,:host .tertiary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .ghost-light{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;border-color:#fff;color:#fff;--color: rgb(255, 255, 255)}:host .ghost-light:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#fff;color:#000;--background: rgb(255, 255, 255);--color: black;border-color:#fff}:host .ghost-light[aria-selected=true],:host .ghost-light:active,:host .ghost-light.active,:host .ghost-light.active:hover,:host .ghost-light:active:hover{background-color:#fff;color:#000;--background: rgb(255, 255, 255);--color: black;border-color:#fff}:host .ghost-light[aria-selected]:hover,:host .ghost-light.active:hover,:host .ghost-light:active:hover{opacity:.9}:host .ghost-light:focus-visible{background-color:#fff;color:#000;--background: rgb(255, 255, 255);--color: black;border-color:#fff!important}:host .ghost-light:disabled,:host .ghost-light.disabled,:host .ghost-light[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .ghost-light:disabled::placeholder,:host .ghost-light.disabled::placeholder,:host .ghost-light[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .ghost{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;border-color:#333;color:#333;--color: rgb(51, 51, 51)}:host .ghost:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .ghost[aria-selected=true],:host .ghost:active,:host .ghost.active,:host .ghost.active:hover,:host .ghost:active:hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .ghost[aria-selected]:hover,:host .ghost.active:hover,:host .ghost:active:hover{opacity:.9}:host .ghost:focus-visible{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333!important}:host .ghost:disabled,:host .ghost.disabled,:host .ghost[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .ghost:disabled::placeholder,:host .ghost.disabled::placeholder,:host .ghost[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .danger.primary{background:#bb000c;border-color:#bb000c;color:#fff;--color: #fff;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s}:host .danger.primary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#d81a1a;color:#fff;--background: rgb(216, 26, 26);--color: rgb(255, 255, 255);border-color:#d81a1a}:host .danger.primary[aria-selected=true],:host .danger.primary:active,:host .danger.primary.active,:host .danger.primary.active:hover,:host .danger.primary:active:hover{background-color:#bb000c;color:#fff;--background: rgb(187, 0, 12);--color: rgb(255, 255, 255);border-color:#bb000c}:host .danger.primary[aria-selected]:hover,:host .danger.primary.active:hover,:host .danger.primary:active:hover{opacity:.9}:host .danger.primary:focus:not(:focus-visible){box-shadow:none;outline:0}:host .danger.primary:focus,:host .danger.primary:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .danger.primary:disabled,:host .danger.primary.disabled,:host .danger.primary[aria-disabled=true]{background:var(--form-control-primary-bg-disabled)!important;color:var(--text-primary-disabled-color)!important;border-color:var(--border-primary-disabled-color)!important;cursor:not-allowed}:host .danger.primary:disabled::placeholder,:host .danger.primary.disabled::placeholder,:host .danger.primary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .danger:not(.primary){color:#bb000c;--color: rgb(187, 0, 12);border-color:transparent;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s}:host .danger:not(.primary):not(:disabled,.disabled,[aria-disabled]):hover{background-color:#d81a1a;color:#fff;--background: rgb(216, 26, 26);--color: rgb(255, 255, 255);border-color:#d81a1a}:host .danger:not(.primary)[aria-selected=true],:host .danger:not(.primary):active,:host .danger:not(.primary).active,:host .danger:not(.primary).active:hover,:host .danger:not(.primary):active:hover{background-color:#bb000c;color:#fff;--background: rgb(187, 0, 12);--color: rgb(255, 255, 255);border-color:#bb000c}:host .danger:not(.primary)[aria-selected]:hover,:host .danger:not(.primary).active:hover,:host .danger:not(.primary):active:hover{opacity:.9}:host .danger:not(.primary):focus:not(:focus-visible){box-shadow:none;outline:0}:host .danger:not(.primary):focus,:host .danger:not(.primary):focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$1.NgvExternalLinkDirective, selector: "a[routerLink]", inputs: ["external"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] }); }
430
+ }
431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvButtonComponent, decorators: [{
432
+ type: Component,
433
+ args: [{ selector: 'nggv-button', template: "<button\n #input\n [ngClass]=\"buttonClasses\"\n [id]=\"id + '-button'\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [type]=\"type\"\n [autofocus]=\"autofocus\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"description\"\n (click)=\"onClick($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n *ngIf=\"type !== 'link'\"\n>\n <ng-container *ngTemplateOutlet=\"contentRef\"></ng-container>\n</button>\n\n<a\n #input\n [ngClass]=\"buttonClasses\"\n role=\"button\"\n [id]=\"id + '-link'\"\n [routerLink]=\"href\"\n [external]=\"external\"\n [attr.aria-label]=\"description\"\n (click)=\"onClick($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n *ngIf=\"type === 'link'\"\n>\n <ng-container *ngTemplateOutlet=\"contentRef\"></ng-container>\n</a>\n\n<ng-template #contentRef>\n <ng-content></ng-content>\n</ng-template>\n", styles: [":host button,:host a{background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center}:host button:focus:not(:focus-visible),:host a:focus:not(:focus-visible){box-shadow:none;outline:0}:host button:focus,:host button:focus-visible,:host a:focus,:host a:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host button,:host a{min-width:100%}}@media screen and (-ms-high-contrast: active){:host button,:host a{border:2px solid currentcolor}}:host button.small,:host a.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host button.large,:host a.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host .primary{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:#007ac7;border-color:#007ac7;color:#fff;--color: #fff}:host .primary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host .primary[aria-selected=true],:host .primary:active,:host .primary.active,:host .primary.active:hover,:host .primary:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host .primary:focus-visible{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3!important}:host .primary:disabled,:host .primary.disabled,:host .primary[aria-disabled=true]{background:var(--form-control-primary-bg-disabled)!important;color:var(--text-primary-disabled-color)!important;border-color:var(--border-primary-disabled-color)!important;cursor:not-allowed}:host .primary:disabled::placeholder,:host .primary.disabled::placeholder,:host .primary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .secondary{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:transparent;border-color:#007ac7;color:#007ac7;--color: rgb(0, 122, 199)}:host .secondary:focus:not(:focus-visible){box-shadow:none;outline:0}:host .secondary:focus,:host .secondary:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .secondary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host .secondary[aria-selected=true],:host .secondary:active,:host .secondary.active,:host .secondary.active:hover,:host .secondary:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host .secondary:disabled,:host .secondary.disabled,:host .secondary[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .secondary:disabled::placeholder,:host .secondary.disabled::placeholder,:host .secondary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .tertiary{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:transparent;border-color:transparent;color:#007ac7;--color: rgb(0, 122, 199)}:host .tertiary:focus:not(:focus-visible){box-shadow:none;outline:0}:host .tertiary:focus,:host .tertiary:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .tertiary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host .tertiary[aria-selected=true],:host .tertiary:active,:host .tertiary.active,:host .tertiary.active:hover,:host .tertiary:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host .tertiary:disabled,:host .tertiary.disabled,:host .tertiary[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .tertiary:disabled::placeholder,:host .tertiary.disabled::placeholder,:host .tertiary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .ghost-light{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;border-color:#fff;color:#fff;--color: rgb(255, 255, 255)}:host .ghost-light:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#fff;color:#000;--background: rgb(255, 255, 255);--color: black;border-color:#fff}:host .ghost-light[aria-selected=true],:host .ghost-light:active,:host .ghost-light.active,:host .ghost-light.active:hover,:host .ghost-light:active:hover{background-color:#fff;color:#000;--background: rgb(255, 255, 255);--color: black;border-color:#fff}:host .ghost-light[aria-selected]:hover,:host .ghost-light.active:hover,:host .ghost-light:active:hover{opacity:.9}:host .ghost-light:focus-visible{background-color:#fff;color:#000;--background: rgb(255, 255, 255);--color: black;border-color:#fff!important}:host .ghost-light:disabled,:host .ghost-light.disabled,:host .ghost-light[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .ghost-light:disabled::placeholder,:host .ghost-light.disabled::placeholder,:host .ghost-light[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .ghost{transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;border-color:#333;color:#333;--color: rgb(51, 51, 51)}:host .ghost:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .ghost[aria-selected=true],:host .ghost:active,:host .ghost.active,:host .ghost.active:hover,:host .ghost:active:hover{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333}:host .ghost[aria-selected]:hover,:host .ghost.active:hover,:host .ghost:active:hover{opacity:.9}:host .ghost:focus-visible{background-color:#333;color:#fff;--background: rgb(51, 51, 51);--color: rgb(255, 255, 255);border-color:#333!important}:host .ghost:disabled,:host .ghost.disabled,:host .ghost[aria-disabled=true]{color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host .ghost:disabled::placeholder,:host .ghost.disabled::placeholder,:host .ghost[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .danger.primary{background:#bb000c;border-color:#bb000c;color:#fff;--color: #fff;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s}:host .danger.primary:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#d81a1a;color:#fff;--background: rgb(216, 26, 26);--color: rgb(255, 255, 255);border-color:#d81a1a}:host .danger.primary[aria-selected=true],:host .danger.primary:active,:host .danger.primary.active,:host .danger.primary.active:hover,:host .danger.primary:active:hover{background-color:#bb000c;color:#fff;--background: rgb(187, 0, 12);--color: rgb(255, 255, 255);border-color:#bb000c}:host .danger.primary[aria-selected]:hover,:host .danger.primary.active:hover,:host .danger.primary:active:hover{opacity:.9}:host .danger.primary:focus:not(:focus-visible){box-shadow:none;outline:0}:host .danger.primary:focus,:host .danger.primary:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host .danger.primary:disabled,:host .danger.primary.disabled,:host .danger.primary[aria-disabled=true]{background:var(--form-control-primary-bg-disabled)!important;color:var(--text-primary-disabled-color)!important;border-color:var(--border-primary-disabled-color)!important;cursor:not-allowed}:host .danger.primary:disabled::placeholder,:host .danger.primary.disabled::placeholder,:host .danger.primary[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host .danger:not(.primary){color:#bb000c;--color: rgb(187, 0, 12);border-color:transparent;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s}:host .danger:not(.primary):not(:disabled,.disabled,[aria-disabled]):hover{background-color:#d81a1a;color:#fff;--background: rgb(216, 26, 26);--color: rgb(255, 255, 255);border-color:#d81a1a}:host .danger:not(.primary)[aria-selected=true],:host .danger:not(.primary):active,:host .danger:not(.primary).active,:host .danger:not(.primary).active:hover,:host .danger:not(.primary):active:hover{background-color:#bb000c;color:#fff;--background: rgb(187, 0, 12);--color: rgb(255, 255, 255);border-color:#bb000c}:host .danger:not(.primary)[aria-selected]:hover,:host .danger:not(.primary).active:hover,:host .danger:not(.primary):active:hover{opacity:.9}:host .danger:not(.primary):focus:not(:focus-visible){box-shadow:none;outline:0}:host .danger:not(.primary):focus,:host .danger:not(.primary):focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}\n"] }]
434
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
435
+ type: Self
436
+ }, {
437
+ type: Optional
438
+ }] }, { type: undefined, decorators: [{
439
+ type: Optional
440
+ }, {
441
+ type: Inject,
442
+ args: [TRANSLOCO_SCOPE]
443
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
444
+ type: HostBinding,
445
+ args: ['attr.data-thook']
446
+ }, {
447
+ type: Input
448
+ }], type: [{
449
+ type: Input
450
+ }], buttonStyle: [{
451
+ type: Input
452
+ }], small: [{
453
+ type: Input
454
+ }], href: [{
455
+ type: Input
456
+ }], ngvClick: [{
457
+ type: Output
458
+ }] } });
459
+
460
+ class NgvButtonModule {
461
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
462
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvButtonModule, declarations: [NgvButtonComponent], imports: [CommonModule, NgvExternalLinkDirectiveModule, RouterModule], exports: [NgvButtonComponent] }); }
463
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvButtonModule, imports: [CommonModule, NgvExternalLinkDirectiveModule, RouterModule] }); }
464
+ }
465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvButtonModule, decorators: [{
466
+ type: NgModule,
467
+ args: [{
468
+ declarations: [NgvButtonComponent],
469
+ imports: [CommonModule, NgvExternalLinkDirectiveModule, RouterModule],
470
+ exports: [NgvButtonComponent],
471
+ }]
472
+ }] });
473
+
474
+ class NgvCardComponent {
475
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
476
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvCardComponent, selector: "nggv-card", ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, styles: [":host{background-clip:border-box;background:var(--sg-card-background);border:var(--sg-card-border);border-radius:var(--sg-card-border-radius);box-shadow:var(--sg-card-box-shadow);color:var(--sg-card-color);display:flex;flex-direction:column;padding:1rem}:host>header{align-items:center;display:flex;justify-content:space-between;margin-bottom:1rem;margin-block-end:1rem}:host>header .close{margin:-.5rem -.5rem -.5rem .5rem}:host>*:not(header,footer){flex:1 1 auto}:host>footer{margin-top:.75rem}@media (min-width: 36em){:host>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host>footer button:not(.link)+button,:host>footer button:not(.link)+.button,:host>footer .button:not(.link)+button,:host>footer .button:not(.link)+.button{margin-top:.75rem}}@media (min-width: 36em){:host>footer button:not(.link)+button,:host>footer button:not(.link)+.button,:host>footer .button:not(.link)+button,:host>footer .button:not(.link)+.button{margin-left:.75rem}}:host:has(.card-row){display:table;width:inherit;box-sizing:border-box}:host ::ng-deep .card-row{display:table-row}:host ::ng-deep .card-row *{padding-bottom:.5rem}:host ::ng-deep .card-row:last-child *{padding-bottom:0}:host ::ng-deep .card-row.divider *{border-top:1px solid #d8d8d8;padding-top:.375rem}:host ::ng-deep .card-column{display:table-cell;text-align:start}:host ::ng-deep .card-column:first-child{text-align:start}:host ::ng-deep .card-column:not(:first-child):not(:last-child){text-align:center}:host ::ng-deep .card-column:last-child{text-align:end}\n"] }); }
477
+ }
478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCardComponent, decorators: [{
479
+ type: Component,
480
+ args: [{ selector: 'nggv-card', template: ` <ng-content></ng-content> `, styles: [":host{background-clip:border-box;background:var(--sg-card-background);border:var(--sg-card-border);border-radius:var(--sg-card-border-radius);box-shadow:var(--sg-card-box-shadow);color:var(--sg-card-color);display:flex;flex-direction:column;padding:1rem}:host>header{align-items:center;display:flex;justify-content:space-between;margin-bottom:1rem;margin-block-end:1rem}:host>header .close{margin:-.5rem -.5rem -.5rem .5rem}:host>*:not(header,footer){flex:1 1 auto}:host>footer{margin-top:.75rem}@media (min-width: 36em){:host>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host>footer button:not(.link)+button,:host>footer button:not(.link)+.button,:host>footer .button:not(.link)+button,:host>footer .button:not(.link)+.button{margin-top:.75rem}}@media (min-width: 36em){:host>footer button:not(.link)+button,:host>footer button:not(.link)+.button,:host>footer .button:not(.link)+button,:host>footer .button:not(.link)+.button{margin-left:.75rem}}:host:has(.card-row){display:table;width:inherit;box-sizing:border-box}:host ::ng-deep .card-row{display:table-row}:host ::ng-deep .card-row *{padding-bottom:.5rem}:host ::ng-deep .card-row:last-child *{padding-bottom:0}:host ::ng-deep .card-row.divider *{border-top:1px solid #d8d8d8;padding-top:.375rem}:host ::ng-deep .card-column{display:table-cell;text-align:start}:host ::ng-deep .card-column:first-child{text-align:start}:host ::ng-deep .card-column:not(:first-child):not(:last-child){text-align:center}:host ::ng-deep .card-column:last-child{text-align:end}\n"] }]
481
+ }] });
482
+
483
+ class NgvCardModule {
484
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
485
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvCardModule, declarations: [NgvCardComponent], imports: [CommonModule], exports: [NgvCardComponent] }); }
486
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCardModule, imports: [CommonModule] }); }
487
+ }
488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCardModule, decorators: [{
489
+ type: NgModule,
490
+ args: [{
491
+ declarations: [NgvCardComponent],
492
+ imports: [CommonModule],
493
+ exports: [NgvCardComponent],
494
+ }]
495
+ }] });
496
+
497
+ /**
498
+ * Checkboxes allow a user to toggle an option on or off, or make multiple choices in a set of available options.
499
+ * https://designlibrary.sebgroup.com/components/component-checkbox
500
+ */
501
+ class NgvCheckboxComponent extends NgvBaseControlValueAccessorComponent$1 {
502
+ constructor(ngControl, translocoScope, cdr) {
503
+ super(ngControl, translocoScope, cdr);
504
+ this.ngControl = ngControl;
505
+ this.translocoScope = translocoScope;
506
+ this.cdr = cdr;
507
+ /** Special property used for selecting DOM elements during automated UI testing. */
508
+ this.thook = 'checkbox';
509
+ this.optionalLabel = 'Optional';
510
+ this.valueChange = new EventEmitter();
511
+ }
512
+ /** @internal */
513
+ onInputChange(event) {
514
+ event.stopPropagation();
515
+ if (this.disabled)
516
+ return;
517
+ this.state = !this.state;
518
+ this.onTouched();
519
+ this.onChange(this.state);
520
+ }
521
+ /** Writes a new value of true or false based on if argument matches this components value property. */
522
+ writeValue(value) {
523
+ // Phantom null value on first load https://github.com/angular/angular/pull/38140
524
+ super.writeValue(value === this.value);
525
+ }
526
+ /** Registers a callback function that is called when the child input element's value changes. */
527
+ registerOnChange(fn) {
528
+ // Override default to update registry
529
+ this.onChange = (checked) => {
530
+ const output = checked ? this.value : null;
531
+ fn(output);
532
+ this.valueChange.emit(output);
533
+ };
534
+ }
535
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
536
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvCheckboxComponent, selector: "nggv-checkbox", inputs: { thook: "thook", optionalLabel: "optionalLabel" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.data-thook": "this.thook" } }, usesInheritance: true, ngImport: i0, template: "<!-- LOCKED INPUT -->\n<div *ngIf=\"locked && state\" class=\"sdv-field-checkbox-wrap\">\n <div\n [id]=\"id + '-checkbox'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n >\n <ng-container *ngIf=\"!labelContentTpl\">\n {{ label }}\n </ng-container>\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl ?? null; context: { $implicit: value }\"\n ></ng-template>\n </div>\n</div>\n\n<!-- INPUT WRAPPER -->\n<ng-container *ngIf=\"!locked\">\n <div class=\"sdv-field-checkbox-wrap\">\n <!-- CHECKBOX FIELD -->\n <label\n [id]=\"id + '-label'\"\n [attr.for]=\"id + '-checkbox'\"\n class=\"form-control\"\n *transloco=\"let t; read: scope\"\n >\n <input\n #input\n type=\"checkbox\"\n [id]=\"id + '-checkbox'\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [autofocus]=\"autofocus\"\n [attr.aria-label]=\"description\"\n [checked]=\"state\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onInputChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- LABEL -->\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n <span\n *ngIf=\"\n optional === true || (required !== true && optional !== false)\n \"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n <span>{{ label }}</span>\n </ng-container>\n </ng-template>\n <i></i>\n </label>\n </div>\n\n <!-- ERRORS -->\n <ng-container *transloco=\"let t; read: scope\">\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-checkbox'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n </ng-container>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{--gds-comp-checkbox-container-height: 1rem;--gds-comp-checkbox-container-width: 1rem;--gds-comp-checkbox-container-color: var(--gds-sys-color-surface);--gds-comp-checkbox-container-color-disabled: var(--gds-ref-pallet-base200);--gds-comp-checkbox-border-color: var(--gds-sys-color-base);--gds-comp-checkbox-border-radius: var(--gds-sys-shape-corner-small);--gds-comp-checkbox-hover-border-color: var(--gds-ref-pallet-base600);--gds-comp-checkbox-container-color-selected: var(--gds-sys-color-base);--gds-comp-checkbox-border-color-selected: var(--gds-sys-color-surface);--gds-comp-checkbox-border-color-focus: var(--gds-sys-color-blue-dark-2)}:host label.form-control input[type=checkbox]{cursor:pointer;height:0;opacity:0;position:absolute;width:0;z-index:-1}:host label.form-control{align-items:flex-start}:host label.form-control:has(input[type=checkbox]){padding:.6875rem 1rem .5625rem}:host label.form-control:has(input[type=checkbox]:focus-visible):focus:not(:focus-visible){box-shadow:none;outline:0}:host label.form-control:has(input[type=checkbox]:focus-visible):focus,:host label.form-control:has(input[type=checkbox]:focus-visible):focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host label.form-control input[type=checkbox]~i{margin-right:.75rem;margin-top:.0625rem;flex-shrink:0;box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-border-color);position:relative;border-radius:var(--gds-comp-checkbox-border-radius);background-color:var(--gds-comp-checkbox-container-color);flex:0 0 auto;height:var(--gds-comp-checkbox-container-width, 1rem);width:var(--gds-comp-checkbox-container-width, 1rem);transition:color .3s ease-in-out,all .3s ease-in-out}:host label.form-control input[type=checkbox]~i:after{transition:color .3s ease-in-out,all .3s ease-in-out}:host label.form-control input[type=checkbox]:not(:checked):focus-visible~i{box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-border-color-focus)}:host label.form-control:hover input[type=checkbox]:not(.disabled,:disabled,:checked,:indeterminate)~i{border-color:var(--gds-comp-checkbox-hover-border-color);box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-hover-border-color)}:host label.form-control:hover input[type=checkbox]:not(:checked,:indeterminate,:disabled,.disabled)~i:after{border-color:var(--gds-comp-checkbox-hover-border-color);opacity:1}:host label.form-control input[type=checkbox]:checked~i{background-color:var(--gds-comp-checkbox-container-color-selected)}:host label.form-control:hover input[type=checkbox]:checked~i{background-color:var(--gds-comp-checkbox-hover-border-color);box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-hover-border-color)}:host label.form-control input[type=checkbox]:indeterminate~i{background-color:var(--gds-comp-checkbox-container-color-selected)}:host label.form-control input[type=checkbox]:indeterminate~i:after{border-bottom:2px solid var(--gds-comp-checkbox-border-color-selected, #fff);border-left:none;transform:scale(1) rotate(0);opacity:1}:host label.form-control:has(input[type=checkbox].is-invalid){border:.0625rem solid var(--intent-danger-background);margin-bottom:.5rem}:host .is-invalid label.form-control:has(input[type=checkbox].is-invalid){border:none;margin:0}@supports (-moz-appearance: none){:host label.form-control.is-invalid{border:.0625rem solid var(--intent-danger-background);margin-bottom:.5rem}:host .is-invalid label.form-control.is-invalid{border:none;margin:0}}:host label.form-control input[type=checkbox]:disabled~i,:host label.form-control input[type=checkbox].disabled~i{background:var(--sg-form-control-bg-disabled)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed;box-shadow:inset 0 0 0 1px var(--border-disabled-color)}:host label.form-control input[type=checkbox]:disabled~i::placeholder,:host label.form-control input[type=checkbox].disabled~i::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=checkbox]:disabled:checked~i,:host label.form-control input[type=checkbox].disabled:checked~i{background:var(--sg-form-control-bg-disabled)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed;box-shadow:inset 0 0 0 1px var(--border-disabled-color)}:host label.form-control input[type=checkbox]:disabled:checked~i::placeholder,:host label.form-control input[type=checkbox].disabled:checked~i::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=checkbox]:disabled:checked~i:after,:host label.form-control input[type=checkbox].disabled:checked~i:after{border-color:var(--border-disabled-color)}:host label.form-control input[type=checkbox]:disabled~span,:host label.form-control input[type=checkbox].disabled~span{color:var(--text-disabled-color)!important;cursor:not-allowed}:host label.form-control input[type=checkbox]:disabled~span::placeholder,:host label.form-control input[type=checkbox].disabled~span::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=checkbox]~i:after{content:\"\";opacity:0;position:absolute}:host label.form-control input[type=checkbox]~i:after{border-bottom:3px solid var(--gds-comp-checkbox-border-color-selected, #fff);border-left:3px solid var(--gds-comp-checkbox-border-color-selected, #fff);height:.5rem;width:1rem;left:0;top:.1875rem;transform:scale(.601) rotate(-45deg);transform-origin:center}:host label.form-control input[type=checkbox]:checked~i:after{opacity:1}:host .form-control{padding:.75rem 1rem;border:1px solid transparent;border-radius:var(--gds-sys-shape-corner-medium);align-items:center;cursor:pointer;display:flex;flex-direction:row-reverse;font:inherit;justify-content:flex-end;position:relative;user-select:none;-webkit-user-select:none}:host .form-control:has(input:disabled){cursor:not-allowed}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }] }); }
537
+ }
538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxComponent, decorators: [{
539
+ type: Component,
540
+ args: [{ selector: 'nggv-checkbox', template: "<!-- LOCKED INPUT -->\n<div *ngIf=\"locked && state\" class=\"sdv-field-checkbox-wrap\">\n <div\n [id]=\"id + '-checkbox'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n >\n <ng-container *ngIf=\"!labelContentTpl\">\n {{ label }}\n </ng-container>\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl ?? null; context: { $implicit: value }\"\n ></ng-template>\n </div>\n</div>\n\n<!-- INPUT WRAPPER -->\n<ng-container *ngIf=\"!locked\">\n <div class=\"sdv-field-checkbox-wrap\">\n <!-- CHECKBOX FIELD -->\n <label\n [id]=\"id + '-label'\"\n [attr.for]=\"id + '-checkbox'\"\n class=\"form-control\"\n *transloco=\"let t; read: scope\"\n >\n <input\n #input\n type=\"checkbox\"\n [id]=\"id + '-checkbox'\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [autofocus]=\"autofocus\"\n [attr.aria-label]=\"description\"\n [checked]=\"state\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onInputChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- LABEL -->\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n <span\n *ngIf=\"\n optional === true || (required !== true && optional !== false)\n \"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n <span>{{ label }}</span>\n </ng-container>\n </ng-template>\n <i></i>\n </label>\n </div>\n\n <!-- ERRORS -->\n <ng-container *transloco=\"let t; read: scope\">\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-checkbox'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n </ng-container>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{--gds-comp-checkbox-container-height: 1rem;--gds-comp-checkbox-container-width: 1rem;--gds-comp-checkbox-container-color: var(--gds-sys-color-surface);--gds-comp-checkbox-container-color-disabled: var(--gds-ref-pallet-base200);--gds-comp-checkbox-border-color: var(--gds-sys-color-base);--gds-comp-checkbox-border-radius: var(--gds-sys-shape-corner-small);--gds-comp-checkbox-hover-border-color: var(--gds-ref-pallet-base600);--gds-comp-checkbox-container-color-selected: var(--gds-sys-color-base);--gds-comp-checkbox-border-color-selected: var(--gds-sys-color-surface);--gds-comp-checkbox-border-color-focus: var(--gds-sys-color-blue-dark-2)}:host label.form-control input[type=checkbox]{cursor:pointer;height:0;opacity:0;position:absolute;width:0;z-index:-1}:host label.form-control{align-items:flex-start}:host label.form-control:has(input[type=checkbox]){padding:.6875rem 1rem .5625rem}:host label.form-control:has(input[type=checkbox]:focus-visible):focus:not(:focus-visible){box-shadow:none;outline:0}:host label.form-control:has(input[type=checkbox]:focus-visible):focus,:host label.form-control:has(input[type=checkbox]:focus-visible):focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host label.form-control input[type=checkbox]~i{margin-right:.75rem;margin-top:.0625rem;flex-shrink:0;box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-border-color);position:relative;border-radius:var(--gds-comp-checkbox-border-radius);background-color:var(--gds-comp-checkbox-container-color);flex:0 0 auto;height:var(--gds-comp-checkbox-container-width, 1rem);width:var(--gds-comp-checkbox-container-width, 1rem);transition:color .3s ease-in-out,all .3s ease-in-out}:host label.form-control input[type=checkbox]~i:after{transition:color .3s ease-in-out,all .3s ease-in-out}:host label.form-control input[type=checkbox]:not(:checked):focus-visible~i{box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-border-color-focus)}:host label.form-control:hover input[type=checkbox]:not(.disabled,:disabled,:checked,:indeterminate)~i{border-color:var(--gds-comp-checkbox-hover-border-color);box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-hover-border-color)}:host label.form-control:hover input[type=checkbox]:not(:checked,:indeterminate,:disabled,.disabled)~i:after{border-color:var(--gds-comp-checkbox-hover-border-color);opacity:1}:host label.form-control input[type=checkbox]:checked~i{background-color:var(--gds-comp-checkbox-container-color-selected)}:host label.form-control:hover input[type=checkbox]:checked~i{background-color:var(--gds-comp-checkbox-hover-border-color);box-shadow:inset 0 0 0 1px var(--gds-comp-checkbox-hover-border-color)}:host label.form-control input[type=checkbox]:indeterminate~i{background-color:var(--gds-comp-checkbox-container-color-selected)}:host label.form-control input[type=checkbox]:indeterminate~i:after{border-bottom:2px solid var(--gds-comp-checkbox-border-color-selected, #fff);border-left:none;transform:scale(1) rotate(0);opacity:1}:host label.form-control:has(input[type=checkbox].is-invalid){border:.0625rem solid var(--intent-danger-background);margin-bottom:.5rem}:host .is-invalid label.form-control:has(input[type=checkbox].is-invalid){border:none;margin:0}@supports (-moz-appearance: none){:host label.form-control.is-invalid{border:.0625rem solid var(--intent-danger-background);margin-bottom:.5rem}:host .is-invalid label.form-control.is-invalid{border:none;margin:0}}:host label.form-control input[type=checkbox]:disabled~i,:host label.form-control input[type=checkbox].disabled~i{background:var(--sg-form-control-bg-disabled)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed;box-shadow:inset 0 0 0 1px var(--border-disabled-color)}:host label.form-control input[type=checkbox]:disabled~i::placeholder,:host label.form-control input[type=checkbox].disabled~i::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=checkbox]:disabled:checked~i,:host label.form-control input[type=checkbox].disabled:checked~i{background:var(--sg-form-control-bg-disabled)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed;box-shadow:inset 0 0 0 1px var(--border-disabled-color)}:host label.form-control input[type=checkbox]:disabled:checked~i::placeholder,:host label.form-control input[type=checkbox].disabled:checked~i::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=checkbox]:disabled:checked~i:after,:host label.form-control input[type=checkbox].disabled:checked~i:after{border-color:var(--border-disabled-color)}:host label.form-control input[type=checkbox]:disabled~span,:host label.form-control input[type=checkbox].disabled~span{color:var(--text-disabled-color)!important;cursor:not-allowed}:host label.form-control input[type=checkbox]:disabled~span::placeholder,:host label.form-control input[type=checkbox].disabled~span::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=checkbox]~i:after{content:\"\";opacity:0;position:absolute}:host label.form-control input[type=checkbox]~i:after{border-bottom:3px solid var(--gds-comp-checkbox-border-color-selected, #fff);border-left:3px solid var(--gds-comp-checkbox-border-color-selected, #fff);height:.5rem;width:1rem;left:0;top:.1875rem;transform:scale(.601) rotate(-45deg);transform-origin:center}:host label.form-control input[type=checkbox]:checked~i:after{opacity:1}:host .form-control{padding:.75rem 1rem;border:1px solid transparent;border-radius:var(--gds-sys-shape-corner-medium);align-items:center;cursor:pointer;display:flex;flex-direction:row-reverse;font:inherit;justify-content:flex-end;position:relative;user-select:none;-webkit-user-select:none}:host .form-control:has(input:disabled){cursor:not-allowed}\n"] }]
541
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
542
+ type: Self
543
+ }, {
544
+ type: Optional
545
+ }] }, { type: undefined, decorators: [{
546
+ type: Optional
547
+ }, {
548
+ type: Inject,
549
+ args: [TRANSLOCO_SCOPE]
550
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
551
+ type: HostBinding,
552
+ args: ['attr.data-thook']
553
+ }, {
554
+ type: Input
555
+ }], optionalLabel: [{
556
+ type: Input
557
+ }], valueChange: [{
558
+ type: Output
559
+ }] } });
560
+
561
+ class NgvCheckboxModule {
562
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
563
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, declarations: [NgvCheckboxComponent], imports: [CommonModule, NgvI18nModule$1], exports: [NgvCheckboxComponent] }); }
564
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, imports: [CommonModule, NgvI18nModule$1] }); }
565
+ }
566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, decorators: [{
567
+ type: NgModule,
568
+ args: [{
569
+ declarations: [NgvCheckboxComponent],
570
+ imports: [CommonModule, NgvI18nModule$1],
571
+ exports: [NgvCheckboxComponent],
572
+ }]
573
+ }] });
574
+
575
+ class NgvTypeaheadHighlightComponent {
576
+ constructor() {
577
+ this.text = '';
578
+ this.input = '';
579
+ /**
580
+ * Regexp of characters that are allowed in textContent without being found in textToHighlight
581
+ * Allow whitespaces.
582
+ * */
583
+ this.allowedNonMatchingChars = new RegExp(/\s/);
584
+ }
585
+ ngOnChanges(changes) {
586
+ const { textContent, textToHighlight } = changes;
587
+ if (textContent?.currentValue != null)
588
+ this.text = `${textContent.currentValue}`;
589
+ if (textToHighlight?.currentValue != null)
590
+ this.input = `${textToHighlight.currentValue}`;
591
+ this.updateValues();
592
+ }
593
+ updateValues() {
594
+ const splittedText = this.text.toLocaleLowerCase().split('');
595
+ const splittedInput = this.input.toLocaleLowerCase().split('');
596
+ const { start, end } = this.getHighlightedPart(splittedText, splittedInput);
597
+ // If user input is not found within the textcontent, reset options and return.
598
+ if (start === -1 || end === -1) {
599
+ this.prefix = this.match = this.suffix = '';
600
+ return;
601
+ }
602
+ this.prefix = this.text.substring(0, start);
603
+ this.match = this.text.substring(start, end);
604
+ this.suffix = this.text.substring(end);
605
+ }
606
+ /**
607
+ * Function that finds the start and end index of where the input is located within the text to display.
608
+ * First occurence is returned. Allows for spaces to occur despite input not matching space.
609
+ * Loops through each character in splittedText and when a char in splittedText equlas the first character of
610
+ * splittedInput, evaluate wether it's match on the entire input.
611
+ * - If it's => return indexes.
612
+ * - If it's not => break out and check next char in outer loop.
613
+ * @param splittedText the text content splitted in an array
614
+ * @param splittedInput the input splitted in an array
615
+ * @returns { start: number, end: number } Indexes of where the match starts and ends in the text displatyed
616
+ */
617
+ getHighlightedPart(splittedText, splittedInput) {
618
+ let start = -1;
619
+ let end = -1;
620
+ for (let i = 0; i < splittedText.length; i++) {
621
+ // If start and end have been set, break and return
622
+ if (start > -1 || end > -1)
623
+ break;
624
+ // If current char match first in input, try see if whole input match from that index
625
+ if (splittedText[i] === splittedInput[0]) {
626
+ let matches = 1;
627
+ for (let t = 1; t <= splittedText.length; t++) {
628
+ // If match on last character of input, we're finished.
629
+ if (matches === splittedInput.length) {
630
+ start = i;
631
+ end = start + t;
632
+ break;
633
+ }
634
+ if (splittedText[t + i] === splittedInput[matches])
635
+ matches++;
636
+ else if (this.allowedNonMatchingChars.test(splittedText[t + i]))
637
+ continue; // Ignore whitespace, continue
638
+ else
639
+ break; // No match, break out of inner loop to check next char in text
640
+ }
641
+ }
642
+ }
643
+ return { start, end };
644
+ }
645
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
646
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvTypeaheadHighlightComponent, selector: "nggv-typeahead-highlight", inputs: { textContent: "textContent", textToHighlight: "textToHighlight" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!this.match\">{{ textContent }}</ng-container>\n<!-- Note that this is sensitive to line breaks producing extra spacing between the different parts -->\n<ng-container *ngIf=\"!!this.match\">\n {{ prefix || '' }}<span class=\"match\">{{ match }}</span>{{ suffix ||''}}\n</ng-container>", styles: [":host .match{font-weight:500}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
647
+ }
648
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadHighlightComponent, decorators: [{
649
+ type: Component,
650
+ args: [{ selector: 'nggv-typeahead-highlight', template: "<ng-container *ngIf=\"!this.match\">{{ textContent }}</ng-container>\n<!-- Note that this is sensitive to line breaks producing extra spacing between the different parts -->\n<ng-container *ngIf=\"!!this.match\">\n {{ prefix || '' }}<span class=\"match\">{{ match }}</span>{{ suffix ||''}}\n</ng-container>", styles: [":host .match{font-weight:500}\n"] }]
651
+ }], propDecorators: { textContent: [{
652
+ type: Input
653
+ }], textToHighlight: [{
654
+ type: Input
655
+ }] } });
656
+
657
+ class NgvDropdownListComponent {
658
+ set expanded(state) {
659
+ this.setExpanded(state);
660
+ }
661
+ get expanded() {
662
+ return this._expanded;
663
+ }
664
+ constructor(translocoScope) {
665
+ this.translocoScope = translocoScope;
666
+ /** The additional amount to show when option is scrolled into view. */
667
+ this.scrollOffset = 24;
668
+ /** Id of the host element and is accessible by the children, automatically generated if not provided. */
669
+ this.id = window.ngv?.nextId();
670
+ /** Special property used for selecting DOM elements during automated UI testing. */
671
+ this.thook = 'dropdown';
672
+ this.selectedValueChanged = new EventEmitter();
673
+ this.closed = new EventEmitter();
674
+ /** The current active option based on numeric index. */
675
+ this.activeIndex = -1;
676
+ this.dropdownUtils = new DropdownUtils();
677
+ this._expanded = false;
678
+ this.closed$ = new Subject();
679
+ if (this.translocoScope)
680
+ this.scope = this.translocoScope.toString();
681
+ }
682
+ ngOnInit() {
683
+ if (this.state)
684
+ this.activeIndex = this.options.findIndex((option) => option.key === this.state.key);
685
+ }
686
+ ngOnChanges(changes) {
687
+ if (!!changes.state && !changes.state.firstChange)
688
+ this.selectedValue = changes.state.currentValue;
689
+ if (!!changes.options?.currentValue?.length && this.expanded)
690
+ this.refreshSelectedOption();
691
+ }
692
+ /**
693
+ * Returns true if argument is an {@link OptionGroup}.
694
+ * @param option the object to check.
695
+ */
696
+ isGroup(option) {
697
+ return 'options' in option;
698
+ }
699
+ /** @internal */
700
+ updateState(option, event) {
701
+ if (option.disabled)
702
+ return;
703
+ this.selectedValue = option;
704
+ this.state = option;
705
+ this.selectedValueChanged.emit(option);
706
+ this.setExpanded(false);
707
+ event.stopPropagation();
708
+ }
709
+ /**
710
+ * @internal
711
+ */
712
+ setExpanded(expanded = true) {
713
+ // update expanded state
714
+ this._expanded = expanded;
715
+ if (expanded)
716
+ this.refreshSelectedOption();
717
+ else {
718
+ this.closed$.next(true);
719
+ this.onClickSubscription?.unsubscribe();
720
+ }
721
+ }
722
+ /**
723
+ * @internal
724
+ */
725
+ refreshSelectedOption() {
726
+ const options = this.dropdownUtils.flattenOptions(this.options, !this.optionContentTpl);
727
+ this.activeIndex = this.getActiveIndex();
728
+ this.state = options[this.activeIndex];
729
+ this.scrollToResult(this.state);
730
+ }
731
+ /**
732
+ * @internal
733
+ * @returns The active index (number) if option is found, -1 otherwise.
734
+ * - If a selectedValue exists that's not nullish and that options is found, return that index
735
+ * - Else, return first non nullish index
736
+ * - If none of the above criterias are met, -1 are returned
737
+ */
738
+ getActiveIndex() {
739
+ if (!!this.selectedValue && this.selectedValue?.key != null) {
740
+ const selectedIndex = this.dropdownUtils
741
+ .flattenOptions(this.options, !this.optionContentTpl)
742
+ .findIndex((option) => option.key != null && option.key === this.selectedValue?.key);
743
+ if (selectedIndex > -1)
744
+ return selectedIndex;
745
+ }
746
+ return this.dropdownUtils
747
+ .flattenOptions(this.options, !this.optionContentTpl)
748
+ .findIndex((option) => option.key != null);
749
+ }
750
+ /**
751
+ * @internal
752
+ * evaluates wether the HTML element overflows
753
+ * @param elem The HTMLElement to evaluate
754
+ * */
755
+ isOverflow(elem) {
756
+ return elem.offsetWidth < elem.scrollWidth;
757
+ }
758
+ /**
759
+ * Typecast anything to an {@link OptionGroup}.
760
+ * @param group the object to typecast.
761
+ */
762
+ castGroup(group) {
763
+ return group;
764
+ }
765
+ /**
766
+ * @internal
767
+ * Disables default events.
768
+ * @param event fired containing which key was pressed.
769
+ */
770
+ onKeyDown(event) {
771
+ switch (event.key) {
772
+ case 'Enter': // Disable form submission
773
+ case 'ArrowUp': // Disable scrolling up
774
+ case 'ArrowDown': // Disable scrolling down
775
+ event.preventDefault();
776
+ event.stopPropagation();
777
+ return false;
778
+ }
779
+ return true;
780
+ }
781
+ /**
782
+ * @internal
783
+ * Enter toggles the dropdown, home, end, and, arrows change the index.
784
+ * @param event fired containing which key was released.
785
+ */
786
+ onKeyUp(event) {
787
+ if (!this.expanded)
788
+ return;
789
+ const options = this.dropdownUtils.flattenOptions(this.options, !this.optionContentTpl);
790
+ let option;
791
+ switch (event.key) {
792
+ case 'Escape':
793
+ this.setExpanded(false);
794
+ this.closed.emit();
795
+ break;
796
+ case 'Enter': // Select the currently chosen value
797
+ option = options[this.activeIndex];
798
+ this.updateState(option, event);
799
+ break;
800
+ case 'Home': // Move to the first option
801
+ this.activeIndex = 0;
802
+ option = options[this.activeIndex];
803
+ this.state = option;
804
+ this.scrollToResult(option);
805
+ break;
806
+ case 'ArrowUp': // Move up one step to the previous option
807
+ if (this.activeIndex > 0)
808
+ this.activeIndex--;
809
+ else if (this.activeIndex === 0)
810
+ this.activeIndex = options.length - 1;
811
+ option = options[this.activeIndex];
812
+ this.state = option;
813
+ this.scrollToResult(option);
814
+ break;
815
+ case 'ArrowDown': // Move down one step to the next option
816
+ if (options.length > this.activeIndex + 1)
817
+ this.activeIndex++;
818
+ else if (this.activeIndex === options.length - 1)
819
+ this.activeIndex = 0;
820
+ option = options[this.activeIndex];
821
+ this.state = option;
822
+ this.scrollToResult(option);
823
+ break;
824
+ case 'End': // Move to the last options
825
+ this.activeIndex = options.length - 1;
826
+ option = options[this.activeIndex];
827
+ this.state = option;
828
+ this.scrollToResult(option);
829
+ break;
830
+ }
831
+ }
832
+ /**
833
+ * Scrolls focused result into view with a specified offset.
834
+ * @param key the result index which to scroll to.
835
+ */
836
+ scrollToResult(option) {
837
+ if (!this.optionRefs || !option)
838
+ return;
839
+ const optionRef = this.optionRefs.find((li) => li.nativeElement.id === this.id + '-option-' + option.key);
840
+ const offset = this.scrollOffset;
841
+ if (optionRef) {
842
+ let delta = window.scrollY || document.documentElement.scrollTop;
843
+ // The list seems not to be visible at the time of scrolling, but this setTimeout "hack" makes it work...
844
+ setTimeout(() => {
845
+ scrollIntoView(optionRef.nativeElement, {
846
+ scrollMode: 'if-needed',
847
+ block: 'nearest',
848
+ });
849
+ delta -= window.scrollY || document.documentElement.scrollTop;
850
+ if (delta)
851
+ window.scrollBy(0, delta > 0 ? -offset : offset);
852
+ }, 0);
853
+ }
854
+ }
855
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownListComponent, deps: [{ token: TRANSLOCO_SCOPE, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
856
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvDropdownListComponent, selector: "nggv-dropdown-list", inputs: { expanded: "expanded", state: "state", scrollOffset: "scrollOffset", optionContentTpl: "optionContentTpl", id: "id", thook: "thook", options: "options", textToHighlight: "textToHighlight" }, outputs: { selectedValueChanged: "selectedValueChanged", closed: "closed" }, host: { listeners: { "document:keydown": "onKeyDown($event)", "document:keyup": "onKeyUp($event)" }, properties: { "attr.id": "this.id", "attr.data-thook": "this.thook" } }, viewQueries: [{ propertyName: "optionRefs", predicate: ["optionRefs"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *transloco=\"let t; read: scope\">\n <ul\n class=\"gds-dropdown__options card options gds-reset\"\n [class.gds-dropdown__options-expanded]=\"expanded\"\n role=\"listbox\"\n tabindex=\"-1\"\n [attr.data-thook]=\"thook + '-options'\"\n [attr.aria-labelledby]=\"id + '-label'\"\n [attr.aria-activedescendant]=\"\n state ? id + '-option-' + state?.key : undefined\n \"\n >\n <ng-container *ngFor=\"let item of options\">\n <!-- OPTION -->\n <ng-container *ngIf=\"!isGroup(item)\">\n <ng-template\n *ngTemplateOutlet=\"listItemTemplate; context: { $implicit: item }\"\n ></ng-template>\n </ng-container>\n\n <!-- OPTION GROUP -->\n <li\n class=\"gds-dropdown__options__label group\"\n [attr.data-thook]=\"thook + '-option-group'\"\n *ngIf=\"isGroup(item)\"\n >\n <div class=\"sdv-list__label\">{{ t(item.label) }}</div>\n <ul [attr.aria-disabled]=\"item.disabled\">\n <ng-container *ngFor=\"let option of castGroup(item).options\">\n <ng-template\n *ngTemplateOutlet=\"\n listItemTemplate;\n context: { $implicit: option }\n \"\n ></ng-template>\n </ng-container>\n </ul>\n </li>\n </ng-container>\n </ul>\n\n <!-- TEMPLATE -->\n <ng-template #listItemTemplate let-option>\n <li\n #optionRefs\n *ngIf=\"!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n [ngvTooltip]=\"isOverflow(liElem) ? t(option.label) : undefined\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"\n basicOptionContentTpl;\n context: { $implicit: option }\n \"\n >\n </ng-template>\n </li>\n <!-- Checking overflow on custom templates do not work skip adding ngvToolTip if custom template is provided -->\n <li\n #optionRefs\n *ngIf=\"!!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"optionContentTpl; context: { $implicit: option }\"\n >\n </ng-template>\n </li>\n </ng-template>\n\n <ng-template #basicOptionContentTpl let-option>\n <nggv-typeahead-highlight\n *ngIf=\"!!textToHighlight\"\n [textToHighlight]=\"textToHighlight\"\n [textContent]=\"t(option.label)\"\n >\n </nggv-typeahead-highlight>\n <ng-container *ngIf=\"!textToHighlight\">\n {{ t(option.label) }}\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{position:absolute;bottom:0;transform:translateY(calc(100% + .5rem));--z-index: var(--sg-z-index-dropdown)}:host .hidden{visibility:hidden;display:none}:host ul[role=menu] [role=menuitem]{padding:.75rem;cursor:pointer}:host ul[role=menu] [role=menuitem]:hover,:host ul[role=menu] [role=menuitem]:focus-visible{background-color:var(--gds-ref-pallet-base200)}:host ul[role=menu] [role=menuitem]:active{background-color:var(--gds-ref-pallet-base300)}:host ul[role=menu] [role=menuitem]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox]{--z-index: var(--sg-z-index-popover);background-color:var(--sg-popover-background);flex-direction:column;justify-content:flex-end;inset:auto;z-index:var(--z-index);box-shadow:var(--sg-popover-box-shadow);color:var(--text-primary-color);padding:0;border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--text-primary-color);--sg-border-color: var(--text-primary-color);border-radius:var(--sg-border-radius)}:host ul[role=listbox] [role=option]{padding:.75rem 1rem;line-height:1.25;cursor:pointer}:host ul[role=listbox] [role=option]:hover,:host ul[role=listbox] [role=option]:focus-visible{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:active{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox] [role=option].active.sg-highlighted,:host ul[role=listbox] [role=option][aria-selected=true]{background:var(--grey-1000);color:#fff}:host .sg-fieldset-container{overflow-y:auto}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option]{display:flex;width:100%}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option].active.sg-highlighted input[type=checkbox]~i{border-color:#007ac7!important;box-shadow:0 0 .25em .0625em #41b0ee;outline-color:transparent;outline-style:solid}:host .gds-dropdown__options{padding-left:0;margin-bottom:0;margin-top:0;display:flex;flex-direction:column;list-style:none;display:none}:host .gds-dropdown__options>li{padding-bottom:.5rem;padding-top:.5rem;border:0;display:block;position:relative}:host .gds-dropdown__options>li:before{font-weight:500;display:inline-block;left:0;position:absolute;text-align:center}:host .gds-dropdown__options-expanded{display:block}:host .gds-dropdown__options__label:hover,:host .gds-dropdown__options__label:focus-visible{background-color:var(--grey-400)}:host .gds-dropdown__options__label:active{background-color:var(--grey-500)}:host .gds-dropdown__options__label:focus-visible{outline-color:#000;outline-offset:-.25rem}:host .gds-dropdown__options__label[aria-hidden=true]{display:none}:host .gds-dropdown__options__label[highlighted]{color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgvTypeaheadHighlightComponent, selector: "nggv-typeahead-highlight", inputs: ["textContent", "textToHighlight"] }, { kind: "directive", type: i3$2.NgvTooltipDirective, selector: "[ngvTooltip]", inputs: ["ngvTooltip", "thook", "placement", "shown", "offset", "resizeThrottle", "maxWidth"], outputs: ["ngvShow", "ngvHide"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }] }); }
857
+ }
858
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownListComponent, decorators: [{
859
+ type: Component,
860
+ args: [{ selector: 'nggv-dropdown-list', template: "<ng-container *transloco=\"let t; read: scope\">\n <ul\n class=\"gds-dropdown__options card options gds-reset\"\n [class.gds-dropdown__options-expanded]=\"expanded\"\n role=\"listbox\"\n tabindex=\"-1\"\n [attr.data-thook]=\"thook + '-options'\"\n [attr.aria-labelledby]=\"id + '-label'\"\n [attr.aria-activedescendant]=\"\n state ? id + '-option-' + state?.key : undefined\n \"\n >\n <ng-container *ngFor=\"let item of options\">\n <!-- OPTION -->\n <ng-container *ngIf=\"!isGroup(item)\">\n <ng-template\n *ngTemplateOutlet=\"listItemTemplate; context: { $implicit: item }\"\n ></ng-template>\n </ng-container>\n\n <!-- OPTION GROUP -->\n <li\n class=\"gds-dropdown__options__label group\"\n [attr.data-thook]=\"thook + '-option-group'\"\n *ngIf=\"isGroup(item)\"\n >\n <div class=\"sdv-list__label\">{{ t(item.label) }}</div>\n <ul [attr.aria-disabled]=\"item.disabled\">\n <ng-container *ngFor=\"let option of castGroup(item).options\">\n <ng-template\n *ngTemplateOutlet=\"\n listItemTemplate;\n context: { $implicit: option }\n \"\n ></ng-template>\n </ng-container>\n </ul>\n </li>\n </ng-container>\n </ul>\n\n <!-- TEMPLATE -->\n <ng-template #listItemTemplate let-option>\n <li\n #optionRefs\n *ngIf=\"!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n [ngvTooltip]=\"isOverflow(liElem) ? t(option.label) : undefined\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"\n basicOptionContentTpl;\n context: { $implicit: option }\n \"\n >\n </ng-template>\n </li>\n <!-- Checking overflow on custom templates do not work skip adding ngvToolTip if custom template is provided -->\n <li\n #optionRefs\n *ngIf=\"!!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"optionContentTpl; context: { $implicit: option }\"\n >\n </ng-template>\n </li>\n </ng-template>\n\n <ng-template #basicOptionContentTpl let-option>\n <nggv-typeahead-highlight\n *ngIf=\"!!textToHighlight\"\n [textToHighlight]=\"textToHighlight\"\n [textContent]=\"t(option.label)\"\n >\n </nggv-typeahead-highlight>\n <ng-container *ngIf=\"!textToHighlight\">\n {{ t(option.label) }}\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{position:absolute;bottom:0;transform:translateY(calc(100% + .5rem));--z-index: var(--sg-z-index-dropdown)}:host .hidden{visibility:hidden;display:none}:host ul[role=menu] [role=menuitem]{padding:.75rem;cursor:pointer}:host ul[role=menu] [role=menuitem]:hover,:host ul[role=menu] [role=menuitem]:focus-visible{background-color:var(--gds-ref-pallet-base200)}:host ul[role=menu] [role=menuitem]:active{background-color:var(--gds-ref-pallet-base300)}:host ul[role=menu] [role=menuitem]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox]{--z-index: var(--sg-z-index-popover);background-color:var(--sg-popover-background);flex-direction:column;justify-content:flex-end;inset:auto;z-index:var(--z-index);box-shadow:var(--sg-popover-box-shadow);color:var(--text-primary-color);padding:0;border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--text-primary-color);--sg-border-color: var(--text-primary-color);border-radius:var(--sg-border-radius)}:host ul[role=listbox] [role=option]{padding:.75rem 1rem;line-height:1.25;cursor:pointer}:host ul[role=listbox] [role=option]:hover,:host ul[role=listbox] [role=option]:focus-visible{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:active{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox] [role=option].active.sg-highlighted,:host ul[role=listbox] [role=option][aria-selected=true]{background:var(--grey-1000);color:#fff}:host .sg-fieldset-container{overflow-y:auto}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option]{display:flex;width:100%}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option].active.sg-highlighted input[type=checkbox]~i{border-color:#007ac7!important;box-shadow:0 0 .25em .0625em #41b0ee;outline-color:transparent;outline-style:solid}:host .gds-dropdown__options{padding-left:0;margin-bottom:0;margin-top:0;display:flex;flex-direction:column;list-style:none;display:none}:host .gds-dropdown__options>li{padding-bottom:.5rem;padding-top:.5rem;border:0;display:block;position:relative}:host .gds-dropdown__options>li:before{font-weight:500;display:inline-block;left:0;position:absolute;text-align:center}:host .gds-dropdown__options-expanded{display:block}:host .gds-dropdown__options__label:hover,:host .gds-dropdown__options__label:focus-visible{background-color:var(--grey-400)}:host .gds-dropdown__options__label:active{background-color:var(--grey-500)}:host .gds-dropdown__options__label:focus-visible{outline-color:#000;outline-offset:-.25rem}:host .gds-dropdown__options__label[aria-hidden=true]{display:none}:host .gds-dropdown__options__label[highlighted]{color:#fff}\n"] }]
861
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
862
+ type: Optional
863
+ }, {
864
+ type: Inject,
865
+ args: [TRANSLOCO_SCOPE]
866
+ }] }]; }, propDecorators: { expanded: [{
867
+ type: Input
868
+ }], state: [{
869
+ type: Input
870
+ }], scrollOffset: [{
871
+ type: Input
872
+ }], optionContentTpl: [{
873
+ type: Input
874
+ }], optionRefs: [{
875
+ type: ViewChildren,
876
+ args: ['optionRefs']
877
+ }], id: [{
878
+ type: HostBinding,
879
+ args: ['attr.id']
880
+ }, {
881
+ type: Input
882
+ }], thook: [{
883
+ type: HostBinding,
884
+ args: ['attr.data-thook']
885
+ }, {
886
+ type: Input
887
+ }], options: [{
888
+ type: Input
889
+ }], textToHighlight: [{
890
+ type: Input
891
+ }], selectedValueChanged: [{
892
+ type: Output
893
+ }], closed: [{
894
+ type: Output
895
+ }], onKeyDown: [{
896
+ type: HostListener,
897
+ args: ['document:keydown', ['$event']]
898
+ }], onKeyUp: [{
899
+ type: HostListener,
900
+ args: ['document:keyup', ['$event']]
901
+ }] } });
902
+
903
+ /**
904
+ * A dropdown allows the user to select an option from a list.
905
+ * Dropdowns enables users to make a quick selection of the available options for a specific entry.
906
+ * https://designlibrary.sebgroup.com/components/component-dropdown
907
+ */
908
+ class NgvDropdownComponent extends NgvBaseControlValueAccessorComponent$1 {
909
+ /** List of {@link Option} and {@link OptionGroup} listed when dropdown is expanded. */
910
+ set options(value) {
911
+ // update options
912
+ this._options = value;
913
+ // already has a null/undefined key
914
+ const nullishOption = this.dropdownUtils
915
+ .flattenOptions(value, false)
916
+ .find((option) => option.key == null);
917
+ // if the dropdown is optional, add a null value to deselect option
918
+ if (!this.required && !nullishOption && this.allowControlNullishOption) {
919
+ this._options = [this.defaultNullishOption].concat(this._options);
920
+ }
921
+ // set default value and emit if there is only one option
922
+ if (value.length === 1 && this.required && this.selectOnSingleOption) {
923
+ const onlyOption = this.dropdownUtils.flattenOptions(value, false)[0];
924
+ this.updateModel(onlyOption);
925
+ return;
926
+ }
927
+ // don't update local state if we shouldn't control nullish value and we cant find the selected value amongst the options
928
+ const matchingOption = this.dropdownUtils
929
+ .flattenOptions(value, false)
930
+ .find((option) => option.key == this.ngControl?.value);
931
+ if (!this.allowControlNullishOption && !matchingOption)
932
+ return;
933
+ // Update local state
934
+ this.writeValue(this.ngControl?.value);
935
+ }
936
+ get options() {
937
+ return this._options;
938
+ }
939
+ /** @internal nullish option. */
940
+ get defaultNullishOption() {
941
+ return { key: null, label: this.placeholder ?? '\u00A0' };
942
+ }
943
+ constructor(ngControl, translocoScope, cdr, dropdownUtils) {
944
+ super(ngControl, translocoScope, cdr);
945
+ this.ngControl = ngControl;
946
+ this.translocoScope = translocoScope;
947
+ this.cdr = cdr;
948
+ this.dropdownUtils = dropdownUtils;
949
+ /** Special property used for selecting DOM elements during automated UI testing. */
950
+ this.thook = 'dropdown';
951
+ /** The additional amount to show when option is scrolled into view. */
952
+ this.scrollOffset = 24;
953
+ /**
954
+ * Allow this component to add/ remove nullish options based on wether the control is required or not
955
+ * Defaults to true.
956
+ */
957
+ this.allowControlNullishOption = true;
958
+ /**
959
+ * If only one option exists in options[], default is to select it.
960
+ * This input can be used to alter that behaviour so it doesn't automatically
961
+ * select a value if it's the only one.
962
+ * Defaults to true.
963
+ */
964
+ this.selectOnSingleOption = true;
965
+ /**
966
+ * Emits changes of the expanded state of the dropdown
967
+ */
968
+ this.expandedChange = new EventEmitter();
969
+ /** The current expanded state of the dropdown options. */
970
+ this.expanded = false;
971
+ /** The current option selected based on numeric index. */
972
+ this.activeIndex = -1;
973
+ this.keyEvent = {};
974
+ this._options = [];
975
+ }
976
+ ngOnChanges(changes) {
977
+ if (changes.required?.currentValue !== undefined) {
978
+ const isRequired = changes.required.currentValue;
979
+ // remove nullish option
980
+ const hasNullishOption = this.dropdownUtils.flattenOptions(this._options, false)[0]?.key == null;
981
+ // if required, remove nullish option
982
+ if (isRequired && hasNullishOption && this.allowControlNullishOption) {
983
+ this._options = this._options.slice(1);
984
+ return;
985
+ }
986
+ // if not required, add nullish option
987
+ if (!isRequired && !hasNullishOption && this.allowControlNullishOption) {
988
+ this._options = [this.defaultNullishOption].concat(this._options);
989
+ return;
990
+ }
991
+ }
992
+ }
993
+ ngOnDestroy() {
994
+ this.onClickSubscription?.unsubscribe();
995
+ }
996
+ /** @internal override to correctly set state from form value */
997
+ writeValue(value) {
998
+ const options = this.dropdownUtils.flattenOptions(this._options, false);
999
+ this.state = options.find((option) => option.key === value);
1000
+ }
1001
+ // ----------------------------------------------------------------------------
1002
+ // EVENTS
1003
+ // ----------------------------------------------------------------------------
1004
+ /** @internal */
1005
+ onSelectChange(option) {
1006
+ if (option.disabled)
1007
+ return;
1008
+ this.updateModel(option);
1009
+ this.setExpanded(false);
1010
+ }
1011
+ // /**
1012
+ // * @internal
1013
+ // * Enter toggles the dropdown, home, end, and, arrows change the index.
1014
+ // * @param event fired containing which key was released.
1015
+ // */
1016
+ onKeyUp(event) {
1017
+ this.keyEvent = event;
1018
+ }
1019
+ /**
1020
+ * Closes the dropdown on click outside.
1021
+ */
1022
+ subscribeToOutsideClickEvent() {
1023
+ this.onClickSubscription = fromEvent(document, 'click').subscribe({
1024
+ next: (event) => {
1025
+ if (this.expanded &&
1026
+ !this.inputRef?.nativeElement.contains(event.target)) {
1027
+ this.toggleDropdown();
1028
+ this.onClickSubscription?.unsubscribe();
1029
+ }
1030
+ },
1031
+ });
1032
+ }
1033
+ // ----------------------------------------------------------------------------
1034
+ // HELPERS
1035
+ // ----------------------------------------------------------------------------
1036
+ /**
1037
+ * Set the dropdown value to given option.
1038
+ * @param value the dropdown option to select.
1039
+ */
1040
+ updateModel(value) {
1041
+ this.state = value;
1042
+ this.onChange(value.key);
1043
+ }
1044
+ /** Toggle the expanded state of the dropdown options. */
1045
+ toggleDropdown() {
1046
+ this.setExpanded(!this.expanded);
1047
+ this.cdr.detectChanges();
1048
+ }
1049
+ /**
1050
+ * Set the expanded state of the dropdown options. If true the options are shown below the field.
1051
+ * Activate on click event to be able to close dropdown on click outside.
1052
+ * @param state the expanded state which to set.
1053
+ */
1054
+ setExpanded(state = true) {
1055
+ this.expanded = state;
1056
+ this.expandedChange.emit(this.expanded);
1057
+ if (this.expanded)
1058
+ this.subscribeToOutsideClickEvent();
1059
+ if (!this.expanded)
1060
+ this.onTouched();
1061
+ }
1062
+ /* TYPE CASTS */
1063
+ /**
1064
+ * Typecast anything to an {@link Option}.
1065
+ * @param option the object to typecast.
1066
+ */
1067
+ castOption(option) {
1068
+ return option;
1069
+ }
1070
+ /**
1071
+ * Typecast anything to an {@link OptionGroup}.
1072
+ * @param group the object to typecast.
1073
+ */
1074
+ castGroup(group) {
1075
+ return group;
1076
+ }
1077
+ /* TYPE CHECKS */
1078
+ /**
1079
+ * Returns true if argument is an {@link Option}.
1080
+ * @param option the object to check.
1081
+ */
1082
+ isOption(option) {
1083
+ return !('options' in option);
1084
+ }
1085
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }, { token: i2$2.DropdownUtils }], target: i0.ɵɵFactoryTarget.Component }); }
1086
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvDropdownComponent, selector: "nggv-dropdown", inputs: { thook: "thook", placeholder: "placeholder", options: "options", scrollOffset: "scrollOffset", allowControlNullishOption: "allowControlNullishOption", textToHighlight: "textToHighlight", selectOnSingleOption: "selectOnSingleOption" }, outputs: { expandedChange: "expandedChange" }, host: { listeners: { "keyup": "onKeyUp($event)" }, properties: { "attr.data-thook": "this.thook" } }, queries: [{ propertyName: "selectedContentTpl", first: true, predicate: ["selectedTpl"], descendants: true, read: TemplateRef }, { propertyName: "optionContentTpl", first: true, predicate: ["optionTpl"], descendants: true, read: TemplateRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label [id]=\"id + '-label'\" class=\"hide-if-empty\" [attr.for]=\"id + '-toggle'\">\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div class=\"description\">{{ description }}</div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n [attr.aria-labelledby]=\"id + '-label ' + id + '-input'\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n <ng-template\n *ngTemplateOutlet=\"\n selectedContentTpl || defaultSelectedContentTpl;\n context: { $implicit: state }\n \"\n >\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n\n <!-- INPUT -->\n <ng-container *ngIf=\"!locked\">\n <div #input [id]=\"id + '-input'\" class=\"dropdown\">\n <button\n [id]=\"id + '-toggle'\"\n [disabled]=\"disabled\"\n type=\"button\"\n class=\"nggv-field-dropdown__label toggle\"\n [class.nggv-field--error]=\"invalid\"\n aria-haspopup=\"listbox\"\n [attr.data-thook]=\"thook + '-toggle'\"\n [attr.aria-expanded]=\"expanded\"\n [attr.aria-labelledby]=\"id + '-label ' + id + '-toggle'\"\n (click)=\"toggleDropdown()\"\n >\n <ng-template\n *ngTemplateOutlet=\"\n selectedContentTpl || defaultSelectedContentTpl;\n context: { $implicit: state }\n \"\n >\n </ng-template>\n </button>\n\n <nggv-dropdown-list\n #dropDownList\n [options]=\"options\"\n [scrollOffset]=\"scrollOffset\"\n [state]=\"state\"\n [expanded]=\"expanded\"\n [optionContentTpl]=\"optionContentTpl\"\n [textToHighlight]=\"textToHighlight\"\n (selectedValueChanged)=\"onSelectChange($event)\"\n >\n </nggv-dropdown-list>\n </div>\n <!-- ERRORS -->\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n </ng-container>\n\n <ng-template #defaultSelectedContentTpl let-state>\n <!-- eslint-disable-next-line @angular-eslint/template/eqeqeq -->\n {{ state?.key != null && state?.label ? t(state.label) : placeholder }}\n </ng-template>\n</ng-container>\n", styles: [":host label{display:block;font-weight:500;line-height:1.25rem;margin-bottom:.5rem;width:100%}:host .description{margin-bottom:.5rem;line-height:1.25rem;width:100%}:host button{font-weight:500;display:inline-flex;justify-content:center;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:transparent;border-color:#007ac7;color:#007ac7;--color: rgb(0, 122, 199);background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--grey-800);--sg-border-color: var(--grey-800);background:var(--sg-form-control-bg);color:var(--text-primary-color);min-height:2.75rem;display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;max-width:100%;font-size:inherit;font-weight:400;line-height:1.125;margin-bottom:.5rem;margin-top:.5rem;width:100%}@media screen and (-ms-high-contrast: active){:host button{border:2px solid currentcolor}}:host button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host button:focus:not(:focus-visible){box-shadow:none;outline:0}:host button:focus,:host button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host button:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host button[aria-selected=true],:host button:active,:host button.active,:host button.active:hover,:host button:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host button:disabled,:host button.disabled,:host button[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host button:disabled::placeholder,:host button.disabled::placeholder,:host button[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host button:focus{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host button{min-width:100%}}:host button:not(:disabled,.disabled,[aria-disabled]):hover{--background: var(--grey-400);--color: var(--grey-1000);background-color:var(--grey-400);color:var(--grey-1000);border-color:var(--grey-1000)}:host button>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host button:after{margin-left:.5rem;margin-right:.5rem;border-bottom:solid 2px var(--text-primary-color);border-left:solid 2px var(--text-primary-color);content:\"\";display:block;height:.5rem;width:.5rem;position:relative;top:-.15rem;transform:translate(75%) rotate3d(0,0,1,-45deg) scaleZ(-1);transition:transform .3s ease-in;flex-shrink:0}:host button[aria-expanded=true]:after{transform:translate(75%,6px) rotate3d(0,0,1,-45deg) scale3d(-1,-1,1)}:host button:hover:after{border-color:currentColor}:host button.small{font-size:.875rem}:host button:hover{background:var(--grey-400)}:host .dropdown{position:relative}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: NgvDropdownListComponent, selector: "nggv-dropdown-list", inputs: ["expanded", "state", "scrollOffset", "optionContentTpl", "id", "thook", "options", "textToHighlight"], outputs: ["selectedValueChanged", "closed"] }] }); }
1087
+ }
1088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownComponent, decorators: [{
1089
+ type: Component,
1090
+ args: [{ selector: 'nggv-dropdown', template: "<!-- LABEL -->\n<ng-container *transloco=\"let t; read: scope\">\n <label [id]=\"id + '-label'\" class=\"hide-if-empty\" [attr.for]=\"id + '-toggle'\">\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n </label>\n\n <!-- DESCRIPTION -->\n <div class=\"description\">{{ description }}</div>\n\n <!-- LOCKED INPUT -->\n <ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n [attr.aria-labelledby]=\"id + '-label ' + id + '-input'\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n <ng-template\n *ngTemplateOutlet=\"\n selectedContentTpl || defaultSelectedContentTpl;\n context: { $implicit: state }\n \"\n >\n </ng-template>\n </ng-container>\n </div>\n </ng-container>\n\n <!-- INPUT -->\n <ng-container *ngIf=\"!locked\">\n <div #input [id]=\"id + '-input'\" class=\"dropdown\">\n <button\n [id]=\"id + '-toggle'\"\n [disabled]=\"disabled\"\n type=\"button\"\n class=\"nggv-field-dropdown__label toggle\"\n [class.nggv-field--error]=\"invalid\"\n aria-haspopup=\"listbox\"\n [attr.data-thook]=\"thook + '-toggle'\"\n [attr.aria-expanded]=\"expanded\"\n [attr.aria-labelledby]=\"id + '-label ' + id + '-toggle'\"\n (click)=\"toggleDropdown()\"\n >\n <ng-template\n *ngTemplateOutlet=\"\n selectedContentTpl || defaultSelectedContentTpl;\n context: { $implicit: state }\n \"\n >\n </ng-template>\n </button>\n\n <nggv-dropdown-list\n #dropDownList\n [options]=\"options\"\n [scrollOffset]=\"scrollOffset\"\n [state]=\"state\"\n [expanded]=\"expanded\"\n [optionContentTpl]=\"optionContentTpl\"\n [textToHighlight]=\"textToHighlight\"\n (selectedValueChanged)=\"onSelectChange($event)\"\n >\n </nggv-dropdown-list>\n </div>\n <!-- ERRORS -->\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-input'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n </ng-container>\n\n <ng-template #defaultSelectedContentTpl let-state>\n <!-- eslint-disable-next-line @angular-eslint/template/eqeqeq -->\n {{ state?.key != null && state?.label ? t(state.label) : placeholder }}\n </ng-template>\n</ng-container>\n", styles: [":host label{display:block;font-weight:500;line-height:1.25rem;margin-bottom:.5rem;width:100%}:host .description{margin-bottom:.5rem;line-height:1.25rem;width:100%}:host button{font-weight:500;display:inline-flex;justify-content:center;transition:all .3s cubic-bezier(.23,1,.32,1),outline-offset 0s,outline-width 0s;background:transparent;border-color:#007ac7;color:#007ac7;--color: rgb(0, 122, 199);background-color:transparent;border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--grey-800);--sg-border-color: var(--grey-800);background:var(--sg-form-control-bg);color:var(--text-primary-color);min-height:2.75rem;display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;max-width:100%;font-size:inherit;font-weight:400;line-height:1.125;margin-bottom:.5rem;margin-top:.5rem;width:100%}@media screen and (-ms-high-contrast: active){:host button{border:2px solid currentcolor}}:host button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}:host button:focus:not(:focus-visible){box-shadow:none;outline:0}:host button:focus,:host button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host button:not(:disabled,.disabled,[aria-disabled]):hover{background-color:#199be3;color:#fff;--background: #199be3;--color: rgb(255, 255, 255);border-color:#199be3}:host button[aria-selected=true],:host button:active,:host button.active,:host button.active:hover,:host button:active:hover{background-color:#007ac7;color:#fff;--background: rgb(0, 122, 199);--color: rgb(255, 255, 255);border-color:#007ac7}:host button:disabled,:host button.disabled,:host button[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host button:disabled::placeholder,:host button.disabled::placeholder,:host button[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host button:focus{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host button{min-width:100%}}:host button:not(:disabled,.disabled,[aria-disabled]):hover{--background: var(--grey-400);--color: var(--grey-1000);background-color:var(--grey-400);color:var(--grey-1000);border-color:var(--grey-1000)}:host button>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host button:after{margin-left:.5rem;margin-right:.5rem;border-bottom:solid 2px var(--text-primary-color);border-left:solid 2px var(--text-primary-color);content:\"\";display:block;height:.5rem;width:.5rem;position:relative;top:-.15rem;transform:translate(75%) rotate3d(0,0,1,-45deg) scaleZ(-1);transition:transform .3s ease-in;flex-shrink:0}:host button[aria-expanded=true]:after{transform:translate(75%,6px) rotate3d(0,0,1,-45deg) scale3d(-1,-1,1)}:host button:hover:after{border-color:currentColor}:host button.small{font-size:.875rem}:host button:hover{background:var(--grey-400)}:host .dropdown{position:relative}\n"] }]
1091
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
1092
+ type: Self
1093
+ }, {
1094
+ type: Optional
1095
+ }] }, { type: undefined, decorators: [{
1096
+ type: Optional
1097
+ }, {
1098
+ type: Inject,
1099
+ args: [TRANSLOCO_SCOPE]
1100
+ }] }, { type: i0.ChangeDetectorRef }, { type: i2$2.DropdownUtils }]; }, propDecorators: { selectedContentTpl: [{
1101
+ type: ContentChild,
1102
+ args: ['selectedTpl', { read: TemplateRef }]
1103
+ }], optionContentTpl: [{
1104
+ type: ContentChild,
1105
+ args: ['optionTpl', { read: TemplateRef }]
1106
+ }], thook: [{
1107
+ type: HostBinding,
1108
+ args: ['attr.data-thook']
1109
+ }, {
1110
+ type: Input
1111
+ }], placeholder: [{
1112
+ type: Input
1113
+ }], options: [{
1114
+ type: Input
1115
+ }], scrollOffset: [{
1116
+ type: Input
1117
+ }], allowControlNullishOption: [{
1118
+ type: Input
1119
+ }], textToHighlight: [{
1120
+ type: Input
1121
+ }], selectOnSingleOption: [{
1122
+ type: Input
1123
+ }], expandedChange: [{
1124
+ type: Output
1125
+ }], onKeyUp: [{
1126
+ type: HostListener,
1127
+ args: ['keyup', ['$event']]
1128
+ }] } });
1129
+
1130
+ class NgvTypeaheadInputComponent extends NgvInputComponent$1 {
1131
+ get dropdownButton() {
1132
+ return this.hostComponent.inputRef?.nativeElement;
1133
+ }
1134
+ constructor(element, renderer2, ngControl, translocoScope, cdr) {
1135
+ super(ngControl, translocoScope, cdr);
1136
+ this.element = element;
1137
+ this.renderer2 = renderer2;
1138
+ this.ngControl = ngControl;
1139
+ this.translocoScope = translocoScope;
1140
+ this.cdr = cdr;
1141
+ /** Boolean to indicate wether the dropdown is expanded or not, to apply appropriate styling */
1142
+ this.expanded = false;
1143
+ super.ngOnInit();
1144
+ }
1145
+ ngOnInit() {
1146
+ this.autocomplete = 'off';
1147
+ this.debounceTime = 0;
1148
+ this.hostComponent.selectOnSingleOption = false;
1149
+ this.moveInput();
1150
+ this.handleExpandedChange();
1151
+ }
1152
+ /**
1153
+ * @internal
1154
+ * Allow space to be inputted as text
1155
+ * @param event fired containing which key was released.
1156
+ */
1157
+ onKeyUp(event) {
1158
+ if (event.code === 'Space') {
1159
+ event.preventDefault();
1160
+ }
1161
+ }
1162
+ /**
1163
+ * @internal
1164
+ * First time the dropdown is expanded, move the input sp it becomes a child of the dropdown button
1165
+ * to better reflect semantics and styling.
1166
+ */
1167
+ moveInput() {
1168
+ // Workaround to execute code in setTimeout due to hooks management etc.
1169
+ setTimeout(() => {
1170
+ // Only move if parent dropdown is found
1171
+ if (this.dropdownButton) {
1172
+ this.renderer2.appendChild(this.dropdownButton.querySelector('button'), this.element.nativeElement);
1173
+ // Get the height of the parent button so the input can be explicitly set to the same height since it's absolutely positioned
1174
+ this.buttonHeight =
1175
+ this.dropdownButton.getBoundingClientRect().height || 32; // Default to 2em;
1176
+ }
1177
+ }, 0);
1178
+ }
1179
+ /**
1180
+ * @internal
1181
+ * When dropdown is expanded, focus on the input. If a value is selected, set it in the input.
1182
+ * When the dropdown is collapsed, empty the input from text.
1183
+ */
1184
+ handleExpandedChange() {
1185
+ this.hostComponent.expandedChange
1186
+ .pipe(takeUntil$1(this._destroy$))
1187
+ .subscribe((state) => {
1188
+ this.expanded = state;
1189
+ if (this.expanded) {
1190
+ // Weird workaround for setting focus. Didn't set focus, but wrapping in setTimeout solved it.
1191
+ // See suggestion here: https://github.com/ionic-team/stencil/issues/3772#issuecomment-1292599609
1192
+ setTimeout(() => this.setFocus());
1193
+ // Format and interpolate result since return type can be other than string from the formatter
1194
+ const formattedValue = `${this.formatSelected(this.hostComponent.state)}`;
1195
+ this.setInput(formattedValue, false);
1196
+ }
1197
+ else
1198
+ this.setInput('', true);
1199
+ });
1200
+ }
1201
+ /**
1202
+ * @internal Formats the selected option to display in the input. Interpolate the returned value
1203
+ * since we don't know the return type or label type.
1204
+ * @param value The selected value
1205
+ * @returns The formatted value
1206
+ */
1207
+ formatSelected(value) {
1208
+ if (value?.key == null)
1209
+ return '';
1210
+ // If no formatter exists, return the label or empty string
1211
+ if (!this.selectedFormatter)
1212
+ return value.label ?? '';
1213
+ // If a formatter exists, use it
1214
+ return this.selectedFormatter(value) ?? '';
1215
+ }
1216
+ /**
1217
+ * Sets the input programmatically instead of native HTML input event.
1218
+ * @param input
1219
+ */
1220
+ setInput(input, triggerFilter) {
1221
+ this.state = input;
1222
+ if (triggerFilter) {
1223
+ this.onChange(this.state);
1224
+ this.inputChange$.next(this.state);
1225
+ }
1226
+ }
1227
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1228
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvTypeaheadInputComponent, selector: "nggv-typeahead-input", inputs: { hostComponent: "hostComponent", resultFormatter: "resultFormatter", selectedFormatter: "selectedFormatter" }, host: { listeners: { "document:keyup": "onKeyUp($event)" } }, usesInheritance: true, ngImport: i0, template: "<ng-container>\n <div class=\"input-wrapper\"\n [ngClass]=\"{ 'expanded': expanded, 'collapsed': !expanded }\"\n [ngStyle]=\"{ 'height.px': buttonHeight }\"\n (click)=\"$event.stopPropagation();\">\n <!-- INPUT FIELD -->\n <div class=\"input-group\">\n <input #input\n [id]=\"id + '-input'\"\n class=\"sdv-field\"\n [attr.type]=\"type\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [attr.email]=\"email\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [pattern]=\"pattern\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n [autofocus]=\"autofocus\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [value]=\"state\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\" />\n </div>\n </div>\n</ng-container>", styles: [":host{position:absolute;top:0;left:0;width:calc(100% - 2.625em)}:host .input-wrapper{border:none;box-shadow:none}:host .input-wrapper.expanded{display:flex}:host .input-wrapper.expanded .input-group input.sdv-field{height:100%;width:100%;min-height:unset;margin-left:1px;border:none;box-shadow:none}:host .input-wrapper.collapsed{display:none}:host .input-wrapper .input-group{width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
1229
+ }
1230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadInputComponent, decorators: [{
1231
+ type: Component,
1232
+ args: [{ selector: 'nggv-typeahead-input', template: "<ng-container>\n <div class=\"input-wrapper\"\n [ngClass]=\"{ 'expanded': expanded, 'collapsed': !expanded }\"\n [ngStyle]=\"{ 'height.px': buttonHeight }\"\n (click)=\"$event.stopPropagation();\">\n <!-- INPUT FIELD -->\n <div class=\"input-group\">\n <input #input\n [id]=\"id + '-input'\"\n class=\"sdv-field\"\n [attr.type]=\"type\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [attr.email]=\"email\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [pattern]=\"pattern\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n [autofocus]=\"autofocus\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [value]=\"state\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\" />\n </div>\n </div>\n</ng-container>", styles: [":host{position:absolute;top:0;left:0;width:calc(100% - 2.625em)}:host .input-wrapper{border:none;box-shadow:none}:host .input-wrapper.expanded{display:flex}:host .input-wrapper.expanded .input-group input.sdv-field{height:100%;width:100%;min-height:unset;margin-left:1px;border:none;box-shadow:none}:host .input-wrapper.collapsed{display:none}:host .input-wrapper .input-group{width:100%}\n"] }]
1233
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.NgControl, decorators: [{
1234
+ type: Self
1235
+ }, {
1236
+ type: Optional
1237
+ }] }, { type: undefined, decorators: [{
1238
+ type: Optional
1239
+ }, {
1240
+ type: Inject,
1241
+ args: [TRANSLOCO_SCOPE]
1242
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostComponent: [{
1243
+ type: Input
1244
+ }], resultFormatter: [{
1245
+ type: Input
1246
+ }], selectedFormatter: [{
1247
+ type: Input
1248
+ }], onKeyUp: [{
1249
+ type: HostListener,
1250
+ args: ['document:keyup', ['$event']]
1251
+ }] } });
1252
+
1253
+ // Use dropdownList template and combine stylesheets
1254
+ class NgvTypeaheadDropdownListComponent extends NgvDropdownListComponent {
1255
+ constructor(translocoScope, element) {
1256
+ super(translocoScope);
1257
+ this.translocoScope = translocoScope;
1258
+ this.element = element;
1259
+ this._destroy$ = new Subject();
1260
+ }
1261
+ ngOnInit() {
1262
+ this.handleSelectedValueChanges();
1263
+ this.handleFocusChanges();
1264
+ }
1265
+ ngOnDestroy() {
1266
+ this._destroy$.next(true);
1267
+ this._destroy$.complete();
1268
+ }
1269
+ /** @Internal Subscribe to click outside dropdownList and input to close dropdownList */
1270
+ subscribeToOutsideClickEvent() {
1271
+ this.onClickSubscription = fromEvent(document, 'click')
1272
+ .pipe(takeUntil$1(this._destroy$))
1273
+ .subscribe({
1274
+ next: (event) => {
1275
+ if (this.expanded &&
1276
+ !this.element.nativeElement.contains(event.target) &&
1277
+ !this.hostComponent.inputRef?.nativeElement.contains(event.target)) {
1278
+ this.setExpanded(false);
1279
+ this.onClickSubscription?.unsubscribe();
1280
+ }
1281
+ },
1282
+ });
1283
+ }
1284
+ /** @Internal Update state of the host-input to reflect the selected value */
1285
+ handleSelectedValueChanges() {
1286
+ this.selectedValueChanged
1287
+ .pipe(takeUntil$1(this._destroy$))
1288
+ .subscribe((selected) => {
1289
+ if (this.hostComponent.inputRef) {
1290
+ this.hostComponent.state = `${this.formatSelected(selected)}`;
1291
+ }
1292
+ });
1293
+ }
1294
+ /** @Internal Expand the dropdown when input receives focus. If no state, set empty string in input */
1295
+ handleFocusChanges() {
1296
+ this.hostComponent.ngvFocus
1297
+ .asObservable()
1298
+ .pipe(takeUntil$1(this._destroy$))
1299
+ .subscribe(() => {
1300
+ if (!this.state)
1301
+ this.hostComponent.ngvInput.emit('');
1302
+ this.setExpanded(true);
1303
+ this.subscribeToOutsideClickEvent();
1304
+ });
1305
+ }
1306
+ /**
1307
+ * @internal Formats the selected option to display in the input. Interpolate the returned value
1308
+ * since we don't know the return type or label type.
1309
+ * @param value The selected value
1310
+ * @returns The formatted value
1311
+ */
1312
+ formatSelected(value) {
1313
+ if (value?.key == null)
1314
+ return '';
1315
+ //If no formatter exists, return the label or empty string
1316
+ if (!this.selectedFormatter)
1317
+ return value.label ?? '';
1318
+ // If a formatter exists, use it
1319
+ return this.selectedFormatter(value) ?? '';
1320
+ }
1321
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadDropdownListComponent, deps: [{ token: TRANSLOCO_SCOPE, optional: true, skipSelf: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
1322
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvTypeaheadDropdownListComponent, selector: "nggv-typeahead-dropdown-list", inputs: { hostComponent: "hostComponent", resultFormatter: "resultFormatter", selectedFormatter: "selectedFormatter" }, usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t; read: scope\">\n <ul\n class=\"gds-dropdown__options card options gds-reset\"\n [class.gds-dropdown__options-expanded]=\"expanded\"\n role=\"listbox\"\n tabindex=\"-1\"\n [attr.data-thook]=\"thook + '-options'\"\n [attr.aria-labelledby]=\"id + '-label'\"\n [attr.aria-activedescendant]=\"\n state ? id + '-option-' + state?.key : undefined\n \"\n >\n <ng-container *ngFor=\"let item of options\">\n <!-- OPTION -->\n <ng-container *ngIf=\"!isGroup(item)\">\n <ng-template\n *ngTemplateOutlet=\"listItemTemplate; context: { $implicit: item }\"\n ></ng-template>\n </ng-container>\n\n <!-- OPTION GROUP -->\n <li\n class=\"gds-dropdown__options__label group\"\n [attr.data-thook]=\"thook + '-option-group'\"\n *ngIf=\"isGroup(item)\"\n >\n <div class=\"sdv-list__label\">{{ t(item.label) }}</div>\n <ul [attr.aria-disabled]=\"item.disabled\">\n <ng-container *ngFor=\"let option of castGroup(item).options\">\n <ng-template\n *ngTemplateOutlet=\"\n listItemTemplate;\n context: { $implicit: option }\n \"\n ></ng-template>\n </ng-container>\n </ul>\n </li>\n </ng-container>\n </ul>\n\n <!-- TEMPLATE -->\n <ng-template #listItemTemplate let-option>\n <li\n #optionRefs\n *ngIf=\"!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n [ngvTooltip]=\"isOverflow(liElem) ? t(option.label) : undefined\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"\n basicOptionContentTpl;\n context: { $implicit: option }\n \"\n >\n </ng-template>\n </li>\n <!-- Checking overflow on custom templates do not work skip adding ngvToolTip if custom template is provided -->\n <li\n #optionRefs\n *ngIf=\"!!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"optionContentTpl; context: { $implicit: option }\"\n >\n </ng-template>\n </li>\n </ng-template>\n\n <ng-template #basicOptionContentTpl let-option>\n <nggv-typeahead-highlight\n *ngIf=\"!!textToHighlight\"\n [textToHighlight]=\"textToHighlight\"\n [textContent]=\"t(option.label)\"\n >\n </nggv-typeahead-highlight>\n <ng-container *ngIf=\"!textToHighlight\">\n {{ t(option.label) }}\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{display:flex;width:100%;position:relative}\n", ":host{position:absolute;bottom:0;transform:translateY(calc(100% + .5rem));--z-index: var(--sg-z-index-dropdown)}:host .hidden{visibility:hidden;display:none}:host ul[role=menu] [role=menuitem]{padding:.75rem;cursor:pointer}:host ul[role=menu] [role=menuitem]:hover,:host ul[role=menu] [role=menuitem]:focus-visible{background-color:var(--gds-ref-pallet-base200)}:host ul[role=menu] [role=menuitem]:active{background-color:var(--gds-ref-pallet-base300)}:host ul[role=menu] [role=menuitem]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox]{--z-index: var(--sg-z-index-popover);background-color:var(--sg-popover-background);flex-direction:column;justify-content:flex-end;inset:auto;z-index:var(--z-index);box-shadow:var(--sg-popover-box-shadow);color:var(--text-primary-color);padding:0;border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--text-primary-color);--sg-border-color: var(--text-primary-color);border-radius:var(--sg-border-radius)}:host ul[role=listbox] [role=option]{padding:.75rem 1rem;line-height:1.25;cursor:pointer}:host ul[role=listbox] [role=option]:hover,:host ul[role=listbox] [role=option]:focus-visible{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:active{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox] [role=option].active.sg-highlighted,:host ul[role=listbox] [role=option][aria-selected=true]{background:var(--grey-1000);color:#fff}:host .sg-fieldset-container{overflow-y:auto}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option]{display:flex;width:100%}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option].active.sg-highlighted input[type=checkbox]~i{border-color:#007ac7!important;box-shadow:0 0 .25em .0625em #41b0ee;outline-color:transparent;outline-style:solid}:host .gds-dropdown__options{padding-left:0;margin-bottom:0;margin-top:0;display:flex;flex-direction:column;list-style:none;display:none}:host .gds-dropdown__options>li{padding-bottom:.5rem;padding-top:.5rem;border:0;display:block;position:relative}:host .gds-dropdown__options>li:before{font-weight:500;display:inline-block;left:0;position:absolute;text-align:center}:host .gds-dropdown__options-expanded{display:block}:host .gds-dropdown__options__label:hover,:host .gds-dropdown__options__label:focus-visible{background-color:var(--grey-400)}:host .gds-dropdown__options__label:active{background-color:var(--grey-500)}:host .gds-dropdown__options__label:focus-visible{outline-color:#000;outline-offset:-.25rem}:host .gds-dropdown__options__label[aria-hidden=true]{display:none}:host .gds-dropdown__options__label[highlighted]{color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$2.NgvTooltipDirective, selector: "[ngvTooltip]", inputs: ["ngvTooltip", "thook", "placement", "shown", "offset", "resizeThrottle", "maxWidth"], outputs: ["ngvShow", "ngvHide"] }, { kind: "component", type: NgvTypeaheadHighlightComponent, selector: "nggv-typeahead-highlight", inputs: ["textContent", "textToHighlight"] }] }); }
1323
+ }
1324
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadDropdownListComponent, decorators: [{
1325
+ type: Component,
1326
+ args: [{ selector: 'nggv-typeahead-dropdown-list', template: "<ng-container *transloco=\"let t; read: scope\">\n <ul\n class=\"gds-dropdown__options card options gds-reset\"\n [class.gds-dropdown__options-expanded]=\"expanded\"\n role=\"listbox\"\n tabindex=\"-1\"\n [attr.data-thook]=\"thook + '-options'\"\n [attr.aria-labelledby]=\"id + '-label'\"\n [attr.aria-activedescendant]=\"\n state ? id + '-option-' + state?.key : undefined\n \"\n >\n <ng-container *ngFor=\"let item of options\">\n <!-- OPTION -->\n <ng-container *ngIf=\"!isGroup(item)\">\n <ng-template\n *ngTemplateOutlet=\"listItemTemplate; context: { $implicit: item }\"\n ></ng-template>\n </ng-container>\n\n <!-- OPTION GROUP -->\n <li\n class=\"gds-dropdown__options__label group\"\n [attr.data-thook]=\"thook + '-option-group'\"\n *ngIf=\"isGroup(item)\"\n >\n <div class=\"sdv-list__label\">{{ t(item.label) }}</div>\n <ul [attr.aria-disabled]=\"item.disabled\">\n <ng-container *ngFor=\"let option of castGroup(item).options\">\n <ng-template\n *ngTemplateOutlet=\"\n listItemTemplate;\n context: { $implicit: option }\n \"\n ></ng-template>\n </ng-container>\n </ul>\n </li>\n </ng-container>\n </ul>\n\n <!-- TEMPLATE -->\n <ng-template #listItemTemplate let-option>\n <li\n #optionRefs\n *ngIf=\"!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n [ngvTooltip]=\"isOverflow(liElem) ? t(option.label) : undefined\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"\n basicOptionContentTpl;\n context: { $implicit: option }\n \"\n >\n </ng-template>\n </li>\n <!-- Checking overflow on custom templates do not work skip adding ngvToolTip if custom template is provided -->\n <li\n #optionRefs\n *ngIf=\"!!optionContentTpl\"\n tabindex=\"-1\"\n [id]=\"id + '-option-' + option.key\"\n class=\"gds-dropdown__options__label option\"\n role=\"option\"\n #liElem\n [attr.data-thook]=\"thook + '-option-' + option.key\"\n [attr.aria-disabled]=\"option.disabled\"\n [attr.aria-selected]=\"\n option.key === selectedValue?.key && !!selectedValue?.key\n \"\n [attr.aria-focus]=\"option.key === state?.key && !option.disabled\"\n (click)=\"updateState(option, $event)\"\n >\n <ng-template\n *ngTemplateOutlet=\"optionContentTpl; context: { $implicit: option }\"\n >\n </ng-template>\n </li>\n </ng-template>\n\n <ng-template #basicOptionContentTpl let-option>\n <nggv-typeahead-highlight\n *ngIf=\"!!textToHighlight\"\n [textToHighlight]=\"textToHighlight\"\n [textContent]=\"t(option.label)\"\n >\n </nggv-typeahead-highlight>\n <ng-container *ngIf=\"!textToHighlight\">\n {{ t(option.label) }}\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{display:flex;width:100%;position:relative}\n", ":host{position:absolute;bottom:0;transform:translateY(calc(100% + .5rem));--z-index: var(--sg-z-index-dropdown)}:host .hidden{visibility:hidden;display:none}:host ul[role=menu] [role=menuitem]{padding:.75rem;cursor:pointer}:host ul[role=menu] [role=menuitem]:hover,:host ul[role=menu] [role=menuitem]:focus-visible{background-color:var(--gds-ref-pallet-base200)}:host ul[role=menu] [role=menuitem]:active{background-color:var(--gds-ref-pallet-base300)}:host ul[role=menu] [role=menuitem]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox]{--z-index: var(--sg-z-index-popover);background-color:var(--sg-popover-background);flex-direction:column;justify-content:flex-end;inset:auto;z-index:var(--z-index);box-shadow:var(--sg-popover-box-shadow);color:var(--text-primary-color);padding:0;border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--text-primary-color);--sg-border-color: var(--text-primary-color);border-radius:var(--sg-border-radius)}:host ul[role=listbox] [role=option]{padding:.75rem 1rem;line-height:1.25;cursor:pointer}:host ul[role=listbox] [role=option]:hover,:host ul[role=listbox] [role=option]:focus-visible{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:active{background-color:var(--grey-400)}:host ul[role=listbox] [role=option]:focus{outline-color:#000;outline-offset:-.25rem}:host ul[role=listbox] [role=option].active.sg-highlighted,:host ul[role=listbox] [role=option][aria-selected=true]{background:var(--grey-1000);color:#fff}:host .sg-fieldset-container{overflow-y:auto}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option]{display:flex;width:100%}:host .sg-fieldset-container fieldset[role=listbox][aria-multiselectable=true] [role=option].active.sg-highlighted input[type=checkbox]~i{border-color:#007ac7!important;box-shadow:0 0 .25em .0625em #41b0ee;outline-color:transparent;outline-style:solid}:host .gds-dropdown__options{padding-left:0;margin-bottom:0;margin-top:0;display:flex;flex-direction:column;list-style:none;display:none}:host .gds-dropdown__options>li{padding-bottom:.5rem;padding-top:.5rem;border:0;display:block;position:relative}:host .gds-dropdown__options>li:before{font-weight:500;display:inline-block;left:0;position:absolute;text-align:center}:host .gds-dropdown__options-expanded{display:block}:host .gds-dropdown__options__label:hover,:host .gds-dropdown__options__label:focus-visible{background-color:var(--grey-400)}:host .gds-dropdown__options__label:active{background-color:var(--grey-500)}:host .gds-dropdown__options__label:focus-visible{outline-color:#000;outline-offset:-.25rem}:host .gds-dropdown__options__label[aria-hidden=true]{display:none}:host .gds-dropdown__options__label[highlighted]{color:#fff}\n"] }]
1327
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1328
+ type: SkipSelf
1329
+ }, {
1330
+ type: Optional
1331
+ }, {
1332
+ type: Inject,
1333
+ args: [TRANSLOCO_SCOPE]
1334
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { hostComponent: [{
1335
+ type: Input
1336
+ }], resultFormatter: [{
1337
+ type: Input
1338
+ }], selectedFormatter: [{
1339
+ type: Input
1340
+ }] } });
1341
+
1342
+ class NgvTypeaheadModule {
1343
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1344
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, declarations: [NgvTypeaheadHighlightComponent,
1345
+ NgvTypeaheadInputComponent,
1346
+ NgvTypeaheadDropdownListComponent], imports: [CommonModule, NgvTooltipModule$1], exports: [NgvTypeaheadHighlightComponent,
1347
+ NgvTypeaheadInputComponent,
1348
+ NgvTypeaheadDropdownListComponent] }); }
1349
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, imports: [CommonModule, NgvTooltipModule$1] }); }
1350
+ }
1351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, decorators: [{
1352
+ type: NgModule,
1353
+ args: [{
1354
+ declarations: [
1355
+ NgvTypeaheadHighlightComponent,
1356
+ NgvTypeaheadInputComponent,
1357
+ NgvTypeaheadDropdownListComponent,
1358
+ ],
1359
+ imports: [CommonModule, NgvTooltipModule$1],
1360
+ exports: [
1361
+ NgvTypeaheadHighlightComponent,
1362
+ NgvTypeaheadInputComponent,
1363
+ NgvTypeaheadDropdownListComponent,
1364
+ ],
1365
+ }]
1366
+ }] });
1367
+
1368
+ class NgvDropdownModule {
1369
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1370
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, declarations: [NgvDropdownComponent, NgvDropdownListComponent], imports: [CommonModule, NgvTypeaheadModule, NgvTooltipModule$1, NgvI18nModule$1], exports: [NgvDropdownComponent, NgvDropdownListComponent] }); }
1371
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, imports: [CommonModule, NgvTypeaheadModule, NgvTooltipModule$1, NgvI18nModule$1] }); }
1372
+ }
1373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, decorators: [{
1374
+ type: NgModule,
1375
+ args: [{
1376
+ declarations: [NgvDropdownComponent, NgvDropdownListComponent],
1377
+ imports: [CommonModule, NgvTypeaheadModule, NgvTooltipModule$1, NgvI18nModule$1],
1378
+ exports: [NgvDropdownComponent, NgvDropdownListComponent],
1379
+ }]
1380
+ }] });
1381
+
1382
+ class NgvTypeaheadDirective {
1383
+ /** Function that filter the inputvalue */
1384
+ set ngvTypeahead(value) {
1385
+ this.typeaheadFunction = value;
1386
+ // If inputsubscription already exists, unsubscribe and subscribe again
1387
+ if (this.inputSubscription$) {
1388
+ this.inputSubscription$?.unsubscribe();
1389
+ this.inputSubscription$ = undefined;
1390
+ this.handleInputChanges();
1391
+ }
1392
+ }
1393
+ /** Forward text inputs to apply the filter function*/
1394
+ onNgvInput(event) {
1395
+ this.inputValue$.next(event);
1396
+ }
1397
+ /** Helper to the determine if the host is nggv-drodpown or nggv-input*/
1398
+ get hostIsDropdown() {
1399
+ return !!this.hostDropdown;
1400
+ }
1401
+ /** Predefined options */
1402
+ get defaultNullishOption() {
1403
+ return { key: null, label: this.unselectLabel || '\u00A0' };
1404
+ }
1405
+ get emptyOption() {
1406
+ return { key: null, label: 'label.nomatchingoptions', disabled: true };
1407
+ }
1408
+ /** Name of the component. nggv-dropdown if NgvDropdownComponent or nggv-input if NgvInputComponent */
1409
+ get localName() {
1410
+ return this.element.nativeElement.localName;
1411
+ }
1412
+ constructor(viewContainerRef, element, hostDropdown, hostInput) {
1413
+ this.viewContainerRef = viewContainerRef;
1414
+ this.element = element;
1415
+ this.hostDropdown = hostDropdown;
1416
+ this.hostInput = hostInput;
1417
+ /** Allow option to be unselected in the dropdown even if it is required. Defaults to true */
1418
+ this.allowUnselect = true;
1419
+ /** Emits the entered string the user has written in the input */
1420
+ this.filterPhraseChange = new EventEmitter();
1421
+ this.inputValue$ = new Subject();
1422
+ this.onDestroy$ = new Subject();
1423
+ }
1424
+ ngOnInit() {
1425
+ this.handleInputChanges();
1426
+ this.inputValue$.next('');
1427
+ if (this.hostIsDropdown)
1428
+ this.createInput();
1429
+ else
1430
+ this.createDropdownList();
1431
+ }
1432
+ ngOnDestroy() {
1433
+ this.onDestroy$.next(true);
1434
+ this.onDestroy$.complete();
1435
+ }
1436
+ /**
1437
+ * @internal
1438
+ * Core functionality of typeahead. Emits input, then filters the result based on the supplied function
1439
+ * If directive is applied on nggv-input, manually show or hide options in the list.
1440
+ * If directive is applied on nggv-dropdown, let the dropdown itself choose when to open or close
1441
+ */
1442
+ handleInputChanges() {
1443
+ this.inputSubscription$ = this.inputValue$
1444
+ .pipe(takeUntil$1(this.onDestroy$), distinctUntilChanged(), tap((inputValue) => this.filterPhraseChange.emit(inputValue)), this.typeaheadFunction ? this.typeaheadFunction : () => from([]), withLatestFrom(this.inputValue$))
1445
+ .subscribe(([filteredValues, input]) => this.setOptions(filteredValues, input));
1446
+ }
1447
+ /**
1448
+ * @internal
1449
+ * Creates a nggv-input if the host itself is not a text-input
1450
+ * Set styles to not display the input when closed
1451
+ * Trigger filtering when changes occur in the field
1452
+ * */
1453
+ createInput() {
1454
+ // Create the input component
1455
+ this.inputComponent = this.viewContainerRef.createComponent(NgvTypeaheadInputComponent);
1456
+ // Forward necessary info to component
1457
+ this.inputComponent.setInput('hostComponent', this.hostDropdown);
1458
+ this.inputComponent.setInput('selectedFormatter', this.selectedFormatter);
1459
+ this.inputComponent.setInput('resultFormatter', this.resultFormatter);
1460
+ // Listen to value changes
1461
+ this.inputComponent.instance.ngvInput
1462
+ .pipe(takeUntil$1(this.onDestroy$))
1463
+ .subscribe((inputValue) => this.inputValue$.next(inputValue));
1464
+ }
1465
+ /** @internal Creates a nggv-dropdown-list if the host itself is a nggv-input */
1466
+ createDropdownList() {
1467
+ this.dropdownListComponent = this.viewContainerRef.createComponent(NgvTypeaheadDropdownListComponent);
1468
+ this.dropdownListComponent.setInput('hostComponent', this.hostInput);
1469
+ }
1470
+ /**
1471
+ * @internal Sets the options the user can select.
1472
+ * If the host is a nggv-dropdown, utilize the dropdown itself to display the options
1473
+ * If the host is a nggv-input, use the created nggv-dropdown-list to displaye the options
1474
+ * @param filteredValues The options to display in the dropdown
1475
+ * @param emptyInput If the input is empty
1476
+ */
1477
+ setOptions(filteredValues, input) {
1478
+ if (!filteredValues)
1479
+ return;
1480
+ // Conditionally add empty or nullish option if it's allowed, the input is empty and does not already contain nullish
1481
+ const allowNullish = this.allowUnselect &&
1482
+ !input &&
1483
+ !(Object.keys(filteredValues[0]).includes('key') &&
1484
+ filteredValues[0].key == null);
1485
+ if (filteredValues.length === 0) {
1486
+ filteredValues = [this.emptyOption];
1487
+ }
1488
+ else if (allowNullish) {
1489
+ filteredValues = [this.defaultNullishOption].concat(filteredValues);
1490
+ }
1491
+ if (this.hostIsDropdown) {
1492
+ // Add nullish option when no input is written (or when dropdown is epanded and has a selection)
1493
+ this.hostDropdown.allowControlNullishOption = false;
1494
+ this.hostDropdown.options = this.formatOptions(filteredValues);
1495
+ this.hostDropdown.textToHighlight = `${input || ''}`;
1496
+ this.hostDropdown.detectChanges();
1497
+ return;
1498
+ }
1499
+ if (!this.hostIsDropdown) {
1500
+ this.dropdownListComponent.setInput('options', this.formatOptions(filteredValues));
1501
+ this.dropdownListComponent.setInput('textToHighlight', `${input || ''}`);
1502
+ }
1503
+ }
1504
+ /**
1505
+ * @internal Formats the available options to display in the dropdown list
1506
+ * @param options The selected value
1507
+ * @returns The formatted value
1508
+ */
1509
+ formatOptions(options) {
1510
+ if (!options)
1511
+ return [];
1512
+ if (!this.resultFormatter)
1513
+ return options;
1514
+ return options.map((value) => value?.label ? this.resultFormatter?.(value) : value);
1515
+ }
1516
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: NgvDropdownComponent, host: true, optional: true }, { token: i2$3.NgvInputComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
1517
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvTypeaheadDirective, isStandalone: true, selector: "nggv-input[ngvTypeahead]", inputs: { ngvTypeahead: "ngvTypeahead", resultFormatter: "resultFormatter", selectedFormatter: "selectedFormatter", allowUnselect: "allowUnselect", unselectLabel: "unselectLabel" }, outputs: { filterPhraseChange: "filterPhraseChange" }, host: { listeners: { "ngvInput": "onNgvInput($event)" } }, ngImport: i0 }); }
1518
+ }
1519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadDirective, decorators: [{
1520
+ type: Directive,
1521
+ args: [{
1522
+ selector: 'nggv-input[ngvTypeahead]',
1523
+ standalone: true,
1524
+ }]
1525
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: NgvDropdownComponent, decorators: [{
1526
+ type: Optional
1527
+ }, {
1528
+ type: Host
1529
+ }] }, { type: i2$3.NgvInputComponent, decorators: [{
1530
+ type: Optional
1531
+ }, {
1532
+ type: Host
1533
+ }] }]; }, propDecorators: { ngvTypeahead: [{
1534
+ type: Input
1535
+ }], resultFormatter: [{
1536
+ type: Input
1537
+ }], selectedFormatter: [{
1538
+ type: Input
1539
+ }], allowUnselect: [{
1540
+ type: Input
1541
+ }], unselectLabel: [{
1542
+ type: Input
1543
+ }], filterPhraseChange: [{
1544
+ type: Output
1545
+ }], onNgvInput: [{
1546
+ type: HostListener,
1547
+ args: ['ngvInput', ['$event']]
1548
+ }] } });
1549
+
1550
+ var button_cancel = "Cancel";
1551
+ var button_apply = "Apply";
1552
+ var button_save = "Save";
1553
+ var text_dialogue = "You can supply the content seen here either through the <code>[content]=\"string\"</code> property or</br>by passing children between the opening and closing tags <code>&lt;c-dialog&gt; ...children &lt;/c-dialog&gt;</code>";
1554
+ var defaultLang = {
1555
+ "error.fieldinputmask": "Invalid value pattern",
1556
+ "error.fieldrequired": "Field must have content",
1557
+ "error.fieldmaxlength": "Field content should not be longer than {{requiredLength}} characters",
1558
+ "label.defaultlabel": "Label",
1559
+ "label.maxlength": "characters left",
1560
+ "label.optional": "Optional",
1561
+ button_cancel: button_cancel,
1562
+ button_apply: button_apply,
1563
+ button_save: button_save,
1564
+ text_dialogue: text_dialogue
1565
+ };
1566
+
1567
+ class NgvMissingHandler {
1568
+ constructor(transpiler) {
1569
+ this.transpiler = transpiler;
1570
+ }
1571
+ handle(key, _, params) {
1572
+ const keyWithoutLocale = key.charAt(2) === '.' ? key.substring(3) : key;
1573
+ const withoutScope = keyWithoutLocale.replace(/^((?:\w+)(?<!label|heading|button|alt|link|title|href|fieldhelp|error|text|image|list)(?:\.))/, '');
1574
+ const transpiledKey = this.transpiler.transpile(defaultLang[keyWithoutLocale], params, {}, keyWithoutLocale);
1575
+ return transpiledKey || withoutScope;
1576
+ }
1577
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvMissingHandler, deps: [{ token: TRANSLOCO_TRANSPILER }], target: i0.ɵɵFactoryTarget.Injectable }); }
1578
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvMissingHandler }); }
1579
+ }
1580
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvMissingHandler, decorators: [{
1581
+ type: Injectable
1582
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1583
+ type: Inject,
1584
+ args: [TRANSLOCO_TRANSPILER]
1585
+ }] }]; } });
1586
+ const en = {
1587
+ 'error.fieldinputmask': 'Invalid value pattern',
1588
+ 'error.fieldrequired': 'Field must have content',
1589
+ 'error.fieldmaxlength': 'Field content should not be longer than {{requiredLength}} characters',
1590
+ 'label.defaultlabel': 'Label',
1591
+ 'label.maxlength': 'characters left',
1592
+ 'label.optional': 'Optional',
1593
+ };
1594
+ const sv = {
1595
+ 'error.fieldinputmask': 'Icke giltigt tecken mönster',
1596
+ 'error.fieldrequired': 'Fältet får inte lämnas tomt',
1597
+ 'error.fieldmaxlength': 'Fältinnehållet måste vara längre än {{requiredLength}} tecken',
1598
+ 'label.maxlength': 'tecken kvar',
1599
+ };
1600
+ class TranslocoInlineLoader {
1601
+ getTranslation(lang) {
1602
+ if (lang === 'sv') {
1603
+ return lastValueFrom(of(sv).pipe(delay(1500)));
1604
+ }
1605
+ return lastValueFrom(of(en).pipe(delay(500)));
1606
+ }
1607
+ }
1608
+ class NgvI18nModule {
1609
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1610
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, exports: [TranslocoModule] }); }
1611
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, providers: [
1612
+ provideTransloco({
1613
+ config: {
1614
+ availableLangs: ['en', 'sv'],
1615
+ defaultLang: 'en',
1616
+ // Remove this option if your application doesn't support changing language in runtime.
1617
+ reRenderOnLangChange: true,
1618
+ prodMode: !isDevMode(),
1619
+ },
1620
+ loader: TranslocoInlineLoader,
1621
+ }),
1622
+ provideTranslocoMissingHandler(NgvMissingHandler),
1623
+ ], imports: [TranslocoModule] }); }
1624
+ }
1625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, decorators: [{
1626
+ type: NgModule,
1627
+ args: [{
1628
+ providers: [
1629
+ provideTransloco({
1630
+ config: {
1631
+ availableLangs: ['en', 'sv'],
1632
+ defaultLang: 'en',
1633
+ // Remove this option if your application doesn't support changing language in runtime.
1634
+ reRenderOnLangChange: true,
1635
+ prodMode: !isDevMode(),
1636
+ },
1637
+ loader: TranslocoInlineLoader,
1638
+ }),
1639
+ provideTranslocoMissingHandler(NgvMissingHandler),
1640
+ ],
1641
+ exports: [TranslocoModule],
1642
+ }]
1643
+ }] });
1644
+
1645
+ class TranslocoMockPipe {
1646
+ constructor() {
1647
+ this.transform = (value) => value;
1648
+ }
1649
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslocoMockPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1650
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TranslocoMockPipe, name: "transloco" }); }
1651
+ }
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslocoMockPipe, decorators: [{
1653
+ type: Pipe,
1654
+ args: [{ name: 'transloco' }]
1655
+ }] });
1656
+ class TranslocoMockTranspiler {
1657
+ constructor() {
1658
+ this.transpile = (..._args) => '';
1659
+ }
1660
+ }
1661
+ class TranslocoMockMissingHandler {
1662
+ constructor() {
1663
+ this.handle = (key, _, _params) => key;
1664
+ }
1665
+ }
1666
+ class TranslocoMockStrategy {
1667
+ constructor() {
1668
+ this.getNextLangs = (_failedLang) => '';
1669
+ }
1670
+ }
1671
+ class TranslocoMockInterceptor {
1672
+ preSaveTranslation(translation, _lang) {
1673
+ return translation;
1674
+ }
1675
+ preSaveTranslationKey(_key, value, _lang) {
1676
+ return value;
1677
+ }
1678
+ }
1679
+ class NgvI18nTestModule {
1680
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1681
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, declarations: [TranslocoMockPipe], imports: [CommonModule], exports: [TranslocoMockPipe] }); }
1682
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, providers: [
1683
+ {
1684
+ provide: TRANSLOCO_TRANSPILER,
1685
+ useClass: TranslocoMockTranspiler,
1686
+ },
1687
+ {
1688
+ provide: TRANSLOCO_INTERCEPTOR,
1689
+ useClass: TranslocoMockInterceptor,
1690
+ },
1691
+ {
1692
+ provide: TRANSLOCO_FALLBACK_STRATEGY,
1693
+ useClass: TranslocoMockStrategy,
1694
+ },
1695
+ {
1696
+ provide: TRANSLOCO_MISSING_HANDLER,
1697
+ useClass: TranslocoMockMissingHandler,
1698
+ deps: [TRANSLOCO_TRANSPILER],
1699
+ },
1700
+ ], imports: [CommonModule] }); }
1701
+ }
1702
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, decorators: [{
1703
+ type: NgModule,
1704
+ args: [{
1705
+ imports: [CommonModule],
1706
+ declarations: [TranslocoMockPipe],
1707
+ exports: [TranslocoMockPipe],
1708
+ providers: [
1709
+ {
1710
+ provide: TRANSLOCO_TRANSPILER,
1711
+ useClass: TranslocoMockTranspiler,
1712
+ },
1713
+ {
1714
+ provide: TRANSLOCO_INTERCEPTOR,
1715
+ useClass: TranslocoMockInterceptor,
1716
+ },
1717
+ {
1718
+ provide: TRANSLOCO_FALLBACK_STRATEGY,
1719
+ useClass: TranslocoMockStrategy,
1720
+ },
1721
+ {
1722
+ provide: TRANSLOCO_MISSING_HANDLER,
1723
+ useClass: TranslocoMockMissingHandler,
1724
+ deps: [TRANSLOCO_TRANSPILER],
1725
+ },
1726
+ ],
1727
+ }]
1728
+ }] });
1729
+
1730
+ /**
1731
+ * A button that will present an explanation to a problem/question.
1732
+ * https://designlibrary.sebgroup.com/components/component-contextual-help-button
1733
+ */
1734
+ class NgvInfoCircleComponent {
1735
+ constructor() {
1736
+ /** Special property used for selecting DOM elements during automated UI testing. */
1737
+ this.thook = 'info';
1738
+ }
1739
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1740
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvInfoCircleComponent, selector: "nggv-info-circle", inputs: { thook: "thook", info: "info" }, host: { properties: { "attr.data-thook": "this.thook" } }, ngImport: i0, template: "<svg [ngvTooltip]=\"info\">\n <path\n d=\"M10.75 11H12L12 16.25M21.25 12C21.25 17.1086 17.1086 21.25 12 21.25C6.89137 21.25 2.75 17.1086 2.75 12C2.75 6.89137 6.89137 2.75 12 2.75C17.1086 2.75 21.25 6.89137 21.25 12Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n />\n <path\n d=\"M11.375 8C11.375 8.34518 11.6548 8.625 12 8.625C12.3452 8.625 12.625 8.34518 12.625 8C12.625 7.65482 12.3452 7.375 12 7.375C11.6548 7.375 11.375 7.65482 11.375 8Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n stroke-width=\"0.25\"\n />\n</svg>\n", styles: [":host{display:block}svg{display:block;width:1.5rem;height:1.5rem}.gds-tooltip{background-color:#1a1a1a;color:#fff;font-size:.875rem;font-weight:400;line-height:1.5;padding:.5rem;pointer-events:none}.gds-tooltip__arrow-top{position:absolute;width:0;height:0;border:.5rem solid transparent;bottom:-1rem;left:50%;transform:translate(-50%);border-color:#1a1a1a transparent transparent}.gds-tooltip__arrow-bottom{position:absolute;width:0;height:0;border:.5rem solid transparent;top:-1rem;left:50%;transform:translate(-50%);border-color:transparent transparent #1a1a1a}.gds-tooltip__arrow-left{position:absolute;width:0;height:0;border:.5rem solid transparent;right:-1rem;top:50%;transform:translateY(-50%);border-color:transparent transparent transparent #1a1a1a}.gds-tooltip__arrow-right{position:absolute;width:0;height:0;border:.5rem solid transparent;left:-1rem;top:50%;transform:translateY(-50%);border-color:transparent #1a1a1a transparent transparent}\n"], dependencies: [{ kind: "directive", type: i3$2.NgvTooltipDirective, selector: "[ngvTooltip]", inputs: ["ngvTooltip", "thook", "placement", "shown", "offset", "resizeThrottle", "maxWidth"], outputs: ["ngvShow", "ngvHide"] }] }); }
1741
+ }
1742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleComponent, decorators: [{
1743
+ type: Component,
1744
+ args: [{ selector: 'nggv-info-circle', template: "<svg [ngvTooltip]=\"info\">\n <path\n d=\"M10.75 11H12L12 16.25M21.25 12C21.25 17.1086 17.1086 21.25 12 21.25C6.89137 21.25 2.75 17.1086 2.75 12C2.75 6.89137 6.89137 2.75 12 2.75C17.1086 2.75 21.25 6.89137 21.25 12Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n />\n <path\n d=\"M11.375 8C11.375 8.34518 11.6548 8.625 12 8.625C12.3452 8.625 12.625 8.34518 12.625 8C12.625 7.65482 12.3452 7.375 12 7.375C11.6548 7.375 11.375 7.65482 11.375 8Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n stroke-width=\"0.25\"\n />\n</svg>\n", styles: [":host{display:block}svg{display:block;width:1.5rem;height:1.5rem}.gds-tooltip{background-color:#1a1a1a;color:#fff;font-size:.875rem;font-weight:400;line-height:1.5;padding:.5rem;pointer-events:none}.gds-tooltip__arrow-top{position:absolute;width:0;height:0;border:.5rem solid transparent;bottom:-1rem;left:50%;transform:translate(-50%);border-color:#1a1a1a transparent transparent}.gds-tooltip__arrow-bottom{position:absolute;width:0;height:0;border:.5rem solid transparent;top:-1rem;left:50%;transform:translate(-50%);border-color:transparent transparent #1a1a1a}.gds-tooltip__arrow-left{position:absolute;width:0;height:0;border:.5rem solid transparent;right:-1rem;top:50%;transform:translateY(-50%);border-color:transparent transparent transparent #1a1a1a}.gds-tooltip__arrow-right{position:absolute;width:0;height:0;border:.5rem solid transparent;left:-1rem;top:50%;transform:translateY(-50%);border-color:transparent #1a1a1a transparent transparent}\n"] }]
1745
+ }], propDecorators: { thook: [{
1746
+ type: HostBinding,
1747
+ args: ['attr.data-thook']
1748
+ }, {
1749
+ type: Input
1750
+ }], info: [{
1751
+ type: Input
1752
+ }] } });
1753
+
1754
+ class NgvInfoCircleModule {
1755
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1756
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, declarations: [NgvInfoCircleComponent], imports: [CommonModule, NggCoreWrapperModule, NgvTooltipModule$1], exports: [NgvInfoCircleComponent] }); }
1757
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, imports: [CommonModule, NggCoreWrapperModule, NgvTooltipModule$1] }); }
1758
+ }
1759
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, decorators: [{
1760
+ type: NgModule,
1761
+ args: [{
1762
+ declarations: [NgvInfoCircleComponent],
1763
+ imports: [CommonModule, NggCoreWrapperModule, NgvTooltipModule$1],
1764
+ exports: [NgvInfoCircleComponent],
1765
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
1766
+ }]
1767
+ }] });
1768
+
1769
+ /**
1770
+ * Input fields allow users to add and edit text.
1771
+ * https://designlibrary.sebgroup.com/components/component-input
1772
+ */
1773
+ class NgvInputComponent extends NgvBaseControlValueAccessorComponent$1 {
1774
+ /** Minimum length (number of characters) of value. */
1775
+ set minLength(length) {
1776
+ this._minlength = length;
1777
+ }
1778
+ /**
1779
+ * Minimum length (number of characters) of value.
1780
+ * @deprecated minlength triggers angular-template-validation. Use @Input() minLength instead.
1781
+ */
1782
+ set minlength(length) {
1783
+ this._minlength = length;
1784
+ }
1785
+ get minlength() {
1786
+ return this._minlength;
1787
+ }
1788
+ /** Maximum length (number of characters) of value. */
1789
+ set maxLength(length) {
1790
+ this._maxlength = length;
1791
+ this.writeValue(this.state);
1792
+ }
1793
+ get maxlength() {
1794
+ return this._maxlength;
1795
+ }
1796
+ /**
1797
+ * Maximum length (number of characters) of value.
1798
+ * @deprecated maxlength triggers angular-template-validation. Use @Input() maxLength instead.
1799
+ */
1800
+ set maxlength(length) {
1801
+ this._maxlength = length;
1802
+ this.writeValue(this.state);
1803
+ }
1804
+ set showCharacterCountdown(option) {
1805
+ this._showCharacterCountDown = option;
1806
+ }
1807
+ get showCharacterCountdown() {
1808
+ return this._showCharacterCountDown && this.hasMaxLength;
1809
+ }
1810
+ set inputMask(newInputMask) {
1811
+ // Hide input field
1812
+ this.hideInput$.next(true);
1813
+ this.cdr.detectChanges();
1814
+ this._inputMask = newInputMask;
1815
+ // Show input field to reload input-mask settings upon update
1816
+ setTimeout(() => {
1817
+ this.hideInput$.next(false);
1818
+ this.cdr.detectChanges();
1819
+ }, 200);
1820
+ }
1821
+ get inputMask() {
1822
+ return this._inputMask;
1823
+ }
1824
+ get control() {
1825
+ return this.ngControl?.control ?? this._formControl;
1826
+ }
1827
+ /** Returns if maxlength is used */
1828
+ get hasMaxLength() {
1829
+ return !!this.maxlength && this.maxlength !== Number.MAX_SAFE_INTEGER;
1830
+ }
1831
+ constructor(ngControl, translocoScope, cdr) {
1832
+ super(ngControl, translocoScope, cdr);
1833
+ this.ngControl = ngControl;
1834
+ this.translocoScope = translocoScope;
1835
+ this.cdr = cdr;
1836
+ /** Adding .gds-form-item as a class to host element */
1837
+ this.class = 'gds-form-item';
1838
+ /** Special property used for selecting DOM elements during automated UI testing. */
1839
+ this.thook = 'input';
1840
+ /** Type of input field. Should avoid types that modify field too much such as range. */
1841
+ this.type = 'text';
1842
+ /** If set to "on", hint for form autofill feature. */
1843
+ this.autocomplete = 'on';
1844
+ /** If set to true, the value will not be editable. */
1845
+ this.readonly = false;
1846
+ /** If set to true, enables the Angular template-driven email validator. */
1847
+ this.email = false;
1848
+ /** Minimum value required for numeric input types. */
1849
+ this.min = 0;
1850
+ /** Maximum value required for numeric input types. */
1851
+ this.max = Number.MAX_SAFE_INTEGER;
1852
+ /** Incremental values that are valid for numeric input types. */
1853
+ this.step = 1;
1854
+ this._maxlength = Number.MAX_SAFE_INTEGER;
1855
+ this._minlength = 0;
1856
+ /** Wether to show label that tells how many characters are still left to be entered. Will only be set if maxLength is also set */
1857
+ this._showCharacterCountDown = true;
1858
+ /** Pattern the value must match to be valid. */
1859
+ this.pattern = '';
1860
+ /** Amount of time to wait until emitting (ngvINput) event */
1861
+ this.debounceTime = 500;
1862
+ /**
1863
+ * @deprecated
1864
+ * Text to put in badge
1865
+ */
1866
+ this.badgeText = '';
1867
+ /** Emits every time the value of the inner input field changes, independantly of updates on the formcontroller */
1868
+ this.ngvInput = new EventEmitter();
1869
+ this._formControl = new UntypedFormControl();
1870
+ /** Toggler for showing or hiding the input field */
1871
+ this.hideInput$ = new Subject();
1872
+ this.inputChange$ = new Subject();
1873
+ this._destroy$ = new Subject();
1874
+ }
1875
+ ngOnInit() {
1876
+ super.ngOnInit();
1877
+ this.inputChange$
1878
+ .pipe(takeUntil(this._destroy$), debounceTime(this.debounceTime))
1879
+ .subscribe((inputValue) => {
1880
+ this.ngvInput.emit(inputValue);
1881
+ });
1882
+ }
1883
+ ngOnDestroy() {
1884
+ this._destroy$.next(true);
1885
+ this._destroy$.complete();
1886
+ }
1887
+ writeValue(value) {
1888
+ // maxLength will only work with string values
1889
+ if (value?.length && value.length > this.maxlength) {
1890
+ // cut value to match max length
1891
+ this.state = this.cutTextAfterMaxLength(value);
1892
+ if (value.length !== this.state.length) {
1893
+ this.onChange(this.state);
1894
+ }
1895
+ // emit value
1896
+ }
1897
+ else {
1898
+ // update state
1899
+ this.state = value;
1900
+ }
1901
+ this.cdr.detectChanges();
1902
+ }
1903
+ cutTextAfterMaxLength(value) {
1904
+ if (typeof value === 'string') {
1905
+ return value.substring(0, this.maxlength);
1906
+ }
1907
+ return value;
1908
+ }
1909
+ /** @internal */
1910
+ onInput(event) {
1911
+ event.stopPropagation();
1912
+ if (this.disabled)
1913
+ return;
1914
+ this.state = event.target.value;
1915
+ this.onChange(this.state);
1916
+ this.inputChange$.next(this.state);
1917
+ }
1918
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1919
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvInputComponent, selector: "nggv-input", inputs: { thook: "thook", type: "type", placeholder: "placeholder", autocomplete: "autocomplete", readonly: "readonly", email: "email", min: "min", max: "max", step: "step", minLength: "minLength", minlength: "minlength", maxLength: "maxLength", maxlength: "maxlength", showCharacterCountdown: "showCharacterCountdown", pattern: "pattern", debounceTime: "debounceTime", badgeText: "badgeText", inputMask: "inputMask" }, outputs: { ngvInput: "ngvInput" }, host: { properties: { "class": "this.class", "attr.data-thook": "this.thook" } }, usesInheritance: true, ngImport: i0, template: "<!-- LABEL -->\n<label\n [id]=\"id + '-label'\"\n class=\"sdv-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n *transloco=\"let t; read: scope\"\n>\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n</label>\n\n<!-- DESCRIPTION -->\n<div class=\"form-info description hide-if-empty\">\n {{ description }}\n</div>\n\n<!-- LOCKED INPUT -->\n<ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n <ng-container *ngIf=\"!inputMask\">\n {{ state }}\n </ng-container>\n <ng-container *ngIf=\"!!inputMask\">\n {{ state | ngvInputMaskFormat: inputMask }}\n </ng-container>\n </ng-container>\n </div>\n</ng-container>\n\n<!-- INPUT WRAPPER -->\n<ng-container *ngIf=\"!locked\">\n <div class=\"gds-input-wrapper\" [class.nggv-field--error]=\"invalid\">\n <div class=\"input-group-prefix hide-if-empty\">\n <ng-content select=\"[slot='prefix']\"></ng-content>\n </div>\n\n <!-- INPUT FIELD -->\n <div class=\"input-group\" *ngIf=\"!inputMask\">\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"sdv-field\"\n [attr.type]=\"type\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [attr.email]=\"email\"\n [attr.aria-describedby]=\"id + '-message'\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [pattern]=\"pattern\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n [autofocus]=\"autofocus\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [value]=\"state\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n </div>\n\n <!-- INPUT FIELD WITH MASK -->\n <div\n class=\"input-group\"\n *ngIf=\"!!inputMask && (hideInput$ | async) === false\"\n >\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"sdv-field\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [attr.aria-describedby]=\"id + '-message'\"\n [ngvInputMask]=\"inputMask\"\n [formControl]=\"control\"\n />\n </div>\n\n <div class=\"input-group-suffix hide-if-empty\">\n <ng-content select=\"[slot='suffix']\"></ng-content>\n <ng-content></ng-content>\n </div>\n </div>\n\n <!-- ERRORS -->\n <div\n class=\"gds-form-item__footer error-wrapper\"\n *transloco=\"let t; read: scope\"\n >\n <span\n class=\"form-info form-info--error\"\n [attr.id]=\"id + '-message'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n\n <ng-container *ngIf=\"!inputMask && hasMaxLength && showCharacterCountdown\">\n <span\n *ngvCharacterCountdown=\"\n maxlength;\n currentLength: (inputRef?.nativeElement?.value ?? '').length;\n charactersLeft as charactersLeft\n \"\n class=\"form-info\"\n style=\"text-align: right\"\n >\n {{ charactersLeft }} {{ t('label.maxlength') }}\n </span>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host.gds-form-item{display:flex;flex-direction:column;max-width:100%;position:relative;width:100%;z-index:0}:host.gds-form-item:not(:last-child){margin-bottom:1.5rem}:host.gds-form-item .gds-form-item__header{display:flex}:host.gds-form-item .gds-form-item__header .form-info{font-weight:400}:host.gds-form-item .gds-form-item__header button.icon.small{margin-top:-.5rem;margin-right:-.5rem}:host.gds-form-item .gds-form-item__labels{flex:1;margin-bottom:.5rem}:host.gds-form-item .gds-form-item__labels .form-info{margin-bottom:0}:host.gds-form-item .gds-form-item__labels .form-info a:link:not(.button,[aria-disabled]){color:#0062bc}:host.gds-form-item .gds-form-item__labels>*{width:100%;display:block}:host.gds-form-item .gds-form-item__expandable-info{overflow:hidden;font-size:.875rem;line-height:1.25rem;transition:height .3s cubic-bezier(.23,1,.32,1)}:host.gds-form-item .gds-form-item__expandable-info>div{padding-bottom:.5rem}:host.gds-form-item .gds-form-item__backdrop{position:absolute;inset:0;background:var(--gds-ref-pallet-base100);border-radius:2px;z-index:-1;margin:-1rem;opacity:0;transition:all .3s cubic-bezier(.23,1,.32,1);border:1px solid transparent}@media (prefers-reduced-motion: reduce){:host.gds-form-item .gds-form-item__backdrop{transition:none}}:host.gds-form-item:has([aria-expanded=true]) .gds-form-item__backdrop{opacity:1;border-radius:.25rem;border-color:var(--gds-ref-pallet-base600)}:host.gds-form-item .gds-form-item__footer:not(:empty){margin-top:.5rem;display:flex;column-gap:1rem}:host.gds-form-item .gds-form-item__footer:not(:empty)>span{font-weight:500}:host .hide-if-empty:empty{display:none}:host input:not([type]),:host input[type=date],:host input[type=datetime],:host input[type=datetime-local],:host input[type=email],:host input[type=month],:host input[type=number],:host input[type=password],:host input[type=search],:host input[type=tel],:host input[type=text],:host input[type=time],:host input[type=url],:host input[type=week]{padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);background-color:var(--sg-form-control-bg);color:var(--sg-text-primary);min-height:2.75rem;display:flex;align-items:center;justify-content:center}:host input:not([type]):focus:not(:focus-visible),:host input[type=date]:focus:not(:focus-visible),:host input[type=datetime]:focus:not(:focus-visible),:host input[type=datetime-local]:focus:not(:focus-visible),:host input[type=email]:focus:not(:focus-visible),:host input[type=month]:focus:not(:focus-visible),:host input[type=number]:focus:not(:focus-visible),:host input[type=password]:focus:not(:focus-visible),:host input[type=search]:focus:not(:focus-visible),:host input[type=tel]:focus:not(:focus-visible),:host input[type=text]:focus:not(:focus-visible),:host input[type=time]:focus:not(:focus-visible),:host input[type=url]:focus:not(:focus-visible),:host input[type=week]:focus:not(:focus-visible){box-shadow:none;outline:0}:host input:not([type]):focus,:host input:not([type]):focus-visible,:host input[type=date]:focus,:host input[type=date]:focus-visible,:host input[type=datetime]:focus,:host input[type=datetime]:focus-visible,:host input[type=datetime-local]:focus,:host input[type=datetime-local]:focus-visible,:host input[type=email]:focus,:host input[type=email]:focus-visible,:host input[type=month]:focus,:host input[type=month]:focus-visible,:host input[type=number]:focus,:host input[type=number]:focus-visible,:host input[type=password]:focus,:host input[type=password]:focus-visible,:host input[type=search]:focus,:host input[type=search]:focus-visible,:host input[type=tel]:focus,:host input[type=tel]:focus-visible,:host input[type=text]:focus,:host input[type=text]:focus-visible,:host input[type=time]:focus,:host input[type=time]:focus-visible,:host input[type=url]:focus,:host input[type=url]:focus-visible,:host input[type=week]:focus,:host input[type=week]:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host input:not([type]).small,:host input[type=date].small,:host input[type=datetime].small,:host input[type=datetime-local].small,:host input[type=email].small,:host input[type=month].small,:host input[type=number].small,:host input[type=password].small,:host input[type=search].small,:host input[type=tel].small,:host input[type=text].small,:host input[type=time].small,:host input[type=url].small,:host input[type=week].small{min-height:2rem;padding:.25rem .75rem;line-height:1rem}@media screen and (-ms-high-contrast: active){:host input:not([type]),:host input[type=date],:host input[type=datetime],:host input[type=datetime-local],:host input[type=email],:host input[type=month],:host input[type=number],:host input[type=password],:host input[type=search],:host input[type=tel],:host input[type=text],:host input[type=time],:host input[type=url],:host input[type=week]{border:2px solid currentcolor}}:host input:not([type]):disabled,:host input:not([type]).disabled,:host input:not([type])[aria-disabled=true],:host input[type=date]:disabled,:host input[type=date].disabled,:host input[type=date][aria-disabled=true],:host input[type=datetime]:disabled,:host input[type=datetime].disabled,:host input[type=datetime][aria-disabled=true],:host input[type=datetime-local]:disabled,:host input[type=datetime-local].disabled,:host input[type=datetime-local][aria-disabled=true],:host input[type=email]:disabled,:host input[type=email].disabled,:host input[type=email][aria-disabled=true],:host input[type=month]:disabled,:host input[type=month].disabled,:host input[type=month][aria-disabled=true],:host input[type=number]:disabled,:host input[type=number].disabled,:host input[type=number][aria-disabled=true],:host input[type=password]:disabled,:host input[type=password].disabled,:host input[type=password][aria-disabled=true],:host input[type=search]:disabled,:host input[type=search].disabled,:host input[type=search][aria-disabled=true],:host input[type=tel]:disabled,:host input[type=tel].disabled,:host input[type=tel][aria-disabled=true],:host input[type=text]:disabled,:host input[type=text].disabled,:host input[type=text][aria-disabled=true],:host input[type=time]:disabled,:host input[type=time].disabled,:host input[type=time][aria-disabled=true],:host input[type=url]:disabled,:host input[type=url].disabled,:host input[type=url][aria-disabled=true],:host input[type=week]:disabled,:host input[type=week].disabled,:host input[type=week][aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host input:not([type]):disabled::placeholder,:host input:not([type]).disabled::placeholder,:host input:not([type])[aria-disabled=true]::placeholder,:host input[type=date]:disabled::placeholder,:host input[type=date].disabled::placeholder,:host input[type=date][aria-disabled=true]::placeholder,:host input[type=datetime]:disabled::placeholder,:host input[type=datetime].disabled::placeholder,:host input[type=datetime][aria-disabled=true]::placeholder,:host input[type=datetime-local]:disabled::placeholder,:host input[type=datetime-local].disabled::placeholder,:host input[type=datetime-local][aria-disabled=true]::placeholder,:host input[type=email]:disabled::placeholder,:host input[type=email].disabled::placeholder,:host input[type=email][aria-disabled=true]::placeholder,:host input[type=month]:disabled::placeholder,:host input[type=month].disabled::placeholder,:host input[type=month][aria-disabled=true]::placeholder,:host input[type=number]:disabled::placeholder,:host input[type=number].disabled::placeholder,:host input[type=number][aria-disabled=true]::placeholder,:host input[type=password]:disabled::placeholder,:host input[type=password].disabled::placeholder,:host input[type=password][aria-disabled=true]::placeholder,:host input[type=search]:disabled::placeholder,:host input[type=search].disabled::placeholder,:host input[type=search][aria-disabled=true]::placeholder,:host input[type=tel]:disabled::placeholder,:host input[type=tel].disabled::placeholder,:host input[type=tel][aria-disabled=true]::placeholder,:host input[type=text]:disabled::placeholder,:host input[type=text].disabled::placeholder,:host input[type=text][aria-disabled=true]::placeholder,:host input[type=time]:disabled::placeholder,:host input[type=time].disabled::placeholder,:host input[type=time][aria-disabled=true]::placeholder,:host input[type=url]:disabled::placeholder,:host input[type=url].disabled::placeholder,:host input[type=url][aria-disabled=true]::placeholder,:host input[type=week]:disabled::placeholder,:host input[type=week].disabled::placeholder,:host input[type=week][aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host input:not([type]):hover,:host input[type=date]:hover,:host input[type=datetime]:hover,:host input[type=datetime-local]:hover,:host input[type=email]:hover,:host input[type=month]:hover,:host input[type=number]:hover,:host input[type=password]:hover,:host input[type=search]:hover,:host input[type=tel]:hover,:host input[type=text]:hover,:host input[type=time]:hover,:host input[type=url]:hover,:host input[type=week]:hover{background-color:var(--gds-ref-pallet-base100)}:host input[type=number]{-moz-appearance:textfield}:host input[type=number]::-webkit-outer-spin-button,:host input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host input{width:100%}:host .gds-input-wrapper{display:flex;flex-direction:column;position:relative;transition:all .2s ease-in-out,outline-offset 0s,outline-width 0s}:host .gds-input-wrapper:before{background:transparent;border-radius:0 0 4px 4px;clip-path:inset(4px 0 0 0);content:\"\";display:block;height:4px;position:absolute;transition:.3s ease-in-out;width:100%}:host .gds-input-wrapper:before{bottom:0}.is-invalid :host .gds-input-wrapper{color:var(--intent-danger-background);opacity:1}.is-invalid :host .gds-input-wrapper:before{background:var(--intent-danger-background);clip-path:inset(1px 0 0 0)}:host label:is(label),:host .label:is(label),:host legend:is(label){margin-bottom:0}:host label.form-control,:host .label.form-control,:host legend.form-control{width:-moz-fit-content;width:fit-content}@supports (-moz-appearance: none){:host label.form-control:focus:not(:focus-visible),:host .label.form-control:focus:not(:focus-visible),:host legend.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host label.form-control:focus,:host label.form-control:focus-within,:host .label.form-control:focus,:host .label.form-control:focus-within,:host legend.form-control:focus,:host legend.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host label:not(.form-control),:host .label:not(.form-control),:host legend:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host label+input,:host label+textarea,fieldset :host label+div,:host label+button,:host label+.group-stepper,:host label+.stepper-wrapper,:host label+.group,:host .label+input,:host .label+textarea,fieldset :host .label+div,:host .label+button,:host .label+.group-stepper,:host .label+.stepper-wrapper,:host .label+.group,:host legend+input,:host legend+textarea,fieldset :host legend+div,:host legend+button,:host legend+.group-stepper,:host legend+.stepper-wrapper,:host legend+.group{margin-top:.5rem}:host label+.form-info,:host .label+.form-info,:host legend+.form-info{margin-bottom:.5rem}:host .form-info{font-size:.875rem;line-height:1.25rem;width:100%}:host .gds-form-item__footer .form-info{font-weight:500}:host .gds-form-item__footer .form-info--error{color:var(--intent-danger-background, #9f000a)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }, { kind: "directive", type: i4.NgvInputMaskDirective, selector: "[ngvInputMask]", inputs: ["ngvInputMask"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.InputMaskFormatPipe, name: "ngvInputMaskFormat" }] }); }
1920
+ }
1921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputComponent, decorators: [{
1922
+ type: Component,
1923
+ args: [{ selector: 'nggv-input', template: "<!-- LABEL -->\n<label\n [id]=\"id + '-label'\"\n class=\"sdv-field-label hide-if-empty\"\n [attr.for]=\"id + '-input'\"\n *transloco=\"let t; read: scope\"\n>\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n</label>\n\n<!-- DESCRIPTION -->\n<div class=\"form-info description hide-if-empty\">\n {{ description }}\n</div>\n\n<!-- LOCKED INPUT -->\n<ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-input'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n <ng-container *ngIf=\"!inputMask\">\n {{ state }}\n </ng-container>\n <ng-container *ngIf=\"!!inputMask\">\n {{ state | ngvInputMaskFormat: inputMask }}\n </ng-container>\n </ng-container>\n </div>\n</ng-container>\n\n<!-- INPUT WRAPPER -->\n<ng-container *ngIf=\"!locked\">\n <div class=\"gds-input-wrapper\" [class.nggv-field--error]=\"invalid\">\n <div class=\"input-group-prefix hide-if-empty\">\n <ng-content select=\"[slot='prefix']\"></ng-content>\n </div>\n\n <!-- INPUT FIELD -->\n <div class=\"input-group\" *ngIf=\"!inputMask\">\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"sdv-field\"\n [attr.type]=\"type\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [attr.email]=\"email\"\n [attr.aria-describedby]=\"id + '-message'\"\n [min]=\"min\"\n [max]=\"max\"\n [step]=\"step\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [pattern]=\"pattern\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n [autofocus]=\"autofocus\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [value]=\"state\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n </div>\n\n <!-- INPUT FIELD WITH MASK -->\n <div\n class=\"input-group\"\n *ngIf=\"!!inputMask && (hideInput$ | async) === false\"\n >\n <input\n #input\n [id]=\"id + '-input'\"\n class=\"sdv-field\"\n autocomplete=\"off\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [readOnly]=\"readonly\"\n [attr.role]=\"role\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [attr.aria-describedby]=\"id + '-message'\"\n [ngvInputMask]=\"inputMask\"\n [formControl]=\"control\"\n />\n </div>\n\n <div class=\"input-group-suffix hide-if-empty\">\n <ng-content select=\"[slot='suffix']\"></ng-content>\n <ng-content></ng-content>\n </div>\n </div>\n\n <!-- ERRORS -->\n <div\n class=\"gds-form-item__footer error-wrapper\"\n *transloco=\"let t; read: scope\"\n >\n <span\n class=\"form-info form-info--error\"\n [attr.id]=\"id + '-message'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </span>\n\n <ng-container *ngIf=\"!inputMask && hasMaxLength && showCharacterCountdown\">\n <span\n *ngvCharacterCountdown=\"\n maxlength;\n currentLength: (inputRef?.nativeElement?.value ?? '').length;\n charactersLeft as charactersLeft\n \"\n class=\"form-info\"\n style=\"text-align: right\"\n >\n {{ charactersLeft }} {{ t('label.maxlength') }}\n </span>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host.gds-form-item{display:flex;flex-direction:column;max-width:100%;position:relative;width:100%;z-index:0}:host.gds-form-item:not(:last-child){margin-bottom:1.5rem}:host.gds-form-item .gds-form-item__header{display:flex}:host.gds-form-item .gds-form-item__header .form-info{font-weight:400}:host.gds-form-item .gds-form-item__header button.icon.small{margin-top:-.5rem;margin-right:-.5rem}:host.gds-form-item .gds-form-item__labels{flex:1;margin-bottom:.5rem}:host.gds-form-item .gds-form-item__labels .form-info{margin-bottom:0}:host.gds-form-item .gds-form-item__labels .form-info a:link:not(.button,[aria-disabled]){color:#0062bc}:host.gds-form-item .gds-form-item__labels>*{width:100%;display:block}:host.gds-form-item .gds-form-item__expandable-info{overflow:hidden;font-size:.875rem;line-height:1.25rem;transition:height .3s cubic-bezier(.23,1,.32,1)}:host.gds-form-item .gds-form-item__expandable-info>div{padding-bottom:.5rem}:host.gds-form-item .gds-form-item__backdrop{position:absolute;inset:0;background:var(--gds-ref-pallet-base100);border-radius:2px;z-index:-1;margin:-1rem;opacity:0;transition:all .3s cubic-bezier(.23,1,.32,1);border:1px solid transparent}@media (prefers-reduced-motion: reduce){:host.gds-form-item .gds-form-item__backdrop{transition:none}}:host.gds-form-item:has([aria-expanded=true]) .gds-form-item__backdrop{opacity:1;border-radius:.25rem;border-color:var(--gds-ref-pallet-base600)}:host.gds-form-item .gds-form-item__footer:not(:empty){margin-top:.5rem;display:flex;column-gap:1rem}:host.gds-form-item .gds-form-item__footer:not(:empty)>span{font-weight:500}:host .hide-if-empty:empty{display:none}:host input:not([type]),:host input[type=date],:host input[type=datetime],:host input[type=datetime-local],:host input[type=email],:host input[type=month],:host input[type=number],:host input[type=password],:host input[type=search],:host input[type=tel],:host input[type=text],:host input[type=time],:host input[type=url],:host input[type=week]{padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);background-color:var(--sg-form-control-bg);color:var(--sg-text-primary);min-height:2.75rem;display:flex;align-items:center;justify-content:center}:host input:not([type]):focus:not(:focus-visible),:host input[type=date]:focus:not(:focus-visible),:host input[type=datetime]:focus:not(:focus-visible),:host input[type=datetime-local]:focus:not(:focus-visible),:host input[type=email]:focus:not(:focus-visible),:host input[type=month]:focus:not(:focus-visible),:host input[type=number]:focus:not(:focus-visible),:host input[type=password]:focus:not(:focus-visible),:host input[type=search]:focus:not(:focus-visible),:host input[type=tel]:focus:not(:focus-visible),:host input[type=text]:focus:not(:focus-visible),:host input[type=time]:focus:not(:focus-visible),:host input[type=url]:focus:not(:focus-visible),:host input[type=week]:focus:not(:focus-visible){box-shadow:none;outline:0}:host input:not([type]):focus,:host input:not([type]):focus-visible,:host input[type=date]:focus,:host input[type=date]:focus-visible,:host input[type=datetime]:focus,:host input[type=datetime]:focus-visible,:host input[type=datetime-local]:focus,:host input[type=datetime-local]:focus-visible,:host input[type=email]:focus,:host input[type=email]:focus-visible,:host input[type=month]:focus,:host input[type=month]:focus-visible,:host input[type=number]:focus,:host input[type=number]:focus-visible,:host input[type=password]:focus,:host input[type=password]:focus-visible,:host input[type=search]:focus,:host input[type=search]:focus-visible,:host input[type=tel]:focus,:host input[type=tel]:focus-visible,:host input[type=text]:focus,:host input[type=text]:focus-visible,:host input[type=time]:focus,:host input[type=time]:focus-visible,:host input[type=url]:focus,:host input[type=url]:focus-visible,:host input[type=week]:focus,:host input[type=week]:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host input:not([type]).small,:host input[type=date].small,:host input[type=datetime].small,:host input[type=datetime-local].small,:host input[type=email].small,:host input[type=month].small,:host input[type=number].small,:host input[type=password].small,:host input[type=search].small,:host input[type=tel].small,:host input[type=text].small,:host input[type=time].small,:host input[type=url].small,:host input[type=week].small{min-height:2rem;padding:.25rem .75rem;line-height:1rem}@media screen and (-ms-high-contrast: active){:host input:not([type]),:host input[type=date],:host input[type=datetime],:host input[type=datetime-local],:host input[type=email],:host input[type=month],:host input[type=number],:host input[type=password],:host input[type=search],:host input[type=tel],:host input[type=text],:host input[type=time],:host input[type=url],:host input[type=week]{border:2px solid currentcolor}}:host input:not([type]):disabled,:host input:not([type]).disabled,:host input:not([type])[aria-disabled=true],:host input[type=date]:disabled,:host input[type=date].disabled,:host input[type=date][aria-disabled=true],:host input[type=datetime]:disabled,:host input[type=datetime].disabled,:host input[type=datetime][aria-disabled=true],:host input[type=datetime-local]:disabled,:host input[type=datetime-local].disabled,:host input[type=datetime-local][aria-disabled=true],:host input[type=email]:disabled,:host input[type=email].disabled,:host input[type=email][aria-disabled=true],:host input[type=month]:disabled,:host input[type=month].disabled,:host input[type=month][aria-disabled=true],:host input[type=number]:disabled,:host input[type=number].disabled,:host input[type=number][aria-disabled=true],:host input[type=password]:disabled,:host input[type=password].disabled,:host input[type=password][aria-disabled=true],:host input[type=search]:disabled,:host input[type=search].disabled,:host input[type=search][aria-disabled=true],:host input[type=tel]:disabled,:host input[type=tel].disabled,:host input[type=tel][aria-disabled=true],:host input[type=text]:disabled,:host input[type=text].disabled,:host input[type=text][aria-disabled=true],:host input[type=time]:disabled,:host input[type=time].disabled,:host input[type=time][aria-disabled=true],:host input[type=url]:disabled,:host input[type=url].disabled,:host input[type=url][aria-disabled=true],:host input[type=week]:disabled,:host input[type=week].disabled,:host input[type=week][aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host input:not([type]):disabled::placeholder,:host input:not([type]).disabled::placeholder,:host input:not([type])[aria-disabled=true]::placeholder,:host input[type=date]:disabled::placeholder,:host input[type=date].disabled::placeholder,:host input[type=date][aria-disabled=true]::placeholder,:host input[type=datetime]:disabled::placeholder,:host input[type=datetime].disabled::placeholder,:host input[type=datetime][aria-disabled=true]::placeholder,:host input[type=datetime-local]:disabled::placeholder,:host input[type=datetime-local].disabled::placeholder,:host input[type=datetime-local][aria-disabled=true]::placeholder,:host input[type=email]:disabled::placeholder,:host input[type=email].disabled::placeholder,:host input[type=email][aria-disabled=true]::placeholder,:host input[type=month]:disabled::placeholder,:host input[type=month].disabled::placeholder,:host input[type=month][aria-disabled=true]::placeholder,:host input[type=number]:disabled::placeholder,:host input[type=number].disabled::placeholder,:host input[type=number][aria-disabled=true]::placeholder,:host input[type=password]:disabled::placeholder,:host input[type=password].disabled::placeholder,:host input[type=password][aria-disabled=true]::placeholder,:host input[type=search]:disabled::placeholder,:host input[type=search].disabled::placeholder,:host input[type=search][aria-disabled=true]::placeholder,:host input[type=tel]:disabled::placeholder,:host input[type=tel].disabled::placeholder,:host input[type=tel][aria-disabled=true]::placeholder,:host input[type=text]:disabled::placeholder,:host input[type=text].disabled::placeholder,:host input[type=text][aria-disabled=true]::placeholder,:host input[type=time]:disabled::placeholder,:host input[type=time].disabled::placeholder,:host input[type=time][aria-disabled=true]::placeholder,:host input[type=url]:disabled::placeholder,:host input[type=url].disabled::placeholder,:host input[type=url][aria-disabled=true]::placeholder,:host input[type=week]:disabled::placeholder,:host input[type=week].disabled::placeholder,:host input[type=week][aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host input:not([type]):hover,:host input[type=date]:hover,:host input[type=datetime]:hover,:host input[type=datetime-local]:hover,:host input[type=email]:hover,:host input[type=month]:hover,:host input[type=number]:hover,:host input[type=password]:hover,:host input[type=search]:hover,:host input[type=tel]:hover,:host input[type=text]:hover,:host input[type=time]:hover,:host input[type=url]:hover,:host input[type=week]:hover{background-color:var(--gds-ref-pallet-base100)}:host input[type=number]{-moz-appearance:textfield}:host input[type=number]::-webkit-outer-spin-button,:host input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host input{width:100%}:host .gds-input-wrapper{display:flex;flex-direction:column;position:relative;transition:all .2s ease-in-out,outline-offset 0s,outline-width 0s}:host .gds-input-wrapper:before{background:transparent;border-radius:0 0 4px 4px;clip-path:inset(4px 0 0 0);content:\"\";display:block;height:4px;position:absolute;transition:.3s ease-in-out;width:100%}:host .gds-input-wrapper:before{bottom:0}.is-invalid :host .gds-input-wrapper{color:var(--intent-danger-background);opacity:1}.is-invalid :host .gds-input-wrapper:before{background:var(--intent-danger-background);clip-path:inset(1px 0 0 0)}:host label:is(label),:host .label:is(label),:host legend:is(label){margin-bottom:0}:host label.form-control,:host .label.form-control,:host legend.form-control{width:-moz-fit-content;width:fit-content}@supports (-moz-appearance: none){:host label.form-control:focus:not(:focus-visible),:host .label.form-control:focus:not(:focus-visible),:host legend.form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host label.form-control:focus,:host label.form-control:focus-within,:host .label.form-control:focus,:host .label.form-control:focus-within,:host legend.form-control:focus,:host legend.form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host label:not(.form-control),:host .label:not(.form-control),:host legend:not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host label+input,:host label+textarea,fieldset :host label+div,:host label+button,:host label+.group-stepper,:host label+.stepper-wrapper,:host label+.group,:host .label+input,:host .label+textarea,fieldset :host .label+div,:host .label+button,:host .label+.group-stepper,:host .label+.stepper-wrapper,:host .label+.group,:host legend+input,:host legend+textarea,fieldset :host legend+div,:host legend+button,:host legend+.group-stepper,:host legend+.stepper-wrapper,:host legend+.group{margin-top:.5rem}:host label+.form-info,:host .label+.form-info,:host legend+.form-info{margin-bottom:.5rem}:host .form-info{font-size:.875rem;line-height:1.25rem;width:100%}:host .gds-form-item__footer .form-info{font-weight:500}:host .gds-form-item__footer .form-info--error{color:var(--intent-danger-background, #9f000a)}\n"] }]
1924
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
1925
+ type: Self
1926
+ }, {
1927
+ type: Optional
1928
+ }] }, { type: undefined, decorators: [{
1929
+ type: Optional
1930
+ }, {
1931
+ type: Inject,
1932
+ args: [TRANSLOCO_SCOPE]
1933
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { class: [{
1934
+ type: HostBinding,
1935
+ args: ['class']
1936
+ }], thook: [{
1937
+ type: HostBinding,
1938
+ args: ['attr.data-thook']
1939
+ }, {
1940
+ type: Input
1941
+ }], type: [{
1942
+ type: Input
1943
+ }], placeholder: [{
1944
+ type: Input
1945
+ }], autocomplete: [{
1946
+ type: Input
1947
+ }], readonly: [{
1948
+ type: Input
1949
+ }], email: [{
1950
+ type: Input
1951
+ }], min: [{
1952
+ type: Input
1953
+ }], max: [{
1954
+ type: Input
1955
+ }], step: [{
1956
+ type: Input
1957
+ }], minLength: [{
1958
+ type: Input
1959
+ }], minlength: [{
1960
+ type: Input
1961
+ }], maxLength: [{
1962
+ type: Input
1963
+ }], maxlength: [{
1964
+ type: Input
1965
+ }], showCharacterCountdown: [{
1966
+ type: Input
1967
+ }], pattern: [{
1968
+ type: Input
1969
+ }], debounceTime: [{
1970
+ type: Input
1971
+ }], badgeText: [{
1972
+ type: Input
1973
+ }], inputMask: [{
1974
+ type: Input
1975
+ }], ngvInput: [{
1976
+ type: Output
1977
+ }] } });
1978
+
1979
+ class NgvInputModule {
1980
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1981
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, declarations: [NgvInputComponent], imports: [CommonModule,
1982
+ NgvI18nModule$1,
1983
+ NgvInputMaskModule$1,
1984
+ ReactiveFormsModule], exports: [NgvInputComponent] }); }
1985
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, imports: [CommonModule,
1986
+ NgvI18nModule$1,
1987
+ NgvInputMaskModule$1,
1988
+ ReactiveFormsModule] }); }
1989
+ }
1990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, decorators: [{
1991
+ type: NgModule,
1992
+ args: [{
1993
+ declarations: [NgvInputComponent],
1994
+ imports: [
1995
+ CommonModule,
1996
+ NgvI18nModule$1,
1997
+ NgvInputMaskModule$1,
1998
+ ReactiveFormsModule,
1999
+ ],
2000
+ exports: [NgvInputComponent],
2001
+ }]
2002
+ }] });
2003
+
2004
+ const InputmaskStatic = _Inputmask.default || _Inputmask;
2005
+ class InputMaskFormatPipe {
2006
+ transform(value, options) {
2007
+ if (!value)
2008
+ return value;
2009
+ return InputmaskStatic.format(value, options);
2010
+ }
2011
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputMaskFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2012
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: InputMaskFormatPipe, name: "ngvInputMaskFormat" }); }
2013
+ }
2014
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputMaskFormatPipe, decorators: [{
2015
+ type: Pipe,
2016
+ args: [{
2017
+ name: 'ngvInputMaskFormat',
2018
+ }]
2019
+ }] });
2020
+
2021
+ class InputMaskConfig {
2022
+ constructor() {
2023
+ this.isAsync = false;
2024
+ this.inputSelector = 'input';
2025
+ }
2026
+ }
2027
+ const INPUT_MASK_CONFIG = new InjectionToken('InputMaskConfig');
2028
+
2029
+ const InputmaskConstructor = _Inputmask.default ||
2030
+ _Inputmask;
2031
+ class NgvInputMaskDirective {
2032
+ constructor(ngControl, config, platformId, elementRef, renderer, ngZone) {
2033
+ this.ngControl = ngControl;
2034
+ this.platformId = platformId;
2035
+ this.elementRef = elementRef;
2036
+ this.renderer = renderer;
2037
+ this.ngZone = ngZone;
2038
+ /** Input settings of directive */
2039
+ this.ngvInputMask = {};
2040
+ this.defaultInputMaskConfig = new InputMaskConfig();
2041
+ this.onInput = (_) => {
2042
+ // Empty method
2043
+ };
2044
+ this.onTouched = (_) => {
2045
+ // Empty method
2046
+ };
2047
+ this.validate = (control) => !control.value || !this.inputMaskPlugin || this.inputMaskPlugin.isValid()
2048
+ ? null
2049
+ : { invalidformat: true };
2050
+ if (this.ngControl) {
2051
+ this.ngControl.valueAccessor = this;
2052
+ }
2053
+ this.setNativeInputElement(config);
2054
+ }
2055
+ onKeyUp(event) {
2056
+ // Trigger "onInput" when pressing delete or backspace, when input is focused
2057
+ if (['Delete', 'Backspace'].includes(event.key)) {
2058
+ this.elementRef.nativeElement.dispatchEvent(new Event('input', {
2059
+ bubbles: true,
2060
+ cancelable: true,
2061
+ }));
2062
+ }
2063
+ }
2064
+ ngOnInit() {
2065
+ if (this.control) {
2066
+ this.control.setValidators(this.control.validator
2067
+ ? [this.control.validator, this.validate]
2068
+ : [this.validate]);
2069
+ this.control.updateValueAndValidity();
2070
+ }
2071
+ }
2072
+ ngOnDestroy() {
2073
+ this.inputMaskPlugin?.remove();
2074
+ this.mutationObserver?.disconnect();
2075
+ }
2076
+ initInputMask() {
2077
+ if (isPlatformServer(this.platformId) ||
2078
+ !this.nativeInputElement ||
2079
+ !Object.keys(this.ngvInputMask).length) {
2080
+ return;
2081
+ }
2082
+ this.inputMaskPlugin = this.ngZone.runOutsideAngular(() => new InputmaskConstructor(this.inputMaskOptions).mask(this.nativeInputElement));
2083
+ if (this.control) {
2084
+ setTimeout(() => {
2085
+ this.control.updateValueAndValidity();
2086
+ });
2087
+ }
2088
+ }
2089
+ ngAfterViewInit() {
2090
+ this.initInputMask();
2091
+ }
2092
+ get inputMaskOptions() {
2093
+ const { parser, ...options } = this.ngvInputMask;
2094
+ return options;
2095
+ }
2096
+ writeValue(value) {
2097
+ if (this.nativeInputElement) {
2098
+ this.renderer.setProperty(this.nativeInputElement, 'value', value ?? '');
2099
+ }
2100
+ }
2101
+ registerOnChange(fn) {
2102
+ // Use injected parser from settings to modify value
2103
+ // of users desire
2104
+ this.onInput = (value) => {
2105
+ const parser = this.ngvInputMask?.parser;
2106
+ const newValue = parser && value ? parser(value) : value;
2107
+ fn(newValue);
2108
+ };
2109
+ }
2110
+ registerOnTouched(fn) {
2111
+ this.onTouched = fn;
2112
+ }
2113
+ setDisabledState(disabled) {
2114
+ if (this.nativeInputElement) {
2115
+ this.renderer.setProperty(this.nativeInputElement, 'disabled', disabled);
2116
+ }
2117
+ }
2118
+ get control() {
2119
+ return this.ngControl?.control;
2120
+ }
2121
+ setNativeInputElement(config) {
2122
+ if (this.elementRef.nativeElement.tagName === 'INPUT') {
2123
+ this.nativeInputElement = this.elementRef.nativeElement;
2124
+ }
2125
+ else {
2126
+ this.defaultInputMaskConfig = {
2127
+ ...this.defaultInputMaskConfig,
2128
+ ...config,
2129
+ };
2130
+ if (this.defaultInputMaskConfig.isAsync) {
2131
+ // Create an observer instance linked to the callback function
2132
+ this.mutationObserver = new MutationObserver((mutationsList) => {
2133
+ for (const mutation of mutationsList) {
2134
+ if (mutation.type === 'childList') {
2135
+ const nativeInputElement = this.elementRef.nativeElement.querySelector(this.defaultInputMaskConfig.inputSelector);
2136
+ if (nativeInputElement) {
2137
+ this.nativeInputElement = nativeInputElement;
2138
+ this.mutationObserver?.disconnect();
2139
+ this.initInputMask();
2140
+ }
2141
+ }
2142
+ }
2143
+ });
2144
+ // Start observing the target node for configured mutations
2145
+ this.mutationObserver.observe(this.elementRef.nativeElement, {
2146
+ childList: true,
2147
+ subtree: true,
2148
+ });
2149
+ }
2150
+ else {
2151
+ this.nativeInputElement = this.elementRef.nativeElement.querySelector(this.defaultInputMaskConfig.inputSelector);
2152
+ }
2153
+ }
2154
+ }
2155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskDirective, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: INPUT_MASK_CONFIG }, { token: PLATFORM_ID }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
2156
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvInputMaskDirective, selector: "[ngvInputMask]", inputs: { ngvInputMask: "ngvInputMask" }, host: { listeners: { "input": "onInput($event.target.value)", "blur": "onTouched($event.target.value)", "keyup": "onKeyUp($event)" } }, ngImport: i0 }); }
2157
+ }
2158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskDirective, decorators: [{
2159
+ type: Directive,
2160
+ args: [{
2161
+ selector: '[ngvInputMask]',
2162
+ }]
2163
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2164
+ type: Optional
2165
+ }, {
2166
+ type: Self
2167
+ }] }, { type: InputMaskConfig, decorators: [{
2168
+ type: Inject,
2169
+ args: [INPUT_MASK_CONFIG]
2170
+ }] }, { type: undefined, decorators: [{
2171
+ type: Inject,
2172
+ args: [PLATFORM_ID]
2173
+ }] }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { ngvInputMask: [{
2174
+ type: Input
2175
+ }], onInput: [{
2176
+ type: HostListener,
2177
+ args: ['input', ['$event.target.value']]
2178
+ }], onTouched: [{
2179
+ type: HostListener,
2180
+ args: ['blur', ['$event.target.value']]
2181
+ }], onKeyUp: [{
2182
+ type: HostListener,
2183
+ args: ['keyup', ['$event']]
2184
+ }] } });
2185
+
2186
+ class NgvInputMaskModule {
2187
+ static forRoot(config) {
2188
+ return {
2189
+ ngModule: NgvInputMaskModule,
2190
+ providers: [{ provide: INPUT_MASK_CONFIG, useValue: config }],
2191
+ };
2192
+ }
2193
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2194
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, declarations: [NgvInputMaskDirective, InputMaskFormatPipe], exports: [NgvInputMaskDirective, InputMaskFormatPipe] }); }
2195
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, providers: [
2196
+ {
2197
+ provide: INPUT_MASK_CONFIG,
2198
+ useClass: InputMaskConfig,
2199
+ },
2200
+ ] }); }
2201
+ }
2202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, decorators: [{
2203
+ type: NgModule,
2204
+ args: [{
2205
+ declarations: [NgvInputMaskDirective, InputMaskFormatPipe],
2206
+ exports: [NgvInputMaskDirective, InputMaskFormatPipe],
2207
+ providers: [
2208
+ {
2209
+ provide: INPUT_MASK_CONFIG,
2210
+ useClass: InputMaskConfig,
2211
+ },
2212
+ ],
2213
+ }]
2214
+ }] });
2215
+
2216
+ const createMask = (options) => typeof options === 'string' ? { mask: options } : options;
2217
+
2218
+ ;
2219
+ (() => {
2220
+ // Make sure there is an incremental ID each component can use
2221
+ if (typeof window !== 'undefined' && !window.ngv) {
2222
+ window.ngv = {
2223
+ ids: { default: -1 },
2224
+ nextId(namespace = 'default') {
2225
+ let id = this.ids[namespace] || 0;
2226
+ if (typeof this.ids[namespace] === 'number')
2227
+ id++;
2228
+ this.ids[namespace] = id;
2229
+ return namespace === 'default'
2230
+ ? `nggv-${id}`
2231
+ : `nggv-${namespace}-${id}`;
2232
+ },
2233
+ };
2234
+ }
2235
+ })();
2236
+
2237
+ class NgvDialogComponent {
2238
+ constructor() {
2239
+ /** Special property used for selecting DOM elements during automated UI testing. */
2240
+ this.thook = 'dialog';
2241
+ /** @internal */
2242
+ this.baseClass = true;
2243
+ /** @internal Defines the default visibility state of the dialog. */
2244
+ this.shown = false;
2245
+ /** Defines the default visibility state of the dialog. */
2246
+ this.initiallyShown = false;
2247
+ /**
2248
+ * Sets modal title. Will be translated (using transloco) if the string matches a cms key.
2249
+ * @deprecated - use heading instead.
2250
+ */
2251
+ this.title = 'Attention';
2252
+ /** Defines if dialog should close on action. */
2253
+ this.autoClose = true;
2254
+ /** An array of event payloads that will be added to every click context menu item click. */
2255
+ this.payload = {};
2256
+ /** It gives an ability for parent component to control if modal should be closed on esc button click. */
2257
+ this.closeModalOnEscape = true;
2258
+ // /** @internal */
2259
+ // closeIcon = faTimes
2260
+ this.ngvCloseEvent = new EventEmitter();
2261
+ this.ngvPositiveEvent = new EventEmitter();
2262
+ this.ngvNeutralEvent = new EventEmitter();
2263
+ this.ngvNegativeEvent = new EventEmitter();
2264
+ }
2265
+ /** @internal */
2266
+ get ariaHidden() {
2267
+ return !this.shown;
2268
+ }
2269
+ /** Buttons are defined as a key-value pair where key is one of "positive|neutral|negative" and value is the button label. */
2270
+ set buttons(buttons) {
2271
+ this._buttons = buttons;
2272
+ }
2273
+ ngOnInit() {
2274
+ this.dialogTitleId =
2275
+ this.dialogTitleId ?? 'sdv-dialog-title-' + window.ngv?.nextId();
2276
+ this.dialogBodyId =
2277
+ this.dialogBodyId ?? 'sdv-dialog-body-' + window.ngv?.nextId();
2278
+ this.shown = this.initiallyShown;
2279
+ if (this.shown)
2280
+ this._limitFocusable();
2281
+ }
2282
+ onAction(event, action) {
2283
+ event.preventDefault();
2284
+ const emitEvent = {
2285
+ original: event,
2286
+ payload: this.payload,
2287
+ };
2288
+ switch (action) {
2289
+ case 'positive':
2290
+ this.ngvPositiveEvent.emit(emitEvent);
2291
+ break;
2292
+ case 'neutral':
2293
+ this.ngvNeutralEvent.emit(emitEvent);
2294
+ break;
2295
+ case 'negative':
2296
+ this.ngvNegativeEvent.emit(emitEvent);
2297
+ break;
2298
+ // case 'close' is handled by if-statement below with call to this.close()
2299
+ }
2300
+ if (this.autoClose)
2301
+ this.close(event, 'action');
2302
+ }
2303
+ open(opener) {
2304
+ this.shown = true;
2305
+ this._previous = opener || document.activeElement;
2306
+ this._limitFocusable();
2307
+ return true;
2308
+ }
2309
+ _limitFocusable() {
2310
+ window.setTimeout(() => {
2311
+ if (!this.dialogRef)
2312
+ return;
2313
+ const focusable = this.dialogRef.nativeElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
2314
+ this._firstFocusable = focusable[0];
2315
+ this._lastFocusable = focusable[focusable.length - 1];
2316
+ if (this._lastFocusable)
2317
+ this._lastFocusable.focus();
2318
+ });
2319
+ }
2320
+ close(event, initiator) {
2321
+ if (initiator === 'host' && event instanceof MouseEvent)
2322
+ return;
2323
+ // prevent modal from closing on esc button click when closeModalOnEscape is set to false
2324
+ if (!this.closeModalOnEscape)
2325
+ return;
2326
+ if (this.shown) {
2327
+ const emitEvent = {
2328
+ original: event,
2329
+ payload: this.payload,
2330
+ };
2331
+ this.ngvCloseEvent.emit(emitEvent);
2332
+ }
2333
+ this.shown = false;
2334
+ window.setTimeout(() => {
2335
+ if (this._previous)
2336
+ this._previous.focus();
2337
+ this._previous = undefined;
2338
+ });
2339
+ }
2340
+ focusTrap(event) {
2341
+ if (event.key !== 'Tab')
2342
+ return;
2343
+ if (event.shiftKey) {
2344
+ // shift + tab
2345
+ if (this._lastFocusable &&
2346
+ document.activeElement === this._firstFocusable) {
2347
+ this._lastFocusable.focus();
2348
+ event.preventDefault();
2349
+ }
2350
+ }
2351
+ else {
2352
+ // tab
2353
+ if (this._firstFocusable &&
2354
+ document.activeElement === this._lastFocusable) {
2355
+ this._firstFocusable.focus();
2356
+ event.preventDefault();
2357
+ }
2358
+ }
2359
+ }
2360
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2361
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvDialogComponent, selector: "nggv-dialog", inputs: { thook: "thook", shown: "shown", initiallyShown: "initiallyShown", heading: "heading", title: "title", content: "content", autoClose: "autoClose", payload: "payload", dialogTitleId: "dialogTitleId", dialogBodyId: "dialogBodyId", closeModalOnEscape: "closeModalOnEscape", buttons: "buttons" }, outputs: { ngvCloseEvent: "ngvCloseEvent", ngvPositiveEvent: "ngvPositiveEvent", ngvNeutralEvent: "ngvNeutralEvent", ngvNegativeEvent: "ngvNegativeEvent" }, host: { listeners: { "click": "close($event,\"host\")", "document:keydown.escape": "close($event)", "keydown": "focusTrap($event)" }, properties: { "attr.data-thook": "this.thook", "class.sdv-modal-dialog": "this.baseClass", "class.-active": "this.shown", "attr.aria-hidden": "this.ariaHidden" } }, viewQueries: [{ propertyName: "dialogRef", first: true, predicate: ["dialog"], descendants: true }], exportAs: ["dialog"], ngImport: i0, template: "<div\n class=\"sdv-modal-dialog__container\"\n *transloco=\"let t\"\n #dialog\n role=\"dialog\"\n aria-dialog=\"true\"\n [attr.aria-labelledby]=\"dialogTitleId\"\n [attr.aria-describedby]=\"dialogBodyId\"\n>\n <header class=\"sdv-modal-dialog__heading\">\n <h3 [attr.id]=\"dialogTitleId\">{{ t(heading || title || '') }}</h3>\n <button\n type=\"button\"\n data-thook=\"dialog-close\"\n (click)=\"onAction($event, 'close')\"\n (keydown.enter)=\"onAction($event, 'close')\"\n class=\"close\"\n >\n <gds-icon-cross-small\n *nggCoreElement\n width=\"24\"\n height=\"24\"\n ></gds-icon-cross-small>\n </button>\n </header>\n <section class=\"sdv-modal-dialog__body\" [attr.id]=\"dialogBodyId\">\n <div [innerHtml]=\"content\"></div>\n <ng-content></ng-content>\n </section>\n <footer class=\"sdv-modal-dialog__actions\">\n <button\n class=\"sdv-button sdv-button-delete\"\n type=\"reset\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.negative || 'negative')\"\n (click)=\"onAction($event, 'negative')\"\n (keydown.enter)=\"onAction($event, 'negative')\"\n *ngIf=\"_buttons && _buttons.negative\"\n >\n {{ t(_buttons.negative) }}\n </button>\n <button\n class=\"sdv-button sdv-button-secondary\"\n type=\"button\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.neutral || 'neutral')\"\n (click)=\"onAction($event, 'neutral')\"\n (keydown.enter)=\"onAction($event, 'neutral')\"\n *ngIf=\"_buttons && _buttons.neutral\"\n >\n {{ t(_buttons.neutral) }}\n </button>\n <button\n class=\"sdv-button\"\n type=\"submit\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.positive || 'positive')\"\n (click)=\"onAction($event, 'positive')\"\n (keydown.enter)=\"onAction($event, 'positive')\"\n *ngIf=\"_buttons && _buttons.positive\"\n >\n {{ t(_buttons.positive) }}\n </button>\n </footer>\n</div>\n\n<div class=\"sdv-modal-backdrop\"></div>\n", styles: [":host{inset:0;position:fixed;display:grid;place-content:center;z-index:calc(var(--sg-z-index-modal-backdrop) + 1)}:host .sdv-modal-dialog__container{background:var(--sg-modal-background);display:flex;flex-direction:column;box-shadow:var(--sg-modal-box-shadow);position:absolute;width:100%;z-index:var(--sg-z-index-modal);position:initial;width:375px;max-width:95vw}:host .sdv-modal-dialog__container>.header,:host .sdv-modal-dialog__container>header{padding:1rem;border-bottom:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);display:inline-flex;justify-content:space-between;align-items:center;width:100%}:host .sdv-modal-dialog__container>.header h3,:host .sdv-modal-dialog__container>.header .h3,:host .sdv-modal-dialog__container>header h3,:host .sdv-modal-dialog__container>header .h3{margin-bottom:0;margin-top:0}:host .sdv-modal-dialog__container>.header h3+.close,:host .sdv-modal-dialog__container>.header .h3+.close,:host .sdv-modal-dialog__container>header h3+.close,:host .sdv-modal-dialog__container>header .h3+.close{margin:-7px}:host .sdv-modal-dialog__container>.body{padding:1rem;overflow:auto;width:100%}:host .sdv-modal-dialog__container>.body p{margin-bottom:0;margin-top:0}:host .sdv-modal-dialog__container>.footer,:host .sdv-modal-dialog__container>footer{padding:1rem;width:100%}@media (min-width: 36em){:host .sdv-modal-dialog__container>.footer,:host .sdv-modal-dialog__container>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host .sdv-modal-dialog__container>.footer button+button,:host .sdv-modal-dialog__container>.footer button+.button,:host .sdv-modal-dialog__container>.footer .button+button,:host .sdv-modal-dialog__container>.footer .button+.button,:host .sdv-modal-dialog__container>footer button+button,:host .sdv-modal-dialog__container>footer button+.button,:host .sdv-modal-dialog__container>footer .button+button,:host .sdv-modal-dialog__container>footer .button+.button{margin-top:.75rem}}@media (min-width: 36em){:host .sdv-modal-dialog__container>.footer button+button,:host .sdv-modal-dialog__container>.footer button+.button,:host .sdv-modal-dialog__container>.footer .button+button,:host .sdv-modal-dialog__container>.footer .button+.button,:host .sdv-modal-dialog__container>footer button+button,:host .sdv-modal-dialog__container>footer button+.button,:host .sdv-modal-dialog__container>footer .button+button,:host .sdv-modal-dialog__container>footer .button+.button{margin-left:.75rem}}:host .sdv-modal-dialog__container.medium{width:512px}:host .sdv-modal-dialog__container.large{width:720px}:host .sdv-modal-dialog__heading{padding:1rem;border-bottom:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);display:inline-flex;justify-content:space-between;align-items:center;width:100%}:host .sdv-modal-dialog__heading h3,:host .sdv-modal-dialog__heading .h3{margin-bottom:0;margin-top:0}:host .sdv-modal-dialog__heading h3+.close,:host .sdv-modal-dialog__heading .h3+.close{margin:-7px}:host .sdv-modal-dialog__heading button{display:grid;place-content:center}:host .sdv-modal-dialog__body{padding:1rem;overflow:auto;width:100%}:host .sdv-modal-dialog__body p{margin-bottom:0;margin-top:0}:host .sdv-modal-backdrop{background:#00000059;inset:0;position:fixed;z-index:999;display:block;transition:opacity .5s cubic-bezier(.33,1,.68,1)}:host .sdv-modal-backdrop--transparent{opacity:0}:host .sdv-modal-backdrop--transparent.entered,:host .sdv-modal-backdrop--transparent.is-entering{opacity:1}:host .sdv-modal-backdrop--transparent.is-exiting{opacity:0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
2362
+ }
2363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDialogComponent, decorators: [{
2364
+ type: Component,
2365
+ args: [{ selector: 'nggv-dialog', exportAs: 'dialog', template: "<div\n class=\"sdv-modal-dialog__container\"\n *transloco=\"let t\"\n #dialog\n role=\"dialog\"\n aria-dialog=\"true\"\n [attr.aria-labelledby]=\"dialogTitleId\"\n [attr.aria-describedby]=\"dialogBodyId\"\n>\n <header class=\"sdv-modal-dialog__heading\">\n <h3 [attr.id]=\"dialogTitleId\">{{ t(heading || title || '') }}</h3>\n <button\n type=\"button\"\n data-thook=\"dialog-close\"\n (click)=\"onAction($event, 'close')\"\n (keydown.enter)=\"onAction($event, 'close')\"\n class=\"close\"\n >\n <gds-icon-cross-small\n *nggCoreElement\n width=\"24\"\n height=\"24\"\n ></gds-icon-cross-small>\n </button>\n </header>\n <section class=\"sdv-modal-dialog__body\" [attr.id]=\"dialogBodyId\">\n <div [innerHtml]=\"content\"></div>\n <ng-content></ng-content>\n </section>\n <footer class=\"sdv-modal-dialog__actions\">\n <button\n class=\"sdv-button sdv-button-delete\"\n type=\"reset\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.negative || 'negative')\"\n (click)=\"onAction($event, 'negative')\"\n (keydown.enter)=\"onAction($event, 'negative')\"\n *ngIf=\"_buttons && _buttons.negative\"\n >\n {{ t(_buttons.negative) }}\n </button>\n <button\n class=\"sdv-button sdv-button-secondary\"\n type=\"button\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.neutral || 'neutral')\"\n (click)=\"onAction($event, 'neutral')\"\n (keydown.enter)=\"onAction($event, 'neutral')\"\n *ngIf=\"_buttons && _buttons.neutral\"\n >\n {{ t(_buttons.neutral) }}\n </button>\n <button\n class=\"sdv-button\"\n type=\"submit\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.positive || 'positive')\"\n (click)=\"onAction($event, 'positive')\"\n (keydown.enter)=\"onAction($event, 'positive')\"\n *ngIf=\"_buttons && _buttons.positive\"\n >\n {{ t(_buttons.positive) }}\n </button>\n </footer>\n</div>\n\n<div class=\"sdv-modal-backdrop\"></div>\n", styles: [":host{inset:0;position:fixed;display:grid;place-content:center;z-index:calc(var(--sg-z-index-modal-backdrop) + 1)}:host .sdv-modal-dialog__container{background:var(--sg-modal-background);display:flex;flex-direction:column;box-shadow:var(--sg-modal-box-shadow);position:absolute;width:100%;z-index:var(--sg-z-index-modal);position:initial;width:375px;max-width:95vw}:host .sdv-modal-dialog__container>.header,:host .sdv-modal-dialog__container>header{padding:1rem;border-bottom:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);display:inline-flex;justify-content:space-between;align-items:center;width:100%}:host .sdv-modal-dialog__container>.header h3,:host .sdv-modal-dialog__container>.header .h3,:host .sdv-modal-dialog__container>header h3,:host .sdv-modal-dialog__container>header .h3{margin-bottom:0;margin-top:0}:host .sdv-modal-dialog__container>.header h3+.close,:host .sdv-modal-dialog__container>.header .h3+.close,:host .sdv-modal-dialog__container>header h3+.close,:host .sdv-modal-dialog__container>header .h3+.close{margin:-7px}:host .sdv-modal-dialog__container>.body{padding:1rem;overflow:auto;width:100%}:host .sdv-modal-dialog__container>.body p{margin-bottom:0;margin-top:0}:host .sdv-modal-dialog__container>.footer,:host .sdv-modal-dialog__container>footer{padding:1rem;width:100%}@media (min-width: 36em){:host .sdv-modal-dialog__container>.footer,:host .sdv-modal-dialog__container>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host .sdv-modal-dialog__container>.footer button+button,:host .sdv-modal-dialog__container>.footer button+.button,:host .sdv-modal-dialog__container>.footer .button+button,:host .sdv-modal-dialog__container>.footer .button+.button,:host .sdv-modal-dialog__container>footer button+button,:host .sdv-modal-dialog__container>footer button+.button,:host .sdv-modal-dialog__container>footer .button+button,:host .sdv-modal-dialog__container>footer .button+.button{margin-top:.75rem}}@media (min-width: 36em){:host .sdv-modal-dialog__container>.footer button+button,:host .sdv-modal-dialog__container>.footer button+.button,:host .sdv-modal-dialog__container>.footer .button+button,:host .sdv-modal-dialog__container>.footer .button+.button,:host .sdv-modal-dialog__container>footer button+button,:host .sdv-modal-dialog__container>footer button+.button,:host .sdv-modal-dialog__container>footer .button+button,:host .sdv-modal-dialog__container>footer .button+.button{margin-left:.75rem}}:host .sdv-modal-dialog__container.medium{width:512px}:host .sdv-modal-dialog__container.large{width:720px}:host .sdv-modal-dialog__heading{padding:1rem;border-bottom:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);display:inline-flex;justify-content:space-between;align-items:center;width:100%}:host .sdv-modal-dialog__heading h3,:host .sdv-modal-dialog__heading .h3{margin-bottom:0;margin-top:0}:host .sdv-modal-dialog__heading h3+.close,:host .sdv-modal-dialog__heading .h3+.close{margin:-7px}:host .sdv-modal-dialog__heading button{display:grid;place-content:center}:host .sdv-modal-dialog__body{padding:1rem;overflow:auto;width:100%}:host .sdv-modal-dialog__body p{margin-bottom:0;margin-top:0}:host .sdv-modal-backdrop{background:#00000059;inset:0;position:fixed;z-index:999;display:block;transition:opacity .5s cubic-bezier(.33,1,.68,1)}:host .sdv-modal-backdrop--transparent{opacity:0}:host .sdv-modal-backdrop--transparent.entered,:host .sdv-modal-backdrop--transparent.is-entering{opacity:1}:host .sdv-modal-backdrop--transparent.is-exiting{opacity:0}\n"] }]
2366
+ }], propDecorators: { dialogRef: [{
2367
+ type: ViewChild,
2368
+ args: ['dialog']
2369
+ }], thook: [{
2370
+ type: HostBinding,
2371
+ args: ['attr.data-thook']
2372
+ }, {
2373
+ type: Input
2374
+ }], baseClass: [{
2375
+ type: HostBinding,
2376
+ args: ['class.sdv-modal-dialog']
2377
+ }], shown: [{
2378
+ type: HostBinding,
2379
+ args: ['class.-active']
2380
+ }, {
2381
+ type: Input
2382
+ }], ariaHidden: [{
2383
+ type: HostBinding,
2384
+ args: ['attr.aria-hidden']
2385
+ }], initiallyShown: [{
2386
+ type: Input
2387
+ }], heading: [{
2388
+ type: Input
2389
+ }], title: [{
2390
+ type: Input
2391
+ }], content: [{
2392
+ type: Input
2393
+ }], autoClose: [{
2394
+ type: Input
2395
+ }], payload: [{
2396
+ type: Input
2397
+ }], dialogTitleId: [{
2398
+ type: Input
2399
+ }], dialogBodyId: [{
2400
+ type: Input
2401
+ }], closeModalOnEscape: [{
2402
+ type: Input
2403
+ }], buttons: [{
2404
+ type: Input
2405
+ }], ngvCloseEvent: [{
2406
+ type: Output
2407
+ }], ngvPositiveEvent: [{
2408
+ type: Output
2409
+ }], ngvNeutralEvent: [{
2410
+ type: Output
2411
+ }], ngvNegativeEvent: [{
2412
+ type: Output
2413
+ }], close: [{
2414
+ type: HostListener,
2415
+ args: ['click', ['$event', '"host"']]
2416
+ }, {
2417
+ type: HostListener,
2418
+ args: ['document:keydown.escape', ['$event']]
2419
+ }], focusTrap: [{
2420
+ type: HostListener,
2421
+ args: ['keydown', ['$event']]
2422
+ }] } });
2423
+
2424
+ class NgvFoldOutComponent {
2425
+ constructor() {
2426
+ /** Special property used for selecting DOM elements during automated UI testing. */
2427
+ this.thook = 'fold-out';
2428
+ // /** @internal */
2429
+ // faEllipsisH: IconDefinition = faEllipsisH
2430
+ /** @internal */
2431
+ this.shown = false;
2432
+ // Empty constructor
2433
+ }
2434
+ ngOnDestroy() {
2435
+ this.onClickSubscription?.unsubscribe();
2436
+ }
2437
+ /** Toggle display of the option list */
2438
+ toggleVisibility(event, setVisibility) {
2439
+ this.shown = setVisibility !== undefined ? setVisibility : !this.shown;
2440
+ if (this.shown)
2441
+ this.subscribeToOutsideClickEvent();
2442
+ }
2443
+ /**
2444
+ * Closes the fold-out on click outside.
2445
+ */
2446
+ subscribeToOutsideClickEvent() {
2447
+ this.onClickSubscription = fromEvent(document, 'click').subscribe({
2448
+ next: (event) => {
2449
+ if (this.shown &&
2450
+ !this.inputRef?.nativeElement.contains(event.target)) {
2451
+ this.toggleVisibility();
2452
+ this.onClickSubscription?.unsubscribe();
2453
+ }
2454
+ },
2455
+ });
2456
+ }
2457
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2458
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvFoldOutComponent, selector: "nggv-fold-out", inputs: { thook: "thook", alignOptions: "alignOptions" }, host: { properties: { "attr.data-thook": "this.thook" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["foldout"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div #foldout class=\"sdv-field-dropdown\">\n <button\n data-thook=\"fold-out-toggle\"\n class=\"sdv-button fold-out-button\"\n (click)=\"toggleVisibility($event)\"\n >\n <gds-icon-dot-grid-one-horizontal\n width=\"24\"\n height=\"24\"\n *nggCoreElement\n ></gds-icon-dot-grid-one-horizontal>\n </button>\n\n <div\n class=\"gds-fold-out__popover\"\n [ngClass]=\"{ 'flex-right': alignOptions === 'right' }\"\n [class.gds-fold-out__popover-expanded]=\"shown\"\n (click)=\"toggleVisibility($event, false)\"\n >\n <ng-content></ng-content>\n </div>\n</div>\n", styles: ["i.sg-icon{font-size:0;width:1rem;height:1rem;display:inline-block}i.sg-icon:before{content:\"\";display:inline-block;background:var(--color);width:100%;height:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}i.sg-icon.sg-icon-calendar:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 248h80v-56H48v56zm0 48v64h80v-64H48zm128 0v64h96v-64h-96zm144 0v64h80v-64h-80zm80-104h-80v56h80v-56zm0 216h-80v56h64c8.8 0 16-7.2 16-16v-40zm-128 0h-96v56h96v-56zm-144 0H48v40c0 8.8 7.16 16 16 16h64v-56zm144-216h-96v56h96v-56z '/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 248h80v-56H48v56zm0 48v64h80v-64H48zm128 0v64h96v-64h-96zm144 0v64h80v-64h-80zm80-104h-80v56h80v-56zm0 216h-80v56h64c8.8 0 16-7.2 16-16v-40zm-128 0h-96v56h96v-56zm-144 0H48v40c0 8.8 7.16 16 16 16h64v-56zm144-216h-96v56h96v-56z '/%3E%3C/svg%3E\")}i.sg-icon.sg-icon-calendar-range:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M96 288c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm224 64c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-128-64c0-13.3 10.7-24 24-24h112c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24zm40 72c13.3 0 24 10.7 24 24s-10.7 24-24 24H120c-13.3 0-24-10.7-24-24s10.7-24 24-24h112zM152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 448c0 8.8 7.16 16 16 16h320c8.8 0 16-7.2 16-16V192H48v256z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M96 288c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm224 64c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-128-64c0-13.3 10.7-24 24-24h112c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24zm40 72c13.3 0 24 10.7 24 24s-10.7 24-24 24H120c-13.3 0-24-10.7-24-24s10.7-24 24-24h112zM152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 448c0 8.8 7.16 16 16 16h320c8.8 0 16-7.2 16-16V192H48v256z'/%3E%3C/svg%3E\")}i.sg-icon.sg-icon-ellipsis:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z'/%3E%3C/svg%3E\")}i.sg-icon.sg-icon-grip-vertical:before{-webkit-mask-image:url(\"data:image/svg+xml, %3Csvg height='1em' viewBox='0 0 320 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z' /%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml, %3Csvg height='1em' viewBox='0 0 320 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z' /%3E%3C/svg%3E\")}i.sg-icon.sg-icon-next:before{background:none;border-bottom:2px solid;border-left:2px solid;content:\"\";display:block;height:12px;margin-left:-10px;margin-top:2px;transform:translate(75%) rotate(-135deg) scaleZ(-1);transition:transform .3s ease-in;width:12px}i.sg-icon.sg-icon-previous:before{background:none;border-bottom:2px solid;border-left:2px solid;content:\"\";display:block;height:12px;margin-left:-4px;margin-top:2px;transform:translate(75%) rotate(45deg) scaleZ(-1);transition:transform .3s ease-in;width:12px}i.sg-icon.sg-icon-ellipsis:before{margin-right:-2px}:host .flex-right{right:0}:host .fold-out-button{border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;background-color:transparent;border:.0625rem solid transparent;padding:.625rem;height:2.75rem;width:2.75rem;min-width:auto;--color: var(--gds-ref-pallet-base800);border-color:transparent;color:var(--gds-ref-pallet-base800);display:flex;gap:.5rem;line-height:.75;padding-inline:.4375rem;width:auto}:host .fold-out-button:focus:not(:focus-visible){box-shadow:none;outline:0}:host .fold-out-button:focus,:host .fold-out-button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host .fold-out-button{min-width:100%}}@media screen and (-ms-high-contrast: active){:host .fold-out-button{border:2px solid currentcolor}}:host .fold-out-button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host .fold-out-button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}.form-group :host .fold-out-button{margin-top:-.625rem}:host .fold-out-button.small{height:2rem;width:2rem;padding:.4375rem;line-height:1.125rem}:host .fold-out-button svg{height:1rem;width:1rem}:host .fold-out-button path,:host .fold-out-button line,:host .fold-out-button circle,:host .fold-out-button rect,:host .fold-out-button ellipse,:host .fold-out-button polyline,:host .fold-out-button text{fill:var(--gds-ref-pallet-base800);stroke:var(--gds-ref-pallet-base800);transition:all .3s cubic-bezier(.23,1,.32,1)}:host .fold-out-button:hover,:host .fold-out-button.highlighted{background-color:#0000001a;border-color:transparent}:host .fold-out-button:active,:host .fold-out-button.highlighted:hover{background-color:#0003;border-color:transparent}:host .gds-fold-out__popover{background-clip:border-box;background:var(--sg-card-background);border:var(--sg-card-border);border-radius:var(--sg-card-border-radius);box-shadow:var(--sg-card-box-shadow);color:var(--sg-card-color);display:flex;flex-direction:column;padding:1rem;width:-moz-fit-content;width:fit-content;display:none;padding:0}:host .gds-fold-out__popover>header{align-items:center;display:flex;justify-content:space-between;margin-bottom:1rem;margin-block-end:1rem}:host .gds-fold-out__popover>header .close{margin:-.5rem -.5rem -.5rem .5rem}:host .gds-fold-out__popover>*:not(header,footer){flex:1 1 auto}:host .gds-fold-out__popover>footer{margin-top:.75rem}@media (min-width: 36em){:host .gds-fold-out__popover>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host .gds-fold-out__popover>footer button:not(.link)+button,:host .gds-fold-out__popover>footer button:not(.link)+.button,:host .gds-fold-out__popover>footer .button:not(.link)+button,:host .gds-fold-out__popover>footer .button:not(.link)+.button{margin-top:.75rem}}@media (min-width: 36em){:host .gds-fold-out__popover>footer button:not(.link)+button,:host .gds-fold-out__popover>footer button:not(.link)+.button,:host .gds-fold-out__popover>footer .button:not(.link)+button,:host .gds-fold-out__popover>footer .button:not(.link)+.button{margin-left:.75rem}}:host .gds-fold-out__popover-expanded{display:block}:host ::ng-deep .sdv-field-dropdown__options__label{padding:.75rem 1rem;line-height:1.25;cursor:pointer;display:flex;gap:.75rem;-webkit-user-select:none;user-select:none}:host ::ng-deep .sdv-field-dropdown__options__label:active{background-color:var(--grey-400)}:host ::ng-deep .sdv-field-dropdown__options__label:focus{outline-color:#000;outline-offset:-.25rem}:host ::ng-deep .sdv-field-dropdown__options__label.active.sg-highlighted,:host ::ng-deep .sdv-field-dropdown__options__label[aria-selected=true]{background:var(--grey-1000);color:#fff}:host ::ng-deep .sdv-field-dropdown__options__label:hover,:host ::ng-deep .sdv-field-dropdown__options__label:focus-visible{background-color:var(--grey-400)}:host ::ng-deep .sdv-field-dropdown__options__label:active{background-color:var(--grey-500)}:host ::ng-deep .sdv-field-dropdown__options__label:focus-visible{outline-color:#000;outline-offset:-.25rem}:host ::ng-deep .sdv-field-dropdown__options__label[aria-hidden=true]{display:none}:host ::ng-deep .sdv-field-dropdown__options__label[highlighted]{background:var(--grey-1000);color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
2459
+ }
2460
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutComponent, decorators: [{
2461
+ type: Component,
2462
+ args: [{ selector: 'nggv-fold-out', template: "<div #foldout class=\"sdv-field-dropdown\">\n <button\n data-thook=\"fold-out-toggle\"\n class=\"sdv-button fold-out-button\"\n (click)=\"toggleVisibility($event)\"\n >\n <gds-icon-dot-grid-one-horizontal\n width=\"24\"\n height=\"24\"\n *nggCoreElement\n ></gds-icon-dot-grid-one-horizontal>\n </button>\n\n <div\n class=\"gds-fold-out__popover\"\n [ngClass]=\"{ 'flex-right': alignOptions === 'right' }\"\n [class.gds-fold-out__popover-expanded]=\"shown\"\n (click)=\"toggleVisibility($event, false)\"\n >\n <ng-content></ng-content>\n </div>\n</div>\n", styles: ["i.sg-icon{font-size:0;width:1rem;height:1rem;display:inline-block}i.sg-icon:before{content:\"\";display:inline-block;background:var(--color);width:100%;height:100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}i.sg-icon.sg-icon-calendar:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 248h80v-56H48v56zm0 48v64h80v-64H48zm128 0v64h96v-64h-96zm144 0v64h80v-64h-80zm80-104h-80v56h80v-56zm0 216h-80v56h64c8.8 0 16-7.2 16-16v-40zm-128 0h-96v56h96v-56zm-144 0H48v40c0 8.8 7.16 16 16 16h64v-56zm144-216h-96v56h96v-56z '/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 248h80v-56H48v56zm0 48v64h80v-64H48zm128 0v64h96v-64h-96zm144 0v64h80v-64h-80zm80-104h-80v56h80v-56zm0 216h-80v56h64c8.8 0 16-7.2 16-16v-40zm-128 0h-96v56h96v-56zm-144 0H48v40c0 8.8 7.16 16 16 16h64v-56zm144-216h-96v56h96v-56z '/%3E%3C/svg%3E\")}i.sg-icon.sg-icon-calendar-range:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M96 288c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm224 64c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-128-64c0-13.3 10.7-24 24-24h112c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24zm40 72c13.3 0 24 10.7 24 24s-10.7 24-24 24H120c-13.3 0-24-10.7-24-24s10.7-24 24-24h112zM152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 448c0 8.8 7.16 16 16 16h320c8.8 0 16-7.2 16-16V192H48v256z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M96 288c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm224 64c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-128-64c0-13.3 10.7-24 24-24h112c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24zm40 72c13.3 0 24 10.7 24 24s-10.7 24-24 24H120c-13.3 0-24-10.7-24-24s10.7-24 24-24h112zM152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 448c0 8.8 7.16 16 16 16h320c8.8 0 16-7.2 16-16V192H48v256z'/%3E%3C/svg%3E\")}i.sg-icon.sg-icon-ellipsis:before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3C!--! Font Awesome Pro 6.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z'/%3E%3C/svg%3E\")}i.sg-icon.sg-icon-grip-vertical:before{-webkit-mask-image:url(\"data:image/svg+xml, %3Csvg height='1em' viewBox='0 0 320 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z' /%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml, %3Csvg height='1em' viewBox='0 0 320 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 352l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm192 0l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 320c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 192l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zM40 160c-22.1 0-40-17.9-40-40L0 72C0 49.9 17.9 32 40 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0zM232 32l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40z' /%3E%3C/svg%3E\")}i.sg-icon.sg-icon-next:before{background:none;border-bottom:2px solid;border-left:2px solid;content:\"\";display:block;height:12px;margin-left:-10px;margin-top:2px;transform:translate(75%) rotate(-135deg) scaleZ(-1);transition:transform .3s ease-in;width:12px}i.sg-icon.sg-icon-previous:before{background:none;border-bottom:2px solid;border-left:2px solid;content:\"\";display:block;height:12px;margin-left:-4px;margin-top:2px;transform:translate(75%) rotate(45deg) scaleZ(-1);transition:transform .3s ease-in;width:12px}i.sg-icon.sg-icon-ellipsis:before{margin-right:-2px}:host .flex-right{right:0}:host .fold-out-button{border:0;cursor:pointer;font-family:inherit;padding:0;padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);font-weight:500;min-height:2.75rem;align-items:center;display:inline-flex;justify-content:center;background-color:transparent;border:.0625rem solid transparent;padding:.625rem;height:2.75rem;width:2.75rem;min-width:auto;--color: var(--gds-ref-pallet-base800);border-color:transparent;color:var(--gds-ref-pallet-base800);display:flex;gap:.5rem;line-height:.75;padding-inline:.4375rem;width:auto}:host .fold-out-button:focus:not(:focus-visible){box-shadow:none;outline:0}:host .fold-out-button:focus,:host .fold-out-button:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media (max-width: 35.98em){:host .fold-out-button{min-width:100%}}@media screen and (-ms-high-contrast: active){:host .fold-out-button{border:2px solid currentcolor}}:host .fold-out-button.small{min-height:2rem;padding:.4375rem .75rem;line-height:1rem}:host .fold-out-button.large{min-height:4rem;padding:1rem 1.5rem;font-size:1.5rem;line-height:2rem}.form-group :host .fold-out-button{margin-top:-.625rem}:host .fold-out-button.small{height:2rem;width:2rem;padding:.4375rem;line-height:1.125rem}:host .fold-out-button svg{height:1rem;width:1rem}:host .fold-out-button path,:host .fold-out-button line,:host .fold-out-button circle,:host .fold-out-button rect,:host .fold-out-button ellipse,:host .fold-out-button polyline,:host .fold-out-button text{fill:var(--gds-ref-pallet-base800);stroke:var(--gds-ref-pallet-base800);transition:all .3s cubic-bezier(.23,1,.32,1)}:host .fold-out-button:hover,:host .fold-out-button.highlighted{background-color:#0000001a;border-color:transparent}:host .fold-out-button:active,:host .fold-out-button.highlighted:hover{background-color:#0003;border-color:transparent}:host .gds-fold-out__popover{background-clip:border-box;background:var(--sg-card-background);border:var(--sg-card-border);border-radius:var(--sg-card-border-radius);box-shadow:var(--sg-card-box-shadow);color:var(--sg-card-color);display:flex;flex-direction:column;padding:1rem;width:-moz-fit-content;width:fit-content;display:none;padding:0}:host .gds-fold-out__popover>header{align-items:center;display:flex;justify-content:space-between;margin-bottom:1rem;margin-block-end:1rem}:host .gds-fold-out__popover>header .close{margin:-.5rem -.5rem -.5rem .5rem}:host .gds-fold-out__popover>*:not(header,footer){flex:1 1 auto}:host .gds-fold-out__popover>footer{margin-top:.75rem}@media (min-width: 36em){:host .gds-fold-out__popover>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host .gds-fold-out__popover>footer button:not(.link)+button,:host .gds-fold-out__popover>footer button:not(.link)+.button,:host .gds-fold-out__popover>footer .button:not(.link)+button,:host .gds-fold-out__popover>footer .button:not(.link)+.button{margin-top:.75rem}}@media (min-width: 36em){:host .gds-fold-out__popover>footer button:not(.link)+button,:host .gds-fold-out__popover>footer button:not(.link)+.button,:host .gds-fold-out__popover>footer .button:not(.link)+button,:host .gds-fold-out__popover>footer .button:not(.link)+.button{margin-left:.75rem}}:host .gds-fold-out__popover-expanded{display:block}:host ::ng-deep .sdv-field-dropdown__options__label{padding:.75rem 1rem;line-height:1.25;cursor:pointer;display:flex;gap:.75rem;-webkit-user-select:none;user-select:none}:host ::ng-deep .sdv-field-dropdown__options__label:active{background-color:var(--grey-400)}:host ::ng-deep .sdv-field-dropdown__options__label:focus{outline-color:#000;outline-offset:-.25rem}:host ::ng-deep .sdv-field-dropdown__options__label.active.sg-highlighted,:host ::ng-deep .sdv-field-dropdown__options__label[aria-selected=true]{background:var(--grey-1000);color:#fff}:host ::ng-deep .sdv-field-dropdown__options__label:hover,:host ::ng-deep .sdv-field-dropdown__options__label:focus-visible{background-color:var(--grey-400)}:host ::ng-deep .sdv-field-dropdown__options__label:active{background-color:var(--grey-500)}:host ::ng-deep .sdv-field-dropdown__options__label:focus-visible{outline-color:#000;outline-offset:-.25rem}:host ::ng-deep .sdv-field-dropdown__options__label[aria-hidden=true]{display:none}:host ::ng-deep .sdv-field-dropdown__options__label[highlighted]{background:var(--grey-1000);color:#fff}\n"] }]
2463
+ }], ctorParameters: function () { return []; }, propDecorators: { thook: [{
2464
+ type: HostBinding,
2465
+ args: ['attr.data-thook']
2466
+ }, {
2467
+ type: Input
2468
+ }], inputRef: [{
2469
+ type: ViewChild,
2470
+ args: ['foldout', { read: ElementRef }]
2471
+ }], alignOptions: [{
2472
+ type: Input
2473
+ }] } });
2474
+
2475
+ class NgvFoldOutOptionDirective {
2476
+ constructor() {
2477
+ this.baseClass = true;
2478
+ }
2479
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2480
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvFoldOutOptionDirective, selector: "[ngvOption]", host: { properties: { "class.sdv-field-dropdown__options__label": "this.baseClass" } }, ngImport: i0 }); }
2481
+ }
2482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutOptionDirective, decorators: [{
2483
+ type: Directive,
2484
+ args: [{
2485
+ selector: '[ngvOption]',
2486
+ }]
2487
+ }], propDecorators: { baseClass: [{
2488
+ type: HostBinding,
2489
+ args: ['class.sdv-field-dropdown__options__label']
2490
+ }] } });
2491
+
2492
+ /** Modal slide-out component based on vanilla pattern library design.
2493
+ * The modal title can be set using the @Input heading, and will automatically be translated if
2494
+ * the string matches a cms key.
2495
+ * Content can be injected into the body of the slide-out by either setting the @Input content to any type of
2496
+ * markdown, or using content projection (adding content between the `nggv-slideout-modal`-start and end tag).
2497
+ * If the content needs to stretch outside the normal padded area, add the attribute `slot="outside-content"` to the
2498
+ * projected content main element.
2499
+ * Test hooks:
2500
+ * The modal hook defaults to 'slideout' but is customizeable.
2501
+ * The closing button can be selected using 'slideout-close'.
2502
+ * The backdrop is selectable using 'slideout-backdrop'.
2503
+ */
2504
+ class NgvSlideOutComponent {
2505
+ /** @internal */
2506
+ get fromLeft() {
2507
+ return this.side === 'left';
2508
+ }
2509
+ /** Buttons are defined as a key-value pair where key is one of "positive|neutral|negative" and value is the button label. */
2510
+ set buttons(buttons) {
2511
+ this._buttons = buttons;
2512
+ }
2513
+ constructor(host) {
2514
+ this.host = host;
2515
+ /** Sets from which side the modal should open. */
2516
+ this.side = 'right';
2517
+ /** Defines the default visibility state of the slide-out. */
2518
+ this.shown = false;
2519
+ /** Defines the default visibility state of the modal. */
2520
+ this.initiallyShown = false;
2521
+ /** Sets whether it is possible to close the modal from the top right corner. */
2522
+ this.closable = true;
2523
+ /** Allows the modal content to decide the width of the modal. */
2524
+ this.autoWidth = false;
2525
+ /** Special property used for selecting DOM elements during automated UI testing. */
2526
+ this.thook = 'slideout';
2527
+ /** Will emit true on closing event. */
2528
+ this.ngvCloseEvent = new EventEmitter();
2529
+ this.ngvPositiveEvent = new EventEmitter();
2530
+ this.ngvNeutralEvent = new EventEmitter();
2531
+ this.ngvNegativeEvent = new EventEmitter();
2532
+ // appends methods for opening and closing modal to native element
2533
+ this.host.nativeElement.open = this.open.bind(this);
2534
+ this.host.nativeElement.close = this.close.bind(this);
2535
+ }
2536
+ ngOnInit() {
2537
+ this.shown = this.initiallyShown;
2538
+ if (this.shown)
2539
+ this.limitFocusable();
2540
+ }
2541
+ onAction(event, action) {
2542
+ event.preventDefault();
2543
+ switch (action) {
2544
+ case 'positive':
2545
+ this.ngvPositiveEvent.emit();
2546
+ break;
2547
+ case 'neutral':
2548
+ this.ngvNeutralEvent.emit();
2549
+ break;
2550
+ case 'negative':
2551
+ this.ngvNegativeEvent.emit();
2552
+ break;
2553
+ }
2554
+ this.close(event, 'action');
2555
+ }
2556
+ /**
2557
+ * Called on a modal element. Opens the modal and sets focus to the last focusable element in the modal.
2558
+ *
2559
+ * @param opener - reference to last focused element before opening modal
2560
+ * @returns - true
2561
+ */
2562
+ open(opener) {
2563
+ this.shown = true;
2564
+ this.previous = opener || document.activeElement;
2565
+ this.limitFocusable();
2566
+ return true;
2567
+ }
2568
+ /**
2569
+ * Called on a modal element. Closes the modal and emits a `ngvCloseEvent`. Sets focus to the lats focused element if an element was sent in to open function.
2570
+ *
2571
+ * @param event
2572
+ * @param initiator
2573
+ */
2574
+ close(event, initiator) {
2575
+ if (initiator === 'host' &&
2576
+ event instanceof MouseEvent &&
2577
+ event.target !== event.currentTarget)
2578
+ return;
2579
+ if (this.shown && this.closable) {
2580
+ this.ngvCloseEvent.emit(this.shown);
2581
+ this.shown = false;
2582
+ window.setTimeout(() => {
2583
+ if (this.previous)
2584
+ this.previous.focus();
2585
+ this.previous = undefined;
2586
+ });
2587
+ }
2588
+ }
2589
+ /** @internal */
2590
+ focusTrap(event) {
2591
+ if (event.key !== 'Tab')
2592
+ return;
2593
+ if (event.shiftKey) {
2594
+ // shift + tab
2595
+ if (this.lastFocusable &&
2596
+ document.activeElement === this.firstFocusable) {
2597
+ this.lastFocusable.focus();
2598
+ event.preventDefault();
2599
+ }
2600
+ }
2601
+ else {
2602
+ // tab
2603
+ if (this.firstFocusable &&
2604
+ document.activeElement === this.lastFocusable) {
2605
+ this.firstFocusable.focus();
2606
+ event.preventDefault();
2607
+ }
2608
+ }
2609
+ }
2610
+ limitFocusable() {
2611
+ window.setTimeout(() => {
2612
+ if (!this.slideOutRef)
2613
+ return;
2614
+ const focusable = this.slideOutRef.nativeElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
2615
+ this.firstFocusable = focusable[0];
2616
+ this.lastFocusable = focusable[focusable.length - 1];
2617
+ if (this.lastFocusable)
2618
+ this.lastFocusable.focus();
2619
+ });
2620
+ }
2621
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvSlideOutComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
2622
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvSlideOutComponent, selector: "nggv-slideout-modal", inputs: { side: "side", shown: "shown", initiallyShown: "initiallyShown", heading: "heading", title: "title", content: "content", closable: "closable", autoWidth: "autoWidth", thook: "thook", buttons: "buttons" }, outputs: { ngvCloseEvent: "ngvCloseEvent", ngvPositiveEvent: "ngvPositiveEvent", ngvNeutralEvent: "ngvNeutralEvent", ngvNegativeEvent: "ngvNegativeEvent" }, host: { listeners: { "click": "close($event,\"host\")", "document:keydown.escape": "close($event)", "keydown": "focusTrap($event)" } }, viewQueries: [{ propertyName: "slideOutRef", first: true, predicate: ["slideOut"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"shown\">\n <div\n [ngClass]=\"{\n 'gds-slide-out--left': fromLeft,\n 'gds-slide-out--right': !fromLeft\n }\"\n *transloco=\"let t\"\n [class.-active]=\"shown\"\n [attr.data-thook]=\"thook\"\n [attr.aria-hidden]=\"!shown\"\n [@modalAnimation]\n >\n <div\n #slideOut\n class=\"gds-slide-out\"\n [class.auto-width]=\"autoWidth\"\n [class.entered]=\"shown\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"sdv-modal-title\"\n aria-describedby=\"sdv-modal-body\"\n >\n <header class=\"gds-slide-out__header\">\n <h3 class=\"gds-slide-out__heading\" id=\"sdv-modal-title\">\n {{ heading || title || '' }}\n </h3>\n <button\n data-testid=\"modal-close-button\"\n class=\"close\"\n (click)=\"this.close()\"\n >\n <span className=\"sr-only\">Close</span>\n <i></i>\n </button>\n </header>\n\n <section id=\"sdv-modal-body\">\n <div class=\"gds-slide-out__content hide-if-empty\">\n <div *ngIf=\"content\" [innerHtml]=\"content\"></div>\n <ng-content></ng-content>\n </div>\n <ng-content select=\"[slot='outside-content']\"></ng-content>\n </section>\n\n <footer class=\"sdv-modal-dialog__actions\">\n <button\n class=\"danger\"\n type=\"reset\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.negative || 'negative')\"\n (click)=\"onAction($event, 'negative')\"\n (keydown.enter)=\"onAction($event, 'negative')\"\n *ngIf=\"_buttons && _buttons.negative\"\n >\n {{ t(_buttons.negative) }}\n </button>\n\n <button\n class=\"secondary\"\n type=\"button\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.neutral || 'neutral')\"\n (click)=\"onAction($event, 'neutral')\"\n (keydown.enter)=\"onAction($event, 'neutral')\"\n *ngIf=\"_buttons && _buttons.neutral\"\n >\n {{ t(_buttons.neutral) }}\n </button>\n\n <button\n type=\"submit\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.positive || 'positive')\"\n (click)=\"onAction($event, 'positive')\"\n (keydown.enter)=\"onAction($event, 'positive')\"\n *ngIf=\"_buttons && _buttons.positive\"\n >\n {{ t(_buttons.positive) }}\n </button>\n </footer>\n </div>\n\n <div\n class=\"gds-backdrop\"\n data-thook=\"slideout-backdrop\"\n (click)=\"close()\"\n ></div>\n </div>\n</ng-container>\n", styles: [":host .gds-slide-out{background:var(--sg-modal-background);display:flex;flex-direction:column;box-shadow:var(--sg-modal-box-shadow);position:absolute;width:100%;z-index:var(--sg-z-index-modal);position:fixed;height:100dvh;max-width:512px;min-height:-webkit-fill-available;min-height:-moz-available;min-height:stretch;right:0;top:0;transition:transform .35s cubic-bezier(.33,1,.68,1);transform:translate(100%);z-index:1050}:host .gds-slide-out>.header,:host .gds-slide-out>header{padding:1rem;border-bottom:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);display:inline-flex;justify-content:space-between;align-items:center;width:100%}:host .gds-slide-out>.header h3,:host .gds-slide-out>.header .h3,:host .gds-slide-out>header h3,:host .gds-slide-out>header .h3{margin-bottom:0;margin-top:0}:host .gds-slide-out>.header h3+.close,:host .gds-slide-out>.header .h3+.close,:host .gds-slide-out>header h3+.close,:host .gds-slide-out>header .h3+.close{margin:-7px}:host .gds-slide-out>.body{padding:1rem;overflow:auto;width:100%}:host .gds-slide-out>.body p{margin-bottom:0;margin-top:0}:host .gds-slide-out>.footer,:host .gds-slide-out>footer{padding:1rem;width:100%}@media (min-width: 36em){:host .gds-slide-out>.footer,:host .gds-slide-out>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host .gds-slide-out>.footer button+button,:host .gds-slide-out>.footer button+.button,:host .gds-slide-out>.footer .button+button,:host .gds-slide-out>.footer .button+.button,:host .gds-slide-out>footer button+button,:host .gds-slide-out>footer button+.button,:host .gds-slide-out>footer .button+button,:host .gds-slide-out>footer .button+.button{margin-top:.75rem}}@media (min-width: 36em){:host .gds-slide-out>.footer button+button,:host .gds-slide-out>.footer button+.button,:host .gds-slide-out>.footer .button+button,:host .gds-slide-out>.footer .button+.button,:host .gds-slide-out>footer button+button,:host .gds-slide-out>footer button+.button,:host .gds-slide-out>footer .button+button,:host .gds-slide-out>footer .button+.button{margin-left:.75rem}}:host .gds-slide-out.is-entering,:host .gds-slide-out.entered{transform:translate(0)}:host .gds-slide-out.is-exiting{transform:translate(100%)}:host .gds-slide-out.large{max-width:720px}:host .gds-slide-out>.body{flex:1 0}:host .gds-slide-out.left{left:0}:host .gds-slide-out.gds-slide-out--768{max-width:48rem}:host .gds-slide-out.gds-slide-out--960{max-width:60rem}:host .gds-slide-out.gds-slide-out--768 header,:host .gds-slide-out.gds-slide-out--960 header{padding:1.5rem 2rem 1rem}:host .gds-slide-out.gds-slide-out--768 .body,:host .gds-slide-out.gds-slide-out--960 .body{padding:2rem 2rem 1rem}:host .gds-slide-out.gds-slide-out--768 footer,:host .gds-slide-out.gds-slide-out--960 footer{padding:1rem 2rem 2rem}:host .gds-slide-out.auto-width{width:auto;max-width:initial}:host .hide-if-empty:empty{display:none}:host .gds-backdrop{background:#00000059;inset:0;position:fixed;z-index:1040;display:block;transition:opacity .5s cubic-bezier(.33,1,.68,1)}:host .gds-backdrop--transparent{opacity:0}:host .gds-backdrop--transparent.entered,:host .gds-backdrop--transparent.is-entering{opacity:1}:host .gds-backdrop--transparent.is-exiting{opacity:0}:host .gds-slide-out__content{padding:1rem;overflow:auto;width:100%}:host .gds-slide-out__content p{margin-bottom:0;margin-top:0}:host #sdv-modal-body{flex:1}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
2623
+ trigger('modalAnimation', [
2624
+ transition(':enter', [
2625
+ query('.gds-slide-out', style({ transform: 'translateX(100%)' }), {
2626
+ optional: true,
2627
+ }),
2628
+ query('.gds-backdrop, [role=dialog]', style({ opacity: '0' }), {
2629
+ optional: true,
2630
+ }),
2631
+ group([
2632
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(0)' })), { optional: true }),
2633
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '1' })), { optional: true }),
2634
+ ]),
2635
+ ]),
2636
+ transition(':leave', [
2637
+ query('.gds-slide-out', style({ transform: 'translateX(0)' }), {
2638
+ optional: true,
2639
+ }),
2640
+ group([
2641
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(100%)' })), { optional: true }),
2642
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '0' })), { optional: true }),
2643
+ ]),
2644
+ ]),
2645
+ ]),
2646
+ ] }); }
2647
+ }
2648
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvSlideOutComponent, decorators: [{
2649
+ type: Component,
2650
+ args: [{ selector: 'nggv-slideout-modal', animations: [
2651
+ trigger('modalAnimation', [
2652
+ transition(':enter', [
2653
+ query('.gds-slide-out', style({ transform: 'translateX(100%)' }), {
2654
+ optional: true,
2655
+ }),
2656
+ query('.gds-backdrop, [role=dialog]', style({ opacity: '0' }), {
2657
+ optional: true,
2658
+ }),
2659
+ group([
2660
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(0)' })), { optional: true }),
2661
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '1' })), { optional: true }),
2662
+ ]),
2663
+ ]),
2664
+ transition(':leave', [
2665
+ query('.gds-slide-out', style({ transform: 'translateX(0)' }), {
2666
+ optional: true,
2667
+ }),
2668
+ group([
2669
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(100%)' })), { optional: true }),
2670
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '0' })), { optional: true }),
2671
+ ]),
2672
+ ]),
2673
+ ]),
2674
+ ], template: "<ng-container *ngIf=\"shown\">\n <div\n [ngClass]=\"{\n 'gds-slide-out--left': fromLeft,\n 'gds-slide-out--right': !fromLeft\n }\"\n *transloco=\"let t\"\n [class.-active]=\"shown\"\n [attr.data-thook]=\"thook\"\n [attr.aria-hidden]=\"!shown\"\n [@modalAnimation]\n >\n <div\n #slideOut\n class=\"gds-slide-out\"\n [class.auto-width]=\"autoWidth\"\n [class.entered]=\"shown\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"sdv-modal-title\"\n aria-describedby=\"sdv-modal-body\"\n >\n <header class=\"gds-slide-out__header\">\n <h3 class=\"gds-slide-out__heading\" id=\"sdv-modal-title\">\n {{ heading || title || '' }}\n </h3>\n <button\n data-testid=\"modal-close-button\"\n class=\"close\"\n (click)=\"this.close()\"\n >\n <span className=\"sr-only\">Close</span>\n <i></i>\n </button>\n </header>\n\n <section id=\"sdv-modal-body\">\n <div class=\"gds-slide-out__content hide-if-empty\">\n <div *ngIf=\"content\" [innerHtml]=\"content\"></div>\n <ng-content></ng-content>\n </div>\n <ng-content select=\"[slot='outside-content']\"></ng-content>\n </section>\n\n <footer class=\"sdv-modal-dialog__actions\">\n <button\n class=\"danger\"\n type=\"reset\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.negative || 'negative')\"\n (click)=\"onAction($event, 'negative')\"\n (keydown.enter)=\"onAction($event, 'negative')\"\n *ngIf=\"_buttons && _buttons.negative\"\n >\n {{ t(_buttons.negative) }}\n </button>\n\n <button\n class=\"secondary\"\n type=\"button\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.neutral || 'neutral')\"\n (click)=\"onAction($event, 'neutral')\"\n (keydown.enter)=\"onAction($event, 'neutral')\"\n *ngIf=\"_buttons && _buttons.neutral\"\n >\n {{ t(_buttons.neutral) }}\n </button>\n\n <button\n type=\"submit\"\n [attr.data-thook]=\"'dialog-' + (_buttons?.positive || 'positive')\"\n (click)=\"onAction($event, 'positive')\"\n (keydown.enter)=\"onAction($event, 'positive')\"\n *ngIf=\"_buttons && _buttons.positive\"\n >\n {{ t(_buttons.positive) }}\n </button>\n </footer>\n </div>\n\n <div\n class=\"gds-backdrop\"\n data-thook=\"slideout-backdrop\"\n (click)=\"close()\"\n ></div>\n </div>\n</ng-container>\n", styles: [":host .gds-slide-out{background:var(--sg-modal-background);display:flex;flex-direction:column;box-shadow:var(--sg-modal-box-shadow);position:absolute;width:100%;z-index:var(--sg-z-index-modal);position:fixed;height:100dvh;max-width:512px;min-height:-webkit-fill-available;min-height:-moz-available;min-height:stretch;right:0;top:0;transition:transform .35s cubic-bezier(.33,1,.68,1);transform:translate(100%);z-index:1050}:host .gds-slide-out>.header,:host .gds-slide-out>header{padding:1rem;border-bottom:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);display:inline-flex;justify-content:space-between;align-items:center;width:100%}:host .gds-slide-out>.header h3,:host .gds-slide-out>.header .h3,:host .gds-slide-out>header h3,:host .gds-slide-out>header .h3{margin-bottom:0;margin-top:0}:host .gds-slide-out>.header h3+.close,:host .gds-slide-out>.header .h3+.close,:host .gds-slide-out>header h3+.close,:host .gds-slide-out>header .h3+.close{margin:-7px}:host .gds-slide-out>.body{padding:1rem;overflow:auto;width:100%}:host .gds-slide-out>.body p{margin-bottom:0;margin-top:0}:host .gds-slide-out>.footer,:host .gds-slide-out>footer{padding:1rem;width:100%}@media (min-width: 36em){:host .gds-slide-out>.footer,:host .gds-slide-out>footer{display:flex;justify-content:flex-end}}@media (max-width: 35.98em){:host .gds-slide-out>.footer button+button,:host .gds-slide-out>.footer button+.button,:host .gds-slide-out>.footer .button+button,:host .gds-slide-out>.footer .button+.button,:host .gds-slide-out>footer button+button,:host .gds-slide-out>footer button+.button,:host .gds-slide-out>footer .button+button,:host .gds-slide-out>footer .button+.button{margin-top:.75rem}}@media (min-width: 36em){:host .gds-slide-out>.footer button+button,:host .gds-slide-out>.footer button+.button,:host .gds-slide-out>.footer .button+button,:host .gds-slide-out>.footer .button+.button,:host .gds-slide-out>footer button+button,:host .gds-slide-out>footer button+.button,:host .gds-slide-out>footer .button+button,:host .gds-slide-out>footer .button+.button{margin-left:.75rem}}:host .gds-slide-out.is-entering,:host .gds-slide-out.entered{transform:translate(0)}:host .gds-slide-out.is-exiting{transform:translate(100%)}:host .gds-slide-out.large{max-width:720px}:host .gds-slide-out>.body{flex:1 0}:host .gds-slide-out.left{left:0}:host .gds-slide-out.gds-slide-out--768{max-width:48rem}:host .gds-slide-out.gds-slide-out--960{max-width:60rem}:host .gds-slide-out.gds-slide-out--768 header,:host .gds-slide-out.gds-slide-out--960 header{padding:1.5rem 2rem 1rem}:host .gds-slide-out.gds-slide-out--768 .body,:host .gds-slide-out.gds-slide-out--960 .body{padding:2rem 2rem 1rem}:host .gds-slide-out.gds-slide-out--768 footer,:host .gds-slide-out.gds-slide-out--960 footer{padding:1rem 2rem 2rem}:host .gds-slide-out.auto-width{width:auto;max-width:initial}:host .hide-if-empty:empty{display:none}:host .gds-backdrop{background:#00000059;inset:0;position:fixed;z-index:1040;display:block;transition:opacity .5s cubic-bezier(.33,1,.68,1)}:host .gds-backdrop--transparent{opacity:0}:host .gds-backdrop--transparent.entered,:host .gds-backdrop--transparent.is-entering{opacity:1}:host .gds-backdrop--transparent.is-exiting{opacity:0}:host .gds-slide-out__content{padding:1rem;overflow:auto;width:100%}:host .gds-slide-out__content p{margin-bottom:0;margin-top:0}:host #sdv-modal-body{flex:1}\n"] }]
2675
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { slideOutRef: [{
2676
+ type: ViewChild,
2677
+ args: ['slideOut']
2678
+ }], side: [{
2679
+ type: Input
2680
+ }], shown: [{
2681
+ type: Input
2682
+ }], initiallyShown: [{
2683
+ type: Input
2684
+ }], heading: [{
2685
+ type: Input
2686
+ }], title: [{
2687
+ type: Input
2688
+ }], content: [{
2689
+ type: Input
2690
+ }], closable: [{
2691
+ type: Input
2692
+ }], autoWidth: [{
2693
+ type: Input
2694
+ }], thook: [{
2695
+ type: Input
2696
+ }], buttons: [{
2697
+ type: Input
2698
+ }], ngvCloseEvent: [{
2699
+ type: Output
2700
+ }], ngvPositiveEvent: [{
2701
+ type: Output
2702
+ }], ngvNeutralEvent: [{
2703
+ type: Output
2704
+ }], ngvNegativeEvent: [{
2705
+ type: Output
2706
+ }], close: [{
2707
+ type: HostListener,
2708
+ args: ['click', ['$event', '"host"']]
2709
+ }, {
2710
+ type: HostListener,
2711
+ args: ['document:keydown.escape', ['$event']]
2712
+ }], focusTrap: [{
2713
+ type: HostListener,
2714
+ args: ['keydown', ['$event']]
2715
+ }] } });
2716
+
2717
+ class NgvModalModule {
2718
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2719
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, declarations: [NgvDialogComponent,
2720
+ NgvSlideOutComponent,
2721
+ NgvFoldOutComponent,
2722
+ NgvFoldOutOptionDirective], imports: [CommonModule, NgvButtonModule$1], exports: [NgvDialogComponent,
2723
+ NgvSlideOutComponent,
2724
+ NgvFoldOutComponent,
2725
+ NgvFoldOutOptionDirective] }); }
2726
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, imports: [CommonModule, NgvButtonModule$1] }); }
2727
+ }
2728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, decorators: [{
2729
+ type: NgModule,
2730
+ args: [{
2731
+ imports: [CommonModule, NgvButtonModule$1],
2732
+ declarations: [
2733
+ NgvDialogComponent,
2734
+ NgvSlideOutComponent,
2735
+ NgvFoldOutComponent,
2736
+ NgvFoldOutOptionDirective,
2737
+ ],
2738
+ exports: [
2739
+ NgvDialogComponent,
2740
+ NgvSlideOutComponent,
2741
+ NgvFoldOutComponent,
2742
+ NgvFoldOutOptionDirective,
2743
+ ],
2744
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
2745
+ }]
2746
+ }] });
2747
+
2748
+ /** @internal Internal class used to uncheck radio buttons with the matching name. */
2749
+ class NgvRadioControlRegistry {
2750
+ constructor() {
2751
+ this._radios = [];
2752
+ }
2753
+ add(control, radio) {
2754
+ this._radios.push([control, radio]);
2755
+ }
2756
+ remove(radio) {
2757
+ for (let i = this._radios.length - 1; i >= 0; --i) {
2758
+ if (this._radios[i][1] === radio) {
2759
+ this._radios.splice(i, 1);
2760
+ return;
2761
+ }
2762
+ }
2763
+ }
2764
+ select(radio) {
2765
+ this._radios.forEach((controlPair) => {
2766
+ if (this._isSameGroup(controlPair, radio) && controlPair[1] !== radio) {
2767
+ controlPair[1].writeValue(radio.value);
2768
+ }
2769
+ });
2770
+ }
2771
+ _isSameGroup(controlPair, radio) {
2772
+ if (!controlPair[0].control)
2773
+ return false;
2774
+ return (
2775
+ //@ts-expect-error internal properties not exposed
2776
+ controlPair[0]._parent === radio.ngControl._parent &&
2777
+ controlPair[1].name === radio.name);
2778
+ }
2779
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioControlRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2780
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioControlRegistry }); }
2781
+ }
2782
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioControlRegistry, decorators: [{
2783
+ type: Injectable
2784
+ }] });
2785
+ /**
2786
+ * Use radio buttons when users must select one option in a list with exclusive options out of a set of two or more options.
2787
+ * https://designlibrary.sebgroup.com/components/component-radiobutton
2788
+ */
2789
+ class NgvRadioComponent extends NgvBaseControlValueAccessorComponent$1 {
2790
+ /**
2791
+ * Creates a new RadioComponent
2792
+ * @param ngControl optional FormControl provided when component is used in a form, through dependency injection.
2793
+ * @param registry internal registry used to uncheck radio buttons with the matching name, through dependency injection.
2794
+ * @param cdr change detection reference for rendering purposes.
2795
+ */
2796
+ constructor(ngControl, translocoScope, registry, cdr) {
2797
+ super(ngControl, translocoScope, cdr);
2798
+ this.ngControl = ngControl;
2799
+ this.translocoScope = translocoScope;
2800
+ this.registry = registry;
2801
+ this.cdr = cdr;
2802
+ /** Special property used for selecting DOM elements during automated UI testing. */
2803
+ this.thook = 'radio';
2804
+ }
2805
+ ngOnInit() {
2806
+ super.ngOnInit();
2807
+ this._checkName();
2808
+ this.registry.add(this.ngControl, this);
2809
+ }
2810
+ ngOnDestroy() {
2811
+ this.registry.remove(this);
2812
+ }
2813
+ /** @internal */
2814
+ onInputChange(event) {
2815
+ event.stopPropagation();
2816
+ if (this.disabled)
2817
+ return;
2818
+ this.onChange(this.state);
2819
+ }
2820
+ /** Writes a new value of true or false based on if argument matches this components value property. */
2821
+ writeValue(value) {
2822
+ // Phantom null value on first load https://github.com/angular/angular/pull/38140
2823
+ super.writeValue(value === this.value);
2824
+ }
2825
+ /** Registers a callback function that is called when the child input element's value changes. */
2826
+ registerOnChange(fn) {
2827
+ // Override default to update registry
2828
+ this.onChange = () => {
2829
+ fn(this.value);
2830
+ this.registry.select(this);
2831
+ };
2832
+ }
2833
+ /** Checks that the name properties match and updates name property if only formControlName is given. */
2834
+ _checkName() {
2835
+ if (this.name &&
2836
+ this.formControlName &&
2837
+ this.name !== this.formControlName) {
2838
+ throw new Error(`
2839
+ If you define both a name and a formControlName attribute on your radio button, their values
2840
+ must match. Ex: <input type="radio" formControlName="food" name="food">
2841
+ `);
2842
+ }
2843
+ if (!this.name && this.formControlName)
2844
+ this.name = this.formControlName;
2845
+ }
2846
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: NgvRadioControlRegistry }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2847
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvRadioComponent, selector: "nggv-radio", inputs: { thook: "thook", formControlName: "formControlName" }, host: { properties: { "attr.data-thook": "this.thook" } }, providers: [NgvRadioControlRegistry], usesInheritance: true, ngImport: i0, template: "<!-- LOCKED INPUT -->\n<div *ngIf=\"locked && state\" class=\"sdv-field-radio-wrap\">\n <div\n [id]=\"id + '-radio'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n >\n {{ label }}\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl ?? null; context: { $implicit: value }\"\n ></ng-template>\n </div>\n</div>\n\n<!-- INPUT WRAPPER -->\n<ng-container *ngIf=\"!locked\">\n <div class=\"sdv-field-radio-wrap\">\n <!-- RADIO BUTTON FIELD -->\n <label [attr.for]=\"id + '-radio'\" class=\"form-control\">\n <input\n #input\n type=\"radio\"\n [attr.id]=\"id + '-radio'\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [autofocus]=\"autofocus\"\n [attr.aria-label]=\"description\"\n [checked]=\"state\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onInputChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <!-- LABEL -->\n {{ label }}\n <ng-template\n *ngTemplateOutlet=\"\n labelContentTpl ?? null;\n context: { $implicit: value }\n \"\n ></ng-template>\n <i></i>\n </label>\n </div>\n\n <!-- ERRORS -->\n <ng-container *transloco=\"let t; read: scope\">\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-radio'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n </ng-container>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host .nggv-field--locked{display:inline-block;border-radius:.25em;position:relative;min-height:2em;padding:.5em .75em .5em 0}:host .form-control{padding:.75rem 1rem;border:1px solid transparent;border-radius:var(--gds-sys-shape-corner-medium);align-items:center;cursor:pointer;display:flex;flex-direction:row-reverse;font:inherit;justify-content:flex-end;position:relative;user-select:none;-webkit-user-select:none}:host .form-control:has(input:disabled){cursor:not-allowed}:host label.form-control input[type=radio]{cursor:pointer;height:0;opacity:0;position:absolute;width:0;z-index:-1}:host label.form-control:has(input[type=radio]:focus-visible):focus:not(:focus-visible){box-shadow:none;outline:0}:host label.form-control:has(input[type=radio]:focus-visible):focus,:host label.form-control:has(input[type=radio]:focus-visible):focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host label.form-control input[type=radio]~i{margin-right:.75rem;margin-top:.0625rem;flex-shrink:0;position:relative;border-radius:var(--gds-comp-radio-border-radius);display:flex;height:var(--gds-comp-radio-container-height);width:var(--gds-comp-radio-container-width);box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border)}:host label.form-control input[type=radio]~i:after{content:\"\";width:100%;height:100%;border-radius:var(--gds-comp-radio-border-radius);background-color:var(--gds-comp-radio-dot);transform:scale(.5)}:host label.form-control:hover input[type=radio]:not(.disabled,:disabled)~i{box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-hover)}:host label.form-control:hover input[type=radio]:not(.disabled,:disabled)~i:after{background-color:var(--gds-comp-radio-dot-hover)}:host label.form-control input[type=radio]:checked:not(.disabled,:disabled)~i{box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-checked)}:host label.form-control input[type=radio]:checked:not(.disabled,:disabled)~i:after{background-color:var(--gds-comp-radio-dot-checked)}:host label.form-control:hover input[type=radio]:checked:not(.disabled,:disabled)~i{box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-checked-hover)}:host label.form-control:hover input[type=radio]:checked:not(.disabled,:disabled)~i:after{background-color:var(--gds-comp-radio-dot-checked-hover)}:host .was-validated label.form-control input[type=radio]:not(.is-invalid):valid~i,:host label.form-control input[type=radio].is-valid~i{--border-color: var(--intent-success-background);--sg-border-color: var(--intent-success-background)}:host .was-validated label.form-control input[type=radio]:not(.is-valid):invalid~i,:host label.form-control input[type=radio].is-invalid~i{--border-color: var(--intent-danger-background);--sg-border-color: var(--intent-danger-background)}:host label.form-control input[type=radio]:disabled~i,:host label.form-control input[type=radio].disabled~i{background-color:var(--gds-comp-radio-container-background-disabled);box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-disabled)}:host label.form-control input[type=radio]:disabled~span,:host label.form-control input[type=radio].disabled~span{color:var(--text-disabled-color)!important;cursor:not-allowed}:host label.form-control input[type=radio]:disabled~span::placeholder,:host label.form-control input[type=radio].disabled~span::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=radio]:disabled:checked~i:after,:host label.form-control input[type=radio]:checked.disabled~i:after{background-color:var(--gds-comp-radio-dot-disabled)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }] }); }
2848
+ }
2849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioComponent, decorators: [{
2850
+ type: Component,
2851
+ args: [{ selector: 'nggv-radio', providers: [NgvRadioControlRegistry], template: "<!-- LOCKED INPUT -->\n<div *ngIf=\"locked && state\" class=\"sdv-field-radio-wrap\">\n <div\n [id]=\"id + '-radio'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n >\n {{ label }}\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl ?? null; context: { $implicit: value }\"\n ></ng-template>\n </div>\n</div>\n\n<!-- INPUT WRAPPER -->\n<ng-container *ngIf=\"!locked\">\n <div class=\"sdv-field-radio-wrap\">\n <!-- RADIO BUTTON FIELD -->\n <label [attr.for]=\"id + '-radio'\" class=\"form-control\">\n <input\n #input\n type=\"radio\"\n [attr.id]=\"id + '-radio'\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [autofocus]=\"autofocus\"\n [attr.aria-label]=\"description\"\n [checked]=\"state\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"onInputChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n <!-- LABEL -->\n {{ label }}\n <ng-template\n *ngTemplateOutlet=\"\n labelContentTpl ?? null;\n context: { $implicit: value }\n \"\n ></ng-template>\n <i></i>\n </label>\n </div>\n\n <!-- ERRORS -->\n <ng-container *transloco=\"let t; read: scope\">\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-radio'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n </ng-container>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host .nggv-field--locked{display:inline-block;border-radius:.25em;position:relative;min-height:2em;padding:.5em .75em .5em 0}:host .form-control{padding:.75rem 1rem;border:1px solid transparent;border-radius:var(--gds-sys-shape-corner-medium);align-items:center;cursor:pointer;display:flex;flex-direction:row-reverse;font:inherit;justify-content:flex-end;position:relative;user-select:none;-webkit-user-select:none}:host .form-control:has(input:disabled){cursor:not-allowed}:host label.form-control input[type=radio]{cursor:pointer;height:0;opacity:0;position:absolute;width:0;z-index:-1}:host label.form-control:has(input[type=radio]:focus-visible):focus:not(:focus-visible){box-shadow:none;outline:0}:host label.form-control:has(input[type=radio]:focus-visible):focus,:host label.form-control:has(input[type=radio]:focus-visible):focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}:host label.form-control input[type=radio]~i{margin-right:.75rem;margin-top:.0625rem;flex-shrink:0;position:relative;border-radius:var(--gds-comp-radio-border-radius);display:flex;height:var(--gds-comp-radio-container-height);width:var(--gds-comp-radio-container-width);box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border)}:host label.form-control input[type=radio]~i:after{content:\"\";width:100%;height:100%;border-radius:var(--gds-comp-radio-border-radius);background-color:var(--gds-comp-radio-dot);transform:scale(.5)}:host label.form-control:hover input[type=radio]:not(.disabled,:disabled)~i{box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-hover)}:host label.form-control:hover input[type=radio]:not(.disabled,:disabled)~i:after{background-color:var(--gds-comp-radio-dot-hover)}:host label.form-control input[type=radio]:checked:not(.disabled,:disabled)~i{box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-checked)}:host label.form-control input[type=radio]:checked:not(.disabled,:disabled)~i:after{background-color:var(--gds-comp-radio-dot-checked)}:host label.form-control:hover input[type=radio]:checked:not(.disabled,:disabled)~i{box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-checked-hover)}:host label.form-control:hover input[type=radio]:checked:not(.disabled,:disabled)~i:after{background-color:var(--gds-comp-radio-dot-checked-hover)}:host .was-validated label.form-control input[type=radio]:not(.is-invalid):valid~i,:host label.form-control input[type=radio].is-valid~i{--border-color: var(--intent-success-background);--sg-border-color: var(--intent-success-background)}:host .was-validated label.form-control input[type=radio]:not(.is-valid):invalid~i,:host label.form-control input[type=radio].is-invalid~i{--border-color: var(--intent-danger-background);--sg-border-color: var(--intent-danger-background)}:host label.form-control input[type=radio]:disabled~i,:host label.form-control input[type=radio].disabled~i{background-color:var(--gds-comp-radio-container-background-disabled);box-shadow:inset 0 0 0 .05rem var(--gds-comp-radio-border-disabled)}:host label.form-control input[type=radio]:disabled~span,:host label.form-control input[type=radio].disabled~span{color:var(--text-disabled-color)!important;cursor:not-allowed}:host label.form-control input[type=radio]:disabled~span::placeholder,:host label.form-control input[type=radio].disabled~span::placeholder{color:var(--text-disabled-color)}:host label.form-control input[type=radio]:disabled:checked~i:after,:host label.form-control input[type=radio]:checked.disabled~i:after{background-color:var(--gds-comp-radio-dot-disabled)}\n"] }]
2852
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2853
+ type: Self
2854
+ }, {
2855
+ type: Optional
2856
+ }] }, { type: undefined, decorators: [{
2857
+ type: Optional
2858
+ }, {
2859
+ type: Inject,
2860
+ args: [TRANSLOCO_SCOPE]
2861
+ }] }, { type: NgvRadioControlRegistry }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
2862
+ type: HostBinding,
2863
+ args: ['attr.data-thook']
2864
+ }, {
2865
+ type: Input
2866
+ }], formControlName: [{
2867
+ type: Input
2868
+ }] } });
2869
+
2870
+ class NgvRadioModule {
2871
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2872
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, declarations: [NgvRadioComponent], imports: [CommonModule, NgvI18nModule$1], exports: [NgvRadioComponent] }); }
2873
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, imports: [CommonModule, NgvI18nModule$1] }); }
2874
+ }
2875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, decorators: [{
2876
+ type: NgModule,
2877
+ args: [{
2878
+ declarations: [NgvRadioComponent],
2879
+ imports: [CommonModule, NgvI18nModule$1],
2880
+ exports: [NgvRadioComponent],
2881
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
2882
+ }]
2883
+ }] });
2884
+
2885
+ /** Textarea fields allow users to add and edit longer or multiple line text. */
2886
+ class NgvTextareaComponent extends NgvBaseControlValueAccessorComponent$1 {
2887
+ /** Minimum length (number of characters) of value. */
2888
+ set minLength(length) {
2889
+ this._minlength = length;
2890
+ this.cdr.detectChanges();
2891
+ }
2892
+ get minlength() {
2893
+ return this._minlength;
2894
+ }
2895
+ /**
2896
+ * Minimum length (number of characters) of value.
2897
+ * @deprecated minlength triggers angular-template-validation. Use @Input() minLength instead.
2898
+ */
2899
+ set minlength(length) {
2900
+ this._minlength = length;
2901
+ this.cdr.detectChanges();
2902
+ }
2903
+ /** Maximum length (number of characters) of value. */
2904
+ set maxLength(length) {
2905
+ this._maxlength = length;
2906
+ this.cdr.detectChanges();
2907
+ }
2908
+ get maxlength() {
2909
+ return this._maxlength;
2910
+ }
2911
+ /**
2912
+ * Maximum length (number of characters) of value.
2913
+ * @deprecated maxlength triggers angular-template-validation. Use @Input() maxLength instead.
2914
+ */
2915
+ set maxlength(length) {
2916
+ this._maxlength = length;
2917
+ this.cdr.detectChanges();
2918
+ }
2919
+ /** Returns if maxlength is used */
2920
+ get hasMaxLength() {
2921
+ return !!this.maxlength && this.maxlength !== Number.MAX_SAFE_INTEGER;
2922
+ }
2923
+ constructor(ngControl, translocoScope, cdr) {
2924
+ super(ngControl, translocoScope, cdr);
2925
+ this.ngControl = ngControl;
2926
+ this.translocoScope = translocoScope;
2927
+ this.cdr = cdr;
2928
+ /** Special property used for selecting DOM elements during automated UI testing. */
2929
+ this.thook = 'textarea';
2930
+ /** If set to true, the value will not be editable. */
2931
+ this.readonly = false;
2932
+ this._maxlength = Number.MAX_SAFE_INTEGER;
2933
+ this._minlength = 0;
2934
+ }
2935
+ /** @internal */
2936
+ onInput(event) {
2937
+ event.stopPropagation();
2938
+ if (this.disabled)
2939
+ return;
2940
+ this.state = event.target.value;
2941
+ this.onChange(this.state);
2942
+ }
2943
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: TRANSLOCO_SCOPE, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2944
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgvTextareaComponent, selector: "nggv-textarea", inputs: { thook: "thook", placeholder: "placeholder", readonly: "readonly", minLength: "minLength", minlength: "minlength", maxLength: "maxLength", maxlength: "maxlength", rows: "rows" }, host: { properties: { "attr.data-thook": "this.thook" } }, usesInheritance: true, ngImport: i0, template: "<!-- LABEL -->\n<label\n [id]=\"id + '-label'\"\n class=\"sdv-field-label hide-if-empty\"\n [attr.for]=\"id + '-textarea'\"\n *transloco=\"let t; read: scope\"\n>\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n</label>\n\n<!-- DESCRIPTION -->\n<div class=\"sdv-field-label--small description\">{{ description }}</div>\n\n<!-- LOCKED INPUT -->\n<ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-textarea'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state }}\n </ng-container>\n </div>\n</ng-container>\n\n<!-- INPUT FIELD -->\n<ng-container *ngIf=\"!locked\">\n <textarea\n #input\n [id]=\"id + '-textarea'\"\n class=\"sdv-field\"\n [ngClass]=\"{ 'no-resize': !!rows }\"\n [class.nggv-field--error]=\"invalid\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [autofocus]=\"autofocus\"\n [readOnly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [attr.role]=\"role\"\n [attr.rows]=\"rows\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [value]=\"state\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n ></textarea>\n\n <!-- ERRORS -->\n <div class=\"error-wrapper\" *transloco=\"let t; read: scope\">\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-textarea'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n\n <ng-container *ngIf=\"hasMaxLength\">\n <label\n *ngvCharacterCountdown=\"\n maxlength;\n currentLength: (inputRef?.nativeElement?.value ?? '').length;\n charactersLeft as charactersLeft\n \"\n class=\"sdv-field-notice\"\n style=\"text-align: right\"\n >\n {{ charactersLeft }} {{ t('label.maxlength') }}\n </label>\n </ng-container>\n </div>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host textarea{padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);align-items:center;background-color:var(--sg-form-control-bg);color:var(--text-primary-color);display:flex;justify-content:center;resize:vertical}:host textarea:focus:not(:focus-visible){box-shadow:none;outline:0}:host textarea:focus,:host textarea:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media screen and (-ms-high-contrast: active){:host textarea{border:2px solid currentcolor}}:host textarea:hover{background-color:var(--gds-ref-pallet-base100)}:host textarea:disabled,:host textarea.disabled,:host textarea[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host textarea:disabled::placeholder,:host textarea.disabled::placeholder,:host textarea[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host label:not(.sdv-field-notice){margin-bottom:.5rem}:host label:not(.sdv-field-notice):is(label){margin-bottom:0}:host label:not(.sdv-field-notice).form-control{width:-moz-fit-content;width:fit-content}@supports (-moz-appearance: none){:host label:not(.sdv-field-notice).form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host label:not(.sdv-field-notice).form-control:focus,:host label:not(.sdv-field-notice).form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host label:not(.sdv-field-notice):not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host label:not(.sdv-field-notice)+input,:host label:not(.sdv-field-notice)+textarea,fieldset :host label:not(.sdv-field-notice)+div,:host label:not(.sdv-field-notice)+button,:host label:not(.sdv-field-notice)+.group-stepper,:host label:not(.sdv-field-notice)+.stepper-wrapper,:host label:not(.sdv-field-notice)+.group{margin-top:.5rem}:host label:not(.sdv-field-notice)+.form-info{margin-bottom:.5rem}:host label:is(.sdv-field-label){margin-bottom:.5rem}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .sdv-field-label--optional{font-weight:400}:host textarea{width:100%;max-width:100%}:host .description{margin-bottom:.5rem}:host .error-wrapper{margin-top:.5rem}:host .no-resize{resize:none}:host .no-resize::-webkit-scrollbar{-webkit-appearance:none}:host .no-resize::-webkit-scrollbar-thumb{border-radius:.5rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2945
+ }
2946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaComponent, decorators: [{
2947
+ type: Component,
2948
+ args: [{ selector: 'nggv-textarea', template: "<!-- LABEL -->\n<label\n [id]=\"id + '-label'\"\n class=\"sdv-field-label hide-if-empty\"\n [attr.for]=\"id + '-textarea'\"\n *transloco=\"let t; read: scope\"\n>\n <ng-template\n *ngTemplateOutlet=\"labelContentTpl || basicLabelContentTpl\"\n ></ng-template>\n <ng-template #basicLabelContentTpl>\n <!-- to trigger css:empty if no label was added -->\n <ng-container *ngIf=\"label\">\n {{ label }}\n <span\n *ngIf=\"optional === true || (required !== true && optional !== false)\"\n class=\"sdv-field-label--optional\"\n >\n ({{ t('label.optional') }})\n </span>\n </ng-container>\n </ng-template>\n</label>\n\n<!-- DESCRIPTION -->\n<div class=\"sdv-field-label--small description\">{{ description }}</div>\n\n<!-- LOCKED INPUT -->\n<ng-container *ngIf=\"locked\">\n <div\n [id]=\"id + '-textarea'\"\n class=\"nggv-field--locked\"\n [attr.name]=\"name\"\n [attr.value]=\"state\"\n [attr.role]=\"role\"\n >\n <span *ngIf=\"!state\" class=\"unset-state\">-</span>\n <ng-container *ngIf=\"state\">\n {{ state }}\n </ng-container>\n </div>\n</ng-container>\n\n<!-- INPUT FIELD -->\n<ng-container *ngIf=\"!locked\">\n <textarea\n #input\n [id]=\"id + '-textarea'\"\n class=\"sdv-field\"\n [ngClass]=\"{ 'no-resize': !!rows }\"\n [class.nggv-field--error]=\"invalid\"\n [attr.name]=\"name\"\n [attr.required]=\"required\"\n [disabled]=\"disabled\"\n [autofocus]=\"autofocus\"\n [readOnly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [attr.role]=\"role\"\n [attr.rows]=\"rows\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-label]=\"description\"\n [value]=\"state\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n ></textarea>\n\n <!-- ERRORS -->\n <div class=\"error-wrapper\" *transloco=\"let t; read: scope\">\n <label\n class=\"sdv-field-notice sdv-field-notice--error\"\n [attr.for]=\"id + '-textarea'\"\n *ngIf=\"invalid && (error || ngControl?.invalid)\"\n >\n <span *ngIf=\"error; else errorsRef\">{{ error }}</span>\n <ng-template #errorsRef>\n <span *ngIf=\"firstError as error\">\n {{ t('error.field' + error?.code, error?.params) }}\n </span>\n </ng-template>\n </label>\n\n <ng-container *ngIf=\"hasMaxLength\">\n <label\n *ngvCharacterCountdown=\"\n maxlength;\n currentLength: (inputRef?.nativeElement?.value ?? '').length;\n charactersLeft as charactersLeft\n \"\n class=\"sdv-field-notice\"\n style=\"text-align: right\"\n >\n {{ charactersLeft }} {{ t('label.maxlength') }}\n </label>\n </ng-container>\n </div>\n\n <!-- CHILDREN -->\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host textarea{padding:.75rem 1rem;border-radius:var(--sg-border-radius);border:solid var(--sg-border-width) var(--sg-border-color);--border-color: var(--sg-border-color);align-items:center;background-color:var(--sg-form-control-bg);color:var(--text-primary-color);display:flex;justify-content:center;resize:vertical}:host textarea:focus:not(:focus-visible){box-shadow:none;outline:0}:host textarea:focus,:host textarea:focus-visible{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}@media screen and (-ms-high-contrast: active){:host textarea{border:2px solid currentcolor}}:host textarea:hover{background-color:var(--gds-ref-pallet-base100)}:host textarea:disabled,:host textarea.disabled,:host textarea[aria-disabled=true]{background:var(--sg-form-control-bg-disabled)!important;color:var(--text-disabled-color)!important;border-color:var(--border-disabled-color)!important;cursor:not-allowed}:host textarea:disabled::placeholder,:host textarea.disabled::placeholder,:host textarea[aria-disabled=true]::placeholder{color:var(--text-disabled-color)}:host label:not(.sdv-field-notice){margin-bottom:.5rem}:host label:not(.sdv-field-notice):is(label){margin-bottom:0}:host label:not(.sdv-field-notice).form-control{width:-moz-fit-content;width:fit-content}@supports (-moz-appearance: none){:host label:not(.sdv-field-notice).form-control:focus:not(:focus-visible){box-shadow:none;outline:0}:host label:not(.sdv-field-notice).form-control:focus,:host label:not(.sdv-field-notice).form-control:focus-within{outline-color:var(--gds-sys-color-focus-outline);outline-style:solid;outline-width:.125rem;outline-offset:.125rem}}:host label:not(.sdv-field-notice):not(.form-control){font-weight:500;width:100%;line-height:1.25rem}:host label:not(.sdv-field-notice)+input,:host label:not(.sdv-field-notice)+textarea,fieldset :host label:not(.sdv-field-notice)+div,:host label:not(.sdv-field-notice)+button,:host label:not(.sdv-field-notice)+.group-stepper,:host label:not(.sdv-field-notice)+.stepper-wrapper,:host label:not(.sdv-field-notice)+.group{margin-top:.5rem}:host label:not(.sdv-field-notice)+.form-info{margin-bottom:.5rem}:host label:is(.sdv-field-label){margin-bottom:.5rem}:host .hide-if-empty:empty{display:none}:host .unset-state{padding-left:.5rem}:host .sdv-field-label--optional{font-weight:400}:host textarea{width:100%;max-width:100%}:host .description{margin-bottom:.5rem}:host .error-wrapper{margin-top:.5rem}:host .no-resize{resize:none}:host .no-resize::-webkit-scrollbar{-webkit-appearance:none}:host .no-resize::-webkit-scrollbar-thumb{border-radius:.5rem}\n"] }]
2949
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2950
+ type: Self
2951
+ }, {
2952
+ type: Optional
2953
+ }] }, { type: undefined, decorators: [{
2954
+ type: Optional
2955
+ }, {
2956
+ type: Inject,
2957
+ args: [TRANSLOCO_SCOPE]
2958
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
2959
+ type: HostBinding,
2960
+ args: ['attr.data-thook']
2961
+ }, {
2962
+ type: Input
2963
+ }], placeholder: [{
2964
+ type: Input
2965
+ }], readonly: [{
2966
+ type: Input
2967
+ }], minLength: [{
2968
+ type: Input
2969
+ }], minlength: [{
2970
+ type: Input
2971
+ }], maxLength: [{
2972
+ type: Input
2973
+ }], maxlength: [{
2974
+ type: Input
2975
+ }], rows: [{
2976
+ type: Input
2977
+ }] } });
2978
+
2979
+ class NgvTextareaModule {
2980
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2981
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, declarations: [NgvTextareaComponent], imports: [CommonModule], exports: [NgvTextareaComponent] }); }
2982
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, imports: [CommonModule] }); }
2983
+ }
2984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, decorators: [{
2985
+ type: NgModule,
2986
+ args: [{
2987
+ declarations: [NgvTextareaComponent],
2988
+ imports: [CommonModule],
2989
+ exports: [NgvTextareaComponent],
2990
+ }]
2991
+ }] });
2992
+
2993
+ /**
2994
+ * A tooltip is a text label that acts as a helper to a specific item.
2995
+ * Recommended to use value `top` or `bottom` with `placement` for responsive design.
2996
+ * Dynamic resizing and tooltip position are a work in progress.
2997
+ * https://designlibrary.sebgroup.com/components/component-tooltip
2998
+ */
2999
+ class NgvTooltipDirective {
3000
+ /** @internal Check if changes should trigger a re-render */
3001
+ static shouldUpdate(change) {
3002
+ return (change &&
3003
+ !change.firstChange &&
3004
+ change.previousValue !== change.currentValue);
3005
+ }
3006
+ constructor(anchorElementRef, renderer) {
3007
+ this.anchorElementRef = anchorElementRef;
3008
+ this.renderer = renderer;
3009
+ /** Special property used for selecting DOM elements during automated UI testing. */
3010
+ this.thook = 'tooltip';
3011
+ /** The side of the anchor which the tooltip will be rendered.
3012
+ * Recommended `top` and `bottom` for responsive designs as these are more stable.
3013
+ */
3014
+ this.placement = 'top';
3015
+ /** Initial state and subsequent updates on wether the tooltip is visible. */
3016
+ this.shown = false;
3017
+ /** How far off from the text the tooltip will be rendered. */
3018
+ this.offset = 10;
3019
+ /** How frequently the tooltip will be re-rendered when the page size changes. */
3020
+ this.resizeThrottle = 50;
3021
+ /** Numeric max-width for tooltip. */
3022
+ this.maxWidth = 343;
3023
+ /** Emits a show event triggered changing visibility state of the tooltip. */
3024
+ this.ngvShow = new EventEmitter();
3025
+ /** Emits a hide event triggered changing visibility state of the tooltip. */
3026
+ this.ngvHide = new EventEmitter();
3027
+ /** @internal */
3028
+ this.timeout = 0;
3029
+ this.anchorElement = this.anchorElementRef.nativeElement;
3030
+ this.parentElement = document.body;
3031
+ }
3032
+ ngAfterViewInit() {
3033
+ // Set a timeout to allow view to fully render before creating tooltip.
3034
+ setTimeout(() => (this.shown ? this.show(true) : this.hide(true)));
3035
+ }
3036
+ ngOnChanges(changes) {
3037
+ if (NgvTooltipDirective.shouldUpdate(changes.ngvTooltip) ||
3038
+ NgvTooltipDirective.shouldUpdate(changes.placement) ||
3039
+ NgvTooltipDirective.shouldUpdate(changes.thook)) {
3040
+ this.shown ? this.show(true) : this.hide(true);
3041
+ }
3042
+ if (NgvTooltipDirective.shouldUpdate(changes.shown)) {
3043
+ this.shown ? this.show() : this.hide();
3044
+ }
3045
+ if (NgvTooltipDirective.shouldUpdate(changes.offset)) {
3046
+ this.updatePosition();
3047
+ }
3048
+ }
3049
+ ngOnDestroy() {
3050
+ this.hide(true);
3051
+ }
3052
+ /** @internal */
3053
+ onMouseEnter() {
3054
+ this.show();
3055
+ }
3056
+ /** @internal */
3057
+ onMouseLeave() {
3058
+ this.hide();
3059
+ }
3060
+ /** @internal */
3061
+ resize() {
3062
+ if (this.timeout)
3063
+ return;
3064
+ this.timeout = window.setTimeout(() => {
3065
+ this.timeout = 0;
3066
+ this.updatePosition();
3067
+ }, this.resizeThrottle);
3068
+ }
3069
+ /**
3070
+ * Sets the visibility state of the tooltip to true and creates a new tooltip if it doesn't exist or `recreate` is set.
3071
+ * @param recreate if set to true, destroy any existing tooltip and create a new one.
3072
+ */
3073
+ show(recreate = false) {
3074
+ // Require tooltip text to create
3075
+ if (!this.ngvTooltip || this.ngvTooltip.length === 0)
3076
+ return;
3077
+ if (recreate || !this.tooltipElement) {
3078
+ this.hide(true);
3079
+ this.create(this.ngvTooltip);
3080
+ }
3081
+ else {
3082
+ this.renderer.appendChild(this.parentElement, this.tooltipElement);
3083
+ }
3084
+ this.updatePosition();
3085
+ this.shown = true;
3086
+ this.ngvShow.emit(this.tooltipElement);
3087
+ }
3088
+ /**
3089
+ * Sets the visibility state of the tooltip to false and destroys an existing tooltip if `destroy` is set.
3090
+ * @param destroy if set to true, destroy any existing tooltip.
3091
+ */
3092
+ hide(destroy = false) {
3093
+ if (!this.tooltipElement)
3094
+ return;
3095
+ if (this.parentElement.contains(this.tooltipElement))
3096
+ this.renderer.removeChild(this.parentElement, this.tooltipElement);
3097
+ if (destroy)
3098
+ this.destroy();
3099
+ this.shown = false;
3100
+ this.ngvHide.emit(this.tooltipElement);
3101
+ }
3102
+ /**
3103
+ * @internal
3104
+ * Creates a new tooltip with the set placement and a given text as its body.
3105
+ * @param text the string to be displayed in the tooltip body.
3106
+ */
3107
+ create(text) {
3108
+ this.tooltipElement = this.renderer.createElement('div');
3109
+ this.renderer.addClass(this.tooltipElement, 'gds-tooltip');
3110
+ this.renderer.setAttribute(this.tooltipElement, 'data-thook', this.thook);
3111
+ this.renderer.setStyle(this.tooltipElement, 'position', 'absolute');
3112
+ this.renderer.setStyle(this.tooltipElement, 'z-index', '1040');
3113
+ this.renderer.setStyle(this.tooltipElement, 'border-radius', '.25rem');
3114
+ this.renderer.setStyle(this.tooltipElement, 'padding', '.5rem 1rem');
3115
+ const relativeMaxWidth = this.pxToRem(this.maxWidth);
3116
+ this.renderer.setStyle(this.tooltipElement, 'max-width', relativeMaxWidth);
3117
+ this.renderer.appendChild(this.tooltipElement, this.renderer.createText(text));
3118
+ // add tooltip to DOM
3119
+ this.renderer.appendChild(this.parentElement, this.tooltipElement);
3120
+ this.arrowElement = this.renderer.createElement('div');
3121
+ this.renderer.addClass(this.arrowElement, `gds-tooltip__arrow-${this.placement}`);
3122
+ // add arrow to tooltip element
3123
+ this.renderer.appendChild(this.tooltipElement, this.arrowElement);
3124
+ }
3125
+ /**
3126
+ * @internal
3127
+ * Destroys the current tooltip by un-setting variables, should only be used after detaching elements from the DOM.
3128
+ */
3129
+ destroy() {
3130
+ this.tooltipElement = undefined;
3131
+ this.arrowElement = undefined;
3132
+ }
3133
+ /**
3134
+ * @internal
3135
+ * Recalculates the position of the tooltip.
3136
+ */
3137
+ updatePosition() {
3138
+ if (!this.tooltipElement || !this.arrowElement)
3139
+ return;
3140
+ const scrollPos = window.pageYOffset ||
3141
+ document.documentElement.scrollTop ||
3142
+ this.parentElement.scrollTop ||
3143
+ 0;
3144
+ const anchorRect = this.anchorElement.getBoundingClientRect();
3145
+ const tooltipRect = this.tooltipElement.getBoundingClientRect();
3146
+ const arrowRect = this.arrowElement.getBoundingClientRect();
3147
+ switch (this.placement) {
3148
+ case 'top':
3149
+ this.alignVertical(true, scrollPos, anchorRect, tooltipRect.width, tooltipRect.height, arrowRect.width);
3150
+ break;
3151
+ case 'bottom':
3152
+ this.alignVertical(false, scrollPos, anchorRect, tooltipRect.width, tooltipRect.height, arrowRect.width);
3153
+ break;
3154
+ case 'left':
3155
+ this.alignHorizontal(true, scrollPos, anchorRect, tooltipRect.height);
3156
+ break;
3157
+ case 'right':
3158
+ this.alignHorizontal(false, scrollPos, anchorRect, tooltipRect.height);
3159
+ break;
3160
+ default:
3161
+ return;
3162
+ }
3163
+ }
3164
+ /**
3165
+ * @internal
3166
+ * Calculates and set the position of the tooltip when the placement is `top` or `bottom`.
3167
+ */
3168
+ alignVertical(above, scrollPos, anchor, tooltipWidth, tooltipHeight, arrowWidth) {
3169
+ const width = this.parentElement.clientWidth;
3170
+ const anchorMidX = anchor.left + anchor.width / 2;
3171
+ const tooltip = {};
3172
+ const arrow = {};
3173
+ if (above)
3174
+ tooltip.top = anchor.top - tooltipHeight - this.offset + scrollPos;
3175
+ else
3176
+ tooltip.top = anchor.bottom + this.offset + scrollPos;
3177
+ if (anchorMidX < width / 2) {
3178
+ tooltip.left = Math.max(0, anchorMidX - tooltipWidth / 2);
3179
+ arrow.left = anchorMidX - tooltip.left;
3180
+ }
3181
+ else {
3182
+ tooltip.right = Math.max(0, width - (anchorMidX + tooltipWidth / 2));
3183
+ arrow.right = width - anchorMidX - tooltip.right - arrowWidth;
3184
+ }
3185
+ this.setStyle(tooltip, arrow);
3186
+ }
3187
+ /**
3188
+ * @internal
3189
+ * Calculates and set the position of the tooltip when the placement is `left` or `right`.
3190
+ */
3191
+ alignHorizontal(before, scrollPos, anchor, tooltipHeight) {
3192
+ const width = this.parentElement.clientWidth;
3193
+ const top = anchor.top + (anchor.height - tooltipHeight) / 2 + scrollPos;
3194
+ const tooltip = { top };
3195
+ const arrow = { top: tooltipHeight / 2 };
3196
+ if (before)
3197
+ tooltip.right = width - anchor.left + this.offset;
3198
+ else
3199
+ tooltip.left = anchor.right + this.offset;
3200
+ this.setStyle(tooltip, arrow);
3201
+ }
3202
+ /**
3203
+ * @internal
3204
+ * Updates the CSS properties for the tooltip position.
3205
+ */
3206
+ setStyle(tooltip, arrow) {
3207
+ // Tooltip
3208
+ Object.entries(tooltip).forEach(([prop, value]) => {
3209
+ const position = this.pxToRem(value);
3210
+ this.renderer.setStyle(this.tooltipElement, prop, position);
3211
+ });
3212
+ // Arrow
3213
+ Object.entries(arrow).forEach(([prop, value]) => {
3214
+ const position = this.pxToRem(value);
3215
+ this.renderer.setStyle(this.arrowElement, prop, position);
3216
+ });
3217
+ }
3218
+ pxToRem(value) {
3219
+ const fontSizePx = window
3220
+ ?.getComputedStyle(this.parentElement)
3221
+ ?.getPropertyValue('font-size');
3222
+ const fontSizeNumberMatch = fontSizePx?.match(/\d{1,}/);
3223
+ const fontSize = fontSizeNumberMatch ? +fontSizeNumberMatch[0] : 16;
3224
+ const remValue = value / fontSize;
3225
+ return `${remValue}rem`;
3226
+ }
3227
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
3228
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvTooltipDirective, selector: "[ngvTooltip]", inputs: { ngvTooltip: "ngvTooltip", thook: "thook", placement: "placement", shown: "shown", offset: "offset", resizeThrottle: "resizeThrottle", maxWidth: "maxWidth" }, outputs: { ngvShow: "ngvShow", ngvHide: "ngvHide" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "window:resize": "resize()" } }, usesOnChanges: true, ngImport: i0 }); }
3229
+ }
3230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipDirective, decorators: [{
3231
+ type: Directive,
3232
+ args: [{
3233
+ selector: '[ngvTooltip]',
3234
+ }]
3235
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { ngvTooltip: [{
3236
+ type: Input
3237
+ }], thook: [{
3238
+ type: Input
3239
+ }], placement: [{
3240
+ type: Input
3241
+ }], shown: [{
3242
+ type: Input
3243
+ }], offset: [{
3244
+ type: Input
3245
+ }], resizeThrottle: [{
3246
+ type: Input
3247
+ }], maxWidth: [{
3248
+ type: Input
3249
+ }], ngvShow: [{
3250
+ type: Output
3251
+ }], ngvHide: [{
3252
+ type: Output
3253
+ }], onMouseEnter: [{
3254
+ type: HostListener,
3255
+ args: ['mouseenter']
3256
+ }], onMouseLeave: [{
3257
+ type: HostListener,
3258
+ args: ['mouseleave']
3259
+ }], resize: [{
3260
+ type: HostListener,
3261
+ args: ['window:resize']
3262
+ }] } });
3263
+
3264
+ class NgvTooltipModule {
3265
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3266
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, declarations: [NgvTooltipDirective], imports: [NgvI18nModule$1], exports: [NgvTooltipDirective] }); }
3267
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, imports: [NgvI18nModule$1] }); }
3268
+ }
3269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, decorators: [{
3270
+ type: NgModule,
3271
+ args: [{
3272
+ declarations: [NgvTooltipDirective],
3273
+ exports: [NgvTooltipDirective],
3274
+ imports: [NgvI18nModule$1],
3275
+ }]
3276
+ }] });
3277
+
3278
+ class NggvModule {
3279
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3280
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, imports: [CommonModule], exports: [NgvBaseControlValueAccessorModule,
3281
+ NgvBreadcrumbsModule,
3282
+ NgvButtonModule,
3283
+ NgvCardModule,
3284
+ NgvCheckboxModule,
3285
+ NgvDropdownModule,
3286
+ NgvI18nModule,
3287
+ NgvInfoCircleModule,
3288
+ NgvInputModule,
3289
+ NgvInputMaskModule,
3290
+ NgvModalModule,
3291
+ NgvRadioModule,
3292
+ NgvTextareaModule,
3293
+ NgvTooltipModule,
3294
+ NgvTypeaheadModule] }); }
3295
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, imports: [CommonModule, NgvBaseControlValueAccessorModule,
3296
+ NgvBreadcrumbsModule,
3297
+ NgvButtonModule,
3298
+ NgvCardModule,
3299
+ NgvCheckboxModule,
3300
+ NgvDropdownModule,
3301
+ NgvI18nModule,
3302
+ NgvInfoCircleModule,
3303
+ NgvInputModule,
3304
+ NgvInputMaskModule,
3305
+ NgvModalModule,
3306
+ NgvRadioModule,
3307
+ NgvTextareaModule,
3308
+ NgvTooltipModule,
3309
+ NgvTypeaheadModule] }); }
3310
+ }
3311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, decorators: [{
3312
+ type: NgModule,
3313
+ args: [{
3314
+ declarations: [],
3315
+ imports: [CommonModule],
3316
+ exports: [
3317
+ NgvBaseControlValueAccessorModule,
3318
+ NgvBreadcrumbsModule,
3319
+ NgvButtonModule,
3320
+ NgvCardModule,
3321
+ NgvCheckboxModule,
3322
+ NgvDropdownModule,
3323
+ NgvI18nModule,
3324
+ NgvInfoCircleModule,
3325
+ NgvInputModule,
3326
+ NgvInputMaskModule,
3327
+ NgvModalModule,
3328
+ NgvRadioModule,
3329
+ NgvTextareaModule,
3330
+ NgvTooltipModule,
3331
+ NgvTypeaheadModule,
3332
+ ],
3333
+ }]
3334
+ }] });
3335
+
3336
+ /**
3337
+ * Generated bundle index. Do not edit.
3338
+ */
3339
+
3340
+ export { ButtonStyle, InputMaskFormatPipe, NggvModule, NgvBaseControlValueAccessorComponent, NgvBaseControlValueAccessorModule, NgvBreadcrumbsComponent, NgvBreadcrumbsModule, NgvButtonComponent, NgvButtonModule, NgvCardComponent, NgvCardModule, NgvCheckboxComponent, NgvCheckboxModule, NgvDialogComponent, NgvDropdownComponent, NgvDropdownListComponent, NgvDropdownModule, NgvFoldOutComponent, NgvFoldOutOptionDirective, NgvI18nModule, NgvI18nTestModule, NgvInfoCircleComponent, NgvInfoCircleModule, NgvInputComponent, NgvInputMaskDirective, NgvInputMaskModule, NgvInputModule, NgvMissingHandler, NgvModalModule, NgvRadioComponent, NgvRadioControlRegistry, NgvRadioModule, NgvSlideOutComponent, NgvTextareaComponent, NgvTextareaModule, NgvTooltipDirective, NgvTooltipModule, NgvTypeaheadDirective, NgvTypeaheadDropdownListComponent, NgvTypeaheadHighlightComponent, NgvTypeaheadInputComponent, NgvTypeaheadModule, TranslocoMockInterceptor, TranslocoMockMissingHandler, TranslocoMockPipe, TranslocoMockStrategy, TranslocoMockTranspiler, createMask };
3341
+ //# sourceMappingURL=sebgroup-green-angular-v-angular.mjs.map