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