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,97 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { MaterialNestedComponent } from '../MaterialNestedComponent';
|
|
3
|
+
import TableComponent from 'formiojs/components/table/Table.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
import * as i2 from "@angular/flex-layout/extended";
|
|
7
|
+
export class MaterialTableComponent extends MaterialNestedComponent {
|
|
8
|
+
setInstance(instance) {
|
|
9
|
+
super.setInstance(instance);
|
|
10
|
+
instance.viewContainer = (component) => {
|
|
11
|
+
return this.viewContainers ?
|
|
12
|
+
this.viewContainers[(component.tableRow * this.instance.component.numCols) + component.tableColumn] :
|
|
13
|
+
null;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
getTableColClasses() {
|
|
17
|
+
if (!this.instance) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const { condensed, cellAlignment } = this.instance.component;
|
|
21
|
+
return {
|
|
22
|
+
'is-condensed': condensed,
|
|
23
|
+
...(cellAlignment && { [cellAlignment]: true })
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
MaterialTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
MaterialTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialTableComponent, selector: "mat-formio-table", usesInheritance: true, ngImport: i0, template: `
|
|
29
|
+
<table class="mat-table" style="width: 100%;" [ngClass]="{'is-bordered' : instance.component.bordered}">
|
|
30
|
+
<thead>
|
|
31
|
+
<tr class="mat-header-row">
|
|
32
|
+
<th *ngFor="let header of instance.component.header"
|
|
33
|
+
class="mat-header-cell"
|
|
34
|
+
>
|
|
35
|
+
{{ instance.t(header) }}
|
|
36
|
+
</th>
|
|
37
|
+
</tr>
|
|
38
|
+
</thead>
|
|
39
|
+
|
|
40
|
+
<tbody>
|
|
41
|
+
<tr *ngFor="let row of instance.table; let i = index"
|
|
42
|
+
role="row"
|
|
43
|
+
class="mat-row"
|
|
44
|
+
[ngClass]="{
|
|
45
|
+
'is-hover': instance.component.hover,
|
|
46
|
+
'is-striped': instance.component.striped && i % 2 === 0
|
|
47
|
+
}"
|
|
48
|
+
>
|
|
49
|
+
<td *ngFor="let col of row"
|
|
50
|
+
role="gridcell"
|
|
51
|
+
class="mat-cell"
|
|
52
|
+
[ngClass]="getTableColClasses()"
|
|
53
|
+
>
|
|
54
|
+
<ng-template #components></ng-template>
|
|
55
|
+
</td>
|
|
56
|
+
</tr>
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>
|
|
59
|
+
`, isInline: true, styles: [".mat-table.is-bordered{border:1px solid #ddd}.mat-row.is-hover:hover{background-color:#f5f5f5}.mat-cell{padding:8px}.mat-cell.is-condensed{padding:3px}.mat-row.is-striped{background-color:#eee}.mat-cell.center{text-align:center}.mat-cell.right{text-align:right}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.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"] }] });
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTableComponent, decorators: [{
|
|
61
|
+
type: Component,
|
|
62
|
+
args: [{ selector: 'mat-formio-table', template: `
|
|
63
|
+
<table class="mat-table" style="width: 100%;" [ngClass]="{'is-bordered' : instance.component.bordered}">
|
|
64
|
+
<thead>
|
|
65
|
+
<tr class="mat-header-row">
|
|
66
|
+
<th *ngFor="let header of instance.component.header"
|
|
67
|
+
class="mat-header-cell"
|
|
68
|
+
>
|
|
69
|
+
{{ instance.t(header) }}
|
|
70
|
+
</th>
|
|
71
|
+
</tr>
|
|
72
|
+
</thead>
|
|
73
|
+
|
|
74
|
+
<tbody>
|
|
75
|
+
<tr *ngFor="let row of instance.table; let i = index"
|
|
76
|
+
role="row"
|
|
77
|
+
class="mat-row"
|
|
78
|
+
[ngClass]="{
|
|
79
|
+
'is-hover': instance.component.hover,
|
|
80
|
+
'is-striped': instance.component.striped && i % 2 === 0
|
|
81
|
+
}"
|
|
82
|
+
>
|
|
83
|
+
<td *ngFor="let col of row"
|
|
84
|
+
role="gridcell"
|
|
85
|
+
class="mat-cell"
|
|
86
|
+
[ngClass]="getTableColClasses()"
|
|
87
|
+
>
|
|
88
|
+
<ng-template #components></ng-template>
|
|
89
|
+
</td>
|
|
90
|
+
</tr>
|
|
91
|
+
</tbody>
|
|
92
|
+
</table>
|
|
93
|
+
`, styles: [".mat-table.is-bordered{border:1px solid #ddd}.mat-row.is-hover:hover{background-color:#f5f5f5}.mat-cell{padding:8px}.mat-cell.is-condensed{padding:3px}.mat-row.is-striped{background-color:#eee}.mat-cell.center{text-align:center}.mat-cell.right{text-align:right}\n"] }]
|
|
94
|
+
}] });
|
|
95
|
+
TableComponent.MaterialComponent = MaterialTableComponent;
|
|
96
|
+
export { TableComponent };
|
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuY29tcG9uZW50LmpzIiwic291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dGggKm5nRm9yPVwibGV0IGhlYWRlciBvZiBpbnN0YW5jZS5jb21wb25lbnQuaGVhZGVyXCJcbiAgICAgICAgICAgICAgY2xhc3M9XCJtYXQtaGVhZGVyLWNlbGxcIlxuICAgICAgICAgID5cbiAgICAgICAgICAgIHt7IGluc3RhbmNlLnQoaGVhZGVyKSB9fVxuICAgICAgICAgIDwvdGg+XG4gICAgICAgIDwvdHI+XG4gICAgICAgIDwvdGhlYWQ+XG5cbiAgICAgICAgPHRib2R5PlxuICAgICAgICA8dHIgKm5nRm9yPVwibGV0IHJvdyBvZiBpbnN0YW5jZS50YWJsZTsgbGV0IGkgPSBpbmRleFwiXG4gICAgICAgICAgICByb2xlPVwicm93XCJcbiAgICAgICAgICAgIGNsYXNzPVwibWF0LXJvd1wiXG4gICAgICAgICAgICBbbmdDbGFzc109XCJ7XG4gICAgICAgICAgICAgICAgJ2lzLWhvdmVyJzogaW5zdGFuY2UuY29tcG9uZW50LmhvdmVyLFxuICAgICAgICAgICAgICAgICdpcy1zdHJpcGVkJzogaW5zdGFuY2UuY29tcG9uZW50LnN0cmlwZWQgJiYgaSAlIDIgPT09IDBcbiAgICAgICAgICAgICAgfVwiXG4gICAgICAgID5cbiAgICAgICAgICA8dGQgKm5nRm9yPVwibGV0IGNvbCBvZiByb3dcIlxuICAgICAgICAgICAgICByb2xlPVwiZ3JpZGNlbGxcIlxuICAgICAgICAgICAgICBjbGFzcz1cIm1hdC1jZWxsXCJcbiAgICAgICAgICAgICAgW25nQ2xhc3NdPVwiZ2V0VGFibGVDb2xDbGFzc2VzKClcIlxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxuZy10ZW1wbGF0ZSAjY29tcG9uZW50cz48L25nLXRlbXBsYXRlPlxuICAgICAgICAgIDwvdGQ+XG4gICAgICAgIDwvdHI+XG4gICAgICAgIDwvdGJvZHk+XG4gICAgICA8L3RhYmxlPlxuICBgXG59KVxuZXhwb3J0IGNsYXNzIE1hdGVyaWFsVGFibGVDb21wb25lbnQgZXh0ZW5kcyBNYXRlcmlhbE5lc3RlZENvbXBvbmVudCB7XG5cbiAgc2V0SW5zdGFuY2UoaW5zdGFuY2U6IGFueSkge1xuICAgIHN1cGVyLnNldEluc3RhbmNlKGluc3RhbmNlKTtcbiAgICBpbnN0YW5jZS52aWV3Q29udGFpbmVyID0gKGNvbXBvbmVudCkgPT4ge1xuICAgICAgcmV0dXJuIHRoaXMudmlld0NvbnRhaW5lcnMgP1xuICAgICAgICB0aGlzLnZpZXdDb250YWluZXJzWyhjb21wb25lbnQudGFibGVSb3cgKiB0aGlzLmluc3RhbmNlLmNvbXBvbmVudC5udW1Db2xzKSArIGNvbXBvbmVudC50YWJsZUNvbHVtbl0gOlxuICAgICAgICBudWxsO1xuICAgIH07XG4gIH1cblxuICBnZXRUYWJsZUNvbENsYXNzZXMoKSB7XG4gICAgaWYgKCF0aGlzLmluc3RhbmNlKSB7XG4gICAgICByZXR1cm47XG4gICAgfVxuICAgIGNvbnN0IHtjb25kZW5zZWQsIGNlbGxBbGlnbm1lbnR9ID0gdGhpcy5pbnN0YW5jZS5jb21wb25lbnQ7XG4gICAgcmV0dXJuIHtcbiAgICAgICdpcy1jb25kZW5zZWQnOiBjb25kZW5zZWQsXG4gICAgICAuLi4oY2VsbEFsaWdubWVudCAmJiB7W2NlbGxBbGlnbm1lbnRdOiB0cnVlfSlcbiAgICB9XG4gIH1cbn1cblRhYmxlQ29tcG9uZW50Lk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxUYWJsZUNvbXBvbmVudDtcbmV4cG9ydCB7IFRhYmxlQ29tcG9uZW50IH07XG4iXX0=
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { MaterialNestedComponent } from '../MaterialNestedComponent';
|
|
3
|
+
import TabsComponent from 'formiojs/components/tabs/Tabs.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
import * as i2 from "@angular/material/tabs";
|
|
7
|
+
import * as i3 from "@angular/flex-layout/flex";
|
|
8
|
+
export class MaterialTabsComponent extends MaterialNestedComponent {
|
|
9
|
+
setInstance(instance) {
|
|
10
|
+
super.setInstance(instance);
|
|
11
|
+
instance.viewContainer = (component) => {
|
|
12
|
+
return this.viewContainers ? this.viewContainers[component.tab] : null;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
MaterialTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
MaterialTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialTabsComponent, selector: "mat-formio-tabs", usesInheritance: true, ngImport: i0, template: `
|
|
18
|
+
<mat-tab-group>
|
|
19
|
+
<mat-tab *ngFor="let tab of instance.component.components" [label]="tab.label">
|
|
20
|
+
<div fxLayout="column" fxLayoutGap="1em" style="border: 1px dotted rgba(0, 0, 0, 0.125)">
|
|
21
|
+
<ng-template #components></ng-template>
|
|
22
|
+
</div>
|
|
23
|
+
</mat-tab>
|
|
24
|
+
</mat-tab-group>
|
|
25
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i3.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: i3.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"] }] });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTabsComponent, decorators: [{
|
|
27
|
+
type: Component,
|
|
28
|
+
args: [{
|
|
29
|
+
selector: 'mat-formio-tabs',
|
|
30
|
+
template: `
|
|
31
|
+
<mat-tab-group>
|
|
32
|
+
<mat-tab *ngFor="let tab of instance.component.components" [label]="tab.label">
|
|
33
|
+
<div fxLayout="column" fxLayoutGap="1em" style="border: 1px dotted rgba(0, 0, 0, 0.125)">
|
|
34
|
+
<ng-template #components></ng-template>
|
|
35
|
+
</div>
|
|
36
|
+
</mat-tab>
|
|
37
|
+
</mat-tab-group>
|
|
38
|
+
`
|
|
39
|
+
}]
|
|
40
|
+
}] });
|
|
41
|
+
TabsComponent.MaterialComponent = MaterialTabsComponent;
|
|
42
|
+
export { TabsComponent };
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFicy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtcmVuZGVyLW1hdGVyaWFsLWZvcm1zL3NyYy9saWIvY29tcG9uZW50cy90YWJzL3RhYnMuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDckUsT0FBTyxhQUFhLE1BQU0sa0NBQWtDLENBQUM7Ozs7O0FBYzdELE1BQU0sT0FBTyxxQkFBc0IsU0FBUSx1QkFBdUI7SUFDaEUsV0FBVyxDQUFDLFFBQWE7UUFDdkIsS0FBSyxDQUFDLFdBQVcsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUM1QixRQUFRLENBQUMsYUFBYSxHQUFHLENBQUMsU0FBUyxFQUFFLEVBQUU7WUFDckMsT0FBTyxJQUFJLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDO1FBQ3pFLENBQUMsQ0FBQztJQUNKLENBQUM7O2tIQU5VLHFCQUFxQjtzR0FBckIscUJBQXFCLDhFQVZ0Qjs7Ozs7Ozs7R0FRVDsyRkFFVSxxQkFBcUI7a0JBWmpDLFNBQVM7bUJBQUM7b0JBQ1QsUUFBUSxFQUFFLGlCQUFpQjtvQkFDM0IsUUFBU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lKGluc3RhbmNlKTtcbiAgICBpbnN0YW5jZS52aWV3Q29udGFpbmVyID0gKGNvbXBvbmVudCkgPT4ge1xuICAgICAgcmV0dXJuIHRoaXMudmlld0NvbnRhaW5lcnMgPyB0aGlzLnZpZXdDb250YWluZXJzW2NvbXBvbmVudC50YWJdIDogbnVsbDtcbiAgICB9O1xuICB9XG59XG5UYWJzQ29tcG9uZW50Lk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxUYWJzQ29tcG9uZW50O1xuZXhwb3J0IHsgVGFic0NvbXBvbmVudCB9O1xuIl19
|
|
@@ -0,0 +1,117 @@
|
|
|
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.2", ngImport: i0, type: MaterialTagsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
+
MaterialTagsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", 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.2", 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFncy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtcmVuZGVyLW1hdGVyaWFsLWZvcm1zL3NyYy9saWIvY29tcG9uZW50cy90YWdzL3RhZ3MuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT0FBTyxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNyRCxPQUFPLGFBQWEsTUFBTSxrQ0FBa0MsQ0FBQztBQUM3RCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQzs7Ozs7Ozs7OztBQW1DekQsTUFBTSxPQUFPLHFCQUFzQixTQUFRLGlCQUFpQjtJQWhDNUQ7O1FBaUNXLHVCQUFrQixHQUFhLENBQUMsS0FBSyxFQUFFLEtBQUssQ0FBQyxDQUFDO1FBQ3ZELFNBQUksR0FBYSxFQUFFLENBQUM7S0FpQ3JCO0lBaENDLEdBQUcsQ0FBQyxLQUF3QjtRQUMxQixNQUFNLEtBQUssR0FBRyxLQUF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dlKCk7XG4gIH1cblxuICBnZXRWYWx1ZSgpIHtcbiAgICByZXR1cm4gKHRoaXMuaW5zdGFuY2UuY29tcG9uZW50LnN0b3JlYXMgPT09ICdzdHJpbmcnKSA/IHRoaXMudGFncy5qb2luKHRoaXMuaW5zdGFuY2UuZGVsaW1pdGVyKSA6IHRoaXMudGFncztcbiAgfVxuXG4gIHNldFZhbHVlKHZhbHVlKSB7XG4gICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgIHZhbHVlID0gdmFsdWUuc3BsaXQodGhpcy5pbnN0YW5jZS5kZWxpbWl0ZXIpO1xuICAgIH1cbiAgICBpZiAodmFsdWUgJiYgIUFycmF5LmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICB2YWx1ZSA9IFt2YWx1ZV07XG4gICAgfVxuICAgIHRoaXMudGFncyA9IHZhbHVlO1xuICB9XG59XG4oVGFnc0NvbXBvbmVudCBhcyBhbnkpLk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxUYWdzQ29tcG9uZW50O1xuZXhwb3J0IHsgVGFnc0NvbXBvbmVudCB9O1xuIl19
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
// Attach the element so the wysiwyg will work.
|
|
17
|
+
this.instance.attachElement(this.textarea.nativeElement);
|
|
18
|
+
}
|
|
19
|
+
getValue() {
|
|
20
|
+
return isNil(this.control.value) ? '' : this.control.value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
MaterialTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTextareaComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
MaterialTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MaterialTextareaComponent, selector: "mat-formio-textarea", viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], 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
|
+
<mat-form-field class="mat-formio-textarea"
|
|
28
|
+
[ngClass]="{'editor-enabled': !!instance.component.editor}"
|
|
29
|
+
fxFill
|
|
30
|
+
fxFlexAlign="center"
|
|
31
|
+
>
|
|
32
|
+
<mat-label fxFill *ngIf="hasLabel">
|
|
33
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
34
|
+
</mat-label>
|
|
35
|
+
<span *ngIf="instance.component.prefix" matPrefix>{{ instance.component.prefix }} </span>
|
|
36
|
+
<textarea matInput
|
|
37
|
+
[placeholder]="instance.component.placeholder"
|
|
38
|
+
[formControl]="control"
|
|
39
|
+
[rows]="(instance.component.rows || 3)"
|
|
40
|
+
(input)="onChange()"
|
|
41
|
+
#textarea
|
|
42
|
+
>
|
|
43
|
+
</textarea>
|
|
44
|
+
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
45
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
46
|
+
</mat-form-field>
|
|
47
|
+
</ng-template>
|
|
48
|
+
`, 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"] }] });
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTextareaComponent, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{ selector: 'mat-formio-textarea', 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="mat-formio-textarea"
|
|
55
|
+
[ngClass]="{'editor-enabled': !!instance.component.editor}"
|
|
56
|
+
fxFill
|
|
57
|
+
fxFlexAlign="center"
|
|
58
|
+
>
|
|
59
|
+
<mat-label fxFill *ngIf="hasLabel">
|
|
60
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
61
|
+
</mat-label>
|
|
62
|
+
<span *ngIf="instance.component.prefix" matPrefix>{{ instance.component.prefix }} </span>
|
|
63
|
+
<textarea matInput
|
|
64
|
+
[placeholder]="instance.component.placeholder"
|
|
65
|
+
[formControl]="control"
|
|
66
|
+
[rows]="(instance.component.rows || 3)"
|
|
67
|
+
(input)="onChange()"
|
|
68
|
+
#textarea
|
|
69
|
+
>
|
|
70
|
+
</textarea>
|
|
71
|
+
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
72
|
+
<mat-error *ngIf="instance.error">{{ instance.error.message }}</mat-error>
|
|
73
|
+
</mat-form-field>
|
|
74
|
+
</ng-template>
|
|
75
|
+
`, styles: [".mat-input-element{min-height:16px}\n"] }]
|
|
76
|
+
}], propDecorators: { textarea: [{
|
|
77
|
+
type: ViewChild,
|
|
78
|
+
args: ['textarea']
|
|
79
|
+
}] } });
|
|
80
|
+
TextAreaComponent.MaterialComponent = MaterialTextareaComponent;
|
|
81
|
+
export { TextAreaComponent };
|
|
82
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXJlbmRlci1tYXRlcmlhbC1mb3Jtcy9zcmMvbGliL2NvbXBvbmVudHMvdGV4dGFyZWEvdGV4dGFyZWEuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUE2QixNQUFNLGVBQWUsQ0FBQztBQUNoRixPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFB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0YXJlYS5uYXRpdmVFbGVtZW50KTtcbiAgfVxuXG4gIGdldFZhbHVlKCkge1xuICAgIHJldHVybiBpc05pbCh0aGlzLmNvbnRyb2wudmFsdWUpID8gJycgOiB0aGlzLmNvbnRyb2wudmFsdWU7XG4gIH1cbn1cblRleHRBcmVhQ29tcG9uZW50Lk1hdGVyaWFsQ29tcG9uZW50ID0gTWF0ZXJpYWxUZXh0YXJlYUNvbXBvbmVudDtcbmV4cG9ydCB7IFRleHRBcmVhQ29tcG9uZW50IH07XG4iXX0=
|
|
@@ -0,0 +1,108 @@
|
|
|
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 "../formio-form-field/formio-form-field.component";
|
|
11
|
+
import * as i7 from "../label/label.component";
|
|
12
|
+
export const TEXTFIELD_TEMPLATE = `
|
|
13
|
+
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
14
|
+
<ng-template #componentTemplate let-hasLabel>
|
|
15
|
+
<mat-form-field [appearance]="getFormFieldAppearance()" fxFill>
|
|
16
|
+
|
|
17
|
+
<mat-label *ngIf="hasLabel">
|
|
18
|
+
<span [instance]="instance" matFormioLabel></span>
|
|
19
|
+
</mat-label>
|
|
20
|
+
|
|
21
|
+
<span *ngIf="instance.component.prefix && instance.type !== 'currency'"
|
|
22
|
+
matPrefix
|
|
23
|
+
>
|
|
24
|
+
{{ instance.component.prefix }}
|
|
25
|
+
</span>
|
|
26
|
+
<input matInput
|
|
27
|
+
type="{{ inputType }}"
|
|
28
|
+
[formControl]="control"
|
|
29
|
+
[placeholder]="instance.component.placeholder"
|
|
30
|
+
(input)="onChange()" #input
|
|
31
|
+
>
|
|
32
|
+
<span *ngIf="instance.component.suffix" matSuffix>{{ instance.component.suffix }}</span>
|
|
33
|
+
|
|
34
|
+
<mat-hint *ngIf="instance.component.showWordCount || instance.component.showCharCount">
|
|
35
|
+
{{ getHint() }}
|
|
36
|
+
</mat-hint>
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
<mat-error *ngIf="isError()" >{{ getErrorMessage() }}</mat-error>
|
|
40
|
+
</mat-form-field>
|
|
41
|
+
</ng-template>
|
|
42
|
+
`;
|
|
43
|
+
export class MaterialTextfieldComponent extends MaterialComponent {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.inputType = 'text';
|
|
47
|
+
}
|
|
48
|
+
ngAfterContentInit() {
|
|
49
|
+
if (this.instance && this.control && this.instance.component.disabled) {
|
|
50
|
+
this.control.disable();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
getHint() {
|
|
54
|
+
if (!this.instance || !this.control || !this.control.value) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
const { showWordCount, showCharCount } = this.instance.component;
|
|
58
|
+
if (showWordCount && showCharCount) {
|
|
59
|
+
return `${this.getWordsCount()} words, ${this.control.value.length} characters`;
|
|
60
|
+
}
|
|
61
|
+
else if (showWordCount) {
|
|
62
|
+
return `${this.getWordsCount()} words`;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return `${this.control.value.length} characters`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
getWordsCount() {
|
|
69
|
+
const matches = this.control.value ? this.control.value.match(/[\w\d’'-]+/gi) : [];
|
|
70
|
+
return matches ? matches.length : 0;
|
|
71
|
+
}
|
|
72
|
+
getFormFieldAppearance() {
|
|
73
|
+
const appearances = ['legacy', 'standard', 'fill', 'outline'];
|
|
74
|
+
const appearance = this.instance.component.appearance ? this.instance.component.appearance.toLowerCase() : '';
|
|
75
|
+
return appearances.includes(appearance) ? appearance : undefined;
|
|
76
|
+
}
|
|
77
|
+
isError() {
|
|
78
|
+
if (this.instance.error) {
|
|
79
|
+
this.control.setErrors(this.instance.component.validate);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
getErrorMessage() {
|
|
87
|
+
if (this.instance.error && this.instance.error.messages) {
|
|
88
|
+
const { messages } = this.instance.error;
|
|
89
|
+
for (const msg of messages) {
|
|
90
|
+
if (msg.context && this.control.hasError(msg.context.validator)) {
|
|
91
|
+
return this.instance.error.message;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
MaterialTextfieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTextfieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
+
MaterialTextfieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", 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 >\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.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: "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"] }] });
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MaterialTextfieldComponent, decorators: [{
|
|
100
|
+
type: Component,
|
|
101
|
+
args: [{
|
|
102
|
+
selector: 'mat-formio-textfield',
|
|
103
|
+
template: TEXTFIELD_TEMPLATE
|
|
104
|
+
}]
|
|
105
|
+
}] });
|
|
106
|
+
TextFieldComponent.MaterialComponent = MaterialTextfieldComponent;
|
|
107
|
+
export { TextFieldComponent };
|
|
108
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGZpZWxkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZW5kZXItbWF0ZXJpYWwtZm9ybXMvc3JjL2xpYi9jb21wb25lbnRzL3RleHRmaWVsZC90ZXh0ZmllbGQuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQTRCLE1BQU0sZUFBZSxDQUFDO0FBQ3BFLE9BQU8sa0JBQWtCLE1BQU0sNENBQTRDLENBQUM7QUFDNUUsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7Ozs7Ozs7OztBQUV6RCxNQUFNLENBQUMsTUFBTSxrQkFBa0IsR0FBRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBOEJqQyxDQUFDO0FBTUYsTUFBTSxPQUFPLDBCQUEyQixTQUFRLGlCQUFpQjtJQUpqRTs7UUFLUyxjQUFTLEdBQUcsTUFBTSxDQUFDO0tBd0QzQjtJQXREQyxrQkFBa0I7UUFDaEIsSUFBSSxJQUFJLENBQUMsUUFBUSxJQUFJLElBQUksQ0FBQyxPQUFPLElBQUksSUFBSSxDQUFDLFFBQVEsQ0F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