ngx-render-material-forms 2.5.12 → 2.5.13
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/esm2022/lib/FormioControl.mjs +36 -0
- package/esm2022/lib/components/Base.mjs +32 -0
- package/esm2022/lib/components/MaterialComponent.mjs +148 -0
- package/esm2022/lib/components/MaterialNestedComponent.mjs +38 -0
- package/esm2022/lib/components/Webform.mjs +18 -0
- package/esm2022/lib/components/add-on-products/add-on-products.component.mjs +841 -0
- package/esm2022/lib/components/button/button.component.mjs +101 -0
- package/esm2022/lib/components/calendar/calendar.component.mjs +127 -0
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +53 -0
- package/esm2022/lib/components/columns/columns.component.mjs +58 -0
- package/esm2022/lib/components/common.service.mjs +255 -0
- package/esm2022/lib/components/confirmation-dialog/confirmation-dialog.component.mjs +24 -0
- package/esm2022/lib/components/container/container.component.mjs +24 -0
- package/{esm2020 → esm2022}/lib/components/content/content.component.mjs +18 -18
- package/esm2022/lib/components/currency/currency.component.mjs +41 -0
- package/esm2022/lib/components/datagrid/datagrid.component.mjs +693 -0
- package/esm2022/lib/components/date/date.component.mjs +336 -0
- package/{esm2020 → esm2022}/lib/components/day/day.component.mjs +75 -75
- package/esm2022/lib/components/editgrid/editgrid.component.mjs +243 -0
- package/esm2022/lib/components/email/email.component.mjs +28 -0
- package/esm2022/lib/components/fieldset/fieldset.component.mjs +49 -0
- package/esm2022/lib/components/formio-form-field/formio-form-field.component.mjs +56 -0
- package/esm2022/lib/components/formio.wizard.mjs +88 -0
- package/{esm2020 → esm2022}/lib/components/hidden/hidden.component.mjs +20 -20
- package/esm2022/lib/components/html/html.component.mjs +29 -0
- package/esm2022/lib/components/index.mjs +125 -0
- package/{esm2020 → esm2022}/lib/components/label/label.component.mjs +17 -17
- package/esm2022/lib/components/number/number.component.mjs +65 -0
- package/esm2022/lib/components/panel/panel.component.mjs +56 -0
- package/esm2022/lib/components/password/password.component.mjs +28 -0
- package/esm2022/lib/components/phonenumber/phonenumber.component.mjs +28 -0
- package/esm2022/lib/components/radio/radio.component.mjs +93 -0
- package/esm2022/lib/components/select/select.component.mjs +592 -0
- package/esm2022/lib/components/selectboxes/selectboxes.component.mjs +99 -0
- package/esm2022/lib/components/signature/signature.component.mjs +99 -0
- package/esm2022/lib/components/survey/survey.component.mjs +166 -0
- package/esm2022/lib/components/table/table.component.mjs +96 -0
- package/esm2022/lib/components/tabs/tabs.component.mjs +42 -0
- package/esm2022/lib/components/tags/tags.component.mjs +114 -0
- package/esm2022/lib/components/textarea/textarea.component.mjs +94 -0
- package/esm2022/lib/components/textfield/textfield.component.mjs +122 -0
- package/esm2022/lib/components/time/time.component.mjs +205 -0
- package/esm2022/lib/components/url/url.component.mjs +28 -0
- package/esm2022/lib/components/well/well.component.mjs +41 -0
- package/{esm2020 → esm2022}/lib/const/ButtonsThemes.mjs +16 -16
- package/{esm2020 → esm2022}/lib/const/LabelPositions.mjs +9 -9
- package/esm2022/lib/directives/mask.directive.mjs +65 -0
- package/esm2022/lib/formio.component.mjs +77 -0
- package/{esm2020 → esm2022}/lib/ngx-render-material-forms.component.mjs +15 -15
- package/esm2022/lib/ngx-render-material-forms.module.mjs +324 -0
- package/{esm2020 → esm2022}/lib/ngx-render-material-forms.service.mjs +14 -14
- package/{esm2020 → esm2022}/lib/renderer.mjs +12 -12
- package/{esm2020 → esm2022}/ngx-render-material-forms.js +4 -4
- package/{esm2020 → esm2022}/public-api.mjs +6 -6
- package/{fesm2020 → fesm2022}/ngx-render-material-forms.js +4209 -4285
- package/fesm2022/ngx-render-material-forms.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/FormioControl.d.ts +7 -7
- package/lib/components/Base.d.ts +2 -2
- package/lib/components/MaterialComponent.d.ts +30 -30
- package/lib/components/MaterialNestedComponent.d.ts +13 -13
- package/lib/components/Webform.d.ts +1 -1
- package/lib/components/add-on-products/add-on-products.component.d.ts +142 -142
- package/lib/components/button/button.component.d.ts +30 -30
- package/lib/components/calendar/calendar.component.d.ts +34 -34
- package/lib/components/checkbox/checkbox.component.d.ts +9 -9
- package/lib/components/columns/columns.component.d.ts +12 -12
- package/lib/components/common.service.d.ts +86 -86
- package/lib/components/confirmation-dialog/confirmation-dialog.component.d.ts +11 -11
- package/lib/components/container/container.component.d.ts +8 -8
- package/lib/components/content/content.component.d.ts +8 -8
- package/lib/components/currency/currency.component.d.ts +10 -10
- package/lib/components/datagrid/datagrid.component.d.ts +81 -81
- package/lib/components/date/date.component.d.ts +40 -40
- package/lib/components/day/day.component.d.ts +16 -16
- package/lib/components/editgrid/editgrid.component.d.ts +50 -50
- package/lib/components/email/email.component.d.ts +9 -9
- package/lib/components/fieldset/fieldset.component.d.ts +8 -8
- package/lib/components/formio-form-field/formio-form-field.component.d.ts +18 -18
- package/lib/components/formio.wizard.d.ts +19 -19
- package/lib/components/hidden/hidden.component.d.ts +8 -8
- package/lib/components/html/html.component.d.ts +11 -11
- package/lib/components/index.d.ts +2 -2
- package/lib/components/label/label.component.d.ts +6 -6
- package/lib/components/number/number.component.d.ts +18 -18
- package/lib/components/panel/panel.component.d.ts +8 -8
- package/lib/components/password/password.component.d.ts +9 -9
- package/lib/components/phonenumber/phonenumber.component.d.ts +9 -9
- package/lib/components/radio/radio.component.d.ts +12 -12
- package/lib/components/select/select.component.d.ts +77 -77
- package/lib/components/selectboxes/selectboxes.component.d.ts +15 -15
- package/lib/components/signature/signature.component.d.ts +12 -12
- package/lib/components/survey/survey.component.d.ts +14 -14
- package/lib/components/table/table.component.d.ts +12 -12
- package/lib/components/tabs/tabs.component.d.ts +9 -9
- package/lib/components/tags/tags.component.d.ts +15 -15
- package/lib/components/textarea/textarea.component.d.ts +13 -13
- package/lib/components/textfield/textfield.component.d.ts +18 -18
- package/lib/components/time/time.component.d.ts +27 -27
- package/lib/components/url/url.component.d.ts +9 -9
- package/lib/components/well/well.component.d.ts +8 -8
- package/lib/const/ButtonsThemes.d.ts +14 -14
- package/lib/const/LabelPositions.d.ts +8 -8
- package/lib/directives/mask.directive.d.ts +17 -17
- package/lib/formio.component.d.ts +15 -15
- package/lib/ngx-render-material-forms.component.d.ts +8 -8
- package/lib/ngx-render-material-forms.module.d.ts +110 -112
- package/lib/ngx-render-material-forms.service.d.ts +6 -6
- package/lib/renderer.d.ts +8 -8
- package/package.json +5 -11
- package/public-api.d.ts +3 -3
- package/esm2020/lib/FormioControl.mjs +0 -36
- package/esm2020/lib/components/Base.mjs +0 -32
- package/esm2020/lib/components/MaterialComponent.mjs +0 -145
- package/esm2020/lib/components/MaterialNestedComponent.mjs +0 -38
- package/esm2020/lib/components/Webform.mjs +0 -18
- package/esm2020/lib/components/add-on-products/add-on-products.component.mjs +0 -842
- package/esm2020/lib/components/button/button.component.mjs +0 -102
- package/esm2020/lib/components/calendar/calendar.component.mjs +0 -129
- package/esm2020/lib/components/checkbox/checkbox.component.mjs +0 -54
- package/esm2020/lib/components/columns/columns.component.mjs +0 -69
- package/esm2020/lib/components/common.service.mjs +0 -256
- package/esm2020/lib/components/confirmation-dialog/confirmation-dialog.component.mjs +0 -25
- package/esm2020/lib/components/container/container.component.mjs +0 -25
- package/esm2020/lib/components/currency/currency.component.mjs +0 -43
- package/esm2020/lib/components/datagrid/datagrid.component.mjs +0 -694
- package/esm2020/lib/components/date/date.component.mjs +0 -337
- package/esm2020/lib/components/editgrid/editgrid.component.mjs +0 -243
- package/esm2020/lib/components/email/email.component.mjs +0 -30
- package/esm2020/lib/components/fieldset/fieldset.component.mjs +0 -50
- package/esm2020/lib/components/formio-form-field/formio-form-field.component.mjs +0 -57
- package/esm2020/lib/components/formio.wizard.mjs +0 -88
- package/esm2020/lib/components/html/html.component.mjs +0 -29
- package/esm2020/lib/components/index.mjs +0 -125
- package/esm2020/lib/components/number/number.component.mjs +0 -67
- package/esm2020/lib/components/panel/panel.component.mjs +0 -57
- package/esm2020/lib/components/password/password.component.mjs +0 -30
- package/esm2020/lib/components/phonenumber/phonenumber.component.mjs +0 -30
- package/esm2020/lib/components/radio/radio.component.mjs +0 -96
- package/esm2020/lib/components/select/select.component.mjs +0 -593
- package/esm2020/lib/components/selectboxes/selectboxes.component.mjs +0 -102
- package/esm2020/lib/components/signature/signature.component.mjs +0 -103
- package/esm2020/lib/components/survey/survey.component.mjs +0 -167
- package/esm2020/lib/components/table/table.component.mjs +0 -97
- package/esm2020/lib/components/tabs/tabs.component.mjs +0 -43
- package/esm2020/lib/components/tags/tags.component.mjs +0 -117
- package/esm2020/lib/components/textarea/textarea.component.mjs +0 -98
- package/esm2020/lib/components/textfield/textfield.component.mjs +0 -124
- package/esm2020/lib/components/time/time.component.mjs +0 -206
- package/esm2020/lib/components/url/url.component.mjs +0 -30
- package/esm2020/lib/components/well/well.component.mjs +0 -43
- package/esm2020/lib/directives/mask.directive.mjs +0 -65
- package/esm2020/lib/formio.component.mjs +0 -80
- package/esm2020/lib/ngx-render-material-forms.module.mjs +0 -378
- package/fesm2015/ngx-render-material-forms.js +0 -5848
- package/fesm2015/ngx-render-material-forms.mjs.map +0 -1
- package/fesm2020/ngx-render-material-forms.mjs.map +0 -1
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
|
3
|
-
import TagsComponent from 'formiojs/components/tags/Tags.js';
|
|
4
|
-
import { MaterialComponent } from '../MaterialComponent';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@angular/common";
|
|
7
|
-
import * as i2 from "@angular/forms";
|
|
8
|
-
import * as i3 from "@angular/material/form-field";
|
|
9
|
-
import * as i4 from "@angular/material/chips";
|
|
10
|
-
import * as i5 from "@angular/material/icon";
|
|
11
|
-
import * as i6 from "@angular/flex-layout/flex";
|
|
12
|
-
import * as i7 from "../formio-form-field/formio-form-field.component";
|
|
13
|
-
import * as i8 from "../label/label.component";
|
|
14
|
-
export class MaterialTagsComponent extends MaterialComponent {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.separatorKeysCodes = [ENTER, COMMA];
|
|
18
|
-
this.tags = [];
|
|
19
|
-
}
|
|
20
|
-
add(event) {
|
|
21
|
-
const input = event.input;
|
|
22
|
-
const value = event.value;
|
|
23
|
-
if ((value || '').trim()) {
|
|
24
|
-
this.tags.push(value.trim());
|
|
25
|
-
}
|
|
26
|
-
if (input) {
|
|
27
|
-
input.value = '';
|
|
28
|
-
}
|
|
29
|
-
this.onChange();
|
|
30
|
-
}
|
|
31
|
-
remove(index) {
|
|
32
|
-
if (index >= 0 && index < this.tags.length) {
|
|
33
|
-
this.tags.splice(index, 1);
|
|
34
|
-
}
|
|
35
|
-
this.onChange();
|
|
36
|
-
}
|
|
37
|
-
getValue() {
|
|
38
|
-
return (this.instance.component.storeas === 'string') ? this.tags.join(this.instance.delimiter) : this.tags;
|
|
39
|
-
}
|
|
40
|
-
setValue(value) {
|
|
41
|
-
if (typeof value === 'string') {
|
|
42
|
-
value = value.split(this.instance.delimiter);
|
|
43
|
-
}
|
|
44
|
-
if (value && !Array.isArray(value)) {
|
|
45
|
-
value = [value];
|
|
46
|
-
}
|
|
47
|
-
this.tags = value;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
MaterialTagsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTagsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
-
MaterialTagsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MaterialTagsComponent, selector: "mat-formio-tags", usesInheritance: true, ngImport: i0, template: `
|
|
52
|
-
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
53
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
54
|
-
<mat-form-field class="example-chip-list" fxFill>
|
|
55
|
-
|
|
56
|
-
<mat-label *ngIf="hasLabel">
|
|
57
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
58
|
-
</mat-label>
|
|
59
|
-
|
|
60
|
-
<mat-chip-list #chipList [attr.aria-label]="instance.component.label">
|
|
61
|
-
<mat-chip *ngFor="let tag of tags; index as i;"
|
|
62
|
-
[selectable]="true"
|
|
63
|
-
[removable]="true"
|
|
64
|
-
(removed)="remove(i)"
|
|
65
|
-
>
|
|
66
|
-
{{tag}}
|
|
67
|
-
<mat-icon matChipRemove>cancel</mat-icon>
|
|
68
|
-
</mat-chip>
|
|
69
|
-
|
|
70
|
-
<input [formControl]="control"
|
|
71
|
-
[matChipInputFor]="chipList"
|
|
72
|
-
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
|
|
73
|
-
[matChipInputAddOnBlur]="true"
|
|
74
|
-
(matChipInputTokenEnd)="add($event)"
|
|
75
|
-
>
|
|
76
|
-
</mat-chip-list>
|
|
77
|
-
</mat-form-field>
|
|
78
|
-
</ng-template>
|
|
79
|
-
`, isInline: true, 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: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i4.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i4.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "component", type: i7.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i8.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTagsComponent, decorators: [{
|
|
81
|
-
type: Component,
|
|
82
|
-
args: [{
|
|
83
|
-
selector: 'mat-formio-tags',
|
|
84
|
-
template: `
|
|
85
|
-
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
86
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
87
|
-
<mat-form-field class="example-chip-list" fxFill>
|
|
88
|
-
|
|
89
|
-
<mat-label *ngIf="hasLabel">
|
|
90
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
91
|
-
</mat-label>
|
|
92
|
-
|
|
93
|
-
<mat-chip-list #chipList [attr.aria-label]="instance.component.label">
|
|
94
|
-
<mat-chip *ngFor="let tag of tags; index as i;"
|
|
95
|
-
[selectable]="true"
|
|
96
|
-
[removable]="true"
|
|
97
|
-
(removed)="remove(i)"
|
|
98
|
-
>
|
|
99
|
-
{{tag}}
|
|
100
|
-
<mat-icon matChipRemove>cancel</mat-icon>
|
|
101
|
-
</mat-chip>
|
|
102
|
-
|
|
103
|
-
<input [formControl]="control"
|
|
104
|
-
[matChipInputFor]="chipList"
|
|
105
|
-
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
|
|
106
|
-
[matChipInputAddOnBlur]="true"
|
|
107
|
-
(matChipInputTokenEnd)="add($event)"
|
|
108
|
-
>
|
|
109
|
-
</mat-chip-list>
|
|
110
|
-
</mat-form-field>
|
|
111
|
-
</ng-template>
|
|
112
|
-
`
|
|
113
|
-
}]
|
|
114
|
-
}] });
|
|
115
|
-
TagsComponent.MaterialComponent = MaterialTagsComponent;
|
|
116
|
-
export { TagsComponent };
|
|
117
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFncy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtcmVuZGVyLW1hdGVyaWFsLWZvcm1zL3NyYy9saWIvY29tcG9uZW50cy90YWdzL3RhZ3MuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT0FBTyxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNyRCxPQUFPLGFBQWEsTUFBTSxrQ0FBa0MsQ0FBQztBQUM3RCxPQUFPLEVBQUUsaUJBQ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9O1xyXG4iXX0=
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Component, ViewChild } from '@angular/core';
|
|
2
|
-
import { MaterialComponent } from '../MaterialComponent';
|
|
3
|
-
import TextAreaComponent from 'formiojs/components/textarea/TextArea.js';
|
|
4
|
-
import isNil from 'lodash/isNil';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@angular/common";
|
|
7
|
-
import * as i2 from "@angular/forms";
|
|
8
|
-
import * as i3 from "@angular/material/form-field";
|
|
9
|
-
import * as i4 from "@angular/material/input";
|
|
10
|
-
import * as i5 from "@angular/flex-layout/flex";
|
|
11
|
-
import * as i6 from "@angular/flex-layout/extended";
|
|
12
|
-
import * as i7 from "../formio-form-field/formio-form-field.component";
|
|
13
|
-
import * as i8 from "../label/label.component";
|
|
14
|
-
export class MaterialTextareaComponent extends MaterialComponent {
|
|
15
|
-
ngAfterViewInit() {
|
|
16
|
-
if (this.element && this.element.nativeElement && this.instance) {
|
|
17
|
-
// Add custom classes to elements.
|
|
18
|
-
if (this.instance.component.customClass) {
|
|
19
|
-
this.element.nativeElement.classList.add(this.instance.component.customClass);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
// Attach the element so the wysiwyg will work.
|
|
23
|
-
this.instance.attachElement(this.textarea.nativeElement);
|
|
24
|
-
}
|
|
25
|
-
getErrorMessage() {
|
|
26
|
-
// Check if instance and necessary properties exist
|
|
27
|
-
if (this.instance && this.instance.parent && this.instance.parent._data) {
|
|
28
|
-
if (this.instance.parent._data.submit) {
|
|
29
|
-
this.control.markAllAsTouched();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// Return the error message if it exists
|
|
33
|
-
return this.instance.error ? this.instance.error.message : '';
|
|
34
|
-
}
|
|
35
|
-
getValue() {
|
|
36
|
-
return isNil(this.control.value) ? '' : this.control.value;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
MaterialTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
-
MaterialTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MaterialTextareaComponent, selector: "mat-formio-textarea", viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
41
|
-
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
42
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
43
|
-
<mat-form-field class="mat-formio-textarea"
|
|
44
|
-
[ngClass]="{'editor-enabled': !!instance.component.editor}"
|
|
45
|
-
fxFill
|
|
46
|
-
fxFlexAlign="center"
|
|
47
|
-
>
|
|
48
|
-
<mat-label fxFill *ngIf="hasLabel">
|
|
49
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
50
|
-
</mat-label>
|
|
51
|
-
<span *ngIf="instance.component.prefix" matPrefix>{{ instance.component.prefix }} </span>
|
|
52
|
-
<textarea matInput
|
|
53
|
-
[placeholder]="instance.component.placeholder"
|
|
54
|
-
[formControl]="control"
|
|
55
|
-
[rows]="(instance.component.rows || 3)"
|
|
56
|
-
(input)="onChange()"
|
|
57
|
-
#textarea
|
|
58
|
-
>
|
|
59
|
-
</textarea>
|
|
60
|
-
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
61
|
-
<mat-error *ngIf="instance.error">{{ getErrorMessage() }}</mat-error>
|
|
62
|
-
</mat-form-field>
|
|
63
|
-
</ng-template>
|
|
64
|
-
`, isInline: true, styles: [".mat-input-element{min-height:16px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i5.DefaultFlexAlignDirective, selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]", inputs: ["fxFlexAlign", "fxFlexAlign.xs", "fxFlexAlign.sm", "fxFlexAlign.md", "fxFlexAlign.lg", "fxFlexAlign.xl", "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg"] }, { kind: "directive", type: i6.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i7.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i8.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTextareaComponent, decorators: [{
|
|
66
|
-
type: Component,
|
|
67
|
-
args: [{ selector: 'mat-formio-textarea', template: `
|
|
68
|
-
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
69
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
70
|
-
<mat-form-field class="mat-formio-textarea"
|
|
71
|
-
[ngClass]="{'editor-enabled': !!instance.component.editor}"
|
|
72
|
-
fxFill
|
|
73
|
-
fxFlexAlign="center"
|
|
74
|
-
>
|
|
75
|
-
<mat-label fxFill *ngIf="hasLabel">
|
|
76
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
77
|
-
</mat-label>
|
|
78
|
-
<span *ngIf="instance.component.prefix" matPrefix>{{ instance.component.prefix }} </span>
|
|
79
|
-
<textarea matInput
|
|
80
|
-
[placeholder]="instance.component.placeholder"
|
|
81
|
-
[formControl]="control"
|
|
82
|
-
[rows]="(instance.component.rows || 3)"
|
|
83
|
-
(input)="onChange()"
|
|
84
|
-
#textarea
|
|
85
|
-
>
|
|
86
|
-
</textarea>
|
|
87
|
-
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
88
|
-
<mat-error *ngIf="instance.error">{{ getErrorMessage() }}</mat-error>
|
|
89
|
-
</mat-form-field>
|
|
90
|
-
</ng-template>
|
|
91
|
-
`, styles: [".mat-input-element{min-height:16px}\n"] }]
|
|
92
|
-
}], propDecorators: { textarea: [{
|
|
93
|
-
type: ViewChild,
|
|
94
|
-
args: ['textarea']
|
|
95
|
-
}] } });
|
|
96
|
-
TextAreaComponent.MaterialComponent = MaterialTextareaComponent;
|
|
97
|
-
export { TextAreaComponent };
|
|
98
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJlbmRlci1tYXRlcmlhbC1mb3Jtcy9zcmMvbGliL2NvbXBvbmVudHMvdGV4dGFyZWEvdGV4dGFyZWEuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUE2QixNQUFNLGVBQWUsQ0FBQztBQUNoRixPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN6RCxPQUFPLGlCQUFpQixNQUFNLDBDQUEwQyxDQUFDO0FBQ3pFLE9BQU8sS0FBSyxNQUFNLGNBQWMsQ0FBQzs7Ozs7Ozs7OztBQStCakMsTUFBTSxPQUFPLHlCQUEwQixTQUFRLGlCQUFpQjtJQUc5RCxlQUFlO1FBQ2IsSUFBSSxJQUFJLENBQUMsT0FBTyxJ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xyXG4gICAgdGhpcy5pbnN0YW5jZS5hdHRhY2hFbGVtZW50KHRoaXMudGV4dGFyZWEubmF0aXZlRWxlbWVudCk7XHJcbiAgfVxyXG5cclxuICBnZXRFcnJvck1lc3NhZ2UoKSB7XHJcbiAgICAvLyBDaGVjayBpZiBpbnN0YW5jZSBhbmQgbmVjZXNzYXJ5IHByb3BlcnRpZXMgZXhpc3RcclxuICAgIGlmICh0aGlzLmluc3RhbmNlICYmIHRoaXMuaW5zdGFuY2UucGFyZW50ICYmIHRoaXMuaW5zdGFuY2UucGFyZW50Ll9kYXRhKSB7XHJcbiAgICAgIGlmICh0aGlzLmluc3RhbmNlLnBhcmVudC5fZGF0YS5zdWJtaXQpIHtcclxuICAgICAgICB0aGlzLmNvbnRyb2wubWFya0FsbEFzVG91Y2hlZCgpO1xyXG4gICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLy8gUmV0dXJuIHRoZSBlcnJvciBtZXNzYWdlIGlmIGl0IGV4aXN0c1xyXG4gICAgcmV0dXJuIHRoaXMuaW5zdGFuY2UuZXJyb3IgPyB0aGlzLmluc3RhbmNlLmVycm9yLm1lc3NhZ2UgOiAnJztcclxuICB9XHJcblxyXG5cclxuICBnZXRWYWx1ZSgpIHtcclxuICAgIHJldHVybiBpc05pbCh0aGlzLmNvbnRyb2wudmFsdWUpID8gJycgOiB0aGlzLmNvbnRyb2wudmFsdWU7XHJcbiAgfVxyXG59XHJcblRleHRBcmVhQ29tcG9uZW50Lk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxUZXh0YXJlYUNvbXBvbmVudDtcclxuZXhwb3J0IHsgVGV4dEFyZWFDb21wb25lbnQgfTtcclxuIl19
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import TextFieldComponent from 'formiojs/components/textfield/TextField.js';
|
|
3
|
-
import { MaterialComponent } from '../MaterialComponent';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@angular/common";
|
|
6
|
-
import * as i2 from "@angular/forms";
|
|
7
|
-
import * as i3 from "@angular/material/form-field";
|
|
8
|
-
import * as i4 from "@angular/material/input";
|
|
9
|
-
import * as i5 from "@angular/flex-layout/flex";
|
|
10
|
-
import * as i6 from "@angular/flex-layout/extended";
|
|
11
|
-
import * as i7 from "../formio-form-field/formio-form-field.component";
|
|
12
|
-
import * as i8 from "../label/label.component";
|
|
13
|
-
export const TEXTFIELD_TEMPLATE = `
|
|
14
|
-
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
15
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
16
|
-
<mat-form-field [appearance]="getFormFieldAppearance()" fxFill>
|
|
17
|
-
|
|
18
|
-
<mat-label *ngIf="hasLabel">
|
|
19
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
20
|
-
</mat-label>
|
|
21
|
-
|
|
22
|
-
<span *ngIf="instance.component.prefix && instance.type !== 'currency'"
|
|
23
|
-
matPrefix
|
|
24
|
-
>
|
|
25
|
-
{{ instance.component.prefix }}
|
|
26
|
-
</span>
|
|
27
|
-
<input matInput
|
|
28
|
-
type="{{ inputType }}"
|
|
29
|
-
[formControl]="control"
|
|
30
|
-
[placeholder]="instance.component.placeholder"
|
|
31
|
-
(input)="onChange()" #input
|
|
32
|
-
[ngClass]="{ 'show-invalid': inputType=='email' }"
|
|
33
|
-
>
|
|
34
|
-
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
35
|
-
|
|
36
|
-
<mat-hint *ngIf="instance.component.showWordCount || instance.component.showCharCount">
|
|
37
|
-
{{ getHint() }}
|
|
38
|
-
</mat-hint>
|
|
39
|
-
|
|
40
|
-
<br/>
|
|
41
|
-
<mat-error *ngIf="isError()" >{{ getErrorMessage() }}</mat-error>
|
|
42
|
-
</mat-form-field>
|
|
43
|
-
</ng-template>
|
|
44
|
-
`;
|
|
45
|
-
export class MaterialTextfieldComponent extends MaterialComponent {
|
|
46
|
-
constructor() {
|
|
47
|
-
super(...arguments);
|
|
48
|
-
this.inputType = 'text';
|
|
49
|
-
}
|
|
50
|
-
ngAfterContentInit() {
|
|
51
|
-
if (this.instance && this.control && this.instance.component.disabled) {
|
|
52
|
-
this.control.disable();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
getHint() {
|
|
56
|
-
if (!this.instance || !this.control || !this.control.value) {
|
|
57
|
-
return '';
|
|
58
|
-
}
|
|
59
|
-
const { showWordCount, showCharCount } = this.instance.component;
|
|
60
|
-
if (showWordCount && showCharCount) {
|
|
61
|
-
return `${this.getWordsCount()} words, ${this.control.value.length} characters`;
|
|
62
|
-
}
|
|
63
|
-
else if (showWordCount) {
|
|
64
|
-
return `${this.getWordsCount()} words`;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
return `${this.control.value.length} characters`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
getWordsCount() {
|
|
71
|
-
const matches = this.control.value ? this.control.value.match(/[\w\d’'-]+/gi) : [];
|
|
72
|
-
return matches ? matches.length : 0;
|
|
73
|
-
}
|
|
74
|
-
getFormFieldAppearance() {
|
|
75
|
-
const appearances = ['legacy', 'standard', 'fill', 'outline'];
|
|
76
|
-
const appearance = this.instance.component.appearance ? this.instance.component.appearance.toLowerCase() : '';
|
|
77
|
-
return appearances.includes(appearance) ? appearance : undefined;
|
|
78
|
-
}
|
|
79
|
-
isError() {
|
|
80
|
-
if (this.instance.error) {
|
|
81
|
-
this.control.setErrors(this.instance.component.validate);
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
getErrorMessage() {
|
|
89
|
-
if (this.instance.error && this.instance.error.messages) {
|
|
90
|
-
const { messages } = this.instance.error;
|
|
91
|
-
if (messages.length) {
|
|
92
|
-
for (const msg of messages) {
|
|
93
|
-
//this.control.hasError(msg.context.validator)
|
|
94
|
-
if (this.instance.type == 'phoneNumber' || this.instance.type == 'email') {
|
|
95
|
-
this.controlHasError = true;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.controlHasError = this.control.hasError(msg.context.validator);
|
|
99
|
-
}
|
|
100
|
-
if (msg.context && this.controlHasError) {
|
|
101
|
-
if (this.instance && this.instance.parent && this.instance.parent._data) {
|
|
102
|
-
if (this.instance.parent._data.submit) {
|
|
103
|
-
this.control.markAllAsTouched();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return this.instance.error ? this.instance.error.message : '';
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
MaterialTextfieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTextfieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
-
MaterialTextfieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MaterialTextfieldComponent, selector: "mat-formio-textfield", usesInheritance: true, ngImport: i0, template: "\n <mat-formio-form-field [instance]=\"instance\" [componentTemplate]=\"componentTemplate\"></mat-formio-form-field>\n <ng-template #componentTemplate let-hasLabel>\n <mat-form-field [appearance]=\"getFormFieldAppearance()\" fxFill>\n\n <mat-label *ngIf=\"hasLabel\">\n <span [instance]=\"instance\" matFormioLabel></span>\n </mat-label>\n\n <span *ngIf=\"instance.component.prefix && instance.type !== 'currency'\"\n matPrefix\n >\n {{ instance.component.prefix }} \n </span>\n <input matInput\n type=\"{{ inputType }}\"\n [formControl]=\"control\"\n [placeholder]=\"instance.component.placeholder\"\n (input)=\"onChange()\" #input\n [ngClass]=\"{ 'show-invalid': inputType=='email' }\"\n >\n <span *ngIf=\"instance.component.suffix\" matSuffix>{{ instance.component.suffix }}</span>\n\n <mat-hint *ngIf=\"instance.component.showWordCount || instance.component.showCharCount\">\n {{ getHint() }}\n </mat-hint>\n\n <br/>\n <mat-error *ngIf=\"isError()\" >{{ getErrorMessage() }}</mat-error>\n </mat-form-field>\n </ng-template>\n", isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i6.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i7.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i8.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTextfieldComponent, decorators: [{
|
|
116
|
-
type: Component,
|
|
117
|
-
args: [{
|
|
118
|
-
selector: 'mat-formio-textfield',
|
|
119
|
-
template: TEXTFIELD_TEMPLATE
|
|
120
|
-
}]
|
|
121
|
-
}] });
|
|
122
|
-
TextFieldComponent.MaterialComponent = MaterialTextfieldComponent;
|
|
123
|
-
export { TextFieldComponent };
|
|
124
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGZpZWxkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZW5kZXItbWF0ZXJpYWwtZm9ybXMvc3JjL2xpYi9jb21wb25lbnRzL3RleHRmaWVsZC90ZXh0ZmllbGQuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQTRCLE1BQU0sZUFBZSxDQUFDO0FBQ3BFLE9BQU8sa0JBQWtCLE1BQU0sNENBQTRDLENBQUM7QUFDNUUsT0FBTyxFQUFFLGlC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uY2UucGFyZW50Ll9kYXRhKSB7XHJcbiAgICAgICAgICAgICAgaWYgKHRoaXMuaW5zdGFuY2UucGFyZW50Ll9kYXRhLnN1Ym1pdCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jb250cm9sLm1hcmtBbGxBc1RvdWNoZWQoKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5zdGFuY2UuZXJyb3IgPyB0aGlzLmluc3RhbmNlLmVycm9yLm1lc3NhZ2UgOiAnJztcclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9XHJcbn1cclxuVGV4dEZpZWxkQ29tcG9uZW50Lk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxUZXh0ZmllbGRDb21wb25lbnQ7XHJcbmV4cG9ydCB7IFRleHRGaWVsZENvbXBvbmVudCB9O1xyXG4iXX0=
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { FormControl } from '@angular/forms';
|
|
3
|
-
import { MaterialComponent } from '../MaterialComponent';
|
|
4
|
-
import TimeComponent from 'formiojs/components/time/Time.js';
|
|
5
|
-
import * as moment_ from 'moment';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@angular/common";
|
|
8
|
-
import * as i2 from "@angular/forms";
|
|
9
|
-
import * as i3 from "@angular/material/form-field";
|
|
10
|
-
import * as i4 from "@angular/flex-layout/flex";
|
|
11
|
-
import * as i5 from "../formio-form-field/formio-form-field.component";
|
|
12
|
-
import * as i6 from "../label/label.component";
|
|
13
|
-
export class MaterialTimeComponent extends MaterialComponent {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.disabled = false;
|
|
17
|
-
this.period = 'AM';
|
|
18
|
-
this.hourControl = new FormControl();
|
|
19
|
-
this.minuteControl = new FormControl();
|
|
20
|
-
this.secondControl = new FormControl();
|
|
21
|
-
this.selectedEvent = new EventEmitter();
|
|
22
|
-
this.hourStep = 1;
|
|
23
|
-
this.minuteStep = 1;
|
|
24
|
-
this.secondStep = 1;
|
|
25
|
-
this.renderElementOnly = false;
|
|
26
|
-
}
|
|
27
|
-
setDisabled(disabled) {
|
|
28
|
-
if (disabled) {
|
|
29
|
-
this.hourControl.disable();
|
|
30
|
-
this.minuteControl.disable();
|
|
31
|
-
this.secondControl.disable();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
get dataFormat() {
|
|
35
|
-
let format = this.instance.component.dataFormat;
|
|
36
|
-
format = format ? format : 'HH:mm';
|
|
37
|
-
return format;
|
|
38
|
-
}
|
|
39
|
-
setInstance(instance) {
|
|
40
|
-
super.setInstance(instance);
|
|
41
|
-
// this.control.setValue('00:00:00');
|
|
42
|
-
this.onChange();
|
|
43
|
-
}
|
|
44
|
-
onChange() {
|
|
45
|
-
const hours = this.hourControl.value;
|
|
46
|
-
const minutes = this.minuteControl.value || '00';
|
|
47
|
-
const seconds = this.secondControl.value || '';
|
|
48
|
-
const rawValue = `${hours || '00'}:${minutes}${seconds ? ':' + seconds : ''} ${this.period}`;
|
|
49
|
-
let value = this.getTwentyFourHourTime(rawValue);
|
|
50
|
-
if (!hours) {
|
|
51
|
-
value = this.instance.emptyValue;
|
|
52
|
-
}
|
|
53
|
-
this.control.setValue(value);
|
|
54
|
-
if (this.instance) {
|
|
55
|
-
super.onChange();
|
|
56
|
-
}
|
|
57
|
-
this.selectedEvent.emit(this.control);
|
|
58
|
-
}
|
|
59
|
-
setValue(value) {
|
|
60
|
-
if (!value) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
super.setValue(value);
|
|
64
|
-
const [hourValue, minuteValue, period] = value.split(':');
|
|
65
|
-
this.hourControl.setValue(hourValue);
|
|
66
|
-
this.minuteControl.setValue(minuteValue);
|
|
67
|
-
// fix for default value with seconds instead of period
|
|
68
|
-
this.period = period === ('AM' || 'PM') ? period : this.period;
|
|
69
|
-
}
|
|
70
|
-
getTwentyFourHourTime(amPmString) {
|
|
71
|
-
const moment = moment_;
|
|
72
|
-
return moment(amPmString, ['h:mm:ss A']).format(this.dataFormat);
|
|
73
|
-
}
|
|
74
|
-
changePeriod() {
|
|
75
|
-
this.period = this.period === 'AM' ? 'PM' : 'AM';
|
|
76
|
-
this.onChange();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
MaterialTimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
80
|
-
MaterialTimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MaterialTimeComponent, selector: "mat-formio-time", inputs: { hourStep: "hourStep", minuteStep: "minuteStep", secondStep: "secondStep", renderElementOnly: "renderElementOnly" }, outputs: { selectedEvent: "selectedEvent" }, usesInheritance: true, ngImport: i0, template: `
|
|
81
|
-
<mat-formio-form-field
|
|
82
|
-
[instance]="instance"
|
|
83
|
-
[componentTemplate]="componentTemplate"
|
|
84
|
-
[renderElementOnly]="renderElementOnly"
|
|
85
|
-
></mat-formio-form-field>
|
|
86
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
87
|
-
<mat-label fxFill *ngIf="hasLabel">
|
|
88
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
89
|
-
</mat-label>
|
|
90
|
-
|
|
91
|
-
<div style="display: block">
|
|
92
|
-
<div fxLayout="row" fxLayoutGap="5%">
|
|
93
|
-
<input
|
|
94
|
-
[formControl]="hourControl"
|
|
95
|
-
[step]="hourStep"
|
|
96
|
-
[min]="0"
|
|
97
|
-
[max]="12"
|
|
98
|
-
type="number"
|
|
99
|
-
fxFlex="25%"
|
|
100
|
-
(input)="onChange()"
|
|
101
|
-
>
|
|
102
|
-
<input
|
|
103
|
-
[formControl]="minuteControl"
|
|
104
|
-
[step]="minuteStep"
|
|
105
|
-
[min]="0"
|
|
106
|
-
[max]="59"
|
|
107
|
-
type="number"
|
|
108
|
-
fxFlex="25%"
|
|
109
|
-
(input)="onChange()"
|
|
110
|
-
>
|
|
111
|
-
<input
|
|
112
|
-
[formControl]="secondControl"
|
|
113
|
-
[step]="secondStep"
|
|
114
|
-
[min]="0"
|
|
115
|
-
[max]="59"
|
|
116
|
-
type="number"
|
|
117
|
-
fxFlex="25%"
|
|
118
|
-
(input)="onChange()"
|
|
119
|
-
*ngIf="instance?.component?.dataFormat === 'HH:mm:ss' ||
|
|
120
|
-
instance?.component?.dataFormat === 'HH:mm:ss.SSS'"
|
|
121
|
-
>
|
|
122
|
-
<button
|
|
123
|
-
[disabled]="instance?.component?.disabled"
|
|
124
|
-
fxFlex="25%"
|
|
125
|
-
(click)="changePeriod()"
|
|
126
|
-
>
|
|
127
|
-
{{period}}
|
|
128
|
-
</button>
|
|
129
|
-
</div>
|
|
130
|
-
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
131
|
-
</div>
|
|
132
|
-
</ng-template>
|
|
133
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i4.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i5.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i6.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialTimeComponent, decorators: [{
|
|
135
|
-
type: Component,
|
|
136
|
-
args: [{
|
|
137
|
-
selector: 'mat-formio-time',
|
|
138
|
-
template: `
|
|
139
|
-
<mat-formio-form-field
|
|
140
|
-
[instance]="instance"
|
|
141
|
-
[componentTemplate]="componentTemplate"
|
|
142
|
-
[renderElementOnly]="renderElementOnly"
|
|
143
|
-
></mat-formio-form-field>
|
|
144
|
-
<ng-template #componentTemplate let-hasLabel>
|
|
145
|
-
<mat-label fxFill *ngIf="hasLabel">
|
|
146
|
-
<span [instance]="instance" matFormioLabel></span>
|
|
147
|
-
</mat-label>
|
|
148
|
-
|
|
149
|
-
<div style="display: block">
|
|
150
|
-
<div fxLayout="row" fxLayoutGap="5%">
|
|
151
|
-
<input
|
|
152
|
-
[formControl]="hourControl"
|
|
153
|
-
[step]="hourStep"
|
|
154
|
-
[min]="0"
|
|
155
|
-
[max]="12"
|
|
156
|
-
type="number"
|
|
157
|
-
fxFlex="25%"
|
|
158
|
-
(input)="onChange()"
|
|
159
|
-
>
|
|
160
|
-
<input
|
|
161
|
-
[formControl]="minuteControl"
|
|
162
|
-
[step]="minuteStep"
|
|
163
|
-
[min]="0"
|
|
164
|
-
[max]="59"
|
|
165
|
-
type="number"
|
|
166
|
-
fxFlex="25%"
|
|
167
|
-
(input)="onChange()"
|
|
168
|
-
>
|
|
169
|
-
<input
|
|
170
|
-
[formControl]="secondControl"
|
|
171
|
-
[step]="secondStep"
|
|
172
|
-
[min]="0"
|
|
173
|
-
[max]="59"
|
|
174
|
-
type="number"
|
|
175
|
-
fxFlex="25%"
|
|
176
|
-
(input)="onChange()"
|
|
177
|
-
*ngIf="instance?.component?.dataFormat === 'HH:mm:ss' ||
|
|
178
|
-
instance?.component?.dataFormat === 'HH:mm:ss.SSS'"
|
|
179
|
-
>
|
|
180
|
-
<button
|
|
181
|
-
[disabled]="instance?.component?.disabled"
|
|
182
|
-
fxFlex="25%"
|
|
183
|
-
(click)="changePeriod()"
|
|
184
|
-
>
|
|
185
|
-
{{period}}
|
|
186
|
-
</button>
|
|
187
|
-
</div>
|
|
188
|
-
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
189
|
-
</div>
|
|
190
|
-
</ng-template>
|
|
191
|
-
`
|
|
192
|
-
}]
|
|
193
|
-
}], propDecorators: { selectedEvent: [{
|
|
194
|
-
type: Output
|
|
195
|
-
}], hourStep: [{
|
|
196
|
-
type: Input
|
|
197
|
-
}], minuteStep: [{
|
|
198
|
-
type: Input
|
|
199
|
-
}], secondStep: [{
|
|
200
|
-
type: Input
|
|
201
|
-
}], renderElementOnly: [{
|
|
202
|
-
type: Input
|
|
203
|
-
}] } });
|
|
204
|
-
TimeComponent.MaterialComponent = MaterialTimeComponent;
|
|
205
|
-
export { TimeComponent };
|
|
206
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZS5jb21wb25lbnQuanMiL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clN0ZXBcIlxyXG4gICAgICAgICAgICBbbWluXT1cIjBcIlxyXG4gICAgICAgICAgICBbbWF4XT1cIjEyXCJcclxuICAgICAgICAgICAgdHlwZT1cIm51bWJlclwiXHJcbiAgICAgICAgICAgIGZ4RmxleD1cIjI1JVwiXHJcbiAgICAgICAgICAgIChpbnB1dCk9XCJvbkNoYW5nZSgpXCJcclxuICAgICAgICAgID5cclxuICAgICAgICAgIDxpbnB1dFxyXG4gICAgICAgICAgICBbZm9ybUNvbnRyb2xdPVwibWludXRlQ29udHJvbFwiXHJcbiAgICAgICAgICAgIFtzdGVwXT1cIm1pbnV0ZVN0ZXBcIlxyXG4gICAgICAgICAgICBbbWluXT1cIjBcIlxyXG4gICAgICAgICAgICBbbWF4XT1cIjU5XCJcclxuICAgICAgICAgICAgdHlwZT1cIm51bWJlclwiXHJcbiAgICAgICAgICAgIGZ4RmxleD1cIjI1JVwiXHJcbiAgICAgICAgICAgIChpbnB1dCk9XCJvbkNoYW5nZSgpXCJcclxuICAgICAgICAgID5cclxuICAgICAgICAgIDxpbnB1dFxyXG4gICAgICAgICAgICBbZm9ybUNvbnRyb2xdPVwic2Vjb25kQ29udHJvbFwiXHJcbiAgICAgICAgICAgIFtzdGVwXT1cInNlY29uZFN0ZXBcIlxyXG4gICAgICAgICAgICBbbWluXT1cIjBcIlxyXG4gICAgICAgICAgICBbbWF4XT1cIjU5XCJcclxuICAgICAgICAgICAgdHlwZT1cIm51bWJlclwiXHJcbiAgICAgICAgICAgIGZ4RmxleD1cIjI1JVwiXHJcbiAgICAgICAgICAgIChpbnB1dCk9XCJvbkNoYW5nZSgpXCJcclxuICAgICAgICAgICAgKm5nSWY9XCJpbnN0YW5jZT8uY29tcG9uZW50Py5kYXRhRm9ybWF0ID09PSAnSEg6bW06c3MnIHx8XHJcbiAgICAgICAgICAgICBpbnN0YW5jZT8uY29tcG9uZW50Py5kYXRhRm9ybWF0ID09PSAnSEg6bW06c3MuU1NTJ1wiXHJcbiAgICAgICAg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