@sebgroup/green-angular 1.0.0-beta.4 → 1.0.0-beta.40

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 (31) hide show
  1. package/esm2020/index.mjs +7 -1
  2. package/esm2020/lib/badge/badge.component.mjs +80 -0
  3. package/esm2020/lib/badge/badge.module.mjs +18 -0
  4. package/esm2020/lib/datepicker/datepicker.component.mjs +186 -0
  5. package/esm2020/lib/datepicker/datepicker.module.mjs +19 -0
  6. package/esm2020/lib/dropdown/dropdown-option.directive.mjs +16 -0
  7. package/esm2020/lib/dropdown/dropdown.component.mjs +117 -133
  8. package/esm2020/lib/dropdown/dropdown.module.mjs +8 -7
  9. package/esm2020/lib/green-angular.module.mjs +7 -6
  10. package/esm2020/lib/modal/index.mjs +3 -0
  11. package/esm2020/lib/modal/modal.component.mjs +152 -0
  12. package/esm2020/lib/modal/modal.module.mjs +30 -0
  13. package/esm2020/lib/segmented-control/segmented-control.component.mjs +3 -3
  14. package/esm2020/lib/segmented-control/segmented-control.module.mjs +4 -4
  15. package/fesm2015/sebgroup-green-angular.mjs +619 -152
  16. package/fesm2015/sebgroup-green-angular.mjs.map +1 -1
  17. package/fesm2020/sebgroup-green-angular.mjs +608 -151
  18. package/fesm2020/sebgroup-green-angular.mjs.map +1 -1
  19. package/index.d.ts +6 -0
  20. package/lib/badge/badge.component.d.ts +25 -0
  21. package/lib/badge/badge.module.d.ts +8 -0
  22. package/lib/datepicker/datepicker.component.d.ts +49 -0
  23. package/lib/datepicker/datepicker.module.d.ts +9 -0
  24. package/lib/dropdown/dropdown-option.directive.d.ts +8 -0
  25. package/lib/dropdown/dropdown.component.d.ts +42 -18
  26. package/lib/dropdown/dropdown.module.d.ts +3 -2
  27. package/lib/green-angular.module.d.ts +2 -1
  28. package/lib/modal/index.d.ts +2 -0
  29. package/lib/modal/modal.component.d.ts +50 -0
  30. package/lib/modal/modal.module.d.ts +8 -0
  31. package/package.json +10 -10
@@ -1,16 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, NgModule, ViewChild } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, NgModule, Directive, EventEmitter, Injector, Inject, Output, ViewChild, ContentChild, HostBinding } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/router';
6
6
  import { RouterModule } from '@angular/router';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { createDropdown } from '@sebgroup/extract';
7
+ import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
8
+ import { dropdownValues, createDropdown, randomId, months, years, createDatepicker } from '@sebgroup/extract';
9
+ import { startOfDay, endOfDay } from 'date-fns';
10
+ import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock';
9
11
 
10
12
  class NggSegmentedControlComponent {
11
13
  }
12
- NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
- NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
14
+ NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
15
+ NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
14
16
  <div class="group">
15
17
  <a
16
18
  *ngFor="let control of $controls | async"
@@ -21,7 +23,7 @@ NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
21
23
  >
22
24
  </div>
23
25
  `, 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.1.2", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
25
27
  type: Component,
26
28
  args: [{
27
29
  selector: 'ngg-segmented-control',
@@ -45,10 +47,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
45
47
 
46
48
  class NggSegmentedControlModule {
47
49
  }
48
- NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
49
- NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
50
- NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
50
+ NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
51
+ NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
52
+ NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
52
54
  type: NgModule,
53
55
  args: [{
54
56
  declarations: [NggSegmentedControlComponent],
@@ -57,39 +59,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
57
59
  }]
58
60
  }] });
59
61
 
62
+ class NggDropdownOptionDirective {
63
+ constructor(templateRef) {
64
+ this.templateRef = templateRef;
65
+ }
66
+ }
67
+ NggDropdownOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownOptionDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
68
+ NggDropdownOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.3", type: NggDropdownOptionDirective, selector: "[nggDropdownOption]", ngImport: i0 });
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownOptionDirective, decorators: [{
70
+ type: Directive,
71
+ args: [{
72
+ selector: '[nggDropdownOption]',
73
+ }]
74
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
75
+
60
76
  class NggDropdownComponent {
61
- constructor(cd) {
77
+ constructor(cd, injector) {
78
+ var _a, _b, _c;
62
79
  this.cd = cd;
80
+ this.injector = injector;
81
+ this.loop = false;
63
82
  this.options = [];
64
- this.value = undefined;
83
+ this._multiSelect = false;
84
+ this._searchable = false;
85
+ this.valueChange = new EventEmitter();
86
+ this.touched = new EventEmitter();
87
+ this.toggler = (_a = dropdownValues.elements) === null || _a === void 0 ? void 0 : _a.toggler;
88
+ this.listbox = (_b = dropdownValues.elements) === null || _b === void 0 ? void 0 : _b.listbox;
89
+ this.fieldset = (_c = dropdownValues.elements) === null || _c === void 0 ? void 0 : _c.fieldset;
65
90
  this.trackByKey = (index, option) => {
66
- return option.key;
91
+ var _a;
92
+ return (_a = option.attributes.id) !== null && _a !== void 0 ? _a : '';
67
93
  };
68
94
  }
95
+ set multiSelect(value) {
96
+ this._multiSelect = this.convertToBoolean(value);
97
+ }
98
+ get multiSelect() {
99
+ return this._multiSelect;
100
+ }
101
+ set searchable(value) {
102
+ this._searchable = this.convertToBoolean(value);
103
+ }
104
+ get searchable() {
105
+ return this._searchable;
106
+ }
107
+ set value(newValue) {
108
+ var _a;
109
+ (_a = this.handler) === null || _a === void 0 ? void 0 : _a.selectByValue(newValue);
110
+ this._value = newValue;
111
+ }
112
+ get value() {
113
+ return this._value;
114
+ }
115
+ get control() {
116
+ return this.injector.get(NgControl);
117
+ }
69
118
  ngAfterViewInit() {
70
- var _a, _b;
119
+ var _a, _b, _c;
71
120
  if (((_a = this.togglerRef) === null || _a === void 0 ? void 0 : _a.nativeElement) && ((_b = this.listboxRef) === null || _b === void 0 ? void 0 : _b.nativeElement)) {
72
- this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (dropdown) => {
121
+ this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (_c = this.fieldsetRef) === null || _c === void 0 ? void 0 : _c.nativeElement, (dropdown) => {
73
122
  this.dropdown = dropdown;
74
123
  this.toggler = dropdown.elements.toggler;
75
124
  this.listbox = dropdown.elements.listbox;
125
+ this.fieldset = dropdown.elements.fieldset;
76
126
  this.cd.detectChanges();
127
+ }, (value) => {
128
+ this.updateValue(value);
77
129
  });
78
- this.selectFromValue(this.value);
79
130
  }
80
131
  }
81
132
  ngOnDestroy() {
82
133
  var _a;
83
134
  (_a = this.handler) === null || _a === void 0 ? void 0 : _a.destroy();
84
135
  }
85
- ngOnChanges() {
86
- if (this.handler && this.dropdown) {
136
+ ngOnChanges(changes) {
137
+ if (this.handler &&
138
+ (changes.id || changes.text || changes.loop || changes.options)) {
87
139
  this.handler.update(this.props);
88
140
  }
89
141
  }
90
- writeValue(obj) {
91
- this.value = obj;
92
- this.selectFromValue(this.value);
142
+ writeValue(value) {
143
+ var _a, _b, _c, _d;
144
+ this.value = value;
145
+ if (value === null &&
146
+ ((_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.isTouched) &&
147
+ ((_c = (_b = this.control) === null || _b === void 0 ? void 0 : _b.control) === null || _c === void 0 ? void 0 : _c.untouched)) {
148
+ (_d = this.handler) === null || _d === void 0 ? void 0 : _d.resetTouchedState();
149
+ this.cd.detectChanges();
150
+ }
93
151
  }
94
152
  registerOnChange(fn) {
95
153
  this.onChangeFn = fn;
@@ -97,186 +155,595 @@ class NggDropdownComponent {
97
155
  registerOnTouched(fn) {
98
156
  this.onTouchedFn = fn;
99
157
  }
100
- select(option) {
158
+ search($event) {
101
159
  var _a;
102
- (_a = this.handler) === null || _a === void 0 ? void 0 : _a.select(option);
103
- this.onChangeFn && this.onChangeFn(option.value);
104
- this.onTouchedFn && this.onTouchedFn();
160
+ (_a = this.handler) === null || _a === void 0 ? void 0 : _a.search($event.target.value);
105
161
  }
106
162
  get props() {
163
+ var _a;
107
164
  return {
108
- id: this.id,
109
- text: this.text,
165
+ id: this.id || ((_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.id),
166
+ texts: this.texts,
167
+ useValue: this.useValue,
168
+ display: this.display,
110
169
  options: this.options,
111
170
  loop: this.loop,
171
+ value: this.value,
172
+ multiSelect: this.multiSelect,
173
+ searchable: this.searchable,
174
+ searchFilter: this.searchFilter,
175
+ compareWith: this.compareWith,
176
+ onTouched: () => {
177
+ var _a;
178
+ (_a = this.onTouchedFn) === null || _a === void 0 ? void 0 : _a.call(this);
179
+ this.touched.emit(true);
180
+ this.cd.markForCheck();
181
+ },
112
182
  };
113
183
  }
114
- selectFromValue(value) {
184
+ updateValue(option) {
115
185
  var _a;
116
- if (this.handler && value !== undefined) {
117
- const option = this.handler.dropdown.options.find((option) => option.value === value);
118
- if (option)
119
- (_a = this.handler) === null || _a === void 0 ? void 0 : _a.select(option);
120
- }
186
+ this._value = option;
187
+ this.valueChange.emit(option);
188
+ (_a = this.onChangeFn) === null || _a === void 0 ? void 0 : _a.call(this, option);
189
+ }
190
+ convertToBoolean(value) {
191
+ return (value === '' || value === 'true' || value.toString() === 'true' || false);
121
192
  }
122
193
  }
123
- NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
124
- NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", text: "text", loop: "loop", options: "options" }, providers: [
194
+ 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 });
195
+ 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: [
125
196
  {
126
197
  provide: NG_VALUE_ACCESSOR,
127
198
  useExisting: NggDropdownComponent,
128
199
  multi: true,
129
200
  },
130
- ], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
131
- <div>
132
- <button
133
- #togglerRef
134
- [id]="toggler?.attributes?.id"
135
- [attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
136
- [attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
137
- [attr.aria-owns]="toggler?.attributes?.['aria-owns']"
138
- [tabindex]="toggler?.attributes?.tabIndex"
139
- [style]="toggler?.attributes?.style"
140
- [class]="toggler?.classes"
141
- (click)="handler?.toggle()"
142
- >
143
- {{ dropdown?.text }}
144
- </button>
145
- <div
146
- #listboxRef
147
- [id]="listbox?.attributes?.id"
148
- [attr.role]="listbox?.attributes?.role"
149
- [attr.aria-activedescendant]="
150
- listbox?.attributes?.['aria-activedescendant']
151
- "
152
- [tabindex]="listbox?.attributes?.tabIndex"
153
- [style]="listbox?.attributes?.style"
154
- [class]="listbox?.classes"
155
- >
156
- <button
157
- class="close m-4 m-sm-2 d-block d-sm-none"
158
- (click)="handler?.close()"
159
- >
160
- <span class="sr-only">Close</span>
161
- </button>
162
- <ul role="listbox">
163
- <li
164
- *ngFor="let option of dropdown?.options; trackBy: trackByKey"
165
- [id]="option.attributes.id"
166
- [attr.role]="option.attributes.role"
167
- [attr.aria-selected]="option.attributes['aria-selected']"
168
- [style]="option.attributes.style"
169
- [class]="option.classes"
170
- (click)="select(option)"
171
- >
172
- {{ option.key }}
173
- </li>
174
- </ul>
175
- </div>
176
- </div>
177
- `, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, decorators: [{
201
+ ], 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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownComponent, decorators: [{
179
203
  type: Component,
180
- args: [{
181
- selector: 'ngg-dropdown',
182
- template: `
183
- <div>
184
- <button
185
- #togglerRef
186
- [id]="toggler?.attributes?.id"
187
- [attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
188
- [attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
189
- [attr.aria-owns]="toggler?.attributes?.['aria-owns']"
190
- [tabindex]="toggler?.attributes?.tabIndex"
191
- [style]="toggler?.attributes?.style"
192
- [class]="toggler?.classes"
193
- (click)="handler?.toggle()"
194
- >
195
- {{ dropdown?.text }}
196
- </button>
197
- <div
198
- #listboxRef
199
- [id]="listbox?.attributes?.id"
200
- [attr.role]="listbox?.attributes?.role"
201
- [attr.aria-activedescendant]="
202
- listbox?.attributes?.['aria-activedescendant']
203
- "
204
- [tabindex]="listbox?.attributes?.tabIndex"
205
- [style]="listbox?.attributes?.style"
206
- [class]="listbox?.classes"
207
- >
208
- <button
209
- class="close m-4 m-sm-2 d-block d-sm-none"
210
- (click)="handler?.close()"
211
- >
212
- <span class="sr-only">Close</span>
213
- </button>
214
- <ul role="listbox">
215
- <li
216
- *ngFor="let option of dropdown?.options; trackBy: trackByKey"
217
- [id]="option.attributes.id"
218
- [attr.role]="option.attributes.role"
219
- [attr.aria-selected]="option.attributes['aria-selected']"
220
- [style]="option.attributes.style"
221
- [class]="option.classes"
222
- (click)="select(option)"
223
- >
224
- {{ option.key }}
225
- </li>
226
- </ul>
227
- </div>
228
- </div>
229
- `,
230
- providers: [
204
+ args: [{ selector: 'ngg-dropdown', providers: [
231
205
  {
232
206
  provide: NG_VALUE_ACCESSOR,
233
207
  useExisting: NggDropdownComponent,
234
208
  multi: true,
235
209
  },
236
- ],
237
- changeDetection: ChangeDetectionStrategy.OnPush,
238
- }]
239
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
210
+ ], 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" }]
211
+ }], ctorParameters: function () {
212
+ return [{ type: i0.ChangeDetectorRef }, { type: i0.Injector, decorators: [{
213
+ type: Inject,
214
+ args: [Injector]
215
+ }] }];
216
+ }, propDecorators: { id: [{
240
217
  type: Input
241
- }], text: [{
218
+ }], texts: [{
242
219
  type: Input
243
220
  }], loop: [{
244
221
  type: Input
222
+ }], display: [{
223
+ type: Input
224
+ }], useValue: [{
225
+ type: Input
226
+ }], label: [{
227
+ type: Input
245
228
  }], options: [{
246
229
  type: Input
230
+ }], valid: [{
231
+ type: Input
232
+ }], invalid: [{
233
+ type: Input
234
+ }], compareWith: [{
235
+ type: Input
236
+ }], searchFilter: [{
237
+ type: Input
238
+ }], multiSelect: [{
239
+ type: Input
240
+ }], searchable: [{
241
+ type: Input
242
+ }], value: [{
243
+ type: Input
244
+ }], valueChange: [{
245
+ type: Output
246
+ }], touched: [{
247
+ type: Output
247
248
  }], togglerRef: [{
248
249
  type: ViewChild,
249
250
  args: ['togglerRef']
250
251
  }], listboxRef: [{
251
252
  type: ViewChild,
252
253
  args: ['listboxRef']
254
+ }], fieldsetRef: [{
255
+ type: ViewChild,
256
+ args: ['fieldsetRef']
257
+ }], customOption: [{
258
+ type: ContentChild,
259
+ args: [NggDropdownOptionDirective]
253
260
  }] } });
254
261
 
255
262
  class NggDropdownModule {
256
263
  }
257
- NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
258
- NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
259
- NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, decorators: [{
264
+ NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
265
+ NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent, NggDropdownOptionDirective], imports: [CommonModule], exports: [NggDropdownComponent, NggDropdownOptionDirective] });
266
+ NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, decorators: [{
261
268
  type: NgModule,
262
269
  args: [{
263
- declarations: [NggDropdownComponent],
270
+ declarations: [NggDropdownComponent, NggDropdownOptionDirective],
264
271
  imports: [CommonModule],
265
- exports: [NggDropdownComponent],
272
+ exports: [NggDropdownComponent, NggDropdownOptionDirective],
273
+ }]
274
+ }] });
275
+
276
+ class NggDatepickerComponent {
277
+ constructor(_cdr) {
278
+ this._cdr = _cdr;
279
+ this.id = randomId();
280
+ this.isValid = null;
281
+ this.valueChange = new EventEmitter();
282
+ this._months = months({});
283
+ this.listener = (data, state) => {
284
+ var _a, _b, _c, _d, _e;
285
+ if (this.dp && state) {
286
+ this.dp.state = Object.assign({}, state);
287
+ this.years = years({
288
+ from: (_b = (_a = this.dp.state) === null || _a === void 0 ? void 0 : _a.minDate) === null || _b === void 0 ? void 0 : _b.getFullYear(),
289
+ to: (_d = (_c = this.dp.state) === null || _c === void 0 ? void 0 : _c.maxDate) === null || _d === void 0 ? void 0 : _d.getFullYear(),
290
+ });
291
+ }
292
+ this.onTouchedFn && this.onTouchedFn();
293
+ if (data) {
294
+ // only emit change event if date has changed
295
+ if (((_e = this.data) === null || _e === void 0 ? void 0 : _e.selectedDate) !== data.selectedDate) {
296
+ this.valueChange.emit(data.selectedDate);
297
+ this.onChangeFn && this.onChangeFn(data.selectedDate);
298
+ }
299
+ this.data = data;
300
+ }
301
+ if (data || state) {
302
+ this._cdr.markForCheck();
303
+ }
304
+ };
305
+ }
306
+ get months() {
307
+ return this._months;
308
+ }
309
+ set months(value) {
310
+ this._months = value;
311
+ }
312
+ get options() {
313
+ return this._options;
314
+ }
315
+ set options(value) {
316
+ var _a;
317
+ this._options = value;
318
+ if (value.locale) {
319
+ this.months = months({ locale: (_a = this.options) === null || _a === void 0 ? void 0 : _a.locale });
320
+ }
321
+ }
322
+ get value() {
323
+ return this._value;
324
+ }
325
+ set value(newValue) {
326
+ if (newValue !== this._value) {
327
+ this._value = newValue;
328
+ }
329
+ }
330
+ writeValue(value) {
331
+ var _a;
332
+ this.value = value;
333
+ // When binding using ngModel we need to set initial select date
334
+ // once we get initial value as it's not available when component is created
335
+ if (value && this.dp && !((_a = this.data) === null || _a === void 0 ? void 0 : _a.selectedDate)) {
336
+ this.dp.select(value);
337
+ }
338
+ }
339
+ registerOnChange(fn) {
340
+ this.onChangeFn = fn;
341
+ }
342
+ registerOnTouched(fn) {
343
+ this.onTouchedFn = fn;
344
+ }
345
+ get data() {
346
+ return this._data;
347
+ }
348
+ set data(value) {
349
+ this._data = value;
350
+ }
351
+ onDateChange(value) {
352
+ var _a;
353
+ const newDate = new Date(value);
354
+ // Only pass valid date to date picker
355
+ if (!isNaN(newDate.getTime())) {
356
+ (_a = this.dp) === null || _a === void 0 ? void 0 : _a.select(value);
357
+ }
358
+ else {
359
+ this.valueChange.emit(value);
360
+ this.onChangeFn && this.onChangeFn(value);
361
+ }
362
+ }
363
+ trackWeek(index, week) {
364
+ return week;
365
+ }
366
+ ngAfterViewInit() {
367
+ // initialize datepicker
368
+ if (this.datepickerElRef &&
369
+ this.datepickerDialogElRef &&
370
+ this.dateInputElRef &&
371
+ this.datepickerTriggerElRef &&
372
+ !this.dp) {
373
+ 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);
374
+ this._cdr.detectChanges();
375
+ }
376
+ else {
377
+ throw 'Missing one or more elements...';
378
+ }
379
+ }
380
+ }
381
+ NggDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
382
+ 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: [
383
+ {
384
+ provide: NG_VALUE_ACCESSOR,
385
+ useExisting: NggDatepickerComponent,
386
+ multi: true,
387
+ },
388
+ ], 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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerComponent, decorators: [{
390
+ type: Component,
391
+ args: [{ selector: 'ngg-datepicker', providers: [
392
+ {
393
+ provide: NG_VALUE_ACCESSOR,
394
+ useExisting: NggDatepickerComponent,
395
+ multi: true,
396
+ },
397
+ ], 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" }]
398
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { options: [{
399
+ type: Input
400
+ }], value: [{
401
+ type: Input
402
+ }], id: [{
403
+ type: Input
404
+ }], label: [{
405
+ type: Input
406
+ }], isValid: [{
407
+ type: Input
408
+ }], valueChange: [{
409
+ type: Output
410
+ }], datepickerDialogElRef: [{
411
+ type: ViewChild,
412
+ args: ['datepickerDialogElRef']
413
+ }], dateInputElRef: [{
414
+ type: ViewChild,
415
+ args: ['dateInputElRef']
416
+ }], datepickerElRef: [{
417
+ type: ViewChild,
418
+ args: ['datepickerElRef']
419
+ }], datepickerTriggerElRef: [{
420
+ type: ViewChild,
421
+ args: ['datepickerTriggerElRef']
422
+ }] } });
423
+ function dateValidator(dates) {
424
+ return (control) => {
425
+ const value = control.value;
426
+ if (!value) {
427
+ return null;
428
+ }
429
+ const newDate = new Date(value);
430
+ const isValidDate = !isNaN(newDate.getTime());
431
+ if (!isValidDate) {
432
+ return { validDate: true };
433
+ }
434
+ const validMinDate = (dates === null || dates === void 0 ? void 0 : dates.min) ? newDate >= startOfDay(dates.min) : true;
435
+ const validMaxDate = (dates === null || dates === void 0 ? void 0 : dates.max) ? newDate <= endOfDay(dates.max) : true;
436
+ if (!validMinDate && (dates === null || dates === void 0 ? void 0 : dates.min)) {
437
+ return {
438
+ validDate: {
439
+ minDate: startOfDay(dates.min),
440
+ actualDate: newDate,
441
+ },
442
+ };
443
+ }
444
+ if (!validMaxDate && (dates === null || dates === void 0 ? void 0 : dates.max)) {
445
+ return {
446
+ validDate: {
447
+ maxDate: endOfDay(dates.max),
448
+ actualDate: newDate,
449
+ },
450
+ };
451
+ }
452
+ return null;
453
+ };
454
+ }
455
+
456
+ class NggDatepickerModule {
457
+ }
458
+ NggDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
459
+ NggDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, declarations: [NggDatepickerComponent], imports: [CommonModule, NggDropdownModule], exports: [NggDatepickerComponent] });
460
+ NggDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, imports: [[CommonModule, NggDropdownModule]] });
461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerModule, decorators: [{
462
+ type: NgModule,
463
+ args: [{
464
+ declarations: [NggDatepickerComponent],
465
+ imports: [CommonModule, NggDropdownModule],
466
+ exports: [NggDatepickerComponent],
266
467
  }]
267
468
  }] });
268
469
 
269
470
  class NggModule {
270
471
  }
271
- NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
272
- NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule] });
273
- NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule] });
274
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, decorators: [{
472
+ NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
473
+ NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule] });
474
+ NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule] });
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModule, decorators: [{
275
476
  type: NgModule,
276
477
  args: [{
277
478
  declarations: [],
278
479
  imports: [CommonModule],
279
- exports: [NggSegmentedControlModule, NggDropdownModule],
480
+ exports: [NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule],
481
+ }]
482
+ }] });
483
+
484
+ class NggModalComponent {
485
+ constructor(ref) {
486
+ this.ref = ref;
487
+ this.isOpenChange = new EventEmitter();
488
+ this.closed = new EventEmitter();
489
+ this.confirm = new EventEmitter();
490
+ this.dismiss = new EventEmitter();
491
+ }
492
+ get isOpen() {
493
+ return this._isOpen;
494
+ }
495
+ set isOpen(value) {
496
+ this._isOpen = value;
497
+ if (value) {
498
+ disableBodyScroll(this.ref.nativeElement);
499
+ }
500
+ else {
501
+ enableBodyScroll(this.ref.nativeElement);
502
+ }
503
+ }
504
+ get open() { return this.isOpen; }
505
+ handleCloseClick(event) {
506
+ this.closeModal(event);
507
+ }
508
+ handleBackdropClick(event) {
509
+ var _a;
510
+ if (event.target == ((_a = this.backdropRef) === null || _a === void 0 ? void 0 : _a.nativeElement))
511
+ this.closeModal(event);
512
+ }
513
+ handleDismiss(event) {
514
+ this.dismiss.emit(event);
515
+ }
516
+ handleConfirm(event) {
517
+ this.confirm.emit(event);
518
+ }
519
+ closeModal(event) {
520
+ if (this.closed.observers.length > 0) {
521
+ this.closed.emit(event);
522
+ }
523
+ else {
524
+ this.isOpen = false;
525
+ this.isOpenChange.emit(this.isOpen);
526
+ }
527
+ }
528
+ ngOnDestroy() {
529
+ enableBodyScroll(this.ref.nativeElement);
530
+ }
531
+ }
532
+ NggModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
533
+ 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", 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 i1.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return i1.NgSwitch; }), selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i0.forwardRef(function () { return i1.NgSwitchCase; }), selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i0.forwardRef(function () { return i1.NgTemplateOutlet; }), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i0.forwardRef(function () { return i1.NgSwitchDefault; }), selector: "[ngSwitchDefault]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalComponent, decorators: [{
535
+ type: Component,
536
+ 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"] }]
537
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { modalType: [{
538
+ type: Input
539
+ }], header: [{
540
+ type: Input
541
+ }], confirmLabel: [{
542
+ type: Input
543
+ }], dismissLabel: [{
544
+ type: Input
545
+ }], size: [{
546
+ type: Input
547
+ }], isOpen: [{
548
+ type: Input
549
+ }], isOpenChange: [{
550
+ type: Output
551
+ }], closed: [{
552
+ type: Output
553
+ }], confirm: [{
554
+ type: Output
555
+ }], dismiss: [{
556
+ type: Output
557
+ }], open: [{
558
+ type: HostBinding,
559
+ args: ['class.open']
560
+ }], backdropRef: [{
561
+ type: ViewChild,
562
+ args: ['backdrop']
563
+ }] } });
564
+ class NggModalHeaderComponent {
565
+ constructor() {
566
+ this.closed = new EventEmitter();
567
+ }
568
+ handleClose(event) {
569
+ this.closed.emit(event);
570
+ }
571
+ }
572
+ NggModalHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
573
+ 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: `
574
+ <h3 data-testid="modal-header-text">{{header}}</h3>
575
+ <button data-testid="modal-close-button" class="close" (click)="this.handleClose($event)">
576
+ <span className="sr-only">Close</span>
577
+ </button>
578
+ `, 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"] });
579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalHeaderComponent, decorators: [{
580
+ type: Component,
581
+ args: [{ selector: '[ngg-modal-header]', template: `
582
+ <h3 data-testid="modal-header-text">{{header}}</h3>
583
+ <button data-testid="modal-close-button" class="close" (click)="this.handleClose($event)">
584
+ <span className="sr-only">Close</span>
585
+ </button>
586
+ `, 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"] }]
587
+ }], propDecorators: { header: [{
588
+ type: Input
589
+ }], closed: [{
590
+ type: Output
591
+ }] } });
592
+ class NggModalBodyComponent {
593
+ }
594
+ NggModalBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
595
+ 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"] });
596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalBodyComponent, decorators: [{
597
+ type: Component,
598
+ 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"] }]
599
+ }] });
600
+ class NggModalFooterComponent {
601
+ constructor() {
602
+ this.dismiss = new EventEmitter();
603
+ this.confirm = new EventEmitter();
604
+ }
605
+ handleDismiss(event) {
606
+ this.dismiss.emit(event);
607
+ }
608
+ handleConfirm(event) {
609
+ this.confirm.emit(event);
610
+ }
611
+ }
612
+ NggModalFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
613
+ 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: `
614
+ <button data-testid="modal-dismiss-button" *ngIf="dismissLabel" class="secondary" (click)="this.handleDismiss($event)">{{dismissLabel}}</button>
615
+ <button data-testid="modal-confirm-button" *ngIf="confirmLabel" class="primary" (click)="this.handleConfirm($event)">{{confirmLabel}}</button>
616
+ `, 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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalFooterComponent, decorators: [{
618
+ type: Component,
619
+ args: [{ selector: '[ngg-modal-footer]', template: `
620
+ <button data-testid="modal-dismiss-button" *ngIf="dismissLabel" class="secondary" (click)="this.handleDismiss($event)">{{dismissLabel}}</button>
621
+ <button data-testid="modal-confirm-button" *ngIf="confirmLabel" class="primary" (click)="this.handleConfirm($event)">{{confirmLabel}}</button>
622
+ `, 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"] }]
623
+ }], propDecorators: { dismissLabel: [{
624
+ type: Input
625
+ }], confirmLabel: [{
626
+ type: Input
627
+ }], dismiss: [{
628
+ type: Output
629
+ }], confirm: [{
630
+ type: Output
631
+ }] } });
632
+
633
+ const DECLARATIONS = [
634
+ NggModalComponent,
635
+ NggModalHeaderComponent,
636
+ NggModalBodyComponent,
637
+ NggModalFooterComponent
638
+ ];
639
+ const EXPORTS = [
640
+ NggModalComponent,
641
+ ];
642
+ class NggModalModule {
643
+ }
644
+ NggModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
645
+ NggModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, declarations: [NggModalComponent,
646
+ NggModalHeaderComponent,
647
+ NggModalBodyComponent,
648
+ NggModalFooterComponent], imports: [CommonModule], exports: [NggModalComponent] });
649
+ NggModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, imports: [[CommonModule]] });
650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggModalModule, decorators: [{
651
+ type: NgModule,
652
+ args: [{
653
+ imports: [CommonModule],
654
+ exports: EXPORTS,
655
+ declarations: DECLARATIONS,
656
+ }]
657
+ }] });
658
+
659
+ class NggBadgeComponent {
660
+ //eslint-disable-next-line
661
+ constructor() {
662
+ /** The color of the component */
663
+ this.badgeType = '';
664
+ /** Callback when component is dismissed */
665
+ this.handleClose = new EventEmitter();
666
+ }
667
+ /** Flag whether the component can be dismissed */
668
+ set isCloseable(value) {
669
+ this._isCloseable = value;
670
+ }
671
+ get isCloseable() {
672
+ return this._isCloseable === '' || !!this._isCloseable;
673
+ }
674
+ get class() {
675
+ return ['badge', this.badgeType].join(' ');
676
+ }
677
+ ngOnInit() {
678
+ if (!!this.customColor || !!this.customBackgroundColor) {
679
+ this.badgeType = '';
680
+ }
681
+ }
682
+ close(e) {
683
+ this.handleClose.emit(e);
684
+ }
685
+ }
686
+ NggBadgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
687
+ 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: `
688
+ <strong>
689
+ <ng-content></ng-content>
690
+ </strong>
691
+ <button *ngIf="isCloseable" class="close" (click)="close($event)">
692
+ {{ closeText }}
693
+ <i></i>
694
+ </button>
695
+ `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeComponent, decorators: [{
697
+ type: Component,
698
+ args: [{
699
+ // we need to disable this warning since we don't want the badge component to create a new element
700
+ // eslint-disable-next-line @angular-eslint/component-selector
701
+ selector: '[ngg-badge]',
702
+ template: `
703
+ <strong>
704
+ <ng-content></ng-content>
705
+ </strong>
706
+ <button *ngIf="isCloseable" class="close" (click)="close($event)">
707
+ {{ closeText }}
708
+ <i></i>
709
+ </button>
710
+ `,
711
+ changeDetection: ChangeDetectionStrategy.OnPush,
712
+ }]
713
+ }], ctorParameters: function () { return []; }, propDecorators: { badgeType: [{
714
+ type: Input
715
+ }], isCloseable: [{
716
+ type: Input
717
+ }], closeText: [{
718
+ type: Input
719
+ }], customColor: [{
720
+ type: HostBinding,
721
+ args: ['style.color']
722
+ }, {
723
+ type: Input
724
+ }], customBackgroundColor: [{
725
+ type: HostBinding,
726
+ args: ['style.background-color']
727
+ }, {
728
+ type: Input
729
+ }], class: [{
730
+ type: HostBinding,
731
+ args: ['class']
732
+ }], handleClose: [{
733
+ type: Output
734
+ }] } });
735
+
736
+ class NggBadgeModule {
737
+ }
738
+ NggBadgeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
739
+ NggBadgeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, declarations: [NggBadgeComponent], imports: [CommonModule], exports: [NggBadgeComponent] });
740
+ NggBadgeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, imports: [[CommonModule]] });
741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeModule, decorators: [{
742
+ type: NgModule,
743
+ args: [{
744
+ declarations: [NggBadgeComponent],
745
+ imports: [CommonModule],
746
+ exports: [NggBadgeComponent],
280
747
  }]
281
748
  }] });
282
749
 
@@ -284,5 +751,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
284
751
  * Generated bundle index. Do not edit.
285
752
  */
286
753
 
287
- export { NggDropdownComponent, NggDropdownModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule };
754
+ export { NggBadgeComponent, NggBadgeModule, NggDatepickerComponent, NggDatepickerModule, NggDropdownComponent, NggDropdownModule, NggDropdownOptionDirective, NggModalBodyComponent, NggModalComponent, NggModalFooterComponent, NggModalHeaderComponent, NggModalModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule, dateValidator };
288
755
  //# sourceMappingURL=sebgroup-green-angular.mjs.map