@carefirst/library 1.3.10 → 1.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/carefirst-library.mjs +2 -0
- package/esm2022/lib/components/alert/alert.component.mjs +56 -0
- package/esm2022/lib/components/badge/badge.component.mjs +39 -0
- package/esm2022/lib/components/button/button.component.mjs +87 -0
- package/esm2022/lib/components/calendar/calendar.component.mjs +39 -0
- package/esm2022/lib/components/chat-bubble/chat-bubble.component.mjs +31 -0
- package/esm2022/lib/components/form-input/form-input.component.mjs +87 -0
- package/esm2022/lib/components/form-input-select/form-input-select.component.mjs +46 -0
- package/esm2022/lib/components/form-input-text-area/form-input-text-area.component.mjs +61 -0
- package/esm2022/lib/components/form-validation/form-validation.component.mjs +20 -0
- package/esm2022/lib/components/icon/icon.component.mjs +29 -0
- package/esm2022/lib/components/logo/logo.component.mjs +18 -0
- package/esm2022/lib/components/notification/notification.component.mjs +22 -0
- package/esm2022/lib/components/page/page.component.mjs +31 -0
- package/esm2022/lib/components/spacer/spacer.component.mjs +30 -0
- package/esm2022/lib/components/spinner/spinner.component.mjs +19 -0
- package/esm2022/lib/directives/button-loader.directive.mjs +41 -0
- package/esm2022/lib/interfaces/alert.interface.mjs +2 -0
- package/esm2022/lib/interfaces/icon.interface.mjs +52 -0
- package/esm2022/lib/interfaces/input.interface.mjs +2 -0
- package/esm2022/lib/interfaces/notification.interface.mjs +2 -0
- package/esm2022/lib/interfaces/spacer.interface.mjs +2 -0
- package/esm2022/lib/library.module.mjs +100 -0
- package/esm2022/lib/utils/attribute.util.mjs +34 -0
- package/esm2022/lib/utils/form-validators-utility.mjs +113 -0
- package/esm2022/public-api.mjs +24 -0
- package/fesm2022/carefirst-library.mjs +885 -0
- package/fesm2022/carefirst-library.mjs.map +1 -0
- package/index.d.ts +2 -0
- package/lib/components/alert/alert.component.d.ts +14 -0
- package/lib/components/badge/badge.component.d.ts +15 -0
- package/lib/components/button/button.component.d.ts +30 -0
- package/lib/components/calendar/calendar.component.d.ts +15 -0
- package/lib/components/chat-bubble/chat-bubble.component.d.ts +13 -0
- package/lib/components/form-input/form-input.component.d.ts +37 -0
- package/lib/components/form-input-select/form-input-select.component.d.ts +21 -0
- package/lib/components/form-input-text-area/form-input-text-area.component.d.ts +27 -0
- package/lib/components/form-validation/form-validation.component.d.ts +9 -0
- package/lib/components/icon/icon.component.d.ts +13 -0
- package/lib/components/logo/logo.component.d.ts +7 -0
- package/lib/components/notification/notification.component.d.ts +9 -0
- package/lib/components/page/page.component.d.ts +13 -0
- package/lib/components/spacer/spacer.component.d.ts +14 -0
- package/lib/components/spinner/spinner.component.d.ts +9 -0
- package/lib/directives/button-loader.directive.d.ts +12 -0
- package/lib/interfaces/alert.interface.d.ts +11 -0
- package/lib/interfaces/icon.interface.d.ts +4 -0
- package/lib/interfaces/input.interface.d.ts +4 -0
- package/lib/interfaces/notification.interface.d.ts +11 -0
- package/lib/interfaces/spacer.interface.d.ts +3 -0
- package/lib/library.module.d.ts +25 -0
- package/lib/utils/attribute.util.d.ts +4 -0
- package/lib/utils/form-validators-utility.d.ts +8 -0
- package/package.json +14 -11
- package/{src/public-api.ts → public-api.d.ts} +0 -18
- package/.eslintrc.json +0 -31
- package/ng-package.json +0 -8
- package/src/lib/components/alert/alert.component.html +0 -0
- package/src/lib/components/alert/alert.component.scss +0 -63
- package/src/lib/components/alert/alert.component.spec.ts +0 -23
- package/src/lib/components/alert/alert.component.ts +0 -73
- package/src/lib/components/badge/badge.component.html +0 -5
- package/src/lib/components/badge/badge.component.scss +0 -96
- package/src/lib/components/badge/badge.component.spec.ts +0 -23
- package/src/lib/components/badge/badge.component.ts +0 -61
- package/src/lib/components/button/button.component.html +0 -20
- package/src/lib/components/button/button.component.scss +0 -153
- package/src/lib/components/button/button.component.spec.ts +0 -21
- package/src/lib/components/button/button.component.ts +0 -94
- package/src/lib/components/calendar/calendar.component.html +0 -9
- package/src/lib/components/calendar/calendar.component.scss +0 -34
- package/src/lib/components/calendar/calendar.component.spec.ts +0 -23
- package/src/lib/components/calendar/calendar.component.ts +0 -53
- package/src/lib/components/chat-bubble/chat-bubble.component.html +0 -9
- package/src/lib/components/chat-bubble/chat-bubble.component.scss +0 -31
- package/src/lib/components/chat-bubble/chat-bubble.component.spec.ts +0 -23
- package/src/lib/components/chat-bubble/chat-bubble.component.ts +0 -43
- package/src/lib/components/form-input/form-input.component.html +0 -37
- package/src/lib/components/form-input/form-input.component.scss +0 -23
- package/src/lib/components/form-input/form-input.component.spec.ts +0 -23
- package/src/lib/components/form-input/form-input.component.ts +0 -95
- package/src/lib/components/form-input-select/form-input-select.component.html +0 -27
- package/src/lib/components/form-input-select/form-input-select.component.scss +0 -40
- package/src/lib/components/form-input-select/form-input-select.component.spec.ts +0 -23
- package/src/lib/components/form-input-select/form-input-select.component.ts +0 -61
- package/src/lib/components/form-input-text-area/form-input-text-area.component.html +0 -29
- package/src/lib/components/form-input-text-area/form-input-text-area.component.scss +0 -19
- package/src/lib/components/form-input-text-area/form-input-text-area.component.spec.ts +0 -23
- package/src/lib/components/form-input-text-area/form-input-text-area.component.ts +0 -76
- package/src/lib/components/form-validation/form-validation.component.html +0 -8
- package/src/lib/components/form-validation/form-validation.component.scss +0 -8
- package/src/lib/components/form-validation/form-validation.component.spec.ts +0 -23
- package/src/lib/components/form-validation/form-validation.component.ts +0 -34
- package/src/lib/components/icon/icon.component.html +0 -529
- package/src/lib/components/icon/icon.component.scss +0 -61
- package/src/lib/components/icon/icon.component.spec.ts +0 -21
- package/src/lib/components/icon/icon.component.ts +0 -40
- package/src/lib/components/logo/logo.component.html +0 -10
- package/src/lib/components/logo/logo.component.scss +0 -5
- package/src/lib/components/logo/logo.component.spec.ts +0 -23
- package/src/lib/components/logo/logo.component.ts +0 -21
- package/src/lib/components/notification/notification.component.html +0 -39
- package/src/lib/components/notification/notification.component.scss +0 -20
- package/src/lib/components/notification/notification.component.spec.ts +0 -21
- package/src/lib/components/notification/notification.component.ts +0 -23
- package/src/lib/components/page/page.component.html +0 -5
- package/src/lib/components/page/page.component.scss +0 -35
- package/src/lib/components/page/page.component.spec.ts +0 -21
- package/src/lib/components/page/page.component.ts +0 -42
- package/src/lib/components/spacer/spacer.component.html +0 -4
- package/src/lib/components/spacer/spacer.component.scss +0 -27
- package/src/lib/components/spacer/spacer.component.spec.ts +0 -21
- package/src/lib/components/spacer/spacer.component.ts +0 -43
- package/src/lib/components/spinner/spinner.component.html +0 -1
- package/src/lib/components/spinner/spinner.component.scss +0 -14
- package/src/lib/components/spinner/spinner.component.spec.ts +0 -23
- package/src/lib/components/spinner/spinner.component.ts +0 -33
- package/src/lib/directives/button-loader.directive.spec.ts +0 -8
- package/src/lib/directives/button-loader.directive.ts +0 -77
- package/src/lib/interfaces/alert.interface.ts +0 -20
- package/src/lib/interfaces/icon.interface.ts +0 -62
- package/src/lib/interfaces/input.interface.ts +0 -8
- package/src/lib/interfaces/notification.interface.ts +0 -15
- package/src/lib/interfaces/spacer.interface.ts +0 -6
- package/src/lib/library.module.ts +0 -66
- package/src/lib/utils/attribute.util.ts +0 -66
- package/src/lib/utils/form-validators-utility.ts +0 -186
- package/tsconfig.lib.json +0 -12
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
@@ -0,0 +1,61 @@
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
2
|
+
import { validateStringValue, checkTruthAttribute } from '../../utils/attribute.util';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@ionic/angular";
|
5
|
+
import * as i2 from "@angular/common";
|
6
|
+
import * as i3 from "@angular/forms";
|
7
|
+
import * as i4 from "../form-validation/form-validation.component";
|
8
|
+
const inputTextAreaC = {
|
9
|
+
labelPlacement: ['fixed', 'floating', 'stacked', 'start', 'end'],
|
10
|
+
autoCapitalize: ['off', 'none', 'on', 'sentences', 'words', 'characters'],
|
11
|
+
};
|
12
|
+
export class FormInputTextAreaComponent {
|
13
|
+
label;
|
14
|
+
labelPlacement;
|
15
|
+
placeholder;
|
16
|
+
autoCapitalize;
|
17
|
+
control;
|
18
|
+
textCenter;
|
19
|
+
minHeight = 'none';
|
20
|
+
maxHeight = 'none';
|
21
|
+
value;
|
22
|
+
valueChange = new EventEmitter();
|
23
|
+
inputLabelPlacement;
|
24
|
+
inputClear = true;
|
25
|
+
inputTextCenter = false;
|
26
|
+
inputAutoCapitalize;
|
27
|
+
ngOnChanges(changes) {
|
28
|
+
this.inputLabelPlacement =
|
29
|
+
validateStringValue(changes, 'labelPlacement', inputTextAreaC.labelPlacement.slice(), this.inputLabelPlacement) || 'floating';
|
30
|
+
this.inputTextCenter = checkTruthAttribute(changes, 'textCenter', this.inputTextCenter);
|
31
|
+
this.inputAutoCapitalize =
|
32
|
+
validateStringValue(changes, 'autoCapitalize', inputTextAreaC.autoCapitalize.slice(), this.inputAutoCapitalize) || 'none';
|
33
|
+
}
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormInputTextAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.9", type: FormInputTextAreaComponent, selector: "cf-form-input-text-area", inputs: { label: "label", labelPlacement: "labelPlacement", placeholder: "placeholder", autoCapitalize: "autoCapitalize", control: "control", textCenter: "textCenter", minHeight: "minHeight", maxHeight: "maxHeight", value: "value" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "<!-- ngModel -->\n<ion-textarea\n [style]=\"'min-height: ' + minHeight + '; max-height: ' + maxHeight\"\n *ngIf=\"!control\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'text-center': inputTextCenter }\"\n [label]=\"label\"\n [labelPlacement]=\"inputLabelPlacement\"\n fill=\"outline\"\n [autocapitalize]=\"autoCapitalize\"\n [autoGrow]=\"true\"\n mode=\"md\"\n (ionInput)=\"valueChange.emit($event.detail.value ?? undefined)\"\n [value]=\"value\"></ion-textarea>\n<!-- Form Control -->\n<ion-textarea\n [style]=\"'min-height: ' + minHeight + '; max-height: ' + maxHeight\"\n *ngIf=\"control\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'text-center': inputTextCenter }\"\n [label]=\"label\"\n [labelPlacement]=\"inputLabelPlacement\"\n fill=\"outline\"\n [autocapitalize]=\"autoCapitalize\"\n [autoGrow]=\"true\"\n mode=\"md\"\n [formControl]=\"control\"\n (ionInput)=\"valueChange.emit($event.detail.value ?? undefined)\"></ion-textarea>\n<cf-form-validation *ngIf=\"control\" [control]=\"control\"></cf-form-validation>\n", styles: ["ion-textarea{font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:1.6rem;color:var(--cf-app-text-color-default);text-align:start;--border-radius: 8px !important;--highlight-color-focused: var(--cf-app-color-primary);--highlight-color-invalid: var(--cf-app-system-color-error);--highlight-color-valid: var(--cf-app-color-primary)}ion-textarea.text-center{text-align:center}\n"], dependencies: [{ kind: "component", type: i1.IonTextarea, selector: "ion-textarea", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "legacy", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "shape", "spellcheck", "value", "wrap"] }, { kind: "directive", type: i1.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar,ion-range" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4.FormValidationComponent, selector: "cf-form-validation", inputs: ["control"] }] });
|
36
|
+
}
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormInputTextAreaComponent, decorators: [{
|
38
|
+
type: Component,
|
39
|
+
args: [{ selector: 'cf-form-input-text-area', template: "<!-- ngModel -->\n<ion-textarea\n [style]=\"'min-height: ' + minHeight + '; max-height: ' + maxHeight\"\n *ngIf=\"!control\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'text-center': inputTextCenter }\"\n [label]=\"label\"\n [labelPlacement]=\"inputLabelPlacement\"\n fill=\"outline\"\n [autocapitalize]=\"autoCapitalize\"\n [autoGrow]=\"true\"\n mode=\"md\"\n (ionInput)=\"valueChange.emit($event.detail.value ?? undefined)\"\n [value]=\"value\"></ion-textarea>\n<!-- Form Control -->\n<ion-textarea\n [style]=\"'min-height: ' + minHeight + '; max-height: ' + maxHeight\"\n *ngIf=\"control\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'text-center': inputTextCenter }\"\n [label]=\"label\"\n [labelPlacement]=\"inputLabelPlacement\"\n fill=\"outline\"\n [autocapitalize]=\"autoCapitalize\"\n [autoGrow]=\"true\"\n mode=\"md\"\n [formControl]=\"control\"\n (ionInput)=\"valueChange.emit($event.detail.value ?? undefined)\"></ion-textarea>\n<cf-form-validation *ngIf=\"control\" [control]=\"control\"></cf-form-validation>\n", styles: ["ion-textarea{font-family:Roboto,sans-serif;font-weight:400;font-style:normal;font-size:1.6rem;color:var(--cf-app-text-color-default);text-align:start;--border-radius: 8px !important;--highlight-color-focused: var(--cf-app-color-primary);--highlight-color-invalid: var(--cf-app-system-color-error);--highlight-color-valid: var(--cf-app-color-primary)}ion-textarea.text-center{text-align:center}\n"] }]
|
40
|
+
}], propDecorators: { label: [{
|
41
|
+
type: Input
|
42
|
+
}], labelPlacement: [{
|
43
|
+
type: Input
|
44
|
+
}], placeholder: [{
|
45
|
+
type: Input
|
46
|
+
}], autoCapitalize: [{
|
47
|
+
type: Input
|
48
|
+
}], control: [{
|
49
|
+
type: Input
|
50
|
+
}], textCenter: [{
|
51
|
+
type: Input
|
52
|
+
}], minHeight: [{
|
53
|
+
type: Input
|
54
|
+
}], maxHeight: [{
|
55
|
+
type: Input
|
56
|
+
}], value: [{
|
57
|
+
type: Input
|
58
|
+
}], valueChange: [{
|
59
|
+
type: Output
|
60
|
+
}] } });
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1pbnB1dC10ZXh0LWFyZWEuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2FyZWZpcnN0L2xpYnJhcnkvc3JjL2xpYi9jb21wb25lbnRzL2Zvcm0taW5wdXQtdGV4dC1hcmVhL2Zvcm0taW5wdXQtdGV4dC1hcmVhLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NhcmVmaXJzdC9saWJyYXJ5L3NyYy9saWIvY29tcG9uZW50cy9mb3JtLWlucHV0LXRleHQtYXJlYS9mb3JtLWlucHV0LXRleHQtYXJlYS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFzQyxNQUFNLGVBQWUsQ0FBQztBQUczRyxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQzs7Ozs7O0FBTXRGLE1BQU0sY0FBYyxHQUFHO0lBQ3JCLGNBQWMsRUFBRSxDQUFDLE9BQU8sRUFBRSxVQUFVLEVBQUUsU0FBUyxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUM7SUFDaEUsY0FBYyxFQUFFLENBQUMsS0FBSyxFQUFFLE1BQU0sRUFBRSxJQ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sYWNlaG9sZGVyXCJcbiAgW25nQ2xhc3NdPVwieyAndGV4dC1jZW50ZXInOiBpbnB1dFRleHRDZW50ZXIgfVwiXG4gIFtsYWJlbF09XCJsYWJlbFwiXG4gIFtsYWJlbFBsYWNlbWVudF09XCJpbnB1dExhYmVsUGxhY2VtZW50XCJcbiAgZmlsbD1cIm91dGxpbmVcIlxuICBbYXV0b2NhcGl0YWxpemVdPVwiYXV0b0NhcGl0YWxpemVcIlxuICBbYXV0b0dyb3ddPVwidHJ1ZVwiXG4gIG1vZGU9XCJtZFwiXG4gIFtmb3JtQ29udHJvbF09XCJjb250cm9sXCJcbiAgKGlvbklucHV0KT1cInZhbHVlQ2hhbmdlLmVtaXQoJGV2ZW50LmRldGFpbC52YWx1ZSA/PyB1bmRlZmluZWQpXCI+PC9pb24tdGV4dGFyZWE+XG48Y2YtZm9ybS12YWxpZGF0aW9uICpuZ0lmPVwiY29udHJvbFwiIFtjb250cm9sXT1cImNvbnRyb2xcIj48L2NmLWZvcm0tdmFsaWRhdGlvbj5cbiJdfQ==
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
import * as i1 from "@angular/common";
|
4
|
+
export class FormValidationComponent {
|
5
|
+
control;
|
6
|
+
ngOnChanges(changes) {
|
7
|
+
if (changes['control'] && changes['control'].currentValue) {
|
8
|
+
this.control = changes['control'].currentValue;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormValidationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
12
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.9", type: FormValidationComponent, selector: "cf-form-validation", inputs: { control: "control" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"control?.dirty && control?.errors\" class=\"form-valid-feedback\">\n <div *ngFor=\"let error of this.control?.errors | keyvalue\">\n <p class=\"body-medium\" *ngIf=\"error.key === 'email'\">*Invalid email format</p>\n <p class=\"body-medium\" *ngIf=\"error.key === 'minlength'\">*Length required: {{ error.value.requiredLength - error.value.actualLength }}</p>\n <p class=\"body-medium\" *ngIf=\"error.key === 'maxlength'\">*Max Length: {{ error.value.requiredLength }}</p>\n <p class=\"body-medium\" *ngIf=\"error.key === 'errorMessage'\">*{{ error.value }}</p>\n </div>\n</div>\n", styles: [".form-valid-feedback{padding:4px 0 0 10px}.form-valid-feedback p{font-size:1.2rem;text-align:left;color:var(--cf-app-system-color-error)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }] });
|
13
|
+
}
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: FormValidationComponent, decorators: [{
|
15
|
+
type: Component,
|
16
|
+
args: [{ selector: 'cf-form-validation', template: "<div *ngIf=\"control?.dirty && control?.errors\" class=\"form-valid-feedback\">\n <div *ngFor=\"let error of this.control?.errors | keyvalue\">\n <p class=\"body-medium\" *ngIf=\"error.key === 'email'\">*Invalid email format</p>\n <p class=\"body-medium\" *ngIf=\"error.key === 'minlength'\">*Length required: {{ error.value.requiredLength - error.value.actualLength }}</p>\n <p class=\"body-medium\" *ngIf=\"error.key === 'maxlength'\">*Max Length: {{ error.value.requiredLength }}</p>\n <p class=\"body-medium\" *ngIf=\"error.key === 'errorMessage'\">*{{ error.value }}</p>\n </div>\n</div>\n", styles: [".form-valid-feedback{padding:4px 0 0 10px}.form-valid-feedback p{font-size:1.2rem;text-align:left;color:var(--cf-app-system-color-error)}\n"] }]
|
17
|
+
}], propDecorators: { control: [{
|
18
|
+
type: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