@sebgroup/green-angular 1.0.0-beta.8 → 1.0.0

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 (59) hide show
  1. package/esm2020/index.mjs +9 -5
  2. package/esm2020/lib/accordion/accordion-list-item.component.mjs +47 -0
  3. package/esm2020/lib/accordion/accordion.component.mjs +72 -0
  4. package/esm2020/lib/accordion/accordion.module.mjs +19 -0
  5. package/esm2020/lib/accordion/index.mjs +4 -0
  6. package/esm2020/lib/badge/badge.component.mjs +80 -0
  7. package/esm2020/lib/badge/badge.module.mjs +18 -0
  8. package/esm2020/lib/badge/index.mjs +3 -0
  9. package/esm2020/lib/button/button.component.mjs +26 -0
  10. package/esm2020/lib/button/button.module.mjs +18 -0
  11. package/esm2020/lib/button/index.mjs +3 -0
  12. package/esm2020/lib/datepicker/datepicker.component.mjs +186 -0
  13. package/esm2020/lib/datepicker/datepicker.module.mjs +19 -0
  14. package/esm2020/lib/datepicker/index.mjs +3 -0
  15. package/esm2020/lib/dropdown/dropdown-option.directive.mjs +16 -0
  16. package/esm2020/lib/dropdown/dropdown.component.mjs +90 -181
  17. package/esm2020/lib/dropdown/dropdown.module.mjs +8 -7
  18. package/esm2020/lib/dropdown/index.mjs +4 -0
  19. package/esm2020/lib/green-angular.module.mjs +36 -7
  20. package/esm2020/lib/modal/index.mjs +3 -0
  21. package/esm2020/lib/modal/modal.component.mjs +196 -0
  22. package/esm2020/lib/modal/modal.module.mjs +31 -0
  23. package/esm2020/lib/progress-circle/index.mjs +3 -0
  24. package/esm2020/lib/progress-circle/progress-circle.component.mjs +48 -0
  25. package/esm2020/lib/progress-circle/progress-circle.module.mjs +18 -0
  26. package/esm2020/lib/segmented-control/index.mjs +3 -0
  27. package/esm2020/lib/segmented-control/segmented-control.component.mjs +3 -3
  28. package/esm2020/lib/segmented-control/segmented-control.module.mjs +4 -4
  29. package/fesm2015/sebgroup-green-angular.mjs +913 -231
  30. package/fesm2015/sebgroup-green-angular.mjs.map +1 -1
  31. package/fesm2020/sebgroup-green-angular.mjs +900 -229
  32. package/fesm2020/sebgroup-green-angular.mjs.map +1 -1
  33. package/index.d.ts +8 -4
  34. package/lib/accordion/accordion-list-item.component.d.ts +15 -0
  35. package/lib/accordion/accordion.component.d.ts +16 -0
  36. package/lib/accordion/accordion.module.d.ts +9 -0
  37. package/lib/accordion/index.d.ts +3 -0
  38. package/lib/badge/badge.component.d.ts +25 -0
  39. package/lib/badge/badge.module.d.ts +8 -0
  40. package/lib/badge/index.d.ts +2 -0
  41. package/lib/button/button.component.d.ts +9 -0
  42. package/lib/button/button.module.d.ts +8 -0
  43. package/lib/button/index.d.ts +2 -0
  44. package/lib/datepicker/datepicker.component.d.ts +49 -0
  45. package/lib/datepicker/datepicker.module.d.ts +9 -0
  46. package/lib/datepicker/index.d.ts +2 -0
  47. package/lib/dropdown/dropdown-option.directive.d.ts +8 -0
  48. package/lib/dropdown/dropdown.component.d.ts +34 -16
  49. package/lib/dropdown/dropdown.module.d.ts +3 -2
  50. package/lib/dropdown/index.d.ts +3 -0
  51. package/lib/green-angular.module.d.ts +9 -3
  52. package/lib/modal/index.d.ts +2 -0
  53. package/lib/modal/modal.component.d.ts +59 -0
  54. package/lib/modal/modal.module.d.ts +9 -0
  55. package/lib/progress-circle/index.d.ts +2 -0
  56. package/lib/progress-circle/progress-circle.component.d.ts +15 -0
  57. package/lib/progress-circle/progress-circle.module.d.ts +8 -0
  58. package/lib/segmented-control/index.d.ts +2 -0
  59. package/package.json +10 -9
@@ -1,98 +1,297 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, NgModule, EventEmitter, Output, ViewChild } from '@angular/core';
3
- import * as i1 from '@angular/common';
2
+ import { EventEmitter, Component, Input, Output, ContentChildren, NgModule, ChangeDetectionStrategy, HostBinding, Directive, Injector, Inject, ViewChild, ContentChild } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import * as i2 from '@angular/router';
5
+ import { randomId, dropdownValues, createDropdown, months, years, createDatepicker } from '@sebgroup/extract';
6
+ import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
7
+ import { startOfDay, endOfDay } from 'date-fns';
8
+ import * as i1 from '@angular/cdk/a11y';
9
+ import { A11yModule } from '@angular/cdk/a11y';
10
+ import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
11
+ import * as i2$1 from '@angular/router';
6
12
  import { RouterModule } from '@angular/router';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { dropdownValues, createDropdown } from '@sebgroup/extract';
9
13
 
10
- class NggSegmentedControlComponent {
14
+ class NggAccordionListItemComponent {
15
+ constructor() {
16
+ this.id = randomId();
17
+ this.listItemHeader = '';
18
+ this.listItemSubHeader = '';
19
+ this.expandedChange = new EventEmitter();
20
+ this.contentHeight = "0px";
21
+ this.isExpanded = false;
22
+ }
23
+ shrink() {
24
+ this.isExpanded = false;
25
+ this.contentHeight = "0px";
26
+ }
27
+ expand() {
28
+ this.isExpanded = true;
29
+ this.contentHeight = "auto";
30
+ }
31
+ toggleExpanded() {
32
+ this.isExpanded = !this.isExpanded;
33
+ if (this.isExpanded) {
34
+ this.contentHeight = "auto";
35
+ }
36
+ else {
37
+ this.contentHeight = "0px";
38
+ }
39
+ this.expandedChange.emit(this);
40
+ }
11
41
  }
12
- NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
- NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
14
- <div class="group">
15
- <a
16
- *ngFor="let control of $controls | async"
17
- [routerLink]="control.url"
18
- routerLinkActive="active"
19
- class="button"
20
- >{{ control.text }}</a
21
- >
22
- </div>
23
- `, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
42
+ NggAccordionListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
43
+ NggAccordionListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggAccordionListItemComponent, selector: "div[ngg-accordion-list-item]", inputs: { id: "id", listItemHeader: "listItemHeader", listItemSubHeader: "listItemSubHeader" }, outputs: { expandedChange: "expandedChange" }, ngImport: i0, template: "<ng-container data-testid=\"accordion-list-item-root\">\n <div role=\"heading\" aria-level=\"2\" [attr.id]=\"id\">\n <button data-testid=\"accordion-list-item-expander-button\" [attr.id]=\"id + '_header'\" (click)=\"toggleExpanded()\"\n tabindex=\"0\" [attr.aria-expanded]=\"this.isExpanded\" [attr.aria-controls]=\"id + '_section'\">\n <span data-testid=\"accordion-list-item-header\">{{listItemHeader}}</span>\n <span data-testid=\"accordion-list-item-subheader\">{{listItemSubHeader}}</span>\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18.8095 9.22817L18.1907 8.60942C18.0438 8.46255 17.8063 8.46255 17.6595 8.60942L12.0001 14.2563L6.34072 8.60942C6.19385 8.46255 5.95635 8.46255 5.80947 8.60942L5.19072 9.22817C5.04385 9.37505 5.04385 9.61255 5.19072 9.75942L11.7345 16.3032C11.8813 16.45 12.1188 16.45 12.2657 16.3032L18.8095 9.75942C18.9563 9.61255 18.9563 9.37505 18.8095 9.22817Z\"\n fill=\"#333333\" />\n </svg>\n </button>\n <div role=\"region\" [hidden]=\"!this.isExpanded\"\n [ngStyle]=\"{height: this.contentHeight}\" [id]=\"id + '_section'\" [attr.aria-labelledby]=\"id + '_header'\"\n data-testid=\"accordion-list-item-content\">\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</ng-container>", directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionListItemComponent, decorators: [{
45
+ type: Component,
46
+ args: [{ selector: 'div[ngg-accordion-list-item]', template: "<ng-container data-testid=\"accordion-list-item-root\">\n <div role=\"heading\" aria-level=\"2\" [attr.id]=\"id\">\n <button data-testid=\"accordion-list-item-expander-button\" [attr.id]=\"id + '_header'\" (click)=\"toggleExpanded()\"\n tabindex=\"0\" [attr.aria-expanded]=\"this.isExpanded\" [attr.aria-controls]=\"id + '_section'\">\n <span data-testid=\"accordion-list-item-header\">{{listItemHeader}}</span>\n <span data-testid=\"accordion-list-item-subheader\">{{listItemSubHeader}}</span>\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18.8095 9.22817L18.1907 8.60942C18.0438 8.46255 17.8063 8.46255 17.6595 8.60942L12.0001 14.2563L6.34072 8.60942C6.19385 8.46255 5.95635 8.46255 5.80947 8.60942L5.19072 9.22817C5.04385 9.37505 5.04385 9.61255 5.19072 9.75942L11.7345 16.3032C11.8813 16.45 12.1188 16.45 12.2657 16.3032L18.8095 9.75942C18.9563 9.61255 18.9563 9.37505 18.8095 9.22817Z\"\n fill=\"#333333\" />\n </svg>\n </button>\n <div role=\"region\" [hidden]=\"!this.isExpanded\"\n [ngStyle]=\"{height: this.contentHeight}\" [id]=\"id + '_section'\" [attr.aria-labelledby]=\"id + '_header'\"\n data-testid=\"accordion-list-item-content\">\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</ng-container>" }]
47
+ }], propDecorators: { id: [{
48
+ type: Input
49
+ }], listItemHeader: [{
50
+ type: Input
51
+ }], listItemSubHeader: [{
52
+ type: Input
53
+ }], expandedChange: [{
54
+ type: Output
55
+ }] } });
56
+
57
+ class NggAccordionComponent {
58
+ constructor() {
59
+ this.closeOthers = false;
60
+ }
61
+ get expandAll() {
62
+ return this._expandAll;
63
+ }
64
+ set expandAll(value) {
65
+ if (value === this._expandAll)
66
+ return;
67
+ if (this._expandAll) {
68
+ this.expandAllSubscription?.unsubscribe();
69
+ }
70
+ this._expandAll = value;
71
+ this.expandAllSubscription = this._expandAll?.subscribe(() => {
72
+ if (this.closeOthers === false) {
73
+ const itemArray = this.items ? Array.from(this.items) : undefined;
74
+ if (itemArray) {
75
+ for (const i of itemArray) {
76
+ i.expand();
77
+ }
78
+ }
79
+ }
80
+ });
81
+ }
82
+ ngAfterContentChecked() {
83
+ if (this.closeOthers) {
84
+ const itemArray = this.items ? Array.from(this.items) : undefined;
85
+ if (itemArray) {
86
+ for (const i of itemArray) {
87
+ i.expandedChange.subscribe((child) => this.onChildExpanded(child));
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ngOnDestroy() {
93
+ if (this.closeOthers) {
94
+ const itemArray = this.items ? Array.from(this.items) : undefined;
95
+ if (itemArray) {
96
+ for (const i of itemArray) {
97
+ i.expandedChange.unsubscribe();
98
+ }
99
+ }
100
+ }
101
+ this.expandAllSubscription?.unsubscribe();
102
+ }
103
+ onChildExpanded(childIdentity) {
104
+ if (this.closeOthers && childIdentity.isExpanded && this.items) {
105
+ this.items.forEach((item) => {
106
+ if (item !== childIdentity)
107
+ item.shrink();
108
+ });
109
+ }
110
+ }
111
+ }
112
+ NggAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
113
+ NggAccordionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggAccordionComponent, selector: "ngg-accordion", inputs: { closeOthers: "closeOthers", expandAll: "expandAll" }, queries: [{ propertyName: "items", predicate: NggAccordionListItemComponent }], ngImport: i0, template: "<div class=\"accordion\" data-testid=\"accordion-root\">\n <ng-content></ng-content>\n</div>\n" });
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionComponent, decorators: [{
25
115
  type: Component,
116
+ args: [{ selector: "ngg-accordion", template: "<div class=\"accordion\" data-testid=\"accordion-root\">\n <ng-content></ng-content>\n</div>\n" }]
117
+ }], propDecorators: { items: [{
118
+ type: ContentChildren,
119
+ args: [NggAccordionListItemComponent]
120
+ }], closeOthers: [{
121
+ type: Input
122
+ }], expandAll: [{
123
+ type: Input
124
+ }] } });
125
+
126
+ class NggAccordionModule {
127
+ }
128
+ NggAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
129
+ NggAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionModule, declarations: [NggAccordionListItemComponent, NggAccordionComponent], imports: [CommonModule], exports: [NggAccordionListItemComponent, NggAccordionComponent] });
130
+ NggAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionModule, imports: [[CommonModule]] });
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggAccordionModule, decorators: [{
132
+ type: NgModule,
26
133
  args: [{
27
- selector: 'ngg-segmented-control',
134
+ imports: [CommonModule],
135
+ exports: [NggAccordionListItemComponent, NggAccordionComponent],
136
+ declarations: [NggAccordionListItemComponent, NggAccordionComponent]
137
+ }]
138
+ }] });
139
+
140
+ class NggBadgeComponent {
141
+ //eslint-disable-next-line
142
+ constructor() {
143
+ /** The color of the component */
144
+ this.badgeType = '';
145
+ /** Callback when component is dismissed */
146
+ this.handleClose = new EventEmitter();
147
+ }
148
+ /** Flag whether the component can be dismissed */
149
+ set isCloseable(value) {
150
+ this._isCloseable = value;
151
+ }
152
+ get isCloseable() {
153
+ return this._isCloseable === '' || !!this._isCloseable;
154
+ }
155
+ get class() {
156
+ return ['badge', this.badgeType].join(' ');
157
+ }
158
+ ngOnInit() {
159
+ if (!!this.customColor || !!this.customBackgroundColor) {
160
+ this.badgeType = '';
161
+ }
162
+ }
163
+ close(e) {
164
+ this.handleClose.emit(e);
165
+ }
166
+ }
167
+ NggBadgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
168
+ NggBadgeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggBadgeComponent, selector: "[ngg-badge]", inputs: { badgeType: "badgeType", isCloseable: "isCloseable", closeText: "closeText", customColor: "customColor", customBackgroundColor: "customBackgroundColor" }, outputs: { handleClose: "handleClose" }, host: { properties: { "style.color": "this.customColor", "style.background-color": "this.customBackgroundColor", "class": "this.class" } }, ngImport: i0, template: `
169
+ <strong>
170
+ <ng-content></ng-content>
171
+ </strong>
172
+ <button *ngIf="isCloseable" class="close" (click)="close($event)">
173
+ {{ closeText }}
174
+ <i></i>
175
+ </button>
176
+ `, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeComponent, decorators: [{
178
+ type: Component,
179
+ args: [{
180
+ // we need to disable this warning since we don't want the badge component to create a new element
181
+ // eslint-disable-next-line @angular-eslint/component-selector
182
+ selector: '[ngg-badge]',
28
183
  template: `
29
- <div class="group">
30
- <a
31
- *ngFor="let control of $controls | async"
32
- [routerLink]="control.url"
33
- routerLinkActive="active"
34
- class="button"
35
- >{{ control.text }}</a
36
- >
37
- </div>
184
+ <strong>
185
+ <ng-content></ng-content>
186
+ </strong>
187
+ <button *ngIf="isCloseable" class="close" (click)="close($event)">
188
+ {{ closeText }}
189
+ <i></i>
190
+ </button>
38
191
  `,
39
- styles: [],
40
192
  changeDetection: ChangeDetectionStrategy.OnPush,
41
193
  }]
42
- }], propDecorators: { $controls: [{
194
+ }], ctorParameters: function () { return []; }, propDecorators: { badgeType: [{
195
+ type: Input
196
+ }], isCloseable: [{
197
+ type: Input
198
+ }], closeText: [{
199
+ type: Input
200
+ }], customColor: [{
201
+ type: HostBinding,
202
+ args: ['style.color']
203
+ }, {
43
204
  type: Input
205
+ }], customBackgroundColor: [{
206
+ type: HostBinding,
207
+ args: ['style.background-color']
208
+ }, {
209
+ type: Input
210
+ }], class: [{
211
+ type: HostBinding,
212
+ args: ['class']
213
+ }], handleClose: [{
214
+ type: Output
44
215
  }] } });
45
216
 
46
- class NggSegmentedControlModule {
217
+ class NggBadgeModule {
47
218
  }
48
- NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
49
- NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
50
- NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
219
+ NggBadgeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
220
+ NggBadgeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, declarations: [NggBadgeComponent], imports: [CommonModule], exports: [NggBadgeComponent] });
221
+ NggBadgeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, imports: [[CommonModule]] });
222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, decorators: [{
52
223
  type: NgModule,
53
224
  args: [{
54
- declarations: [NggSegmentedControlComponent],
55
- imports: [RouterModule, CommonModule],
56
- exports: [NggSegmentedControlComponent],
225
+ declarations: [NggBadgeComponent],
226
+ imports: [CommonModule],
227
+ exports: [NggBadgeComponent],
57
228
  }]
58
229
  }] });
59
230
 
231
+ class NggDropdownOptionDirective {
232
+ constructor(templateRef) {
233
+ this.templateRef = templateRef;
234
+ }
235
+ }
236
+ NggDropdownOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownOptionDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
237
+ NggDropdownOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.3", type: NggDropdownOptionDirective, selector: "[nggDropdownOption]", ngImport: i0 });
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownOptionDirective, decorators: [{
239
+ type: Directive,
240
+ args: [{
241
+ selector: '[nggDropdownOption]',
242
+ }]
243
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
244
+
60
245
  class NggDropdownComponent {
61
- constructor(cd) {
246
+ constructor(cd, injector) {
62
247
  this.cd = cd;
248
+ this.injector = injector;
63
249
  this.loop = false;
64
250
  this.options = [];
251
+ this._multiSelect = false;
252
+ this._searchable = false;
65
253
  this.valueChange = new EventEmitter();
66
- this.toggler = dropdownValues.elements?.toggler;
67
- this.listbox = dropdownValues.elements?.listbox;
254
+ this.touched = new EventEmitter();
255
+ this.toggler = dropdownValues().elements?.toggler;
256
+ this.listbox = dropdownValues().elements?.listbox;
257
+ this.fieldset = dropdownValues().elements?.fieldset;
68
258
  this.trackByKey = (index, option) => {
69
- return option.key;
259
+ return option.attributes.id ?? '';
70
260
  };
71
261
  }
262
+ set multiSelect(value) {
263
+ this._multiSelect = this.convertToBoolean(value);
264
+ }
265
+ get multiSelect() {
266
+ return this._multiSelect;
267
+ }
268
+ set searchable(value) {
269
+ this._searchable = this.convertToBoolean(value);
270
+ }
271
+ get searchable() {
272
+ return this._searchable;
273
+ }
274
+ set value(newValue) {
275
+ this.handler?.selectByValue(newValue);
276
+ this._value = newValue;
277
+ }
72
278
  get value() {
73
279
  return this._value;
74
280
  }
75
- set value(newValue) {
76
- if (newValue !== this._value) {
77
- if (this.options) {
78
- this.setSelectionByValue(newValue);
79
- }
80
- this._value = newValue;
81
- }
281
+ get control() {
282
+ return this.injector.get(NgControl);
82
283
  }
83
284
  ngAfterViewInit() {
84
285
  if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {
85
- this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (dropdown) => {
286
+ this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, this.fieldsetRef?.nativeElement, (dropdown) => {
86
287
  this.dropdown = dropdown;
87
288
  this.toggler = dropdown.elements.toggler;
88
289
  this.listbox = dropdown.elements.listbox;
89
- const selected = this.dropdown.options.find((option) => option.selected);
90
- if (this._value !== selected?.value) {
91
- this._value = selected?.value;
92
- }
290
+ this.fieldset = dropdown.elements.fieldset;
93
291
  this.cd.detectChanges();
292
+ }, (value) => {
293
+ this.updateValue(value);
94
294
  });
95
- this.setSelectionByValue(this.value);
96
295
  }
97
296
  }
98
297
  ngOnDestroy() {
@@ -100,9 +299,8 @@ class NggDropdownComponent {
100
299
  }
101
300
  ngOnChanges(changes) {
102
301
  if (this.handler &&
103
- (changes.id || changes.text || changes.loop || changes.options)) {
302
+ (changes.id || changes.texts || changes.loop || changes.options)) {
104
303
  this.handler.update(this.props);
105
- this.setSelectionByValue(this.value);
106
304
  }
107
305
  }
108
306
  writeValue(value) {
@@ -114,189 +312,68 @@ class NggDropdownComponent {
114
312
  registerOnTouched(fn) {
115
313
  this.onTouchedFn = fn;
116
314
  }
117
- select(option) {
118
- this.handler?.select(option);
119
- this._value = option.value;
120
- this.valueChange.emit(option.value);
121
- this.onChangeFn && this.onChangeFn(option.value);
122
- this.onTouchedFn && this.onTouchedFn();
315
+ search($event) {
316
+ this.handler?.search($event.target.value);
123
317
  }
124
318
  get props() {
125
319
  return {
126
- id: this.id,
127
- text: this.text,
320
+ id: this.id || this.dropdown?.id,
321
+ texts: this.texts,
322
+ useValue: this.useValue,
323
+ display: this.display,
128
324
  options: this.options,
129
325
  loop: this.loop,
326
+ value: this.value,
327
+ multiSelect: this.multiSelect,
328
+ searchable: this.searchable,
329
+ searchFilter: this.searchFilter,
330
+ compareWith: this.compareWith,
331
+ onTouched: () => {
332
+ this.onTouchedFn?.();
333
+ this.touched.emit(true);
334
+ this.cd.markForCheck();
335
+ },
130
336
  };
131
337
  }
132
- setSelectionByValue(value) {
133
- if (this.handler && value !== undefined) {
134
- const option = this.handler.dropdown.options.find((option) => option.value === value);
135
- if (option)
136
- this.handler?.select(option);
137
- }
338
+ updateValue(option) {
339
+ this._value = option;
340
+ this.valueChange.emit(option);
341
+ this.onChangeFn?.(option);
342
+ }
343
+ convertToBoolean(value) {
344
+ return (value === '' || value === 'true' || value.toString() === 'true' || false);
138
345
  }
139
346
  }
140
- NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
141
- NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", text: "text", loop: "loop", label: "label", options: "options", valid: "valid", invalid: "invalid", value: "value" }, outputs: { valueChange: "valueChange" }, providers: [
347
+ NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: Injector }], target: i0.ɵɵFactoryTarget.Component });
348
+ NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", texts: "texts", loop: "loop", display: "display", useValue: "useValue", label: "label", options: "options", valid: "valid", invalid: "invalid", compareWith: "compareWith", searchFilter: "searchFilter", multiSelect: "multiSelect", searchable: "searchable", value: "value" }, outputs: { valueChange: "valueChange", touched: "touched" }, providers: [
142
349
  {
143
350
  provide: NG_VALUE_ACCESSOR,
144
351
  useExisting: NggDropdownComponent,
145
352
  multi: true,
146
353
  },
147
- ], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
148
- <div>
149
- <span
150
- class="label"
151
- *ngIf="label"
152
- [id]="toggler?.attributes?.id + '_label'"
153
- >{{ label }}</span
154
- >
155
- <button
156
- [attr.aria-labelledby]="
157
- label ? toggler?.attributes?.id + '_info' : null
158
- "
159
- [attr.aria-describedby]="
160
- label ? toggler?.attributes?.id + '_info' : null
161
- "
162
- type="button"
163
- #togglerRef
164
- [id]="toggler?.attributes?.id"
165
- [attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
166
- [attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
167
- [attr.aria-owns]="toggler?.attributes?.['aria-owns']"
168
- [tabindex]="toggler?.attributes?.tabIndex"
169
- [style]="toggler?.attributes?.style"
170
- [class]="toggler?.classes"
171
- (click)="handler?.toggle()"
172
- [class.is-valid]="valid"
173
- [class.is-invalid]="invalid"
174
- >
175
- <span>{{ dropdown?.text }}</span>
176
- </button>
177
- <span class="form-info" [attr.id]="toggler?.attributes?.id + '_info'"
178
- ><ng-content select="[data-form-info]"></ng-content
179
- ></span>
180
- <div
181
- #listboxRef
182
- [id]="listbox?.attributes?.id"
183
- [attr.role]="listbox?.attributes?.role"
184
- [attr.aria-activedescendant]="
185
- listbox?.attributes?.['aria-activedescendant']
186
- "
187
- [tabindex]="listbox?.attributes?.tabIndex"
188
- [style]="listbox?.attributes?.style"
189
- [class]="listbox?.classes"
190
- >
191
- <button
192
- type="button"
193
- class="close m-4 m-sm-2 d-block d-sm-none"
194
- (click)="handler?.close()"
195
- >
196
- <span class="sr-only">Close</span>
197
- </button>
198
- <ul role="listbox">
199
- <li
200
- *ngFor="let option of dropdown?.options; trackBy: trackByKey"
201
- [id]="option.attributes.id"
202
- [attr.role]="option.attributes.role"
203
- [attr.aria-selected]="option.attributes['aria-selected']"
204
- [style]="option.attributes.style"
205
- [class]="option.classes"
206
- (click)="select(option)"
207
- >
208
- {{ option.key }}
209
- </li>
210
- </ul>
211
- </div>
212
- </div>
213
- `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownComponent, decorators: [{
354
+ ], queries: [{ propertyName: "customOption", first: true, predicate: NggDropdownOptionDirective, descendants: true }], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }, { propertyName: "fieldsetRef", first: true, predicate: ["fieldsetRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\n <span class=\"label\" *ngIf=\"label\" [id]=\"toggler?.attributes?.id + '_label'\">{{\n label\n }}</span>\n <button\n [attr.aria-labelledby]=\"label ? toggler?.attributes?.id + '_label' : null\"\n [attr.aria-describedby]=\"\n formInfo?.textContent && (formInfo?.textContent?.length ?? 0 > 0)\n ? toggler?.attributes?.id + '_info'\n : null\n \"\n type=\"button\"\n #togglerRef\n [id]=\"toggler?.attributes?.id\"\n [attr.aria-haspopup]=\"toggler?.attributes?.['aria-haspopup']\"\n [attr.aria-expanded]=\"toggler?.attributes?.['aria-expanded']\"\n [attr.aria-owns]=\"toggler?.attributes?.['aria-owns']\"\n [tabindex]=\"toggler?.attributes?.tabIndex\"\n [style]=\"toggler?.attributes?.style\"\n [class]=\"toggler?.classes\"\n (click)=\"handler?.toggle()\"\n [class.is-valid]=\"valid\"\n [class.is-invalid]=\"invalid\"\n >\n <span>{{ dropdown?.texts?.select }}</span>\n </button>\n <span\n class=\"form-info\"\n #formInfo\n [attr.id]=\"toggler?.attributes?.id + '_info'\"\n ><ng-content select=\"[data-form-info]\"></ng-content\n ></span>\n <div\n #listboxRef\n [id]=\"listbox?.attributes?.id\"\n [attr.role]=\"listbox?.attributes?.role\"\n [attr.aria-activedescendant]=\"\n listbox?.attributes?.['aria-activedescendant']\n \"\n [tabindex]=\"listbox?.attributes?.tabIndex\"\n [style]=\"listbox?.attributes?.style\"\n [class]=\"listbox?.classes\"\n >\n <button\n type=\"button\"\n class=\"close m-4 m-sm-2 d-block d-sm-none\"\n (click)=\"handler?.close()\"\n >\n <span class=\"sr-only\">{{ dropdown?.texts?.close }}</span>\n <i></i>\n </button>\n <ul role=\"listbox\" *ngIf=\"!dropdown?.isMultiSelect\">\n <ng-container *ngTemplateOutlet=\"searchInput\"></ng-container>\n <li\n *ngFor=\"\n let option of dropdown?.options;\n let index = index;\n trackBy: trackByKey\n \"\n [id]=\"option.attributes.id\"\n [attr.role]=\"option.attributes.role\"\n [attr.aria-selected]=\"option.attributes['aria-selected']\"\n [style]=\"option.attributes.style\"\n [class]=\"option.classes\"\n (click)=\"handler?.select(option)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customOption?.templateRef\n ? customOption!.templateRef\n : defaultOption;\n context: { option: option, index: index }\n \"\n ></ng-container>\n </li>\n </ul>\n <div *ngIf=\"dropdown?.isMultiSelect\" class=\"sg-fieldset-container\">\n <ng-container *ngTemplateOutlet=\"searchInput\"></ng-container>\n <!--TODO: Improve checkboxes in dropdown angular-->\n <fieldset\n #fieldsetRef\n [attr.aria-describedby]=\"fieldset?.attributes?.id\"\n role=\"listbox\"\n tabIndex=\"-1\"\n aria-multiselectable=\"true\"\n >\n <legend class=\"sr-only\" [id]=\"fieldset?.attributes?.id\">Options</legend>\n <div>\n <label\n class=\"form-control\"\n [attr.role]=\"option.attributes.role\"\n [id]=\"option.attributes.id\"\n [attr.aria-selected]=\"option.attributes['aria-selected']\"\n [class]=\"option.classes\"\n *ngFor=\"\n let option of dropdown?.options;\n let index = index;\n trackBy: trackByKey\n \"\n >\n <input\n type=\"checkbox\"\n (change)=\"handler?.select(option, false)\"\n [checked]=\"option.selected\"\n tabIndex=\"-1\"\n />\n <ng-container\n *ngTemplateOutlet=\"\n customOption?.templateRef\n ? customOption!.templateRef\n : defaultOption;\n context: { option: option, index: index }\n \"\n ></ng-container>\n <i></i>\n </label>\n </div>\n </fieldset>\n </div>\n </div>\n</div>\n\n<ng-template #defaultOption let-option=\"option\">\n {{ option[dropdown!.display] }}\n</ng-template>\n\n<ng-template #searchInput>\n <input\n *ngIf=\"dropdown?.isSearchable\"\n [id]=\"toggler?.attributes?.id + '_search-input'\"\n type=\"search\"\n (input)=\"search($event)\"\n placeholder=\"{{ dropdown?.texts?.searchPlaceholder }}\"\n class=\"rounded-0 rounded-top border-0 border-bottom border-info\"\n />\n</ng-template>\n", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownComponent, decorators: [{
215
356
  type: Component,
216
- args: [{
217
- selector: 'ngg-dropdown',
218
- template: `
219
- <div>
220
- <span
221
- class="label"
222
- *ngIf="label"
223
- [id]="toggler?.attributes?.id + '_label'"
224
- >{{ label }}</span
225
- >
226
- <button
227
- [attr.aria-labelledby]="
228
- label ? toggler?.attributes?.id + '_info' : null
229
- "
230
- [attr.aria-describedby]="
231
- label ? toggler?.attributes?.id + '_info' : null
232
- "
233
- type="button"
234
- #togglerRef
235
- [id]="toggler?.attributes?.id"
236
- [attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
237
- [attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
238
- [attr.aria-owns]="toggler?.attributes?.['aria-owns']"
239
- [tabindex]="toggler?.attributes?.tabIndex"
240
- [style]="toggler?.attributes?.style"
241
- [class]="toggler?.classes"
242
- (click)="handler?.toggle()"
243
- [class.is-valid]="valid"
244
- [class.is-invalid]="invalid"
245
- >
246
- <span>{{ dropdown?.text }}</span>
247
- </button>
248
- <span class="form-info" [attr.id]="toggler?.attributes?.id + '_info'"
249
- ><ng-content select="[data-form-info]"></ng-content
250
- ></span>
251
- <div
252
- #listboxRef
253
- [id]="listbox?.attributes?.id"
254
- [attr.role]="listbox?.attributes?.role"
255
- [attr.aria-activedescendant]="
256
- listbox?.attributes?.['aria-activedescendant']
257
- "
258
- [tabindex]="listbox?.attributes?.tabIndex"
259
- [style]="listbox?.attributes?.style"
260
- [class]="listbox?.classes"
261
- >
262
- <button
263
- type="button"
264
- class="close m-4 m-sm-2 d-block d-sm-none"
265
- (click)="handler?.close()"
266
- >
267
- <span class="sr-only">Close</span>
268
- </button>
269
- <ul role="listbox">
270
- <li
271
- *ngFor="let option of dropdown?.options; trackBy: trackByKey"
272
- [id]="option.attributes.id"
273
- [attr.role]="option.attributes.role"
274
- [attr.aria-selected]="option.attributes['aria-selected']"
275
- [style]="option.attributes.style"
276
- [class]="option.classes"
277
- (click)="select(option)"
278
- >
279
- {{ option.key }}
280
- </li>
281
- </ul>
282
- </div>
283
- </div>
284
- `,
285
- providers: [
357
+ args: [{ selector: 'ngg-dropdown', providers: [
286
358
  {
287
359
  provide: NG_VALUE_ACCESSOR,
288
360
  useExisting: NggDropdownComponent,
289
361
  multi: true,
290
362
  },
291
- ],
292
- changeDetection: ChangeDetectionStrategy.OnPush,
293
- }]
294
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
363
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <span class=\"label\" *ngIf=\"label\" [id]=\"toggler?.attributes?.id + '_label'\">{{\n label\n }}</span>\n <button\n [attr.aria-labelledby]=\"label ? toggler?.attributes?.id + '_label' : null\"\n [attr.aria-describedby]=\"\n formInfo?.textContent && (formInfo?.textContent?.length ?? 0 > 0)\n ? toggler?.attributes?.id + '_info'\n : null\n \"\n type=\"button\"\n #togglerRef\n [id]=\"toggler?.attributes?.id\"\n [attr.aria-haspopup]=\"toggler?.attributes?.['aria-haspopup']\"\n [attr.aria-expanded]=\"toggler?.attributes?.['aria-expanded']\"\n [attr.aria-owns]=\"toggler?.attributes?.['aria-owns']\"\n [tabindex]=\"toggler?.attributes?.tabIndex\"\n [style]=\"toggler?.attributes?.style\"\n [class]=\"toggler?.classes\"\n (click)=\"handler?.toggle()\"\n [class.is-valid]=\"valid\"\n [class.is-invalid]=\"invalid\"\n >\n <span>{{ dropdown?.texts?.select }}</span>\n </button>\n <span\n class=\"form-info\"\n #formInfo\n [attr.id]=\"toggler?.attributes?.id + '_info'\"\n ><ng-content select=\"[data-form-info]\"></ng-content\n ></span>\n <div\n #listboxRef\n [id]=\"listbox?.attributes?.id\"\n [attr.role]=\"listbox?.attributes?.role\"\n [attr.aria-activedescendant]=\"\n listbox?.attributes?.['aria-activedescendant']\n \"\n [tabindex]=\"listbox?.attributes?.tabIndex\"\n [style]=\"listbox?.attributes?.style\"\n [class]=\"listbox?.classes\"\n >\n <button\n type=\"button\"\n class=\"close m-4 m-sm-2 d-block d-sm-none\"\n (click)=\"handler?.close()\"\n >\n <span class=\"sr-only\">{{ dropdown?.texts?.close }}</span>\n <i></i>\n </button>\n <ul role=\"listbox\" *ngIf=\"!dropdown?.isMultiSelect\">\n <ng-container *ngTemplateOutlet=\"searchInput\"></ng-container>\n <li\n *ngFor=\"\n let option of dropdown?.options;\n let index = index;\n trackBy: trackByKey\n \"\n [id]=\"option.attributes.id\"\n [attr.role]=\"option.attributes.role\"\n [attr.aria-selected]=\"option.attributes['aria-selected']\"\n [style]=\"option.attributes.style\"\n [class]=\"option.classes\"\n (click)=\"handler?.select(option)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n customOption?.templateRef\n ? customOption!.templateRef\n : defaultOption;\n context: { option: option, index: index }\n \"\n ></ng-container>\n </li>\n </ul>\n <div *ngIf=\"dropdown?.isMultiSelect\" class=\"sg-fieldset-container\">\n <ng-container *ngTemplateOutlet=\"searchInput\"></ng-container>\n <!--TODO: Improve checkboxes in dropdown angular-->\n <fieldset\n #fieldsetRef\n [attr.aria-describedby]=\"fieldset?.attributes?.id\"\n role=\"listbox\"\n tabIndex=\"-1\"\n aria-multiselectable=\"true\"\n >\n <legend class=\"sr-only\" [id]=\"fieldset?.attributes?.id\">Options</legend>\n <div>\n <label\n class=\"form-control\"\n [attr.role]=\"option.attributes.role\"\n [id]=\"option.attributes.id\"\n [attr.aria-selected]=\"option.attributes['aria-selected']\"\n [class]=\"option.classes\"\n *ngFor=\"\n let option of dropdown?.options;\n let index = index;\n trackBy: trackByKey\n \"\n >\n <input\n type=\"checkbox\"\n (change)=\"handler?.select(option, false)\"\n [checked]=\"option.selected\"\n tabIndex=\"-1\"\n />\n <ng-container\n *ngTemplateOutlet=\"\n customOption?.templateRef\n ? customOption!.templateRef\n : defaultOption;\n context: { option: option, index: index }\n \"\n ></ng-container>\n <i></i>\n </label>\n </div>\n </fieldset>\n </div>\n </div>\n</div>\n\n<ng-template #defaultOption let-option=\"option\">\n {{ option[dropdown!.display] }}\n</ng-template>\n\n<ng-template #searchInput>\n <input\n *ngIf=\"dropdown?.isSearchable\"\n [id]=\"toggler?.attributes?.id + '_search-input'\"\n type=\"search\"\n (input)=\"search($event)\"\n placeholder=\"{{ dropdown?.texts?.searchPlaceholder }}\"\n class=\"rounded-0 rounded-top border-0 border-bottom border-info\"\n />\n</ng-template>\n" }]
364
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Injector, decorators: [{
365
+ type: Inject,
366
+ args: [Injector]
367
+ }] }]; }, propDecorators: { id: [{
295
368
  type: Input
296
- }], text: [{
369
+ }], texts: [{
297
370
  type: Input
298
371
  }], loop: [{
299
372
  type: Input
373
+ }], display: [{
374
+ type: Input
375
+ }], useValue: [{
376
+ type: Input
300
377
  }], label: [{
301
378
  type: Input
302
379
  }], options: [{
@@ -305,43 +382,637 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
305
382
  type: Input
306
383
  }], invalid: [{
307
384
  type: Input
385
+ }], compareWith: [{
386
+ type: Input
387
+ }], searchFilter: [{
388
+ type: Input
389
+ }], multiSelect: [{
390
+ type: Input
391
+ }], searchable: [{
392
+ type: Input
308
393
  }], value: [{
309
394
  type: Input
310
395
  }], valueChange: [{
311
396
  type: Output
397
+ }], touched: [{
398
+ type: Output
312
399
  }], togglerRef: [{
313
400
  type: ViewChild,
314
401
  args: ['togglerRef']
315
402
  }], listboxRef: [{
316
403
  type: ViewChild,
317
404
  args: ['listboxRef']
405
+ }], fieldsetRef: [{
406
+ type: ViewChild,
407
+ args: ['fieldsetRef']
408
+ }], customOption: [{
409
+ type: ContentChild,
410
+ args: [NggDropdownOptionDirective]
318
411
  }] } });
319
412
 
413
+ class NggDatepickerComponent {
414
+ constructor(_cdr) {
415
+ this._cdr = _cdr;
416
+ this.id = randomId();
417
+ this.isValid = null;
418
+ this.valueChange = new EventEmitter();
419
+ this._months = months({});
420
+ this.listener = (data, state) => {
421
+ if (this.dp && state) {
422
+ this.dp.state = { ...state };
423
+ this.years = years({
424
+ from: this.dp.state?.minDate?.getFullYear(),
425
+ to: this.dp.state?.maxDate?.getFullYear(),
426
+ });
427
+ }
428
+ this.onTouchedFn && this.onTouchedFn();
429
+ if (data) {
430
+ // only emit change event if date has changed
431
+ if (this.data?.selectedDate !== data.selectedDate) {
432
+ this.valueChange.emit(data.selectedDate);
433
+ this.onChangeFn && this.onChangeFn(data.selectedDate);
434
+ }
435
+ this.data = data;
436
+ }
437
+ if (data || state) {
438
+ this._cdr.markForCheck();
439
+ }
440
+ };
441
+ }
442
+ get months() {
443
+ return this._months;
444
+ }
445
+ set months(value) {
446
+ this._months = value;
447
+ }
448
+ get options() {
449
+ return this._options;
450
+ }
451
+ set options(value) {
452
+ this._options = value;
453
+ if (value.locale) {
454
+ this.months = months({ locale: this.options?.locale });
455
+ }
456
+ }
457
+ get value() {
458
+ return this._value;
459
+ }
460
+ set value(newValue) {
461
+ if (newValue !== this._value) {
462
+ this._value = newValue;
463
+ }
464
+ }
465
+ writeValue(value) {
466
+ this.value = value;
467
+ // When binding using ngModel we need to set initial select date
468
+ // once we get initial value as it's not available when component is created
469
+ if (value && this.dp && !this.data?.selectedDate) {
470
+ this.dp.select(value);
471
+ }
472
+ }
473
+ registerOnChange(fn) {
474
+ this.onChangeFn = fn;
475
+ }
476
+ registerOnTouched(fn) {
477
+ this.onTouchedFn = fn;
478
+ }
479
+ get data() {
480
+ return this._data;
481
+ }
482
+ set data(value) {
483
+ this._data = value;
484
+ }
485
+ onDateChange(value) {
486
+ const newDate = new Date(value);
487
+ // Only pass valid date to date picker
488
+ if (!isNaN(newDate.getTime())) {
489
+ this.dp?.select(value);
490
+ }
491
+ else {
492
+ this.valueChange.emit(value);
493
+ this.onChangeFn && this.onChangeFn(value);
494
+ }
495
+ }
496
+ trackWeek(index, week) {
497
+ return week;
498
+ }
499
+ ngAfterViewInit() {
500
+ // initialize datepicker
501
+ if (this.datepickerElRef &&
502
+ this.datepickerDialogElRef &&
503
+ this.dateInputElRef &&
504
+ this.datepickerTriggerElRef &&
505
+ !this.dp) {
506
+ this.dp = createDatepicker(this.listener, {
507
+ ...this.options,
508
+ selectedDate: this.value,
509
+ }, this.datepickerElRef.nativeElement, this.datepickerDialogElRef.nativeElement, this.dateInputElRef.nativeElement, this.datepickerTriggerElRef.nativeElement);
510
+ this._cdr.detectChanges();
511
+ }
512
+ else {
513
+ throw 'Missing one or more elements...';
514
+ }
515
+ }
516
+ }
517
+ NggDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
518
+ NggDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggDatepickerComponent, selector: "ngg-datepicker", inputs: { options: "options", value: "value", id: "id", label: "label", isValid: "isValid" }, outputs: { valueChange: "valueChange" }, providers: [
519
+ {
520
+ provide: NG_VALUE_ACCESSOR,
521
+ useExisting: NggDatepickerComponent,
522
+ multi: true,
523
+ },
524
+ ], viewQueries: [{ propertyName: "datepickerDialogElRef", first: true, predicate: ["datepickerDialogElRef"], descendants: true }, { propertyName: "dateInputElRef", first: true, predicate: ["dateInputElRef"], descendants: true }, { propertyName: "datepickerElRef", first: true, predicate: ["datepickerElRef"], descendants: true }, { propertyName: "datepickerTriggerElRef", first: true, predicate: ["datepickerTriggerElRef"], descendants: true }], ngImport: i0, template: "<div class=\"form-group\">\n <label *ngIf=\"label\" [for]=\"id\">{{ label }}</label>\n <div\n class=\"group\"\n #datepickerElRef\n [class.is-valid]=\"isValid\"\n [class.is-invalid]=\"isValid === false\"\n >\n <input\n [attr.id]=\"id\"\n [attr.aria-describedby]=\"\n formInfo?.innerText && formInfo.innerText.length > 0\n ? id + '_info'\n : null\n \"\n type=\"text\"\n placeholder=\"yyyy-mm-dd\"\n #dateInputElRef\n [value]=\"data?.formattedSelectedDate || ''\"\n (change)=\"onDateChange(dateInputElRef.value)\"\n />\n <button\n #datepickerTriggerElRef\n (click)=\"dp?.toggle()\"\n type=\"button\"\n class=\"primary\"\n >\n <i class=\"sg-icon sg-icon-calendar\">Select date</i>\n </button>\n </div>\n <span class=\"form-info\" #formInfo [attr.id]=\"id + '_info'\"\n ><ng-content select=\"[data-form-info]\"></ng-content\n ></span>\n</div>\n<!-- TODO: get or set attributes from within datepicker instance (dp) -->\n<div\n #datepickerDialogElRef\n class=\"popover popover-datepicker\"\n [class.active]=\"dp?.state?.isActive\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Choose Date\"\n>\n <button type=\"button\" class=\"close\" (click)=\"dp?.close()\"><i></i>Close</button>\n <div class=\"sg-date\">\n <header>\n <button type=\"button\" class=\"link\" (click)=\"dp?.sub(1, 'months')\">\n <i class=\"sg-icon sg-icon-previous\">Previous month</i>\n </button>\n <ngg-dropdown\n [options]=\"months\"\n display=\"key\"\n text=\"Select\"\n [value]=\"data?.month\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n *ngIf=\"years\"\n [options]=\"years\"\n display=\"key\"\n text=\"Select\"\n [value]=\"data?.year\"\n (valueChange)=\"dp?.setYear($event)\"\n ></ngg-dropdown>\n <button type=\"button\" class=\"link\" (click)=\"dp?.add(1, 'months')\">\n <i class=\"sg-icon sg-icon-next\">Next month</i>\n </button>\n </header>\n <main>\n <table role=\"grid\">\n <thead>\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let header of data?.calendar?.headers\"\n [abbr]=\"header.abbr\"\n [class.sg-week-header]=\"header.type === 'week'\"\n [class.sg-day-header]=\"header.type === 'day'\"\n >\n {{ header.displayText }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"\n let week of data?.calendar?.calendarGrid;\n trackBy: trackWeek;\n let i = index\n \"\n >\n <th\n *ngIf=\"data?.calendar?.weekNumbers as weekNumbers\"\n class=\"sg-week-number\"\n >\n {{ weekNumbers[i] }}\n </th>\n <td\n *ngFor=\"let day of week\"\n [attr.data-date]=\"day.formattedDate\"\n [attr.role]=\"day.selected ? 'gridcell' : null\"\n [attr.aria-selected]=\"\n day.selected && !data?.highlightedDate ? true : null\n \"\n [class.disabled]=\"day.disabled\"\n [class.sg-date-today]=\"day.today\"\n [title]=\"day.today ? 'Today' : ''\"\n [tabIndex]=\"\n day.highlighted ||\n (day.selected && !data?.highlightedDate) ||\n (day.today && !data?.highlightedDate && !data?.selectedDate)\n ? 0\n : -1\n \"\n (click)=\"day.currentMonth && dp?.select(day.date)\"\n >\n {{ day.day }}\n </td>\n </tr>\n </tbody>\n </table>\n </main>\n </div>\n</div>\n", components: [{ type: NggDropdownComponent, selector: "ngg-dropdown", inputs: ["id", "texts", "loop", "display", "useValue", "label", "options", "valid", "invalid", "compareWith", "searchFilter", "multiSelect", "searchable", "value"], outputs: ["valueChange", "touched"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerComponent, decorators: [{
526
+ type: Component,
527
+ args: [{ selector: 'ngg-datepicker', providers: [
528
+ {
529
+ provide: NG_VALUE_ACCESSOR,
530
+ useExisting: NggDatepickerComponent,
531
+ multi: true,
532
+ },
533
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-group\">\n <label *ngIf=\"label\" [for]=\"id\">{{ label }}</label>\n <div\n class=\"group\"\n #datepickerElRef\n [class.is-valid]=\"isValid\"\n [class.is-invalid]=\"isValid === false\"\n >\n <input\n [attr.id]=\"id\"\n [attr.aria-describedby]=\"\n formInfo?.innerText && formInfo.innerText.length > 0\n ? id + '_info'\n : null\n \"\n type=\"text\"\n placeholder=\"yyyy-mm-dd\"\n #dateInputElRef\n [value]=\"data?.formattedSelectedDate || ''\"\n (change)=\"onDateChange(dateInputElRef.value)\"\n />\n <button\n #datepickerTriggerElRef\n (click)=\"dp?.toggle()\"\n type=\"button\"\n class=\"primary\"\n >\n <i class=\"sg-icon sg-icon-calendar\">Select date</i>\n </button>\n </div>\n <span class=\"form-info\" #formInfo [attr.id]=\"id + '_info'\"\n ><ng-content select=\"[data-form-info]\"></ng-content\n ></span>\n</div>\n<!-- TODO: get or set attributes from within datepicker instance (dp) -->\n<div\n #datepickerDialogElRef\n class=\"popover popover-datepicker\"\n [class.active]=\"dp?.state?.isActive\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Choose Date\"\n>\n <button type=\"button\" class=\"close\" (click)=\"dp?.close()\"><i></i>Close</button>\n <div class=\"sg-date\">\n <header>\n <button type=\"button\" class=\"link\" (click)=\"dp?.sub(1, 'months')\">\n <i class=\"sg-icon sg-icon-previous\">Previous month</i>\n </button>\n <ngg-dropdown\n [options]=\"months\"\n display=\"key\"\n text=\"Select\"\n [value]=\"data?.month\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n *ngIf=\"years\"\n [options]=\"years\"\n display=\"key\"\n text=\"Select\"\n [value]=\"data?.year\"\n (valueChange)=\"dp?.setYear($event)\"\n ></ngg-dropdown>\n <button type=\"button\" class=\"link\" (click)=\"dp?.add(1, 'months')\">\n <i class=\"sg-icon sg-icon-next\">Next month</i>\n </button>\n </header>\n <main>\n <table role=\"grid\">\n <thead>\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let header of data?.calendar?.headers\"\n [abbr]=\"header.abbr\"\n [class.sg-week-header]=\"header.type === 'week'\"\n [class.sg-day-header]=\"header.type === 'day'\"\n >\n {{ header.displayText }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"\n let week of data?.calendar?.calendarGrid;\n trackBy: trackWeek;\n let i = index\n \"\n >\n <th\n *ngIf=\"data?.calendar?.weekNumbers as weekNumbers\"\n class=\"sg-week-number\"\n >\n {{ weekNumbers[i] }}\n </th>\n <td\n *ngFor=\"let day of week\"\n [attr.data-date]=\"day.formattedDate\"\n [attr.role]=\"day.selected ? 'gridcell' : null\"\n [attr.aria-selected]=\"\n day.selected && !data?.highlightedDate ? true : null\n \"\n [class.disabled]=\"day.disabled\"\n [class.sg-date-today]=\"day.today\"\n [title]=\"day.today ? 'Today' : ''\"\n [tabIndex]=\"\n day.highlighted ||\n (day.selected && !data?.highlightedDate) ||\n (day.today && !data?.highlightedDate && !data?.selectedDate)\n ? 0\n : -1\n \"\n (click)=\"day.currentMonth && dp?.select(day.date)\"\n >\n {{ day.day }}\n </td>\n </tr>\n </tbody>\n </table>\n </main>\n </div>\n</div>\n" }]
534
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { options: [{
535
+ type: Input
536
+ }], value: [{
537
+ type: Input
538
+ }], id: [{
539
+ type: Input
540
+ }], label: [{
541
+ type: Input
542
+ }], isValid: [{
543
+ type: Input
544
+ }], valueChange: [{
545
+ type: Output
546
+ }], datepickerDialogElRef: [{
547
+ type: ViewChild,
548
+ args: ['datepickerDialogElRef']
549
+ }], dateInputElRef: [{
550
+ type: ViewChild,
551
+ args: ['dateInputElRef']
552
+ }], datepickerElRef: [{
553
+ type: ViewChild,
554
+ args: ['datepickerElRef']
555
+ }], datepickerTriggerElRef: [{
556
+ type: ViewChild,
557
+ args: ['datepickerTriggerElRef']
558
+ }] } });
559
+ function dateValidator(dates) {
560
+ return (control) => {
561
+ const value = control.value;
562
+ if (!value) {
563
+ return null;
564
+ }
565
+ const newDate = new Date(value);
566
+ const isValidDate = !isNaN(newDate.getTime());
567
+ if (!isValidDate) {
568
+ return { validDate: true };
569
+ }
570
+ const validMinDate = dates?.min ? newDate >= startOfDay(dates.min) : true;
571
+ const validMaxDate = dates?.max ? newDate <= endOfDay(dates.max) : true;
572
+ if (!validMinDate && dates?.min) {
573
+ return {
574
+ validDate: {
575
+ minDate: startOfDay(dates.min),
576
+ actualDate: newDate,
577
+ },
578
+ };
579
+ }
580
+ if (!validMaxDate && dates?.max) {
581
+ return {
582
+ validDate: {
583
+ maxDate: endOfDay(dates.max),
584
+ actualDate: newDate,
585
+ },
586
+ };
587
+ }
588
+ return null;
589
+ };
590
+ }
591
+
320
592
  class NggDropdownModule {
321
593
  }
322
- NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
323
- NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
324
- NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, decorators: [{
594
+ NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
595
+ NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent, NggDropdownOptionDirective], imports: [CommonModule], exports: [NggDropdownComponent, NggDropdownOptionDirective] });
596
+ NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
597
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, decorators: [{
326
598
  type: NgModule,
327
599
  args: [{
328
- declarations: [NggDropdownComponent],
600
+ declarations: [NggDropdownComponent, NggDropdownOptionDirective],
329
601
  imports: [CommonModule],
330
- exports: [NggDropdownComponent],
602
+ exports: [NggDropdownComponent, NggDropdownOptionDirective],
603
+ }]
604
+ }] });
605
+
606
+ class NggDatepickerModule {
607
+ }
608
+ NggDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
609
+ NggDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, declarations: [NggDatepickerComponent], imports: [CommonModule, NggDropdownModule], exports: [NggDatepickerComponent] });
610
+ NggDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, imports: [[CommonModule, NggDropdownModule]] });
611
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, decorators: [{
612
+ type: NgModule,
613
+ args: [{
614
+ declarations: [NggDatepickerComponent],
615
+ imports: [CommonModule, NggDropdownModule],
616
+ exports: [NggDatepickerComponent],
617
+ }]
618
+ }] });
619
+
620
+ class NggModalComponent {
621
+ constructor(ref, configurableFocusTrapFactory) {
622
+ this.ref = ref;
623
+ this.configurableFocusTrapFactory = configurableFocusTrapFactory;
624
+ this.isOpenChange = new EventEmitter();
625
+ this.closed = new EventEmitter();
626
+ this.confirm = new EventEmitter();
627
+ this.dismiss = new EventEmitter();
628
+ this.configurableFocusTrap = this.configurableFocusTrapFactory.create(this.ref.nativeElement);
629
+ }
630
+ get trapFocus() {
631
+ return this._trapFocus;
632
+ }
633
+ set trapFocus(value) {
634
+ this._trapFocus = value;
635
+ if (value) {
636
+ if (this._isOpen) {
637
+ this.enableFocusTrap();
638
+ }
639
+ }
640
+ else {
641
+ this.disableFocusTrap();
642
+ }
643
+ }
644
+ get isOpen() {
645
+ return this._isOpen;
646
+ }
647
+ set isOpen(value) {
648
+ this._isOpen = value;
649
+ if (value) {
650
+ if (this.trapFocus) {
651
+ this.enableFocusTrap();
652
+ }
653
+ disableBodyScroll(this.ref.nativeElement);
654
+ }
655
+ else {
656
+ this.disableFocusTrap();
657
+ enableBodyScroll(this.ref.nativeElement);
658
+ }
659
+ }
660
+ get open() { return this.isOpen; }
661
+ ngOnInit() {
662
+ if (this._isOpen && this.trapFocus)
663
+ this.enableFocusTrap();
664
+ else
665
+ this.disableFocusTrap();
666
+ }
667
+ handleCloseClick(event) {
668
+ this.closeModal(event);
669
+ }
670
+ handleBackdropClick(event) {
671
+ if (event.target == this.backdropRef?.nativeElement)
672
+ this.closeModal(event);
673
+ }
674
+ handleDismiss(event) {
675
+ this.dismiss.emit(event);
676
+ }
677
+ handleConfirm(event) {
678
+ this.confirm.emit(event);
679
+ }
680
+ closeModal(event) {
681
+ if (this.closed.observers.length > 0) {
682
+ this.closed.emit(event);
683
+ }
684
+ else {
685
+ this.isOpen = false;
686
+ this.isOpenChange.emit(this.isOpen);
687
+ }
688
+ }
689
+ enableFocusTrap() {
690
+ if (this.configurableFocusTrap) {
691
+ this.configurableFocusTrap.enabled = true;
692
+ this.configurableFocusTrap.focusInitialElementWhenReady();
693
+ }
694
+ }
695
+ disableFocusTrap() {
696
+ if (this.configurableFocusTrap) {
697
+ this.configurableFocusTrap.enabled = false;
698
+ }
699
+ }
700
+ ngOnDestroy() {
701
+ this.configurableFocusTrap?.destroy();
702
+ enableBodyScroll(this.ref.nativeElement);
703
+ }
704
+ }
705
+ NggModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalComponent, deps: [{ token: i0.ElementRef }, { token: i1.ConfigurableFocusTrapFactory }], target: i0.ɵɵFactoryTarget.Component });
706
+ NggModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggModalComponent, selector: "ngg-modal", inputs: { modalType: "modalType", header: "header", confirmLabel: "confirmLabel", dismissLabel: "dismissLabel", size: "size", trapFocus: "trapFocus", isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange", closed: "closed", confirm: "confirm", dismiss: "dismiss" }, host: { properties: { "class.open": "this.open" } }, viewQueries: [{ propertyName: "backdropRef", first: true, predicate: ["backdrop"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"isOpen\" [ngSwitch]=\"modalType\">\n <aside data-testid=\"modal\" *ngSwitchCase=\"'slideout'\" role=\"dialog\" aria-modal=\"true\" [class.small]=\"size === 'sm'\" [class.medium]=\"size === 'md'\" [class.large]=\"size === 'lg'\">\n <header ngg-modal-header data-testid=\"modal-header\" [header]=\"header\" (closed)=\"this.handleCloseClick($event)\"></header>\n <div ngg-modal-body data-testid=\"modal-body\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"contentTpl\"></ng-container> \n </div>\n <footer ngg-modal-footer data-testid=\"modal-footer\" *ngIf=\"dismissLabel || confirmLabel\" [dismissLabel]=\"dismissLabel\" [confirmLabel]=\"confirmLabel\" (dismiss)=\"this.handleDismiss($event)\" (confirm)=\"this.handleConfirm($event)\"></footer>\n </aside>\n <main data-testid=\"modal\" *ngSwitchCase=\"'takeover'\" role=\"dialog\" aria-modal=\"true\">\n <header ngg-modal-header data-testid=\"modal-header\" [header]=\"header\" (closed)=\"this.handleCloseClick($event)\"></header>\n <div ngg-modal-body data-testid=\"modal-body\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"contentTpl\"></ng-container> \n </div>\n <footer ngg-modal-footer data-testid=\"modal-footer\" *ngIf=\"dismissLabel || confirmLabel\" [dismissLabel]=\"dismissLabel\" [confirmLabel]=\"confirmLabel\" (dismiss)=\"this.handleDismiss($event)\" (confirm)=\"this.handleConfirm($event)\"></footer>\n </main>\n <section data-testid=\"modal\" *ngSwitchDefault role=\"dialog\" aria-modal=\"true\" [class.small]=\"size === 'sm'\" [class.medium]=\"size === 'md'\" [class.large]=\"size === 'lg'\">\n <header ngg-modal-header data-testid=\"modal-header\" [header]=\"header\" (closed)=\"this.handleCloseClick($event)\"></header>\n <div ngg-modal-body data-testid=\"modal-body\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"contentTpl\"></ng-container> \n </div>\n <footer ngg-modal-footer data-testid=\"modal-footer\" *ngIf=\"dismissLabel || confirmLabel\" [dismissLabel]=\"dismissLabel\" [confirmLabel]=\"confirmLabel\" (dismiss)=\"this.handleDismiss($event)\" (confirm)=\"this.handleConfirm($event)\"></footer>\n </section>\n <ng-template #contentTpl>\n <ng-content></ng-content>\n </ng-template>\n <div #backdrop data-testid=\"modal-backdrop\" class=\"backdrop\" (click)=\"this.handleBackdropClick($event)\" [attr.aria-hidden]=\"true\"></div>\n</ng-container>", styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"], components: [{ type: i0.forwardRef(function () { return NggModalHeaderComponent; }), selector: "[ngg-modal-header]", inputs: ["header"], outputs: ["closed"] }, { type: i0.forwardRef(function () { return NggModalBodyComponent; }), selector: "[ngg-modal-body]" }, { type: i0.forwardRef(function () { return NggModalFooterComponent; }), selector: "[ngg-modal-footer]", inputs: ["dismissLabel", "confirmLabel"], outputs: ["dismiss", "confirm"] }], directives: [{ type: i0.forwardRef(function () { return i2.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return i2.NgSwitch; }), selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i0.forwardRef(function () { return i2.NgSwitchCase; }), selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i0.forwardRef(function () { return i2.NgTemplateOutlet; }), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i0.forwardRef(function () { return i2.NgSwitchDefault; }), selector: "[ngSwitchDefault]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalComponent, decorators: [{
708
+ type: Component,
709
+ args: [{ selector: 'ngg-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"isOpen\" [ngSwitch]=\"modalType\">\n <aside data-testid=\"modal\" *ngSwitchCase=\"'slideout'\" role=\"dialog\" aria-modal=\"true\" [class.small]=\"size === 'sm'\" [class.medium]=\"size === 'md'\" [class.large]=\"size === 'lg'\">\n <header ngg-modal-header data-testid=\"modal-header\" [header]=\"header\" (closed)=\"this.handleCloseClick($event)\"></header>\n <div ngg-modal-body data-testid=\"modal-body\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"contentTpl\"></ng-container> \n </div>\n <footer ngg-modal-footer data-testid=\"modal-footer\" *ngIf=\"dismissLabel || confirmLabel\" [dismissLabel]=\"dismissLabel\" [confirmLabel]=\"confirmLabel\" (dismiss)=\"this.handleDismiss($event)\" (confirm)=\"this.handleConfirm($event)\"></footer>\n </aside>\n <main data-testid=\"modal\" *ngSwitchCase=\"'takeover'\" role=\"dialog\" aria-modal=\"true\">\n <header ngg-modal-header data-testid=\"modal-header\" [header]=\"header\" (closed)=\"this.handleCloseClick($event)\"></header>\n <div ngg-modal-body data-testid=\"modal-body\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"contentTpl\"></ng-container> \n </div>\n <footer ngg-modal-footer data-testid=\"modal-footer\" *ngIf=\"dismissLabel || confirmLabel\" [dismissLabel]=\"dismissLabel\" [confirmLabel]=\"confirmLabel\" (dismiss)=\"this.handleDismiss($event)\" (confirm)=\"this.handleConfirm($event)\"></footer>\n </main>\n <section data-testid=\"modal\" *ngSwitchDefault role=\"dialog\" aria-modal=\"true\" [class.small]=\"size === 'sm'\" [class.medium]=\"size === 'md'\" [class.large]=\"size === 'lg'\">\n <header ngg-modal-header data-testid=\"modal-header\" [header]=\"header\" (closed)=\"this.handleCloseClick($event)\"></header>\n <div ngg-modal-body data-testid=\"modal-body\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"contentTpl\"></ng-container> \n </div>\n <footer ngg-modal-footer data-testid=\"modal-footer\" *ngIf=\"dismissLabel || confirmLabel\" [dismissLabel]=\"dismissLabel\" [confirmLabel]=\"confirmLabel\" (dismiss)=\"this.handleDismiss($event)\" (confirm)=\"this.handleConfirm($event)\"></footer>\n </section>\n <ng-template #contentTpl>\n <ng-content></ng-content>\n </ng-template>\n <div #backdrop data-testid=\"modal-backdrop\" class=\"backdrop\" (click)=\"this.handleBackdropClick($event)\" [attr.aria-hidden]=\"true\"></div>\n</ng-container>", styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"] }]
710
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.ConfigurableFocusTrapFactory }]; }, propDecorators: { modalType: [{
711
+ type: Input
712
+ }], header: [{
713
+ type: Input
714
+ }], confirmLabel: [{
715
+ type: Input
716
+ }], dismissLabel: [{
717
+ type: Input
718
+ }], size: [{
719
+ type: Input
720
+ }], trapFocus: [{
721
+ type: Input
722
+ }], isOpen: [{
723
+ type: Input
724
+ }], isOpenChange: [{
725
+ type: Output
726
+ }], closed: [{
727
+ type: Output
728
+ }], confirm: [{
729
+ type: Output
730
+ }], dismiss: [{
731
+ type: Output
732
+ }], open: [{
733
+ type: HostBinding,
734
+ args: ['class.open']
735
+ }], backdropRef: [{
736
+ type: ViewChild,
737
+ args: ['backdrop']
738
+ }] } });
739
+ class NggModalHeaderComponent {
740
+ constructor() {
741
+ this.closed = new EventEmitter();
742
+ }
743
+ handleClose(event) {
744
+ this.closed.emit(event);
745
+ }
746
+ }
747
+ NggModalHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
748
+ NggModalHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggModalHeaderComponent, selector: "[ngg-modal-header]", inputs: { header: "header" }, outputs: { closed: "closed" }, ngImport: i0, template: `
749
+ <h3 data-testid="modal-header-text">{{header}}</h3>
750
+ <button data-testid="modal-close-button" class="close" (click)="this.handleClose($event)">
751
+ <span className="sr-only">Close</span>
752
+ <i></i>
753
+ </button>
754
+ `, isInline: true, styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"] });
755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalHeaderComponent, decorators: [{
756
+ type: Component,
757
+ args: [{ selector: '[ngg-modal-header]', template: `
758
+ <h3 data-testid="modal-header-text">{{header}}</h3>
759
+ <button data-testid="modal-close-button" class="close" (click)="this.handleClose($event)">
760
+ <span className="sr-only">Close</span>
761
+ <i></i>
762
+ </button>
763
+ `, styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"] }]
764
+ }], propDecorators: { header: [{
765
+ type: Input
766
+ }], closed: [{
767
+ type: Output
768
+ }] } });
769
+ class NggModalBodyComponent {
770
+ }
771
+ NggModalBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
772
+ NggModalBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggModalBodyComponent, selector: "[ngg-modal-body]", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"] });
773
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalBodyComponent, decorators: [{
774
+ type: Component,
775
+ args: [{ selector: '[ngg-modal-body]', template: `<ng-content></ng-content>`, styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"] }]
776
+ }] });
777
+ class NggModalFooterComponent {
778
+ constructor() {
779
+ this.dismiss = new EventEmitter();
780
+ this.confirm = new EventEmitter();
781
+ }
782
+ handleDismiss(event) {
783
+ this.dismiss.emit(event);
784
+ }
785
+ handleConfirm(event) {
786
+ this.confirm.emit(event);
787
+ }
788
+ }
789
+ NggModalFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
790
+ NggModalFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggModalFooterComponent, selector: "[ngg-modal-footer]", inputs: { dismissLabel: "dismissLabel", confirmLabel: "confirmLabel" }, outputs: { dismiss: "dismiss", confirm: "confirm" }, ngImport: i0, template: `
791
+ <button data-testid="modal-dismiss-button" *ngIf="dismissLabel" class="secondary" (click)="this.handleDismiss($event)">{{dismissLabel}}</button>
792
+ <button data-testid="modal-confirm-button" *ngIf="confirmLabel" class="primary" (click)="this.handleConfirm($event)">{{confirmLabel}}</button>
793
+ `, isInline: true, styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalFooterComponent, decorators: [{
795
+ type: Component,
796
+ args: [{ selector: '[ngg-modal-footer]', template: `
797
+ <button data-testid="modal-dismiss-button" *ngIf="dismissLabel" class="secondary" (click)="this.handleDismiss($event)">{{dismissLabel}}</button>
798
+ <button data-testid="modal-confirm-button" *ngIf="confirmLabel" class="primary" (click)="this.handleConfirm($event)">{{confirmLabel}}</button>
799
+ `, styles: [":host.open{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:var(--sg-z-index-modal-backdrop)}:host.open>section[role=dialog]{left:50%;top:50%;transform:translate(-50%,-50%)}.body::-webkit-scrollbar{background-color:#f8f8f8;height:10px;width:10px}.body::-webkit-scrollbar-thumb{background-color:#cecece}.body::-webkit-scrollbar-track{background-color:#f8f8f8;box-shadow:inset 0 0 10px #00000040}\n"] }]
800
+ }], propDecorators: { dismissLabel: [{
801
+ type: Input
802
+ }], confirmLabel: [{
803
+ type: Input
804
+ }], dismiss: [{
805
+ type: Output
806
+ }], confirm: [{
807
+ type: Output
808
+ }] } });
809
+
810
+ const DECLARATIONS = [
811
+ NggModalComponent,
812
+ NggModalHeaderComponent,
813
+ NggModalBodyComponent,
814
+ NggModalFooterComponent
815
+ ];
816
+ const EXPORTS = [
817
+ NggModalComponent,
818
+ ];
819
+ class NggModalModule {
820
+ }
821
+ NggModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
822
+ NggModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, declarations: [NggModalComponent,
823
+ NggModalHeaderComponent,
824
+ NggModalBodyComponent,
825
+ NggModalFooterComponent], imports: [A11yModule, CommonModule], exports: [NggModalComponent] });
826
+ NggModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, imports: [[A11yModule, CommonModule]] });
827
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, decorators: [{
828
+ type: NgModule,
829
+ args: [{
830
+ imports: [A11yModule, CommonModule],
831
+ exports: EXPORTS,
832
+ declarations: DECLARATIONS,
833
+ }]
834
+ }] });
835
+
836
+ class NggProgressCircleComponent {
837
+ constructor() {
838
+ this._startValue = '0deg';
839
+ this._endValue = '0deg';
840
+ /** id of the progress circle */
841
+ this.id = `progress-circle-${randomId()}`;
842
+ /** theme of the progress circle */
843
+ this.theme = 'warning';
844
+ }
845
+ /** progress circle value in percentage */
846
+ set value(percent) {
847
+ const degrees = this.calculateDegrees(percent);
848
+ this._endValue = `${degrees}deg`;
849
+ }
850
+ calculateDegrees(percent) {
851
+ if (percent > 100) {
852
+ return 180;
853
+ }
854
+ if (percent < 0) {
855
+ return 0;
856
+ }
857
+ /** formula: ((n% * 360deg) / 100% ) / 2 */
858
+ return percent * 1.8;
859
+ }
860
+ }
861
+ NggProgressCircleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggProgressCircleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
862
+ NggProgressCircleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggProgressCircleComponent, selector: "ngg-progress-circle", inputs: { id: "id", theme: "theme", value: "value" }, host: { properties: { "style.--start-value": "this._startValue", "style.--end-value": "this._endValue" } }, ngImport: i0, template: "<div\n class=\"outer-circle\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"value\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-label]=\"id\"\n>\n <div class=\"ring full-ring\">\n <div class=\"ring-progress\" [ngClass]=\"theme\"></div>\n </div>\n <div class=\"ring\">\n <div class=\"ring-progress\" [ngClass]=\"theme\"></div>\n </div>\n <div class=\"inner-circle\">\n <ng-content></ng-content>\n </div>\n</div>\n", directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggProgressCircleComponent, decorators: [{
864
+ type: Component,
865
+ args: [{ selector: 'ngg-progress-circle', template: "<div\n class=\"outer-circle\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"value\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-label]=\"id\"\n>\n <div class=\"ring full-ring\">\n <div class=\"ring-progress\" [ngClass]=\"theme\"></div>\n </div>\n <div class=\"ring\">\n <div class=\"ring-progress\" [ngClass]=\"theme\"></div>\n </div>\n <div class=\"inner-circle\">\n <ng-content></ng-content>\n </div>\n</div>\n" }]
866
+ }], propDecorators: { _startValue: [{
867
+ type: HostBinding,
868
+ args: ['style.--start-value']
869
+ }], _endValue: [{
870
+ type: HostBinding,
871
+ args: ['style.--end-value']
872
+ }], id: [{
873
+ type: Input
874
+ }], theme: [{
875
+ type: Input
876
+ }], value: [{
877
+ type: Input
878
+ }] } });
879
+
880
+ class NggProgressCircleModule {
881
+ }
882
+ NggProgressCircleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggProgressCircleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
883
+ NggProgressCircleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggProgressCircleModule, declarations: [NggProgressCircleComponent], imports: [CommonModule], exports: [NggProgressCircleComponent] });
884
+ NggProgressCircleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggProgressCircleModule, imports: [[CommonModule]] });
885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggProgressCircleModule, decorators: [{
886
+ type: NgModule,
887
+ args: [{
888
+ declarations: [NggProgressCircleComponent],
889
+ imports: [CommonModule],
890
+ exports: [NggProgressCircleComponent],
891
+ }]
892
+ }] });
893
+
894
+ class NggSegmentedControlComponent {
895
+ }
896
+ NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
897
+ NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
898
+ <div class="group">
899
+ <a
900
+ *ngFor="let control of $controls | async"
901
+ [routerLink]="control.url"
902
+ routerLinkActive="active"
903
+ class="button"
904
+ >{{ control.text }}</a
905
+ >
906
+ </div>
907
+ `, isInline: true, directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], pipes: { "async": i2.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
909
+ type: Component,
910
+ args: [{
911
+ selector: 'ngg-segmented-control',
912
+ template: `
913
+ <div class="group">
914
+ <a
915
+ *ngFor="let control of $controls | async"
916
+ [routerLink]="control.url"
917
+ routerLinkActive="active"
918
+ class="button"
919
+ >{{ control.text }}</a
920
+ >
921
+ </div>
922
+ `,
923
+ styles: [],
924
+ changeDetection: ChangeDetectionStrategy.OnPush,
925
+ }]
926
+ }], propDecorators: { $controls: [{
927
+ type: Input
928
+ }] } });
929
+
930
+ class NggSegmentedControlModule {
931
+ }
932
+ NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
933
+ NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
934
+ NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
935
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
936
+ type: NgModule,
937
+ args: [{
938
+ declarations: [NggSegmentedControlComponent],
939
+ imports: [RouterModule, CommonModule],
940
+ exports: [NggSegmentedControlComponent],
941
+ }]
942
+ }] });
943
+
944
+ class NggButtonComponent {
945
+ get classes() {
946
+ return [this.variant, this.size ? this.size : false].filter(Boolean).join(" ");
947
+ }
948
+ }
949
+ NggButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
950
+ NggButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggButtonComponent, selector: "[ngg-button]", inputs: { variant: "variant", size: "size" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggButtonComponent, decorators: [{
952
+ type: Component,
953
+ args: [{
954
+ // eslint-disable-next-line @angular-eslint/component-selector
955
+ selector: '[ngg-button]',
956
+ template: `<ng-content></ng-content>`,
957
+ changeDetection: ChangeDetectionStrategy.OnPush
958
+ }]
959
+ }], propDecorators: { variant: [{
960
+ type: Input
961
+ }], size: [{
962
+ type: Input
963
+ }], classes: [{
964
+ type: HostBinding,
965
+ args: ['class']
966
+ }] } });
967
+
968
+ class NggButtonModule {
969
+ }
970
+ NggButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
971
+ NggButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggButtonModule, declarations: [NggButtonComponent], imports: [CommonModule], exports: [NggButtonComponent] });
972
+ NggButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggButtonModule, imports: [[CommonModule]] });
973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggButtonModule, decorators: [{
974
+ type: NgModule,
975
+ args: [{
976
+ declarations: [NggButtonComponent],
977
+ imports: [CommonModule],
978
+ exports: [NggButtonComponent],
331
979
  }]
332
980
  }] });
333
981
 
334
982
  class NggModule {
335
983
  }
336
- NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
337
- NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule] });
338
- NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule] });
339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, decorators: [{
984
+ NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
985
+ NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggAccordionModule,
986
+ NggBadgeModule,
987
+ NggButtonModule,
988
+ NggDatepickerModule,
989
+ NggDropdownModule,
990
+ NggModalModule,
991
+ NggProgressCircleModule,
992
+ NggSegmentedControlModule] });
993
+ NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, imports: [[CommonModule], NggAccordionModule,
994
+ NggBadgeModule,
995
+ NggButtonModule,
996
+ NggDatepickerModule,
997
+ NggDropdownModule,
998
+ NggModalModule,
999
+ NggProgressCircleModule,
1000
+ NggSegmentedControlModule] });
1001
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, decorators: [{
340
1002
  type: NgModule,
341
1003
  args: [{
342
1004
  declarations: [],
343
1005
  imports: [CommonModule],
344
- exports: [NggSegmentedControlModule, NggDropdownModule],
1006
+ exports: [
1007
+ NggAccordionModule,
1008
+ NggBadgeModule,
1009
+ NggButtonModule,
1010
+ NggDatepickerModule,
1011
+ NggDropdownModule,
1012
+ NggModalModule,
1013
+ NggProgressCircleModule,
1014
+ NggSegmentedControlModule,
1015
+ ],
345
1016
  }]
346
1017
  }] });
347
1018
 
@@ -349,5 +1020,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
349
1020
  * Generated bundle index. Do not edit.
350
1021
  */
351
1022
 
352
- export { NggDropdownComponent, NggDropdownModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule };
1023
+ export { NggAccordionComponent, NggAccordionListItemComponent, NggAccordionModule, NggBadgeComponent, NggBadgeModule, NggButtonComponent, NggButtonModule, NggDatepickerComponent, NggDatepickerModule, NggDropdownComponent, NggDropdownModule, NggDropdownOptionDirective, NggModalBodyComponent, NggModalComponent, NggModalFooterComponent, NggModalHeaderComponent, NggModalModule, NggModule, NggProgressCircleComponent, NggProgressCircleModule, NggSegmentedControlComponent, NggSegmentedControlModule, dateValidator };
353
1024
  //# sourceMappingURL=sebgroup-green-angular.mjs.map