ngx-render-material-forms 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/esm2020/lib/FormioControl.mjs +36 -0
- package/esm2020/lib/components/Base.mjs +32 -0
- package/esm2020/lib/components/MaterialComponent.mjs +145 -0
- package/esm2020/lib/components/MaterialNestedComponent.mjs +38 -0
- package/esm2020/lib/components/Webform.mjs +19 -0
- package/esm2020/lib/components/button/button.component.mjs +91 -0
- package/esm2020/lib/components/calendar/calendar.component.mjs +129 -0
- package/esm2020/lib/components/checkbox/checkbox.component.mjs +54 -0
- package/esm2020/lib/components/columns/columns.component.mjs +69 -0
- package/esm2020/lib/components/container/container.component.mjs +25 -0
- package/esm2020/lib/components/content/content.component.mjs +18 -0
- package/esm2020/lib/components/currency/currency.component.mjs +35 -0
- package/esm2020/lib/components/datagrid/datagrid.component.mjs +244 -0
- package/esm2020/lib/components/date/date.component.mjs +325 -0
- package/esm2020/lib/components/day/day.component.mjs +154 -0
- package/esm2020/lib/components/editgrid/editgrid.component.mjs +243 -0
- package/esm2020/lib/components/email/email.component.mjs +29 -0
- package/esm2020/lib/components/fieldset/fieldset.component.mjs +50 -0
- package/esm2020/lib/components/formio-form-field/formio-form-field.component.mjs +57 -0
- package/esm2020/lib/components/formio.wizard.mjs +88 -0
- package/esm2020/lib/components/hidden/hidden.component.mjs +20 -0
- package/esm2020/lib/components/html/html.component.mjs +29 -0
- package/esm2020/lib/components/index.mjs +125 -0
- package/esm2020/lib/components/label/label.component.mjs +17 -0
- package/esm2020/lib/components/number/number.component.mjs +66 -0
- package/esm2020/lib/components/panel/panel.component.mjs +57 -0
- package/esm2020/lib/components/password/password.component.mjs +29 -0
- package/esm2020/lib/components/phonenumber/phonenumber.component.mjs +29 -0
- package/esm2020/lib/components/radio/radio.component.mjs +96 -0
- package/esm2020/lib/components/select/select.component.mjs +186 -0
- package/esm2020/lib/components/selectboxes/selectboxes.component.mjs +102 -0
- package/esm2020/lib/components/signature/signature.component.mjs +103 -0
- package/esm2020/lib/components/survey/survey.component.mjs +167 -0
- package/esm2020/lib/components/table/table.component.mjs +97 -0
- package/esm2020/lib/components/tabs/tabs.component.mjs +43 -0
- package/esm2020/lib/components/tags/tags.component.mjs +117 -0
- package/esm2020/lib/components/textarea/textarea.component.mjs +82 -0
- package/esm2020/lib/components/textfield/textfield.component.mjs +108 -0
- package/esm2020/lib/components/time/time.component.mjs +206 -0
- package/esm2020/lib/components/url/url.component.mjs +29 -0
- package/esm2020/lib/components/well/well.component.mjs +43 -0
- package/esm2020/lib/const/ButtonsThemes.mjs +17 -0
- package/esm2020/lib/const/LabelPositions.mjs +10 -0
- package/esm2020/lib/directives/mask.directive.mjs +65 -0
- package/esm2020/lib/formio.component.mjs +80 -0
- package/esm2020/lib/ngx-render-material-forms.component.mjs +22 -0
- package/esm2020/lib/ngx-render-material-forms.module.mjs +344 -0
- package/esm2020/lib/ngx-render-material-forms.service.mjs +14 -0
- package/esm2020/lib/renderer.mjs +13 -0
- package/esm2020/ngx-render-material-forms.mjs +5 -0
- package/esm2020/public-api.mjs +7 -0
- package/fesm2015/ngx-render-material-forms - Copy.mjs +3787 -0
- package/fesm2015/ngx-render-material-forms.js +3787 -0
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -0
- package/fesm2020/ngx-render-material-forms.mjs +3788 -0
- package/fesm2020/ngx-render-material-forms.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/FormioControl.d.ts +7 -0
- package/lib/components/Base.d.ts +2 -0
- package/lib/components/MaterialComponent.d.ts +30 -0
- package/lib/components/MaterialNestedComponent.d.ts +13 -0
- package/lib/components/Webform.d.ts +1 -0
- package/lib/components/button/button.component.d.ts +23 -0
- package/lib/components/calendar/calendar.component.d.ts +34 -0
- package/lib/components/checkbox/checkbox.component.d.ts +9 -0
- package/lib/components/columns/columns.component.d.ts +12 -0
- package/lib/components/container/container.component.d.ts +8 -0
- package/lib/components/content/content.component.d.ts +8 -0
- package/lib/components/currency/currency.component.d.ts +10 -0
- package/lib/components/datagrid/datagrid.component.d.ts +22 -0
- package/lib/components/date/date.component.d.ts +40 -0
- package/lib/components/day/day.component.d.ts +16 -0
- package/lib/components/editgrid/editgrid.component.d.ts +50 -0
- package/lib/components/email/email.component.d.ts +9 -0
- package/lib/components/fieldset/fieldset.component.d.ts +8 -0
- package/lib/components/formio-form-field/formio-form-field.component.d.ts +18 -0
- package/lib/components/formio.wizard.d.ts +19 -0
- package/lib/components/hidden/hidden.component.d.ts +8 -0
- package/lib/components/html/html.component.d.ts +11 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/label/label.component.d.ts +6 -0
- package/lib/components/number/number.component.d.ts +18 -0
- package/lib/components/panel/panel.component.d.ts +8 -0
- package/lib/components/password/password.component.d.ts +9 -0
- package/lib/components/phonenumber/phonenumber.component.d.ts +9 -0
- package/lib/components/radio/radio.component.d.ts +12 -0
- package/lib/components/select/select.component.d.ts +25 -0
- package/lib/components/selectboxes/selectboxes.component.d.ts +15 -0
- package/lib/components/signature/signature.component.d.ts +12 -0
- package/lib/components/survey/survey.component.d.ts +14 -0
- package/lib/components/table/table.component.d.ts +12 -0
- package/lib/components/tabs/tabs.component.d.ts +9 -0
- package/lib/components/tags/tags.component.d.ts +15 -0
- package/lib/components/textarea/textarea.component.d.ts +12 -0
- package/lib/components/textfield/textfield.component.d.ts +17 -0
- package/lib/components/time/time.component.d.ts +27 -0
- package/lib/components/url/url.component.d.ts +9 -0
- package/lib/components/well/well.component.d.ts +8 -0
- package/lib/const/ButtonsThemes.d.ts +14 -0
- package/lib/const/LabelPositions.d.ts +8 -0
- package/lib/directives/mask.directive.d.ts +17 -0
- package/lib/formio.component.d.ts +15 -0
- package/lib/ngx-render-material-forms.component.d.ts +8 -0
- package/lib/ngx-render-material-forms.module.d.ts +106 -0
- package/lib/ngx-render-material-forms.service.d.ts +6 -0
- package/lib/renderer.d.ts +8 -0
- package/package.json +38 -0
- package/public-api.d.ts +3 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Component, ViewChild } from '@angular/core';
|
|
2
|
+
import { MaterialComponent } from '../MaterialComponent';
|
|
3
|
+
import SelectComponent from 'formiojs/components/select/Select.js';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { FormControl } from '@angular/forms';
|
|
6
|
+
import { Subject, takeUntil } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "@angular/common";
|
|
9
|
+
import * as i2 from "@angular/forms";
|
|
10
|
+
import * as i3 from "@angular/material/form-field";
|
|
11
|
+
import * as i4 from "@angular/material/select";
|
|
12
|
+
import * as i5 from "@angular/material/core";
|
|
13
|
+
import * as i6 from "@angular/flex-layout/flex";
|
|
14
|
+
import * as i7 from "ngx-mat-select-search";
|
|
15
|
+
import * as i8 from "../formio-form-field/formio-form-field.component";
|
|
16
|
+
import * as i9 from "../label/label.component";
|
|
17
|
+
export class MaterialSelectComponent extends MaterialComponent {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.websiteMultiCtrl = new FormControl();
|
|
21
|
+
this.websiteMultiFilterCtrl = new FormControl();
|
|
22
|
+
this._onDestroy = new Subject();
|
|
23
|
+
}
|
|
24
|
+
filterWebsiteMulti() {
|
|
25
|
+
if (!this.selectOptions) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let search = this.websiteMultiFilterCtrl.value;
|
|
29
|
+
search = search.toLowerCase();
|
|
30
|
+
this.filteredOptions = this.selectOptions.then((options) => {
|
|
31
|
+
const filtered = options.filter((option) => option.label.toLowerCase().indexOf(search) !== -1);
|
|
32
|
+
this.filteredOptionsLength = filtered.length;
|
|
33
|
+
return filtered;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
ngOnDestroy() {
|
|
37
|
+
this._onDestroy.next('');
|
|
38
|
+
this._onDestroy.complete();
|
|
39
|
+
}
|
|
40
|
+
/*End*/
|
|
41
|
+
setInstance(instance) {
|
|
42
|
+
super.setInstance(instance);
|
|
43
|
+
this.instance.triggerUpdate();
|
|
44
|
+
}
|
|
45
|
+
ngOnInit() {
|
|
46
|
+
/*new logic */
|
|
47
|
+
//this.websiteMultiCtrl.setValue(this.websites[1]);
|
|
48
|
+
//this.filteredOptions.next(this.websites.slice());
|
|
49
|
+
this.websiteMultiFilterCtrl.valueChanges
|
|
50
|
+
.pipe(takeUntil(this._onDestroy))
|
|
51
|
+
.subscribe(() => {
|
|
52
|
+
this.filterWebsiteMulti();
|
|
53
|
+
});
|
|
54
|
+
/*End */
|
|
55
|
+
this.selectOptions = new Promise((resolve) => {
|
|
56
|
+
this.selectOptionsResolve = resolve;
|
|
57
|
+
});
|
|
58
|
+
this.selectOptions.then((options) => {
|
|
59
|
+
this.filteredOptionsLength = options.length;
|
|
60
|
+
});
|
|
61
|
+
this.filteredOptions = this.selectOptions;
|
|
62
|
+
}
|
|
63
|
+
// onFilter(value) {
|
|
64
|
+
// this.filteredOptions = this.selectOptions.then((options) => {
|
|
65
|
+
// const filtered = options.filter((option) => option.label.toLowerCase().indexOf(value.toLowerCase()) !== -1);
|
|
66
|
+
// this.filteredOptionsLength = filtered.length;
|
|
67
|
+
// return filtered;
|
|
68
|
+
// })
|
|
69
|
+
// }
|
|
70
|
+
compareObjects(o1, o2) {
|
|
71
|
+
return _.isEqual(o1, o2);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
MaterialSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
75
|
+
MaterialSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialSelectComponent, selector: "mat-formio-select", viewQueries: [{ propertyName: "multiSelect", first: true, predicate: ["multiSelect"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
76
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
77
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
78
|
+
<mat-form-field fxFill>
|
|
79
|
+
|
|
80
|
+
<mat-label *ngIf="hasLabel">
|
|
81
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
82
|
+
</mat-label>
|
|
83
|
+
|
|
84
|
+
<span *ngIf="instance.component.prefix" matPrefix>
|
|
85
|
+
{{ instance.component.prefix }}
|
|
86
|
+
</span>
|
|
87
|
+
<mat-select
|
|
88
|
+
[multiple]="instance.component.multiple"
|
|
89
|
+
[formControl]="control"
|
|
90
|
+
[placeholder]="instance.component.placeholder"
|
|
91
|
+
(selectionChange)="onChange()"
|
|
92
|
+
[compareWith]="compareObjects"
|
|
93
|
+
>
|
|
94
|
+
|
|
95
|
+
<mat-option>
|
|
96
|
+
<ngx-mat-select-search placeholderLabel="Find country..." [formControl]="websiteMultiFilterCtrl"></ngx-mat-select-search>
|
|
97
|
+
</mat-option>
|
|
98
|
+
|
|
99
|
+
<mat-option *ngFor="let option of filteredOptions | async" [value]="option.value">
|
|
100
|
+
<span [innerHTML]="option.label"></span>
|
|
101
|
+
</mat-option>
|
|
102
|
+
|
|
103
|
+
<!-- <div class="mat-option">
|
|
104
|
+
<input class="mat-input-element" placeholder="Type to search the risk" (input)="onFilter($event.target.value)">
|
|
105
|
+
</div> -->
|
|
106
|
+
<mat-option *ngIf="!filteredOptionsLength" disabled>
|
|
107
|
+
<span>Nothing was found</span>
|
|
108
|
+
</mat-option>
|
|
109
|
+
<!-- <mat-option *ngFor="let option of filteredOptions | async" [value]="option.value">
|
|
110
|
+
<span [innerHTML]="option.label"></span>
|
|
111
|
+
</mat-option> -->
|
|
112
|
+
</mat-select>
|
|
113
|
+
|
|
114
|
+
<span *ngIf="instance.component.suffix" matSuffix>
|
|
115
|
+
{{ instance.component.suffix }}
|
|
116
|
+
</span>
|
|
117
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
118
|
+
</mat-form-field>
|
|
119
|
+
</ng-template>
|
|
120
|
+
`, 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.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: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i6.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "component", type: i7.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "indexAndLengthScreenReaderText", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toogleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "component", type: i8.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i9.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSelectComponent, decorators: [{
|
|
122
|
+
type: Component,
|
|
123
|
+
args: [{
|
|
124
|
+
selector: 'mat-formio-select',
|
|
125
|
+
template: `
|
|
126
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
127
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
128
|
+
<mat-form-field fxFill>
|
|
129
|
+
|
|
130
|
+
<mat-label *ngIf="hasLabel">
|
|
131
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
132
|
+
</mat-label>
|
|
133
|
+
|
|
134
|
+
<span *ngIf="instance.component.prefix" matPrefix>
|
|
135
|
+
{{ instance.component.prefix }}
|
|
136
|
+
</span>
|
|
137
|
+
<mat-select
|
|
138
|
+
[multiple]="instance.component.multiple"
|
|
139
|
+
[formControl]="control"
|
|
140
|
+
[placeholder]="instance.component.placeholder"
|
|
141
|
+
(selectionChange)="onChange()"
|
|
142
|
+
[compareWith]="compareObjects"
|
|
143
|
+
>
|
|
144
|
+
|
|
145
|
+
<mat-option>
|
|
146
|
+
<ngx-mat-select-search placeholderLabel="Find country..." [formControl]="websiteMultiFilterCtrl"></ngx-mat-select-search>
|
|
147
|
+
</mat-option>
|
|
148
|
+
|
|
149
|
+
<mat-option *ngFor="let option of filteredOptions | async" [value]="option.value">
|
|
150
|
+
<span [innerHTML]="option.label"></span>
|
|
151
|
+
</mat-option>
|
|
152
|
+
|
|
153
|
+
<!-- <div class="mat-option">
|
|
154
|
+
<input class="mat-input-element" placeholder="Type to search the risk" (input)="onFilter($event.target.value)">
|
|
155
|
+
</div> -->
|
|
156
|
+
<mat-option *ngIf="!filteredOptionsLength" disabled>
|
|
157
|
+
<span>Nothing was found</span>
|
|
158
|
+
</mat-option>
|
|
159
|
+
<!-- <mat-option *ngFor="let option of filteredOptions | async" [value]="option.value">
|
|
160
|
+
<span [innerHTML]="option.label"></span>
|
|
161
|
+
</mat-option> -->
|
|
162
|
+
</mat-select>
|
|
163
|
+
|
|
164
|
+
<span *ngIf="instance.component.suffix" matSuffix>
|
|
165
|
+
{{ instance.component.suffix }}
|
|
166
|
+
</span>
|
|
167
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
168
|
+
</mat-form-field>
|
|
169
|
+
</ng-template>
|
|
170
|
+
`
|
|
171
|
+
}]
|
|
172
|
+
}], propDecorators: { multiSelect: [{
|
|
173
|
+
type: ViewChild,
|
|
174
|
+
args: ['multiSelect', { static: true }]
|
|
175
|
+
}] } });
|
|
176
|
+
SelectComponent.MaterialComponent = MaterialSelectComponent;
|
|
177
|
+
// Make sure we detect changes when new items make their way into the select dropdown.
|
|
178
|
+
const setItems = SelectComponent.prototype.setItems;
|
|
179
|
+
SelectComponent.prototype.setItems = function (...args) {
|
|
180
|
+
setItems.call(this, ...args);
|
|
181
|
+
if (this.materialComponent && this.materialComponent.selectOptionsResolve) {
|
|
182
|
+
this.materialComponent.selectOptionsResolve(this.selectOptions);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
export { SelectComponent };
|
|
186
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZW5kZXItbWF0ZXJpYWwtZm9ybXMvc3JjL2xpYi9jb21wb25lbnRzL3NlbGVjdC9zZWxlY3QuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbX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ha2UgdGhlaXIgd2F5IGludG8gdGhlIHNlbGVjdCBkcm9wZG93bi5cbmNvbnN0IHNldEl0ZW1zID0gU2VsZWN0Q29tcG9uZW50LnByb3RvdHlwZS5zZXRJdGVtcztcblNlbGVjdENvbXBvbmVudC5wcm90b3R5cGUuc2V0SXRlbXMgPSBmdW5jdGlvbiAoLi4uYXJncykge1xuICBzZXRJdGVtcy5jYWxsKHRoaXMsIC4uLmFyZ3MpO1xuICBpZiAodGhpcy5tYXRlcmlhbENvbXBvbmVudCAmJiB0aGlzLm1hdGVyaWFsQ29tcG9uZW50LnNlbGVjdE9wdGlvbnNSZXNvbHZlKSB7XG4gICAgdGhpcy5tYXRlcmlhbENvbXBvbmVudC5zZWxlY3RPcHRpb25zUmVzb2x2ZSh0aGlzLnNlbGVjdE9wdGlvbnMpO1xuICB9XG59O1xuXG5leHBvcnQgeyBTZWxlY3RDb21wb25lbnQgfTtcbiJdfQ==
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { MaterialRadioComponent } from '../radio/radio.component';
|
|
3
|
+
import SelectBoxesComponent from 'formiojs/components/selectboxes/SelectBoxes.js';
|
|
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/checkbox";
|
|
9
|
+
import * as i5 from "@angular/flex-layout/flex";
|
|
10
|
+
import * as i6 from "../formio-form-field/formio-form-field.component";
|
|
11
|
+
import * as i7 from "../label/label.component";
|
|
12
|
+
export class MaterialSelectBoxesComponent extends MaterialRadioComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.value = {};
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
}
|
|
18
|
+
setInstance(instance) {
|
|
19
|
+
instance.component.values.forEach((option) => {
|
|
20
|
+
this.value[option.value] = false;
|
|
21
|
+
});
|
|
22
|
+
super.setInstance(instance);
|
|
23
|
+
}
|
|
24
|
+
getValue() {
|
|
25
|
+
return this.value;
|
|
26
|
+
}
|
|
27
|
+
setValue(value) {
|
|
28
|
+
const normalizedValue = this.instance.normalizeValue(value);
|
|
29
|
+
for (const prop in normalizedValue) {
|
|
30
|
+
if (normalizedValue.hasOwnProperty(prop)) {
|
|
31
|
+
this.value[prop] = normalizedValue[prop];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
setDisabled(disabled) {
|
|
36
|
+
this.disabled = !!disabled;
|
|
37
|
+
}
|
|
38
|
+
onChange() {
|
|
39
|
+
this.instance.updateValue(this.getValue(), { modified: true });
|
|
40
|
+
this.instance.triggerChange({ modified: true });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
MaterialSelectBoxesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSelectBoxesComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
+
MaterialSelectBoxesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialSelectBoxesComponent, selector: "mat-formio-selectboxes", usesInheritance: true, ngImport: i0, template: `
|
|
45
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
46
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
47
|
+
<div fxLayout="column">
|
|
48
|
+
<mat-label *ngIf="hasLabel">
|
|
49
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
50
|
+
</mat-label>
|
|
51
|
+
<div
|
|
52
|
+
fxFlexOffset="10px"
|
|
53
|
+
fxLayout="{{ getLayout() }}"
|
|
54
|
+
fxLayoutGap="10px"
|
|
55
|
+
>
|
|
56
|
+
<mat-checkbox
|
|
57
|
+
*ngFor="let option of instance.component.values"
|
|
58
|
+
(change)="onChange()"
|
|
59
|
+
[(ngModel)]="value[option.value]"
|
|
60
|
+
[disabled]="disabled"
|
|
61
|
+
>
|
|
62
|
+
{{ option.label }}
|
|
63
|
+
</mat-checkbox>
|
|
64
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</ng-template>
|
|
68
|
+
`, 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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i5.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: i5.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: i5.DefaultFlexOffsetDirective, selector: " [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md], [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md], [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm], [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]", inputs: ["fxFlexOffset", "fxFlexOffset.xs", "fxFlexOffset.sm", "fxFlexOffset.md", "fxFlexOffset.lg", "fxFlexOffset.xl", "fxFlexOffset.lt-sm", "fxFlexOffset.lt-md", "fxFlexOffset.lt-lg", "fxFlexOffset.lt-xl", "fxFlexOffset.gt-xs", "fxFlexOffset.gt-sm", "fxFlexOffset.gt-md", "fxFlexOffset.gt-lg"] }, { kind: "component", type: i6.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i7.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSelectBoxesComponent, decorators: [{
|
|
70
|
+
type: Component,
|
|
71
|
+
args: [{
|
|
72
|
+
selector: 'mat-formio-selectboxes',
|
|
73
|
+
template: `
|
|
74
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
75
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
76
|
+
<div fxLayout="column">
|
|
77
|
+
<mat-label *ngIf="hasLabel">
|
|
78
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
79
|
+
</mat-label>
|
|
80
|
+
<div
|
|
81
|
+
fxFlexOffset="10px"
|
|
82
|
+
fxLayout="{{ getLayout() }}"
|
|
83
|
+
fxLayoutGap="10px"
|
|
84
|
+
>
|
|
85
|
+
<mat-checkbox
|
|
86
|
+
*ngFor="let option of instance.component.values"
|
|
87
|
+
(change)="onChange()"
|
|
88
|
+
[(ngModel)]="value[option.value]"
|
|
89
|
+
[disabled]="disabled"
|
|
90
|
+
>
|
|
91
|
+
{{ option.label }}
|
|
92
|
+
</mat-checkbox>
|
|
93
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</ng-template>
|
|
97
|
+
`
|
|
98
|
+
}]
|
|
99
|
+
}] });
|
|
100
|
+
SelectBoxesComponent.MaterialComponent = MaterialSelectBoxesComponent;
|
|
101
|
+
export { SelectBoxesComponent };
|
|
102
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0Ym94ZXMuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJlbmRlci1tYXRlcmlhbC1mb3Jtcy9zcmMvbGliL2NvbXBvbmVudHMvc2VsZWN0Ym94ZXMvc2VsZWN0Ym94ZXMuY29tcG9uZW50LnRzIl0sIm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51cGRhdGVWYWx1ZSh0aGlzLmdldFZhbHVlKCksIHttb2RpZmllZDogdHJ1ZX0pO1xuICAgIHRoaXMuaW5zdGFuY2UudHJpZ2dlckNoYW5nZSh7bW9kaWZpZWQ6IHRydWV9KTtcbiAgfVxufVxuU2VsZWN0Qm94ZXNDb21wb25lbnQuTWF0ZXJpYWxDb21wb25lbnQgPSBNYXRlcmlhbFNlbGVjdEJveGVzQ29tcG9uZW50O1xuZXhwb3J0IHsgU2VsZWN0Qm94ZXNDb21wb25lbnQgfTtcbiJdfQ==
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Component, ViewChild } from '@angular/core';
|
|
2
|
+
import { MaterialComponent } from '../MaterialComponent';
|
|
3
|
+
import SignatureComponent from 'formiojs/components/signature/Signature.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
import * as i2 from "@angular/material/form-field";
|
|
7
|
+
import * as i3 from "@angular/material/button";
|
|
8
|
+
import * as i4 from "@angular/material/icon";
|
|
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 class MaterialSignatureComponent extends MaterialComponent {
|
|
14
|
+
renderComponents() {
|
|
15
|
+
if (this.signatureElement) {
|
|
16
|
+
this.instance.attach(this.signatureElement.nativeElement);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
ngAfterViewInit() {
|
|
20
|
+
this.renderComponents();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
MaterialSignatureComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSignatureComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
MaterialSignatureComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialSignatureComponent, selector: "mat-formio-signature", viewQueries: [{ propertyName: "signatureElement", first: true, predicate: ["signature"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
25
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
26
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
27
|
+
<div #signature>
|
|
28
|
+
|
|
29
|
+
<mat-label *ngIf="hasLabel">
|
|
30
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
31
|
+
</mat-label>
|
|
32
|
+
|
|
33
|
+
<button mat-icon-button [ngStyle]="{position: 'absolute'}" ref="refresh">
|
|
34
|
+
<mat-icon>refresh</mat-icon>
|
|
35
|
+
</button>
|
|
36
|
+
|
|
37
|
+
<div class="signature-pad-body"
|
|
38
|
+
[ngStyle]="{width: instance.component.width, height: instance.component.height, padding: 0, margin: 0}"
|
|
39
|
+
[attr.tabindex]="instance.component.tabindex || 0"
|
|
40
|
+
ref="padBody"
|
|
41
|
+
>
|
|
42
|
+
<canvas class="signature-pad-canvas"
|
|
43
|
+
[attr.height]="instance.component.height"
|
|
44
|
+
ref="canvas"
|
|
45
|
+
></canvas>
|
|
46
|
+
<img fxFlexFill [ngStyle]="{display: 'none' }" ref="signatureImage">
|
|
47
|
+
</div>
|
|
48
|
+
<div *ngIf="instance.component.footer"
|
|
49
|
+
class="signature-pad-footer"
|
|
50
|
+
fxLayout="row"
|
|
51
|
+
fxLayoutAlign="center center"
|
|
52
|
+
>
|
|
53
|
+
<mat-hint>{{ instance.t(instance.component.footer) }}</mat-hint>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</ng-template>
|
|
57
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.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: i5.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i5.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i6.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.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"] }] });
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSignatureComponent, decorators: [{
|
|
59
|
+
type: Component,
|
|
60
|
+
args: [{
|
|
61
|
+
selector: 'mat-formio-signature',
|
|
62
|
+
template: `
|
|
63
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
64
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
65
|
+
<div #signature>
|
|
66
|
+
|
|
67
|
+
<mat-label *ngIf="hasLabel">
|
|
68
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
69
|
+
</mat-label>
|
|
70
|
+
|
|
71
|
+
<button mat-icon-button [ngStyle]="{position: 'absolute'}" ref="refresh">
|
|
72
|
+
<mat-icon>refresh</mat-icon>
|
|
73
|
+
</button>
|
|
74
|
+
|
|
75
|
+
<div class="signature-pad-body"
|
|
76
|
+
[ngStyle]="{width: instance.component.width, height: instance.component.height, padding: 0, margin: 0}"
|
|
77
|
+
[attr.tabindex]="instance.component.tabindex || 0"
|
|
78
|
+
ref="padBody"
|
|
79
|
+
>
|
|
80
|
+
<canvas class="signature-pad-canvas"
|
|
81
|
+
[attr.height]="instance.component.height"
|
|
82
|
+
ref="canvas"
|
|
83
|
+
></canvas>
|
|
84
|
+
<img fxFlexFill [ngStyle]="{display: 'none' }" ref="signatureImage">
|
|
85
|
+
</div>
|
|
86
|
+
<div *ngIf="instance.component.footer"
|
|
87
|
+
class="signature-pad-footer"
|
|
88
|
+
fxLayout="row"
|
|
89
|
+
fxLayoutAlign="center center"
|
|
90
|
+
>
|
|
91
|
+
<mat-hint>{{ instance.t(instance.component.footer) }}</mat-hint>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</ng-template>
|
|
95
|
+
`
|
|
96
|
+
}]
|
|
97
|
+
}], propDecorators: { signatureElement: [{
|
|
98
|
+
type: ViewChild,
|
|
99
|
+
args: ['signature']
|
|
100
|
+
}] } });
|
|
101
|
+
SignatureComponent.MaterialComponent = MaterialSignatureComponent;
|
|
102
|
+
export { SignatureComponent };
|
|
103
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmF0dXJlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZW5kZXItbWF0ZXJpYWwtZm9ybXMvc3JjL2xpYi9jb21wb25lbnRzL3NpZ25hdHVyZS9zaWduYXR1cmUuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUE2QixNQUFNLGVBQWUsQ0FBQztBQUNoRix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RoaXMuc2lnbmF0dXJlRWxlbWVudCkge1xuICAgICAgdGhpcy5pbnN0YW5jZS5hdHRhY2godGhpcy5zaWduYXR1cmVFbGVtZW50Lm5hdGl2ZUVsZW1lbnQpO1xuICAgIH1cbiAgfVxuXG4gIG5nQWZ0ZXJWaWV3SW5pdCgpIHtcbiAgICB0aGlzLnJlbmRlckNvbXBvbmVudHMoKTtcbiAgfVxufVxuU2lnbmF0dXJlQ29tcG9uZW50Lk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxTaWduYXR1cmVDb21wb25lbnQ7XG5leHBvcnQgeyBTaWduYXR1cmVDb21wb25lbnQgfTtcbiJdfQ==
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { MaterialComponent } from '../MaterialComponent';
|
|
3
|
+
import SurveyComponent from 'formiojs/components/survey/Survey.js';
|
|
4
|
+
import { FormControl } from '@angular/forms';
|
|
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/radio";
|
|
10
|
+
import * as i5 from "@angular/flex-layout/flex";
|
|
11
|
+
import * as i6 from "../formio-form-field/formio-form-field.component";
|
|
12
|
+
import * as i7 from "../label/label.component";
|
|
13
|
+
export class MaterialSurveyComponent extends MaterialComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.controls = {};
|
|
17
|
+
}
|
|
18
|
+
getFormControl(question) {
|
|
19
|
+
if (!this.controls[question]) {
|
|
20
|
+
this.controls[question] = new FormControl();
|
|
21
|
+
if (this.instance.shouldDisabled) {
|
|
22
|
+
this.controls[question].disable();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return this.controls[question];
|
|
26
|
+
}
|
|
27
|
+
setDisabled(disabled) {
|
|
28
|
+
const method = disabled ? 'disable' : 'enable';
|
|
29
|
+
for (const question in this.controls) {
|
|
30
|
+
if (this.controls.hasOwnProperty(question)) {
|
|
31
|
+
this.controls[question][method]();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
getValue() {
|
|
36
|
+
const values = {};
|
|
37
|
+
for (const question in this.controls) {
|
|
38
|
+
if (this.controls.hasOwnProperty(question)) {
|
|
39
|
+
values[question] = this.controls[question].value || false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return values;
|
|
43
|
+
}
|
|
44
|
+
setValue(value) {
|
|
45
|
+
for (const question in value) {
|
|
46
|
+
if (value.hasOwnProperty(question)) {
|
|
47
|
+
const control = this.getFormControl(question);
|
|
48
|
+
if (control) {
|
|
49
|
+
control.setValue(value[question] || false);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
getUniqueName(question) {
|
|
55
|
+
return `${this.instance.id}-${question}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
MaterialSurveyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSurveyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
+
MaterialSurveyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialSurveyComponent, selector: "mat-formio-survey", usesInheritance: true, ngImport: i0, template: `
|
|
60
|
+
|
|
61
|
+
<mat-formio-form-field
|
|
62
|
+
[instance]="instance"
|
|
63
|
+
[componentTemplate]="componentTemplate"
|
|
64
|
+
[showDescription]="false"
|
|
65
|
+
></mat-formio-form-field>
|
|
66
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
67
|
+
|
|
68
|
+
<table class="mat-elevation-z8 mat-table" fxFill>
|
|
69
|
+
<thead>
|
|
70
|
+
<tr class="mat-header-row">
|
|
71
|
+
<th class="mat-header-cell">
|
|
72
|
+
<h2 *ngIf="hasLabel">
|
|
73
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
74
|
+
</h2>
|
|
75
|
+
</th>
|
|
76
|
+
<th class="mat-header-cell"
|
|
77
|
+
*ngFor="let value of instance.component.values"
|
|
78
|
+
style="text-align: center;"
|
|
79
|
+
>
|
|
80
|
+
{{ value.label }}
|
|
81
|
+
</th>
|
|
82
|
+
</tr>
|
|
83
|
+
</thead>
|
|
84
|
+
|
|
85
|
+
<tbody>
|
|
86
|
+
<tr class="mat-row" *ngFor="let question of instance.component.questions; index as i;">
|
|
87
|
+
<td class="mat-cell">{{ question.label }}</td>
|
|
88
|
+
<td class="mat-cell"
|
|
89
|
+
*ngFor="let value of instance.component.values; index as j;"
|
|
90
|
+
style="text-align: center;"
|
|
91
|
+
>
|
|
92
|
+
<mat-radio-group (change)="onChange()"
|
|
93
|
+
[formControl]="getFormControl(question.value)"
|
|
94
|
+
[name]="getUniqueName(question.value)"
|
|
95
|
+
>
|
|
96
|
+
<mat-radio-button [value]="value.value"></mat-radio-button>
|
|
97
|
+
</mat-radio-group>
|
|
98
|
+
</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<mat-hint *ngIf="instance.component.description" class="mat-formio-component-description">
|
|
101
|
+
{{ instance.component.description }}
|
|
102
|
+
</mat-hint>
|
|
103
|
+
</tbody>
|
|
104
|
+
|
|
105
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
106
|
+
</table>
|
|
107
|
+
</ng-template>
|
|
108
|
+
`, 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.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: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i4.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "directive", type: i5.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "component", type: i6.FormioFormFieldComponent, selector: "mat-formio-form-field", inputs: ["labelTemplate", "renderTopLabel", "showDescription", "renderElementOnly", "instance", "componentTemplate"] }, { kind: "component", type: i7.LabelComponent, selector: "span[matFormioLabel]", inputs: ["instance"] }] });
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialSurveyComponent, decorators: [{
|
|
110
|
+
type: Component,
|
|
111
|
+
args: [{
|
|
112
|
+
selector: 'mat-formio-survey',
|
|
113
|
+
template: `
|
|
114
|
+
|
|
115
|
+
<mat-formio-form-field
|
|
116
|
+
[instance]="instance"
|
|
117
|
+
[componentTemplate]="componentTemplate"
|
|
118
|
+
[showDescription]="false"
|
|
119
|
+
></mat-formio-form-field>
|
|
120
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
121
|
+
|
|
122
|
+
<table class="mat-elevation-z8 mat-table" fxFill>
|
|
123
|
+
<thead>
|
|
124
|
+
<tr class="mat-header-row">
|
|
125
|
+
<th class="mat-header-cell">
|
|
126
|
+
<h2 *ngIf="hasLabel">
|
|
127
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
128
|
+
</h2>
|
|
129
|
+
</th>
|
|
130
|
+
<th class="mat-header-cell"
|
|
131
|
+
*ngFor="let value of instance.component.values"
|
|
132
|
+
style="text-align: center;"
|
|
133
|
+
>
|
|
134
|
+
{{ value.label }}
|
|
135
|
+
</th>
|
|
136
|
+
</tr>
|
|
137
|
+
</thead>
|
|
138
|
+
|
|
139
|
+
<tbody>
|
|
140
|
+
<tr class="mat-row" *ngFor="let question of instance.component.questions; index as i;">
|
|
141
|
+
<td class="mat-cell">{{ question.label }}</td>
|
|
142
|
+
<td class="mat-cell"
|
|
143
|
+
*ngFor="let value of instance.component.values; index as j;"
|
|
144
|
+
style="text-align: center;"
|
|
145
|
+
>
|
|
146
|
+
<mat-radio-group (change)="onChange()"
|
|
147
|
+
[formControl]="getFormControl(question.value)"
|
|
148
|
+
[name]="getUniqueName(question.value)"
|
|
149
|
+
>
|
|
150
|
+
<mat-radio-button [value]="value.value"></mat-radio-button>
|
|
151
|
+
</mat-radio-group>
|
|
152
|
+
</td>
|
|
153
|
+
</tr>
|
|
154
|
+
<mat-hint *ngIf="instance.component.description" class="mat-formio-component-description">
|
|
155
|
+
{{ instance.component.description }}
|
|
156
|
+
</mat-hint>
|
|
157
|
+
</tbody>
|
|
158
|
+
|
|
159
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
160
|
+
</table>
|
|
161
|
+
</ng-template>
|
|
162
|
+
`
|
|
163
|
+
}]
|
|
164
|
+
}] });
|
|
165
|
+
SurveyComponent.MaterialComponent = MaterialSurveyComponent;
|
|
166
|
+
export { SurveyComponent };
|
|
167
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3VydmV5LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZW5kZXItbWF0ZXJpYWwtZm9ybXMvc3JjL2xpYi9jb21wb25lbnRzL3N1cnZleS9zdXJ2ZXkuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT0FBTy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