@sebgroup/green-angular 4.6.1 → 4.6.3

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 (189) hide show
  1. package/esm2022/src/v-angular/base-control-value-accessor/base-control-value-accessor.component.mjs +9 -9
  2. package/esm2022/src/v-angular/button/button.component.mjs +5 -5
  3. package/esm2022/src/v-angular/character-countdown/character-countdown.directive.mjs +5 -5
  4. package/esm2022/src/v-angular/core/core.globals.mjs +3 -3
  5. package/esm2022/src/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +4 -4
  6. package/esm2022/src/v-angular/dropdown/typeahead/index.mjs +4 -1
  7. package/esm2022/src/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.mjs +5 -5
  8. package/esm2022/src/v-angular/dropdown/typeahead/typeahead.directive.mjs +177 -0
  9. package/esm2022/src/v-angular/info-circle/info-circle.component.mjs +3 -3
  10. package/esm2022/src/v-angular/input/input.component.mjs +7 -7
  11. package/esm2022/src/v-angular/input-mask/input-mask-format.pipe.mjs +5 -4
  12. package/esm2022/src/v-angular/input-mask/input-mask.directive.mjs +8 -8
  13. package/esm2022/src/v-angular/modal/dialog/dialog.component.mjs +16 -16
  14. package/esm2022/src/v-angular/modal/fold-out/fold-out.directive.mjs +3 -3
  15. package/esm2022/src/v-angular/modal/modal.globals.mjs +3 -3
  16. package/esm2022/src/v-angular/modal/slide-out/slide-out.component.mjs +15 -15
  17. package/esm2022/src/v-angular/textarea/textarea.component.mjs +4 -3
  18. package/esm2022/src/v-angular/textarea/textarea.module.mjs +5 -4
  19. package/esm2022/src/v-angular/tooltip/tooltip.directive.mjs +13 -13
  20. package/esm2022/v-angular/base-control-value-accessor/base-control-value-accessor.component.mjs +287 -0
  21. package/esm2022/v-angular/base-control-value-accessor/base-control-value-accessor.module.mjs +17 -0
  22. package/esm2022/v-angular/base-control-value-accessor/index.mjs +3 -0
  23. package/esm2022/v-angular/breadcrumbs/breadcrumbs.component.mjs +25 -0
  24. package/esm2022/v-angular/breadcrumbs/breadcrumbs.module.mjs +20 -0
  25. package/esm2022/v-angular/breadcrumbs/index.mjs +3 -0
  26. package/esm2022/v-angular/button/button.component.mjs +108 -0
  27. package/esm2022/v-angular/button/button.module.mjs +20 -0
  28. package/esm2022/v-angular/button/index.mjs +3 -0
  29. package/esm2022/v-angular/card/card.component.mjs +11 -0
  30. package/esm2022/v-angular/card/card.module.mjs +18 -0
  31. package/esm2022/v-angular/card/index.mjs +3 -0
  32. package/esm2022/v-angular/character-countdown/character-countdown.directive.mjs +51 -0
  33. package/esm2022/v-angular/character-countdown/character-countdown.module.mjs +18 -0
  34. package/esm2022/v-angular/character-countdown/index.mjs +3 -0
  35. package/esm2022/v-angular/checkbox/checkbox.component.mjs +72 -0
  36. package/esm2022/v-angular/checkbox/checkbox.module.mjs +19 -0
  37. package/esm2022/v-angular/checkbox/index.mjs +3 -0
  38. package/esm2022/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +256 -0
  39. package/esm2022/v-angular/dropdown/dropdown-list/index.mjs +2 -0
  40. package/esm2022/v-angular/dropdown/dropdown.component.mjs +239 -0
  41. package/esm2022/v-angular/dropdown/dropdown.module.mjs +22 -0
  42. package/esm2022/v-angular/dropdown/index.mjs +6 -0
  43. package/esm2022/v-angular/dropdown/typeahead/index.mjs +6 -0
  44. package/esm2022/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.mjs +98 -0
  45. package/esm2022/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.mjs +85 -0
  46. package/esm2022/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +132 -0
  47. package/esm2022/v-angular/dropdown/typeahead/typeahead.directive.mjs +177 -0
  48. package/esm2022/v-angular/dropdown/typeahead/typeahead.module.mjs +33 -0
  49. package/esm2022/v-angular/i18n/i18n.json +12 -0
  50. package/esm2022/v-angular/i18n/i18n.module.mjs +83 -0
  51. package/esm2022/v-angular/i18n/i18n.test.module.mjs +89 -0
  52. package/esm2022/v-angular/i18n/index.mjs +3 -0
  53. package/esm2022/v-angular/index.mjs +18 -0
  54. package/esm2022/v-angular/info-circle/index.mjs +3 -0
  55. package/esm2022/v-angular/info-circle/info-circle.component.mjs +28 -0
  56. package/esm2022/v-angular/info-circle/info-circle.module.mjs +21 -0
  57. package/esm2022/v-angular/input/index.mjs +3 -0
  58. package/esm2022/v-angular/input/input.component.mjs +221 -0
  59. package/esm2022/v-angular/input/input.module.mjs +32 -0
  60. package/esm2022/v-angular/input-mask/config.mjs +9 -0
  61. package/esm2022/v-angular/input-mask/constants.mjs +2 -0
  62. package/esm2022/v-angular/input-mask/index.mjs +6 -0
  63. package/esm2022/v-angular/input-mask/input-mask-format.pipe.mjs +21 -0
  64. package/esm2022/v-angular/input-mask/input-mask.directive.mjs +165 -0
  65. package/esm2022/v-angular/input-mask/input-mask.module.mjs +35 -0
  66. package/esm2022/v-angular/input-mask/input-mask.types.mjs +2 -0
  67. package/esm2022/v-angular/modal/dialog/dialog.component.mjs +190 -0
  68. package/esm2022/v-angular/modal/fold-out/fold-out.component.mjs +56 -0
  69. package/esm2022/v-angular/modal/fold-out/fold-out.directive.mjs +19 -0
  70. package/esm2022/v-angular/modal/index.mjs +6 -0
  71. package/esm2022/v-angular/modal/modal.globals.mjs +20 -0
  72. package/esm2022/v-angular/modal/modal.module.mjs +40 -0
  73. package/esm2022/v-angular/modal/modal.types.mjs +2 -0
  74. package/esm2022/v-angular/modal/slide-out/slide-out.component.mjs +229 -0
  75. package/esm2022/v-angular/radio/index.mjs +3 -0
  76. package/esm2022/v-angular/radio/radio.component.mjs +130 -0
  77. package/esm2022/v-angular/radio/radio.module.mjs +20 -0
  78. package/esm2022/v-angular/sebgroup-green-angular-v-angular.mjs +5 -0
  79. package/esm2022/v-angular/textarea/index.mjs +3 -0
  80. package/esm2022/v-angular/textarea/textarea.component.mjs +102 -0
  81. package/esm2022/v-angular/textarea/textarea.module.mjs +19 -0
  82. package/esm2022/v-angular/tooltip/index.mjs +3 -0
  83. package/esm2022/v-angular/tooltip/tooltip.directive.mjs +273 -0
  84. package/esm2022/v-angular/tooltip/tooltip.module.mjs +18 -0
  85. package/esm2022/v-angular/v-angular.module.mjs +80 -0
  86. package/fesm2022/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs +8 -8
  87. package/fesm2022/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs.map +1 -1
  88. package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs +4 -4
  89. package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs.map +1 -1
  90. package/fesm2022/sebgroup-green-angular-src-v-angular-character-countdown.mjs +4 -4
  91. package/fesm2022/sebgroup-green-angular-src-v-angular-character-countdown.mjs.map +1 -1
  92. package/fesm2022/sebgroup-green-angular-src-v-angular-core.mjs +2 -2
  93. package/fesm2022/sebgroup-green-angular-src-v-angular-core.mjs.map +1 -1
  94. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs +179 -10
  95. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs.map +1 -1
  96. package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs +2 -2
  97. package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs.map +1 -1
  98. package/fesm2022/sebgroup-green-angular-src-v-angular-input-mask.mjs +11 -10
  99. package/fesm2022/sebgroup-green-angular-src-v-angular-input-mask.mjs.map +1 -1
  100. package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs +6 -6
  101. package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs.map +1 -1
  102. package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs +33 -33
  103. package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs.map +1 -1
  104. package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs +7 -5
  105. package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs.map +1 -1
  106. package/fesm2022/sebgroup-green-angular-src-v-angular-tooltip.mjs +12 -12
  107. package/fesm2022/sebgroup-green-angular-src-v-angular-tooltip.mjs.map +1 -1
  108. package/fesm2022/sebgroup-green-angular-v-angular.mjs +3408 -0
  109. package/fesm2022/sebgroup-green-angular-v-angular.mjs.map +1 -0
  110. package/package.json +8 -2
  111. package/src/v-angular/base-control-value-accessor/base-control-value-accessor.component.d.ts +3 -3
  112. package/src/v-angular/button/button.component.d.ts +2 -2
  113. package/src/v-angular/character-countdown/character-countdown.directive.d.ts +1 -1
  114. package/src/v-angular/core/core.globals.d.ts +1 -1
  115. package/src/v-angular/dropdown/typeahead/index.d.ts +3 -0
  116. package/src/v-angular/dropdown/typeahead/typeahead.directive.d.ts +76 -0
  117. package/src/v-angular/input/input.component.d.ts +3 -3
  118. package/src/v-angular/input-mask/input-mask-format.pipe.d.ts +1 -1
  119. package/src/v-angular/input-mask/input-mask.directive.d.ts +2 -2
  120. package/src/v-angular/modal/dialog/dialog.component.d.ts +5 -5
  121. package/src/v-angular/modal/fold-out/fold-out.directive.d.ts +1 -1
  122. package/src/v-angular/modal/modal.globals.d.ts +1 -1
  123. package/src/v-angular/modal/slide-out/slide-out.component.d.ts +6 -6
  124. package/src/v-angular/textarea/textarea.module.d.ts +2 -1
  125. package/src/v-angular/tooltip/tooltip.directive.d.ts +4 -4
  126. package/v-angular/base-control-value-accessor/base-control-value-accessor.component.d.ts +124 -0
  127. package/v-angular/base-control-value-accessor/base-control-value-accessor.module.d.ts +7 -0
  128. package/v-angular/base-control-value-accessor/index.d.ts +2 -0
  129. package/v-angular/breadcrumbs/breadcrumbs.component.d.ts +18 -0
  130. package/v-angular/breadcrumbs/breadcrumbs.module.d.ts +10 -0
  131. package/v-angular/breadcrumbs/index.d.ts +2 -0
  132. package/v-angular/button/button.component.d.ts +62 -0
  133. package/v-angular/button/button.module.d.ts +10 -0
  134. package/v-angular/button/index.d.ts +2 -0
  135. package/v-angular/card/card.component.d.ts +5 -0
  136. package/v-angular/card/card.module.d.ts +8 -0
  137. package/v-angular/card/index.d.ts +2 -0
  138. package/v-angular/character-countdown/character-countdown.directive.d.ts +17 -0
  139. package/v-angular/character-countdown/character-countdown.module.d.ts +8 -0
  140. package/v-angular/character-countdown/index.d.ts +2 -0
  141. package/v-angular/checkbox/checkbox.component.d.ts +27 -0
  142. package/v-angular/checkbox/checkbox.module.d.ts +9 -0
  143. package/v-angular/checkbox/index.d.ts +2 -0
  144. package/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +89 -0
  145. package/v-angular/dropdown/dropdown-list/index.d.ts +1 -0
  146. package/v-angular/dropdown/dropdown.component.d.ts +99 -0
  147. package/v-angular/dropdown/dropdown.module.d.ts +12 -0
  148. package/v-angular/dropdown/index.d.ts +5 -0
  149. package/v-angular/dropdown/typeahead/index.d.ts +5 -0
  150. package/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.d.ts +34 -0
  151. package/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.d.ts +34 -0
  152. package/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.d.ts +59 -0
  153. package/v-angular/dropdown/typeahead/typeahead.directive.d.ts +76 -0
  154. package/v-angular/dropdown/typeahead/typeahead.module.d.ts +11 -0
  155. package/v-angular/i18n/i18n.module.d.ts +15 -0
  156. package/v-angular/i18n/i18n.test.module.d.ts +27 -0
  157. package/v-angular/i18n/index.d.ts +2 -0
  158. package/v-angular/index.d.ts +17 -0
  159. package/v-angular/info-circle/index.d.ts +2 -0
  160. package/v-angular/info-circle/info-circle.component.d.ts +16 -0
  161. package/v-angular/info-circle/info-circle.module.d.ts +10 -0
  162. package/v-angular/input/index.d.ts +2 -0
  163. package/v-angular/input/input.component.d.ts +90 -0
  164. package/v-angular/input/input.module.d.ts +11 -0
  165. package/v-angular/input-mask/config.d.ts +6 -0
  166. package/v-angular/input-mask/constants.d.ts +2 -0
  167. package/v-angular/input-mask/index.d.ts +5 -0
  168. package/v-angular/input-mask/input-mask-format.pipe.d.ts +8 -0
  169. package/v-angular/input-mask/input-mask.directive.d.ts +39 -0
  170. package/v-angular/input-mask/input-mask.module.d.ts +11 -0
  171. package/v-angular/input-mask/input-mask.types.d.ts +20 -0
  172. package/v-angular/modal/dialog/dialog.component.d.ts +55 -0
  173. package/v-angular/modal/fold-out/fold-out.component.d.ts +24 -0
  174. package/v-angular/modal/fold-out/fold-out.directive.d.ts +6 -0
  175. package/v-angular/modal/index.d.ts +5 -0
  176. package/v-angular/modal/modal.globals.d.ts +13 -0
  177. package/v-angular/modal/modal.module.d.ts +13 -0
  178. package/v-angular/modal/modal.types.d.ts +5 -0
  179. package/v-angular/modal/slide-out/slide-out.component.d.ts +76 -0
  180. package/v-angular/radio/index.d.ts +2 -0
  181. package/v-angular/radio/radio.component.d.ts +48 -0
  182. package/v-angular/radio/radio.module.d.ts +9 -0
  183. package/v-angular/textarea/index.d.ts +2 -0
  184. package/v-angular/textarea/textarea.component.d.ts +44 -0
  185. package/v-angular/textarea/textarea.module.d.ts +9 -0
  186. package/v-angular/tooltip/index.d.ts +2 -0
  187. package/v-angular/tooltip/tooltip.directive.d.ts +106 -0
  188. package/v-angular/tooltip/tooltip.module.d.ts +8 -0
  189. package/v-angular/v-angular.module.d.ts +23 -0
@@ -0,0 +1,3408 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, TemplateRef, ElementRef, Injectable, Component, Self, Optional, Inject, ContentChild, ViewChild, HostBinding, Input, Output, NgModule, Directive, ViewChildren, HostListener, SkipSelf, 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.nggv?.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.nggvFocus = new EventEmitter();
115
+ /** Emits focus events triggered by the child elements. */
116
+ this.nggvBlur = 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.nggvFocus.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.nggvBlur.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: { nggvFocus: "nggvFocus", nggvBlur: "nggvBlur" }, 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
+ }], nggvFocus: [{
308
+ type: Output
309
+ }], nggvBlur: [{
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.nggvClick = 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.nggvClick.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: { nggvClick: "nggvClick" }, 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
+ }], nggvClick: [{
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
+ class CharacterCountdownDirective {
498
+ set maxlength(value) {
499
+ if (!!value && !Number.isNaN(value)) {
500
+ this._maxlength = value;
501
+ this.updateContext();
502
+ if (!this.isViewCreated) {
503
+ this.viewContainerRef.createEmbeddedView(this.templateRef, this.context);
504
+ this.isViewCreated = true;
505
+ }
506
+ }
507
+ else {
508
+ if (this.isViewCreated) {
509
+ this.viewContainerRef.clear();
510
+ this.isViewCreated = false;
511
+ }
512
+ }
513
+ }
514
+ set currentLength(value) {
515
+ this._currentLength = value ?? 0;
516
+ this.updateContext();
517
+ }
518
+ constructor(viewContainerRef, templateRef) {
519
+ this.viewContainerRef = viewContainerRef;
520
+ this.templateRef = templateRef;
521
+ this._maxlength = Number.MAX_SAFE_INTEGER;
522
+ this._currentLength = 0;
523
+ this.isViewCreated = false;
524
+ this.context = { charactersLeft: 0 };
525
+ this.calculateCharactersLeft = (max, current) => max - current;
526
+ }
527
+ updateContext() {
528
+ this.context.charactersLeft = this.calculateCharactersLeft(this._maxlength, this._currentLength);
529
+ }
530
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CharacterCountdownDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
531
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CharacterCountdownDirective, selector: "[nggvCharacterCountdown]", inputs: { maxlength: ["nggvCharacterCountdown", "maxlength"], currentLength: ["nggvCharacterCountdownCurrentLength", "currentLength"] }, ngImport: i0 }); }
532
+ }
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CharacterCountdownDirective, decorators: [{
534
+ type: Directive,
535
+ args: [{
536
+ selector: '[nggvCharacterCountdown]',
537
+ }]
538
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { maxlength: [{
539
+ type: Input,
540
+ args: ['nggvCharacterCountdown']
541
+ }], currentLength: [{
542
+ type: Input,
543
+ args: ['nggvCharacterCountdownCurrentLength']
544
+ }] } });
545
+
546
+ class NggCharacterCountdownDirectiveModule {
547
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggCharacterCountdownDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
548
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NggCharacterCountdownDirectiveModule, declarations: [CharacterCountdownDirective], imports: [CommonModule], exports: [CharacterCountdownDirective] }); }
549
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggCharacterCountdownDirectiveModule, imports: [CommonModule] }); }
550
+ }
551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggCharacterCountdownDirectiveModule, decorators: [{
552
+ type: NgModule,
553
+ args: [{
554
+ declarations: [CharacterCountdownDirective],
555
+ imports: [CommonModule],
556
+ exports: [CharacterCountdownDirective],
557
+ }]
558
+ }] });
559
+
560
+ /**
561
+ * Checkboxes allow a user to toggle an option on or off, or make multiple choices in a set of available options.
562
+ * https://designlibrary.sebgroup.com/components/component-checkbox
563
+ */
564
+ class NgvCheckboxComponent extends NgvBaseControlValueAccessorComponent$1 {
565
+ constructor(ngControl, translocoScope, cdr) {
566
+ super(ngControl, translocoScope, cdr);
567
+ this.ngControl = ngControl;
568
+ this.translocoScope = translocoScope;
569
+ this.cdr = cdr;
570
+ /** Special property used for selecting DOM elements during automated UI testing. */
571
+ this.thook = 'checkbox';
572
+ this.optionalLabel = 'Optional';
573
+ this.valueChange = new EventEmitter();
574
+ }
575
+ /** @internal */
576
+ onInputChange(event) {
577
+ event.stopPropagation();
578
+ if (this.disabled)
579
+ return;
580
+ this.state = !this.state;
581
+ this.onTouched();
582
+ this.onChange(this.state);
583
+ }
584
+ /** Writes a new value of true or false based on if argument matches this components value property. */
585
+ writeValue(value) {
586
+ // Phantom null value on first load https://github.com/angular/angular/pull/38140
587
+ super.writeValue(value === this.value);
588
+ }
589
+ /** Registers a callback function that is called when the child input element's value changes. */
590
+ registerOnChange(fn) {
591
+ // Override default to update registry
592
+ this.onChange = (checked) => {
593
+ const output = checked ? this.value : null;
594
+ fn(output);
595
+ this.valueChange.emit(output);
596
+ };
597
+ }
598
+ 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 }); }
599
+ 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"] }] }); }
600
+ }
601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxComponent, decorators: [{
602
+ type: Component,
603
+ 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"] }]
604
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
605
+ type: Self
606
+ }, {
607
+ type: Optional
608
+ }] }, { type: undefined, decorators: [{
609
+ type: Optional
610
+ }, {
611
+ type: Inject,
612
+ args: [TRANSLOCO_SCOPE]
613
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
614
+ type: HostBinding,
615
+ args: ['attr.data-thook']
616
+ }, {
617
+ type: Input
618
+ }], optionalLabel: [{
619
+ type: Input
620
+ }], valueChange: [{
621
+ type: Output
622
+ }] } });
623
+
624
+ class NgvCheckboxModule {
625
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
626
+ 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] }); }
627
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, imports: [CommonModule, NgvI18nModule$1] }); }
628
+ }
629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvCheckboxModule, decorators: [{
630
+ type: NgModule,
631
+ args: [{
632
+ declarations: [NgvCheckboxComponent],
633
+ imports: [CommonModule, NgvI18nModule$1],
634
+ exports: [NgvCheckboxComponent],
635
+ }]
636
+ }] });
637
+
638
+ class NgvTypeaheadHighlightComponent {
639
+ constructor() {
640
+ this.text = '';
641
+ this.input = '';
642
+ /**
643
+ * Regexp of characters that are allowed in textContent without being found in textToHighlight
644
+ * Allow whitespaces.
645
+ * */
646
+ this.allowedNonMatchingChars = new RegExp(/\s/);
647
+ }
648
+ ngOnChanges(changes) {
649
+ const { textContent, textToHighlight } = changes;
650
+ if (textContent?.currentValue != null)
651
+ this.text = `${textContent.currentValue}`;
652
+ if (textToHighlight?.currentValue != null)
653
+ this.input = `${textToHighlight.currentValue}`;
654
+ this.updateValues();
655
+ }
656
+ updateValues() {
657
+ const splittedText = this.text.toLocaleLowerCase().split('');
658
+ const splittedInput = this.input.toLocaleLowerCase().split('');
659
+ const { start, end } = this.getHighlightedPart(splittedText, splittedInput);
660
+ // If user input is not found within the textcontent, reset options and return.
661
+ if (start === -1 || end === -1) {
662
+ this.prefix = this.match = this.suffix = '';
663
+ return;
664
+ }
665
+ this.prefix = this.text.substring(0, start);
666
+ this.match = this.text.substring(start, end);
667
+ this.suffix = this.text.substring(end);
668
+ }
669
+ /**
670
+ * Function that finds the start and end index of where the input is located within the text to display.
671
+ * First occurence is returned. Allows for spaces to occur despite input not matching space.
672
+ * Loops through each character in splittedText and when a char in splittedText equlas the first character of
673
+ * splittedInput, evaluate wether it's match on the entire input.
674
+ * - If it's => return indexes.
675
+ * - If it's not => break out and check next char in outer loop.
676
+ * @param splittedText the text content splitted in an array
677
+ * @param splittedInput the input splitted in an array
678
+ * @returns { start: number, end: number } Indexes of where the match starts and ends in the text displatyed
679
+ */
680
+ getHighlightedPart(splittedText, splittedInput) {
681
+ let start = -1;
682
+ let end = -1;
683
+ for (let i = 0; i < splittedText.length; i++) {
684
+ // If start and end have been set, break and return
685
+ if (start > -1 || end > -1)
686
+ break;
687
+ // If current char match first in input, try see if whole input match from that index
688
+ if (splittedText[i] === splittedInput[0]) {
689
+ let matches = 1;
690
+ for (let t = 1; t <= splittedText.length; t++) {
691
+ // If match on last character of input, we're finished.
692
+ if (matches === splittedInput.length) {
693
+ start = i;
694
+ end = start + t;
695
+ break;
696
+ }
697
+ if (splittedText[t + i] === splittedInput[matches])
698
+ matches++;
699
+ else if (this.allowedNonMatchingChars.test(splittedText[t + i]))
700
+ continue; // Ignore whitespace, continue
701
+ else
702
+ break; // No match, break out of inner loop to check next char in text
703
+ }
704
+ }
705
+ }
706
+ return { start, end };
707
+ }
708
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
709
+ 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"] }] }); }
710
+ }
711
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadHighlightComponent, decorators: [{
712
+ type: Component,
713
+ 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"] }]
714
+ }], propDecorators: { textContent: [{
715
+ type: Input
716
+ }], textToHighlight: [{
717
+ type: Input
718
+ }] } });
719
+
720
+ class NgvDropdownListComponent {
721
+ set expanded(state) {
722
+ this.setExpanded(state);
723
+ }
724
+ get expanded() {
725
+ return this._expanded;
726
+ }
727
+ constructor(translocoScope) {
728
+ this.translocoScope = translocoScope;
729
+ /** The additional amount to show when option is scrolled into view. */
730
+ this.scrollOffset = 24;
731
+ /** Id of the host element and is accessible by the children, automatically generated if not provided. */
732
+ this.id = window.nggv?.nextId();
733
+ /** Special property used for selecting DOM elements during automated UI testing. */
734
+ this.thook = 'dropdown';
735
+ this.selectedValueChanged = new EventEmitter();
736
+ this.closed = new EventEmitter();
737
+ /** The current active option based on numeric index. */
738
+ this.activeIndex = -1;
739
+ this.dropdownUtils = new DropdownUtils();
740
+ this._expanded = false;
741
+ this.closed$ = new Subject();
742
+ if (this.translocoScope)
743
+ this.scope = this.translocoScope.toString();
744
+ }
745
+ ngOnInit() {
746
+ if (this.state)
747
+ this.activeIndex = this.options.findIndex((option) => option.key === this.state.key);
748
+ }
749
+ ngOnChanges(changes) {
750
+ if (!!changes.state && !changes.state.firstChange)
751
+ this.selectedValue = changes.state.currentValue;
752
+ if (!!changes.options?.currentValue?.length && this.expanded)
753
+ this.refreshSelectedOption();
754
+ }
755
+ /**
756
+ * Returns true if argument is an {@link OptionGroup}.
757
+ * @param option the object to check.
758
+ */
759
+ isGroup(option) {
760
+ return 'options' in option;
761
+ }
762
+ /** @internal */
763
+ updateState(option, event) {
764
+ if (option.disabled)
765
+ return;
766
+ this.selectedValue = option;
767
+ this.state = option;
768
+ this.selectedValueChanged.emit(option);
769
+ this.setExpanded(false);
770
+ event.stopPropagation();
771
+ }
772
+ /**
773
+ * @internal
774
+ */
775
+ setExpanded(expanded = true) {
776
+ // update expanded state
777
+ this._expanded = expanded;
778
+ if (expanded)
779
+ this.refreshSelectedOption();
780
+ else {
781
+ this.closed$.next(true);
782
+ this.onClickSubscription?.unsubscribe();
783
+ }
784
+ }
785
+ /**
786
+ * @internal
787
+ */
788
+ refreshSelectedOption() {
789
+ const options = this.dropdownUtils.flattenOptions(this.options, !this.optionContentTpl);
790
+ this.activeIndex = this.getActiveIndex();
791
+ this.state = options[this.activeIndex];
792
+ this.scrollToResult(this.state);
793
+ }
794
+ /**
795
+ * @internal
796
+ * @returns The active index (number) if option is found, -1 otherwise.
797
+ * - If a selectedValue exists that's not nullish and that options is found, return that index
798
+ * - Else, return first non nullish index
799
+ * - If none of the above criterias are met, -1 are returned
800
+ */
801
+ getActiveIndex() {
802
+ if (!!this.selectedValue && this.selectedValue?.key != null) {
803
+ const selectedIndex = this.dropdownUtils
804
+ .flattenOptions(this.options, !this.optionContentTpl)
805
+ .findIndex((option) => option.key != null && option.key === this.selectedValue?.key);
806
+ if (selectedIndex > -1)
807
+ return selectedIndex;
808
+ }
809
+ return this.dropdownUtils
810
+ .flattenOptions(this.options, !this.optionContentTpl)
811
+ .findIndex((option) => option.key != null);
812
+ }
813
+ /**
814
+ * @internal
815
+ * evaluates wether the HTML element overflows
816
+ * @param elem The HTMLElement to evaluate
817
+ * */
818
+ isOverflow(elem) {
819
+ return elem.offsetWidth < elem.scrollWidth;
820
+ }
821
+ /**
822
+ * Typecast anything to an {@link OptionGroup}.
823
+ * @param group the object to typecast.
824
+ */
825
+ castGroup(group) {
826
+ return group;
827
+ }
828
+ /**
829
+ * @internal
830
+ * Disables default events.
831
+ * @param event fired containing which key was pressed.
832
+ */
833
+ onKeyDown(event) {
834
+ switch (event.key) {
835
+ case 'Enter': // Disable form submission
836
+ case 'ArrowUp': // Disable scrolling up
837
+ case 'ArrowDown': // Disable scrolling down
838
+ event.preventDefault();
839
+ event.stopPropagation();
840
+ return false;
841
+ }
842
+ return true;
843
+ }
844
+ /**
845
+ * @internal
846
+ * Enter toggles the dropdown, home, end, and, arrows change the index.
847
+ * @param event fired containing which key was released.
848
+ */
849
+ onKeyUp(event) {
850
+ if (!this.expanded)
851
+ return;
852
+ const options = this.dropdownUtils.flattenOptions(this.options, !this.optionContentTpl);
853
+ let option;
854
+ switch (event.key) {
855
+ case 'Escape':
856
+ this.setExpanded(false);
857
+ this.closed.emit();
858
+ break;
859
+ case 'Enter': // Select the currently chosen value
860
+ option = options[this.activeIndex];
861
+ this.updateState(option, event);
862
+ break;
863
+ case 'Home': // Move to the first option
864
+ this.activeIndex = 0;
865
+ option = options[this.activeIndex];
866
+ this.state = option;
867
+ this.scrollToResult(option);
868
+ break;
869
+ case 'ArrowUp': // Move up one step to the previous option
870
+ if (this.activeIndex > 0)
871
+ this.activeIndex--;
872
+ else if (this.activeIndex === 0)
873
+ this.activeIndex = options.length - 1;
874
+ option = options[this.activeIndex];
875
+ this.state = option;
876
+ this.scrollToResult(option);
877
+ break;
878
+ case 'ArrowDown': // Move down one step to the next option
879
+ if (options.length > this.activeIndex + 1)
880
+ this.activeIndex++;
881
+ else if (this.activeIndex === options.length - 1)
882
+ this.activeIndex = 0;
883
+ option = options[this.activeIndex];
884
+ this.state = option;
885
+ this.scrollToResult(option);
886
+ break;
887
+ case 'End': // Move to the last options
888
+ this.activeIndex = options.length - 1;
889
+ option = options[this.activeIndex];
890
+ this.state = option;
891
+ this.scrollToResult(option);
892
+ break;
893
+ }
894
+ }
895
+ /**
896
+ * Scrolls focused result into view with a specified offset.
897
+ * @param key the result index which to scroll to.
898
+ */
899
+ scrollToResult(option) {
900
+ if (!this.optionRefs || !option)
901
+ return;
902
+ const optionRef = this.optionRefs.find((li) => li.nativeElement.id === this.id + '-option-' + option.key);
903
+ const offset = this.scrollOffset;
904
+ if (optionRef) {
905
+ let delta = window.scrollY || document.documentElement.scrollTop;
906
+ // The list seems not to be visible at the time of scrolling, but this setTimeout "hack" makes it work...
907
+ setTimeout(() => {
908
+ scrollIntoView(optionRef.nativeElement, {
909
+ scrollMode: 'if-needed',
910
+ block: 'nearest',
911
+ });
912
+ delta -= window.scrollY || document.documentElement.scrollTop;
913
+ if (delta)
914
+ window.scrollBy(0, delta > 0 ? -offset : offset);
915
+ }, 0);
916
+ }
917
+ }
918
+ 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 }); }
919
+ 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 [nggvTooltip]=\"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 nggvToolTip 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: "[nggvTooltip]", inputs: ["nggvTooltip", "thook", "placement", "shown", "offset", "resizeThrottle", "maxWidth"], outputs: ["nggvShow", "nggvHide"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }] }); }
920
+ }
921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownListComponent, decorators: [{
922
+ type: Component,
923
+ 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 [nggvTooltip]=\"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 nggvToolTip 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"] }]
924
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
925
+ type: Optional
926
+ }, {
927
+ type: Inject,
928
+ args: [TRANSLOCO_SCOPE]
929
+ }] }]; }, propDecorators: { expanded: [{
930
+ type: Input
931
+ }], state: [{
932
+ type: Input
933
+ }], scrollOffset: [{
934
+ type: Input
935
+ }], optionContentTpl: [{
936
+ type: Input
937
+ }], optionRefs: [{
938
+ type: ViewChildren,
939
+ args: ['optionRefs']
940
+ }], id: [{
941
+ type: HostBinding,
942
+ args: ['attr.id']
943
+ }, {
944
+ type: Input
945
+ }], thook: [{
946
+ type: HostBinding,
947
+ args: ['attr.data-thook']
948
+ }, {
949
+ type: Input
950
+ }], options: [{
951
+ type: Input
952
+ }], textToHighlight: [{
953
+ type: Input
954
+ }], selectedValueChanged: [{
955
+ type: Output
956
+ }], closed: [{
957
+ type: Output
958
+ }], onKeyDown: [{
959
+ type: HostListener,
960
+ args: ['document:keydown', ['$event']]
961
+ }], onKeyUp: [{
962
+ type: HostListener,
963
+ args: ['document:keyup', ['$event']]
964
+ }] } });
965
+
966
+ /**
967
+ * A dropdown allows the user to select an option from a list.
968
+ * Dropdowns enables users to make a quick selection of the available options for a specific entry.
969
+ * https://designlibrary.sebgroup.com/components/component-dropdown
970
+ */
971
+ class NgvDropdownComponent extends NgvBaseControlValueAccessorComponent$1 {
972
+ /** List of {@link Option} and {@link OptionGroup} listed when dropdown is expanded. */
973
+ set options(value) {
974
+ // update options
975
+ this._options = value;
976
+ // already has a null/undefined key
977
+ const nullishOption = this.dropdownUtils
978
+ .flattenOptions(value, false)
979
+ .find((option) => option.key == null);
980
+ // if the dropdown is optional, add a null value to deselect option
981
+ if (!this.required && !nullishOption && this.allowControlNullishOption) {
982
+ this._options = [this.defaultNullishOption].concat(this._options);
983
+ }
984
+ // set default value and emit if there is only one option
985
+ if (value.length === 1 && this.required && this.selectOnSingleOption) {
986
+ const onlyOption = this.dropdownUtils.flattenOptions(value, false)[0];
987
+ this.updateModel(onlyOption);
988
+ return;
989
+ }
990
+ // don't update local state if we shouldn't control nullish value and we cant find the selected value amongst the options
991
+ const matchingOption = this.dropdownUtils
992
+ .flattenOptions(value, false)
993
+ .find((option) => option.key == this.ngControl?.value);
994
+ if (!this.allowControlNullishOption && !matchingOption)
995
+ return;
996
+ // Update local state
997
+ this.writeValue(this.ngControl?.value);
998
+ }
999
+ get options() {
1000
+ return this._options;
1001
+ }
1002
+ /** @internal nullish option. */
1003
+ get defaultNullishOption() {
1004
+ return { key: null, label: this.placeholder ?? '\u00A0' };
1005
+ }
1006
+ constructor(ngControl, translocoScope, cdr, dropdownUtils) {
1007
+ super(ngControl, translocoScope, cdr);
1008
+ this.ngControl = ngControl;
1009
+ this.translocoScope = translocoScope;
1010
+ this.cdr = cdr;
1011
+ this.dropdownUtils = dropdownUtils;
1012
+ /** Special property used for selecting DOM elements during automated UI testing. */
1013
+ this.thook = 'dropdown';
1014
+ /** The additional amount to show when option is scrolled into view. */
1015
+ this.scrollOffset = 24;
1016
+ /**
1017
+ * Allow this component to add/ remove nullish options based on wether the control is required or not
1018
+ * Defaults to true.
1019
+ */
1020
+ this.allowControlNullishOption = true;
1021
+ /**
1022
+ * If only one option exists in options[], default is to select it.
1023
+ * This input can be used to alter that behaviour so it doesn't automatically
1024
+ * select a value if it's the only one.
1025
+ * Defaults to true.
1026
+ */
1027
+ this.selectOnSingleOption = true;
1028
+ /**
1029
+ * Emits changes of the expanded state of the dropdown
1030
+ */
1031
+ this.expandedChange = new EventEmitter();
1032
+ /** The current expanded state of the dropdown options. */
1033
+ this.expanded = false;
1034
+ /** The current option selected based on numeric index. */
1035
+ this.activeIndex = -1;
1036
+ this.keyEvent = {};
1037
+ this._options = [];
1038
+ }
1039
+ ngOnChanges(changes) {
1040
+ if (changes.required?.currentValue !== undefined) {
1041
+ const isRequired = changes.required.currentValue;
1042
+ // remove nullish option
1043
+ const hasNullishOption = this.dropdownUtils.flattenOptions(this._options, false)[0]?.key == null;
1044
+ // if required, remove nullish option
1045
+ if (isRequired && hasNullishOption && this.allowControlNullishOption) {
1046
+ this._options = this._options.slice(1);
1047
+ return;
1048
+ }
1049
+ // if not required, add nullish option
1050
+ if (!isRequired && !hasNullishOption && this.allowControlNullishOption) {
1051
+ this._options = [this.defaultNullishOption].concat(this._options);
1052
+ return;
1053
+ }
1054
+ }
1055
+ }
1056
+ ngOnDestroy() {
1057
+ this.onClickSubscription?.unsubscribe();
1058
+ }
1059
+ /** @internal override to correctly set state from form value */
1060
+ writeValue(value) {
1061
+ const options = this.dropdownUtils.flattenOptions(this._options, false);
1062
+ this.state = options.find((option) => option.key === value);
1063
+ }
1064
+ // ----------------------------------------------------------------------------
1065
+ // EVENTS
1066
+ // ----------------------------------------------------------------------------
1067
+ /** @internal */
1068
+ onSelectChange(option) {
1069
+ if (option.disabled)
1070
+ return;
1071
+ this.updateModel(option);
1072
+ this.setExpanded(false);
1073
+ }
1074
+ // /**
1075
+ // * @internal
1076
+ // * Enter toggles the dropdown, home, end, and, arrows change the index.
1077
+ // * @param event fired containing which key was released.
1078
+ // */
1079
+ onKeyUp(event) {
1080
+ this.keyEvent = event;
1081
+ }
1082
+ /**
1083
+ * Closes the dropdown on click outside.
1084
+ */
1085
+ subscribeToOutsideClickEvent() {
1086
+ this.onClickSubscription = fromEvent(document, 'click').subscribe({
1087
+ next: (event) => {
1088
+ if (this.expanded &&
1089
+ !this.inputRef?.nativeElement.contains(event.target)) {
1090
+ this.toggleDropdown();
1091
+ this.onClickSubscription?.unsubscribe();
1092
+ }
1093
+ },
1094
+ });
1095
+ }
1096
+ // ----------------------------------------------------------------------------
1097
+ // HELPERS
1098
+ // ----------------------------------------------------------------------------
1099
+ /**
1100
+ * Set the dropdown value to given option.
1101
+ * @param value the dropdown option to select.
1102
+ */
1103
+ updateModel(value) {
1104
+ this.state = value;
1105
+ this.onChange(value.key);
1106
+ }
1107
+ /** Toggle the expanded state of the dropdown options. */
1108
+ toggleDropdown() {
1109
+ this.setExpanded(!this.expanded);
1110
+ this.cdr.detectChanges();
1111
+ }
1112
+ /**
1113
+ * Set the expanded state of the dropdown options. If true the options are shown below the field.
1114
+ * Activate on click event to be able to close dropdown on click outside.
1115
+ * @param state the expanded state which to set.
1116
+ */
1117
+ setExpanded(state = true) {
1118
+ this.expanded = state;
1119
+ this.expandedChange.emit(this.expanded);
1120
+ if (this.expanded)
1121
+ this.subscribeToOutsideClickEvent();
1122
+ if (!this.expanded)
1123
+ this.onTouched();
1124
+ }
1125
+ /* TYPE CASTS */
1126
+ /**
1127
+ * Typecast anything to an {@link Option}.
1128
+ * @param option the object to typecast.
1129
+ */
1130
+ castOption(option) {
1131
+ return option;
1132
+ }
1133
+ /**
1134
+ * Typecast anything to an {@link OptionGroup}.
1135
+ * @param group the object to typecast.
1136
+ */
1137
+ castGroup(group) {
1138
+ return group;
1139
+ }
1140
+ /* TYPE CHECKS */
1141
+ /**
1142
+ * Returns true if argument is an {@link Option}.
1143
+ * @param option the object to check.
1144
+ */
1145
+ isOption(option) {
1146
+ return !('options' in option);
1147
+ }
1148
+ 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 }); }
1149
+ 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"] }] }); }
1150
+ }
1151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownComponent, decorators: [{
1152
+ type: Component,
1153
+ 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"] }]
1154
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
1155
+ type: Self
1156
+ }, {
1157
+ type: Optional
1158
+ }] }, { type: undefined, decorators: [{
1159
+ type: Optional
1160
+ }, {
1161
+ type: Inject,
1162
+ args: [TRANSLOCO_SCOPE]
1163
+ }] }, { type: i0.ChangeDetectorRef }, { type: i2$2.DropdownUtils }]; }, propDecorators: { selectedContentTpl: [{
1164
+ type: ContentChild,
1165
+ args: ['selectedTpl', { read: TemplateRef }]
1166
+ }], optionContentTpl: [{
1167
+ type: ContentChild,
1168
+ args: ['optionTpl', { read: TemplateRef }]
1169
+ }], thook: [{
1170
+ type: HostBinding,
1171
+ args: ['attr.data-thook']
1172
+ }, {
1173
+ type: Input
1174
+ }], placeholder: [{
1175
+ type: Input
1176
+ }], options: [{
1177
+ type: Input
1178
+ }], scrollOffset: [{
1179
+ type: Input
1180
+ }], allowControlNullishOption: [{
1181
+ type: Input
1182
+ }], textToHighlight: [{
1183
+ type: Input
1184
+ }], selectOnSingleOption: [{
1185
+ type: Input
1186
+ }], expandedChange: [{
1187
+ type: Output
1188
+ }], onKeyUp: [{
1189
+ type: HostListener,
1190
+ args: ['keyup', ['$event']]
1191
+ }] } });
1192
+
1193
+ class NgvTypeaheadInputComponent extends NgvInputComponent$1 {
1194
+ get dropdownButton() {
1195
+ return this.hostComponent.inputRef?.nativeElement;
1196
+ }
1197
+ constructor(element, renderer2, ngControl, translocoScope, cdr) {
1198
+ super(ngControl, translocoScope, cdr);
1199
+ this.element = element;
1200
+ this.renderer2 = renderer2;
1201
+ this.ngControl = ngControl;
1202
+ this.translocoScope = translocoScope;
1203
+ this.cdr = cdr;
1204
+ /** Boolean to indicate wether the dropdown is expanded or not, to apply appropriate styling */
1205
+ this.expanded = false;
1206
+ super.ngOnInit();
1207
+ }
1208
+ ngOnInit() {
1209
+ this.autocomplete = 'off';
1210
+ this.debounceTime = 0;
1211
+ this.hostComponent.selectOnSingleOption = false;
1212
+ this.moveInput();
1213
+ this.handleExpandedChange();
1214
+ }
1215
+ /**
1216
+ * @internal
1217
+ * Allow space to be inputted as text
1218
+ * @param event fired containing which key was released.
1219
+ */
1220
+ onKeyUp(event) {
1221
+ if (event.code === 'Space') {
1222
+ event.preventDefault();
1223
+ }
1224
+ }
1225
+ /**
1226
+ * @internal
1227
+ * First time the dropdown is expanded, move the input sp it becomes a child of the dropdown button
1228
+ * to better reflect semantics and styling.
1229
+ */
1230
+ moveInput() {
1231
+ // Workaround to execute code in setTimeout due to hooks management etc.
1232
+ setTimeout(() => {
1233
+ // Only move if parent dropdown is found
1234
+ if (this.dropdownButton) {
1235
+ this.renderer2.appendChild(this.dropdownButton.querySelector('button'), this.element.nativeElement);
1236
+ // Get the height of the parent button so the input can be explicitly set to the same height since it's absolutely positioned
1237
+ this.buttonHeight =
1238
+ this.dropdownButton.getBoundingClientRect().height || 32; // Default to 2em;
1239
+ }
1240
+ }, 0);
1241
+ }
1242
+ /**
1243
+ * @internal
1244
+ * When dropdown is expanded, focus on the input. If a value is selected, set it in the input.
1245
+ * When the dropdown is collapsed, empty the input from text.
1246
+ */
1247
+ handleExpandedChange() {
1248
+ this.hostComponent.expandedChange
1249
+ .pipe(takeUntil$1(this._destroy$))
1250
+ .subscribe((state) => {
1251
+ this.expanded = state;
1252
+ if (this.expanded) {
1253
+ // Weird workaround for setting focus. Didn't set focus, but wrapping in setTimeout solved it.
1254
+ // See suggestion here: https://github.com/ionic-team/stencil/issues/3772#issuecomment-1292599609
1255
+ setTimeout(() => this.setFocus());
1256
+ // Format and interpolate result since return type can be other than string from the formatter
1257
+ const formattedValue = `${this.formatSelected(this.hostComponent.state)}`;
1258
+ this.setInput(formattedValue, false);
1259
+ }
1260
+ else
1261
+ this.setInput('', true);
1262
+ });
1263
+ }
1264
+ /**
1265
+ * @internal Formats the selected option to display in the input. Interpolate the returned value
1266
+ * since we don't know the return type or label type.
1267
+ * @param value The selected value
1268
+ * @returns The formatted value
1269
+ */
1270
+ formatSelected(value) {
1271
+ if (value?.key == null)
1272
+ return '';
1273
+ // If no formatter exists, return the label or empty string
1274
+ if (!this.selectedFormatter)
1275
+ return value.label ?? '';
1276
+ // If a formatter exists, use it
1277
+ return this.selectedFormatter(value) ?? '';
1278
+ }
1279
+ /**
1280
+ * Sets the input programmatically instead of native HTML input event.
1281
+ * @param input
1282
+ */
1283
+ setInput(input, triggerFilter) {
1284
+ this.state = input;
1285
+ if (triggerFilter) {
1286
+ this.onChange(this.state);
1287
+ this.inputChange$.next(this.state);
1288
+ }
1289
+ }
1290
+ 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 }); }
1291
+ 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"] }] }); }
1292
+ }
1293
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadInputComponent, decorators: [{
1294
+ type: Component,
1295
+ 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"] }]
1296
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.NgControl, decorators: [{
1297
+ type: Self
1298
+ }, {
1299
+ type: Optional
1300
+ }] }, { type: undefined, decorators: [{
1301
+ type: Optional
1302
+ }, {
1303
+ type: Inject,
1304
+ args: [TRANSLOCO_SCOPE]
1305
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostComponent: [{
1306
+ type: Input
1307
+ }], resultFormatter: [{
1308
+ type: Input
1309
+ }], selectedFormatter: [{
1310
+ type: Input
1311
+ }], onKeyUp: [{
1312
+ type: HostListener,
1313
+ args: ['document:keyup', ['$event']]
1314
+ }] } });
1315
+
1316
+ // Use dropdownList template and combine stylesheets
1317
+ class NgvTypeaheadDropdownListComponent extends NgvDropdownListComponent {
1318
+ constructor(translocoScope, element) {
1319
+ super(translocoScope);
1320
+ this.translocoScope = translocoScope;
1321
+ this.element = element;
1322
+ this._destroy$ = new Subject();
1323
+ }
1324
+ ngOnInit() {
1325
+ this.handleSelectedValueChanges();
1326
+ this.handleFocusChanges();
1327
+ }
1328
+ ngOnDestroy() {
1329
+ this._destroy$.next(true);
1330
+ this._destroy$.complete();
1331
+ }
1332
+ /** @Internal Subscribe to click outside dropdownList and input to close dropdownList */
1333
+ subscribeToOutsideClickEvent() {
1334
+ this.onClickSubscription = fromEvent(document, 'click')
1335
+ .pipe(takeUntil$1(this._destroy$))
1336
+ .subscribe({
1337
+ next: (event) => {
1338
+ if (this.expanded &&
1339
+ !this.element.nativeElement.contains(event.target) &&
1340
+ !this.hostComponent.inputRef?.nativeElement.contains(event.target)) {
1341
+ this.setExpanded(false);
1342
+ this.onClickSubscription?.unsubscribe();
1343
+ }
1344
+ },
1345
+ });
1346
+ }
1347
+ /** @Internal Update state of the host-input to reflect the selected value */
1348
+ handleSelectedValueChanges() {
1349
+ this.selectedValueChanged
1350
+ .pipe(takeUntil$1(this._destroy$))
1351
+ .subscribe((selected) => {
1352
+ if (this.hostComponent.inputRef) {
1353
+ this.hostComponent.state = `${this.formatSelected(selected)}`;
1354
+ }
1355
+ });
1356
+ }
1357
+ /** @Internal Expand the dropdown when input receives focus. If no state, set empty string in input */
1358
+ handleFocusChanges() {
1359
+ this.hostComponent.nggvFocus
1360
+ .asObservable()
1361
+ .pipe(takeUntil$1(this._destroy$))
1362
+ .subscribe(() => {
1363
+ if (!this.state)
1364
+ this.hostComponent.nggvInput.emit('');
1365
+ this.setExpanded(true);
1366
+ this.subscribeToOutsideClickEvent();
1367
+ });
1368
+ }
1369
+ /**
1370
+ * @internal Formats the selected option to display in the input. Interpolate the returned value
1371
+ * since we don't know the return type or label type.
1372
+ * @param value The selected value
1373
+ * @returns The formatted value
1374
+ */
1375
+ formatSelected(value) {
1376
+ if (value?.key == null)
1377
+ return '';
1378
+ //If no formatter exists, return the label or empty string
1379
+ if (!this.selectedFormatter)
1380
+ return value.label ?? '';
1381
+ // If a formatter exists, use it
1382
+ return this.selectedFormatter(value) ?? '';
1383
+ }
1384
+ 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 }); }
1385
+ 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 [nggvTooltip]=\"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 nggvToolTip 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: "[nggvTooltip]", inputs: ["nggvTooltip", "thook", "placement", "shown", "offset", "resizeThrottle", "maxWidth"], outputs: ["nggvShow", "nggvHide"] }, { kind: "component", type: NgvTypeaheadHighlightComponent, selector: "nggv-typeahead-highlight", inputs: ["textContent", "textToHighlight"] }] }); }
1386
+ }
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadDropdownListComponent, decorators: [{
1388
+ type: Component,
1389
+ 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 [nggvTooltip]=\"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 nggvToolTip 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"] }]
1390
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1391
+ type: SkipSelf
1392
+ }, {
1393
+ type: Optional
1394
+ }, {
1395
+ type: Inject,
1396
+ args: [TRANSLOCO_SCOPE]
1397
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { hostComponent: [{
1398
+ type: Input
1399
+ }], resultFormatter: [{
1400
+ type: Input
1401
+ }], selectedFormatter: [{
1402
+ type: Input
1403
+ }] } });
1404
+
1405
+ class NgvTypeaheadModule {
1406
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1407
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, declarations: [NgvTypeaheadHighlightComponent,
1408
+ NgvTypeaheadInputComponent,
1409
+ NgvTypeaheadDropdownListComponent], imports: [CommonModule, NgvTooltipModule$1], exports: [NgvTypeaheadHighlightComponent,
1410
+ NgvTypeaheadInputComponent,
1411
+ NgvTypeaheadDropdownListComponent] }); }
1412
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, imports: [CommonModule, NgvTooltipModule$1] }); }
1413
+ }
1414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadModule, decorators: [{
1415
+ type: NgModule,
1416
+ args: [{
1417
+ declarations: [
1418
+ NgvTypeaheadHighlightComponent,
1419
+ NgvTypeaheadInputComponent,
1420
+ NgvTypeaheadDropdownListComponent,
1421
+ ],
1422
+ imports: [CommonModule, NgvTooltipModule$1],
1423
+ exports: [
1424
+ NgvTypeaheadHighlightComponent,
1425
+ NgvTypeaheadInputComponent,
1426
+ NgvTypeaheadDropdownListComponent,
1427
+ ],
1428
+ }]
1429
+ }] });
1430
+
1431
+ class NgvDropdownModule {
1432
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1433
+ 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] }); }
1434
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, imports: [CommonModule, NgvTypeaheadModule, NgvTooltipModule$1, NgvI18nModule$1] }); }
1435
+ }
1436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDropdownModule, decorators: [{
1437
+ type: NgModule,
1438
+ args: [{
1439
+ declarations: [NgvDropdownComponent, NgvDropdownListComponent],
1440
+ imports: [CommonModule, NgvTypeaheadModule, NgvTooltipModule$1, NgvI18nModule$1],
1441
+ exports: [NgvDropdownComponent, NgvDropdownListComponent],
1442
+ }]
1443
+ }] });
1444
+
1445
+ class NgvTypeaheadDirective {
1446
+ /** Function that filter the inputvalue */
1447
+ set nggvTypeahead(value) {
1448
+ this.typeaheadFunction = value;
1449
+ // If inputsubscription already exists, unsubscribe and subscribe again
1450
+ if (this.inputSubscription$) {
1451
+ this.inputSubscription$?.unsubscribe();
1452
+ this.inputSubscription$ = undefined;
1453
+ this.handleInputChanges();
1454
+ }
1455
+ }
1456
+ /** Forward text inputs to apply the filter function*/
1457
+ onNgvInput(event) {
1458
+ this.inputValue$.next(event);
1459
+ }
1460
+ /** Helper to the determine if the host is nggv-drodpown or nggv-input*/
1461
+ get hostIsDropdown() {
1462
+ return !!this.hostDropdown;
1463
+ }
1464
+ /** Predefined options */
1465
+ get defaultNullishOption() {
1466
+ return { key: null, label: this.unselectLabel || '\u00A0' };
1467
+ }
1468
+ get emptyOption() {
1469
+ return { key: null, label: 'label.nomatchingoptions', disabled: true };
1470
+ }
1471
+ /** Name of the component. nggv-dropdown if NgvDropdownComponent or nggv-input if NgvInputComponent */
1472
+ get localName() {
1473
+ return this.element.nativeElement.localName;
1474
+ }
1475
+ constructor(viewContainerRef, element, hostDropdown, hostInput) {
1476
+ this.viewContainerRef = viewContainerRef;
1477
+ this.element = element;
1478
+ this.hostDropdown = hostDropdown;
1479
+ this.hostInput = hostInput;
1480
+ /** Allow option to be unselected in the dropdown even if it is required. Defaults to true */
1481
+ this.allowUnselect = true;
1482
+ /** Emits the entered string the user has written in the input */
1483
+ this.filterPhraseChange = new EventEmitter();
1484
+ this.inputValue$ = new Subject();
1485
+ this.onDestroy$ = new Subject();
1486
+ }
1487
+ ngOnInit() {
1488
+ this.handleInputChanges();
1489
+ this.inputValue$.next('');
1490
+ if (this.hostIsDropdown)
1491
+ this.createInput();
1492
+ else
1493
+ this.createDropdownList();
1494
+ }
1495
+ ngOnDestroy() {
1496
+ this.onDestroy$.next(true);
1497
+ this.onDestroy$.complete();
1498
+ }
1499
+ /**
1500
+ * @internal
1501
+ * Core functionality of typeahead. Emits input, then filters the result based on the supplied function
1502
+ * If directive is applied on nggv-input, manually show or hide options in the list.
1503
+ * If directive is applied on nggv-dropdown, let the dropdown itself choose when to open or close
1504
+ */
1505
+ handleInputChanges() {
1506
+ this.inputSubscription$ = this.inputValue$
1507
+ .pipe(takeUntil$1(this.onDestroy$), distinctUntilChanged(), tap((inputValue) => this.filterPhraseChange.emit(inputValue)), this.typeaheadFunction ? this.typeaheadFunction : () => from([]), withLatestFrom(this.inputValue$))
1508
+ .subscribe(([filteredValues, input]) => this.setOptions(filteredValues, input));
1509
+ }
1510
+ /**
1511
+ * @internal
1512
+ * Creates a nggv-input if the host itself is not a text-input
1513
+ * Set styles to not display the input when closed
1514
+ * Trigger filtering when changes occur in the field
1515
+ * */
1516
+ createInput() {
1517
+ // Create the input component
1518
+ this.inputComponent = this.viewContainerRef.createComponent(NgvTypeaheadInputComponent);
1519
+ // Forward necessary info to component
1520
+ this.inputComponent.setInput('hostComponent', this.hostDropdown);
1521
+ this.inputComponent.setInput('selectedFormatter', this.selectedFormatter);
1522
+ this.inputComponent.setInput('resultFormatter', this.resultFormatter);
1523
+ // Listen to value changes
1524
+ this.inputComponent.instance.nggvInput
1525
+ .pipe(takeUntil$1(this.onDestroy$))
1526
+ .subscribe((inputValue) => this.inputValue$.next(inputValue));
1527
+ }
1528
+ /** @internal Creates a nggv-dropdown-list if the host itself is a nggv-input */
1529
+ createDropdownList() {
1530
+ this.dropdownListComponent = this.viewContainerRef.createComponent(NgvTypeaheadDropdownListComponent);
1531
+ this.dropdownListComponent.setInput('hostComponent', this.hostInput);
1532
+ }
1533
+ /**
1534
+ * @internal Sets the options the user can select.
1535
+ * If the host is a nggv-dropdown, utilize the dropdown itself to display the options
1536
+ * If the host is a nggv-input, use the created nggv-dropdown-list to displaye the options
1537
+ * @param filteredValues The options to display in the dropdown
1538
+ * @param emptyInput If the input is empty
1539
+ */
1540
+ setOptions(filteredValues, input) {
1541
+ if (!filteredValues)
1542
+ return;
1543
+ // Conditionally add empty or nullish option if it's allowed, the input is empty and does not already contain nullish
1544
+ const allowNullish = this.allowUnselect &&
1545
+ !input &&
1546
+ !(Object.keys(filteredValues[0]).includes('key') &&
1547
+ filteredValues[0].key == null);
1548
+ if (filteredValues.length === 0) {
1549
+ filteredValues = [this.emptyOption];
1550
+ }
1551
+ else if (allowNullish) {
1552
+ filteredValues = [this.defaultNullishOption].concat(filteredValues);
1553
+ }
1554
+ if (this.hostIsDropdown) {
1555
+ // Add nullish option when no input is written (or when dropdown is epanded and has a selection)
1556
+ this.hostDropdown.allowControlNullishOption = false;
1557
+ this.hostDropdown.options = this.formatOptions(filteredValues);
1558
+ this.hostDropdown.textToHighlight = `${input || ''}`;
1559
+ this.hostDropdown.detectChanges();
1560
+ return;
1561
+ }
1562
+ if (!this.hostIsDropdown) {
1563
+ this.dropdownListComponent.setInput('options', this.formatOptions(filteredValues));
1564
+ this.dropdownListComponent.setInput('textToHighlight', `${input || ''}`);
1565
+ }
1566
+ }
1567
+ /**
1568
+ * @internal Formats the available options to display in the dropdown list
1569
+ * @param options The selected value
1570
+ * @returns The formatted value
1571
+ */
1572
+ formatOptions(options) {
1573
+ if (!options)
1574
+ return [];
1575
+ if (!this.resultFormatter)
1576
+ return options;
1577
+ return options.map((value) => value?.label ? this.resultFormatter?.(value) : value);
1578
+ }
1579
+ 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 }); }
1580
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvTypeaheadDirective, isStandalone: true, selector: "nggv-input[nggvTypeahead], nggv-dropdown[nggvTypeahead]", inputs: { nggvTypeahead: "nggvTypeahead", resultFormatter: "resultFormatter", selectedFormatter: "selectedFormatter", allowUnselect: "allowUnselect", unselectLabel: "unselectLabel" }, outputs: { filterPhraseChange: "filterPhraseChange" }, host: { listeners: { "nggvInput": "onNgvInput($event)" } }, ngImport: i0 }); }
1581
+ }
1582
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTypeaheadDirective, decorators: [{
1583
+ type: Directive,
1584
+ args: [{
1585
+ selector: 'nggv-input[nggvTypeahead], nggv-dropdown[nggvTypeahead]',
1586
+ standalone: true,
1587
+ }]
1588
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: NgvDropdownComponent, decorators: [{
1589
+ type: Optional
1590
+ }, {
1591
+ type: Host
1592
+ }] }, { type: i2$3.NgvInputComponent, decorators: [{
1593
+ type: Optional
1594
+ }, {
1595
+ type: Host
1596
+ }] }]; }, propDecorators: { nggvTypeahead: [{
1597
+ type: Input
1598
+ }], resultFormatter: [{
1599
+ type: Input
1600
+ }], selectedFormatter: [{
1601
+ type: Input
1602
+ }], allowUnselect: [{
1603
+ type: Input
1604
+ }], unselectLabel: [{
1605
+ type: Input
1606
+ }], filterPhraseChange: [{
1607
+ type: Output
1608
+ }], onNgvInput: [{
1609
+ type: HostListener,
1610
+ args: ['nggvInput', ['$event']]
1611
+ }] } });
1612
+
1613
+ var button_cancel = "Cancel";
1614
+ var button_apply = "Apply";
1615
+ var button_save = "Save";
1616
+ 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>";
1617
+ var defaultLang = {
1618
+ "error.fieldinputmask": "Invalid value pattern",
1619
+ "error.fieldrequired": "Field must have content",
1620
+ "error.fieldmaxlength": "Field content should not be longer than {{requiredLength}} characters",
1621
+ "label.defaultlabel": "Label",
1622
+ "label.maxlength": "characters left",
1623
+ "label.optional": "Optional",
1624
+ button_cancel: button_cancel,
1625
+ button_apply: button_apply,
1626
+ button_save: button_save,
1627
+ text_dialogue: text_dialogue
1628
+ };
1629
+
1630
+ class NgvMissingHandler {
1631
+ constructor(transpiler) {
1632
+ this.transpiler = transpiler;
1633
+ }
1634
+ handle(key, _, params) {
1635
+ const keyWithoutLocale = key.charAt(2) === '.' ? key.substring(3) : key;
1636
+ const withoutScope = keyWithoutLocale.replace(/^((?:\w+)(?<!label|heading|button|alt|link|title|href|fieldhelp|error|text|image|list)(?:\.))/, '');
1637
+ const transpiledKey = this.transpiler.transpile(defaultLang[keyWithoutLocale], params, {}, keyWithoutLocale);
1638
+ return transpiledKey || withoutScope;
1639
+ }
1640
+ 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 }); }
1641
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvMissingHandler }); }
1642
+ }
1643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvMissingHandler, decorators: [{
1644
+ type: Injectable
1645
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1646
+ type: Inject,
1647
+ args: [TRANSLOCO_TRANSPILER]
1648
+ }] }]; } });
1649
+ const en = {
1650
+ 'error.fieldinputmask': 'Invalid value pattern',
1651
+ 'error.fieldrequired': 'Field must have content',
1652
+ 'error.fieldmaxlength': 'Field content should not be longer than {{requiredLength}} characters',
1653
+ 'label.defaultlabel': 'Label',
1654
+ 'label.maxlength': 'characters left',
1655
+ 'label.optional': 'Optional',
1656
+ };
1657
+ const sv = {
1658
+ 'error.fieldinputmask': 'Icke giltigt tecken mönster',
1659
+ 'error.fieldrequired': 'Fältet får inte lämnas tomt',
1660
+ 'error.fieldmaxlength': 'Fältinnehållet måste vara längre än {{requiredLength}} tecken',
1661
+ 'label.maxlength': 'tecken kvar',
1662
+ };
1663
+ class TranslocoInlineLoader {
1664
+ getTranslation(lang) {
1665
+ if (lang === 'sv') {
1666
+ return lastValueFrom(of(sv).pipe(delay(1500)));
1667
+ }
1668
+ return lastValueFrom(of(en).pipe(delay(500)));
1669
+ }
1670
+ }
1671
+ class NgvI18nModule {
1672
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1673
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, exports: [TranslocoModule] }); }
1674
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, providers: [
1675
+ provideTransloco({
1676
+ config: {
1677
+ availableLangs: ['en', 'sv'],
1678
+ defaultLang: 'en',
1679
+ // Remove this option if your application doesn't support changing language in runtime.
1680
+ reRenderOnLangChange: true,
1681
+ prodMode: !isDevMode(),
1682
+ },
1683
+ loader: TranslocoInlineLoader,
1684
+ }),
1685
+ provideTranslocoMissingHandler(NgvMissingHandler),
1686
+ ], imports: [TranslocoModule] }); }
1687
+ }
1688
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nModule, decorators: [{
1689
+ type: NgModule,
1690
+ args: [{
1691
+ providers: [
1692
+ provideTransloco({
1693
+ config: {
1694
+ availableLangs: ['en', 'sv'],
1695
+ defaultLang: 'en',
1696
+ // Remove this option if your application doesn't support changing language in runtime.
1697
+ reRenderOnLangChange: true,
1698
+ prodMode: !isDevMode(),
1699
+ },
1700
+ loader: TranslocoInlineLoader,
1701
+ }),
1702
+ provideTranslocoMissingHandler(NgvMissingHandler),
1703
+ ],
1704
+ exports: [TranslocoModule],
1705
+ }]
1706
+ }] });
1707
+
1708
+ class TranslocoMockPipe {
1709
+ constructor() {
1710
+ this.transform = (value) => value;
1711
+ }
1712
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslocoMockPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1713
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TranslocoMockPipe, name: "transloco" }); }
1714
+ }
1715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TranslocoMockPipe, decorators: [{
1716
+ type: Pipe,
1717
+ args: [{ name: 'transloco' }]
1718
+ }] });
1719
+ class TranslocoMockTranspiler {
1720
+ constructor() {
1721
+ this.transpile = (..._args) => '';
1722
+ }
1723
+ }
1724
+ class TranslocoMockMissingHandler {
1725
+ constructor() {
1726
+ this.handle = (key, _, _params) => key;
1727
+ }
1728
+ }
1729
+ class TranslocoMockStrategy {
1730
+ constructor() {
1731
+ this.getNextLangs = (_failedLang) => '';
1732
+ }
1733
+ }
1734
+ class TranslocoMockInterceptor {
1735
+ preSaveTranslation(translation, _lang) {
1736
+ return translation;
1737
+ }
1738
+ preSaveTranslationKey(_key, value, _lang) {
1739
+ return value;
1740
+ }
1741
+ }
1742
+ class NgvI18nTestModule {
1743
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1744
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, declarations: [TranslocoMockPipe], imports: [CommonModule], exports: [TranslocoMockPipe] }); }
1745
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, providers: [
1746
+ {
1747
+ provide: TRANSLOCO_TRANSPILER,
1748
+ useClass: TranslocoMockTranspiler,
1749
+ },
1750
+ {
1751
+ provide: TRANSLOCO_INTERCEPTOR,
1752
+ useClass: TranslocoMockInterceptor,
1753
+ },
1754
+ {
1755
+ provide: TRANSLOCO_FALLBACK_STRATEGY,
1756
+ useClass: TranslocoMockStrategy,
1757
+ },
1758
+ {
1759
+ provide: TRANSLOCO_MISSING_HANDLER,
1760
+ useClass: TranslocoMockMissingHandler,
1761
+ deps: [TRANSLOCO_TRANSPILER],
1762
+ },
1763
+ ], imports: [CommonModule] }); }
1764
+ }
1765
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvI18nTestModule, decorators: [{
1766
+ type: NgModule,
1767
+ args: [{
1768
+ imports: [CommonModule],
1769
+ declarations: [TranslocoMockPipe],
1770
+ exports: [TranslocoMockPipe],
1771
+ providers: [
1772
+ {
1773
+ provide: TRANSLOCO_TRANSPILER,
1774
+ useClass: TranslocoMockTranspiler,
1775
+ },
1776
+ {
1777
+ provide: TRANSLOCO_INTERCEPTOR,
1778
+ useClass: TranslocoMockInterceptor,
1779
+ },
1780
+ {
1781
+ provide: TRANSLOCO_FALLBACK_STRATEGY,
1782
+ useClass: TranslocoMockStrategy,
1783
+ },
1784
+ {
1785
+ provide: TRANSLOCO_MISSING_HANDLER,
1786
+ useClass: TranslocoMockMissingHandler,
1787
+ deps: [TRANSLOCO_TRANSPILER],
1788
+ },
1789
+ ],
1790
+ }]
1791
+ }] });
1792
+
1793
+ /**
1794
+ * A button that will present an explanation to a problem/question.
1795
+ * https://designlibrary.sebgroup.com/components/component-contextual-help-button
1796
+ */
1797
+ class NgvInfoCircleComponent {
1798
+ constructor() {
1799
+ /** Special property used for selecting DOM elements during automated UI testing. */
1800
+ this.thook = 'info';
1801
+ }
1802
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1803
+ 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 [nggvTooltip]=\"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: "[nggvTooltip]", inputs: ["nggvTooltip", "thook", "placement", "shown", "offset", "resizeThrottle", "maxWidth"], outputs: ["nggvShow", "nggvHide"] }] }); }
1804
+ }
1805
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleComponent, decorators: [{
1806
+ type: Component,
1807
+ args: [{ selector: 'nggv-info-circle', template: "<svg [nggvTooltip]=\"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"] }]
1808
+ }], propDecorators: { thook: [{
1809
+ type: HostBinding,
1810
+ args: ['attr.data-thook']
1811
+ }, {
1812
+ type: Input
1813
+ }], info: [{
1814
+ type: Input
1815
+ }] } });
1816
+
1817
+ class NgvInfoCircleModule {
1818
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1819
+ 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] }); }
1820
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, imports: [CommonModule, NggCoreWrapperModule, NgvTooltipModule$1] }); }
1821
+ }
1822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInfoCircleModule, decorators: [{
1823
+ type: NgModule,
1824
+ args: [{
1825
+ declarations: [NgvInfoCircleComponent],
1826
+ imports: [CommonModule, NggCoreWrapperModule, NgvTooltipModule$1],
1827
+ exports: [NgvInfoCircleComponent],
1828
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
1829
+ }]
1830
+ }] });
1831
+
1832
+ /**
1833
+ * Input fields allow users to add and edit text.
1834
+ * https://designlibrary.sebgroup.com/components/component-input
1835
+ */
1836
+ class NgvInputComponent extends NgvBaseControlValueAccessorComponent$1 {
1837
+ /** Minimum length (number of characters) of value. */
1838
+ set minLength(length) {
1839
+ this._minlength = length;
1840
+ }
1841
+ /**
1842
+ * Minimum length (number of characters) of value.
1843
+ * @deprecated minlength triggers angular-template-validation. Use @Input() minLength instead.
1844
+ */
1845
+ set minlength(length) {
1846
+ this._minlength = length;
1847
+ }
1848
+ get minlength() {
1849
+ return this._minlength;
1850
+ }
1851
+ /** Maximum length (number of characters) of value. */
1852
+ set maxLength(length) {
1853
+ this._maxlength = length;
1854
+ this.writeValue(this.state);
1855
+ }
1856
+ get maxlength() {
1857
+ return this._maxlength;
1858
+ }
1859
+ /**
1860
+ * Maximum length (number of characters) of value.
1861
+ * @deprecated maxlength triggers angular-template-validation. Use @Input() maxLength instead.
1862
+ */
1863
+ set maxlength(length) {
1864
+ this._maxlength = length;
1865
+ this.writeValue(this.state);
1866
+ }
1867
+ set showCharacterCountdown(option) {
1868
+ this._showCharacterCountDown = option;
1869
+ }
1870
+ get showCharacterCountdown() {
1871
+ return this._showCharacterCountDown && this.hasMaxLength;
1872
+ }
1873
+ set inputMask(newInputMask) {
1874
+ // Hide input field
1875
+ this.hideInput$.next(true);
1876
+ this.cdr.detectChanges();
1877
+ this._inputMask = newInputMask;
1878
+ // Show input field to reload input-mask settings upon update
1879
+ setTimeout(() => {
1880
+ this.hideInput$.next(false);
1881
+ this.cdr.detectChanges();
1882
+ }, 200);
1883
+ }
1884
+ get inputMask() {
1885
+ return this._inputMask;
1886
+ }
1887
+ get control() {
1888
+ return this.ngControl?.control ?? this._formControl;
1889
+ }
1890
+ /** Returns if maxlength is used */
1891
+ get hasMaxLength() {
1892
+ return !!this.maxlength && this.maxlength !== Number.MAX_SAFE_INTEGER;
1893
+ }
1894
+ constructor(ngControl, translocoScope, cdr) {
1895
+ super(ngControl, translocoScope, cdr);
1896
+ this.ngControl = ngControl;
1897
+ this.translocoScope = translocoScope;
1898
+ this.cdr = cdr;
1899
+ /** Adding .gds-form-item as a class to host element */
1900
+ this.class = 'gds-form-item';
1901
+ /** Special property used for selecting DOM elements during automated UI testing. */
1902
+ this.thook = 'input';
1903
+ /** Type of input field. Should avoid types that modify field too much such as range. */
1904
+ this.type = 'text';
1905
+ /** If set to "on", hint for form autofill feature. */
1906
+ this.autocomplete = 'on';
1907
+ /** If set to true, the value will not be editable. */
1908
+ this.readonly = false;
1909
+ /** If set to true, enables the Angular template-driven email validator. */
1910
+ this.email = false;
1911
+ /** Minimum value required for numeric input types. */
1912
+ this.min = 0;
1913
+ /** Maximum value required for numeric input types. */
1914
+ this.max = Number.MAX_SAFE_INTEGER;
1915
+ /** Incremental values that are valid for numeric input types. */
1916
+ this.step = 1;
1917
+ this._maxlength = Number.MAX_SAFE_INTEGER;
1918
+ this._minlength = 0;
1919
+ /** Wether to show label that tells how many characters are still left to be entered. Will only be set if maxLength is also set */
1920
+ this._showCharacterCountDown = true;
1921
+ /** Pattern the value must match to be valid. */
1922
+ this.pattern = '';
1923
+ /** Amount of time to wait until emitting (nggvINput) event */
1924
+ this.debounceTime = 500;
1925
+ /**
1926
+ * @deprecated
1927
+ * Text to put in badge
1928
+ */
1929
+ this.badgeText = '';
1930
+ /** Emits every time the value of the inner input field changes, independantly of updates on the formcontroller */
1931
+ this.nggvInput = new EventEmitter();
1932
+ this._formControl = new UntypedFormControl();
1933
+ /** Toggler for showing or hiding the input field */
1934
+ this.hideInput$ = new Subject();
1935
+ this.inputChange$ = new Subject();
1936
+ this._destroy$ = new Subject();
1937
+ }
1938
+ ngOnInit() {
1939
+ super.ngOnInit();
1940
+ this.inputChange$
1941
+ .pipe(takeUntil(this._destroy$), debounceTime(this.debounceTime))
1942
+ .subscribe((inputValue) => {
1943
+ this.nggvInput.emit(inputValue);
1944
+ });
1945
+ }
1946
+ ngOnDestroy() {
1947
+ this._destroy$.next(true);
1948
+ this._destroy$.complete();
1949
+ }
1950
+ writeValue(value) {
1951
+ // maxLength will only work with string values
1952
+ if (value?.length && value.length > this.maxlength) {
1953
+ // cut value to match max length
1954
+ this.state = this.cutTextAfterMaxLength(value);
1955
+ if (value.length !== this.state.length) {
1956
+ this.onChange(this.state);
1957
+ }
1958
+ // emit value
1959
+ }
1960
+ else {
1961
+ // update state
1962
+ this.state = value;
1963
+ }
1964
+ this.cdr.detectChanges();
1965
+ }
1966
+ cutTextAfterMaxLength(value) {
1967
+ if (typeof value === 'string') {
1968
+ return value.substring(0, this.maxlength);
1969
+ }
1970
+ return value;
1971
+ }
1972
+ /** @internal */
1973
+ onInput(event) {
1974
+ event.stopPropagation();
1975
+ if (this.disabled)
1976
+ return;
1977
+ this.state = event.target.value;
1978
+ this.onChange(this.state);
1979
+ this.inputChange$.next(this.state);
1980
+ }
1981
+ 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 }); }
1982
+ 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: { nggvInput: "nggvInput" }, 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 | nggvInputMaskFormat: 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 [nggvInputMask]=\"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 *nggvCharacterCountdown=\"\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: "[nggvInputMask]", inputs: ["nggvInputMask"] }, { 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: "nggvInputMaskFormat" }] }); }
1983
+ }
1984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputComponent, decorators: [{
1985
+ type: Component,
1986
+ 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 | nggvInputMaskFormat: 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 [nggvInputMask]=\"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 *nggvCharacterCountdown=\"\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"] }]
1987
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
1988
+ type: Self
1989
+ }, {
1990
+ type: Optional
1991
+ }] }, { type: undefined, decorators: [{
1992
+ type: Optional
1993
+ }, {
1994
+ type: Inject,
1995
+ args: [TRANSLOCO_SCOPE]
1996
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { class: [{
1997
+ type: HostBinding,
1998
+ args: ['class']
1999
+ }], thook: [{
2000
+ type: HostBinding,
2001
+ args: ['attr.data-thook']
2002
+ }, {
2003
+ type: Input
2004
+ }], type: [{
2005
+ type: Input
2006
+ }], placeholder: [{
2007
+ type: Input
2008
+ }], autocomplete: [{
2009
+ type: Input
2010
+ }], readonly: [{
2011
+ type: Input
2012
+ }], email: [{
2013
+ type: Input
2014
+ }], min: [{
2015
+ type: Input
2016
+ }], max: [{
2017
+ type: Input
2018
+ }], step: [{
2019
+ type: Input
2020
+ }], minLength: [{
2021
+ type: Input
2022
+ }], minlength: [{
2023
+ type: Input
2024
+ }], maxLength: [{
2025
+ type: Input
2026
+ }], maxlength: [{
2027
+ type: Input
2028
+ }], showCharacterCountdown: [{
2029
+ type: Input
2030
+ }], pattern: [{
2031
+ type: Input
2032
+ }], debounceTime: [{
2033
+ type: Input
2034
+ }], badgeText: [{
2035
+ type: Input
2036
+ }], inputMask: [{
2037
+ type: Input
2038
+ }], nggvInput: [{
2039
+ type: Output
2040
+ }] } });
2041
+
2042
+ class NgvInputModule {
2043
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2044
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, declarations: [NgvInputComponent], imports: [CommonModule,
2045
+ NgvI18nModule$1,
2046
+ NgvInputMaskModule$1,
2047
+ ReactiveFormsModule], exports: [NgvInputComponent] }); }
2048
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, imports: [CommonModule,
2049
+ NgvI18nModule$1,
2050
+ NgvInputMaskModule$1,
2051
+ ReactiveFormsModule] }); }
2052
+ }
2053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputModule, decorators: [{
2054
+ type: NgModule,
2055
+ args: [{
2056
+ declarations: [NgvInputComponent],
2057
+ imports: [
2058
+ CommonModule,
2059
+ NgvI18nModule$1,
2060
+ NgvInputMaskModule$1,
2061
+ ReactiveFormsModule,
2062
+ ],
2063
+ exports: [NgvInputComponent],
2064
+ }]
2065
+ }] });
2066
+
2067
+ const InputmaskStatic = _Inputmask.default ||
2068
+ _Inputmask;
2069
+ class InputMaskFormatPipe {
2070
+ transform(value, options) {
2071
+ if (!value)
2072
+ return value;
2073
+ return InputmaskStatic.format(value, options);
2074
+ }
2075
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputMaskFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
2076
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: InputMaskFormatPipe, name: "nggvInputMaskFormat" }); }
2077
+ }
2078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputMaskFormatPipe, decorators: [{
2079
+ type: Pipe,
2080
+ args: [{
2081
+ name: 'nggvInputMaskFormat',
2082
+ }]
2083
+ }] });
2084
+
2085
+ class InputMaskConfig {
2086
+ constructor() {
2087
+ this.isAsync = false;
2088
+ this.inputSelector = 'input';
2089
+ }
2090
+ }
2091
+ const INPUT_MASK_CONFIG = new InjectionToken('InputMaskConfig');
2092
+
2093
+ const InputmaskConstructor = _Inputmask.default ||
2094
+ _Inputmask;
2095
+ class NgvInputMaskDirective {
2096
+ constructor(ngControl, config, platformId, elementRef, renderer, ngZone) {
2097
+ this.ngControl = ngControl;
2098
+ this.platformId = platformId;
2099
+ this.elementRef = elementRef;
2100
+ this.renderer = renderer;
2101
+ this.ngZone = ngZone;
2102
+ /** Input settings of directive */
2103
+ this.nggvInputMask = {};
2104
+ this.defaultInputMaskConfig = new InputMaskConfig();
2105
+ this.onInput = (_) => {
2106
+ // Empty method
2107
+ };
2108
+ this.onTouched = (_) => {
2109
+ // Empty method
2110
+ };
2111
+ this.validate = (control) => !control.value || !this.inputMaskPlugin || this.inputMaskPlugin.isValid()
2112
+ ? null
2113
+ : { invalidformat: true };
2114
+ if (this.ngControl) {
2115
+ this.ngControl.valueAccessor = this;
2116
+ }
2117
+ this.setNativeInputElement(config);
2118
+ }
2119
+ onKeyUp(event) {
2120
+ // Trigger "onInput" when pressing delete or backspace, when input is focused
2121
+ if (['Delete', 'Backspace'].includes(event.key)) {
2122
+ this.elementRef.nativeElement.dispatchEvent(new Event('input', {
2123
+ bubbles: true,
2124
+ cancelable: true,
2125
+ }));
2126
+ }
2127
+ }
2128
+ ngOnInit() {
2129
+ if (this.control) {
2130
+ this.control.setValidators(this.control.validator
2131
+ ? [this.control.validator, this.validate]
2132
+ : [this.validate]);
2133
+ this.control.updateValueAndValidity();
2134
+ }
2135
+ }
2136
+ ngOnDestroy() {
2137
+ this.inputMaskPlugin?.remove();
2138
+ this.mutationObserver?.disconnect();
2139
+ }
2140
+ initInputMask() {
2141
+ if (isPlatformServer(this.platformId) ||
2142
+ !this.nativeInputElement ||
2143
+ !Object.keys(this.nggvInputMask).length) {
2144
+ return;
2145
+ }
2146
+ this.inputMaskPlugin = this.ngZone.runOutsideAngular(() => new InputmaskConstructor(this.inputMaskOptions).mask(this.nativeInputElement));
2147
+ if (this.control) {
2148
+ setTimeout(() => {
2149
+ this.control.updateValueAndValidity();
2150
+ });
2151
+ }
2152
+ }
2153
+ ngAfterViewInit() {
2154
+ this.initInputMask();
2155
+ }
2156
+ get inputMaskOptions() {
2157
+ const { parser, ...options } = this.nggvInputMask;
2158
+ return options;
2159
+ }
2160
+ writeValue(value) {
2161
+ if (this.nativeInputElement) {
2162
+ this.renderer.setProperty(this.nativeInputElement, 'value', value ?? '');
2163
+ }
2164
+ }
2165
+ registerOnChange(fn) {
2166
+ // Use injected parser from settings to modify value
2167
+ // of users desire
2168
+ this.onInput = (value) => {
2169
+ const parser = this.nggvInputMask?.parser;
2170
+ const newValue = parser && value ? parser(value) : value;
2171
+ fn(newValue);
2172
+ };
2173
+ }
2174
+ registerOnTouched(fn) {
2175
+ this.onTouched = fn;
2176
+ }
2177
+ setDisabledState(disabled) {
2178
+ if (this.nativeInputElement) {
2179
+ this.renderer.setProperty(this.nativeInputElement, 'disabled', disabled);
2180
+ }
2181
+ }
2182
+ get control() {
2183
+ return this.ngControl?.control;
2184
+ }
2185
+ setNativeInputElement(config) {
2186
+ if (this.elementRef.nativeElement.tagName === 'INPUT') {
2187
+ this.nativeInputElement = this.elementRef.nativeElement;
2188
+ }
2189
+ else {
2190
+ this.defaultInputMaskConfig = {
2191
+ ...this.defaultInputMaskConfig,
2192
+ ...config,
2193
+ };
2194
+ if (this.defaultInputMaskConfig.isAsync) {
2195
+ // Create an observer instance linked to the callback function
2196
+ this.mutationObserver = new MutationObserver((mutationsList) => {
2197
+ for (const mutation of mutationsList) {
2198
+ if (mutation.type === 'childList') {
2199
+ const nativeInputElement = this.elementRef.nativeElement.querySelector(this.defaultInputMaskConfig.inputSelector);
2200
+ if (nativeInputElement) {
2201
+ this.nativeInputElement = nativeInputElement;
2202
+ this.mutationObserver?.disconnect();
2203
+ this.initInputMask();
2204
+ }
2205
+ }
2206
+ }
2207
+ });
2208
+ // Start observing the target node for configured mutations
2209
+ this.mutationObserver.observe(this.elementRef.nativeElement, {
2210
+ childList: true,
2211
+ subtree: true,
2212
+ });
2213
+ }
2214
+ else {
2215
+ this.nativeInputElement = this.elementRef.nativeElement.querySelector(this.defaultInputMaskConfig.inputSelector);
2216
+ }
2217
+ }
2218
+ }
2219
+ 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 }); }
2220
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvInputMaskDirective, selector: "[nggvInputMask]", inputs: { nggvInputMask: "nggvInputMask" }, host: { listeners: { "input": "onInput($event.target.value)", "blur": "onTouched($event.target.value)", "keyup": "onKeyUp($event)" } }, ngImport: i0 }); }
2221
+ }
2222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskDirective, decorators: [{
2223
+ type: Directive,
2224
+ args: [{
2225
+ selector: '[nggvInputMask]',
2226
+ }]
2227
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2228
+ type: Optional
2229
+ }, {
2230
+ type: Self
2231
+ }] }, { type: InputMaskConfig, decorators: [{
2232
+ type: Inject,
2233
+ args: [INPUT_MASK_CONFIG]
2234
+ }] }, { type: undefined, decorators: [{
2235
+ type: Inject,
2236
+ args: [PLATFORM_ID]
2237
+ }] }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { nggvInputMask: [{
2238
+ type: Input
2239
+ }], onInput: [{
2240
+ type: HostListener,
2241
+ args: ['input', ['$event.target.value']]
2242
+ }], onTouched: [{
2243
+ type: HostListener,
2244
+ args: ['blur', ['$event.target.value']]
2245
+ }], onKeyUp: [{
2246
+ type: HostListener,
2247
+ args: ['keyup', ['$event']]
2248
+ }] } });
2249
+
2250
+ class NgvInputMaskModule {
2251
+ static forRoot(config) {
2252
+ return {
2253
+ ngModule: NgvInputMaskModule,
2254
+ providers: [{ provide: INPUT_MASK_CONFIG, useValue: config }],
2255
+ };
2256
+ }
2257
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2258
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, declarations: [NgvInputMaskDirective, InputMaskFormatPipe], exports: [NgvInputMaskDirective, InputMaskFormatPipe] }); }
2259
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, providers: [
2260
+ {
2261
+ provide: INPUT_MASK_CONFIG,
2262
+ useClass: InputMaskConfig,
2263
+ },
2264
+ ] }); }
2265
+ }
2266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvInputMaskModule, decorators: [{
2267
+ type: NgModule,
2268
+ args: [{
2269
+ declarations: [NgvInputMaskDirective, InputMaskFormatPipe],
2270
+ exports: [NgvInputMaskDirective, InputMaskFormatPipe],
2271
+ providers: [
2272
+ {
2273
+ provide: INPUT_MASK_CONFIG,
2274
+ useClass: InputMaskConfig,
2275
+ },
2276
+ ],
2277
+ }]
2278
+ }] });
2279
+
2280
+ const createMask = (options) => typeof options === 'string' ? { mask: options } : options;
2281
+
2282
+ ;
2283
+ (() => {
2284
+ // Make sure there is an incremental ID each component can use
2285
+ if (typeof window !== 'undefined' && !window.nggv) {
2286
+ window.nggv = {
2287
+ ids: { default: -1 },
2288
+ nextId(namespace = 'default') {
2289
+ let id = this.ids[namespace] || 0;
2290
+ if (typeof this.ids[namespace] === 'number')
2291
+ id++;
2292
+ this.ids[namespace] = id;
2293
+ return namespace === 'default'
2294
+ ? `nggv-${id}`
2295
+ : `nggv-${namespace}-${id}`;
2296
+ },
2297
+ };
2298
+ }
2299
+ })();
2300
+
2301
+ class NgvDialogComponent {
2302
+ constructor() {
2303
+ /** Special property used for selecting DOM elements during automated UI testing. */
2304
+ this.thook = 'dialog';
2305
+ /** @internal */
2306
+ this.baseClass = true;
2307
+ /** @internal Defines the default visibility state of the dialog. */
2308
+ this.shown = false;
2309
+ /** Defines the default visibility state of the dialog. */
2310
+ this.initiallyShown = false;
2311
+ /**
2312
+ * Sets modal title. Will be translated (using transloco) if the string matches a cms key.
2313
+ * @deprecated - use heading instead.
2314
+ */
2315
+ this.title = 'Attention';
2316
+ /** Defines if dialog should close on action. */
2317
+ this.autoClose = true;
2318
+ /** An array of event payloads that will be added to every click context menu item click. */
2319
+ this.payload = {};
2320
+ /** It gives an ability for parent component to control if modal should be closed on esc button click. */
2321
+ this.closeModalOnEscape = true;
2322
+ // /** @internal */
2323
+ // closeIcon = faTimes
2324
+ this.nggvCloseEvent = new EventEmitter();
2325
+ this.nggvPositiveEvent = new EventEmitter();
2326
+ this.nggvNeutralEvent = new EventEmitter();
2327
+ this.nggvNegativeEvent = new EventEmitter();
2328
+ }
2329
+ /** @internal */
2330
+ get ariaHidden() {
2331
+ return !this.shown;
2332
+ }
2333
+ /** Buttons are defined as a key-value pair where key is one of "positive|neutral|negative" and value is the button label. */
2334
+ set buttons(buttons) {
2335
+ this._buttons = buttons;
2336
+ }
2337
+ ngOnInit() {
2338
+ this.dialogTitleId =
2339
+ this.dialogTitleId ?? 'sdv-dialog-title-' + window.nggv?.nextId();
2340
+ this.dialogBodyId =
2341
+ this.dialogBodyId ?? 'sdv-dialog-body-' + window.nggv?.nextId();
2342
+ this.shown = this.initiallyShown;
2343
+ if (this.shown)
2344
+ this._limitFocusable();
2345
+ }
2346
+ onAction(event, action) {
2347
+ event.preventDefault();
2348
+ const emitEvent = {
2349
+ original: event,
2350
+ payload: this.payload,
2351
+ };
2352
+ switch (action) {
2353
+ case 'positive':
2354
+ this.nggvPositiveEvent.emit(emitEvent);
2355
+ break;
2356
+ case 'neutral':
2357
+ this.nggvNeutralEvent.emit(emitEvent);
2358
+ break;
2359
+ case 'negative':
2360
+ this.nggvNegativeEvent.emit(emitEvent);
2361
+ break;
2362
+ // case 'close' is handled by if-statement below with call to this.close()
2363
+ }
2364
+ if (this.autoClose)
2365
+ this.close(event, 'action');
2366
+ }
2367
+ open(opener) {
2368
+ this.shown = true;
2369
+ this._previous = opener || document.activeElement;
2370
+ this._limitFocusable();
2371
+ return true;
2372
+ }
2373
+ _limitFocusable() {
2374
+ window.setTimeout(() => {
2375
+ if (!this.dialogRef)
2376
+ return;
2377
+ const focusable = this.dialogRef.nativeElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
2378
+ this._firstFocusable = focusable[0];
2379
+ this._lastFocusable = focusable[focusable.length - 1];
2380
+ if (this._lastFocusable)
2381
+ this._lastFocusable.focus();
2382
+ });
2383
+ }
2384
+ close(event, initiator) {
2385
+ if (initiator === 'host' && event instanceof MouseEvent)
2386
+ return;
2387
+ // prevent modal from closing on esc button click when closeModalOnEscape is set to false
2388
+ if (!this.closeModalOnEscape)
2389
+ return;
2390
+ if (this.shown) {
2391
+ const emitEvent = {
2392
+ original: event,
2393
+ payload: this.payload,
2394
+ };
2395
+ this.nggvCloseEvent.emit(emitEvent);
2396
+ }
2397
+ this.shown = false;
2398
+ window.setTimeout(() => {
2399
+ if (this._previous)
2400
+ this._previous.focus();
2401
+ this._previous = undefined;
2402
+ });
2403
+ }
2404
+ focusTrap(event) {
2405
+ if (event.key !== 'Tab')
2406
+ return;
2407
+ if (event.shiftKey) {
2408
+ // shift + tab
2409
+ if (this._lastFocusable &&
2410
+ document.activeElement === this._firstFocusable) {
2411
+ this._lastFocusable.focus();
2412
+ event.preventDefault();
2413
+ }
2414
+ }
2415
+ else {
2416
+ // tab
2417
+ if (this._firstFocusable &&
2418
+ document.activeElement === this._lastFocusable) {
2419
+ this._firstFocusable.focus();
2420
+ event.preventDefault();
2421
+ }
2422
+ }
2423
+ }
2424
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2425
+ 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: { nggvCloseEvent: "nggvCloseEvent", nggvPositiveEvent: "nggvPositiveEvent", nggvNeutralEvent: "nggvNeutralEvent", nggvNegativeEvent: "nggvNegativeEvent" }, 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"] }] }); }
2426
+ }
2427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvDialogComponent, decorators: [{
2428
+ type: Component,
2429
+ 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"] }]
2430
+ }], propDecorators: { dialogRef: [{
2431
+ type: ViewChild,
2432
+ args: ['dialog']
2433
+ }], thook: [{
2434
+ type: HostBinding,
2435
+ args: ['attr.data-thook']
2436
+ }, {
2437
+ type: Input
2438
+ }], baseClass: [{
2439
+ type: HostBinding,
2440
+ args: ['class.sdv-modal-dialog']
2441
+ }], shown: [{
2442
+ type: HostBinding,
2443
+ args: ['class.-active']
2444
+ }, {
2445
+ type: Input
2446
+ }], ariaHidden: [{
2447
+ type: HostBinding,
2448
+ args: ['attr.aria-hidden']
2449
+ }], initiallyShown: [{
2450
+ type: Input
2451
+ }], heading: [{
2452
+ type: Input
2453
+ }], title: [{
2454
+ type: Input
2455
+ }], content: [{
2456
+ type: Input
2457
+ }], autoClose: [{
2458
+ type: Input
2459
+ }], payload: [{
2460
+ type: Input
2461
+ }], dialogTitleId: [{
2462
+ type: Input
2463
+ }], dialogBodyId: [{
2464
+ type: Input
2465
+ }], closeModalOnEscape: [{
2466
+ type: Input
2467
+ }], buttons: [{
2468
+ type: Input
2469
+ }], nggvCloseEvent: [{
2470
+ type: Output
2471
+ }], nggvPositiveEvent: [{
2472
+ type: Output
2473
+ }], nggvNeutralEvent: [{
2474
+ type: Output
2475
+ }], nggvNegativeEvent: [{
2476
+ type: Output
2477
+ }], close: [{
2478
+ type: HostListener,
2479
+ args: ['click', ['$event', '"host"']]
2480
+ }, {
2481
+ type: HostListener,
2482
+ args: ['document:keydown.escape', ['$event']]
2483
+ }], focusTrap: [{
2484
+ type: HostListener,
2485
+ args: ['keydown', ['$event']]
2486
+ }] } });
2487
+
2488
+ class NgvFoldOutComponent {
2489
+ constructor() {
2490
+ /** Special property used for selecting DOM elements during automated UI testing. */
2491
+ this.thook = 'fold-out';
2492
+ // /** @internal */
2493
+ // faEllipsisH: IconDefinition = faEllipsisH
2494
+ /** @internal */
2495
+ this.shown = false;
2496
+ // Empty constructor
2497
+ }
2498
+ ngOnDestroy() {
2499
+ this.onClickSubscription?.unsubscribe();
2500
+ }
2501
+ /** Toggle display of the option list */
2502
+ toggleVisibility(event, setVisibility) {
2503
+ this.shown = setVisibility !== undefined ? setVisibility : !this.shown;
2504
+ if (this.shown)
2505
+ this.subscribeToOutsideClickEvent();
2506
+ }
2507
+ /**
2508
+ * Closes the fold-out on click outside.
2509
+ */
2510
+ subscribeToOutsideClickEvent() {
2511
+ this.onClickSubscription = fromEvent(document, 'click').subscribe({
2512
+ next: (event) => {
2513
+ if (this.shown &&
2514
+ !this.inputRef?.nativeElement.contains(event.target)) {
2515
+ this.toggleVisibility();
2516
+ this.onClickSubscription?.unsubscribe();
2517
+ }
2518
+ },
2519
+ });
2520
+ }
2521
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2522
+ 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"] }] }); }
2523
+ }
2524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutComponent, decorators: [{
2525
+ type: Component,
2526
+ 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"] }]
2527
+ }], ctorParameters: function () { return []; }, propDecorators: { thook: [{
2528
+ type: HostBinding,
2529
+ args: ['attr.data-thook']
2530
+ }, {
2531
+ type: Input
2532
+ }], inputRef: [{
2533
+ type: ViewChild,
2534
+ args: ['foldout', { read: ElementRef }]
2535
+ }], alignOptions: [{
2536
+ type: Input
2537
+ }] } });
2538
+
2539
+ class NgvFoldOutOptionDirective {
2540
+ constructor() {
2541
+ this.baseClass = true;
2542
+ }
2543
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2544
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvFoldOutOptionDirective, selector: "[nggvOption]", host: { properties: { "class.sdv-field-dropdown__options__label": "this.baseClass" } }, ngImport: i0 }); }
2545
+ }
2546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvFoldOutOptionDirective, decorators: [{
2547
+ type: Directive,
2548
+ args: [{
2549
+ selector: '[nggvOption]',
2550
+ }]
2551
+ }], propDecorators: { baseClass: [{
2552
+ type: HostBinding,
2553
+ args: ['class.sdv-field-dropdown__options__label']
2554
+ }] } });
2555
+
2556
+ /** Modal slide-out component based on vanilla pattern library design.
2557
+ * The modal title can be set using the @Input heading, and will automatically be translated if
2558
+ * the string matches a cms key.
2559
+ * Content can be injected into the body of the slide-out by either setting the @Input content to any type of
2560
+ * markdown, or using content projection (adding content between the `nggv-slideout-modal`-start and end tag).
2561
+ * If the content needs to stretch outside the normal padded area, add the attribute `slot="outside-content"` to the
2562
+ * projected content main element.
2563
+ * Test hooks:
2564
+ * The modal hook defaults to 'slideout' but is customizeable.
2565
+ * The closing button can be selected using 'slideout-close'.
2566
+ * The backdrop is selectable using 'slideout-backdrop'.
2567
+ */
2568
+ class NgvSlideOutComponent {
2569
+ /** @internal */
2570
+ get fromLeft() {
2571
+ return this.side === 'left';
2572
+ }
2573
+ /** Buttons are defined as a key-value pair where key is one of "positive|neutral|negative" and value is the button label. */
2574
+ set buttons(buttons) {
2575
+ this._buttons = buttons;
2576
+ }
2577
+ constructor(host) {
2578
+ this.host = host;
2579
+ /** Sets from which side the modal should open. */
2580
+ this.side = 'right';
2581
+ /** Defines the default visibility state of the slide-out. */
2582
+ this.shown = false;
2583
+ /** Defines the default visibility state of the modal. */
2584
+ this.initiallyShown = false;
2585
+ /** Sets whether it is possible to close the modal from the top right corner. */
2586
+ this.closable = true;
2587
+ /** Allows the modal content to decide the width of the modal. */
2588
+ this.autoWidth = false;
2589
+ /** Special property used for selecting DOM elements during automated UI testing. */
2590
+ this.thook = 'slideout';
2591
+ /** Will emit true on closing event. */
2592
+ this.nggvCloseEvent = new EventEmitter();
2593
+ this.nggvPositiveEvent = new EventEmitter();
2594
+ this.nggvNeutralEvent = new EventEmitter();
2595
+ this.nggvNegativeEvent = new EventEmitter();
2596
+ // appends methods for opening and closing modal to native element
2597
+ this.host.nativeElement.open = this.open.bind(this);
2598
+ this.host.nativeElement.close = this.close.bind(this);
2599
+ }
2600
+ ngOnInit() {
2601
+ this.shown = this.initiallyShown;
2602
+ if (this.shown)
2603
+ this.limitFocusable();
2604
+ }
2605
+ onAction(event, action) {
2606
+ event.preventDefault();
2607
+ switch (action) {
2608
+ case 'positive':
2609
+ this.nggvPositiveEvent.emit();
2610
+ break;
2611
+ case 'neutral':
2612
+ this.nggvNeutralEvent.emit();
2613
+ break;
2614
+ case 'negative':
2615
+ this.nggvNegativeEvent.emit();
2616
+ break;
2617
+ }
2618
+ this.close(event, 'action');
2619
+ }
2620
+ /**
2621
+ * Called on a modal element. Opens the modal and sets focus to the last focusable element in the modal.
2622
+ *
2623
+ * @param opener - reference to last focused element before opening modal
2624
+ * @returns - true
2625
+ */
2626
+ open(opener) {
2627
+ this.shown = true;
2628
+ this.previous = opener || document.activeElement;
2629
+ this.limitFocusable();
2630
+ return true;
2631
+ }
2632
+ /**
2633
+ * Called on a modal element. Closes the modal and emits a `nggvCloseEvent`. Sets focus to the lats focused element if an element was sent in to open function.
2634
+ *
2635
+ * @param event
2636
+ * @param initiator
2637
+ */
2638
+ close(event, initiator) {
2639
+ if (initiator === 'host' &&
2640
+ event instanceof MouseEvent &&
2641
+ event.target !== event.currentTarget)
2642
+ return;
2643
+ if (this.shown && this.closable) {
2644
+ this.nggvCloseEvent.emit(this.shown);
2645
+ this.shown = false;
2646
+ window.setTimeout(() => {
2647
+ if (this.previous)
2648
+ this.previous.focus();
2649
+ this.previous = undefined;
2650
+ });
2651
+ }
2652
+ }
2653
+ /** @internal */
2654
+ focusTrap(event) {
2655
+ if (event.key !== 'Tab')
2656
+ return;
2657
+ if (event.shiftKey) {
2658
+ // shift + tab
2659
+ if (this.lastFocusable &&
2660
+ document.activeElement === this.firstFocusable) {
2661
+ this.lastFocusable.focus();
2662
+ event.preventDefault();
2663
+ }
2664
+ }
2665
+ else {
2666
+ // tab
2667
+ if (this.firstFocusable &&
2668
+ document.activeElement === this.lastFocusable) {
2669
+ this.firstFocusable.focus();
2670
+ event.preventDefault();
2671
+ }
2672
+ }
2673
+ }
2674
+ limitFocusable() {
2675
+ window.setTimeout(() => {
2676
+ if (!this.slideOutRef)
2677
+ return;
2678
+ const focusable = this.slideOutRef.nativeElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
2679
+ this.firstFocusable = focusable[0];
2680
+ this.lastFocusable = focusable[focusable.length - 1];
2681
+ if (this.lastFocusable)
2682
+ this.lastFocusable.focus();
2683
+ });
2684
+ }
2685
+ 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 }); }
2686
+ 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: { nggvCloseEvent: "nggvCloseEvent", nggvPositiveEvent: "nggvPositiveEvent", nggvNeutralEvent: "nggvNeutralEvent", nggvNegativeEvent: "nggvNegativeEvent" }, 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: [
2687
+ trigger('modalAnimation', [
2688
+ transition(':enter', [
2689
+ query('.gds-slide-out', style({ transform: 'translateX(100%)' }), {
2690
+ optional: true,
2691
+ }),
2692
+ query('.gds-backdrop, [role=dialog]', style({ opacity: '0' }), {
2693
+ optional: true,
2694
+ }),
2695
+ group([
2696
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(0)' })), { optional: true }),
2697
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '1' })), { optional: true }),
2698
+ ]),
2699
+ ]),
2700
+ transition(':leave', [
2701
+ query('.gds-slide-out', style({ transform: 'translateX(0)' }), {
2702
+ optional: true,
2703
+ }),
2704
+ group([
2705
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(100%)' })), { optional: true }),
2706
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '0' })), { optional: true }),
2707
+ ]),
2708
+ ]),
2709
+ ]),
2710
+ ] }); }
2711
+ }
2712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvSlideOutComponent, decorators: [{
2713
+ type: Component,
2714
+ args: [{ selector: 'nggv-slideout-modal', animations: [
2715
+ trigger('modalAnimation', [
2716
+ transition(':enter', [
2717
+ query('.gds-slide-out', style({ transform: 'translateX(100%)' }), {
2718
+ optional: true,
2719
+ }),
2720
+ query('.gds-backdrop, [role=dialog]', style({ opacity: '0' }), {
2721
+ optional: true,
2722
+ }),
2723
+ group([
2724
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(0)' })), { optional: true }),
2725
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '1' })), { optional: true }),
2726
+ ]),
2727
+ ]),
2728
+ transition(':leave', [
2729
+ query('.gds-slide-out', style({ transform: 'translateX(0)' }), {
2730
+ optional: true,
2731
+ }),
2732
+ group([
2733
+ query('.gds-slide-out', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ transform: 'translateX(100%)' })), { optional: true }),
2734
+ query('.gds-backdrop, [role=dialog]', animate('350ms cubic-bezier(0.33, 1, 0.68, 1)', style({ opacity: '0' })), { optional: true }),
2735
+ ]),
2736
+ ]),
2737
+ ]),
2738
+ ], 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"] }]
2739
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { slideOutRef: [{
2740
+ type: ViewChild,
2741
+ args: ['slideOut']
2742
+ }], side: [{
2743
+ type: Input
2744
+ }], shown: [{
2745
+ type: Input
2746
+ }], initiallyShown: [{
2747
+ type: Input
2748
+ }], heading: [{
2749
+ type: Input
2750
+ }], title: [{
2751
+ type: Input
2752
+ }], content: [{
2753
+ type: Input
2754
+ }], closable: [{
2755
+ type: Input
2756
+ }], autoWidth: [{
2757
+ type: Input
2758
+ }], thook: [{
2759
+ type: Input
2760
+ }], buttons: [{
2761
+ type: Input
2762
+ }], nggvCloseEvent: [{
2763
+ type: Output
2764
+ }], nggvPositiveEvent: [{
2765
+ type: Output
2766
+ }], nggvNeutralEvent: [{
2767
+ type: Output
2768
+ }], nggvNegativeEvent: [{
2769
+ type: Output
2770
+ }], close: [{
2771
+ type: HostListener,
2772
+ args: ['click', ['$event', '"host"']]
2773
+ }, {
2774
+ type: HostListener,
2775
+ args: ['document:keydown.escape', ['$event']]
2776
+ }], focusTrap: [{
2777
+ type: HostListener,
2778
+ args: ['keydown', ['$event']]
2779
+ }] } });
2780
+
2781
+ class NgvModalModule {
2782
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2783
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, declarations: [NgvDialogComponent,
2784
+ NgvSlideOutComponent,
2785
+ NgvFoldOutComponent,
2786
+ NgvFoldOutOptionDirective], imports: [CommonModule, NgvButtonModule$1], exports: [NgvDialogComponent,
2787
+ NgvSlideOutComponent,
2788
+ NgvFoldOutComponent,
2789
+ NgvFoldOutOptionDirective] }); }
2790
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, imports: [CommonModule, NgvButtonModule$1] }); }
2791
+ }
2792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvModalModule, decorators: [{
2793
+ type: NgModule,
2794
+ args: [{
2795
+ imports: [CommonModule, NgvButtonModule$1],
2796
+ declarations: [
2797
+ NgvDialogComponent,
2798
+ NgvSlideOutComponent,
2799
+ NgvFoldOutComponent,
2800
+ NgvFoldOutOptionDirective,
2801
+ ],
2802
+ exports: [
2803
+ NgvDialogComponent,
2804
+ NgvSlideOutComponent,
2805
+ NgvFoldOutComponent,
2806
+ NgvFoldOutOptionDirective,
2807
+ ],
2808
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
2809
+ }]
2810
+ }] });
2811
+
2812
+ /** @internal Internal class used to uncheck radio buttons with the matching name. */
2813
+ class NgvRadioControlRegistry {
2814
+ constructor() {
2815
+ this._radios = [];
2816
+ }
2817
+ add(control, radio) {
2818
+ this._radios.push([control, radio]);
2819
+ }
2820
+ remove(radio) {
2821
+ for (let i = this._radios.length - 1; i >= 0; --i) {
2822
+ if (this._radios[i][1] === radio) {
2823
+ this._radios.splice(i, 1);
2824
+ return;
2825
+ }
2826
+ }
2827
+ }
2828
+ select(radio) {
2829
+ this._radios.forEach((controlPair) => {
2830
+ if (this._isSameGroup(controlPair, radio) && controlPair[1] !== radio) {
2831
+ controlPair[1].writeValue(radio.value);
2832
+ }
2833
+ });
2834
+ }
2835
+ _isSameGroup(controlPair, radio) {
2836
+ if (!controlPair[0].control)
2837
+ return false;
2838
+ return (
2839
+ //@ts-expect-error internal properties not exposed
2840
+ controlPair[0]._parent === radio.ngControl._parent &&
2841
+ controlPair[1].name === radio.name);
2842
+ }
2843
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioControlRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2844
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioControlRegistry }); }
2845
+ }
2846
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioControlRegistry, decorators: [{
2847
+ type: Injectable
2848
+ }] });
2849
+ /**
2850
+ * Use radio buttons when users must select one option in a list with exclusive options out of a set of two or more options.
2851
+ * https://designlibrary.sebgroup.com/components/component-radiobutton
2852
+ */
2853
+ class NgvRadioComponent extends NgvBaseControlValueAccessorComponent$1 {
2854
+ /**
2855
+ * Creates a new RadioComponent
2856
+ * @param ngControl optional FormControl provided when component is used in a form, through dependency injection.
2857
+ * @param registry internal registry used to uncheck radio buttons with the matching name, through dependency injection.
2858
+ * @param cdr change detection reference for rendering purposes.
2859
+ */
2860
+ constructor(ngControl, translocoScope, registry, cdr) {
2861
+ super(ngControl, translocoScope, cdr);
2862
+ this.ngControl = ngControl;
2863
+ this.translocoScope = translocoScope;
2864
+ this.registry = registry;
2865
+ this.cdr = cdr;
2866
+ /** Special property used for selecting DOM elements during automated UI testing. */
2867
+ this.thook = 'radio';
2868
+ }
2869
+ ngOnInit() {
2870
+ super.ngOnInit();
2871
+ this._checkName();
2872
+ this.registry.add(this.ngControl, this);
2873
+ }
2874
+ ngOnDestroy() {
2875
+ this.registry.remove(this);
2876
+ }
2877
+ /** @internal */
2878
+ onInputChange(event) {
2879
+ event.stopPropagation();
2880
+ if (this.disabled)
2881
+ return;
2882
+ this.onChange(this.state);
2883
+ }
2884
+ /** Writes a new value of true or false based on if argument matches this components value property. */
2885
+ writeValue(value) {
2886
+ // Phantom null value on first load https://github.com/angular/angular/pull/38140
2887
+ super.writeValue(value === this.value);
2888
+ }
2889
+ /** Registers a callback function that is called when the child input element's value changes. */
2890
+ registerOnChange(fn) {
2891
+ // Override default to update registry
2892
+ this.onChange = () => {
2893
+ fn(this.value);
2894
+ this.registry.select(this);
2895
+ };
2896
+ }
2897
+ /** Checks that the name properties match and updates name property if only formControlName is given. */
2898
+ _checkName() {
2899
+ if (this.name &&
2900
+ this.formControlName &&
2901
+ this.name !== this.formControlName) {
2902
+ throw new Error(`
2903
+ If you define both a name and a formControlName attribute on your radio button, their values
2904
+ must match. Ex: <input type="radio" formControlName="food" name="food">
2905
+ `);
2906
+ }
2907
+ if (!this.name && this.formControlName)
2908
+ this.name = this.formControlName;
2909
+ }
2910
+ 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 }); }
2911
+ 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"] }] }); }
2912
+ }
2913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioComponent, decorators: [{
2914
+ type: Component,
2915
+ 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"] }]
2916
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2917
+ type: Self
2918
+ }, {
2919
+ type: Optional
2920
+ }] }, { type: undefined, decorators: [{
2921
+ type: Optional
2922
+ }, {
2923
+ type: Inject,
2924
+ args: [TRANSLOCO_SCOPE]
2925
+ }] }, { type: NgvRadioControlRegistry }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
2926
+ type: HostBinding,
2927
+ args: ['attr.data-thook']
2928
+ }, {
2929
+ type: Input
2930
+ }], formControlName: [{
2931
+ type: Input
2932
+ }] } });
2933
+
2934
+ class NgvRadioModule {
2935
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2936
+ 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] }); }
2937
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, imports: [CommonModule, NgvI18nModule$1] }); }
2938
+ }
2939
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvRadioModule, decorators: [{
2940
+ type: NgModule,
2941
+ args: [{
2942
+ declarations: [NgvRadioComponent],
2943
+ imports: [CommonModule, NgvI18nModule$1],
2944
+ exports: [NgvRadioComponent],
2945
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
2946
+ }]
2947
+ }] });
2948
+
2949
+ /** Textarea fields allow users to add and edit longer or multiple line text. */
2950
+ class NgvTextareaComponent extends NgvBaseControlValueAccessorComponent$1 {
2951
+ /** Minimum length (number of characters) of value. */
2952
+ set minLength(length) {
2953
+ this._minlength = length;
2954
+ this.cdr.detectChanges();
2955
+ }
2956
+ get minlength() {
2957
+ return this._minlength;
2958
+ }
2959
+ /**
2960
+ * Minimum length (number of characters) of value.
2961
+ * @deprecated minlength triggers angular-template-validation. Use @Input() minLength instead.
2962
+ */
2963
+ set minlength(length) {
2964
+ this._minlength = length;
2965
+ this.cdr.detectChanges();
2966
+ }
2967
+ /** Maximum length (number of characters) of value. */
2968
+ set maxLength(length) {
2969
+ this._maxlength = length;
2970
+ this.cdr.detectChanges();
2971
+ }
2972
+ get maxlength() {
2973
+ return this._maxlength;
2974
+ }
2975
+ /**
2976
+ * Maximum length (number of characters) of value.
2977
+ * @deprecated maxlength triggers angular-template-validation. Use @Input() maxLength instead.
2978
+ */
2979
+ set maxlength(length) {
2980
+ this._maxlength = length;
2981
+ this.cdr.detectChanges();
2982
+ }
2983
+ /** Returns if maxlength is used */
2984
+ get hasMaxLength() {
2985
+ return !!this.maxlength && this.maxlength !== Number.MAX_SAFE_INTEGER;
2986
+ }
2987
+ constructor(ngControl, translocoScope, cdr) {
2988
+ super(ngControl, translocoScope, cdr);
2989
+ this.ngControl = ngControl;
2990
+ this.translocoScope = translocoScope;
2991
+ this.cdr = cdr;
2992
+ /** Special property used for selecting DOM elements during automated UI testing. */
2993
+ this.thook = 'textarea';
2994
+ /** If set to true, the value will not be editable. */
2995
+ this.readonly = false;
2996
+ this._maxlength = Number.MAX_SAFE_INTEGER;
2997
+ this._minlength = 0;
2998
+ }
2999
+ /** @internal */
3000
+ onInput(event) {
3001
+ event.stopPropagation();
3002
+ if (this.disabled)
3003
+ return;
3004
+ this.state = event.target.value;
3005
+ this.onChange(this.state);
3006
+ }
3007
+ 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 }); }
3008
+ 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 *nggvCharacterCountdown=\"\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"] }, { kind: "directive", type: i3$1.TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoLang", "translocoLoadingTpl"] }] }); }
3009
+ }
3010
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaComponent, decorators: [{
3011
+ type: Component,
3012
+ 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 *nggvCharacterCountdown=\"\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"] }]
3013
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
3014
+ type: Self
3015
+ }, {
3016
+ type: Optional
3017
+ }] }, { type: undefined, decorators: [{
3018
+ type: Optional
3019
+ }, {
3020
+ type: Inject,
3021
+ args: [TRANSLOCO_SCOPE]
3022
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { thook: [{
3023
+ type: HostBinding,
3024
+ args: ['attr.data-thook']
3025
+ }, {
3026
+ type: Input
3027
+ }], placeholder: [{
3028
+ type: Input
3029
+ }], readonly: [{
3030
+ type: Input
3031
+ }], minLength: [{
3032
+ type: Input
3033
+ }], minlength: [{
3034
+ type: Input
3035
+ }], maxLength: [{
3036
+ type: Input
3037
+ }], maxlength: [{
3038
+ type: Input
3039
+ }], rows: [{
3040
+ type: Input
3041
+ }] } });
3042
+
3043
+ class NgvTextareaModule {
3044
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3045
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, declarations: [NgvTextareaComponent], imports: [CommonModule, NgvI18nModule$1], exports: [NgvTextareaComponent] }); }
3046
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, imports: [CommonModule, NgvI18nModule$1] }); }
3047
+ }
3048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTextareaModule, decorators: [{
3049
+ type: NgModule,
3050
+ args: [{
3051
+ declarations: [NgvTextareaComponent],
3052
+ imports: [CommonModule, NgvI18nModule$1],
3053
+ exports: [NgvTextareaComponent],
3054
+ }]
3055
+ }] });
3056
+
3057
+ /**
3058
+ * A tooltip is a text label that acts as a helper to a specific item.
3059
+ * Recommended to use value `top` or `bottom` with `placement` for responsive design.
3060
+ * Dynamic resizing and tooltip position are a work in progress.
3061
+ * https://designlibrary.sebgroup.com/components/component-tooltip
3062
+ */
3063
+ class NgvTooltipDirective {
3064
+ /** @internal Check if changes should trigger a re-render */
3065
+ static shouldUpdate(change) {
3066
+ return (change &&
3067
+ !change.firstChange &&
3068
+ change.previousValue !== change.currentValue);
3069
+ }
3070
+ constructor(anchorElementRef, renderer) {
3071
+ this.anchorElementRef = anchorElementRef;
3072
+ this.renderer = renderer;
3073
+ /** Special property used for selecting DOM elements during automated UI testing. */
3074
+ this.thook = 'tooltip';
3075
+ /** The side of the anchor which the tooltip will be rendered.
3076
+ * Recommended `top` and `bottom` for responsive designs as these are more stable.
3077
+ */
3078
+ this.placement = 'top';
3079
+ /** Initial state and subsequent updates on wether the tooltip is visible. */
3080
+ this.shown = false;
3081
+ /** How far off from the text the tooltip will be rendered. */
3082
+ this.offset = 10;
3083
+ /** How frequently the tooltip will be re-rendered when the page size changes. */
3084
+ this.resizeThrottle = 50;
3085
+ /** Numeric max-width for tooltip. */
3086
+ this.maxWidth = 343;
3087
+ /** Emits a show event triggered changing visibility state of the tooltip. */
3088
+ this.nggvShow = new EventEmitter();
3089
+ /** Emits a hide event triggered changing visibility state of the tooltip. */
3090
+ this.nggvHide = new EventEmitter();
3091
+ /** @internal */
3092
+ this.timeout = 0;
3093
+ this.anchorElement = this.anchorElementRef.nativeElement;
3094
+ this.parentElement = document.body;
3095
+ }
3096
+ ngAfterViewInit() {
3097
+ // Set a timeout to allow view to fully render before creating tooltip.
3098
+ setTimeout(() => (this.shown ? this.show(true) : this.hide(true)));
3099
+ }
3100
+ ngOnChanges(changes) {
3101
+ if (NgvTooltipDirective.shouldUpdate(changes.nggvTooltip) ||
3102
+ NgvTooltipDirective.shouldUpdate(changes.placement) ||
3103
+ NgvTooltipDirective.shouldUpdate(changes.thook)) {
3104
+ this.shown ? this.show(true) : this.hide(true);
3105
+ }
3106
+ if (NgvTooltipDirective.shouldUpdate(changes.shown)) {
3107
+ this.shown ? this.show() : this.hide();
3108
+ }
3109
+ if (NgvTooltipDirective.shouldUpdate(changes.offset)) {
3110
+ this.updatePosition();
3111
+ }
3112
+ }
3113
+ ngOnDestroy() {
3114
+ this.hide(true);
3115
+ }
3116
+ /** @internal */
3117
+ onMouseEnter() {
3118
+ this.show();
3119
+ }
3120
+ /** @internal */
3121
+ onMouseLeave() {
3122
+ this.hide();
3123
+ }
3124
+ /** @internal */
3125
+ resize() {
3126
+ if (this.timeout)
3127
+ return;
3128
+ this.timeout = window.setTimeout(() => {
3129
+ this.timeout = 0;
3130
+ this.updatePosition();
3131
+ }, this.resizeThrottle);
3132
+ }
3133
+ /**
3134
+ * Sets the visibility state of the tooltip to true and creates a new tooltip if it doesn't exist or `recreate` is set.
3135
+ * @param recreate if set to true, destroy any existing tooltip and create a new one.
3136
+ */
3137
+ show(recreate = false) {
3138
+ // Require tooltip text to create
3139
+ if (!this.nggvTooltip || this.nggvTooltip.length === 0)
3140
+ return;
3141
+ if (recreate || !this.tooltipElement) {
3142
+ this.hide(true);
3143
+ this.create(this.nggvTooltip);
3144
+ }
3145
+ else {
3146
+ this.renderer.appendChild(this.parentElement, this.tooltipElement);
3147
+ }
3148
+ this.updatePosition();
3149
+ this.shown = true;
3150
+ this.nggvShow.emit(this.tooltipElement);
3151
+ }
3152
+ /**
3153
+ * Sets the visibility state of the tooltip to false and destroys an existing tooltip if `destroy` is set.
3154
+ * @param destroy if set to true, destroy any existing tooltip.
3155
+ */
3156
+ hide(destroy = false) {
3157
+ if (!this.tooltipElement)
3158
+ return;
3159
+ if (this.parentElement.contains(this.tooltipElement))
3160
+ this.renderer.removeChild(this.parentElement, this.tooltipElement);
3161
+ if (destroy)
3162
+ this.destroy();
3163
+ this.shown = false;
3164
+ this.nggvHide.emit(this.tooltipElement);
3165
+ }
3166
+ /**
3167
+ * @internal
3168
+ * Creates a new tooltip with the set placement and a given text as its body.
3169
+ * @param text the string to be displayed in the tooltip body.
3170
+ */
3171
+ create(text) {
3172
+ this.tooltipElement = this.renderer.createElement('div');
3173
+ this.renderer.addClass(this.tooltipElement, 'gds-tooltip');
3174
+ this.renderer.setAttribute(this.tooltipElement, 'data-thook', this.thook);
3175
+ this.renderer.setStyle(this.tooltipElement, 'position', 'absolute');
3176
+ this.renderer.setStyle(this.tooltipElement, 'z-index', '1040');
3177
+ this.renderer.setStyle(this.tooltipElement, 'border-radius', '.25rem');
3178
+ this.renderer.setStyle(this.tooltipElement, 'padding', '.5rem 1rem');
3179
+ const relativeMaxWidth = this.pxToRem(this.maxWidth);
3180
+ this.renderer.setStyle(this.tooltipElement, 'max-width', relativeMaxWidth);
3181
+ this.renderer.appendChild(this.tooltipElement, this.renderer.createText(text));
3182
+ // add tooltip to DOM
3183
+ this.renderer.appendChild(this.parentElement, this.tooltipElement);
3184
+ this.arrowElement = this.renderer.createElement('div');
3185
+ this.renderer.addClass(this.arrowElement, `gds-tooltip__arrow-${this.placement}`);
3186
+ // add arrow to tooltip element
3187
+ this.renderer.appendChild(this.tooltipElement, this.arrowElement);
3188
+ }
3189
+ /**
3190
+ * @internal
3191
+ * Destroys the current tooltip by un-setting variables, should only be used after detaching elements from the DOM.
3192
+ */
3193
+ destroy() {
3194
+ this.tooltipElement = undefined;
3195
+ this.arrowElement = undefined;
3196
+ }
3197
+ /**
3198
+ * @internal
3199
+ * Recalculates the position of the tooltip.
3200
+ */
3201
+ updatePosition() {
3202
+ if (!this.tooltipElement || !this.arrowElement)
3203
+ return;
3204
+ const scrollPos = window.pageYOffset ||
3205
+ document.documentElement.scrollTop ||
3206
+ this.parentElement.scrollTop ||
3207
+ 0;
3208
+ const anchorRect = this.anchorElement.getBoundingClientRect();
3209
+ const tooltipRect = this.tooltipElement.getBoundingClientRect();
3210
+ const arrowRect = this.arrowElement.getBoundingClientRect();
3211
+ switch (this.placement) {
3212
+ case 'top':
3213
+ this.alignVertical(true, scrollPos, anchorRect, tooltipRect.width, tooltipRect.height, arrowRect.width);
3214
+ break;
3215
+ case 'bottom':
3216
+ this.alignVertical(false, scrollPos, anchorRect, tooltipRect.width, tooltipRect.height, arrowRect.width);
3217
+ break;
3218
+ case 'left':
3219
+ this.alignHorizontal(true, scrollPos, anchorRect, tooltipRect.height);
3220
+ break;
3221
+ case 'right':
3222
+ this.alignHorizontal(false, scrollPos, anchorRect, tooltipRect.height);
3223
+ break;
3224
+ default:
3225
+ return;
3226
+ }
3227
+ }
3228
+ /**
3229
+ * @internal
3230
+ * Calculates and set the position of the tooltip when the placement is `top` or `bottom`.
3231
+ */
3232
+ alignVertical(above, scrollPos, anchor, tooltipWidth, tooltipHeight, arrowWidth) {
3233
+ const width = this.parentElement.clientWidth;
3234
+ const anchorMidX = anchor.left + anchor.width / 2;
3235
+ const tooltip = {};
3236
+ const arrow = {};
3237
+ if (above)
3238
+ tooltip.top = anchor.top - tooltipHeight - this.offset + scrollPos;
3239
+ else
3240
+ tooltip.top = anchor.bottom + this.offset + scrollPos;
3241
+ if (anchorMidX < width / 2) {
3242
+ tooltip.left = Math.max(0, anchorMidX - tooltipWidth / 2);
3243
+ arrow.left = anchorMidX - tooltip.left;
3244
+ }
3245
+ else {
3246
+ tooltip.right = Math.max(0, width - (anchorMidX + tooltipWidth / 2));
3247
+ arrow.right = width - anchorMidX - tooltip.right - arrowWidth;
3248
+ }
3249
+ this.setStyle(tooltip, arrow);
3250
+ }
3251
+ /**
3252
+ * @internal
3253
+ * Calculates and set the position of the tooltip when the placement is `left` or `right`.
3254
+ */
3255
+ alignHorizontal(before, scrollPos, anchor, tooltipHeight) {
3256
+ const width = this.parentElement.clientWidth;
3257
+ const top = anchor.top + (anchor.height - tooltipHeight) / 2 + scrollPos;
3258
+ const tooltip = { top };
3259
+ const arrow = { top: tooltipHeight / 2 };
3260
+ if (before)
3261
+ tooltip.right = width - anchor.left + this.offset;
3262
+ else
3263
+ tooltip.left = anchor.right + this.offset;
3264
+ this.setStyle(tooltip, arrow);
3265
+ }
3266
+ /**
3267
+ * @internal
3268
+ * Updates the CSS properties for the tooltip position.
3269
+ */
3270
+ setStyle(tooltip, arrow) {
3271
+ // Tooltip
3272
+ Object.entries(tooltip).forEach(([prop, value]) => {
3273
+ const position = this.pxToRem(value);
3274
+ this.renderer.setStyle(this.tooltipElement, prop, position);
3275
+ });
3276
+ // Arrow
3277
+ Object.entries(arrow).forEach(([prop, value]) => {
3278
+ const position = this.pxToRem(value);
3279
+ this.renderer.setStyle(this.arrowElement, prop, position);
3280
+ });
3281
+ }
3282
+ pxToRem(value) {
3283
+ const fontSizePx = window
3284
+ ?.getComputedStyle(this.parentElement)
3285
+ ?.getPropertyValue('font-size');
3286
+ const fontSizeNumberMatch = fontSizePx?.match(/\d{1,}/);
3287
+ const fontSize = fontSizeNumberMatch ? +fontSizeNumberMatch[0] : 16;
3288
+ const remValue = value / fontSize;
3289
+ return `${remValue}rem`;
3290
+ }
3291
+ 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 }); }
3292
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgvTooltipDirective, selector: "[nggvTooltip]", inputs: { nggvTooltip: "nggvTooltip", thook: "thook", placement: "placement", shown: "shown", offset: "offset", resizeThrottle: "resizeThrottle", maxWidth: "maxWidth" }, outputs: { nggvShow: "nggvShow", nggvHide: "nggvHide" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "window:resize": "resize()" } }, usesOnChanges: true, ngImport: i0 }); }
3293
+ }
3294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipDirective, decorators: [{
3295
+ type: Directive,
3296
+ args: [{
3297
+ selector: '[nggvTooltip]',
3298
+ }]
3299
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { nggvTooltip: [{
3300
+ type: Input
3301
+ }], thook: [{
3302
+ type: Input
3303
+ }], placement: [{
3304
+ type: Input
3305
+ }], shown: [{
3306
+ type: Input
3307
+ }], offset: [{
3308
+ type: Input
3309
+ }], resizeThrottle: [{
3310
+ type: Input
3311
+ }], maxWidth: [{
3312
+ type: Input
3313
+ }], nggvShow: [{
3314
+ type: Output
3315
+ }], nggvHide: [{
3316
+ type: Output
3317
+ }], onMouseEnter: [{
3318
+ type: HostListener,
3319
+ args: ['mouseenter']
3320
+ }], onMouseLeave: [{
3321
+ type: HostListener,
3322
+ args: ['mouseleave']
3323
+ }], resize: [{
3324
+ type: HostListener,
3325
+ args: ['window:resize']
3326
+ }] } });
3327
+
3328
+ class NgvTooltipModule {
3329
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3330
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, declarations: [NgvTooltipDirective], imports: [NgvI18nModule$1], exports: [NgvTooltipDirective] }); }
3331
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, imports: [NgvI18nModule$1] }); }
3332
+ }
3333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgvTooltipModule, decorators: [{
3334
+ type: NgModule,
3335
+ args: [{
3336
+ declarations: [NgvTooltipDirective],
3337
+ exports: [NgvTooltipDirective],
3338
+ imports: [NgvI18nModule$1],
3339
+ }]
3340
+ }] });
3341
+
3342
+ class NggvModule {
3343
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3344
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, imports: [CommonModule], exports: [NgvBaseControlValueAccessorModule,
3345
+ NgvBreadcrumbsModule,
3346
+ NgvButtonModule,
3347
+ NgvCardModule,
3348
+ NggCharacterCountdownDirectiveModule,
3349
+ NgvCheckboxModule,
3350
+ NgvDropdownModule,
3351
+ NgvI18nModule,
3352
+ NgvInfoCircleModule,
3353
+ NgvInputModule,
3354
+ NgvInputMaskModule,
3355
+ NgvModalModule,
3356
+ NgvRadioModule,
3357
+ NgvTextareaModule,
3358
+ NgvTooltipModule,
3359
+ NgvTypeaheadModule] }); }
3360
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, imports: [CommonModule, NgvBaseControlValueAccessorModule,
3361
+ NgvBreadcrumbsModule,
3362
+ NgvButtonModule,
3363
+ NgvCardModule,
3364
+ NggCharacterCountdownDirectiveModule,
3365
+ NgvCheckboxModule,
3366
+ NgvDropdownModule,
3367
+ NgvI18nModule,
3368
+ NgvInfoCircleModule,
3369
+ NgvInputModule,
3370
+ NgvInputMaskModule,
3371
+ NgvModalModule,
3372
+ NgvRadioModule,
3373
+ NgvTextareaModule,
3374
+ NgvTooltipModule,
3375
+ NgvTypeaheadModule] }); }
3376
+ }
3377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NggvModule, decorators: [{
3378
+ type: NgModule,
3379
+ args: [{
3380
+ declarations: [],
3381
+ imports: [CommonModule],
3382
+ exports: [
3383
+ NgvBaseControlValueAccessorModule,
3384
+ NgvBreadcrumbsModule,
3385
+ NgvButtonModule,
3386
+ NgvCardModule,
3387
+ NggCharacterCountdownDirectiveModule,
3388
+ NgvCheckboxModule,
3389
+ NgvDropdownModule,
3390
+ NgvI18nModule,
3391
+ NgvInfoCircleModule,
3392
+ NgvInputModule,
3393
+ NgvInputMaskModule,
3394
+ NgvModalModule,
3395
+ NgvRadioModule,
3396
+ NgvTextareaModule,
3397
+ NgvTooltipModule,
3398
+ NgvTypeaheadModule,
3399
+ ],
3400
+ }]
3401
+ }] });
3402
+
3403
+ /**
3404
+ * Generated bundle index. Do not edit.
3405
+ */
3406
+
3407
+ export { ButtonStyle, CharacterCountdownDirective, InputMaskFormatPipe, NggCharacterCountdownDirectiveModule, 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 };
3408
+ //# sourceMappingURL=sebgroup-green-angular-v-angular.mjs.map