@abgov/angular-components 2.0.0-alpha.5 → 2.0.0-alpha.7
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 +3 -45
- package/abgov-angular-components.d.ts +1 -0
- package/bundles/abgov-angular-components.umd.js +176 -2565
- package/bundles/abgov-angular-components.umd.js.map +1 -1
- package/esm2015/index.js +3 -27
- package/esm2015/lib/angular-components.module.js +16 -94
- package/esm2015/lib/value-directive.js +133 -0
- package/fesm2015/abgov-angular-components.js +119 -2007
- package/fesm2015/abgov-angular-components.js.map +1 -1
- package/index.d.ts +2 -26
- package/lib/angular-components.module.d.ts +7 -0
- package/lib/value-directive.d.ts +34 -0
- package/package.json +8 -13
- package/abgov-angular-components.metadata.json +0 -1
- package/esm2015/experimental/app-version-header/app-version-header.component.js +0 -30
- package/esm2015/experimental/badge/badge.component.js +0 -24
- package/esm2015/experimental/components.module.js +0 -29
- package/esm2015/experimental/index.js +0 -5
- package/esm2015/experimental/number-input/number-input.component.js +0 -151
- package/esm2015/lib/button/button.component.js +0 -66
- package/esm2015/lib/button-link/button-link.component.js +0 -66
- package/esm2015/lib/callout/callout.component.js +0 -34
- package/esm2015/lib/card/card.component.js +0 -37
- package/esm2015/lib/card/content/card-content.component.js +0 -24
- package/esm2015/lib/card/footer/card-footer.component.js +0 -24
- package/esm2015/lib/card/header/card-header.component.js +0 -24
- package/esm2015/lib/card/thumb/card-thumb.component.js +0 -27
- package/esm2015/lib/card-group/card.group.component.js +0 -23
- package/esm2015/lib/checkbox/checkbox-change.js +0 -3
- package/esm2015/lib/checkbox/checkbox.component.js +0 -136
- package/esm2015/lib/dropdown/dropdown.component.js +0 -326
- package/esm2015/lib/dropdown/option/option.component.js +0 -48
- package/esm2015/lib/dropdown/option-group/option-group.component.js +0 -46
- package/esm2015/lib/element-load-indicator/element-load-indicator.component.js +0 -63
- package/esm2015/lib/header/header.component.js +0 -47
- package/esm2015/lib/hero-banner/content/hero-banner-content.component.js +0 -15
- package/esm2015/lib/hero-banner/hero-banner.component.js +0 -21
- package/esm2015/lib/hero-banner/link/hero-banner-link.component.js +0 -18
- package/esm2015/lib/microsite-logo/microsite-logo.component.js +0 -34
- package/esm2015/lib/notification/notification.component.js +0 -59
- package/esm2015/lib/notification-banner/notification-banner.component.js +0 -32
- package/esm2015/lib/page-load-indicator/page-load-indicator.component.js +0 -117
- package/esm2015/lib/radio/radio-change.js +0 -3
- package/esm2015/lib/radio/radio.component.js +0 -146
- package/esm2015/lib/radio/radio.service.js +0 -20
- package/esm2015/lib/radio-group/radio-group.component.js +0 -282
- package/esm2015/lib/skeleton/skeleton-element.component.js +0 -21
- package/esm2015/lib/skeleton/skeleton-image-content.component.js +0 -19
- package/experimental/app-version-header/app-version-header.component.d.ts +0 -10
- package/experimental/badge/badge.component.d.ts +0 -7
- package/experimental/components.module.d.ts +0 -2
- package/experimental/index.d.ts +0 -4
- package/experimental/number-input/number-input.component.d.ts +0 -66
- package/lib/button/button.component.d.ts +0 -37
- package/lib/button-link/button-link.component.d.ts +0 -38
- package/lib/callout/callout.component.d.ts +0 -20
- package/lib/card/card.component.d.ts +0 -23
- package/lib/card/content/card-content.component.d.ts +0 -14
- package/lib/card/footer/card-footer.component.d.ts +0 -14
- package/lib/card/header/card-header.component.d.ts +0 -14
- package/lib/card/thumb/card-thumb.component.d.ts +0 -22
- package/lib/card-group/card.group.component.d.ts +0 -32
- package/lib/checkbox/checkbox-change.d.ts +0 -7
- package/lib/checkbox/checkbox.component.d.ts +0 -100
- package/lib/dropdown/dropdown.component.d.ts +0 -193
- package/lib/dropdown/option/option.component.d.ts +0 -39
- package/lib/dropdown/option-group/option-group.component.d.ts +0 -38
- package/lib/element-load-indicator/element-load-indicator.component.d.ts +0 -38
- package/lib/header/header.component.d.ts +0 -29
- package/lib/hero-banner/content/hero-banner-content.component.d.ts +0 -5
- package/lib/hero-banner/hero-banner.component.d.ts +0 -9
- package/lib/hero-banner/link/hero-banner-link.component.d.ts +0 -6
- package/lib/microsite-logo/microsite-logo.component.d.ts +0 -20
- package/lib/notification/notification.component.d.ts +0 -43
- package/lib/notification-banner/notification-banner.component.d.ts +0 -22
- package/lib/page-load-indicator/page-load-indicator.component.d.ts +0 -55
- package/lib/radio/radio-change.d.ts +0 -7
- package/lib/radio/radio.component.d.ts +0 -119
- package/lib/radio/radio.service.d.ts +0 -7
- package/lib/radio-group/radio-group.component.d.ts +0 -190
- package/lib/skeleton/skeleton-element.component.d.ts +0 -5
- package/lib/skeleton/skeleton-image-content.component.d.ts +0 -5
|
@@ -1,2043 +1,155 @@
|
|
|
1
|
-
import '@abgov/web-components';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { NgModule, CUSTOM_ELEMENTS_SCHEMA, forwardRef, Directive, HostListener } from '@angular/core';
|
|
4
3
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { BehaviorSubject } from 'rxjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A Government of Alberta styled button.
|
|
11
|
-
* selector: button[goa-button], input[type="button"][goa-button], input[type="submit"][goa-button]
|
|
12
|
-
*/
|
|
13
|
-
class GoAButtonComponent {
|
|
14
|
-
constructor() {
|
|
15
|
-
/**
|
|
16
|
-
* The appearance style of the button.
|
|
17
|
-
*/
|
|
18
|
-
this.buttonType = 'primary';
|
|
19
|
-
/**
|
|
20
|
-
* The size of the button, controls font size and padding.
|
|
21
|
-
*/
|
|
22
|
-
this.buttonSize = 'normal';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Adds class goa-button to the host.
|
|
26
|
-
* @ignore
|
|
27
|
-
*/
|
|
28
|
-
get primaryBinding() {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Adds class goa--secondary to the host if the buttonStyle = secondary.
|
|
33
|
-
* @ignore
|
|
34
|
-
*/
|
|
35
|
-
get secondaryBinding() {
|
|
36
|
-
return this.buttonType === 'secondary';
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Adds class goa--tertiary to the host if the buttonStyle = tertiary.
|
|
40
|
-
* @ignore
|
|
41
|
-
*/
|
|
42
|
-
get tertiaryBinding() {
|
|
43
|
-
return this.buttonType === 'tertiary';
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Adds class btn-small to the host if the buttonSize = small.
|
|
47
|
-
* @ignore
|
|
48
|
-
*/
|
|
49
|
-
get smallBinding() {
|
|
50
|
-
return this.buttonSize === 'small';
|
|
51
|
-
}
|
|
52
|
-
/* eslint-disable @angular-eslint/no-empty-lifecycle-method */
|
|
53
|
-
ngOnInit() { }
|
|
54
|
-
}
|
|
55
|
-
GoAButtonComponent.decorators = [
|
|
56
|
-
{ type: Component, args: [{
|
|
57
|
-
selector:
|
|
58
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
59
|
-
'button[goa-button], input[type="button"][goa-button], input[type="submit"][goa-button]',
|
|
60
|
-
template: "<ng-content></ng-content>\n",
|
|
61
|
-
styles: [""]
|
|
62
|
-
},] }
|
|
63
|
-
];
|
|
64
|
-
GoAButtonComponent.ctorParameters = () => [];
|
|
65
|
-
GoAButtonComponent.propDecorators = {
|
|
66
|
-
primaryBinding: [{ type: HostBinding, args: ['class.goa-button',] }],
|
|
67
|
-
secondaryBinding: [{ type: HostBinding, args: ['class.goa--secondary',] }],
|
|
68
|
-
tertiaryBinding: [{ type: HostBinding, args: ['class.goa--tertiary',] }],
|
|
69
|
-
smallBinding: [{ type: HostBinding, args: ['class.btn-small',] }],
|
|
70
|
-
buttonType: [{ type: Input }],
|
|
71
|
-
buttonSize: [{ type: Input }]
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* A logo for a Government of Alberta hosted microsite.
|
|
76
|
-
* selector: goa-microsite-logo
|
|
77
|
-
*/
|
|
78
|
-
class GoAMicrositeLogoComponent {
|
|
79
|
-
constructor() {
|
|
80
|
-
/**
|
|
81
|
-
* The home page URL of the microsite.
|
|
82
|
-
*/
|
|
83
|
-
this.serviceHome = 'https://www.alberta.ca/index.aspx';
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* @ignore
|
|
87
|
-
*/
|
|
88
|
-
ngOnInit() {
|
|
89
|
-
if (this.serviceName === undefined || this.serviceName === null) {
|
|
90
|
-
throw new TypeError(`Input 'serviceName' is required.`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
GoAMicrositeLogoComponent.decorators = [
|
|
95
|
-
{ type: Component, args: [{
|
|
96
|
-
selector: 'goa-microsite-logo',
|
|
97
|
-
template: "<a href=\"{{serviceHome}}\" attr.aria-label=\"{{serviceHome}}\" class=\"microsite-link\">\n <span class=\"image-desktop-tablet\"></span>\n <span class=\"image-mobile\"></span>\n <span class=\"name\">\n {{serviceName}}\n </span>\n</a>\n",
|
|
98
|
-
styles: [""]
|
|
99
|
-
},] }
|
|
100
|
-
];
|
|
101
|
-
GoAMicrositeLogoComponent.ctorParameters = () => [];
|
|
102
|
-
GoAMicrositeLogoComponent.propDecorators = {
|
|
103
|
-
serviceName: [{ type: Input }],
|
|
104
|
-
serviceHome: [{ type: Input }]
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* A header component for a Government of Alberta hosted microsite.
|
|
109
|
-
* selector: goa-header
|
|
110
|
-
*/
|
|
111
|
-
class GoAHeaderComponent {
|
|
112
|
-
// ServiceLevel = this.ServiceLevel;
|
|
113
|
-
constructor() {
|
|
114
|
-
/**
|
|
115
|
-
* The home page URL of the microsite.
|
|
116
|
-
*/
|
|
117
|
-
this.serviceHome = 'https://www.alberta.ca/index.aspx';
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* @ignore
|
|
121
|
-
*/
|
|
122
|
-
ngOnInit() {
|
|
123
|
-
this.checkRequiredProps('serviceLevel', 'serviceName', 'serviceHome');
|
|
124
|
-
}
|
|
125
|
-
serviceLevelCssClass() {
|
|
126
|
-
return `service-level--${this.serviceLevel.toLowerCase()}`;
|
|
127
|
-
}
|
|
128
|
-
serviceLevelFormatted() {
|
|
129
|
-
return this.serviceLevel.toLowerCase();
|
|
130
|
-
}
|
|
131
|
-
checkRequiredProps(...props) {
|
|
132
|
-
props.forEach(prop => {
|
|
133
|
-
if (!this[prop]) {
|
|
134
|
-
throw new TypeError(`Input '${prop}' is required.`);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
GoAHeaderComponent.decorators = [
|
|
140
|
-
{ type: Component, args: [{
|
|
141
|
-
selector: 'goa-header',
|
|
142
|
-
template: "<header class=\"goa-header goa-official-site-header\">\n <div>\n <span class=\"service-level\" [ngClass]=\"serviceLevelCssClass()\">\n {{ serviceLevelFormatted() }}\n </span>\n </div>\n <div\n *ngIf=\"serviceLevel === 'live'; else elseNotLive\"\n class=\"site-text\"\n i18n=\"Alberta.ca official site text on header\"\n >\n An official site of the\n <a href=\"https://www.alberta.ca/index.aspx\" class=\"web-link\"\n >Alberta Government</a\n >\n </div>\n <ng-template #elseNotLive>\n <div class=\"site-text\" i18n=\"Alberta.ca site text on header\">\n This is a new\n <a href=\"https://www.alberta.ca/index.aspx\" class=\"web-link\"\n >Alberta Government</a\n >\n service\n </div>\n </ng-template>\n</header>\n<header class=\"goa-header goa-microsite-header\">\n <goa-microsite-logo\n [serviceName]=\"serviceName\"\n [serviceHome]=\"serviceHome\"\n ></goa-microsite-logo>\n <ng-content></ng-content>\n</header>\n",
|
|
143
|
-
styles: [""]
|
|
144
|
-
},] }
|
|
145
|
-
];
|
|
146
|
-
GoAHeaderComponent.ctorParameters = () => [];
|
|
147
|
-
GoAHeaderComponent.propDecorators = {
|
|
148
|
-
serviceName: [{ type: Input }],
|
|
149
|
-
serviceHome: [{ type: Input }],
|
|
150
|
-
serviceLevel: [{ type: Input }]
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Styles an anchor Design system compliant.
|
|
155
|
-
* selector: a[goa-button]
|
|
156
|
-
* @example <a goa-button linkType='right' href='...'>Text</a>
|
|
157
|
-
*/
|
|
158
|
-
class GoAButtonLinkComponent {
|
|
159
|
-
constructor() {
|
|
160
|
-
/**
|
|
161
|
-
* The type of arrow to use.
|
|
162
|
-
*/
|
|
163
|
-
this.linkType = 'right';
|
|
164
|
-
/**
|
|
165
|
-
* The size of the button, controls font size and padding.
|
|
166
|
-
*/
|
|
167
|
-
this.buttonSize = 'normal';
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Adds class goa-link-button to the host.
|
|
171
|
-
* @ignore
|
|
172
|
-
*/
|
|
173
|
-
get primaryBinding() {
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Adds class right-arrow to the host if the linkType = right.
|
|
178
|
-
* @ignore
|
|
179
|
-
*/
|
|
180
|
-
get rightBinding() {
|
|
181
|
-
return this.linkType === 'right';
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Adds class right-arrow to the host if the linkType = right.
|
|
185
|
-
* @ignore
|
|
186
|
-
*/
|
|
187
|
-
get upBinding() {
|
|
188
|
-
return this.linkType === 'up';
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Adds class btn-small to the host if the buttonSize = small.
|
|
192
|
-
* @ignore
|
|
193
|
-
*/
|
|
194
|
-
get smallBinding() {
|
|
195
|
-
return this.buttonSize === 'small';
|
|
196
|
-
}
|
|
197
|
-
/* eslint-disable @angular-eslint/no-empty-lifecycle-method */
|
|
198
|
-
ngOnInit() { }
|
|
199
|
-
}
|
|
200
|
-
GoAButtonLinkComponent.decorators = [
|
|
201
|
-
{ type: Component, args: [{
|
|
202
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
203
|
-
selector: 'a[goa-button]',
|
|
204
|
-
template: "<span>\n <ng-content></ng-content>\n</span>",
|
|
205
|
-
styles: [""]
|
|
206
|
-
},] }
|
|
207
|
-
];
|
|
208
|
-
GoAButtonLinkComponent.ctorParameters = () => [];
|
|
209
|
-
GoAButtonLinkComponent.propDecorators = {
|
|
210
|
-
primaryBinding: [{ type: HostBinding, args: ['class.goa-link-button',] }],
|
|
211
|
-
rightBinding: [{ type: HostBinding, args: ['class.right-arrow',] }],
|
|
212
|
-
upBinding: [{ type: HostBinding, args: ['class.up-arrow',] }],
|
|
213
|
-
smallBinding: [{ type: HostBinding, args: ['class.btn-small',] }],
|
|
214
|
-
linkType: [{ type: Input }],
|
|
215
|
-
buttonSize: [{ type: Input }]
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Option component with to use with GoADropdown.
|
|
220
|
-
* selector: goa-option
|
|
221
|
-
*/
|
|
222
|
-
class GoAOptionComponent {
|
|
223
|
-
constructor() {
|
|
224
|
-
/**
|
|
225
|
-
* Is the option currently selected
|
|
226
|
-
* @ignore
|
|
227
|
-
*/
|
|
228
|
-
this.selected = false;
|
|
229
|
-
/**
|
|
230
|
-
* Is the option selected by default?
|
|
231
|
-
*/
|
|
232
|
-
this.defaultSelected = false;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Lifecycle hook OnInit
|
|
236
|
-
* @ignore
|
|
237
|
-
*/
|
|
238
|
-
ngOnInit() {
|
|
239
|
-
if (this.id === undefined || this.id === null) {
|
|
240
|
-
throw new TypeError(`Input 'id' is required.`);
|
|
241
|
-
}
|
|
242
|
-
if (this.label === undefined || this.label === null) {
|
|
243
|
-
throw new TypeError(`Input 'label' is required.`);
|
|
244
|
-
}
|
|
245
|
-
this.selected = this.defaultSelected;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
GoAOptionComponent.decorators = [
|
|
249
|
-
{ type: Component, args: [{
|
|
250
|
-
selector: 'goa-option',
|
|
251
|
-
template: "<ng-template #optionTemplate>\n <div class=\"goa-option\">\n <ng-content></ng-content>\n </div>\n</ng-template>",
|
|
252
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
253
|
-
styles: [""]
|
|
254
|
-
},] }
|
|
255
|
-
];
|
|
256
|
-
GoAOptionComponent.ctorParameters = () => [];
|
|
257
|
-
GoAOptionComponent.propDecorators = {
|
|
258
|
-
id: [{ type: Input }],
|
|
259
|
-
value: [{ type: Input }],
|
|
260
|
-
label: [{ type: Input }],
|
|
261
|
-
defaultSelected: [{ type: Input }],
|
|
262
|
-
optionTemplate: [{ type: ViewChild, args: ['optionTemplate',] }]
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Option grouping component with to use with GoADropdown.
|
|
267
|
-
* selector: goa-option-group
|
|
268
|
-
*/
|
|
269
|
-
class GoAOptionGroupComponent {
|
|
270
|
-
constructor(cdr) {
|
|
271
|
-
this.cdr = cdr;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Lifecycle hook OnInit
|
|
275
|
-
* @ignore
|
|
276
|
-
*/
|
|
277
|
-
ngOnInit() {
|
|
278
|
-
if (this.label === undefined || this.label === null || this.label === '') {
|
|
279
|
-
throw new TypeError(`The input 'label' is required.`);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Lifecycle hook AfterViewInit
|
|
284
|
-
* @ignore
|
|
285
|
-
*/
|
|
286
|
-
ngAfterViewInit() {
|
|
287
|
-
this._filteredOptions = [...this.options];
|
|
288
|
-
// The template output cache is populated by child components during render, so tell angular that
|
|
289
|
-
// there have been changes during the render here.
|
|
290
|
-
this.cdr.detectChanges();
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
GoAOptionGroupComponent.decorators = [
|
|
294
|
-
{ type: Component, args: [{
|
|
295
|
-
selector: 'goa-option-group',
|
|
296
|
-
template: "<!--Grab the <option> template from the GoAOption -->\n<ng-template #optionGroupTemplate>\n <div class=\"goa-option-group\">\n {{label}}\n <div class=\"group-options\">\n <ng-container class=\"goa-option\"> \n <ng-template *ngFor=\"let option of _filteredOptions\" [ngTemplateOutlet]=\"option.optionTemplate\"></ng-template>\n </ng-container>\n </div>\n </div>\n</ng-template>",
|
|
297
|
-
styles: [".goa-option-group{font-weight:bold}.goa-option-group .group-options{padding-left:1em;font-weight:normal}\n"]
|
|
298
|
-
},] }
|
|
299
|
-
];
|
|
300
|
-
GoAOptionGroupComponent.ctorParameters = () => [
|
|
301
|
-
{ type: ChangeDetectorRef }
|
|
302
|
-
];
|
|
303
|
-
GoAOptionGroupComponent.propDecorators = {
|
|
304
|
-
label: [{ type: Input }],
|
|
305
|
-
options: [{ type: ContentChildren, args: [GoAOptionComponent, { descendants: true },] }],
|
|
306
|
-
optionGroupTemplate: [{ type: ViewChild, args: ['optionGroupTemplate',] }]
|
|
307
|
-
};
|
|
4
|
+
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import '@abgov/web-components';
|
|
308
6
|
|
|
309
|
-
|
|
310
|
-
* A dropdown component with Government of Alberta styling.
|
|
311
|
-
* selector: goa-dropdown
|
|
312
|
-
*/
|
|
313
|
-
class GoADropdownComponent {
|
|
314
|
-
constructor(cdr) {
|
|
315
|
-
this.cdr = cdr;
|
|
316
|
-
/**
|
|
317
|
-
* boolean for if the dropdown is open.
|
|
318
|
-
* @ignore
|
|
319
|
-
*/
|
|
320
|
-
this._isOpen = false;
|
|
321
|
-
/**
|
|
322
|
-
* Is the required error tripped?
|
|
323
|
-
* @ignore
|
|
324
|
-
*/
|
|
325
|
-
this._requiredError = false;
|
|
326
|
-
/**
|
|
327
|
-
* This position config ensures that the top "start" corner of the overlay
|
|
328
|
-
* is aligned with with the bottom "start" of the origin by default (overlapping
|
|
329
|
-
* the trigger completely). If the panel cannot fit below the trigger, it
|
|
330
|
-
* will fall back to a position above the trigger.
|
|
331
|
-
* @ignore
|
|
332
|
-
*/
|
|
333
|
-
this._positions = [
|
|
334
|
-
{
|
|
335
|
-
originX: 'start',
|
|
336
|
-
originY: 'bottom',
|
|
337
|
-
overlayX: 'start',
|
|
338
|
-
overlayY: 'top',
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
originX: 'start',
|
|
342
|
-
originY: 'top',
|
|
343
|
-
overlayX: 'start',
|
|
344
|
-
overlayY: 'bottom',
|
|
345
|
-
},
|
|
346
|
-
];
|
|
347
|
-
/**
|
|
348
|
-
* All options currently matching filter including groups.
|
|
349
|
-
* @ignore
|
|
350
|
-
*/
|
|
351
|
-
this._allFilteredOptions = [];
|
|
352
|
-
/**
|
|
353
|
-
* Whats the mode for typeahead.
|
|
354
|
-
*/
|
|
355
|
-
this.typeaheadMode = 'none';
|
|
356
|
-
/**
|
|
357
|
-
* Is the select disabled.
|
|
358
|
-
*/
|
|
359
|
-
this.disabled = false;
|
|
360
|
-
/**
|
|
361
|
-
* @ignore
|
|
362
|
-
*/
|
|
363
|
-
this._multiple = false;
|
|
364
|
-
/**
|
|
365
|
-
* @ignore
|
|
366
|
-
*/
|
|
367
|
-
this._required = false;
|
|
368
|
-
/**
|
|
369
|
-
* Event emitted containing the value field of all selected options when the selection changes.
|
|
370
|
-
*/
|
|
371
|
-
this.selectionChange = new EventEmitter();
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Update the selected options, select the options with the given ids
|
|
375
|
-
*/
|
|
376
|
-
set selectedIds(ids) {
|
|
377
|
-
if (this.allOptions === undefined) {
|
|
378
|
-
// aren't initialized yet, return
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
if (ids === null || ids === undefined) {
|
|
382
|
-
ids = [];
|
|
383
|
-
}
|
|
384
|
-
if (ids.length > 1 && this.multiple === false) {
|
|
385
|
-
throw new Error('Cannot select multiple options when the dropdown has multiple set to false.');
|
|
386
|
-
}
|
|
387
|
-
const selectedOptions = [];
|
|
388
|
-
this.allOptions.forEach(option => {
|
|
389
|
-
if (ids.includes(option.id)) {
|
|
390
|
-
option.selected = true;
|
|
391
|
-
selectedOptions.push(option);
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
option.selected = false;
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
this.selectionChanged(selectedOptions, true);
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Is multiple selection?
|
|
401
|
-
*/
|
|
402
|
-
set multiple(value) {
|
|
403
|
-
this._multiple = value;
|
|
404
|
-
if (this._multiple === false) {
|
|
405
|
-
// If we have changed from multiple to no multiple then deselect everything.
|
|
406
|
-
this.selectedItems.forEach(option => {
|
|
407
|
-
option.selected = false;
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
get multiple() {
|
|
412
|
-
return this._multiple;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Is a selection required?
|
|
416
|
-
*/
|
|
417
|
-
set required(value) {
|
|
418
|
-
this._required = value;
|
|
419
|
-
this._requiredError = this.selectedItems.length === 0 && this._required === true;
|
|
420
|
-
}
|
|
421
|
-
get required() {
|
|
422
|
-
return this._required;
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Lifecycle hook OnInit
|
|
426
|
-
* @ignore
|
|
427
|
-
*/
|
|
428
|
-
/* eslint-disable @angular-eslint/no-empty-lifecycle-method */
|
|
429
|
-
ngOnInit() { }
|
|
430
|
-
/**
|
|
431
|
-
* Lifecycle hook AfterViewInit
|
|
432
|
-
* @ignore
|
|
433
|
-
*/
|
|
434
|
-
ngAfterViewInit() {
|
|
435
|
-
this._triggerRect = this.textInput.nativeElement.getBoundingClientRect();
|
|
436
|
-
this._filteredOptions = [...this.options];
|
|
437
|
-
this._allFilteredOptions = [...this.allOptions];
|
|
438
|
-
if (this.selectedItems.length > 0) {
|
|
439
|
-
this.setTextInput(this.selectedItems[0].label);
|
|
440
|
-
}
|
|
441
|
-
// The template output cache is populated by child components during render,
|
|
442
|
-
// so tell angular that there have been changes during the render here.
|
|
443
|
-
this.cdr.detectChanges();
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Called when user updates the text in the searchbox.
|
|
447
|
-
* @param text The text of the input
|
|
448
|
-
* @ignore
|
|
449
|
-
*/
|
|
450
|
-
onFilterChange(text) {
|
|
451
|
-
// open the dropdown if it is not already
|
|
452
|
-
if (!this._isOpen === true) {
|
|
453
|
-
this._isOpen = true;
|
|
454
|
-
}
|
|
455
|
-
this.filterOptions(text);
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Handler for keyboard events when menu is open.
|
|
459
|
-
* @param event keyboard event
|
|
460
|
-
* @ignore
|
|
461
|
-
*/
|
|
462
|
-
overlayKeydown(event) {
|
|
463
|
-
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
|
|
464
|
-
this.optionClicked(this._activeOption);
|
|
465
|
-
}
|
|
466
|
-
else if (event.code === 'ArrowDown') {
|
|
467
|
-
this._activeIndex = (this._activeIndex + 1) % this._allFilteredOptions.length;
|
|
468
|
-
this._activeOption = this._allFilteredOptions[this._activeIndex];
|
|
469
|
-
}
|
|
470
|
-
else if (event.code === 'ArrowUp') {
|
|
471
|
-
if (this._activeIndex > 0) {
|
|
472
|
-
this._activeIndex = this._activeIndex - 1;
|
|
473
|
-
this._activeOption = this._allFilteredOptions[this._activeIndex];
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Sets the active option. Active option is the option that when enter is pressed is selected.
|
|
479
|
-
* @param option The option to make the active option
|
|
480
|
-
* @ignore
|
|
481
|
-
*/
|
|
482
|
-
setActiveOption(option) {
|
|
483
|
-
this._activeOption = option;
|
|
484
|
-
this._activeIndex = this._allFilteredOptions.findIndex((filteredOption) => filteredOption.id === option.id);
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Handler for when the input is clicked.
|
|
488
|
-
* @ignore
|
|
489
|
-
*/
|
|
490
|
-
inputClicked() {
|
|
491
|
-
if (this.disabled === false) {
|
|
492
|
-
this._isOpen = !this._isOpen;
|
|
493
|
-
// set the active option to the first in the list
|
|
494
|
-
if (this._allFilteredOptions.length > 0) {
|
|
495
|
-
this._activeOption = this._allFilteredOptions[0];
|
|
496
|
-
this._activeIndex = 0;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Handler for when descendant an option is clicked.
|
|
502
|
-
* @ignore
|
|
503
|
-
*/
|
|
504
|
-
optionClicked(option) {
|
|
505
|
-
let selectedOptions = [];
|
|
506
|
-
if (this.multiple === true) {
|
|
507
|
-
option.selected = !option.selected;
|
|
508
|
-
selectedOptions = this.selectedItems;
|
|
509
|
-
}
|
|
510
|
-
else {
|
|
511
|
-
option.selected = !option.selected;
|
|
512
|
-
this.selectedItems.forEach((o) => {
|
|
513
|
-
if (option.id !== o.id) {
|
|
514
|
-
// change all options that weren't selected to false without notifying change
|
|
515
|
-
o.selected = false;
|
|
516
|
-
}
|
|
517
|
-
selectedOptions = [option];
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
this.selectionChanged(selectedOptions, true);
|
|
521
|
-
if (this.multiple === false) {
|
|
522
|
-
// close the dropdown if we are in single selection mode
|
|
523
|
-
this._isOpen = false;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* Update view when selection changes
|
|
528
|
-
* @param options
|
|
529
|
-
* @ignore
|
|
530
|
-
*/
|
|
531
|
-
selectionChanged(options, emitEvent) {
|
|
532
|
-
if (options.length > 0) {
|
|
533
|
-
const selectedOptions = options.map(o => o.label).join(', ');
|
|
534
|
-
this._requiredError = false;
|
|
535
|
-
this.setTextInput(selectedOptions);
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
this._requiredError = this.required;
|
|
539
|
-
this.setTextInput('');
|
|
540
|
-
}
|
|
541
|
-
if (emitEvent === true) {
|
|
542
|
-
this.emitChange(options);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* Emit selection change
|
|
547
|
-
* @ignore
|
|
548
|
-
*/
|
|
549
|
-
emitChange(options) {
|
|
550
|
-
const values = options.map((option) => option.value);
|
|
551
|
-
this.selectionChange.emit(values);
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Gets all the currently selected options
|
|
555
|
-
* @ignore
|
|
556
|
-
*/
|
|
557
|
-
get selectedItems() {
|
|
558
|
-
if (this.allOptions === undefined) {
|
|
559
|
-
return [];
|
|
560
|
-
}
|
|
561
|
-
return [...this.allOptions.filter((option) => option.selected === true)];
|
|
562
|
-
}
|
|
563
|
-
/**
|
|
564
|
-
* Set the text of the input.
|
|
565
|
-
* @param value The value to set
|
|
566
|
-
* @ignore
|
|
567
|
-
*/
|
|
568
|
-
setTextInput(value) {
|
|
569
|
-
if (this.textInput) {
|
|
570
|
-
this.textInput.nativeElement.value = value;
|
|
571
|
-
// Exact matches show whole list?
|
|
572
|
-
this.filterOptions('');
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Update the filtered options with the passed in filter text.
|
|
577
|
-
* @param filterText The text to filter by
|
|
578
|
-
* @ignore
|
|
579
|
-
*/
|
|
580
|
-
filterOptions(filterText) {
|
|
581
|
-
this.optionGroups.forEach(group => {
|
|
582
|
-
group._filteredOptions = group.options.filter(this.typeaheadFilter.bind(this, filterText, this.typeaheadMode));
|
|
583
|
-
});
|
|
584
|
-
this._filteredOptions = this.options.filter(this.typeaheadFilter.bind(this, filterText, this.typeaheadMode));
|
|
585
|
-
this._allFilteredOptions = this.allOptions.filter(this.typeaheadFilter.bind(this, filterText, this.typeaheadMode));
|
|
586
|
-
// The filters have changed so update the active option incase it has been filtered out.
|
|
587
|
-
this._activeOption = this._allFilteredOptions[this._activeIndex % this._allFilteredOptions.length];
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Filter for typeahead with logic for what mode we are in.
|
|
591
|
-
* @param option
|
|
592
|
-
* @ignore
|
|
593
|
-
*/
|
|
594
|
-
typeaheadFilter(filterText, typeaheadMode, option) {
|
|
595
|
-
if (typeaheadMode === 'none' || this.typeaheadMode === undefined) {
|
|
596
|
-
return true;
|
|
597
|
-
}
|
|
598
|
-
if (typeaheadMode === 'startsWith') {
|
|
599
|
-
return option.label.toLocaleLowerCase().startsWith(filterText.toLocaleLowerCase());
|
|
600
|
-
}
|
|
601
|
-
if (typeaheadMode === 'contains') {
|
|
602
|
-
return option.label.toLocaleLowerCase().includes(filterText.toLocaleLowerCase());
|
|
603
|
-
}
|
|
604
|
-
}
|
|
7
|
+
class AngularComponentsModule {
|
|
605
8
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
]
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
];
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
required: [{ type: Input }],
|
|
625
|
-
textInput: [{ type: ViewChild, args: ['textInput',] }],
|
|
626
|
-
allOptions: [{ type: ContentChildren, args: [GoAOptionComponent, { descendants: true },] }],
|
|
627
|
-
options: [{ type: ContentChildren, args: [GoAOptionComponent, { descendants: false },] }],
|
|
628
|
-
optionGroups: [{ type: ContentChildren, args: [GoAOptionGroupComponent, { descendants: false },] }],
|
|
629
|
-
selectionChange: [{ type: Output }]
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
const GOA_CHECKBOX_CONTROL_VALUE_ACCESSOR = {
|
|
633
|
-
provide: NG_VALUE_ACCESSOR,
|
|
634
|
-
useExisting: forwardRef(() => GoACheckboxComponent),
|
|
635
|
-
multi: true
|
|
636
|
-
};
|
|
637
|
-
/**
|
|
638
|
-
* Checkbox component with Government of Alberta styling.
|
|
639
|
-
* selector: goa-checkbox
|
|
640
|
-
*/
|
|
641
|
-
class GoACheckboxComponent {
|
|
642
|
-
constructor(_changeDetectorRef) {
|
|
643
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
644
|
-
/**
|
|
645
|
-
* @ignore
|
|
646
|
-
*/
|
|
647
|
-
this._indeterminate = false;
|
|
648
|
-
/**
|
|
649
|
-
* The position to display the label/text for the checbox. Valid values are before and after.
|
|
650
|
-
*/
|
|
651
|
-
this.labelPosition = 'after';
|
|
652
|
-
/**
|
|
653
|
-
* Event emitted containing the source checkbox, and whether or not it is checked.
|
|
654
|
-
*/
|
|
655
|
-
this.selectionChange = new EventEmitter();
|
|
656
|
-
/**
|
|
657
|
-
* @ignore
|
|
658
|
-
*/
|
|
659
|
-
this._propagateChange = (_) => { };
|
|
660
|
-
this.uniqueId = `goa-checkbox-${GoACheckboxComponent.idNum++}`;
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* Boolean indicating whether or not the checkbox should display as indeterminate
|
|
664
|
-
* (i.e. it has associated 'child' checkboxes, some of which are selected).
|
|
665
|
-
*/
|
|
666
|
-
get indeterminate() { return this._indeterminate; }
|
|
667
|
-
set indeterminate(value) {
|
|
668
|
-
// only do something if value has changed from current
|
|
669
|
-
if (value !== this.indeterminate) {
|
|
670
|
-
this._indeterminate = value;
|
|
671
|
-
// can't be indeterminate and checked, so clear checked
|
|
672
|
-
if (this._indeterminate) {
|
|
673
|
-
this.checked = false;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
9
|
+
AngularComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
+
AngularComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, imports: [CommonModule, FormsModule, ReactiveFormsModule] });
|
|
11
|
+
AngularComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, imports: [[CommonModule, FormsModule, ReactiveFormsModule]] });
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, decorators: [{
|
|
13
|
+
type: NgModule,
|
|
14
|
+
args: [{
|
|
15
|
+
imports: [CommonModule, FormsModule, ReactiveFormsModule],
|
|
16
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
+
class ValueDirective {
|
|
22
|
+
constructor(elementRef) {
|
|
23
|
+
this.elementRef = elementRef;
|
|
24
|
+
this._value = "";
|
|
25
|
+
this.onChange = () => { };
|
|
26
|
+
this.onTouched = () => { };
|
|
676
27
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
* @ignore
|
|
680
|
-
*/
|
|
681
|
-
hasError() {
|
|
682
|
-
return this.required && !this.checked;
|
|
28
|
+
get value() {
|
|
29
|
+
return this._value;
|
|
683
30
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if ((value !== undefined) && (value !== null)) {
|
|
691
|
-
this.checked = value;
|
|
692
|
-
this._changeDetectorRef.detectChanges();
|
|
31
|
+
set value(val) {
|
|
32
|
+
if (val !== this._value) {
|
|
33
|
+
this._value = val;
|
|
34
|
+
this.onChange(this._value);
|
|
35
|
+
this.onTouched();
|
|
36
|
+
this.elementRef.nativeElement.value = val;
|
|
693
37
|
}
|
|
694
38
|
}
|
|
695
|
-
/**
|
|
696
|
-
* Implemented as part of ControlValueAccessor.
|
|
697
|
-
* @param fn The function to call on change. Provided by ControlValueAccessor
|
|
698
|
-
* @ignore
|
|
699
|
-
*/
|
|
700
|
-
registerOnChange(fn) {
|
|
701
|
-
this._propagateChange = fn;
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Implemented as part of ControlValueAccessor.
|
|
705
|
-
* @param fn The function to call on touch. Provided by ControlValueAccessor
|
|
706
|
-
* @ignore
|
|
707
|
-
*/
|
|
708
|
-
registerOnTouched(fn) {
|
|
709
|
-
this._onTouchedCallback = fn;
|
|
710
|
-
}
|
|
711
|
-
;
|
|
712
|
-
/**
|
|
713
|
-
* Toggles the checked value of the checkbox
|
|
714
|
-
* @ignore
|
|
715
|
-
*/
|
|
716
|
-
toggle() {
|
|
717
|
-
this.checked = !this.checked;
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* User interaction event on click of the checkbox or its label to indicate toggling of the current checked status.
|
|
721
|
-
* Emits selectionChange to parent components.
|
|
722
|
-
* @ignore
|
|
723
|
-
*/
|
|
724
|
-
onChange(event) {
|
|
725
|
-
event.stopPropagation();
|
|
726
|
-
this.toggle();
|
|
727
|
-
// user manually clicking overrides indeterminate and sets it to false
|
|
728
|
-
// this is because if they click and set to checked/unchecked, all 'child' checkboxes should get set to
|
|
729
|
-
// checked/unchecked (by user routine, not here), so this checkbox is no longer indeterminate
|
|
730
|
-
this.indeterminate = false;
|
|
731
|
-
const checkBoxChange = {
|
|
732
|
-
source: this,
|
|
733
|
-
checked: this.checked
|
|
734
|
-
};
|
|
735
|
-
this._propagateChange(this.checked);
|
|
736
|
-
this.selectionChange.emit(checkBoxChange);
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* @ignore
|
|
741
|
-
*/
|
|
742
|
-
GoACheckboxComponent.idNum = 0;
|
|
743
|
-
GoACheckboxComponent.decorators = [
|
|
744
|
-
{ type: Component, args: [{
|
|
745
|
-
selector: 'goa-checkbox',
|
|
746
|
-
template: "\n<div class=\"goa-checkbox\" [ngClass]=\"{'goa-checkbox-disabled': disabled, 'has-error': hasError(), 'goa-checkbox-label-before': labelPosition === 'before'}\">\n <label class=\"goa-checkbox-layout\" [attr.for]=\"uniqueId\">\n <div class=\"goa-checkbox-container\"\n [ngClass]=\"{'goa-checkbox-selected': checked, 'goa-checkbox-indeterminate': indeterminate}\">\n <input type=\"checkbox\"\n [id]=\"uniqueId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [attr.value]=\"value\"\n (change)=\"onChange($event)\"\n />\n <svg *ngIf=\"checked\" id='checkmark' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 12.18\" class=\"goa-checkmark\">\n <path d=\"M5.09,9.64,1.27,5.82,0,7.09l5.09,5.09L16,1.27,14.73,0Z\"/>\n </svg>\n <svg *ngIf=\"indeterminate\" id='dashmark' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 15 2\" class=\"goa-indeterminate\">\n <rect width=\"15\" height=\"2\"/>\n </svg>\n </div>\n <div class=\"goa-checkbox-label\">\n <ng-content></ng-content>\n </div>\n </label>\n</div>\n",
|
|
747
|
-
//register our custom ControlValueAccessor with angular DI system so angular knows how to get instance of it for ngModel binding
|
|
748
|
-
providers: [GOA_CHECKBOX_CONTROL_VALUE_ACCESSOR],
|
|
749
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
750
|
-
styles: [""]
|
|
751
|
-
},] }
|
|
752
|
-
];
|
|
753
|
-
GoACheckboxComponent.ctorParameters = () => [
|
|
754
|
-
{ type: ChangeDetectorRef }
|
|
755
|
-
];
|
|
756
|
-
GoACheckboxComponent.propDecorators = {
|
|
757
|
-
value: [{ type: Input }],
|
|
758
|
-
checked: [{ type: Input }],
|
|
759
|
-
disabled: [{ type: Input }],
|
|
760
|
-
required: [{ type: Input }],
|
|
761
|
-
indeterminate: [{ type: Input }],
|
|
762
|
-
labelPosition: [{ type: Input }],
|
|
763
|
-
selectionChange: [{ type: Output }]
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
class GoARadioChange {
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
class GoARadioService {
|
|
770
|
-
constructor() {
|
|
771
|
-
this.radioChangeMessage = new BehaviorSubject(new GoARadioChange());
|
|
772
|
-
}
|
|
773
|
-
selectRadio(radioChange) {
|
|
774
|
-
this.radioChangeMessage.next(radioChange);
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
GoARadioService.ɵprov = i0.ɵɵdefineInjectable({ factory: function GoARadioService_Factory() { return new GoARadioService(); }, token: GoARadioService, providedIn: "root" });
|
|
778
|
-
GoARadioService.decorators = [
|
|
779
|
-
{ type: Injectable, args: [{
|
|
780
|
-
providedIn: 'root',
|
|
781
|
-
},] }
|
|
782
|
-
];
|
|
783
|
-
GoARadioService.ctorParameters = () => [];
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
* Control value accessor to use for the component's provider
|
|
787
|
-
* @ignore
|
|
788
|
-
*/
|
|
789
|
-
const GOA_RADIO_CONTROL_VALUE_ACCESSOR = {
|
|
790
|
-
provide: NG_VALUE_ACCESSOR,
|
|
791
|
-
useExisting: forwardRef(() => GoARadioComponent),
|
|
792
|
-
multi: true
|
|
793
|
-
};
|
|
794
|
-
/**
|
|
795
|
-
* Radiobutton component with Government of Alberta styling.
|
|
796
|
-
*/
|
|
797
|
-
class GoARadioComponent {
|
|
798
|
-
constructor(_changeDetector, _radioService) {
|
|
799
|
-
this._changeDetector = _changeDetector;
|
|
800
|
-
this._radioService = _radioService;
|
|
801
|
-
/**
|
|
802
|
-
* The position to display the label/text for the radiobutton. Valid values are before and after.
|
|
803
|
-
*/
|
|
804
|
-
this.labelPosition = 'after';
|
|
805
|
-
/**
|
|
806
|
-
* Event emitted containing the source radiobutton, and whether or not it is checked.
|
|
807
|
-
*/
|
|
808
|
-
this.selectionChange = new EventEmitter();
|
|
809
|
-
/**
|
|
810
|
-
* @ignore
|
|
811
|
-
*/
|
|
812
|
-
this._propagateChange = (_) => { };
|
|
813
|
-
this.uniqueId = `goa-radiobutton-${GoARadioComponent.idNum++}`;
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* Lifecycle hook OnInit. Used to subscribe to radio change messages from the radioService in order to know whether or not
|
|
817
|
-
* this radio should be checked or not.
|
|
818
|
-
* @ignore
|
|
819
|
-
*/
|
|
820
|
-
ngOnInit() {
|
|
821
|
-
this.radioServiceSubscription = this._radioService.radioChangeMessage.subscribe(rcm => {
|
|
822
|
-
if (rcm && rcm.source && rcm.source.name === this.name && rcm.source.uniqueId !== this.uniqueId) {
|
|
823
|
-
this.checked = false;
|
|
824
|
-
this._changeDetector.detectChanges();
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
/**
|
|
829
|
-
* Lifecycle hook OnDestroy. Used to unsubscribe from the radio change messages.
|
|
830
|
-
* @ignore
|
|
831
|
-
*/
|
|
832
|
-
ngOnDestroy() {
|
|
833
|
-
this.radioServiceSubscription.unsubscribe();
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Boolean indicating if the radiobutton is required and not checked
|
|
837
|
-
* @ignore
|
|
838
|
-
*/
|
|
839
|
-
hasError() {
|
|
840
|
-
return this.required && !this.checked;
|
|
841
|
-
}
|
|
842
|
-
/**
|
|
843
|
-
* Marks the radio button as needing checking for change detection.
|
|
844
|
-
* This method is exposed because the parent radio group will directly
|
|
845
|
-
* update bound properties of the radio button.
|
|
846
|
-
*/
|
|
847
|
-
markForCheck() {
|
|
848
|
-
// When group value changes, the button will not be notified. Use `markForCheck` to explicitly
|
|
849
|
-
// update radio button's status
|
|
850
|
-
this._changeDetector.markForCheck();
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* Implemented as part of ControlValueAccessor.
|
|
854
|
-
* @param value The model bound property, i.e. the value of checked
|
|
855
|
-
* @ignore
|
|
856
|
-
*/
|
|
857
39
|
writeValue(value) {
|
|
858
|
-
if (
|
|
859
|
-
this.
|
|
860
|
-
this._changeDetector.detectChanges();
|
|
40
|
+
if (value) {
|
|
41
|
+
this.value = value;
|
|
861
42
|
}
|
|
862
43
|
}
|
|
863
|
-
/**
|
|
864
|
-
* Implemented as part of ControlValueAccessor.
|
|
865
|
-
* @param fn The function to call on change. Provided by ControlValueAccessor
|
|
866
|
-
* @ignore
|
|
867
|
-
*/
|
|
868
44
|
registerOnChange(fn) {
|
|
869
|
-
this.
|
|
45
|
+
this.onChange = fn;
|
|
870
46
|
}
|
|
871
|
-
/**
|
|
872
|
-
* Implemented as part of ControlValueAccessor.
|
|
873
|
-
* @param fn The function to call on touch. Provided by ControlValueAccessor
|
|
874
|
-
* @ignore
|
|
875
|
-
*/
|
|
876
47
|
registerOnTouched(fn) {
|
|
877
|
-
this.
|
|
48
|
+
this.onTouched = fn;
|
|
878
49
|
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
* User interaction event on click of the radiobutton or its label to indicate toggling of the current checked status.
|
|
882
|
-
* Emits selectionChange to parent components.
|
|
883
|
-
* @ignore
|
|
884
|
-
*/
|
|
885
|
-
onClick() {
|
|
886
|
-
// flip the checked state of this radio
|
|
887
|
-
this.checked = !this.checked;
|
|
888
|
-
// emit radio change event for those interested
|
|
889
|
-
const radioChange = {
|
|
890
|
-
source: this,
|
|
891
|
-
checked: this.checked
|
|
892
|
-
};
|
|
893
|
-
this._propagateChange(this.checked);
|
|
894
|
-
this.selectionChange.emit(radioChange);
|
|
895
|
-
// notify other radios in group/with same name via radio service so they know to flip their states to not checked
|
|
896
|
-
this._radioService.selectRadio(radioChange);
|
|
50
|
+
listenForValueChange(value) {
|
|
51
|
+
this.value = value;
|
|
897
52
|
}
|
|
898
53
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
]
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
* Control value accessor to use for the component's provider
|
|
930
|
-
* @ignore
|
|
931
|
-
*/
|
|
932
|
-
const GOA_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {
|
|
933
|
-
provide: NG_VALUE_ACCESSOR,
|
|
934
|
-
useExisting: forwardRef(() => GoARadioGroupComponent),
|
|
935
|
-
multi: true
|
|
936
|
-
};
|
|
937
|
-
/**
|
|
938
|
-
* Injection token that can be used to inject instances of `GoARadioGroupComponent`. It serves as
|
|
939
|
-
* alternative token to the actual `GoARadioGroupComponent` class which could cause unnecessary
|
|
940
|
-
* retention of the class and its component metadata.
|
|
941
|
-
* @ignore
|
|
942
|
-
*/
|
|
943
|
-
const GOA_RADIO_GROUP = new InjectionToken('GoARadioGroup');
|
|
944
|
-
/**
|
|
945
|
-
* Radiobutton group component with Government of Alberta styling. Used to group a set of related radio buttons.
|
|
946
|
-
*/
|
|
947
|
-
class GoARadioGroupComponent {
|
|
948
|
-
constructor(_changeDetector, _radioService) {
|
|
949
|
-
this._changeDetector = _changeDetector;
|
|
950
|
-
this._radioService = _radioService;
|
|
951
|
-
/**
|
|
952
|
-
* @ignore
|
|
953
|
-
*/
|
|
954
|
-
this._name = `goa-radio-group-${GoARadioGroupComponent.idNum++}`;
|
|
955
|
-
/**
|
|
956
|
-
* @ignore
|
|
957
|
-
*/
|
|
958
|
-
this._value = null;
|
|
959
|
-
/**
|
|
960
|
-
* @ignore
|
|
961
|
-
*/
|
|
962
|
-
this._labelPosition = 'after';
|
|
963
|
-
/**
|
|
964
|
-
* The error message to display when the radio group selection is required and nothing has been selected
|
|
965
|
-
*/
|
|
966
|
-
this.requiredErrorMessage = 'Please select one of the provided options.';
|
|
967
|
-
/**
|
|
968
|
-
* Event emitted containing the source radiobutton, and whether or not it is checked.
|
|
969
|
-
*/
|
|
970
|
-
this.selectionChange = new EventEmitter();
|
|
971
|
-
/**
|
|
972
|
-
* @ignore
|
|
973
|
-
*/
|
|
974
|
-
this._propagateChange = (_) => { };
|
|
975
|
-
this.uniqueId = `goa-radiobutton-group-${GoARadioGroupComponent.idNum++}`;
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* Indicates the "group" or set of radios this radio belongs to.
|
|
979
|
-
*/
|
|
980
|
-
get name() { return this._name; }
|
|
981
|
-
set name(value) {
|
|
982
|
-
this._name = value;
|
|
983
|
-
this._updateRadioButtonNames();
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* Value/unique identifier for the object the radiobutton represents.
|
|
987
|
-
*/
|
|
988
|
-
get value() { return this._value; }
|
|
989
|
-
set value(newValue) {
|
|
990
|
-
if (this._value !== newValue) {
|
|
991
|
-
// Set this before proceeding to ensure no circular loop occurs with selection.
|
|
992
|
-
this._value = newValue;
|
|
993
|
-
this._updateSelectedRadioFromValue();
|
|
994
|
-
this._setSelectedRadioToChecked();
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
/**
|
|
998
|
-
* The currently selected radio.
|
|
999
|
-
*/
|
|
1000
|
-
get selected() { return this._selected; }
|
|
1001
|
-
set selected(selected) {
|
|
1002
|
-
this._selected = selected;
|
|
1003
|
-
this.value = selected ? selected.value : null;
|
|
1004
|
-
this._setSelectedRadioToChecked();
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* Boolean indicating whether or not the radiobutton is disabled.
|
|
1008
|
-
*/
|
|
1009
|
-
get disabled() { return this._disabled; }
|
|
1010
|
-
set disabled(value) {
|
|
1011
|
-
this._disabled = value;
|
|
1012
|
-
this._updateRadioButtonDisabled();
|
|
1013
|
-
}
|
|
1014
|
-
/**
|
|
1015
|
-
* Boolean indicating whether or not the radiobutton is required.
|
|
1016
|
-
*/
|
|
1017
|
-
get required() { return this._required; }
|
|
1018
|
-
set required(value) {
|
|
1019
|
-
this._required = value;
|
|
1020
|
-
this._updateRadioButtonRequired();
|
|
1021
|
-
}
|
|
1022
|
-
/**
|
|
1023
|
-
* The position to display the label/text for the radiobutton. Valid values are before and after.
|
|
1024
|
-
*/
|
|
1025
|
-
get labelPosition() {
|
|
1026
|
-
return this._labelPosition;
|
|
1027
|
-
}
|
|
1028
|
-
set labelPosition(position) {
|
|
1029
|
-
this._labelPosition = position === 'before' ? 'before' : 'after';
|
|
1030
|
-
this._updateRadioButtonLabelPosition();
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Lifecycle hook AfterContentInit. Used to set properties on child radios based on the radio group's properties.
|
|
1034
|
-
* @ignore
|
|
1035
|
-
*/
|
|
1036
|
-
ngAfterContentInit() {
|
|
1037
|
-
this._updateRadioButtonNames();
|
|
1038
|
-
this._updateRadioButtonDisabled();
|
|
1039
|
-
this._updateRadioButtonRequired();
|
|
1040
|
-
this._updateRadioButtonLabelPosition();
|
|
1041
|
-
this._updateSelectedRadioFromValue();
|
|
1042
|
-
}
|
|
1043
|
-
/**
|
|
1044
|
-
* Lifecycle hook OnInit. Used to subscribe to radio change messages from the radioService in order to set the 'selected' property
|
|
1045
|
-
* of the radio group based on which radio was selected
|
|
1046
|
-
* @ignore
|
|
1047
|
-
*/
|
|
1048
|
-
ngOnInit() {
|
|
1049
|
-
this.radioServiceSubscription = this._radioService.radioChangeMessage.subscribe(rcm => {
|
|
1050
|
-
if (rcm && rcm.source && rcm.source.name === this.name && rcm.checked) {
|
|
1051
|
-
this.selected = this._radios.find(r => r.uniqueId === rcm.source.uniqueId);
|
|
1052
|
-
this.selectionChange.emit(rcm);
|
|
1053
|
-
}
|
|
1054
|
-
});
|
|
1055
|
-
}
|
|
1056
|
-
/**
|
|
1057
|
-
* Lifecycle hook OnDestroy. Used to unsubscribe from the radio change messages.
|
|
1058
|
-
* @ignore
|
|
1059
|
-
*/
|
|
1060
|
-
ngOnDestroy() {
|
|
1061
|
-
this.radioServiceSubscription.unsubscribe();
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Updates the `selected` radio button from the internal _value state.
|
|
1065
|
-
*/
|
|
1066
|
-
_updateSelectedRadioFromValue() {
|
|
1067
|
-
// If the value already matches the selected radio, do nothing.
|
|
1068
|
-
const isAlreadySelected = this._selected !== undefined && this._selected !== null && this._selected.value === this._value;
|
|
1069
|
-
// need to wrap in setTimeout because _radios hasnt resolved yet when Input setter fires, need to get to next cycle in page lifecycle
|
|
1070
|
-
setTimeout(() => {
|
|
1071
|
-
if (this._radios && !isAlreadySelected) {
|
|
1072
|
-
this._selected = null;
|
|
1073
|
-
this._radios.forEach(radio => {
|
|
1074
|
-
radio.checked = this.value === radio.value;
|
|
1075
|
-
if (radio.checked) {
|
|
1076
|
-
this._selected = radio;
|
|
1077
|
-
}
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
/**
|
|
1083
|
-
* Sets the selected radio to checked if it is not already checked
|
|
1084
|
-
*/
|
|
1085
|
-
_setSelectedRadioToChecked() {
|
|
1086
|
-
if (this.selected && !this.selected.checked) {
|
|
1087
|
-
this.selected.checked = true;
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
/**
|
|
1091
|
-
* Updates the 'name' property of the child radio buttons to match that of the group so they all function together
|
|
1092
|
-
*/
|
|
1093
|
-
_updateRadioButtonNames() {
|
|
1094
|
-
if (this._radios) {
|
|
1095
|
-
this._radios.forEach(radio => {
|
|
1096
|
-
radio.name = this.name;
|
|
1097
|
-
radio.markForCheck();
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
/**
|
|
1102
|
-
* Updates the 'disabled' property of the child radio buttons to match the disabled state of the radio group
|
|
1103
|
-
*/
|
|
1104
|
-
_updateRadioButtonDisabled() {
|
|
1105
|
-
if (this._radios) {
|
|
1106
|
-
this._radios.forEach(radio => {
|
|
1107
|
-
radio.required = this._required;
|
|
1108
|
-
radio.markForCheck();
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
54
|
+
ValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValueDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
+
ValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ValueDirective, selector: "[goaValue]", host: { listeners: { "_change": "listenForValueChange($event.detail.value)" } }, providers: [
|
|
56
|
+
{
|
|
57
|
+
provide: NG_VALUE_ACCESSOR,
|
|
58
|
+
useExisting: forwardRef(() => ValueDirective),
|
|
59
|
+
multi: true,
|
|
60
|
+
},
|
|
61
|
+
], ngImport: i0 });
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValueDirective, decorators: [{
|
|
63
|
+
type: Directive,
|
|
64
|
+
args: [{
|
|
65
|
+
selector: "[goaValue]",
|
|
66
|
+
providers: [
|
|
67
|
+
{
|
|
68
|
+
provide: NG_VALUE_ACCESSOR,
|
|
69
|
+
useExisting: forwardRef(() => ValueDirective),
|
|
70
|
+
multi: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
}]
|
|
74
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { listenForValueChange: [{
|
|
75
|
+
type: HostListener,
|
|
76
|
+
args: ["_change", ["$event.detail.value"]]
|
|
77
|
+
}] } });
|
|
78
|
+
class ValuesDirective {
|
|
79
|
+
constructor(elementRef) {
|
|
80
|
+
this.elementRef = elementRef;
|
|
81
|
+
this._value = [];
|
|
82
|
+
this.onChange = () => { };
|
|
83
|
+
this.onTouched = () => { };
|
|
1111
84
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
*/
|
|
1115
|
-
_updateRadioButtonRequired() {
|
|
1116
|
-
if (this._radios) {
|
|
1117
|
-
this._radios.forEach(radio => {
|
|
1118
|
-
radio.required = this._required;
|
|
1119
|
-
radio.markForCheck();
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
85
|
+
get value() {
|
|
86
|
+
return this._value;
|
|
1122
87
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
if (this._radios) {
|
|
1128
|
-
this._radios.forEach(radio => {
|
|
1129
|
-
radio.labelPosition = this._labelPosition;
|
|
1130
|
-
radio.markForCheck();
|
|
1131
|
-
});
|
|
88
|
+
set value(val) {
|
|
89
|
+
if (val && val !== this._value) {
|
|
90
|
+
this._setValue(val);
|
|
91
|
+
this.elementRef.nativeElement.value = JSON.stringify(val);
|
|
1132
92
|
}
|
|
1133
93
|
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Boolean indicating if the radiobutton is required and not checked
|
|
1136
|
-
* @ignore
|
|
1137
|
-
*/
|
|
1138
|
-
hasError() {
|
|
1139
|
-
const hasSelectedRadio = this._radios.some(r => r.checked);
|
|
1140
|
-
return this.required && !hasSelectedRadio;
|
|
1141
|
-
}
|
|
1142
|
-
/**
|
|
1143
|
-
* Implemented as part of ControlValueAccessor.
|
|
1144
|
-
* @param value The model bound property, i.e. the value of checked
|
|
1145
|
-
* @ignore
|
|
1146
|
-
*/
|
|
1147
94
|
writeValue(value) {
|
|
1148
|
-
if (
|
|
1149
|
-
this.
|
|
1150
|
-
this._changeDetector.detectChanges();
|
|
95
|
+
if (value) {
|
|
96
|
+
this.value = value;
|
|
1151
97
|
}
|
|
1152
98
|
}
|
|
1153
|
-
/**
|
|
1154
|
-
* Implemented as part of ControlValueAccessor.
|
|
1155
|
-
* @param fn The function to call on change. Provided by ControlValueAccessor
|
|
1156
|
-
* @ignore
|
|
1157
|
-
*/
|
|
1158
99
|
registerOnChange(fn) {
|
|
1159
|
-
this.
|
|
100
|
+
this.onChange = fn;
|
|
1160
101
|
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Implemented as part of ControlValueAccessor.
|
|
1163
|
-
* @param fn The function to call on touch. Provided by ControlValueAccessor
|
|
1164
|
-
* @ignore
|
|
1165
|
-
*/
|
|
1166
102
|
registerOnTouched(fn) {
|
|
1167
|
-
this.
|
|
1168
|
-
}
|
|
1169
|
-
;
|
|
1170
|
-
}
|
|
1171
|
-
/**
|
|
1172
|
-
* Used to generate unique Id for this component
|
|
1173
|
-
* @ignore
|
|
1174
|
-
*/
|
|
1175
|
-
GoARadioGroupComponent.idNum = 0;
|
|
1176
|
-
GoARadioGroupComponent.decorators = [
|
|
1177
|
-
{ type: Component, args: [{
|
|
1178
|
-
selector: 'goa-radio-group',
|
|
1179
|
-
template: "<div class=\"goa-radio-group\" [ngClass]=\"{'goa-radio-group-disabled': disabled}\">\n <span *ngIf=\"title\" class=\"radio-group-title\">{{title}}</span>\n <span *ngIf=\"required\" class=\"required-label\" i18n=\"Required label for dropdown\">(Required)</span>\n <div *ngIf=\"helperText\" class=\"helper-text\">{{helperText}}</div>\n <div class=\"goa-radios\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"hasError()\" class=\"error-text\">{{requiredErrorMessage}}</div>\n</div>\n",
|
|
1180
|
-
providers: [
|
|
1181
|
-
GOA_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
|
|
1182
|
-
{ provide: GOA_RADIO_GROUP, useExisting: GoARadioGroupComponent }
|
|
1183
|
-
],
|
|
1184
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1185
|
-
styles: [""]
|
|
1186
|
-
},] }
|
|
1187
|
-
];
|
|
1188
|
-
GoARadioGroupComponent.ctorParameters = () => [
|
|
1189
|
-
{ type: ChangeDetectorRef },
|
|
1190
|
-
{ type: GoARadioService }
|
|
1191
|
-
];
|
|
1192
|
-
GoARadioGroupComponent.propDecorators = {
|
|
1193
|
-
_radios: [{ type: ContentChildren, args: [forwardRef(() => GoARadioComponent), { descendants: true },] }],
|
|
1194
|
-
title: [{ type: Input }],
|
|
1195
|
-
helperText: [{ type: Input }],
|
|
1196
|
-
requiredErrorMessage: [{ type: Input }],
|
|
1197
|
-
name: [{ type: Input }],
|
|
1198
|
-
value: [{ type: Input }],
|
|
1199
|
-
selected: [{ type: Input }],
|
|
1200
|
-
disabled: [{ type: Input }],
|
|
1201
|
-
required: [{ type: Input }],
|
|
1202
|
-
labelPosition: [{ type: Input }],
|
|
1203
|
-
selectionChange: [{ type: Output }]
|
|
1204
|
-
};
|
|
1205
|
-
|
|
1206
|
-
/**
|
|
1207
|
-
* Callout component to describe important changes or facts.
|
|
1208
|
-
* selector: goa-callout
|
|
1209
|
-
*/
|
|
1210
|
-
class GoACalloutComponent {
|
|
1211
|
-
constructor() {
|
|
1212
|
-
/**
|
|
1213
|
-
* The type of the callout, changes stylings and icons.
|
|
1214
|
-
*/
|
|
1215
|
-
this.type = 'information';
|
|
1216
|
-
}
|
|
1217
|
-
/**
|
|
1218
|
-
* @ignore
|
|
1219
|
-
*/
|
|
1220
|
-
ngOnInit() {
|
|
1221
|
-
if (this.title === undefined || this.title === null) {
|
|
1222
|
-
throw new TypeError(`Input 'title' is required.`);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
GoACalloutComponent.decorators = [
|
|
1227
|
-
{ type: Component, args: [{
|
|
1228
|
-
selector: 'goa-callout',
|
|
1229
|
-
template: "<div\n class=\"goa-callout\"\n [ngClass]=\"{\n 'goa--event': type === 'event',\n 'goa--important': type === 'important',\n 'goa--emergency': type === 'emergency',\n 'goa--success': type === 'success'\n }\"\n>\n <div>\n <h3>{{ title }}</h3>\n <div class=\"messages\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n",
|
|
1230
|
-
styles: [""]
|
|
1231
|
-
},] }
|
|
1232
|
-
];
|
|
1233
|
-
GoACalloutComponent.ctorParameters = () => [];
|
|
1234
|
-
GoACalloutComponent.propDecorators = {
|
|
1235
|
-
type: [{ type: Input }],
|
|
1236
|
-
title: [{ type: Input }]
|
|
1237
|
-
};
|
|
1238
|
-
|
|
1239
|
-
/**
|
|
1240
|
-
* Government of Alberta styled notification, comes in 4 variants: emergency, event, information, important.
|
|
1241
|
-
* Can set the message and optionally a link url.
|
|
1242
|
-
* selector: goa-notification
|
|
1243
|
-
*/
|
|
1244
|
-
class GoANotificationComponent {
|
|
1245
|
-
constructor(_changeDetectorRef) {
|
|
1246
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
1247
|
-
/**
|
|
1248
|
-
* Whether or not the notification has been dismissed.
|
|
1249
|
-
* @ignore
|
|
1250
|
-
*/
|
|
1251
|
-
this._isDismissed = false;
|
|
1252
|
-
/**
|
|
1253
|
-
* The type of the notification, changes stylings and icons.
|
|
1254
|
-
*/
|
|
1255
|
-
this.type = 'information';
|
|
1256
|
-
/**
|
|
1257
|
-
* Can the notification be dismissed?
|
|
1258
|
-
*/
|
|
1259
|
-
this.isDismissable = true;
|
|
1260
|
-
/**
|
|
1261
|
-
* Event emitted when the notification has been dismissed by the user.
|
|
1262
|
-
*/
|
|
1263
|
-
this.dismiss = new EventEmitter();
|
|
1264
|
-
}
|
|
1265
|
-
/**
|
|
1266
|
-
* @ignore
|
|
1267
|
-
*/
|
|
1268
|
-
ngOnInit() {
|
|
1269
|
-
}
|
|
1270
|
-
/**
|
|
1271
|
-
* @ignore
|
|
1272
|
-
*/
|
|
1273
|
-
dismissClick() {
|
|
1274
|
-
this._isDismissed = true;
|
|
1275
|
-
this._changeDetectorRef.detectChanges();
|
|
1276
|
-
this.dismiss.emit();
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
GoANotificationComponent.decorators = [
|
|
1280
|
-
{ type: Component, args: [{
|
|
1281
|
-
selector: 'goa-notification',
|
|
1282
|
-
template: "\n<div class=\"goa-notification\"\n [ngClass]=\"{\n 'dismissed': _isDismissed === true,\n 'goa--event': type === 'event',\n 'goa--important': type === 'important',\n 'goa--emergency': type === 'emergency'\n }\">\n <div class=\"content\">\n <a *ngIf=\"notificationUrl\" class=\"message\" href={{notificationUrl}}>{{message}}</a>\n <span *ngIf=\"!notificationUrl\" class=\"message\">{{message}}</span>\n <a *ngIf=\"isDismissable === true\" class=\"close\" i18n-title title=\"Dismiss\" (click)=\"dismissClick()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n <path d=\"M 15.99 14.54C 15.99 14.54 14.54 15.99 14.54 15.99 14.54 15.99 8 9.45 8 9.45 8 9.45 1.46 15.99 1.46 15.99 1.46 15.99 0.01 14.54 0.01 14.54 0.01 14.54 6.55 8 6.55 8 6.55 8 0.01 1.46 0.01 1.46 0.01 1.46 1.46 0.01 1.46 0.01 1.46 0.01 8 6.55 8 6.55 8 6.55 14.54 0.01 14.54 0.01 14.54 0.01 15.99 1.46 15.99 1.46 15.99 1.46 9.45 8 9.45 8 9.45 8 15.99 14.54 15.99 14.54Z\"/>\n </svg>\n </a>\n </div>\n</div>\n\n",
|
|
1283
|
-
styles: [""]
|
|
1284
|
-
},] }
|
|
1285
|
-
];
|
|
1286
|
-
GoANotificationComponent.ctorParameters = () => [
|
|
1287
|
-
{ type: ChangeDetectorRef }
|
|
1288
|
-
];
|
|
1289
|
-
GoANotificationComponent.propDecorators = {
|
|
1290
|
-
type: [{ type: Input }],
|
|
1291
|
-
message: [{ type: Input }],
|
|
1292
|
-
notificationUrl: [{ type: Input }],
|
|
1293
|
-
isDismissable: [{ type: Input }],
|
|
1294
|
-
dismiss: [{ type: Output }]
|
|
1295
|
-
};
|
|
1296
|
-
|
|
1297
|
-
/**
|
|
1298
|
-
* Government of Alberta styled notification banner. Contains one or more notifications.
|
|
1299
|
-
* selector: goa-notification-banner
|
|
1300
|
-
*/
|
|
1301
|
-
class GoANotificationBannerComponent {
|
|
1302
|
-
constructor() {
|
|
1303
|
-
/**
|
|
1304
|
-
* The accessibility title for the notification banner. Is not displayed.
|
|
1305
|
-
*/
|
|
1306
|
-
this.title = 'Notifications';
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* @ignore
|
|
1310
|
-
*/
|
|
1311
|
-
ngOnInit() {
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
GoANotificationBannerComponent.decorators = [
|
|
1315
|
-
{ type: Component, args: [{
|
|
1316
|
-
selector: 'goa-notification-banner',
|
|
1317
|
-
template: "<div class=\"goa-notifications\">\r\n <h2 class=\"title\">{{title}}</h2>\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n",
|
|
1318
|
-
styles: [""]
|
|
1319
|
-
},] }
|
|
1320
|
-
];
|
|
1321
|
-
GoANotificationBannerComponent.ctorParameters = () => [];
|
|
1322
|
-
GoANotificationBannerComponent.propDecorators = {
|
|
1323
|
-
title: [{ type: Input }],
|
|
1324
|
-
_notifications: [{ type: ContentChildren, args: [GoANotificationComponent, { descendants: false },] }]
|
|
1325
|
-
};
|
|
1326
|
-
|
|
1327
|
-
class GoASkeletonImageContentComponent {
|
|
1328
|
-
constructor() {
|
|
1329
|
-
this.rows = 1;
|
|
1330
|
-
this.arr = Array;
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
GoASkeletonImageContentComponent.decorators = [
|
|
1334
|
-
{ type: Component, args: [{
|
|
1335
|
-
selector: 'goa-skeleton-image-content',
|
|
1336
|
-
template: "<div class=\"skeleton-image-content\">\n <goa-skeleton-element type=\"thumbnail\"></goa-skeleton-element>\n <div class=\"skeleton-image-content__text\">\n <goa-skeleton-element\n type=\"title\"\n *ngFor=\"let i of arr(rows).fill(1)\"\n ></goa-skeleton-element>\n </div>\n</div>\n",
|
|
1337
|
-
styles: [""]
|
|
1338
|
-
},] }
|
|
1339
|
-
];
|
|
1340
|
-
GoASkeletonImageContentComponent.ctorParameters = () => [];
|
|
1341
|
-
GoASkeletonImageContentComponent.propDecorators = {
|
|
1342
|
-
rows: [{ type: Input }]
|
|
1343
|
-
};
|
|
1344
|
-
|
|
1345
|
-
class GoASkeletonElementComponent {
|
|
1346
|
-
constructor() {
|
|
1347
|
-
this.type = 'text';
|
|
1348
|
-
}
|
|
1349
|
-
get elementClass() {
|
|
1350
|
-
return `skeleton ${this.type}`;
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
GoASkeletonElementComponent.decorators = [
|
|
1354
|
-
{ type: Component, args: [{
|
|
1355
|
-
selector: 'goa-skeleton-element',
|
|
1356
|
-
template: "<div [ngClass]=\"elementClass\"></div>",
|
|
1357
|
-
styles: [""]
|
|
1358
|
-
},] }
|
|
1359
|
-
];
|
|
1360
|
-
GoASkeletonElementComponent.ctorParameters = () => [];
|
|
1361
|
-
GoASkeletonElementComponent.propDecorators = {
|
|
1362
|
-
type: [{ type: Input }]
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
|
-
/**
|
|
1366
|
-
* Header component used for Government of Alberta cards.
|
|
1367
|
-
* Put header content inside of component and it will project to the header section of the card.
|
|
1368
|
-
* selector: goa-card-header
|
|
1369
|
-
* @example <goa-card><goa-card-header>My content</goa-card-header></goa-card>
|
|
1370
|
-
*/
|
|
1371
|
-
class GoACardHeaderComponent {
|
|
1372
|
-
constructor() { }
|
|
1373
|
-
/**
|
|
1374
|
-
* @ignore
|
|
1375
|
-
*/
|
|
1376
|
-
ngOnInit() {
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
GoACardHeaderComponent.decorators = [
|
|
1380
|
-
{ type: Component, args: [{
|
|
1381
|
-
selector: 'goa-card-header',
|
|
1382
|
-
template: "<ng-container>\n <ng-content></ng-content>\n</ng-container>",
|
|
1383
|
-
styles: [""]
|
|
1384
|
-
},] }
|
|
1385
|
-
];
|
|
1386
|
-
GoACardHeaderComponent.ctorParameters = () => [];
|
|
1387
|
-
|
|
1388
|
-
/**
|
|
1389
|
-
* Footer component used for Government of Alberta cards.
|
|
1390
|
-
* Put footer content inside of component and it will project to the confootertent section of the card.
|
|
1391
|
-
* selector: goa-card-footer
|
|
1392
|
-
* @example <goa-card><goa-card-footer>My content</goa-card-footer></goa-card>
|
|
1393
|
-
*/
|
|
1394
|
-
class GoACardFooterComponent {
|
|
1395
|
-
constructor() { }
|
|
1396
|
-
/**
|
|
1397
|
-
* @ignore
|
|
1398
|
-
*/
|
|
1399
|
-
ngOnInit() {
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
GoACardFooterComponent.decorators = [
|
|
1403
|
-
{ type: Component, args: [{
|
|
1404
|
-
selector: 'goa-card-footer',
|
|
1405
|
-
template: "<ng-container>\n <ng-content></ng-content>\n</ng-container>",
|
|
1406
|
-
styles: [""]
|
|
1407
|
-
},] }
|
|
1408
|
-
];
|
|
1409
|
-
GoACardFooterComponent.ctorParameters = () => [];
|
|
1410
|
-
|
|
1411
|
-
/**
|
|
1412
|
-
* cardImage image component used for Government of Alberta cards.
|
|
1413
|
-
* It will project to the content section of the card.
|
|
1414
|
-
* selector: goa-card-thumb-image
|
|
1415
|
-
* @example <goa-card><goa-card-thumb-image url="" alt=""></goa-card-thumb-image></goa-card>
|
|
1416
|
-
*/
|
|
1417
|
-
class GoACardThumbImageComponent {
|
|
1418
|
-
constructor() { }
|
|
1419
|
-
/**
|
|
1420
|
-
* @ignore
|
|
1421
|
-
*/
|
|
1422
|
-
ngOnInit() { }
|
|
1423
|
-
}
|
|
1424
|
-
GoACardThumbImageComponent.decorators = [
|
|
1425
|
-
{ type: Component, args: [{
|
|
1426
|
-
selector: 'goa-card-thumb-image',
|
|
1427
|
-
template: "<ng-container>\n <img src=\"{{url}}\" [attr.alt]=\"alt\">\n</ng-container>",
|
|
1428
|
-
styles: [":host img,:host iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}\n"]
|
|
1429
|
-
},] }
|
|
1430
|
-
];
|
|
1431
|
-
GoACardThumbImageComponent.ctorParameters = () => [];
|
|
1432
|
-
GoACardThumbImageComponent.propDecorators = {
|
|
1433
|
-
url: [{ type: Input }],
|
|
1434
|
-
alt: [{ type: Input }]
|
|
1435
|
-
};
|
|
1436
|
-
|
|
1437
|
-
/**
|
|
1438
|
-
* Content component used for Government of Alberta cards.
|
|
1439
|
-
* Put content inside of component and it will project to the content section of the card.
|
|
1440
|
-
* selector: goa-card-content
|
|
1441
|
-
* @example <goa-card><goa-card-content>My content</goa-card-content></goa-card>
|
|
1442
|
-
*/
|
|
1443
|
-
class GoACardContentComponent {
|
|
1444
|
-
constructor() { }
|
|
1445
|
-
/**
|
|
1446
|
-
* @ignore
|
|
1447
|
-
*/
|
|
1448
|
-
ngOnInit() {
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
GoACardContentComponent.decorators = [
|
|
1452
|
-
{ type: Component, args: [{
|
|
1453
|
-
selector: 'goa-card-content',
|
|
1454
|
-
template: "<ng-container>\n <ng-content></ng-content>\n</ng-container>",
|
|
1455
|
-
styles: [""]
|
|
1456
|
-
},] }
|
|
1457
|
-
];
|
|
1458
|
-
GoACardContentComponent.ctorParameters = () => [];
|
|
1459
|
-
|
|
1460
|
-
/**
|
|
1461
|
-
* Card component with Government of Alberta styling.
|
|
1462
|
-
* Place desired sub-components (goa-card-thumb-image, goa-card-header, goa-card-content, goa-card-footer) inside of content.
|
|
1463
|
-
* selector: goa-card
|
|
1464
|
-
*/
|
|
1465
|
-
class GoACardComponent {
|
|
1466
|
-
constructor() {
|
|
1467
|
-
/**
|
|
1468
|
-
* What percentage of container width to take.
|
|
1469
|
-
*/
|
|
1470
|
-
this.cardSize = 'full';
|
|
1471
|
-
}
|
|
1472
|
-
/**
|
|
1473
|
-
* @ignore
|
|
1474
|
-
*/
|
|
1475
|
-
ngOnInit() {
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
GoACardComponent.decorators = [
|
|
1479
|
-
{ type: Component, args: [{
|
|
1480
|
-
selector: 'goa-card',
|
|
1481
|
-
template: "<div\n class=\"goa-card\"\n [ngClass]=\"{\n 'card-auto': cardSize === 'auto'\n }\" [attr.data-skeleton]=\"isSkeleton ? '' : null\"\n>\n <div class=\"goa-poster\">\n <ng-content select=\"goa-card-thumb-image\"></ng-content>\n </div>\n <div class=\"card-content\">\n <a class=\"goa-title\" href=\"{{ titleUrl }}\">\n <ng-content select=\"goa-card-header\"></ng-content>\n </a>\n <div class=\"goa-text\">\n <ng-content select=\"goa-card-content\"></ng-content>\n </div>\n <div class=\"goa-footer\">\n <ng-content select=\"goa-card-footer\"></ng-content>\n </div>\n </div>\n</div>\n",
|
|
1482
|
-
styles: [""]
|
|
1483
|
-
},] }
|
|
1484
|
-
];
|
|
1485
|
-
GoACardComponent.ctorParameters = () => [];
|
|
1486
|
-
GoACardComponent.propDecorators = {
|
|
1487
|
-
cardSize: [{ type: Input }],
|
|
1488
|
-
titleUrl: [{ type: Input }],
|
|
1489
|
-
isSkeleton: [{ type: Input }]
|
|
1490
|
-
};
|
|
1491
|
-
|
|
1492
|
-
/**
|
|
1493
|
-
* A wrapper/group for a set of card display
|
|
1494
|
-
*/
|
|
1495
|
-
class GoACardGroupComponent {
|
|
1496
|
-
constructor() { }
|
|
1497
|
-
/* eslint-disable @angular-eslint/no-empty-lifecycle-method */
|
|
1498
|
-
ngOnInit() { }
|
|
1499
|
-
}
|
|
1500
|
-
GoACardGroupComponent.decorators = [
|
|
1501
|
-
{ type: Component, args: [{
|
|
1502
|
-
selector: 'goa-card-group',
|
|
1503
|
-
template: "<ng-container>\n <div class=\"goa-card-group\">\n <div class=\"card-group-title\">{{ title }}</div>\n <div\n [ngClass]=\"{\n 'card-group-basic': layout === 'basic',\n 'card-group-column': layout === 'column'\n }\"\n >\n <ng-content></ng-content>\n <div *ngFor=\"let card of cardItems\">\n <goa-card titleUrl=\"{{ card.titleUrl }}\">\n <goa-card-thumb-image\n url=\"{{ card.cardImageUrl }}\"\n alt=\"hero pic\"\n ></goa-card-thumb-image>\n <goa-card-header>{{ card.title }}</goa-card-header>\n <goa-card-content>{{ card.description }}</goa-card-content>\n </goa-card>\n </div>\n </div>\n </div>\n</ng-container>\n",
|
|
1504
|
-
styles: [""]
|
|
1505
|
-
},] }
|
|
1506
|
-
];
|
|
1507
|
-
GoACardGroupComponent.ctorParameters = () => [];
|
|
1508
|
-
GoACardGroupComponent.propDecorators = {
|
|
1509
|
-
layout: [{ type: Input }],
|
|
1510
|
-
title: [{ type: Input }],
|
|
1511
|
-
cardItems: [{ type: Input }]
|
|
1512
|
-
};
|
|
1513
|
-
|
|
1514
|
-
class GoAHeroBannerContentComponent {
|
|
1515
|
-
constructor() { }
|
|
1516
|
-
ngOnInit() {
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
GoAHeroBannerContentComponent.decorators = [
|
|
1520
|
-
{ type: Component, args: [{
|
|
1521
|
-
selector: 'goa-hero-banner-content',
|
|
1522
|
-
template: "<ng-container>\n <p class=\"goa-hero-banner-content\" role=\"note\">\n <ng-content></ng-content>\n </p>\n</ng-container>\n",
|
|
1523
|
-
styles: [""]
|
|
1524
|
-
},] }
|
|
1525
|
-
];
|
|
1526
|
-
GoAHeroBannerContentComponent.ctorParameters = () => [];
|
|
1527
|
-
|
|
1528
|
-
class GoAHeroBannerLinkComponent {
|
|
1529
|
-
constructor() { }
|
|
1530
|
-
ngOnInit() {
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
GoAHeroBannerLinkComponent.decorators = [
|
|
1534
|
-
{ type: Component, args: [{
|
|
1535
|
-
selector: 'goa-hero-banner-link',
|
|
1536
|
-
template: "<ng-container>\n <a class=\"goa-link-button right-arrow\" [href]=\"url\" role=\"link\">\n <ng-content></ng-content>\n </a>\n</ng-container>\n",
|
|
1537
|
-
styles: [""]
|
|
1538
|
-
},] }
|
|
1539
|
-
];
|
|
1540
|
-
GoAHeroBannerLinkComponent.ctorParameters = () => [];
|
|
1541
|
-
GoAHeroBannerLinkComponent.propDecorators = {
|
|
1542
|
-
url: [{ type: Input }]
|
|
1543
|
-
};
|
|
1544
|
-
|
|
1545
|
-
class GoAHeroBannerComponent {
|
|
1546
|
-
constructor() { }
|
|
1547
|
-
ngOnInit() {
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
GoAHeroBannerComponent.decorators = [
|
|
1551
|
-
{ type: Component, args: [{
|
|
1552
|
-
selector: 'goa-hero-banner',
|
|
1553
|
-
template: "<div class=\"goa-hero\"\n style=\"background-image: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.40) 40%, rgba(0, 0, 0, 0.6) 100%), url({{backgroundUrl}});\"\n>\n <h1 role=\"heading\">{{ title }}</h1>\n <ng-content select=\"goa-hero-banner-content\"></ng-content>\n <ng-content select=\"goa-hero-banner-link\"></ng-content>\n</div>\n",
|
|
1554
|
-
styles: [""]
|
|
1555
|
-
},] }
|
|
1556
|
-
];
|
|
1557
|
-
GoAHeroBannerComponent.ctorParameters = () => [];
|
|
1558
|
-
GoAHeroBannerComponent.propDecorators = {
|
|
1559
|
-
title: [{ type: Input }],
|
|
1560
|
-
backgroundUrl: [{ type: Input }]
|
|
1561
|
-
};
|
|
1562
|
-
|
|
1563
|
-
/**
|
|
1564
|
-
* A page load indicator component with Government of Alberta styling.
|
|
1565
|
-
* selector: goa-page-load-indicator
|
|
1566
|
-
*/
|
|
1567
|
-
class GoAPageLoadIndicatorComponent {
|
|
1568
|
-
constructor() {
|
|
1569
|
-
/**
|
|
1570
|
-
* Sets the page loader visibility state.
|
|
1571
|
-
*/
|
|
1572
|
-
this.visible = false;
|
|
1573
|
-
/**
|
|
1574
|
-
* The type of page loader, deterministic and indeterministic.
|
|
1575
|
-
*/
|
|
1576
|
-
this.type = 'infinite';
|
|
1577
|
-
/**
|
|
1578
|
-
* The message to display while loading.
|
|
1579
|
-
*/
|
|
1580
|
-
this.message = '';
|
|
1581
|
-
/**
|
|
1582
|
-
* Sets the percentage value of the page loader while set to progress type, 0 - 100 percent.
|
|
1583
|
-
*/
|
|
1584
|
-
this.value = 0;
|
|
1585
|
-
/**
|
|
1586
|
-
* Sets the page to locked and does not accept user input. When not set the component
|
|
1587
|
-
* can be used as a child element without blocking user input.
|
|
1588
|
-
*/
|
|
1589
|
-
this.pagelock = true;
|
|
1590
|
-
/**
|
|
1591
|
-
* Sets the progress indicator display type size.
|
|
1592
|
-
*/
|
|
1593
|
-
this.displayType = 'large';
|
|
1594
|
-
/**
|
|
1595
|
-
* Set defaults
|
|
1596
|
-
*/
|
|
1597
|
-
this.strokeDashoffsetDefault = 280;
|
|
1598
|
-
this.progressMaxValue = 283;
|
|
1599
|
-
this.strokeDashoffset = 0;
|
|
1600
|
-
}
|
|
1601
|
-
ngOnInit() {
|
|
1602
|
-
if (this.type !== 'progress') {
|
|
1603
|
-
this.strokeDashoffset = this.strokeDashoffsetDefault;
|
|
1604
|
-
}
|
|
103
|
+
this.onTouched = fn;
|
|
1605
104
|
}
|
|
1606
|
-
|
|
1607
|
-
if (
|
|
1608
|
-
this.
|
|
1609
|
-
}
|
|
1610
|
-
if (changes.value) {
|
|
1611
|
-
if (this.type === 'progress') {
|
|
1612
|
-
this.setProgress(changes.value.currentValue);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
/**
|
|
1617
|
-
* Toggles the page scrolling based on page load indicator's visibility.
|
|
1618
|
-
* @param isBlock The flag to enable/disable page scroll.
|
|
1619
|
-
* @ignore
|
|
1620
|
-
*/
|
|
1621
|
-
blockScrollingToggle(isBlock) {
|
|
1622
|
-
if (!isBlock || !this.pagelock) {
|
|
1623
|
-
document.body.style.removeProperty('height');
|
|
1624
|
-
document.body.style.removeProperty('overflow');
|
|
1625
|
-
}
|
|
1626
|
-
else {
|
|
1627
|
-
document.body.style.height = '100%';
|
|
1628
|
-
document.body.style.overflow = 'hidden';
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
/**
|
|
1632
|
-
* Blocks the keyboard input when page load indicator is visible.
|
|
1633
|
-
* @ignore
|
|
1634
|
-
*/
|
|
1635
|
-
disableKeyboardInputHandler(event) {
|
|
1636
|
-
if (this.visible) {
|
|
1637
|
-
event.returnValue = false;
|
|
1638
|
-
event.preventDefault();
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
ngOnDestroy() {
|
|
1642
|
-
this.blockScrollingToggle(false);
|
|
1643
|
-
}
|
|
1644
|
-
setProgress(progress) {
|
|
1645
|
-
if (this.type !== 'progress') {
|
|
1646
|
-
return;
|
|
1647
|
-
}
|
|
1648
|
-
;
|
|
1649
|
-
if (progress === 0) {
|
|
1650
|
-
this.strokeDashoffset = this.progressMaxValue;
|
|
105
|
+
listenForValueChange(value) {
|
|
106
|
+
if (!value) {
|
|
107
|
+
this._setValue(undefined);
|
|
1651
108
|
return;
|
|
1652
109
|
}
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
/**
|
|
1693
|
-
* The base color of the spinner.
|
|
1694
|
-
*/
|
|
1695
|
-
this.baseColour = '#c8eef9';
|
|
1696
|
-
/**
|
|
1697
|
-
* The spinner color of the spinner.
|
|
1698
|
-
*/
|
|
1699
|
-
this.spinnerColour = '#0070c4';
|
|
1700
|
-
this.radius = this.size === 'small' ? 16 : 18;
|
|
1701
|
-
this.innerRadius = this.radius - 4;
|
|
1702
|
-
this.diameter = this.radius * 2;
|
|
1703
|
-
this.dashArray = this.innerRadius * Math.PI * 2;
|
|
1704
|
-
this.dashOffset = this.innerRadius * Math.PI * 0.5;
|
|
1705
|
-
this.viewBox = `0 0 ${this.diameter} ${this.diameter}`;
|
|
1706
|
-
}
|
|
1707
|
-
/**
|
|
1708
|
-
* @ignore
|
|
1709
|
-
*/
|
|
1710
|
-
ngOnChanges(changes) {
|
|
1711
|
-
if (changes.size) {
|
|
1712
|
-
this.radius = changes.size.currentValue === 'small' ? 16 : 18;
|
|
1713
|
-
this.innerRadius = this.radius - 4;
|
|
1714
|
-
this.diameter = this.radius * 2;
|
|
1715
|
-
this.viewBox = `0 0 ${this.diameter} ${this.diameter}`;
|
|
1716
|
-
this.dashArray = this.innerRadius * Math.PI * 2;
|
|
1717
|
-
this.dashOffset = this.innerRadius * Math.PI * 0.5;
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
/**
|
|
1721
|
-
* @ignore
|
|
1722
|
-
*/
|
|
1723
|
-
ngOnInit() { }
|
|
1724
|
-
}
|
|
1725
|
-
GoAElementLoadIndicatorComponent.decorators = [
|
|
1726
|
-
{ type: Component, args: [{
|
|
1727
|
-
selector: 'goa-element-load-indicator',
|
|
1728
|
-
template: "<div *ngIf=\"visible\">\n <svg\n fill=\"none\"\n [attr.viewBox]=\"viewBox\"\n [attr.width]=\"radius\"\n [attr.height]=\"radius\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n class=\"base-circle\"\n [attr.cx]=\"radius\"\n [attr.cy]=\"radius\"\n [attr.r]=\"innerRadius\"\n [style.stroke]=\"baseColour\"\n />\n <circle\n class=\"rotating-circle\"\n [attr.cx]=\"radius\"\n [style.stroke-dasharray]=\"dashArray\"\n [style.stroke-dashoffset]=\"dashOffset\"\n [attr.cy]=\"radius\"\n [attr.r]=\"innerRadius\"\n [style.stroke]=\"spinnerColour\"\n />\n </svg>\n</div>\n",
|
|
1729
|
-
styles: [""]
|
|
1730
|
-
},] }
|
|
1731
|
-
];
|
|
1732
|
-
GoAElementLoadIndicatorComponent.ctorParameters = () => [];
|
|
1733
|
-
GoAElementLoadIndicatorComponent.propDecorators = {
|
|
1734
|
-
visible: [{ type: Input }],
|
|
1735
|
-
size: [{ type: Input }],
|
|
1736
|
-
baseColour: [{ type: Input }],
|
|
1737
|
-
spinnerColour: [{ type: Input }]
|
|
1738
|
-
};
|
|
1739
|
-
|
|
1740
|
-
class AngularComponentsModule {
|
|
1741
|
-
}
|
|
1742
|
-
AngularComponentsModule.decorators = [
|
|
1743
|
-
{ type: NgModule, args: [{
|
|
1744
|
-
imports: [CommonModule, OverlayModule],
|
|
1745
|
-
exports: [
|
|
1746
|
-
FormsModule,
|
|
1747
|
-
OverlayModule,
|
|
1748
|
-
CommonModule,
|
|
1749
|
-
GoAButtonComponent,
|
|
1750
|
-
GoAMicrositeLogoComponent,
|
|
1751
|
-
GoAHeaderComponent,
|
|
1752
|
-
GoAButtonLinkComponent,
|
|
1753
|
-
GoAOptionComponent,
|
|
1754
|
-
GoADropdownComponent,
|
|
1755
|
-
GoAOptionGroupComponent,
|
|
1756
|
-
GoACheckboxComponent,
|
|
1757
|
-
GoACalloutComponent,
|
|
1758
|
-
GoACardGroupComponent,
|
|
1759
|
-
GoANotificationComponent,
|
|
1760
|
-
GoANotificationBannerComponent,
|
|
1761
|
-
GoACardComponent,
|
|
1762
|
-
GoACardHeaderComponent,
|
|
1763
|
-
GoACardFooterComponent,
|
|
1764
|
-
GoACardContentComponent,
|
|
1765
|
-
GoACardThumbImageComponent,
|
|
1766
|
-
GoARadioComponent,
|
|
1767
|
-
GoARadioGroupComponent,
|
|
1768
|
-
GoAHeroBannerComponent,
|
|
1769
|
-
GoAHeroBannerContentComponent,
|
|
1770
|
-
GoAHeroBannerLinkComponent,
|
|
1771
|
-
GoAPageLoadIndicatorComponent,
|
|
1772
|
-
GoASkeletonImageContentComponent,
|
|
1773
|
-
GoASkeletonElementComponent,
|
|
1774
|
-
GoAElementLoadIndicatorComponent,
|
|
1775
|
-
],
|
|
1776
|
-
declarations: [
|
|
1777
|
-
GoAButtonComponent,
|
|
1778
|
-
GoAMicrositeLogoComponent,
|
|
1779
|
-
GoAHeaderComponent,
|
|
1780
|
-
GoAButtonLinkComponent,
|
|
1781
|
-
GoAOptionComponent,
|
|
1782
|
-
GoADropdownComponent,
|
|
1783
|
-
GoAOptionGroupComponent,
|
|
1784
|
-
GoACheckboxComponent,
|
|
1785
|
-
GoACalloutComponent,
|
|
1786
|
-
GoACardGroupComponent,
|
|
1787
|
-
GoANotificationComponent,
|
|
1788
|
-
GoANotificationBannerComponent,
|
|
1789
|
-
GoACardComponent,
|
|
1790
|
-
GoACardHeaderComponent,
|
|
1791
|
-
GoACardFooterComponent,
|
|
1792
|
-
GoACardContentComponent,
|
|
1793
|
-
GoACardThumbImageComponent,
|
|
1794
|
-
GoARadioComponent,
|
|
1795
|
-
GoARadioGroupComponent,
|
|
1796
|
-
GoAHeroBannerComponent,
|
|
1797
|
-
GoAHeroBannerContentComponent,
|
|
1798
|
-
GoAHeroBannerLinkComponent,
|
|
1799
|
-
GoAPageLoadIndicatorComponent,
|
|
1800
|
-
GoASkeletonImageContentComponent,
|
|
1801
|
-
GoASkeletonElementComponent,
|
|
1802
|
-
GoAElementLoadIndicatorComponent,
|
|
1803
|
-
],
|
|
1804
|
-
providers: [GoARadioService],
|
|
1805
|
-
schemas: [
|
|
1806
|
-
CUSTOM_ELEMENTS_SCHEMA
|
|
1807
|
-
]
|
|
1808
|
-
},] }
|
|
1809
|
-
];
|
|
1810
|
-
|
|
1811
|
-
class GoACheckboxChange {
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
class GoABadgeComponent {
|
|
1815
|
-
constructor() {
|
|
1816
|
-
this.type = 'light';
|
|
1817
|
-
}
|
|
1818
|
-
get badgeClass() {
|
|
1819
|
-
return `badge-${this.type}`;
|
|
1820
|
-
}
|
|
1821
|
-
/* eslint-disable @angular-eslint/no-empty-lifecycle-method */
|
|
1822
|
-
ngOnInit() { }
|
|
1823
|
-
}
|
|
1824
|
-
GoABadgeComponent.decorators = [
|
|
1825
|
-
{ type: Component, args: [{
|
|
1826
|
-
selector: 'goa-badge',
|
|
1827
|
-
template: "<div class=\"goa-badge\" [ngClass]=\"badgeClass\">\n <ng-content class=\"goa-badge-icon\" select=\"mat-icon,.goa-badge-icon\"></ng-content>\n <div class=\"goa-badge-content\">\n <ng-content></ng-content>\n </div>\n</div>\n",
|
|
1828
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1829
|
-
styles: [""]
|
|
1830
|
-
},] }
|
|
1831
|
-
];
|
|
1832
|
-
GoABadgeComponent.ctorParameters = () => [];
|
|
1833
|
-
GoABadgeComponent.propDecorators = {
|
|
1834
|
-
type: [{ type: Input }]
|
|
1835
|
-
};
|
|
1836
|
-
|
|
1837
|
-
class GoAAppVersionHeaderComponent {
|
|
1838
|
-
constructor() {
|
|
1839
|
-
this.isProdEnvironment = false;
|
|
1840
|
-
this.environment = '';
|
|
1841
|
-
this.version = '';
|
|
1842
|
-
this.closed = new EventEmitter();
|
|
1843
|
-
}
|
|
1844
|
-
ngOnInit() {
|
|
1845
|
-
}
|
|
1846
|
-
onCloseClick() {
|
|
1847
|
-
this.closed.next(true);
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
GoAAppVersionHeaderComponent.decorators = [
|
|
1851
|
-
{ type: Component, args: [{
|
|
1852
|
-
selector: 'goa-app-version-header',
|
|
1853
|
-
template: "<div\n *ngIf=\"!isProdEnvironment && (closed | async) === null\"\n class=\"goa-app-version-header\"\n>\n <span class=\"content-wrapper\">\n <span class=\"environment-and-version\">{{ environment }} {{ version }}</span>\n <span class=\"close\" (click)=\"onCloseClick()\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"ionicon\"\n viewBox=\"0 0 512 512\"\n >\n <title>Close</title>\n <path\n fill=\"currentColor\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n d=\"M368 368L144 144M368 144L144 368\"\n />\n </svg>\n </span>\n </span>\n</div>\n",
|
|
1854
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1855
|
-
styles: [""]
|
|
1856
|
-
},] }
|
|
1857
|
-
];
|
|
1858
|
-
GoAAppVersionHeaderComponent.ctorParameters = () => [];
|
|
1859
|
-
GoAAppVersionHeaderComponent.propDecorators = {
|
|
1860
|
-
isProdEnvironment: [{ type: Input }],
|
|
1861
|
-
environment: [{ type: Input }],
|
|
1862
|
-
version: [{ type: Input }],
|
|
1863
|
-
closed: [{ type: Output }]
|
|
1864
|
-
};
|
|
1865
|
-
|
|
1866
|
-
class GoANumberInputComponent {
|
|
1867
|
-
constructor() {
|
|
1868
|
-
this._isTouched = false;
|
|
1869
|
-
/**
|
|
1870
|
-
* Sets the step value that is used when incrementing / decrementing
|
|
1871
|
-
*
|
|
1872
|
-
* @memberof GoANumberInputComponent
|
|
1873
|
-
*/
|
|
1874
|
-
this.step = 1;
|
|
1875
|
-
/**
|
|
1876
|
-
* An event that fires whenever the value is changed
|
|
1877
|
-
*
|
|
1878
|
-
* @type {EventEmitter<number | undefined | null>}
|
|
1879
|
-
* @memberof GoANumberInputComponent
|
|
1880
|
-
*/
|
|
1881
|
-
this.valueChanged = new EventEmitter();
|
|
1882
|
-
}
|
|
1883
|
-
get input() {
|
|
1884
|
-
var _a;
|
|
1885
|
-
return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
1886
|
-
}
|
|
1887
|
-
/**
|
|
1888
|
-
* The value of the NumberInput
|
|
1889
|
-
*
|
|
1890
|
-
* @memberof GoANumberInputComponent
|
|
1891
|
-
*/
|
|
1892
|
-
set value(val) {
|
|
1893
|
-
var _a;
|
|
1894
|
-
const newVal = (val === undefined || val === null || Number.isNaN(val)) ? null : this.clampValue(val);
|
|
1895
|
-
if (this._value !== newVal) {
|
|
1896
|
-
this._value = newVal;
|
|
1897
|
-
(_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, newVal);
|
|
1898
|
-
this.valueChanged.emit(newVal);
|
|
1899
|
-
}
|
|
1900
|
-
if (this.input && this.input.valueAsNumber !== newVal) {
|
|
1901
|
-
this.input.valueAsNumber = newVal;
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
get value() {
|
|
1905
|
-
return this._value;
|
|
1906
|
-
}
|
|
1907
|
-
/**
|
|
1908
|
-
* Sets the minimum value that the number input can take
|
|
1909
|
-
*
|
|
1910
|
-
* @memberof GoANumberInputComponent
|
|
1911
|
-
*/
|
|
1912
|
-
set min(min) {
|
|
1913
|
-
this._min = min;
|
|
1914
|
-
// force reevaluation / clamping
|
|
1915
|
-
this.value = this._value;
|
|
1916
|
-
}
|
|
1917
|
-
get min() {
|
|
1918
|
-
return this._min;
|
|
1919
|
-
}
|
|
1920
|
-
/**
|
|
1921
|
-
* Sets the maximum value that the number input can take
|
|
1922
|
-
*
|
|
1923
|
-
* @memberof GoANumberInputComponent
|
|
1924
|
-
*/
|
|
1925
|
-
set max(max) {
|
|
1926
|
-
this._max = max;
|
|
1927
|
-
// force reevaluation / clamping
|
|
1928
|
-
this.value = this._value;
|
|
1929
|
-
}
|
|
1930
|
-
get max() {
|
|
1931
|
-
return this._max;
|
|
1932
|
-
}
|
|
1933
|
-
clampValue(val) {
|
|
1934
|
-
if (Number.isFinite(this.max)) {
|
|
1935
|
-
val = Math.min(this.max, val);
|
|
1936
|
-
}
|
|
1937
|
-
if (Number.isFinite(this.min)) {
|
|
1938
|
-
val = Math.max(val, this.min);
|
|
1939
|
-
}
|
|
1940
|
-
return val;
|
|
1941
|
-
}
|
|
1942
|
-
markTouched() {
|
|
1943
|
-
var _a;
|
|
1944
|
-
if (this._isTouched === false) {
|
|
1945
|
-
this._isTouched = true;
|
|
1946
|
-
(_a = this.onTouched) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
handleInput(event) {
|
|
1950
|
-
var _a;
|
|
1951
|
-
const inputString = (_a = event.data) !== null && _a !== void 0 ? _a : '';
|
|
1952
|
-
// If someone is typing a negative number, let them
|
|
1953
|
-
if (inputString.trim() !== '-') {
|
|
1954
|
-
this.value = event.target.valueAsNumber;
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* Increment the number input
|
|
1959
|
-
*
|
|
1960
|
-
* @memberof GoANumberInputComponent
|
|
1961
|
-
*/
|
|
1962
|
-
increment() {
|
|
1963
|
-
// use built-in browser increment logic
|
|
1964
|
-
this.input.stepUp();
|
|
1965
|
-
this.value = this.input.valueAsNumber;
|
|
1966
|
-
}
|
|
1967
|
-
/**
|
|
1968
|
-
* Decrement the number input
|
|
1969
|
-
*
|
|
1970
|
-
* @memberof GoANumberInputComponent
|
|
1971
|
-
*/
|
|
1972
|
-
decrement() {
|
|
1973
|
-
// use built-in browser decrement logic
|
|
1974
|
-
this.input.stepDown();
|
|
1975
|
-
this.value = this.input.valueAsNumber;
|
|
1976
|
-
}
|
|
1977
|
-
// CONTROL VALUE ACCESSOR INTERFACE
|
|
1978
|
-
writeValue(value) {
|
|
1979
|
-
this.value = value;
|
|
1980
|
-
}
|
|
1981
|
-
registerOnChange(handler) {
|
|
1982
|
-
this.onChange = handler;
|
|
1983
|
-
}
|
|
1984
|
-
registerOnTouched(handler) {
|
|
1985
|
-
this.onTouched = handler;
|
|
1986
|
-
}
|
|
1987
|
-
setDisabledState(isDisabled) {
|
|
1988
|
-
this.disabled = isDisabled;
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
GoANumberInputComponent.decorators = [
|
|
1992
|
-
{ type: Component, args: [{
|
|
1993
|
-
selector: 'goa-number-input',
|
|
1994
|
-
template: "<div (focusout)=\"markTouched()\" class=\"number-input-container\">\n <button\n [disabled]=\"disabled || (min !== undefined && value <= min)\"\n goa-button\n buttonType=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n (click)=\"decrement()\"\n >\n <svg width=\"1em\" height=\"100%\" viewBox=\"0 0 100 100\">\n <line x1=\"25%\" y1=\"50%\" x2=\"75%\" y2=\"50%\" stroke-width=\"15%\" />\n </svg>\n </button>\n\n <input\n #numberInput\n type=\"number\"\n [min]=\"min\"\n [max]=\"max\"\n [value]=\"value\"\n [step]=\"step\"\n [disabled]=\"disabled\"\n (input)=\"handleInput($event)\"\n />\n\n <button\n goa-button\n [disabled]=\"disabled || (max !== undefined && value >= max)\"\n buttonType=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n (click)=\"increment()\"\n >\n <svg width=\"1em\" height=\"100%\" viewBox=\"0 0 100 100\">\n <line x1=\"25%\" y1=\"50%\" x2=\"75%\" y2=\"50%\" stroke-width=\"15%\" />\n <line x1=\"50%\" y1=\"25%\" x2=\"50%\" y2=\"75%\" stroke-width=\"15%\" />\n </svg>\n </button>\n</div>\n",
|
|
1995
|
-
providers: [
|
|
1996
|
-
{
|
|
1997
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1998
|
-
useExisting: forwardRef(() => GoANumberInputComponent),
|
|
1999
|
-
multi: true
|
|
2000
|
-
},
|
|
2001
|
-
],
|
|
2002
|
-
styles: [""]
|
|
2003
|
-
},] }
|
|
2004
|
-
];
|
|
2005
|
-
GoANumberInputComponent.propDecorators = {
|
|
2006
|
-
inputElement: [{ type: ViewChild, args: ['numberInput',] }],
|
|
2007
|
-
disabled: [{ type: Input }],
|
|
2008
|
-
step: [{ type: Input }],
|
|
2009
|
-
valueChanged: [{ type: Output }],
|
|
2010
|
-
value: [{ type: Input }],
|
|
2011
|
-
min: [{ type: Input }],
|
|
2012
|
-
max: [{ type: Input }]
|
|
2013
|
-
};
|
|
2014
|
-
|
|
2015
|
-
class ExperimentalComponentsModule {
|
|
2016
|
-
}
|
|
2017
|
-
ExperimentalComponentsModule.decorators = [
|
|
2018
|
-
{ type: NgModule, args: [{
|
|
2019
|
-
imports: [
|
|
2020
|
-
CommonModule,
|
|
2021
|
-
AngularComponentsModule
|
|
2022
|
-
],
|
|
2023
|
-
exports: [
|
|
2024
|
-
GoABadgeComponent,
|
|
2025
|
-
GoAAppVersionHeaderComponent,
|
|
2026
|
-
GoANumberInputComponent,
|
|
2027
|
-
],
|
|
2028
|
-
declarations: [
|
|
2029
|
-
GoABadgeComponent,
|
|
2030
|
-
GoAAppVersionHeaderComponent,
|
|
2031
|
-
GoANumberInputComponent,
|
|
2032
|
-
],
|
|
2033
|
-
providers: [],
|
|
2034
|
-
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
2035
|
-
},] }
|
|
2036
|
-
];
|
|
110
|
+
try {
|
|
111
|
+
this.value = JSON.parse(value);
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
// we still need to trigger the events to prevent any previous valid value to remain set.
|
|
115
|
+
const v = value.match(/^[\w\s,]*$/) ? value.split(",") : undefined;
|
|
116
|
+
this._setValue(v);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
_setValue(value) {
|
|
120
|
+
this._value = value;
|
|
121
|
+
this.onChange(value);
|
|
122
|
+
this.onTouched();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
ValuesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValuesDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
126
|
+
ValuesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ValuesDirective, selector: "[goaValues]", host: { listeners: { "_change": "listenForValueChange($event.detail.value)" } }, providers: [
|
|
127
|
+
{
|
|
128
|
+
provide: NG_VALUE_ACCESSOR,
|
|
129
|
+
useExisting: forwardRef(() => ValuesDirective),
|
|
130
|
+
multi: true,
|
|
131
|
+
},
|
|
132
|
+
], ngImport: i0 });
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValuesDirective, decorators: [{
|
|
134
|
+
type: Directive,
|
|
135
|
+
args: [{
|
|
136
|
+
selector: "[goaValues]",
|
|
137
|
+
providers: [
|
|
138
|
+
{
|
|
139
|
+
provide: NG_VALUE_ACCESSOR,
|
|
140
|
+
useExisting: forwardRef(() => ValuesDirective),
|
|
141
|
+
multi: true,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
}]
|
|
145
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { listenForValueChange: [{
|
|
146
|
+
type: HostListener,
|
|
147
|
+
args: ["_change", ["$event.detail.value"]]
|
|
148
|
+
}] } });
|
|
2037
149
|
|
|
2038
150
|
/**
|
|
2039
151
|
* Generated bundle index. Do not edit.
|
|
2040
152
|
*/
|
|
2041
153
|
|
|
2042
|
-
export { AngularComponentsModule,
|
|
154
|
+
export { AngularComponentsModule, ValueDirective, ValuesDirective };
|
|
2043
155
|
//# sourceMappingURL=abgov-angular-components.js.map
|