@sebgroup/green-angular 0.0.1

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