@sebgroup/green-angular 1.0.0-beta.15 → 1.0.0-beta.19
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.
- package/esm2020/index.mjs +2 -1
- package/esm2020/lib/badge/badge.component.mjs +34 -12
- package/esm2020/lib/datepicker/datepicker.component.mjs +1 -1
- package/esm2020/lib/dropdown/dropdown-option.directive.mjs +16 -0
- package/esm2020/lib/dropdown/dropdown.component.mjs +86 -25
- package/esm2020/lib/dropdown/dropdown.module.mjs +5 -4
- package/fesm2015/sebgroup-green-angular.mjs +138 -40
- package/fesm2015/sebgroup-green-angular.mjs.map +1 -1
- package/fesm2020/sebgroup-green-angular.mjs +136 -40
- package/fesm2020/sebgroup-green-angular.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/badge/badge.component.d.ts +17 -8
- package/lib/dropdown/dropdown-option.directive.d.ts +8 -0
- package/lib/dropdown/dropdown.component.d.ts +6 -2
- package/lib/dropdown/dropdown.module.d.ts +3 -2
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, Input, NgModule, EventEmitter, Output, ViewChild, HostBinding } from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, NgModule, Directive, EventEmitter, 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';
|
|
@@ -59,6 +59,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
59
59
|
}]
|
|
60
60
|
}] });
|
|
61
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
|
+
|
|
62
76
|
class NggDropdownComponent {
|
|
63
77
|
constructor(cd) {
|
|
64
78
|
var _a, _b, _c;
|
|
@@ -67,6 +81,7 @@ class NggDropdownComponent {
|
|
|
67
81
|
this._multiSelect = false;
|
|
68
82
|
this.options = [];
|
|
69
83
|
this.valueChange = new EventEmitter();
|
|
84
|
+
this.touched = new EventEmitter();
|
|
70
85
|
this.toggler = (_a = dropdownValues.elements) === null || _a === void 0 ? void 0 : _a.toggler;
|
|
71
86
|
this.listbox = (_b = dropdownValues.elements) === null || _b === void 0 ? void 0 : _b.listbox;
|
|
72
87
|
this.fieldset = (_c = dropdownValues.elements) === null || _c === void 0 ? void 0 : _c.fieldset;
|
|
@@ -107,12 +122,7 @@ class NggDropdownComponent {
|
|
|
107
122
|
selectedOption = dropdown.selectValue
|
|
108
123
|
? data[dropdown.selectValue]
|
|
109
124
|
: data;
|
|
110
|
-
|
|
111
|
-
this._value = selectedOption;
|
|
112
|
-
this.valueChange.emit(selectedOption);
|
|
113
|
-
this.onChangeFn && this.onChangeFn(selectedOption);
|
|
114
|
-
this.onTouchedFn && this.onTouchedFn();
|
|
115
|
-
}, 0);
|
|
125
|
+
this.updateValue(selectedOption);
|
|
116
126
|
}
|
|
117
127
|
}
|
|
118
128
|
else {
|
|
@@ -124,12 +134,7 @@ class NggDropdownComponent {
|
|
|
124
134
|
this._value !== [] &&
|
|
125
135
|
selectedOption &&
|
|
126
136
|
JSON.stringify(this._value) !== JSON.stringify(selectedOption)) {
|
|
127
|
-
|
|
128
|
-
this._value = selectedOption;
|
|
129
|
-
this.valueChange.emit(selectedOption);
|
|
130
|
-
this.onChangeFn && this.onChangeFn(selectedOption);
|
|
131
|
-
this.onTouchedFn && this.onTouchedFn();
|
|
132
|
-
}, 0);
|
|
137
|
+
this.updateValue(selectedOption);
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
140
|
this.cd.detectChanges();
|
|
@@ -167,8 +172,20 @@ class NggDropdownComponent {
|
|
|
167
172
|
loop: this.loop,
|
|
168
173
|
value: this.value,
|
|
169
174
|
multiSelect: this.multiSelect,
|
|
175
|
+
onTouched: () => {
|
|
176
|
+
var _a;
|
|
177
|
+
(_a = this.onTouchedFn) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
178
|
+
this.touched.emit(true);
|
|
179
|
+
this.cd.markForCheck();
|
|
180
|
+
},
|
|
170
181
|
};
|
|
171
182
|
}
|
|
183
|
+
updateValue(option) {
|
|
184
|
+
var _a;
|
|
185
|
+
this._value = option;
|
|
186
|
+
this.valueChange.emit(option);
|
|
187
|
+
(_a = this.onChangeFn) === null || _a === void 0 ? void 0 : _a.call(this, option);
|
|
188
|
+
}
|
|
172
189
|
setSelectionByValue(value) {
|
|
173
190
|
var _a, _b, _c, _d, _e;
|
|
174
191
|
if (!((_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.isMultiSelect)) {
|
|
@@ -183,13 +200,13 @@ class NggDropdownComponent {
|
|
|
183
200
|
}
|
|
184
201
|
}
|
|
185
202
|
NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
186
|
-
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", selectValue: "selectValue", useValue: "useValue", multiSelect: "multiSelect", label: "label", options: "options", valid: "valid", invalid: "invalid", value: "value" }, outputs: { valueChange: "valueChange" }, providers: [
|
|
203
|
+
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", selectValue: "selectValue", useValue: "useValue", multiSelect: "multiSelect", label: "label", options: "options", valid: "valid", invalid: "invalid", value: "value" }, outputs: { valueChange: "valueChange", touched: "touched" }, providers: [
|
|
187
204
|
{
|
|
188
205
|
provide: NG_VALUE_ACCESSOR,
|
|
189
206
|
useExisting: NggDropdownComponent,
|
|
190
207
|
multi: true,
|
|
191
208
|
},
|
|
192
|
-
], 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: `
|
|
209
|
+
], 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: `
|
|
193
210
|
<div>
|
|
194
211
|
<span
|
|
195
212
|
class="label"
|
|
@@ -249,7 +266,11 @@ NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
|
249
266
|
</button>
|
|
250
267
|
<ul role="listbox" *ngIf="!dropdown?.isMultiSelect">
|
|
251
268
|
<li
|
|
252
|
-
*ngFor="
|
|
269
|
+
*ngFor="
|
|
270
|
+
let option of dropdown?.options;
|
|
271
|
+
let index = index;
|
|
272
|
+
trackBy: trackByKey
|
|
273
|
+
"
|
|
253
274
|
[id]="option.attributes.id"
|
|
254
275
|
[attr.role]="option.attributes.role"
|
|
255
276
|
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
@@ -257,7 +278,14 @@ NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
|
257
278
|
[class]="option.classes"
|
|
258
279
|
(click)="handler?.select(option)"
|
|
259
280
|
>
|
|
260
|
-
|
|
281
|
+
<ng-container
|
|
282
|
+
*ngTemplateOutlet="
|
|
283
|
+
customOption?.templateRef
|
|
284
|
+
? customOption!.templateRef
|
|
285
|
+
: defaultOption;
|
|
286
|
+
context: { option: option, index: index }
|
|
287
|
+
"
|
|
288
|
+
></ng-container>
|
|
261
289
|
</li>
|
|
262
290
|
</ul>
|
|
263
291
|
<div *ngIf="dropdown?.isMultiSelect" class="sg-fieldset-container">
|
|
@@ -277,21 +305,37 @@ NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
|
277
305
|
[id]="option.attributes.id"
|
|
278
306
|
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
279
307
|
[class]="option.classes"
|
|
280
|
-
*ngFor="
|
|
308
|
+
*ngFor="
|
|
309
|
+
let option of dropdown?.options;
|
|
310
|
+
let index = index;
|
|
311
|
+
trackBy: trackByKey
|
|
312
|
+
"
|
|
281
313
|
>
|
|
282
314
|
<input
|
|
283
315
|
type="checkbox"
|
|
284
316
|
(change)="handler?.select(option, false)"
|
|
285
317
|
[checked]="option.selected"
|
|
318
|
+
tabIndex="-1"
|
|
286
319
|
/>
|
|
287
|
-
<
|
|
320
|
+
<ng-container
|
|
321
|
+
*ngTemplateOutlet="
|
|
322
|
+
customOption?.templateRef
|
|
323
|
+
? customOption!.templateRef
|
|
324
|
+
: defaultOption;
|
|
325
|
+
context: { option: option, index: index }
|
|
326
|
+
"
|
|
327
|
+
></ng-container>
|
|
288
328
|
<i></i>
|
|
289
329
|
</label>
|
|
290
330
|
</fieldset>
|
|
291
331
|
</div>
|
|
292
332
|
</div>
|
|
293
333
|
</div>
|
|
294
|
-
|
|
334
|
+
|
|
335
|
+
<ng-template #defaultOption let-option="option">
|
|
336
|
+
{{ option[dropdown!.display] }}
|
|
337
|
+
</ng-template>
|
|
338
|
+
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
295
339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownComponent, decorators: [{
|
|
296
340
|
type: Component,
|
|
297
341
|
args: [{
|
|
@@ -356,7 +400,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
356
400
|
</button>
|
|
357
401
|
<ul role="listbox" *ngIf="!dropdown?.isMultiSelect">
|
|
358
402
|
<li
|
|
359
|
-
*ngFor="
|
|
403
|
+
*ngFor="
|
|
404
|
+
let option of dropdown?.options;
|
|
405
|
+
let index = index;
|
|
406
|
+
trackBy: trackByKey
|
|
407
|
+
"
|
|
360
408
|
[id]="option.attributes.id"
|
|
361
409
|
[attr.role]="option.attributes.role"
|
|
362
410
|
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
@@ -364,7 +412,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
364
412
|
[class]="option.classes"
|
|
365
413
|
(click)="handler?.select(option)"
|
|
366
414
|
>
|
|
367
|
-
|
|
415
|
+
<ng-container
|
|
416
|
+
*ngTemplateOutlet="
|
|
417
|
+
customOption?.templateRef
|
|
418
|
+
? customOption!.templateRef
|
|
419
|
+
: defaultOption;
|
|
420
|
+
context: { option: option, index: index }
|
|
421
|
+
"
|
|
422
|
+
></ng-container>
|
|
368
423
|
</li>
|
|
369
424
|
</ul>
|
|
370
425
|
<div *ngIf="dropdown?.isMultiSelect" class="sg-fieldset-container">
|
|
@@ -384,20 +439,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
384
439
|
[id]="option.attributes.id"
|
|
385
440
|
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
386
441
|
[class]="option.classes"
|
|
387
|
-
*ngFor="
|
|
442
|
+
*ngFor="
|
|
443
|
+
let option of dropdown?.options;
|
|
444
|
+
let index = index;
|
|
445
|
+
trackBy: trackByKey
|
|
446
|
+
"
|
|
388
447
|
>
|
|
389
448
|
<input
|
|
390
449
|
type="checkbox"
|
|
391
450
|
(change)="handler?.select(option, false)"
|
|
392
451
|
[checked]="option.selected"
|
|
452
|
+
tabIndex="-1"
|
|
393
453
|
/>
|
|
394
|
-
<
|
|
454
|
+
<ng-container
|
|
455
|
+
*ngTemplateOutlet="
|
|
456
|
+
customOption?.templateRef
|
|
457
|
+
? customOption!.templateRef
|
|
458
|
+
: defaultOption;
|
|
459
|
+
context: { option: option, index: index }
|
|
460
|
+
"
|
|
461
|
+
></ng-container>
|
|
395
462
|
<i></i>
|
|
396
463
|
</label>
|
|
397
464
|
</fieldset>
|
|
398
465
|
</div>
|
|
399
466
|
</div>
|
|
400
467
|
</div>
|
|
468
|
+
|
|
469
|
+
<ng-template #defaultOption let-option="option">
|
|
470
|
+
{{ option[dropdown!.display] }}
|
|
471
|
+
</ng-template>
|
|
401
472
|
`,
|
|
402
473
|
providers: [
|
|
403
474
|
{
|
|
@@ -434,6 +505,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
434
505
|
type: Input
|
|
435
506
|
}], valueChange: [{
|
|
436
507
|
type: Output
|
|
508
|
+
}], touched: [{
|
|
509
|
+
type: Output
|
|
437
510
|
}], togglerRef: [{
|
|
438
511
|
type: ViewChild,
|
|
439
512
|
args: ['togglerRef']
|
|
@@ -443,19 +516,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
443
516
|
}], fieldsetRef: [{
|
|
444
517
|
type: ViewChild,
|
|
445
518
|
args: ['fieldsetRef']
|
|
519
|
+
}], customOption: [{
|
|
520
|
+
type: ContentChild,
|
|
521
|
+
args: [NggDropdownOptionDirective]
|
|
446
522
|
}] } });
|
|
447
523
|
|
|
448
524
|
class NggDropdownModule {
|
|
449
525
|
}
|
|
450
526
|
NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
451
|
-
NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
|
|
527
|
+
NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent, NggDropdownOptionDirective], imports: [CommonModule], exports: [NggDropdownComponent, NggDropdownOptionDirective] });
|
|
452
528
|
NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
|
|
453
529
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDropdownModule, decorators: [{
|
|
454
530
|
type: NgModule,
|
|
455
531
|
args: [{
|
|
456
|
-
declarations: [NggDropdownComponent],
|
|
532
|
+
declarations: [NggDropdownComponent, NggDropdownOptionDirective],
|
|
457
533
|
imports: [CommonModule],
|
|
458
|
-
exports: [NggDropdownComponent],
|
|
534
|
+
exports: [NggDropdownComponent, NggDropdownOptionDirective],
|
|
459
535
|
}]
|
|
460
536
|
}] });
|
|
461
537
|
|
|
@@ -571,7 +647,7 @@ NggDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
571
647
|
useExisting: NggDatepickerComponent,
|
|
572
648
|
multi: true,
|
|
573
649
|
},
|
|
574
|
-
], 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()\">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 selectValue=\"value\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n *ngIf=\"years\"\n [options]=\"years\"\n text=\"Select\"\n [value]=\"data?.year\"\n selectValue=\"value\"\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", "selectValue", "useValue", "multiSelect", "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 });
|
|
650
|
+
], 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()\">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 selectValue=\"value\"\n (valueChange)=\"dp?.setMonth($event)\"\n ></ngg-dropdown>\n <ngg-dropdown\n *ngIf=\"years\"\n [options]=\"years\"\n text=\"Select\"\n [value]=\"data?.year\"\n selectValue=\"value\"\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", "selectValue", "useValue", "multiSelect", "label", "options", "valid", "invalid", "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 });
|
|
575
651
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggDatepickerComponent, decorators: [{
|
|
576
652
|
type: Component,
|
|
577
653
|
args: [{ selector: 'ngg-datepicker', providers: [
|
|
@@ -668,9 +744,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
668
744
|
}] });
|
|
669
745
|
|
|
670
746
|
class NggBadgeComponent {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
747
|
+
//eslint-disable-next-line
|
|
748
|
+
constructor() {
|
|
749
|
+
/** The color of the component */
|
|
750
|
+
this.badgeType = '';
|
|
751
|
+
/** Callback when component is dismissed */
|
|
752
|
+
this.handleClose = new EventEmitter();
|
|
753
|
+
}
|
|
754
|
+
/** Flag whether the component can be dismissed */
|
|
674
755
|
set isCloseable(value) {
|
|
675
756
|
this._isCloseable = value;
|
|
676
757
|
}
|
|
@@ -680,16 +761,21 @@ class NggBadgeComponent {
|
|
|
680
761
|
get class() {
|
|
681
762
|
return ['badge', this.badgeType].join(' ');
|
|
682
763
|
}
|
|
683
|
-
|
|
684
|
-
this.
|
|
764
|
+
ngOnInit() {
|
|
765
|
+
if (!!this.customColor || !!this.customBackgroundColor) {
|
|
766
|
+
this.badgeType = '';
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
close(e) {
|
|
770
|
+
this.handleClose.emit(e);
|
|
685
771
|
}
|
|
686
772
|
}
|
|
687
|
-
NggBadgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeComponent, deps: [
|
|
688
|
-
NggBadgeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: NggBadgeComponent, selector: "[ngg-badge]", inputs: {
|
|
773
|
+
NggBadgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: NggBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
774
|
+
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: `
|
|
689
775
|
<strong>
|
|
690
776
|
<ng-content></ng-content>
|
|
691
777
|
</strong>
|
|
692
|
-
<button *ngIf="isCloseable" class="close" (click)="close()">
|
|
778
|
+
<button *ngIf="isCloseable" class="close" (click)="close($event)">
|
|
693
779
|
{{ closeText }}
|
|
694
780
|
</button>
|
|
695
781
|
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -703,21 +789,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
703
789
|
<strong>
|
|
704
790
|
<ng-content></ng-content>
|
|
705
791
|
</strong>
|
|
706
|
-
<button *ngIf="isCloseable" class="close" (click)="close()">
|
|
792
|
+
<button *ngIf="isCloseable" class="close" (click)="close($event)">
|
|
707
793
|
{{ closeText }}
|
|
708
794
|
</button>
|
|
709
795
|
`,
|
|
710
796
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
711
797
|
}]
|
|
712
|
-
}], ctorParameters: function () { return [
|
|
798
|
+
}], ctorParameters: function () { return []; }, propDecorators: { badgeType: [{
|
|
713
799
|
type: Input
|
|
714
|
-
}],
|
|
800
|
+
}], isCloseable: [{
|
|
715
801
|
type: Input
|
|
716
802
|
}], closeText: [{
|
|
717
803
|
type: Input
|
|
804
|
+
}], customColor: [{
|
|
805
|
+
type: HostBinding,
|
|
806
|
+
args: ['style.color']
|
|
807
|
+
}, {
|
|
808
|
+
type: Input
|
|
809
|
+
}], customBackgroundColor: [{
|
|
810
|
+
type: HostBinding,
|
|
811
|
+
args: ['style.background-color']
|
|
812
|
+
}, {
|
|
813
|
+
type: Input
|
|
718
814
|
}], class: [{
|
|
719
815
|
type: HostBinding,
|
|
720
816
|
args: ['class']
|
|
817
|
+
}], handleClose: [{
|
|
818
|
+
type: Output
|
|
721
819
|
}] } });
|
|
722
820
|
|
|
723
821
|
class NggBadgeModule {
|
|
@@ -738,5 +836,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
738
836
|
* Generated bundle index. Do not edit.
|
|
739
837
|
*/
|
|
740
838
|
|
|
741
|
-
export { NggBadgeComponent, NggBadgeModule, NggDatepickerComponent, NggDatepickerModule, NggDropdownComponent, NggDropdownModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule, dateValidator };
|
|
839
|
+
export { NggBadgeComponent, NggBadgeModule, NggDatepickerComponent, NggDatepickerModule, NggDropdownComponent, NggDropdownModule, NggDropdownOptionDirective, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule, dateValidator };
|
|
742
840
|
//# sourceMappingURL=sebgroup-green-angular.mjs.map
|