@sebgroup/green-angular 1.0.0-beta.1 → 1.0.0-beta.10

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 (50) hide show
  1. package/esm2020/index.mjs +8 -0
  2. package/esm2020/lib/datepicker/datepicker.component.mjs +140 -0
  3. package/esm2020/lib/datepicker/datepicker.module.mjs +19 -0
  4. package/esm2020/lib/dropdown/dropdown.component.mjs +275 -0
  5. package/esm2020/lib/dropdown/dropdown.module.mjs +18 -0
  6. package/esm2020/lib/green-angular.module.mjs +20 -0
  7. package/esm2020/lib/segmented-control/segmented-control.component.mjs +40 -0
  8. package/esm2020/lib/segmented-control/segmented-control.module.mjs +19 -0
  9. package/esm2020/sebgroup-green-angular.mjs +5 -0
  10. package/fesm2015/sebgroup-green-angular.mjs +517 -0
  11. package/fesm2015/sebgroup-green-angular.mjs.map +1 -0
  12. package/fesm2020/sebgroup-green-angular.mjs +511 -0
  13. package/fesm2020/sebgroup-green-angular.mjs.map +1 -0
  14. package/index.d.ts +2 -4
  15. package/lib/datepicker/datepicker.component.d.ts +46 -0
  16. package/lib/datepicker/datepicker.module.d.ts +9 -0
  17. package/lib/dropdown/dropdown.component.d.ts +33 -13
  18. package/lib/dropdown/dropdown.module.d.ts +3 -7
  19. package/lib/green-angular.module.d.ts +2 -1
  20. package/package.json +29 -17
  21. package/bundles/sebgroup-green-angular.umd.js +0 -610
  22. package/bundles/sebgroup-green-angular.umd.js.map +0 -1
  23. package/esm2015/index.js +0 -10
  24. package/esm2015/index.js.map +0 -1
  25. package/esm2015/lib/dropdown/dropdown.component.js +0 -111
  26. package/esm2015/lib/dropdown/dropdown.component.js.map +0 -1
  27. package/esm2015/lib/dropdown/dropdown.module.js +0 -42
  28. package/esm2015/lib/dropdown/dropdown.module.js.map +0 -1
  29. package/esm2015/lib/dropdown/popover-element.directive.js +0 -220
  30. package/esm2015/lib/dropdown/popover-element.directive.js.map +0 -1
  31. package/esm2015/lib/dropdown/popover-option.directive.js +0 -59
  32. package/esm2015/lib/dropdown/popover-option.directive.js.map +0 -1
  33. package/esm2015/lib/dropdown/popover-trigger.directive.js +0 -80
  34. package/esm2015/lib/dropdown/popover-trigger.directive.js.map +0 -1
  35. package/esm2015/lib/dropdown/popover.directive.js +0 -46
  36. package/esm2015/lib/dropdown/popover.directive.js.map +0 -1
  37. package/esm2015/lib/green-angular.module.js +0 -19
  38. package/esm2015/lib/green-angular.module.js.map +0 -1
  39. package/esm2015/lib/segmented-control/segmented-control.component.js +0 -40
  40. package/esm2015/lib/segmented-control/segmented-control.component.js.map +0 -1
  41. package/esm2015/lib/segmented-control/segmented-control.module.js +0 -19
  42. package/esm2015/lib/segmented-control/segmented-control.module.js.map +0 -1
  43. package/esm2015/sebgroup-green-angular.js +0 -5
  44. package/esm2015/sebgroup-green-angular.js.map +0 -1
  45. package/fesm2015/sebgroup-green-angular.js +0 -602
  46. package/fesm2015/sebgroup-green-angular.js.map +0 -1
  47. package/lib/dropdown/popover-element.directive.d.ts +0 -36
  48. package/lib/dropdown/popover-option.directive.d.ts +0 -20
  49. package/lib/dropdown/popover-trigger.directive.d.ts +0 -19
  50. package/lib/dropdown/popover.directive.d.ts +0 -24
@@ -0,0 +1,511 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, NgModule, EventEmitter, Output, ViewChild } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i2 from '@angular/router';
6
+ import { RouterModule } from '@angular/router';
7
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
+ import { dropdownValues, createDropdown, randomId, months, years, createDatepicker } from '@sebgroup/extract';
9
+
10
+ class NggSegmentedControlComponent {
11
+ }
12
+ NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
14
+ <div class="group">
15
+ <a
16
+ *ngFor="let control of $controls | async"
17
+ [routerLink]="control.url"
18
+ routerLinkActive="active"
19
+ class="button"
20
+ >{{ control.text }}</a
21
+ >
22
+ </div>
23
+ `, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
25
+ type: Component,
26
+ args: [{
27
+ selector: 'ngg-segmented-control',
28
+ template: `
29
+ <div class="group">
30
+ <a
31
+ *ngFor="let control of $controls | async"
32
+ [routerLink]="control.url"
33
+ routerLinkActive="active"
34
+ class="button"
35
+ >{{ control.text }}</a
36
+ >
37
+ </div>
38
+ `,
39
+ styles: [],
40
+ changeDetection: ChangeDetectionStrategy.OnPush,
41
+ }]
42
+ }], propDecorators: { $controls: [{
43
+ type: Input
44
+ }] } });
45
+
46
+ class NggSegmentedControlModule {
47
+ }
48
+ NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
49
+ NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
50
+ NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
52
+ type: NgModule,
53
+ args: [{
54
+ declarations: [NggSegmentedControlComponent],
55
+ imports: [RouterModule, CommonModule],
56
+ exports: [NggSegmentedControlComponent],
57
+ }]
58
+ }] });
59
+
60
+ class NggDropdownComponent {
61
+ constructor(cd) {
62
+ this.cd = cd;
63
+ this.loop = false;
64
+ this.options = [];
65
+ this.valueChange = new EventEmitter();
66
+ this.toggler = dropdownValues.elements?.toggler;
67
+ this.listbox = dropdownValues.elements?.listbox;
68
+ this.trackByKey = (index, option) => {
69
+ return option.key;
70
+ };
71
+ }
72
+ get value() {
73
+ return this._value;
74
+ }
75
+ set value(newValue) {
76
+ this.setSelectionByValue(newValue);
77
+ }
78
+ ngAfterViewInit() {
79
+ if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {
80
+ this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (dropdown) => {
81
+ this.dropdown = dropdown;
82
+ this.toggler = dropdown.elements.toggler;
83
+ this.listbox = dropdown.elements.listbox;
84
+ const selected = this.dropdown.options?.find((option) => option.selected);
85
+ if (selected && this._value !== selected?.value) {
86
+ setTimeout(() => {
87
+ this._value = selected.value;
88
+ this.valueChange.emit(selected.value);
89
+ this.onChangeFn && this.onChangeFn(selected.value);
90
+ this.onTouchedFn && this.onTouchedFn();
91
+ }, 0);
92
+ }
93
+ this.cd.detectChanges();
94
+ });
95
+ }
96
+ }
97
+ ngOnDestroy() {
98
+ this.handler?.destroy();
99
+ }
100
+ ngOnChanges(changes) {
101
+ if (this.handler &&
102
+ (changes.id || changes.text || changes.loop || changes.options)) {
103
+ this.handler.update(this.props);
104
+ }
105
+ }
106
+ writeValue(value) {
107
+ this.value = value;
108
+ }
109
+ registerOnChange(fn) {
110
+ this.onChangeFn = fn;
111
+ }
112
+ registerOnTouched(fn) {
113
+ this.onTouchedFn = fn;
114
+ }
115
+ select(option) {
116
+ this.handler?.select(option);
117
+ this._value = option.value;
118
+ this.valueChange.emit(option.value);
119
+ this.onChangeFn && this.onChangeFn(option.value);
120
+ this.onTouchedFn && this.onTouchedFn();
121
+ }
122
+ get props() {
123
+ return {
124
+ id: this.id || this.dropdown?.id,
125
+ text: this.text,
126
+ options: this.options,
127
+ loop: this.loop,
128
+ value: this.value,
129
+ };
130
+ }
131
+ setSelectionByValue(value) {
132
+ if (this._value !== value) {
133
+ this._value = value;
134
+ const selected = this.handler?.dropdown?.options.find((option) => option.value === value);
135
+ if (selected)
136
+ this.handler?.select(selected);
137
+ }
138
+ }
139
+ }
140
+ NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
141
+ NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", text: "text", loop: "loop", label: "label", options: "options", valid: "valid", invalid: "invalid", value: "value" }, outputs: { valueChange: "valueChange" }, providers: [
142
+ {
143
+ provide: NG_VALUE_ACCESSOR,
144
+ useExisting: NggDropdownComponent,
145
+ multi: true,
146
+ },
147
+ ], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
148
+ <div>
149
+ <span
150
+ class="label"
151
+ *ngIf="label"
152
+ [id]="toggler?.attributes?.id + '_label'"
153
+ >{{ label }}</span
154
+ >
155
+ <button
156
+ [attr.aria-labelledby]="
157
+ label ? toggler?.attributes?.id + '_label' : null
158
+ "
159
+ [attr.aria-describedby]="
160
+ formInfo?.innerText && formInfo.innerText.length > 0
161
+ ? toggler?.attributes?.id + '_info'
162
+ : null
163
+ "
164
+ type="button"
165
+ #togglerRef
166
+ [id]="toggler?.attributes?.id"
167
+ [attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
168
+ [attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
169
+ [attr.aria-owns]="toggler?.attributes?.['aria-owns']"
170
+ [tabindex]="toggler?.attributes?.tabIndex"
171
+ [style]="toggler?.attributes?.style"
172
+ [class]="toggler?.classes"
173
+ (click)="handler?.toggle()"
174
+ [class.is-valid]="valid"
175
+ [class.is-invalid]="invalid"
176
+ >
177
+ <span>{{ dropdown?.text }}</span>
178
+ </button>
179
+ <span
180
+ class="form-info"
181
+ #formInfo
182
+ [attr.id]="toggler?.attributes?.id + '_info'"
183
+ ><ng-content select="[data-form-info]"></ng-content
184
+ ></span>
185
+ <div
186
+ #listboxRef
187
+ [id]="listbox?.attributes?.id"
188
+ [attr.role]="listbox?.attributes?.role"
189
+ [attr.aria-activedescendant]="
190
+ listbox?.attributes?.['aria-activedescendant']
191
+ "
192
+ [tabindex]="listbox?.attributes?.tabIndex"
193
+ [style]="listbox?.attributes?.style"
194
+ [class]="listbox?.classes"
195
+ >
196
+ <button
197
+ type="button"
198
+ class="close m-4 m-sm-2 d-block d-sm-none"
199
+ (click)="handler?.close()"
200
+ >
201
+ <span class="sr-only">Close</span>
202
+ </button>
203
+ <ul role="listbox">
204
+ <li
205
+ *ngFor="let option of dropdown?.options; trackBy: trackByKey"
206
+ [id]="option.attributes.id"
207
+ [attr.role]="option.attributes.role"
208
+ [attr.aria-selected]="option.attributes['aria-selected']"
209
+ [style]="option.attributes.style"
210
+ [class]="option.classes"
211
+ (click)="handler?.select(option)"
212
+ >
213
+ {{ option.key }}
214
+ </li>
215
+ </ul>
216
+ </div>
217
+ </div>
218
+ `, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownComponent, decorators: [{
220
+ type: Component,
221
+ args: [{
222
+ selector: 'ngg-dropdown',
223
+ template: `
224
+ <div>
225
+ <span
226
+ class="label"
227
+ *ngIf="label"
228
+ [id]="toggler?.attributes?.id + '_label'"
229
+ >{{ label }}</span
230
+ >
231
+ <button
232
+ [attr.aria-labelledby]="
233
+ label ? toggler?.attributes?.id + '_label' : null
234
+ "
235
+ [attr.aria-describedby]="
236
+ formInfo?.innerText && formInfo.innerText.length > 0
237
+ ? toggler?.attributes?.id + '_info'
238
+ : null
239
+ "
240
+ type="button"
241
+ #togglerRef
242
+ [id]="toggler?.attributes?.id"
243
+ [attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
244
+ [attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
245
+ [attr.aria-owns]="toggler?.attributes?.['aria-owns']"
246
+ [tabindex]="toggler?.attributes?.tabIndex"
247
+ [style]="toggler?.attributes?.style"
248
+ [class]="toggler?.classes"
249
+ (click)="handler?.toggle()"
250
+ [class.is-valid]="valid"
251
+ [class.is-invalid]="invalid"
252
+ >
253
+ <span>{{ dropdown?.text }}</span>
254
+ </button>
255
+ <span
256
+ class="form-info"
257
+ #formInfo
258
+ [attr.id]="toggler?.attributes?.id + '_info'"
259
+ ><ng-content select="[data-form-info]"></ng-content
260
+ ></span>
261
+ <div
262
+ #listboxRef
263
+ [id]="listbox?.attributes?.id"
264
+ [attr.role]="listbox?.attributes?.role"
265
+ [attr.aria-activedescendant]="
266
+ listbox?.attributes?.['aria-activedescendant']
267
+ "
268
+ [tabindex]="listbox?.attributes?.tabIndex"
269
+ [style]="listbox?.attributes?.style"
270
+ [class]="listbox?.classes"
271
+ >
272
+ <button
273
+ type="button"
274
+ class="close m-4 m-sm-2 d-block d-sm-none"
275
+ (click)="handler?.close()"
276
+ >
277
+ <span class="sr-only">Close</span>
278
+ </button>
279
+ <ul role="listbox">
280
+ <li
281
+ *ngFor="let option of dropdown?.options; trackBy: trackByKey"
282
+ [id]="option.attributes.id"
283
+ [attr.role]="option.attributes.role"
284
+ [attr.aria-selected]="option.attributes['aria-selected']"
285
+ [style]="option.attributes.style"
286
+ [class]="option.classes"
287
+ (click)="handler?.select(option)"
288
+ >
289
+ {{ option.key }}
290
+ </li>
291
+ </ul>
292
+ </div>
293
+ </div>
294
+ `,
295
+ providers: [
296
+ {
297
+ provide: NG_VALUE_ACCESSOR,
298
+ useExisting: NggDropdownComponent,
299
+ multi: true,
300
+ },
301
+ ],
302
+ changeDetection: ChangeDetectionStrategy.OnPush,
303
+ }]
304
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
305
+ type: Input
306
+ }], text: [{
307
+ type: Input
308
+ }], loop: [{
309
+ type: Input
310
+ }], label: [{
311
+ type: Input
312
+ }], options: [{
313
+ type: Input
314
+ }], valid: [{
315
+ type: Input
316
+ }], invalid: [{
317
+ type: Input
318
+ }], value: [{
319
+ type: Input
320
+ }], valueChange: [{
321
+ type: Output
322
+ }], togglerRef: [{
323
+ type: ViewChild,
324
+ args: ['togglerRef']
325
+ }], listboxRef: [{
326
+ type: ViewChild,
327
+ args: ['listboxRef']
328
+ }] } });
329
+
330
+ class NggDropdownModule {
331
+ }
332
+ NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
333
+ NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
334
+ NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDropdownModule, decorators: [{
336
+ type: NgModule,
337
+ args: [{
338
+ declarations: [NggDropdownComponent],
339
+ imports: [CommonModule],
340
+ exports: [NggDropdownComponent],
341
+ }]
342
+ }] });
343
+
344
+ class NggDatepickerComponent {
345
+ constructor(_cdr) {
346
+ this._cdr = _cdr;
347
+ this.id = randomId();
348
+ this.valueChange = new EventEmitter();
349
+ this._months = months({});
350
+ this.years = years({});
351
+ this.trackByKey = (index, option) => {
352
+ return option.key;
353
+ };
354
+ this.listener = (data, state) => {
355
+ if (this.dp && state) {
356
+ this.dp.state = { ...state };
357
+ }
358
+ this.onTouchedFn && this.onTouchedFn();
359
+ if (data) {
360
+ this.valueChange.emit(data.selectedDate);
361
+ this.onChangeFn && this.onChangeFn(data.selectedDate);
362
+ this.data = data;
363
+ }
364
+ if (data || state) {
365
+ this._cdr.markForCheck();
366
+ }
367
+ };
368
+ }
369
+ get months() {
370
+ return this._months;
371
+ }
372
+ set months(value) {
373
+ this._months = value;
374
+ }
375
+ get options() {
376
+ return this._options;
377
+ }
378
+ set options(value) {
379
+ this._options = value;
380
+ if (value.locale) {
381
+ this.months = months({ locale: this.options?.locale });
382
+ }
383
+ }
384
+ get value() {
385
+ return this._value;
386
+ }
387
+ set value(newValue) {
388
+ if (newValue !== this._value) {
389
+ this._value = newValue;
390
+ }
391
+ }
392
+ writeValue(value) {
393
+ this.value = value;
394
+ // When binding using ngModel we need to set initial select date
395
+ // once we get initial value as it's not available when component is created
396
+ if (value && this.dp && !this.data?.selectedDate) {
397
+ this.dp.select(value);
398
+ }
399
+ }
400
+ registerOnChange(fn) {
401
+ this.onChangeFn = fn;
402
+ }
403
+ registerOnTouched(fn) {
404
+ this.onTouchedFn = fn;
405
+ }
406
+ get data() {
407
+ return this._data;
408
+ }
409
+ set data(value) {
410
+ this._data = value;
411
+ }
412
+ trackWeek(index, week) {
413
+ return week;
414
+ }
415
+ ngAfterViewInit() {
416
+ // initialize datepicker
417
+ if (this.datepickerElRef &&
418
+ this.datepickerDialogElRef &&
419
+ this.dateInputElRef &&
420
+ this.datepickerTriggerElRef &&
421
+ !this.dp) {
422
+ this.dp = createDatepicker(this.listener, {
423
+ ...this.options,
424
+ selectedDate: this.value,
425
+ }, this.datepickerElRef.nativeElement, this.datepickerDialogElRef.nativeElement, this.dateInputElRef.nativeElement, this.datepickerTriggerElRef.nativeElement);
426
+ this._cdr.detectChanges();
427
+ }
428
+ else {
429
+ throw 'Missing one or more elements...';
430
+ }
431
+ }
432
+ }
433
+ NggDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
434
+ NggDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: NggDatepickerComponent, selector: "ngg-datepicker", inputs: { options: "options", value: "value", id: "id", label: "label", valid: "valid", invalid: "invalid" }, outputs: { valueChange: "valueChange" }, providers: [
435
+ {
436
+ provide: NG_VALUE_ACCESSOR,
437
+ useExisting: NggDatepickerComponent,
438
+ multi: true,
439
+ },
440
+ ], 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]=\"valid\"\n [class.is-invalid]=\"invalid\"\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)=\"dp?.select(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()\">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 text=\"Select\"\n [value]=\"data?.month\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n [options]=\"years\"\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.currentMonth\"\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", "text", "loop", "label", "options", "valid", "invalid", "value"], outputs: ["valueChange"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDatepickerComponent, decorators: [{
442
+ type: Component,
443
+ args: [{ selector: 'ngg-datepicker', providers: [
444
+ {
445
+ provide: NG_VALUE_ACCESSOR,
446
+ useExisting: NggDatepickerComponent,
447
+ multi: true,
448
+ },
449
+ ], 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]=\"valid\"\n [class.is-invalid]=\"invalid\"\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)=\"dp?.select(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()\">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 text=\"Select\"\n [value]=\"data?.month\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n [options]=\"years\"\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.currentMonth\"\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" }]
450
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { options: [{
451
+ type: Input
452
+ }], value: [{
453
+ type: Input
454
+ }], id: [{
455
+ type: Input
456
+ }], label: [{
457
+ type: Input
458
+ }], valid: [{
459
+ type: Input
460
+ }], invalid: [{
461
+ type: Input
462
+ }], valueChange: [{
463
+ type: Output
464
+ }], datepickerDialogElRef: [{
465
+ type: ViewChild,
466
+ args: ['datepickerDialogElRef']
467
+ }], dateInputElRef: [{
468
+ type: ViewChild,
469
+ args: ['dateInputElRef']
470
+ }], datepickerElRef: [{
471
+ type: ViewChild,
472
+ args: ['datepickerElRef']
473
+ }], datepickerTriggerElRef: [{
474
+ type: ViewChild,
475
+ args: ['datepickerTriggerElRef']
476
+ }] } });
477
+
478
+ class NggDatepickerModule {
479
+ }
480
+ NggDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
481
+ NggDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDatepickerModule, declarations: [NggDatepickerComponent], imports: [CommonModule, NggDropdownModule], exports: [NggDatepickerComponent] });
482
+ NggDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDatepickerModule, imports: [[CommonModule, NggDropdownModule]] });
483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggDatepickerModule, decorators: [{
484
+ type: NgModule,
485
+ args: [{
486
+ declarations: [NggDatepickerComponent],
487
+ imports: [CommonModule, NggDropdownModule],
488
+ exports: [NggDatepickerComponent],
489
+ }]
490
+ }] });
491
+
492
+ class NggModule {
493
+ }
494
+ NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
495
+ NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule] });
496
+ NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule] });
497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NggModule, decorators: [{
498
+ type: NgModule,
499
+ args: [{
500
+ declarations: [],
501
+ imports: [CommonModule],
502
+ exports: [NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule],
503
+ }]
504
+ }] });
505
+
506
+ /**
507
+ * Generated bundle index. Do not edit.
508
+ */
509
+
510
+ export { NggDatepickerComponent, NggDatepickerModule, NggDropdownComponent, NggDropdownModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule };
511
+ //# sourceMappingURL=sebgroup-green-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sebgroup-green-angular.mjs","sources":["../../../../libs/angular/src/lib/segmented-control/segmented-control.component.ts","../../../../libs/angular/src/lib/segmented-control/segmented-control.module.ts","../../../../libs/angular/src/lib/dropdown/dropdown.component.ts","../../../../libs/angular/src/lib/dropdown/dropdown.module.ts","../../../../libs/angular/src/lib/datepicker/datepicker.component.ts","../../../../libs/angular/src/lib/datepicker/datepicker.component.html","../../../../libs/angular/src/lib/datepicker/datepicker.module.ts","../../../../libs/angular/src/lib/green-angular.module.ts","../../../../libs/angular/src/sebgroup-green-angular.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Input } from '@angular/core'\nimport { Observable } from 'rxjs'\nexport interface SegmentedControl {\n url: string\n text: Observable<string> | string\n}\n@Component({\n selector: 'ngg-segmented-control',\n template: `\n <div class=\"group\">\n <a\n *ngFor=\"let control of $controls | async\"\n [routerLink]=\"control.url\"\n routerLinkActive=\"active\"\n class=\"button\"\n >{{ control.text }}</a\n >\n </div>\n `,\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggSegmentedControlComponent {\n @Input() $controls: Observable<Array<SegmentedControl>> | undefined\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggSegmentedControlComponent } from './segmented-control.component'\nimport { RouterModule } from '@angular/router'\n\n@NgModule({\n declarations: [NggSegmentedControlComponent],\n imports: [RouterModule, CommonModule],\n exports: [NggSegmentedControlComponent],\n})\nexport class NggSegmentedControlModule {}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewChild,\n EventEmitter,\n SimpleChanges,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport {\n createDropdown,\n AbstractDropdown,\n DropdownHandler,\n DropdownOption,\n ExtendedDropdownOption,\n ElementProps,\n DropdownArgs,\n dropdownValues,\n} from '@sebgroup/extract'\n\n@Component({\n selector: 'ngg-dropdown',\n template: `\n <div>\n <span\n class=\"label\"\n *ngIf=\"label\"\n [id]=\"toggler?.attributes?.id + '_label'\"\n >{{ label }}</span\n >\n <button\n [attr.aria-labelledby]=\"\n label ? toggler?.attributes?.id + '_label' : null\n \"\n [attr.aria-describedby]=\"\n formInfo?.innerText && formInfo.innerText.length > 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?.text }}</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\">Close</span>\n </button>\n <ul role=\"listbox\">\n <li\n *ngFor=\"let option of dropdown?.options; trackBy: trackByKey\"\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 {{ option.key }}\n </li>\n </ul>\n </div>\n </div>\n `,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: NggDropdownComponent,\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggDropdownComponent\n implements ControlValueAccessor, AfterViewInit, OnDestroy, OnChanges\n{\n @Input() id?: string\n @Input() text?: string\n @Input() loop?: boolean = false\n @Input() label?: string\n @Input() options: DropdownOption[] = []\n @Input() valid?: boolean\n @Input() invalid?: boolean\n\n @Input()\n get value(): any {\n return this._value\n }\n set value(newValue: any) {\n this.setSelectionByValue(newValue)\n }\n private _value: any\n\n @Output() readonly valueChange: EventEmitter<any> = new EventEmitter<any>()\n\n @ViewChild('togglerRef') public togglerRef:\n | ElementRef<HTMLElement>\n | undefined\n\n @ViewChild('listboxRef') public listboxRef:\n | ElementRef<HTMLElement>\n | undefined\n\n onChangeFn?: (value: any) => void\n onTouchedFn?: any\n\n dropdown?: AbstractDropdown\n handler?: DropdownHandler\n toggler?: Partial<ElementProps> = dropdownValues.elements?.toggler\n listbox?: Partial<ElementProps> = dropdownValues.elements?.listbox\n\n constructor(private cd: ChangeDetectorRef) {}\n\n ngAfterViewInit(): void {\n if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {\n this.handler = createDropdown(\n this.props,\n this.togglerRef.nativeElement,\n this.listboxRef.nativeElement,\n (dropdown) => {\n this.dropdown = dropdown\n this.toggler = dropdown.elements.toggler\n this.listbox = dropdown.elements.listbox\n\n const selected = this.dropdown.options?.find(\n (option) => option.selected\n )\n if (selected && this._value !== selected?.value) {\n setTimeout(() => {\n this._value = selected.value\n this.valueChange.emit(selected.value)\n this.onChangeFn && this.onChangeFn(selected.value)\n this.onTouchedFn && this.onTouchedFn()\n }, 0)\n }\n this.cd.detectChanges()\n }\n )\n }\n }\n\n ngOnDestroy(): void {\n this.handler?.destroy()\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (\n this.handler &&\n (changes.id || changes.text || changes.loop || changes.options)\n ) {\n this.handler.update(this.props)\n }\n }\n\n writeValue(value: any): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChangeFn = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouchedFn = fn\n }\n\n select(option: ExtendedDropdownOption) {\n this.handler?.select(option)\n this._value = option.value\n this.valueChange.emit(option.value)\n this.onChangeFn && this.onChangeFn(option.value)\n this.onTouchedFn && this.onTouchedFn()\n }\n\n trackByKey = (index: number, option: ExtendedDropdownOption): string => {\n return option.key\n }\n\n private get props(): DropdownArgs {\n return {\n id: this.id || this.dropdown?.id,\n text: this.text,\n options: this.options,\n loop: this.loop,\n value: this.value,\n }\n }\n\n private setSelectionByValue(value: any) {\n if (this._value !== value) {\n this._value = value\n\n const selected = this.handler?.dropdown?.options.find(\n (option) => option.value === value\n )\n if (selected) this.handler?.select(selected)\n }\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggDropdownComponent } from './dropdown.component'\n\n@NgModule({\n declarations: [NggDropdownComponent],\n imports: [CommonModule],\n exports: [NggDropdownComponent],\n})\nexport class NggDropdownModule {}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n Output,\n ViewChild,\n EventEmitter,\n ChangeDetectorRef,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport {\n AbstractDropdown,\n DropdownHandler,\n ExtendedDropdownOption,\n ElementProps,\n DatepickerData,\n Datepicker,\n createDatepicker,\n DatepickerState,\n DropdownOption,\n months,\n years,\n randomId,\n DatepickerOptions,\n} from '@sebgroup/extract'\n\n@Component({\n selector: 'ngg-datepicker',\n templateUrl: 'datepicker.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: NggDatepickerComponent,\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggDatepickerComponent\n implements ControlValueAccessor, AfterViewInit\n{\n get months(): Array<DropdownOption> {\n return this._months\n }\n\n set months(value: Array<DropdownOption>) {\n this._months = value\n }\n @Input()\n get options(): DatepickerOptions {\n return <DatepickerOptions>this._options\n }\n set options(value: DatepickerOptions) {\n this._options = value\n if (value.locale) {\n this.months = months({ locale: this.options?.locale })\n }\n }\n @Input()\n get value(): string | Date | undefined {\n return this._value\n }\n set value(newValue: string | Date | undefined) {\n if (newValue !== this._value) {\n this._value = newValue\n }\n }\n @Input() id?: string = randomId()\n @Input() label?: string\n @Input() valid?: boolean\n @Input() invalid?: boolean\n @Output() readonly valueChange: EventEmitter<any> = new EventEmitter<any>()\n @ViewChild('datepickerDialogElRef')\n public datepickerDialogElRef?: ElementRef<HTMLElement>\n @ViewChild('dateInputElRef')\n public dateInputElRef?: ElementRef<HTMLInputElement>\n @ViewChild('datepickerElRef') public datepickerElRef?: ElementRef<HTMLElement>\n @ViewChild('datepickerTriggerElRef')\n public datepickerTriggerElRef?: ElementRef<HTMLButtonElement>\n\n onChangeFn?: (value: any) => void\n onTouchedFn?: any\n\n dropdown?: AbstractDropdown\n handler?: DropdownHandler\n toggler?: Partial<ElementProps>\n listbox?: Partial<ElementProps>\n _value: string | Date | undefined\n private _months: Array<DropdownOption> = months({})\n years: Array<DropdownOption> = years({})\n private _options?: DatepickerOptions\n\n dp: Datepicker | undefined\n private _data: DatepickerData | undefined\n\n constructor(private _cdr: ChangeDetectorRef) {}\n\n writeValue(value: any): void {\n this.value = value\n\n // When binding using ngModel we need to set initial select date\n // once we get initial value as it's not available when component is created\n if (value && this.dp && !this.data?.selectedDate) {\n this.dp.select(value)\n }\n }\n\n registerOnChange(fn: any): void {\n this.onChangeFn = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouchedFn = fn\n }\n\n trackByKey = (index: number, option: ExtendedDropdownOption): string => {\n return option.key\n }\n\n get data(): DatepickerData | undefined {\n return this._data\n }\n\n set data(value: DatepickerData | undefined) {\n this._data = value\n }\n\n listener = (\n data: DatepickerData | undefined,\n state: DatepickerState | undefined\n ) => {\n if (this.dp && state) {\n this.dp.state = { ...state }\n }\n\n this.onTouchedFn && this.onTouchedFn()\n\n if (data) {\n this.valueChange.emit(data.selectedDate)\n this.onChangeFn && this.onChangeFn(data.selectedDate)\n this.data = data\n }\n\n if (data || state) {\n this._cdr.markForCheck()\n }\n }\n trackWeek(index: any, week: any) {\n return week\n }\n\n ngAfterViewInit(): void {\n // initialize datepicker\n if (\n this.datepickerElRef &&\n this.datepickerDialogElRef &&\n this.dateInputElRef &&\n this.datepickerTriggerElRef &&\n !this.dp\n ) {\n this.dp = createDatepicker(\n this.listener,\n {\n ...this.options,\n selectedDate: this.value,\n },\n this.datepickerElRef.nativeElement,\n this.datepickerDialogElRef.nativeElement,\n this.dateInputElRef.nativeElement,\n this.datepickerTriggerElRef.nativeElement\n )\n this._cdr.detectChanges()\n } else {\n throw 'Missing one or more elements...'\n }\n }\n}\n","<div class=\"form-group\">\n <label *ngIf=\"label\" [for]=\"id\">{{ label }}</label>\n <div\n class=\"group\"\n #datepickerElRef\n [class.is-valid]=\"valid\"\n [class.is-invalid]=\"invalid\"\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)=\"dp?.select(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()\">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 text=\"Select\"\n [value]=\"data?.month\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n [options]=\"years\"\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.currentMonth\"\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","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggDatepickerComponent } from './datepicker.component'\nimport { NggDropdownModule } from '../dropdown/dropdown.module'\n\n@NgModule({\n declarations: [NggDatepickerComponent],\n imports: [CommonModule, NggDropdownModule],\n exports: [NggDatepickerComponent],\n})\nexport class NggDatepickerModule {}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggSegmentedControlModule } from './segmented-control/segmented-control.module'\nimport { NggDropdownModule } from './dropdown/dropdown.module'\nimport { NggDatepickerModule } from './datepicker/datepicker.module'\n\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n exports: [NggSegmentedControlModule, NggDropdownModule, NggDatepickerModule],\n})\nexport class NggModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAsBa,4BAA4B;;yHAA5B,4BAA4B;6GAA5B,4BAA4B,iGAd7B;;;;;;;;;;GAUT;2FAIU,4BAA4B;kBAhBxC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;;;;;;;;;GAUT;oBACD,MAAM,EAAE,EAAE;oBACV,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAEU,SAAS;sBAAjB,KAAK;;;MCbK,yBAAyB;;sHAAzB,yBAAyB;uHAAzB,yBAAyB,iBAJrB,4BAA4B,aACjC,YAAY,EAAE,YAAY,aAC1B,4BAA4B;uHAE3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from './lib/green-angular.module';
2
2
  export * from './lib/dropdown/dropdown.module';
3
3
  export * from './lib/dropdown/dropdown.component';
4
- export * from './lib/dropdown/popover.directive';
5
- export * from './lib/dropdown/popover-element.directive';
6
- export * from './lib/dropdown/popover-option.directive';
7
- export * from './lib/dropdown/popover-trigger.directive';
4
+ export * from './lib/datepicker/datepicker.module';
5
+ export * from './lib/datepicker/datepicker.component';
8
6
  export * from './lib/segmented-control/segmented-control.module';
9
7
  export * from './lib/segmented-control/segmented-control.component';
@@ -0,0 +1,46 @@
1
+ import { AfterViewInit, ElementRef, EventEmitter, ChangeDetectorRef } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { AbstractDropdown, DropdownHandler, ExtendedDropdownOption, ElementProps, DatepickerData, Datepicker, DatepickerState, DropdownOption, DatepickerOptions } from '@sebgroup/extract';
4
+ import * as i0 from "@angular/core";
5
+ export declare class NggDatepickerComponent implements ControlValueAccessor, AfterViewInit {
6
+ private _cdr;
7
+ get months(): Array<DropdownOption>;
8
+ set months(value: Array<DropdownOption>);
9
+ get options(): DatepickerOptions;
10
+ set options(value: DatepickerOptions);
11
+ get value(): string | Date | undefined;
12
+ set value(newValue: string | Date | undefined);
13
+ id?: string;
14
+ label?: string;
15
+ valid?: boolean;
16
+ invalid?: boolean;
17
+ readonly valueChange: EventEmitter<any>;
18
+ datepickerDialogElRef?: ElementRef<HTMLElement>;
19
+ dateInputElRef?: ElementRef<HTMLInputElement>;
20
+ datepickerElRef?: ElementRef<HTMLElement>;
21
+ datepickerTriggerElRef?: ElementRef<HTMLButtonElement>;
22
+ onChangeFn?: (value: any) => void;
23
+ onTouchedFn?: any;
24
+ dropdown?: AbstractDropdown;
25
+ handler?: DropdownHandler;
26
+ toggler?: Partial<ElementProps>;
27
+ listbox?: Partial<ElementProps>;
28
+ _value: string | Date | undefined;
29
+ private _months;
30
+ years: Array<DropdownOption>;
31
+ private _options?;
32
+ dp: Datepicker | undefined;
33
+ private _data;
34
+ constructor(_cdr: ChangeDetectorRef);
35
+ writeValue(value: any): void;
36
+ registerOnChange(fn: any): void;
37
+ registerOnTouched(fn: any): void;
38
+ trackByKey: (index: number, option: ExtendedDropdownOption) => string;
39
+ get data(): DatepickerData | undefined;
40
+ set data(value: DatepickerData | undefined);
41
+ listener: (data: DatepickerData | undefined, state: DatepickerState | undefined) => void;
42
+ trackWeek(index: any, week: any): any;
43
+ ngAfterViewInit(): void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<NggDatepickerComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<NggDatepickerComponent, "ngg-datepicker", never, { "options": "options"; "value": "value"; "id": "id"; "label": "label"; "valid": "valid"; "invalid": "invalid"; }, { "valueChange": "valueChange"; }, never, ["[data-form-info]"]>;
46
+ }