@ajsf/material 0.5.1 → 0.8.0
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/{esm2015/ajsf-material.js → esm2020/ajsf-material.mjs} +0 -0
- package/{esm2015/lib/angular-flex-monkey-patch.js → esm2020/lib/angular-flex-monkey-patch.mjs} +0 -0
- package/esm2020/lib/material-design-framework.component.mjs +102 -0
- package/esm2020/lib/material-design-framework.module.mjs +119 -0
- package/esm2020/lib/material-design.framework.mjs +57 -0
- package/esm2020/lib/widgets/flex-layout-root.component.mjs +76 -0
- package/esm2020/lib/widgets/flex-layout-section.component.mjs +349 -0
- package/esm2020/lib/widgets/material-add-reference.component.mjs +66 -0
- package/esm2020/lib/widgets/material-button-group.component.mjs +90 -0
- package/esm2020/lib/widgets/material-button.component.mjs +76 -0
- package/esm2020/lib/widgets/material-checkbox.component.mjs +166 -0
- package/esm2020/lib/widgets/material-checkboxes.component.mjs +129 -0
- package/esm2020/lib/widgets/material-chip-list.component.mjs +35 -0
- package/{esm2015/lib/widgets/material-datepicker.component.js → esm2020/lib/widgets/material-datepicker.component.mjs} +75 -24
- package/esm2020/lib/widgets/material-file.component.mjs +35 -0
- package/esm2020/lib/widgets/material-input.component.mjs +149 -0
- package/esm2020/lib/widgets/material-number.component.mjs +145 -0
- package/esm2020/lib/widgets/material-one-of.component.mjs +35 -0
- package/esm2020/lib/widgets/material-radios.component.mjs +122 -0
- package/esm2020/lib/widgets/material-select.component.mjs +186 -0
- package/esm2020/lib/widgets/material-slider.component.mjs +83 -0
- package/esm2020/lib/widgets/material-stepper.component.mjs +35 -0
- package/esm2020/lib/widgets/material-tabs.component.mjs +86 -0
- package/esm2020/lib/widgets/material-textarea.component.mjs +134 -0
- package/{esm2015/lib/widgets/public_api.js → esm2020/lib/widgets/public_api.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/fesm2015/ajsf-material.mjs +2320 -0
- package/fesm2015/ajsf-material.mjs.map +1 -0
- package/fesm2020/ajsf-material.mjs +2313 -0
- package/fesm2020/ajsf-material.mjs.map +1 -0
- package/{ajsf-material.d.ts → index.d.ts} +1 -0
- package/lib/material-design-framework.component.d.ts +3 -0
- package/lib/material-design-framework.module.d.ts +51 -2
- package/lib/material-design.framework.d.ts +3 -0
- package/lib/widgets/flex-layout-root.component.d.ts +3 -0
- package/lib/widgets/flex-layout-section.component.d.ts +3 -0
- package/lib/widgets/material-add-reference.component.d.ts +3 -0
- package/lib/widgets/material-button-group.component.d.ts +3 -0
- package/lib/widgets/material-button.component.d.ts +3 -0
- package/lib/widgets/material-checkbox.component.d.ts +3 -0
- package/lib/widgets/material-checkboxes.component.d.ts +3 -0
- package/lib/widgets/material-chip-list.component.d.ts +3 -0
- package/lib/widgets/material-datepicker.component.d.ts +3 -0
- package/lib/widgets/material-file.component.d.ts +3 -0
- package/lib/widgets/material-input.component.d.ts +3 -0
- package/lib/widgets/material-number.component.d.ts +3 -0
- package/lib/widgets/material-one-of.component.d.ts +3 -0
- package/lib/widgets/material-radios.component.d.ts +3 -0
- package/lib/widgets/material-select.component.d.ts +3 -0
- package/lib/widgets/material-slider.component.d.ts +3 -0
- package/lib/widgets/material-stepper.component.d.ts +3 -0
- package/lib/widgets/material-tabs.component.d.ts +3 -0
- package/lib/widgets/material-textarea.component.d.ts +3 -0
- package/package.json +27 -15
- package/ajsf-material.metadata.json +0 -1
- package/bundles/ajsf-material.umd.js +0 -1422
- package/bundles/ajsf-material.umd.js.map +0 -1
- package/esm2015/lib/material-design-framework.component.js +0 -101
- package/esm2015/lib/material-design-framework.module.js +0 -80
- package/esm2015/lib/material-design.framework.js +0 -54
- package/esm2015/lib/widgets/flex-layout-root.component.js +0 -55
- package/esm2015/lib/widgets/flex-layout-section.component.js +0 -221
- package/esm2015/lib/widgets/material-add-reference.component.js +0 -53
- package/esm2015/lib/widgets/material-button-group.component.js +0 -63
- package/esm2015/lib/widgets/material-button.component.js +0 -60
- package/esm2015/lib/widgets/material-checkbox.component.js +0 -109
- package/esm2015/lib/widgets/material-checkboxes.component.js +0 -101
- package/esm2015/lib/widgets/material-chip-list.component.js +0 -33
- package/esm2015/lib/widgets/material-file.component.js +0 -33
- package/esm2015/lib/widgets/material-input.component.js +0 -95
- package/esm2015/lib/widgets/material-number.component.js +0 -97
- package/esm2015/lib/widgets/material-one-of.component.js +0 -33
- package/esm2015/lib/widgets/material-radios.component.js +0 -84
- package/esm2015/lib/widgets/material-select.component.js +0 -115
- package/esm2015/lib/widgets/material-slider.component.js +0 -60
- package/esm2015/lib/widgets/material-stepper.component.js +0 -33
- package/esm2015/lib/widgets/material-tabs.component.js +0 -69
- package/esm2015/lib/widgets/material-textarea.component.js +0 -88
- package/fesm2015/ajsf-material.js +0 -1710
- package/fesm2015/ajsf-material.js.map +0 -1
|
@@ -0,0 +1,2313 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, Inject, Optional, Injectable, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@ajsf/core';
|
|
4
|
+
import { hasOwn, buildTitleMap, isDefined, isArray, Framework, WidgetLibraryModule, JsonSchemaFormModule, JsonSchemaFormService, FrameworkLibraryService, WidgetLibraryService } from '@ajsf/core';
|
|
5
|
+
import * as i2 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i3 from '@angular/flex-layout/flex';
|
|
8
|
+
import * as i4 from '@angular/flex-layout/extended';
|
|
9
|
+
import * as i5 from '@angular/material/card';
|
|
10
|
+
import { MatCardModule } from '@angular/material/card';
|
|
11
|
+
import * as i6 from '@angular/material/expansion';
|
|
12
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
13
|
+
import * as i4$1 from '@angular/material/form-field';
|
|
14
|
+
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldModule } from '@angular/material/form-field';
|
|
15
|
+
import * as i3$1 from '@angular/material/button';
|
|
16
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
17
|
+
import * as i4$2 from '@angular/material/icon';
|
|
18
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
19
|
+
import * as i3$2 from '@angular/material/button-toggle';
|
|
20
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
21
|
+
import * as i3$3 from '@angular/forms';
|
|
22
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
23
|
+
import * as i4$3 from '@angular/material/checkbox';
|
|
24
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
25
|
+
import * as i6$1 from '@angular/material/slide-toggle';
|
|
26
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
27
|
+
import * as i4$4 from '@angular/material/datepicker';
|
|
28
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
29
|
+
import * as i5$1 from '@angular/material/input';
|
|
30
|
+
import { MatInputModule } from '@angular/material/input';
|
|
31
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
32
|
+
import * as i4$5 from '@angular/material/autocomplete';
|
|
33
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
34
|
+
import * as i4$6 from '@angular/material/core';
|
|
35
|
+
import { MatNativeDateModule } from '@angular/material/core';
|
|
36
|
+
import * as i5$2 from '@angular/material/radio';
|
|
37
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
38
|
+
import * as i6$2 from '@angular/material/select';
|
|
39
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
40
|
+
import * as i5$3 from '@angular/material/slider';
|
|
41
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
42
|
+
import * as i3$4 from '@angular/material/tabs';
|
|
43
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
44
|
+
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
45
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
46
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
47
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
48
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
49
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
50
|
+
import { MediaMarshaller } from '@angular/flex-layout/core';
|
|
51
|
+
|
|
52
|
+
class FlexLayoutRootComponent {
|
|
53
|
+
constructor(jsf) {
|
|
54
|
+
this.jsf = jsf;
|
|
55
|
+
this.isFlexItem = false;
|
|
56
|
+
}
|
|
57
|
+
removeItem(item) {
|
|
58
|
+
this.jsf.removeItem(item);
|
|
59
|
+
}
|
|
60
|
+
// Set attributes for flexbox child
|
|
61
|
+
// (container attributes are set in flex-layout-section.component)
|
|
62
|
+
getFlexAttribute(node, attribute) {
|
|
63
|
+
const index = ['flex-grow', 'flex-shrink', 'flex-basis'].indexOf(attribute);
|
|
64
|
+
return ((node.options || {}).flex || '').split(/\s+/)[index] ||
|
|
65
|
+
(node.options || {})[attribute] || ['1', '1', 'auto'][index];
|
|
66
|
+
}
|
|
67
|
+
showWidget(layoutNode) {
|
|
68
|
+
return this.jsf.evaluateCondition(layoutNode, this.dataIndex);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
FlexLayoutRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutRootComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
72
|
+
FlexLayoutRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FlexLayoutRootComponent, selector: "flex-layout-root-widget", inputs: { dataIndex: "dataIndex", layoutIndex: "layoutIndex", layout: "layout", isFlexItem: "isFlexItem" }, ngImport: i0, template: `
|
|
73
|
+
<div *ngFor="let layoutNode of layout; let i = index"
|
|
74
|
+
[class.form-flex-item]="isFlexItem"
|
|
75
|
+
[style.flex-grow]="getFlexAttribute(layoutNode, 'flex-grow')"
|
|
76
|
+
[style.flex-shrink]="getFlexAttribute(layoutNode, 'flex-shrink')"
|
|
77
|
+
[style.flex-basis]="getFlexAttribute(layoutNode, 'flex-basis')"
|
|
78
|
+
[style.align-self]="(layoutNode?.options || {})['align-self']"
|
|
79
|
+
[style.order]="layoutNode?.options?.order"
|
|
80
|
+
[fxFlex]="layoutNode?.options?.fxFlex"
|
|
81
|
+
[fxFlexOrder]="layoutNode?.options?.fxFlexOrder"
|
|
82
|
+
[fxFlexOffset]="layoutNode?.options?.fxFlexOffset"
|
|
83
|
+
[fxFlexAlign]="layoutNode?.options?.fxFlexAlign">
|
|
84
|
+
<select-framework-widget *ngIf="showWidget(layoutNode)"
|
|
85
|
+
[dataIndex]="layoutNode?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
|
|
86
|
+
[layoutIndex]="(layoutIndex || []).concat(i)"
|
|
87
|
+
[layoutNode]="layoutNode"></select-framework-widget>
|
|
88
|
+
<div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultFlexOrderDirective, selector: " [fxFlexOrder], [fxFlexOrder.xs], [fxFlexOrder.sm], [fxFlexOrder.md], [fxFlexOrder.lg], [fxFlexOrder.xl], [fxFlexOrder.lt-sm], [fxFlexOrder.lt-md], [fxFlexOrder.lt-lg], [fxFlexOrder.lt-xl], [fxFlexOrder.gt-xs], [fxFlexOrder.gt-sm], [fxFlexOrder.gt-md], [fxFlexOrder.gt-lg]", inputs: ["fxFlexOrder", "fxFlexOrder.xs", "fxFlexOrder.sm", "fxFlexOrder.md", "fxFlexOrder.lg", "fxFlexOrder.xl", "fxFlexOrder.lt-sm", "fxFlexOrder.lt-md", "fxFlexOrder.lt-lg", "fxFlexOrder.lt-xl", "fxFlexOrder.gt-xs", "fxFlexOrder.gt-sm", "fxFlexOrder.gt-md", "fxFlexOrder.gt-lg"] }, { kind: "directive", type: i3.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: "directive", type: i3.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: i3.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: i1.SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutRootComponent, decorators: [{
|
|
90
|
+
type: Component,
|
|
91
|
+
args: [{
|
|
92
|
+
// tslint:disable-next-line:component-selector
|
|
93
|
+
selector: 'flex-layout-root-widget',
|
|
94
|
+
template: `
|
|
95
|
+
<div *ngFor="let layoutNode of layout; let i = index"
|
|
96
|
+
[class.form-flex-item]="isFlexItem"
|
|
97
|
+
[style.flex-grow]="getFlexAttribute(layoutNode, 'flex-grow')"
|
|
98
|
+
[style.flex-shrink]="getFlexAttribute(layoutNode, 'flex-shrink')"
|
|
99
|
+
[style.flex-basis]="getFlexAttribute(layoutNode, 'flex-basis')"
|
|
100
|
+
[style.align-self]="(layoutNode?.options || {})['align-self']"
|
|
101
|
+
[style.order]="layoutNode?.options?.order"
|
|
102
|
+
[fxFlex]="layoutNode?.options?.fxFlex"
|
|
103
|
+
[fxFlexOrder]="layoutNode?.options?.fxFlexOrder"
|
|
104
|
+
[fxFlexOffset]="layoutNode?.options?.fxFlexOffset"
|
|
105
|
+
[fxFlexAlign]="layoutNode?.options?.fxFlexAlign">
|
|
106
|
+
<select-framework-widget *ngIf="showWidget(layoutNode)"
|
|
107
|
+
[dataIndex]="layoutNode?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])"
|
|
108
|
+
[layoutIndex]="(layoutIndex || []).concat(i)"
|
|
109
|
+
[layoutNode]="layoutNode"></select-framework-widget>
|
|
110
|
+
<div>`,
|
|
111
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
112
|
+
}]
|
|
113
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { dataIndex: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], layoutIndex: [{
|
|
116
|
+
type: Input
|
|
117
|
+
}], layout: [{
|
|
118
|
+
type: Input
|
|
119
|
+
}], isFlexItem: [{
|
|
120
|
+
type: Input
|
|
121
|
+
}] } });
|
|
122
|
+
|
|
123
|
+
class FlexLayoutSectionComponent {
|
|
124
|
+
constructor(jsf) {
|
|
125
|
+
this.jsf = jsf;
|
|
126
|
+
this.controlDisabled = false;
|
|
127
|
+
this.boundControl = false;
|
|
128
|
+
this.expanded = true;
|
|
129
|
+
this.containerType = 'div';
|
|
130
|
+
}
|
|
131
|
+
get sectionTitle() {
|
|
132
|
+
return this.options.notitle ? null : this.jsf.setItemTitle(this);
|
|
133
|
+
}
|
|
134
|
+
ngOnInit() {
|
|
135
|
+
this.jsf.initializeControl(this);
|
|
136
|
+
this.options = this.layoutNode.options || {};
|
|
137
|
+
this.expanded = typeof this.options.expanded === 'boolean' ?
|
|
138
|
+
this.options.expanded : !this.options.expandable;
|
|
139
|
+
switch (this.layoutNode.type) {
|
|
140
|
+
case 'section':
|
|
141
|
+
case 'array':
|
|
142
|
+
case 'fieldset':
|
|
143
|
+
case 'advancedfieldset':
|
|
144
|
+
case 'authfieldset':
|
|
145
|
+
case 'optionfieldset':
|
|
146
|
+
case 'selectfieldset':
|
|
147
|
+
this.containerType = 'fieldset';
|
|
148
|
+
break;
|
|
149
|
+
case 'card':
|
|
150
|
+
this.containerType = 'card';
|
|
151
|
+
break;
|
|
152
|
+
case 'expansion-panel':
|
|
153
|
+
this.containerType = 'expansion-panel';
|
|
154
|
+
break;
|
|
155
|
+
default: // 'div', 'flex', 'tab', 'conditional', 'actions'
|
|
156
|
+
this.containerType = 'div';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
toggleExpanded() {
|
|
160
|
+
if (this.options.expandable) {
|
|
161
|
+
this.expanded = !this.expanded;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Set attributes for flexbox container
|
|
165
|
+
// (child attributes are set in flex-layout-root.component)
|
|
166
|
+
getFlexAttribute(attribute) {
|
|
167
|
+
const flexActive = this.layoutNode.type === 'flex' ||
|
|
168
|
+
!!this.options.displayFlex ||
|
|
169
|
+
this.options.display === 'flex';
|
|
170
|
+
// if (attribute !== 'flex' && !flexActive) { return null; }
|
|
171
|
+
switch (attribute) {
|
|
172
|
+
case 'is-flex':
|
|
173
|
+
return flexActive;
|
|
174
|
+
case 'display':
|
|
175
|
+
return flexActive ? 'flex' : 'initial';
|
|
176
|
+
case 'flex-direction':
|
|
177
|
+
case 'flex-wrap':
|
|
178
|
+
const index = ['flex-direction', 'flex-wrap'].indexOf(attribute);
|
|
179
|
+
return (this.options['flex-flow'] || '').split(/\s+/)[index] ||
|
|
180
|
+
this.options[attribute] || ['column', 'nowrap'][index];
|
|
181
|
+
case 'justify-content':
|
|
182
|
+
case 'align-items':
|
|
183
|
+
case 'align-content':
|
|
184
|
+
return this.options[attribute];
|
|
185
|
+
case 'layout':
|
|
186
|
+
return (this.options.fxLayout || 'row') +
|
|
187
|
+
this.options.fxLayoutWrap ? ' ' + this.options.fxLayoutWrap : '';
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
FlexLayoutSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutSectionComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
192
|
+
FlexLayoutSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FlexLayoutSectionComponent, selector: "flex-layout-section-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
193
|
+
<div *ngIf="containerType === 'div'"
|
|
194
|
+
[class]="options?.htmlClass || ''"
|
|
195
|
+
[class.expandable]="options?.expandable && !expanded"
|
|
196
|
+
[class.expanded]="options?.expandable && expanded">
|
|
197
|
+
<label *ngIf="sectionTitle"
|
|
198
|
+
[class]="'legend ' + (options?.labelHtmlClass || '')"
|
|
199
|
+
[innerHTML]="sectionTitle"
|
|
200
|
+
(click)="toggleExpanded()"></label>
|
|
201
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
202
|
+
[layout]="layoutNode.items"
|
|
203
|
+
[dataIndex]="dataIndex"
|
|
204
|
+
[layoutIndex]="layoutIndex"
|
|
205
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
206
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
207
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
208
|
+
[style.display]="getFlexAttribute('display')"
|
|
209
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
210
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
211
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
212
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
213
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
214
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
215
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
216
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
217
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
218
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
219
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<fieldset *ngIf="containerType === 'fieldset'"
|
|
223
|
+
[class]="options?.htmlClass || ''"
|
|
224
|
+
[class.expandable]="options?.expandable && !expanded"
|
|
225
|
+
[class.expanded]="options?.expandable && expanded"
|
|
226
|
+
[disabled]="options?.readonly">
|
|
227
|
+
<legend *ngIf="sectionTitle"
|
|
228
|
+
[class]="'legend ' + (options?.labelHtmlClass || '')"
|
|
229
|
+
[innerHTML]="sectionTitle"
|
|
230
|
+
(click)="toggleExpanded()"></legend>
|
|
231
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
232
|
+
[layout]="layoutNode.items"
|
|
233
|
+
[dataIndex]="dataIndex"
|
|
234
|
+
[layoutIndex]="layoutIndex"
|
|
235
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
236
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
237
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
238
|
+
[style.display]="getFlexAttribute('display')"
|
|
239
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
240
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
241
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
242
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
243
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
244
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
245
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
246
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
247
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
248
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
249
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
250
|
+
</fieldset>
|
|
251
|
+
|
|
252
|
+
<mat-card *ngIf="containerType === 'card'"
|
|
253
|
+
[ngClass]="options?.htmlClass || ''"
|
|
254
|
+
[class.expandable]="options?.expandable && !expanded"
|
|
255
|
+
[class.expanded]="options?.expandable && expanded">
|
|
256
|
+
<mat-card-header *ngIf="sectionTitle">
|
|
257
|
+
<legend
|
|
258
|
+
[class]="'legend ' + (options?.labelHtmlClass || '')"
|
|
259
|
+
[innerHTML]="sectionTitle"
|
|
260
|
+
(click)="toggleExpanded()"></legend>
|
|
261
|
+
</mat-card-header>
|
|
262
|
+
<mat-card-content *ngIf="expanded">
|
|
263
|
+
<fieldset [disabled]="options?.readonly">
|
|
264
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
265
|
+
[layout]="layoutNode.items"
|
|
266
|
+
[dataIndex]="dataIndex"
|
|
267
|
+
[layoutIndex]="layoutIndex"
|
|
268
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
269
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
270
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
271
|
+
[style.display]="getFlexAttribute('display')"
|
|
272
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
273
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
274
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
275
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
276
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
277
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
278
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
279
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
280
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
281
|
+
</fieldset>
|
|
282
|
+
</mat-card-content>
|
|
283
|
+
<mat-card-footer>
|
|
284
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
285
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
286
|
+
</mat-card-footer>
|
|
287
|
+
</mat-card>
|
|
288
|
+
|
|
289
|
+
<mat-expansion-panel *ngIf="containerType === 'expansion-panel'"
|
|
290
|
+
[expanded]="expanded"
|
|
291
|
+
[hideToggle]="!options?.expandable">
|
|
292
|
+
<mat-expansion-panel-header>
|
|
293
|
+
<mat-panel-title>
|
|
294
|
+
<legend *ngIf="sectionTitle"
|
|
295
|
+
[class]="options?.labelHtmlClass"
|
|
296
|
+
[innerHTML]="sectionTitle"
|
|
297
|
+
(click)="toggleExpanded()"></legend>
|
|
298
|
+
</mat-panel-title>
|
|
299
|
+
</mat-expansion-panel-header>
|
|
300
|
+
<fieldset [disabled]="options?.readonly">
|
|
301
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
302
|
+
[layout]="layoutNode.items"
|
|
303
|
+
[dataIndex]="dataIndex"
|
|
304
|
+
[layoutIndex]="layoutIndex"
|
|
305
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
306
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
307
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
308
|
+
[style.display]="getFlexAttribute('display')"
|
|
309
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
310
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
311
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
312
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
313
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
314
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
315
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
316
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
317
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
318
|
+
</fieldset>
|
|
319
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
320
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
321
|
+
</mat-expansion-panel>`, isInline: true, styles: ["fieldset{border:0;margin:0;padding:0}.legend{font-weight:700}.expandable>.legend:before{content:\"\\25b6\";padding-right:.3em}.expanded>.legend:before{content:\"\\25bc\";padding-right:.2em}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.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"] }, { kind: "directive", type: i3.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: i3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "directive", type: i4.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: i5.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i5.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i5.MatCardFooter, selector: "mat-card-footer" }, { kind: "component", type: i6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i6.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: FlexLayoutRootComponent, selector: "flex-layout-root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isFlexItem"] }] });
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutSectionComponent, decorators: [{
|
|
323
|
+
type: Component,
|
|
324
|
+
args: [{ selector: 'flex-layout-section-widget', template: `
|
|
325
|
+
<div *ngIf="containerType === 'div'"
|
|
326
|
+
[class]="options?.htmlClass || ''"
|
|
327
|
+
[class.expandable]="options?.expandable && !expanded"
|
|
328
|
+
[class.expanded]="options?.expandable && expanded">
|
|
329
|
+
<label *ngIf="sectionTitle"
|
|
330
|
+
[class]="'legend ' + (options?.labelHtmlClass || '')"
|
|
331
|
+
[innerHTML]="sectionTitle"
|
|
332
|
+
(click)="toggleExpanded()"></label>
|
|
333
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
334
|
+
[layout]="layoutNode.items"
|
|
335
|
+
[dataIndex]="dataIndex"
|
|
336
|
+
[layoutIndex]="layoutIndex"
|
|
337
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
338
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
339
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
340
|
+
[style.display]="getFlexAttribute('display')"
|
|
341
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
342
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
343
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
344
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
345
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
346
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
347
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
348
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
349
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
350
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
351
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
<fieldset *ngIf="containerType === 'fieldset'"
|
|
355
|
+
[class]="options?.htmlClass || ''"
|
|
356
|
+
[class.expandable]="options?.expandable && !expanded"
|
|
357
|
+
[class.expanded]="options?.expandable && expanded"
|
|
358
|
+
[disabled]="options?.readonly">
|
|
359
|
+
<legend *ngIf="sectionTitle"
|
|
360
|
+
[class]="'legend ' + (options?.labelHtmlClass || '')"
|
|
361
|
+
[innerHTML]="sectionTitle"
|
|
362
|
+
(click)="toggleExpanded()"></legend>
|
|
363
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
364
|
+
[layout]="layoutNode.items"
|
|
365
|
+
[dataIndex]="dataIndex"
|
|
366
|
+
[layoutIndex]="layoutIndex"
|
|
367
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
368
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
369
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
370
|
+
[style.display]="getFlexAttribute('display')"
|
|
371
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
372
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
373
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
374
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
375
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
376
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
377
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
378
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
379
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
380
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
381
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
382
|
+
</fieldset>
|
|
383
|
+
|
|
384
|
+
<mat-card *ngIf="containerType === 'card'"
|
|
385
|
+
[ngClass]="options?.htmlClass || ''"
|
|
386
|
+
[class.expandable]="options?.expandable && !expanded"
|
|
387
|
+
[class.expanded]="options?.expandable && expanded">
|
|
388
|
+
<mat-card-header *ngIf="sectionTitle">
|
|
389
|
+
<legend
|
|
390
|
+
[class]="'legend ' + (options?.labelHtmlClass || '')"
|
|
391
|
+
[innerHTML]="sectionTitle"
|
|
392
|
+
(click)="toggleExpanded()"></legend>
|
|
393
|
+
</mat-card-header>
|
|
394
|
+
<mat-card-content *ngIf="expanded">
|
|
395
|
+
<fieldset [disabled]="options?.readonly">
|
|
396
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
397
|
+
[layout]="layoutNode.items"
|
|
398
|
+
[dataIndex]="dataIndex"
|
|
399
|
+
[layoutIndex]="layoutIndex"
|
|
400
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
401
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
402
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
403
|
+
[style.display]="getFlexAttribute('display')"
|
|
404
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
405
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
406
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
407
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
408
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
409
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
410
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
411
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
412
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
413
|
+
</fieldset>
|
|
414
|
+
</mat-card-content>
|
|
415
|
+
<mat-card-footer>
|
|
416
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
417
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
418
|
+
</mat-card-footer>
|
|
419
|
+
</mat-card>
|
|
420
|
+
|
|
421
|
+
<mat-expansion-panel *ngIf="containerType === 'expansion-panel'"
|
|
422
|
+
[expanded]="expanded"
|
|
423
|
+
[hideToggle]="!options?.expandable">
|
|
424
|
+
<mat-expansion-panel-header>
|
|
425
|
+
<mat-panel-title>
|
|
426
|
+
<legend *ngIf="sectionTitle"
|
|
427
|
+
[class]="options?.labelHtmlClass"
|
|
428
|
+
[innerHTML]="sectionTitle"
|
|
429
|
+
(click)="toggleExpanded()"></legend>
|
|
430
|
+
</mat-panel-title>
|
|
431
|
+
</mat-expansion-panel-header>
|
|
432
|
+
<fieldset [disabled]="options?.readonly">
|
|
433
|
+
<flex-layout-root-widget *ngIf="expanded"
|
|
434
|
+
[layout]="layoutNode.items"
|
|
435
|
+
[dataIndex]="dataIndex"
|
|
436
|
+
[layoutIndex]="layoutIndex"
|
|
437
|
+
[isFlexItem]="getFlexAttribute('is-flex')"
|
|
438
|
+
[class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'"
|
|
439
|
+
[class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'"
|
|
440
|
+
[style.display]="getFlexAttribute('display')"
|
|
441
|
+
[style.flex-direction]="getFlexAttribute('flex-direction')"
|
|
442
|
+
[style.flex-wrap]="getFlexAttribute('flex-wrap')"
|
|
443
|
+
[style.justify-content]="getFlexAttribute('justify-content')"
|
|
444
|
+
[style.align-items]="getFlexAttribute('align-items')"
|
|
445
|
+
[style.align-content]="getFlexAttribute('align-content')"
|
|
446
|
+
[fxLayout]="getFlexAttribute('layout')"
|
|
447
|
+
[fxLayoutGap]="options?.fxLayoutGap"
|
|
448
|
+
[fxLayoutAlign]="options?.fxLayoutAlign"
|
|
449
|
+
[attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget>
|
|
450
|
+
</fieldset>
|
|
451
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
452
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
453
|
+
</mat-expansion-panel>`, styles: ["fieldset{border:0;margin:0;padding:0}.legend{font-weight:700}.expandable>.legend:before{content:\"\\25b6\";padding-right:.3em}.expanded>.legend:before{content:\"\\25bc\";padding-right:.2em}\n"] }]
|
|
454
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
455
|
+
type: Input
|
|
456
|
+
}], layoutIndex: [{
|
|
457
|
+
type: Input
|
|
458
|
+
}], dataIndex: [{
|
|
459
|
+
type: Input
|
|
460
|
+
}] } });
|
|
461
|
+
|
|
462
|
+
class MaterialAddReferenceComponent {
|
|
463
|
+
constructor(jsf) {
|
|
464
|
+
this.jsf = jsf;
|
|
465
|
+
}
|
|
466
|
+
ngOnInit() {
|
|
467
|
+
this.options = this.layoutNode.options || {};
|
|
468
|
+
}
|
|
469
|
+
get showAddButton() {
|
|
470
|
+
return !this.layoutNode.arrayItem ||
|
|
471
|
+
this.layoutIndex[this.layoutIndex.length - 1] < this.options.maxItems;
|
|
472
|
+
}
|
|
473
|
+
addItem(event) {
|
|
474
|
+
event.preventDefault();
|
|
475
|
+
this.jsf.addItem(this);
|
|
476
|
+
}
|
|
477
|
+
get buttonText() {
|
|
478
|
+
const parent = {
|
|
479
|
+
dataIndex: this.dataIndex.slice(0, -1),
|
|
480
|
+
layoutIndex: this.layoutIndex.slice(0, -1),
|
|
481
|
+
layoutNode: this.jsf.getParentNode(this),
|
|
482
|
+
};
|
|
483
|
+
return parent.layoutNode.add ||
|
|
484
|
+
this.jsf.setArrayItemTitle(parent, this.layoutNode, this.itemCount);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
MaterialAddReferenceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialAddReferenceComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
488
|
+
MaterialAddReferenceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialAddReferenceComponent, selector: "material-add-reference-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
489
|
+
<section [class]="options?.htmlClass || ''" align="end">
|
|
490
|
+
<button mat-raised-button *ngIf="showAddButton"
|
|
491
|
+
[color]="options?.color || 'accent'"
|
|
492
|
+
[disabled]="options?.readonly"
|
|
493
|
+
(click)="addItem($event)">
|
|
494
|
+
<span *ngIf="options?.icon" [class]="options?.icon"></span>
|
|
495
|
+
<span *ngIf="options?.title" [innerHTML]="buttonText"></span>
|
|
496
|
+
</button>
|
|
497
|
+
</section>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.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"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialAddReferenceComponent, decorators: [{
|
|
499
|
+
type: Component,
|
|
500
|
+
args: [{
|
|
501
|
+
// tslint:disable-next-line:component-selector
|
|
502
|
+
selector: 'material-add-reference-widget',
|
|
503
|
+
template: `
|
|
504
|
+
<section [class]="options?.htmlClass || ''" align="end">
|
|
505
|
+
<button mat-raised-button *ngIf="showAddButton"
|
|
506
|
+
[color]="options?.color || 'accent'"
|
|
507
|
+
[disabled]="options?.readonly"
|
|
508
|
+
(click)="addItem($event)">
|
|
509
|
+
<span *ngIf="options?.icon" [class]="options?.icon"></span>
|
|
510
|
+
<span *ngIf="options?.title" [innerHTML]="buttonText"></span>
|
|
511
|
+
</button>
|
|
512
|
+
</section>`,
|
|
513
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
514
|
+
}]
|
|
515
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
516
|
+
type: Input
|
|
517
|
+
}], layoutIndex: [{
|
|
518
|
+
type: Input
|
|
519
|
+
}], dataIndex: [{
|
|
520
|
+
type: Input
|
|
521
|
+
}] } });
|
|
522
|
+
|
|
523
|
+
class MaterialButtonComponent {
|
|
524
|
+
constructor(jsf) {
|
|
525
|
+
this.jsf = jsf;
|
|
526
|
+
this.controlDisabled = false;
|
|
527
|
+
this.boundControl = false;
|
|
528
|
+
}
|
|
529
|
+
ngOnInit() {
|
|
530
|
+
this.options = this.layoutNode.options || {};
|
|
531
|
+
this.jsf.initializeControl(this);
|
|
532
|
+
if (hasOwn(this.options, 'disabled')) {
|
|
533
|
+
this.controlDisabled = this.options.disabled;
|
|
534
|
+
}
|
|
535
|
+
else if (this.jsf.formOptions.disableInvalidSubmit) {
|
|
536
|
+
this.controlDisabled = !this.jsf.isValid;
|
|
537
|
+
this.jsf.isValidChanges.subscribe(isValid => this.controlDisabled = !isValid);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
updateValue(event) {
|
|
541
|
+
if (typeof this.options.onClick === 'function') {
|
|
542
|
+
this.options.onClick(event);
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
this.jsf.updateValue(this, event.target.value);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
MaterialButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
550
|
+
MaterialButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialButtonComponent, selector: "material-button-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
551
|
+
<div class="button-row" [class]="options?.htmlClass || ''">
|
|
552
|
+
<button mat-raised-button
|
|
553
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
554
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
555
|
+
[color]="options?.color || 'primary'"
|
|
556
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
557
|
+
[id]="'control' + layoutNode?._id"
|
|
558
|
+
[name]="controlName"
|
|
559
|
+
[type]="layoutNode?.type"
|
|
560
|
+
[value]="controlValue"
|
|
561
|
+
(click)="updateValue($event)">
|
|
562
|
+
<mat-icon *ngIf="options?.icon" class="mat-24">{{options?.icon}}</mat-icon>
|
|
563
|
+
<span *ngIf="options?.title" [innerHTML]="options?.title"></span>
|
|
564
|
+
</button>
|
|
565
|
+
</div>`, isInline: true, styles: ["button{margin-top:10px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.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$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonComponent, decorators: [{
|
|
567
|
+
type: Component,
|
|
568
|
+
args: [{ selector: 'material-button-widget', template: `
|
|
569
|
+
<div class="button-row" [class]="options?.htmlClass || ''">
|
|
570
|
+
<button mat-raised-button
|
|
571
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
572
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
573
|
+
[color]="options?.color || 'primary'"
|
|
574
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
575
|
+
[id]="'control' + layoutNode?._id"
|
|
576
|
+
[name]="controlName"
|
|
577
|
+
[type]="layoutNode?.type"
|
|
578
|
+
[value]="controlValue"
|
|
579
|
+
(click)="updateValue($event)">
|
|
580
|
+
<mat-icon *ngIf="options?.icon" class="mat-24">{{options?.icon}}</mat-icon>
|
|
581
|
+
<span *ngIf="options?.title" [innerHTML]="options?.title"></span>
|
|
582
|
+
</button>
|
|
583
|
+
</div>`, styles: ["button{margin-top:10px}\n"] }]
|
|
584
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
585
|
+
type: Input
|
|
586
|
+
}], layoutIndex: [{
|
|
587
|
+
type: Input
|
|
588
|
+
}], dataIndex: [{
|
|
589
|
+
type: Input
|
|
590
|
+
}] } });
|
|
591
|
+
|
|
592
|
+
class MaterialButtonGroupComponent {
|
|
593
|
+
constructor(jsf) {
|
|
594
|
+
this.jsf = jsf;
|
|
595
|
+
this.controlDisabled = false;
|
|
596
|
+
this.boundControl = false;
|
|
597
|
+
this.radiosList = [];
|
|
598
|
+
this.vertical = false;
|
|
599
|
+
}
|
|
600
|
+
ngOnInit() {
|
|
601
|
+
this.options = this.layoutNode.options || {};
|
|
602
|
+
this.radiosList = buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true);
|
|
603
|
+
this.jsf.initializeControl(this);
|
|
604
|
+
}
|
|
605
|
+
updateValue(value) {
|
|
606
|
+
this.options.showErrors = true;
|
|
607
|
+
this.jsf.updateValue(this, value);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
MaterialButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonGroupComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
611
|
+
MaterialButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialButtonGroupComponent, selector: "material-button-group-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
612
|
+
<div>
|
|
613
|
+
<div *ngIf="options?.title">
|
|
614
|
+
<label
|
|
615
|
+
[attr.for]="'control' + layoutNode?._id"
|
|
616
|
+
[class]="options?.labelHtmlClass || ''"
|
|
617
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
618
|
+
[innerHTML]="options?.title"></label>
|
|
619
|
+
</div>
|
|
620
|
+
<mat-button-toggle-group
|
|
621
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
622
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
623
|
+
[attr.required]="options?.required"
|
|
624
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
625
|
+
[name]="controlName"
|
|
626
|
+
[value]="controlValue"
|
|
627
|
+
[vertical]="!!options.vertical">
|
|
628
|
+
<mat-button-toggle *ngFor="let radioItem of radiosList"
|
|
629
|
+
[id]="'control' + layoutNode?._id + '/' + radioItem?.name"
|
|
630
|
+
[value]="radioItem?.value"
|
|
631
|
+
(click)="updateValue(radioItem?.value)">
|
|
632
|
+
<span [innerHTML]="radioItem?.name"></span>
|
|
633
|
+
</mat-button-toggle>
|
|
634
|
+
</mat-button-toggle-group>
|
|
635
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
636
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
637
|
+
</div>`, isInline: true, styles: ["mat-error{font-size:75%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonGroupComponent, decorators: [{
|
|
639
|
+
type: Component,
|
|
640
|
+
args: [{ selector: 'material-button-group-widget', template: `
|
|
641
|
+
<div>
|
|
642
|
+
<div *ngIf="options?.title">
|
|
643
|
+
<label
|
|
644
|
+
[attr.for]="'control' + layoutNode?._id"
|
|
645
|
+
[class]="options?.labelHtmlClass || ''"
|
|
646
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
647
|
+
[innerHTML]="options?.title"></label>
|
|
648
|
+
</div>
|
|
649
|
+
<mat-button-toggle-group
|
|
650
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
651
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
652
|
+
[attr.required]="options?.required"
|
|
653
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
654
|
+
[name]="controlName"
|
|
655
|
+
[value]="controlValue"
|
|
656
|
+
[vertical]="!!options.vertical">
|
|
657
|
+
<mat-button-toggle *ngFor="let radioItem of radiosList"
|
|
658
|
+
[id]="'control' + layoutNode?._id + '/' + radioItem?.name"
|
|
659
|
+
[value]="radioItem?.value"
|
|
660
|
+
(click)="updateValue(radioItem?.value)">
|
|
661
|
+
<span [innerHTML]="radioItem?.name"></span>
|
|
662
|
+
</mat-button-toggle>
|
|
663
|
+
</mat-button-toggle-group>
|
|
664
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
665
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
666
|
+
</div>`, styles: ["mat-error{font-size:75%}\n"] }]
|
|
667
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
668
|
+
type: Input
|
|
669
|
+
}], layoutIndex: [{
|
|
670
|
+
type: Input
|
|
671
|
+
}], dataIndex: [{
|
|
672
|
+
type: Input
|
|
673
|
+
}] } });
|
|
674
|
+
|
|
675
|
+
class MaterialCheckboxComponent {
|
|
676
|
+
constructor(jsf) {
|
|
677
|
+
this.jsf = jsf;
|
|
678
|
+
this.controlDisabled = false;
|
|
679
|
+
this.boundControl = false;
|
|
680
|
+
this.trueValue = true;
|
|
681
|
+
this.falseValue = false;
|
|
682
|
+
this.showSlideToggle = false;
|
|
683
|
+
}
|
|
684
|
+
ngOnInit() {
|
|
685
|
+
this.options = this.layoutNode.options || {};
|
|
686
|
+
this.jsf.initializeControl(this, !this.options.readonly);
|
|
687
|
+
if (this.controlValue === null || this.controlValue === undefined) {
|
|
688
|
+
this.controlValue = false;
|
|
689
|
+
this.jsf.updateValue(this, this.falseValue);
|
|
690
|
+
}
|
|
691
|
+
if (this.layoutNode.type === 'slide-toggle' ||
|
|
692
|
+
this.layoutNode.format === 'slide-toggle') {
|
|
693
|
+
this.showSlideToggle = true;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
updateValue(event) {
|
|
697
|
+
this.options.showErrors = true;
|
|
698
|
+
this.jsf.updateValue(this, event.checked ? this.trueValue : this.falseValue);
|
|
699
|
+
}
|
|
700
|
+
get isChecked() {
|
|
701
|
+
return this.jsf.getFormControlValue(this) === this.trueValue;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
MaterialCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialCheckboxComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
705
|
+
MaterialCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialCheckboxComponent, selector: "material-checkbox-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
706
|
+
<mat-checkbox *ngIf="boundControl && !showSlideToggle"
|
|
707
|
+
[formControl]="formControl"
|
|
708
|
+
align="left"
|
|
709
|
+
[color]="options?.color || 'primary'"
|
|
710
|
+
[id]="'control' + layoutNode?._id"
|
|
711
|
+
labelPosition="after"
|
|
712
|
+
[name]="controlName"
|
|
713
|
+
(blur)="options.showErrors = true">
|
|
714
|
+
<span *ngIf="options?.title"
|
|
715
|
+
class="checkbox-name"
|
|
716
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
717
|
+
[innerHTML]="options?.title"></span>
|
|
718
|
+
</mat-checkbox>
|
|
719
|
+
<mat-checkbox *ngIf="!boundControl && !showSlideToggle"
|
|
720
|
+
align="left"
|
|
721
|
+
[color]="options?.color || 'primary'"
|
|
722
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
723
|
+
[id]="'control' + layoutNode?._id"
|
|
724
|
+
labelPosition="after"
|
|
725
|
+
[name]="controlName"
|
|
726
|
+
[checked]="isChecked"
|
|
727
|
+
(blur)="options.showErrors = true"
|
|
728
|
+
(change)="updateValue($event)">
|
|
729
|
+
<span *ngIf="options?.title"
|
|
730
|
+
class="checkbox-name"
|
|
731
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
732
|
+
[innerHTML]="options?.title"></span>
|
|
733
|
+
</mat-checkbox>
|
|
734
|
+
<mat-slide-toggle *ngIf="boundControl && showSlideToggle"
|
|
735
|
+
[formControl]="formControl"
|
|
736
|
+
align="left"
|
|
737
|
+
[color]="options?.color || 'primary'"
|
|
738
|
+
[id]="'control' + layoutNode?._id"
|
|
739
|
+
labelPosition="after"
|
|
740
|
+
[name]="controlName"
|
|
741
|
+
(blur)="options.showErrors = true">
|
|
742
|
+
<span *ngIf="options?.title"
|
|
743
|
+
class="checkbox-name"
|
|
744
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
745
|
+
[innerHTML]="options?.title"></span>
|
|
746
|
+
</mat-slide-toggle>
|
|
747
|
+
<mat-slide-toggle *ngIf="!boundControl && showSlideToggle"
|
|
748
|
+
align="left"
|
|
749
|
+
[color]="options?.color || 'primary'"
|
|
750
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
751
|
+
[id]="'control' + layoutNode?._id"
|
|
752
|
+
labelPosition="after"
|
|
753
|
+
[name]="controlName"
|
|
754
|
+
[checked]="isChecked"
|
|
755
|
+
(blur)="options.showErrors = true"
|
|
756
|
+
(change)="updateValue($event)">
|
|
757
|
+
<span *ngIf="options?.title"
|
|
758
|
+
class="checkbox-name"
|
|
759
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
760
|
+
[innerHTML]="options?.title"></span>
|
|
761
|
+
</mat-slide-toggle>
|
|
762
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
763
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: [".checkbox-name{white-space:nowrap}mat-error{font-size:75%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }] });
|
|
764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialCheckboxComponent, decorators: [{
|
|
765
|
+
type: Component,
|
|
766
|
+
args: [{ selector: 'material-checkbox-widget', template: `
|
|
767
|
+
<mat-checkbox *ngIf="boundControl && !showSlideToggle"
|
|
768
|
+
[formControl]="formControl"
|
|
769
|
+
align="left"
|
|
770
|
+
[color]="options?.color || 'primary'"
|
|
771
|
+
[id]="'control' + layoutNode?._id"
|
|
772
|
+
labelPosition="after"
|
|
773
|
+
[name]="controlName"
|
|
774
|
+
(blur)="options.showErrors = true">
|
|
775
|
+
<span *ngIf="options?.title"
|
|
776
|
+
class="checkbox-name"
|
|
777
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
778
|
+
[innerHTML]="options?.title"></span>
|
|
779
|
+
</mat-checkbox>
|
|
780
|
+
<mat-checkbox *ngIf="!boundControl && !showSlideToggle"
|
|
781
|
+
align="left"
|
|
782
|
+
[color]="options?.color || 'primary'"
|
|
783
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
784
|
+
[id]="'control' + layoutNode?._id"
|
|
785
|
+
labelPosition="after"
|
|
786
|
+
[name]="controlName"
|
|
787
|
+
[checked]="isChecked"
|
|
788
|
+
(blur)="options.showErrors = true"
|
|
789
|
+
(change)="updateValue($event)">
|
|
790
|
+
<span *ngIf="options?.title"
|
|
791
|
+
class="checkbox-name"
|
|
792
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
793
|
+
[innerHTML]="options?.title"></span>
|
|
794
|
+
</mat-checkbox>
|
|
795
|
+
<mat-slide-toggle *ngIf="boundControl && showSlideToggle"
|
|
796
|
+
[formControl]="formControl"
|
|
797
|
+
align="left"
|
|
798
|
+
[color]="options?.color || 'primary'"
|
|
799
|
+
[id]="'control' + layoutNode?._id"
|
|
800
|
+
labelPosition="after"
|
|
801
|
+
[name]="controlName"
|
|
802
|
+
(blur)="options.showErrors = true">
|
|
803
|
+
<span *ngIf="options?.title"
|
|
804
|
+
class="checkbox-name"
|
|
805
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
806
|
+
[innerHTML]="options?.title"></span>
|
|
807
|
+
</mat-slide-toggle>
|
|
808
|
+
<mat-slide-toggle *ngIf="!boundControl && showSlideToggle"
|
|
809
|
+
align="left"
|
|
810
|
+
[color]="options?.color || 'primary'"
|
|
811
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
812
|
+
[id]="'control' + layoutNode?._id"
|
|
813
|
+
labelPosition="after"
|
|
814
|
+
[name]="controlName"
|
|
815
|
+
[checked]="isChecked"
|
|
816
|
+
(blur)="options.showErrors = true"
|
|
817
|
+
(change)="updateValue($event)">
|
|
818
|
+
<span *ngIf="options?.title"
|
|
819
|
+
class="checkbox-name"
|
|
820
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
821
|
+
[innerHTML]="options?.title"></span>
|
|
822
|
+
</mat-slide-toggle>
|
|
823
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
824
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: [".checkbox-name{white-space:nowrap}mat-error{font-size:75%}\n"] }]
|
|
825
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
826
|
+
type: Input
|
|
827
|
+
}], layoutIndex: [{
|
|
828
|
+
type: Input
|
|
829
|
+
}], dataIndex: [{
|
|
830
|
+
type: Input
|
|
831
|
+
}] } });
|
|
832
|
+
|
|
833
|
+
// TODO: Change this to use a Selection List instead?
|
|
834
|
+
// https://material.angular.io/components/list/overview
|
|
835
|
+
class MaterialCheckboxesComponent {
|
|
836
|
+
constructor(jsf) {
|
|
837
|
+
this.jsf = jsf;
|
|
838
|
+
this.controlDisabled = false;
|
|
839
|
+
this.boundControl = false;
|
|
840
|
+
this.horizontalList = false;
|
|
841
|
+
this.checkboxList = [];
|
|
842
|
+
}
|
|
843
|
+
ngOnInit() {
|
|
844
|
+
this.options = this.layoutNode.options || {};
|
|
845
|
+
this.horizontalList = this.layoutNode.type === 'checkboxes-inline' ||
|
|
846
|
+
this.layoutNode.type === 'checkboxbuttons';
|
|
847
|
+
this.jsf.initializeControl(this);
|
|
848
|
+
this.checkboxList = buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true);
|
|
849
|
+
if (this.boundControl) {
|
|
850
|
+
const formArray = this.jsf.getFormControl(this);
|
|
851
|
+
for (const checkboxItem of this.checkboxList) {
|
|
852
|
+
checkboxItem.checked = formArray.value.includes(checkboxItem.value);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
get allChecked() {
|
|
857
|
+
return this.checkboxList.filter(t => t.checked).length === this.checkboxList.length;
|
|
858
|
+
}
|
|
859
|
+
get someChecked() {
|
|
860
|
+
const checkedItems = this.checkboxList.filter(t => t.checked).length;
|
|
861
|
+
return checkedItems > 0 && checkedItems < this.checkboxList.length;
|
|
862
|
+
}
|
|
863
|
+
updateValue() {
|
|
864
|
+
this.options.showErrors = true;
|
|
865
|
+
if (this.boundControl) {
|
|
866
|
+
this.jsf.updateArrayCheckboxList(this, this.checkboxList);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
updateAllValues(event) {
|
|
870
|
+
this.options.showErrors = true;
|
|
871
|
+
this.checkboxList.forEach(t => t.checked = event.checked);
|
|
872
|
+
this.updateValue();
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
MaterialCheckboxesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialCheckboxesComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
876
|
+
MaterialCheckboxesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialCheckboxesComponent, selector: "material-checkboxes-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
877
|
+
<div>
|
|
878
|
+
<mat-checkbox type="checkbox"
|
|
879
|
+
[checked]="allChecked"
|
|
880
|
+
[color]="options?.color || 'primary'"
|
|
881
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
882
|
+
[indeterminate]="someChecked"
|
|
883
|
+
[name]="options?.name"
|
|
884
|
+
(blur)="options.showErrors = true"
|
|
885
|
+
(change)="updateAllValues($event)">
|
|
886
|
+
<span class="checkbox-name" [innerHTML]="options?.name"></span>
|
|
887
|
+
</mat-checkbox>
|
|
888
|
+
<label *ngIf="options?.title"
|
|
889
|
+
class="title"
|
|
890
|
+
[class]="options?.labelHtmlClass || ''"
|
|
891
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
892
|
+
[innerHTML]="options?.title"></label>
|
|
893
|
+
<ul class="checkbox-list" [class.horizontal-list]="horizontalList">
|
|
894
|
+
<li *ngFor="let checkboxItem of checkboxList"
|
|
895
|
+
[class]="options?.htmlClass || ''">
|
|
896
|
+
<mat-checkbox type="checkbox"
|
|
897
|
+
[(ngModel)]="checkboxItem.checked"
|
|
898
|
+
[color]="options?.color || 'primary'"
|
|
899
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
900
|
+
[name]="checkboxItem?.name"
|
|
901
|
+
(blur)="options.showErrors = true"
|
|
902
|
+
(change)="updateValue()">
|
|
903
|
+
<span class="checkbox-name" [innerHTML]="checkboxItem?.name"></span>
|
|
904
|
+
</mat-checkbox>
|
|
905
|
+
</li>
|
|
906
|
+
</ul>
|
|
907
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
908
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
909
|
+
</div>`, isInline: true, styles: [".title{font-weight:700}.checkbox-list{list-style-type:none}.horizontal-list>li{display:inline-block;margin-right:10px;zoom:1}.checkbox-name{white-space:nowrap}mat-error{font-size:75%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }] });
|
|
910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialCheckboxesComponent, decorators: [{
|
|
911
|
+
type: Component,
|
|
912
|
+
args: [{ selector: 'material-checkboxes-widget', template: `
|
|
913
|
+
<div>
|
|
914
|
+
<mat-checkbox type="checkbox"
|
|
915
|
+
[checked]="allChecked"
|
|
916
|
+
[color]="options?.color || 'primary'"
|
|
917
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
918
|
+
[indeterminate]="someChecked"
|
|
919
|
+
[name]="options?.name"
|
|
920
|
+
(blur)="options.showErrors = true"
|
|
921
|
+
(change)="updateAllValues($event)">
|
|
922
|
+
<span class="checkbox-name" [innerHTML]="options?.name"></span>
|
|
923
|
+
</mat-checkbox>
|
|
924
|
+
<label *ngIf="options?.title"
|
|
925
|
+
class="title"
|
|
926
|
+
[class]="options?.labelHtmlClass || ''"
|
|
927
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
928
|
+
[innerHTML]="options?.title"></label>
|
|
929
|
+
<ul class="checkbox-list" [class.horizontal-list]="horizontalList">
|
|
930
|
+
<li *ngFor="let checkboxItem of checkboxList"
|
|
931
|
+
[class]="options?.htmlClass || ''">
|
|
932
|
+
<mat-checkbox type="checkbox"
|
|
933
|
+
[(ngModel)]="checkboxItem.checked"
|
|
934
|
+
[color]="options?.color || 'primary'"
|
|
935
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
936
|
+
[name]="checkboxItem?.name"
|
|
937
|
+
(blur)="options.showErrors = true"
|
|
938
|
+
(change)="updateValue()">
|
|
939
|
+
<span class="checkbox-name" [innerHTML]="checkboxItem?.name"></span>
|
|
940
|
+
</mat-checkbox>
|
|
941
|
+
</li>
|
|
942
|
+
</ul>
|
|
943
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
944
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
945
|
+
</div>`, styles: [".title{font-weight:700}.checkbox-list{list-style-type:none}.horizontal-list>li{display:inline-block;margin-right:10px;zoom:1}.checkbox-name{white-space:nowrap}mat-error{font-size:75%}\n"] }]
|
|
946
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
947
|
+
type: Input
|
|
948
|
+
}], layoutIndex: [{
|
|
949
|
+
type: Input
|
|
950
|
+
}], dataIndex: [{
|
|
951
|
+
type: Input
|
|
952
|
+
}] } });
|
|
953
|
+
|
|
954
|
+
// TODO: Add this control
|
|
955
|
+
class MaterialChipListComponent {
|
|
956
|
+
constructor(jsf) {
|
|
957
|
+
this.jsf = jsf;
|
|
958
|
+
this.controlDisabled = false;
|
|
959
|
+
this.boundControl = false;
|
|
960
|
+
}
|
|
961
|
+
ngOnInit() {
|
|
962
|
+
this.options = this.layoutNode.options || {};
|
|
963
|
+
this.jsf.initializeControl(this);
|
|
964
|
+
}
|
|
965
|
+
updateValue(event) {
|
|
966
|
+
this.jsf.updateValue(this, event.target.value);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
MaterialChipListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialChipListComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
970
|
+
MaterialChipListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialChipListComponent, selector: "material-chip-list-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ``, isInline: true });
|
|
971
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialChipListComponent, decorators: [{
|
|
972
|
+
type: Component,
|
|
973
|
+
args: [{
|
|
974
|
+
// tslint:disable-next-line:component-selector
|
|
975
|
+
selector: 'material-chip-list-widget',
|
|
976
|
+
template: ``,
|
|
977
|
+
}]
|
|
978
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
979
|
+
type: Input
|
|
980
|
+
}], layoutIndex: [{
|
|
981
|
+
type: Input
|
|
982
|
+
}], dataIndex: [{
|
|
983
|
+
type: Input
|
|
984
|
+
}] } });
|
|
985
|
+
|
|
986
|
+
class MaterialDatepickerComponent {
|
|
987
|
+
constructor(matFormFieldDefaultOptions, jsf) {
|
|
988
|
+
this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
|
|
989
|
+
this.jsf = jsf;
|
|
990
|
+
this.controlDisabled = false;
|
|
991
|
+
this.boundControl = false;
|
|
992
|
+
this.autoCompleteList = [];
|
|
993
|
+
}
|
|
994
|
+
ngOnInit() {
|
|
995
|
+
this.options = this.layoutNode.options || {};
|
|
996
|
+
this.jsf.initializeControl(this, !this.options.readonly);
|
|
997
|
+
if (!this.options.notitle && !this.options.description && this.options.placeholder) {
|
|
998
|
+
this.options.description = this.options.placeholder;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
MaterialDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDatepickerComponent, deps: [{ token: MAT_FORM_FIELD_DEFAULT_OPTIONS, optional: true }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1003
|
+
MaterialDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialDatepickerComponent, selector: "material-datepicker-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1004
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1005
|
+
[class]="options?.htmlClass || ''"
|
|
1006
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1007
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1008
|
+
[style.width]="'100%'">
|
|
1009
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1010
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1011
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1012
|
+
<input matInput *ngIf="boundControl"
|
|
1013
|
+
[formControl]="formControl"
|
|
1014
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1015
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1016
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1017
|
+
[id]="'control' + layoutNode?._id"
|
|
1018
|
+
[max]="options?.maximum"
|
|
1019
|
+
[matDatepicker]="picker"
|
|
1020
|
+
[min]="options?.minimum"
|
|
1021
|
+
[name]="controlName"
|
|
1022
|
+
[placeholder]="options?.title"
|
|
1023
|
+
[readonly]="options?.readonly"
|
|
1024
|
+
[required]="options?.required"
|
|
1025
|
+
[style.width]="'100%'"
|
|
1026
|
+
(blur)="options.showErrors = true"
|
|
1027
|
+
>
|
|
1028
|
+
<input matInput *ngIf="!boundControl"
|
|
1029
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1030
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1031
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1032
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1033
|
+
[id]="'control' + layoutNode?._id"
|
|
1034
|
+
[max]="options?.maximum"
|
|
1035
|
+
[matDatepicker]="picker"
|
|
1036
|
+
[min]="options?.minimum"
|
|
1037
|
+
[name]="controlName"
|
|
1038
|
+
[placeholder]="options?.title"
|
|
1039
|
+
[required]="options?.required"
|
|
1040
|
+
[style.width]="'100%'"
|
|
1041
|
+
[readonly]="options?.readonly"
|
|
1042
|
+
(blur)="options.showErrors = true"
|
|
1043
|
+
>
|
|
1044
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1045
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1046
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1047
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1048
|
+
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
|
1049
|
+
</mat-form-field>
|
|
1050
|
+
<mat-datepicker #picker ></mat-datepicker>
|
|
1051
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1052
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.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: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i5$1.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"] }] });
|
|
1053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDatepickerComponent, decorators: [{
|
|
1054
|
+
type: Component,
|
|
1055
|
+
args: [{ selector: 'material-datepicker-widget', template: `
|
|
1056
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1057
|
+
[class]="options?.htmlClass || ''"
|
|
1058
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1059
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1060
|
+
[style.width]="'100%'">
|
|
1061
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1062
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1063
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1064
|
+
<input matInput *ngIf="boundControl"
|
|
1065
|
+
[formControl]="formControl"
|
|
1066
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1067
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1068
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1069
|
+
[id]="'control' + layoutNode?._id"
|
|
1070
|
+
[max]="options?.maximum"
|
|
1071
|
+
[matDatepicker]="picker"
|
|
1072
|
+
[min]="options?.minimum"
|
|
1073
|
+
[name]="controlName"
|
|
1074
|
+
[placeholder]="options?.title"
|
|
1075
|
+
[readonly]="options?.readonly"
|
|
1076
|
+
[required]="options?.required"
|
|
1077
|
+
[style.width]="'100%'"
|
|
1078
|
+
(blur)="options.showErrors = true"
|
|
1079
|
+
>
|
|
1080
|
+
<input matInput *ngIf="!boundControl"
|
|
1081
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1082
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1083
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1084
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1085
|
+
[id]="'control' + layoutNode?._id"
|
|
1086
|
+
[max]="options?.maximum"
|
|
1087
|
+
[matDatepicker]="picker"
|
|
1088
|
+
[min]="options?.minimum"
|
|
1089
|
+
[name]="controlName"
|
|
1090
|
+
[placeholder]="options?.title"
|
|
1091
|
+
[required]="options?.required"
|
|
1092
|
+
[style.width]="'100%'"
|
|
1093
|
+
[readonly]="options?.readonly"
|
|
1094
|
+
(blur)="options.showErrors = true"
|
|
1095
|
+
>
|
|
1096
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1097
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1098
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1099
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1100
|
+
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
|
1101
|
+
</mat-form-field>
|
|
1102
|
+
<mat-datepicker #picker ></mat-datepicker>
|
|
1103
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1104
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"] }]
|
|
1105
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1106
|
+
type: Inject,
|
|
1107
|
+
args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
|
|
1108
|
+
}, {
|
|
1109
|
+
type: Optional
|
|
1110
|
+
}] }, { type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1111
|
+
type: Input
|
|
1112
|
+
}], layoutIndex: [{
|
|
1113
|
+
type: Input
|
|
1114
|
+
}], dataIndex: [{
|
|
1115
|
+
type: Input
|
|
1116
|
+
}] } });
|
|
1117
|
+
|
|
1118
|
+
class MaterialDesignFrameworkComponent {
|
|
1119
|
+
constructor(changeDetector, jsf) {
|
|
1120
|
+
this.changeDetector = changeDetector;
|
|
1121
|
+
this.jsf = jsf;
|
|
1122
|
+
this.frameworkInitialized = false;
|
|
1123
|
+
this.formControl = null;
|
|
1124
|
+
this.parentArray = null;
|
|
1125
|
+
this.isOrderable = false;
|
|
1126
|
+
this.dynamicTitle = null;
|
|
1127
|
+
}
|
|
1128
|
+
get showRemoveButton() {
|
|
1129
|
+
if (!this.layoutNode || !this.widgetOptions.removable ||
|
|
1130
|
+
this.widgetOptions.readonly || this.layoutNode.type === '$ref') {
|
|
1131
|
+
return false;
|
|
1132
|
+
}
|
|
1133
|
+
if (this.layoutNode.recursiveReference) {
|
|
1134
|
+
return true;
|
|
1135
|
+
}
|
|
1136
|
+
if (!this.layoutNode.arrayItem || !this.parentArray) {
|
|
1137
|
+
return false;
|
|
1138
|
+
}
|
|
1139
|
+
// If array length <= minItems, don't allow removing any items
|
|
1140
|
+
return this.parentArray.items.length - 1 <= this.parentArray.options.minItems ? false :
|
|
1141
|
+
// For removable list items, allow removing any item
|
|
1142
|
+
this.layoutNode.arrayItemType === 'list' ? true :
|
|
1143
|
+
// For removable tuple items, only allow removing last item in list
|
|
1144
|
+
this.layoutIndex[this.layoutIndex.length - 1] === this.parentArray.items.length - 2;
|
|
1145
|
+
}
|
|
1146
|
+
ngOnInit() {
|
|
1147
|
+
this.initializeFramework();
|
|
1148
|
+
}
|
|
1149
|
+
ngOnChanges() {
|
|
1150
|
+
if (!this.frameworkInitialized) {
|
|
1151
|
+
this.initializeFramework();
|
|
1152
|
+
}
|
|
1153
|
+
if (this.dynamicTitle) {
|
|
1154
|
+
this.updateTitle();
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
initializeFramework() {
|
|
1158
|
+
if (this.layoutNode) {
|
|
1159
|
+
this.options = cloneDeep(this.layoutNode.options || {});
|
|
1160
|
+
this.widgetLayoutNode = {
|
|
1161
|
+
...this.layoutNode,
|
|
1162
|
+
options: cloneDeep(this.layoutNode.options || {})
|
|
1163
|
+
};
|
|
1164
|
+
this.widgetOptions = this.widgetLayoutNode.options;
|
|
1165
|
+
this.formControl = this.jsf.getFormControl(this);
|
|
1166
|
+
if (isDefined(this.widgetOptions.minimum) &&
|
|
1167
|
+
isDefined(this.widgetOptions.maximum) &&
|
|
1168
|
+
this.widgetOptions.multipleOf >= 1) {
|
|
1169
|
+
this.layoutNode.type = 'range';
|
|
1170
|
+
}
|
|
1171
|
+
if (!['$ref', 'advancedfieldset', 'authfieldset', 'button', 'card',
|
|
1172
|
+
'checkbox', 'expansion-panel', 'help', 'message', 'msg', 'section',
|
|
1173
|
+
'submit', 'tabarray', 'tabs'].includes(this.layoutNode.type) &&
|
|
1174
|
+
/{{.+?}}/.test(this.widgetOptions.title || '')) {
|
|
1175
|
+
this.dynamicTitle = this.widgetOptions.title;
|
|
1176
|
+
this.updateTitle();
|
|
1177
|
+
}
|
|
1178
|
+
if (this.layoutNode.arrayItem && this.layoutNode.type !== '$ref') {
|
|
1179
|
+
this.parentArray = this.jsf.getParentNode(this);
|
|
1180
|
+
if (this.parentArray) {
|
|
1181
|
+
this.isOrderable =
|
|
1182
|
+
this.parentArray.type.slice(0, 3) !== 'tab' &&
|
|
1183
|
+
this.layoutNode.arrayItemType === 'list' &&
|
|
1184
|
+
!this.widgetOptions.readonly &&
|
|
1185
|
+
this.parentArray.options.orderable;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
this.frameworkInitialized = true;
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
this.options = {};
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
updateTitle() {
|
|
1195
|
+
this.widgetLayoutNode.options.title = this.jsf.parseText(this.dynamicTitle, this.jsf.getFormControlValue(this), this.jsf.getFormControlGroup(this).value, this.dataIndex[this.dataIndex.length - 1]);
|
|
1196
|
+
}
|
|
1197
|
+
removeItem() {
|
|
1198
|
+
this.jsf.removeItem(this);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
MaterialDesignFrameworkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFrameworkComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1202
|
+
MaterialDesignFrameworkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialDesignFrameworkComponent, selector: "material-design-framework", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, usesOnChanges: true, ngImport: i0, template: "<div\n [class.array-item]=\"widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'\"\n [orderable]=\"isOrderable\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [layoutNode]=\"widgetLayoutNode\">\n <svg *ngIf=\"showRemoveButton\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"18\" width=\"18\" viewBox=\"0 0 24 24\"\n class=\"close-button\"\n (click)=\"removeItem()\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"/>\n </svg>\n <select-widget-widget\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [layoutNode]=\"widgetLayoutNode\"></select-widget-widget>\n</div>\n<div class=\"spacer\" *ngIf=\"widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'\"></div>\n", styles: [".array-item{border-radius:2px;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;padding:6px;position:relative;transition:all .28s cubic-bezier(.4,0,.2,1)}.close-button{cursor:pointer;position:absolute;top:6px;right:6px;fill:#0006;visibility:hidden;z-index:500}.close-button:hover{fill:#000c}.array-item:hover>.close-button{visibility:visible}.spacer{margin:6px 0}[draggable=true]:hover{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;cursor:move;z-index:10}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.SelectWidgetComponent, selector: "select-widget-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }, { kind: "directive", type: i1.OrderableDirective, selector: "[orderable]", inputs: ["orderable", "layoutNode", "layoutIndex", "dataIndex"] }] });
|
|
1203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFrameworkComponent, decorators: [{
|
|
1204
|
+
type: Component,
|
|
1205
|
+
args: [{ selector: 'material-design-framework', template: "<div\n [class.array-item]=\"widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'\"\n [orderable]=\"isOrderable\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [layoutNode]=\"widgetLayoutNode\">\n <svg *ngIf=\"showRemoveButton\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"18\" width=\"18\" viewBox=\"0 0 24 24\"\n class=\"close-button\"\n (click)=\"removeItem()\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"/>\n </svg>\n <select-widget-widget\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [layoutNode]=\"widgetLayoutNode\"></select-widget-widget>\n</div>\n<div class=\"spacer\" *ngIf=\"widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'\"></div>\n", styles: [".array-item{border-radius:2px;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;padding:6px;position:relative;transition:all .28s cubic-bezier(.4,0,.2,1)}.close-button{cursor:pointer;position:absolute;top:6px;right:6px;fill:#0006;visibility:hidden;z-index:500}.close-button:hover{fill:#000c}.array-item:hover>.close-button{visibility:visible}.spacer{margin:6px 0}[draggable=true]:hover{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;cursor:move;z-index:10}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"] }]
|
|
1206
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1207
|
+
type: Input
|
|
1208
|
+
}], layoutIndex: [{
|
|
1209
|
+
type: Input
|
|
1210
|
+
}], dataIndex: [{
|
|
1211
|
+
type: Input
|
|
1212
|
+
}] } });
|
|
1213
|
+
|
|
1214
|
+
// TODO: Add this control
|
|
1215
|
+
class MaterialFileComponent {
|
|
1216
|
+
constructor(jsf) {
|
|
1217
|
+
this.jsf = jsf;
|
|
1218
|
+
this.controlDisabled = false;
|
|
1219
|
+
this.boundControl = false;
|
|
1220
|
+
}
|
|
1221
|
+
ngOnInit() {
|
|
1222
|
+
this.options = this.layoutNode.options || {};
|
|
1223
|
+
this.jsf.initializeControl(this);
|
|
1224
|
+
}
|
|
1225
|
+
updateValue(event) {
|
|
1226
|
+
this.jsf.updateValue(this, event.target.value);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
MaterialFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialFileComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1230
|
+
MaterialFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialFileComponent, selector: "material-file-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ``, isInline: true });
|
|
1231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialFileComponent, decorators: [{
|
|
1232
|
+
type: Component,
|
|
1233
|
+
args: [{
|
|
1234
|
+
// tslint:disable-next-line:component-selector
|
|
1235
|
+
selector: 'material-file-widget',
|
|
1236
|
+
template: ``,
|
|
1237
|
+
}]
|
|
1238
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1239
|
+
type: Input
|
|
1240
|
+
}], layoutIndex: [{
|
|
1241
|
+
type: Input
|
|
1242
|
+
}], dataIndex: [{
|
|
1243
|
+
type: Input
|
|
1244
|
+
}] } });
|
|
1245
|
+
|
|
1246
|
+
class MaterialInputComponent {
|
|
1247
|
+
constructor(matFormFieldDefaultOptions, jsf) {
|
|
1248
|
+
this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
|
|
1249
|
+
this.jsf = jsf;
|
|
1250
|
+
this.controlDisabled = false;
|
|
1251
|
+
this.boundControl = false;
|
|
1252
|
+
this.autoCompleteList = [];
|
|
1253
|
+
}
|
|
1254
|
+
ngOnInit() {
|
|
1255
|
+
this.options = this.layoutNode.options || {};
|
|
1256
|
+
this.jsf.initializeControl(this);
|
|
1257
|
+
if (!this.options.notitle && !this.options.description && this.options.placeholder) {
|
|
1258
|
+
this.options.description = this.options.placeholder;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
updateValue(event) {
|
|
1262
|
+
this.jsf.updateValue(this, event.target.value);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
MaterialInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialInputComponent, deps: [{ token: MAT_FORM_FIELD_DEFAULT_OPTIONS, optional: true }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1266
|
+
MaterialInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialInputComponent, selector: "material-input-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1267
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1268
|
+
[class]="options?.htmlClass || ''"
|
|
1269
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1270
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1271
|
+
[style.width]="'100%'">
|
|
1272
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1273
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1274
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1275
|
+
<input matInput *ngIf="boundControl"
|
|
1276
|
+
[formControl]="formControl"
|
|
1277
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1278
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1279
|
+
[attr.maxlength]="options?.maxLength"
|
|
1280
|
+
[attr.minlength]="options?.minLength"
|
|
1281
|
+
[attr.pattern]="options?.pattern"
|
|
1282
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1283
|
+
[id]="'control' + layoutNode?._id"
|
|
1284
|
+
[name]="controlName"
|
|
1285
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1286
|
+
[required]="options?.required"
|
|
1287
|
+
[style.width]="'100%'"
|
|
1288
|
+
[type]="layoutNode?.type"
|
|
1289
|
+
(blur)="options.showErrors = true">
|
|
1290
|
+
<input matInput *ngIf="!boundControl"
|
|
1291
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1292
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1293
|
+
[attr.maxlength]="options?.maxLength"
|
|
1294
|
+
[attr.minlength]="options?.minLength"
|
|
1295
|
+
[attr.pattern]="options?.pattern"
|
|
1296
|
+
[disabled]="controlDisabled"
|
|
1297
|
+
[id]="'control' + layoutNode?._id"
|
|
1298
|
+
[name]="controlName"
|
|
1299
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1300
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1301
|
+
[required]="options?.required"
|
|
1302
|
+
[style.width]="'100%'"
|
|
1303
|
+
[type]="layoutNode?.type"
|
|
1304
|
+
[value]="controlValue"
|
|
1305
|
+
(input)="updateValue($event)"
|
|
1306
|
+
(blur)="options.showErrors = true">
|
|
1307
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1308
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1309
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1310
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1311
|
+
<mat-autocomplete *ngIf="options?.typeahead?.source">
|
|
1312
|
+
<mat-option *ngFor="let word of options?.typeahead?.source"
|
|
1313
|
+
[value]="word">{{word}}</mat-option>
|
|
1314
|
+
</mat-autocomplete>
|
|
1315
|
+
</mat-form-field>
|
|
1316
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1317
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.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: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$3.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i3$3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3$3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i4$6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i5$1.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"] }] });
|
|
1318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialInputComponent, decorators: [{
|
|
1319
|
+
type: Component,
|
|
1320
|
+
args: [{ selector: 'material-input-widget', template: `
|
|
1321
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1322
|
+
[class]="options?.htmlClass || ''"
|
|
1323
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1324
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1325
|
+
[style.width]="'100%'">
|
|
1326
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1327
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1328
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1329
|
+
<input matInput *ngIf="boundControl"
|
|
1330
|
+
[formControl]="formControl"
|
|
1331
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1332
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1333
|
+
[attr.maxlength]="options?.maxLength"
|
|
1334
|
+
[attr.minlength]="options?.minLength"
|
|
1335
|
+
[attr.pattern]="options?.pattern"
|
|
1336
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1337
|
+
[id]="'control' + layoutNode?._id"
|
|
1338
|
+
[name]="controlName"
|
|
1339
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1340
|
+
[required]="options?.required"
|
|
1341
|
+
[style.width]="'100%'"
|
|
1342
|
+
[type]="layoutNode?.type"
|
|
1343
|
+
(blur)="options.showErrors = true">
|
|
1344
|
+
<input matInput *ngIf="!boundControl"
|
|
1345
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1346
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
1347
|
+
[attr.maxlength]="options?.maxLength"
|
|
1348
|
+
[attr.minlength]="options?.minLength"
|
|
1349
|
+
[attr.pattern]="options?.pattern"
|
|
1350
|
+
[disabled]="controlDisabled"
|
|
1351
|
+
[id]="'control' + layoutNode?._id"
|
|
1352
|
+
[name]="controlName"
|
|
1353
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1354
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1355
|
+
[required]="options?.required"
|
|
1356
|
+
[style.width]="'100%'"
|
|
1357
|
+
[type]="layoutNode?.type"
|
|
1358
|
+
[value]="controlValue"
|
|
1359
|
+
(input)="updateValue($event)"
|
|
1360
|
+
(blur)="options.showErrors = true">
|
|
1361
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1362
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1363
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1364
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1365
|
+
<mat-autocomplete *ngIf="options?.typeahead?.source">
|
|
1366
|
+
<mat-option *ngFor="let word of options?.typeahead?.source"
|
|
1367
|
+
[value]="word">{{word}}</mat-option>
|
|
1368
|
+
</mat-autocomplete>
|
|
1369
|
+
</mat-form-field>
|
|
1370
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1371
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"] }]
|
|
1372
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1373
|
+
type: Inject,
|
|
1374
|
+
args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
|
|
1375
|
+
}, {
|
|
1376
|
+
type: Optional
|
|
1377
|
+
}] }, { type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1378
|
+
type: Input
|
|
1379
|
+
}], layoutIndex: [{
|
|
1380
|
+
type: Input
|
|
1381
|
+
}], dataIndex: [{
|
|
1382
|
+
type: Input
|
|
1383
|
+
}] } });
|
|
1384
|
+
|
|
1385
|
+
class MaterialNumberComponent {
|
|
1386
|
+
constructor(matFormFieldDefaultOptions, jsf) {
|
|
1387
|
+
this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
|
|
1388
|
+
this.jsf = jsf;
|
|
1389
|
+
this.controlDisabled = false;
|
|
1390
|
+
this.boundControl = false;
|
|
1391
|
+
this.allowNegative = true;
|
|
1392
|
+
this.allowDecimal = true;
|
|
1393
|
+
this.allowExponents = false;
|
|
1394
|
+
this.lastValidNumber = '';
|
|
1395
|
+
}
|
|
1396
|
+
ngOnInit() {
|
|
1397
|
+
this.options = this.layoutNode.options || {};
|
|
1398
|
+
this.jsf.initializeControl(this);
|
|
1399
|
+
if (this.layoutNode.dataType === 'integer') {
|
|
1400
|
+
this.allowDecimal = false;
|
|
1401
|
+
}
|
|
1402
|
+
if (!this.options.notitle && !this.options.description && this.options.placeholder) {
|
|
1403
|
+
this.options.description = this.options.placeholder;
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
updateValue(event) {
|
|
1407
|
+
this.jsf.updateValue(this, event.target.value);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
MaterialNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialNumberComponent, deps: [{ token: MAT_FORM_FIELD_DEFAULT_OPTIONS, optional: true }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1411
|
+
MaterialNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialNumberComponent, selector: "material-number-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1412
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1413
|
+
[class]="options?.htmlClass || ''"
|
|
1414
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1415
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1416
|
+
[style.width]="'100%'">
|
|
1417
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1418
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1419
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1420
|
+
<input matInput *ngIf="boundControl"
|
|
1421
|
+
[formControl]="formControl"
|
|
1422
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1423
|
+
[attr.max]="options?.maximum"
|
|
1424
|
+
[attr.min]="options?.minimum"
|
|
1425
|
+
[attr.step]="options?.multipleOf || options?.step || 'any'"
|
|
1426
|
+
[id]="'control' + layoutNode?._id"
|
|
1427
|
+
[name]="controlName"
|
|
1428
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1429
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1430
|
+
[required]="options?.required"
|
|
1431
|
+
[style.width]="'100%'"
|
|
1432
|
+
[type]="'number'"
|
|
1433
|
+
(blur)="options.showErrors = true">
|
|
1434
|
+
<input matInput *ngIf="!boundControl"
|
|
1435
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1436
|
+
[attr.max]="options?.maximum"
|
|
1437
|
+
[attr.min]="options?.minimum"
|
|
1438
|
+
[attr.step]="options?.multipleOf || options?.step || 'any'"
|
|
1439
|
+
[disabled]="controlDisabled"
|
|
1440
|
+
[id]="'control' + layoutNode?._id"
|
|
1441
|
+
[name]="controlName"
|
|
1442
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1443
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1444
|
+
[required]="options?.required"
|
|
1445
|
+
[style.width]="'100%'"
|
|
1446
|
+
[type]="'number'"
|
|
1447
|
+
[value]="controlValue"
|
|
1448
|
+
(input)="updateValue($event)"
|
|
1449
|
+
(blur)="options.showErrors = true">
|
|
1450
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1451
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1452
|
+
<mat-hint *ngIf="layoutNode?.type === 'range'" align="start"
|
|
1453
|
+
[innerHTML]="controlValue"></mat-hint>
|
|
1454
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1455
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1456
|
+
</mat-form-field>
|
|
1457
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1458
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.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: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i5$1.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"] }] });
|
|
1459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialNumberComponent, decorators: [{
|
|
1460
|
+
type: Component,
|
|
1461
|
+
args: [{ selector: 'material-number-widget', template: `
|
|
1462
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1463
|
+
[class]="options?.htmlClass || ''"
|
|
1464
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1465
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1466
|
+
[style.width]="'100%'">
|
|
1467
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1468
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1469
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1470
|
+
<input matInput *ngIf="boundControl"
|
|
1471
|
+
[formControl]="formControl"
|
|
1472
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1473
|
+
[attr.max]="options?.maximum"
|
|
1474
|
+
[attr.min]="options?.minimum"
|
|
1475
|
+
[attr.step]="options?.multipleOf || options?.step || 'any'"
|
|
1476
|
+
[id]="'control' + layoutNode?._id"
|
|
1477
|
+
[name]="controlName"
|
|
1478
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1479
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1480
|
+
[required]="options?.required"
|
|
1481
|
+
[style.width]="'100%'"
|
|
1482
|
+
[type]="'number'"
|
|
1483
|
+
(blur)="options.showErrors = true">
|
|
1484
|
+
<input matInput *ngIf="!boundControl"
|
|
1485
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1486
|
+
[attr.max]="options?.maximum"
|
|
1487
|
+
[attr.min]="options?.minimum"
|
|
1488
|
+
[attr.step]="options?.multipleOf || options?.step || 'any'"
|
|
1489
|
+
[disabled]="controlDisabled"
|
|
1490
|
+
[id]="'control' + layoutNode?._id"
|
|
1491
|
+
[name]="controlName"
|
|
1492
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1493
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
1494
|
+
[required]="options?.required"
|
|
1495
|
+
[style.width]="'100%'"
|
|
1496
|
+
[type]="'number'"
|
|
1497
|
+
[value]="controlValue"
|
|
1498
|
+
(input)="updateValue($event)"
|
|
1499
|
+
(blur)="options.showErrors = true">
|
|
1500
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1501
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1502
|
+
<mat-hint *ngIf="layoutNode?.type === 'range'" align="start"
|
|
1503
|
+
[innerHTML]="controlValue"></mat-hint>
|
|
1504
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1505
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1506
|
+
</mat-form-field>
|
|
1507
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1508
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"] }]
|
|
1509
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1510
|
+
type: Inject,
|
|
1511
|
+
args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
|
|
1512
|
+
}, {
|
|
1513
|
+
type: Optional
|
|
1514
|
+
}] }, { type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1515
|
+
type: Input
|
|
1516
|
+
}], layoutIndex: [{
|
|
1517
|
+
type: Input
|
|
1518
|
+
}], dataIndex: [{
|
|
1519
|
+
type: Input
|
|
1520
|
+
}] } });
|
|
1521
|
+
|
|
1522
|
+
// TODO: Add this control
|
|
1523
|
+
class MaterialOneOfComponent {
|
|
1524
|
+
constructor(jsf) {
|
|
1525
|
+
this.jsf = jsf;
|
|
1526
|
+
this.controlDisabled = false;
|
|
1527
|
+
this.boundControl = false;
|
|
1528
|
+
}
|
|
1529
|
+
ngOnInit() {
|
|
1530
|
+
this.options = this.layoutNode.options || {};
|
|
1531
|
+
this.jsf.initializeControl(this);
|
|
1532
|
+
}
|
|
1533
|
+
updateValue(event) {
|
|
1534
|
+
this.jsf.updateValue(this, event.target.value);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
MaterialOneOfComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialOneOfComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1538
|
+
MaterialOneOfComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialOneOfComponent, selector: "material-one-of-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ``, isInline: true });
|
|
1539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialOneOfComponent, decorators: [{
|
|
1540
|
+
type: Component,
|
|
1541
|
+
args: [{
|
|
1542
|
+
// tslint:disable-next-line:component-selector
|
|
1543
|
+
selector: 'material-one-of-widget',
|
|
1544
|
+
template: ``,
|
|
1545
|
+
}]
|
|
1546
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1547
|
+
type: Input
|
|
1548
|
+
}], layoutIndex: [{
|
|
1549
|
+
type: Input
|
|
1550
|
+
}], dataIndex: [{
|
|
1551
|
+
type: Input
|
|
1552
|
+
}] } });
|
|
1553
|
+
|
|
1554
|
+
class MaterialRadiosComponent {
|
|
1555
|
+
constructor(jsf) {
|
|
1556
|
+
this.jsf = jsf;
|
|
1557
|
+
this.controlDisabled = false;
|
|
1558
|
+
this.boundControl = false;
|
|
1559
|
+
this.flexDirection = 'column';
|
|
1560
|
+
this.radiosList = [];
|
|
1561
|
+
}
|
|
1562
|
+
ngOnInit() {
|
|
1563
|
+
this.options = this.layoutNode.options || {};
|
|
1564
|
+
if (this.layoutNode.type === 'radios-inline') {
|
|
1565
|
+
this.flexDirection = 'row';
|
|
1566
|
+
}
|
|
1567
|
+
this.radiosList = buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true);
|
|
1568
|
+
this.jsf.initializeControl(this, !this.options.readonly);
|
|
1569
|
+
}
|
|
1570
|
+
updateValue(value) {
|
|
1571
|
+
this.options.showErrors = true;
|
|
1572
|
+
this.jsf.updateValue(this, value);
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
MaterialRadiosComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialRadiosComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1576
|
+
MaterialRadiosComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialRadiosComponent, selector: "material-radios-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1577
|
+
<div>
|
|
1578
|
+
<div *ngIf="options?.title">
|
|
1579
|
+
<label
|
|
1580
|
+
[attr.for]="'control' + layoutNode?._id"
|
|
1581
|
+
[class]="options?.labelHtmlClass || ''"
|
|
1582
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
1583
|
+
[innerHTML]="options?.title"></label>
|
|
1584
|
+
</div>
|
|
1585
|
+
<mat-radio-group *ngIf="boundControl"
|
|
1586
|
+
[formControl]="formControl"
|
|
1587
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1588
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1589
|
+
[attr.required]="options?.required"
|
|
1590
|
+
[style.flex-direction]="flexDirection"
|
|
1591
|
+
[name]="controlName"
|
|
1592
|
+
(blur)="options.showErrors = true">
|
|
1593
|
+
<mat-radio-button *ngFor="let radioItem of radiosList"
|
|
1594
|
+
[id]="'control' + layoutNode?._id + '/' + radioItem?.name"
|
|
1595
|
+
[value]="radioItem?.value">
|
|
1596
|
+
<span [innerHTML]="radioItem?.name"></span>
|
|
1597
|
+
</mat-radio-button>
|
|
1598
|
+
</mat-radio-group>
|
|
1599
|
+
<mat-radio-group *ngIf="!boundControl"
|
|
1600
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1601
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1602
|
+
[attr.required]="options?.required"
|
|
1603
|
+
[style.flex-direction]="flexDirection"
|
|
1604
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1605
|
+
[name]="controlName"
|
|
1606
|
+
[value]="controlValue">
|
|
1607
|
+
<mat-radio-button *ngFor="let radioItem of radiosList"
|
|
1608
|
+
[id]="'control' + layoutNode?._id + '/' + radioItem?.name"
|
|
1609
|
+
[value]="radioItem?.value"
|
|
1610
|
+
(click)="updateValue(radioItem?.value)">
|
|
1611
|
+
<span [innerHTML]="radioItem?.name"></span>
|
|
1612
|
+
</mat-radio-button>
|
|
1613
|
+
</mat-radio-group>
|
|
1614
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1615
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
1616
|
+
</div>`, isInline: true, styles: ["mat-radio-group{display:inline-flex}mat-radio-button{margin:2px}mat-error{font-size:75%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "directive", type: i5$2.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i5$2.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }] });
|
|
1617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialRadiosComponent, decorators: [{
|
|
1618
|
+
type: Component,
|
|
1619
|
+
args: [{ selector: 'material-radios-widget', template: `
|
|
1620
|
+
<div>
|
|
1621
|
+
<div *ngIf="options?.title">
|
|
1622
|
+
<label
|
|
1623
|
+
[attr.for]="'control' + layoutNode?._id"
|
|
1624
|
+
[class]="options?.labelHtmlClass || ''"
|
|
1625
|
+
[style.display]="options?.notitle ? 'none' : ''"
|
|
1626
|
+
[innerHTML]="options?.title"></label>
|
|
1627
|
+
</div>
|
|
1628
|
+
<mat-radio-group *ngIf="boundControl"
|
|
1629
|
+
[formControl]="formControl"
|
|
1630
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1631
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1632
|
+
[attr.required]="options?.required"
|
|
1633
|
+
[style.flex-direction]="flexDirection"
|
|
1634
|
+
[name]="controlName"
|
|
1635
|
+
(blur)="options.showErrors = true">
|
|
1636
|
+
<mat-radio-button *ngFor="let radioItem of radiosList"
|
|
1637
|
+
[id]="'control' + layoutNode?._id + '/' + radioItem?.name"
|
|
1638
|
+
[value]="radioItem?.value">
|
|
1639
|
+
<span [innerHTML]="radioItem?.name"></span>
|
|
1640
|
+
</mat-radio-button>
|
|
1641
|
+
</mat-radio-group>
|
|
1642
|
+
<mat-radio-group *ngIf="!boundControl"
|
|
1643
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1644
|
+
[attr.readonly]="options?.readonly ? 'readonly' : null"
|
|
1645
|
+
[attr.required]="options?.required"
|
|
1646
|
+
[style.flex-direction]="flexDirection"
|
|
1647
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1648
|
+
[name]="controlName"
|
|
1649
|
+
[value]="controlValue">
|
|
1650
|
+
<mat-radio-button *ngFor="let radioItem of radiosList"
|
|
1651
|
+
[id]="'control' + layoutNode?._id + '/' + radioItem?.name"
|
|
1652
|
+
[value]="radioItem?.value"
|
|
1653
|
+
(click)="updateValue(radioItem?.value)">
|
|
1654
|
+
<span [innerHTML]="radioItem?.name"></span>
|
|
1655
|
+
</mat-radio-button>
|
|
1656
|
+
</mat-radio-group>
|
|
1657
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1658
|
+
[innerHTML]="options?.errorMessage"></mat-error>
|
|
1659
|
+
</div>`, styles: ["mat-radio-group{display:inline-flex}mat-radio-button{margin:2px}mat-error{font-size:75%}\n"] }]
|
|
1660
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1661
|
+
type: Input
|
|
1662
|
+
}], layoutIndex: [{
|
|
1663
|
+
type: Input
|
|
1664
|
+
}], dataIndex: [{
|
|
1665
|
+
type: Input
|
|
1666
|
+
}] } });
|
|
1667
|
+
|
|
1668
|
+
class MaterialSelectComponent {
|
|
1669
|
+
constructor(matFormFieldDefaultOptions, jsf) {
|
|
1670
|
+
this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
|
|
1671
|
+
this.jsf = jsf;
|
|
1672
|
+
this.controlDisabled = false;
|
|
1673
|
+
this.boundControl = false;
|
|
1674
|
+
this.selectList = [];
|
|
1675
|
+
this.isArray = isArray;
|
|
1676
|
+
}
|
|
1677
|
+
ngOnInit() {
|
|
1678
|
+
this.options = this.layoutNode.options || {};
|
|
1679
|
+
this.selectList = buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, !!this.options.required, !!this.options.flatList);
|
|
1680
|
+
this.jsf.initializeControl(this, !this.options.readonly);
|
|
1681
|
+
if (!this.options.notitle && !this.options.description && this.options.placeholder) {
|
|
1682
|
+
this.options.description = this.options.placeholder;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
updateValue(event) {
|
|
1686
|
+
this.options.showErrors = true;
|
|
1687
|
+
this.jsf.updateValue(this, event.value);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
MaterialSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialSelectComponent, deps: [{ token: MAT_FORM_FIELD_DEFAULT_OPTIONS, optional: true }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1691
|
+
MaterialSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialSelectComponent, selector: "material-select-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1692
|
+
<mat-form-field
|
|
1693
|
+
[appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1694
|
+
[class]="options?.htmlClass || ''"
|
|
1695
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1696
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1697
|
+
[style.width]="'100%'">
|
|
1698
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1699
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1700
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1701
|
+
<mat-select *ngIf="boundControl"
|
|
1702
|
+
[formControl]="formControl"
|
|
1703
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1704
|
+
[attr.name]="controlName"
|
|
1705
|
+
[id]="'control' + layoutNode?._id"
|
|
1706
|
+
[multiple]="options?.multiple"
|
|
1707
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1708
|
+
[required]="options?.required"
|
|
1709
|
+
[style.width]="'100%'"
|
|
1710
|
+
(blur)="options.showErrors = true">
|
|
1711
|
+
<ng-template ngFor let-selectItem [ngForOf]="selectList">
|
|
1712
|
+
<mat-option *ngIf="!isArray(selectItem?.items)"
|
|
1713
|
+
[value]="selectItem?.value">
|
|
1714
|
+
<span [innerHTML]="selectItem?.name"></span>
|
|
1715
|
+
</mat-option>
|
|
1716
|
+
<mat-optgroup *ngIf="isArray(selectItem?.items)"
|
|
1717
|
+
[label]="selectItem?.group">
|
|
1718
|
+
<mat-option *ngFor="let subItem of selectItem.items"
|
|
1719
|
+
[value]="subItem?.value">
|
|
1720
|
+
<span [innerHTML]="subItem?.name"></span>
|
|
1721
|
+
</mat-option>
|
|
1722
|
+
</mat-optgroup>
|
|
1723
|
+
</ng-template>
|
|
1724
|
+
</mat-select>
|
|
1725
|
+
<mat-select *ngIf="!boundControl"
|
|
1726
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1727
|
+
[attr.name]="controlName"
|
|
1728
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1729
|
+
[id]="'control' + layoutNode?._id"
|
|
1730
|
+
[multiple]="options?.multiple"
|
|
1731
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1732
|
+
[required]="options?.required"
|
|
1733
|
+
[style.width]="'100%'"
|
|
1734
|
+
[value]="controlValue"
|
|
1735
|
+
(blur)="options.showErrors = true"
|
|
1736
|
+
(change)="updateValue($event)">
|
|
1737
|
+
<ng-template ngFor let-selectItem [ngForOf]="selectList">
|
|
1738
|
+
<mat-option *ngIf="!isArray(selectItem?.items)"
|
|
1739
|
+
[attr.selected]="selectItem?.value === controlValue"
|
|
1740
|
+
[value]="selectItem?.value">
|
|
1741
|
+
<span [innerHTML]="selectItem?.name"></span>
|
|
1742
|
+
</mat-option>
|
|
1743
|
+
<mat-optgroup *ngIf="isArray(selectItem?.items)"
|
|
1744
|
+
[label]="selectItem?.group">
|
|
1745
|
+
<mat-option *ngFor="let subItem of selectItem.items"
|
|
1746
|
+
[attr.selected]="subItem?.value === controlValue"
|
|
1747
|
+
[value]="subItem?.value">
|
|
1748
|
+
<span [innerHTML]="subItem?.name"></span>
|
|
1749
|
+
</mat-option>
|
|
1750
|
+
</mat-optgroup>
|
|
1751
|
+
</ng-template>
|
|
1752
|
+
</mat-select>
|
|
1753
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1754
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1755
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1756
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1757
|
+
</mat-form-field>
|
|
1758
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1759
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i4$6.MatOptgroup, selector: "mat-optgroup", inputs: ["disabled"], exportAs: ["matOptgroup"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }] });
|
|
1760
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialSelectComponent, decorators: [{
|
|
1761
|
+
type: Component,
|
|
1762
|
+
args: [{ selector: 'material-select-widget', template: `
|
|
1763
|
+
<mat-form-field
|
|
1764
|
+
[appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
1765
|
+
[class]="options?.htmlClass || ''"
|
|
1766
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
1767
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
1768
|
+
[style.width]="'100%'">
|
|
1769
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
1770
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
1771
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
1772
|
+
<mat-select *ngIf="boundControl"
|
|
1773
|
+
[formControl]="formControl"
|
|
1774
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1775
|
+
[attr.name]="controlName"
|
|
1776
|
+
[id]="'control' + layoutNode?._id"
|
|
1777
|
+
[multiple]="options?.multiple"
|
|
1778
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1779
|
+
[required]="options?.required"
|
|
1780
|
+
[style.width]="'100%'"
|
|
1781
|
+
(blur)="options.showErrors = true">
|
|
1782
|
+
<ng-template ngFor let-selectItem [ngForOf]="selectList">
|
|
1783
|
+
<mat-option *ngIf="!isArray(selectItem?.items)"
|
|
1784
|
+
[value]="selectItem?.value">
|
|
1785
|
+
<span [innerHTML]="selectItem?.name"></span>
|
|
1786
|
+
</mat-option>
|
|
1787
|
+
<mat-optgroup *ngIf="isArray(selectItem?.items)"
|
|
1788
|
+
[label]="selectItem?.group">
|
|
1789
|
+
<mat-option *ngFor="let subItem of selectItem.items"
|
|
1790
|
+
[value]="subItem?.value">
|
|
1791
|
+
<span [innerHTML]="subItem?.name"></span>
|
|
1792
|
+
</mat-option>
|
|
1793
|
+
</mat-optgroup>
|
|
1794
|
+
</ng-template>
|
|
1795
|
+
</mat-select>
|
|
1796
|
+
<mat-select *ngIf="!boundControl"
|
|
1797
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1798
|
+
[attr.name]="controlName"
|
|
1799
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1800
|
+
[id]="'control' + layoutNode?._id"
|
|
1801
|
+
[multiple]="options?.multiple"
|
|
1802
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
1803
|
+
[required]="options?.required"
|
|
1804
|
+
[style.width]="'100%'"
|
|
1805
|
+
[value]="controlValue"
|
|
1806
|
+
(blur)="options.showErrors = true"
|
|
1807
|
+
(change)="updateValue($event)">
|
|
1808
|
+
<ng-template ngFor let-selectItem [ngForOf]="selectList">
|
|
1809
|
+
<mat-option *ngIf="!isArray(selectItem?.items)"
|
|
1810
|
+
[attr.selected]="selectItem?.value === controlValue"
|
|
1811
|
+
[value]="selectItem?.value">
|
|
1812
|
+
<span [innerHTML]="selectItem?.name"></span>
|
|
1813
|
+
</mat-option>
|
|
1814
|
+
<mat-optgroup *ngIf="isArray(selectItem?.items)"
|
|
1815
|
+
[label]="selectItem?.group">
|
|
1816
|
+
<mat-option *ngFor="let subItem of selectItem.items"
|
|
1817
|
+
[attr.selected]="subItem?.value === controlValue"
|
|
1818
|
+
[value]="subItem?.value">
|
|
1819
|
+
<span [innerHTML]="subItem?.name"></span>
|
|
1820
|
+
</mat-option>
|
|
1821
|
+
</mat-optgroup>
|
|
1822
|
+
</ng-template>
|
|
1823
|
+
</mat-select>
|
|
1824
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
1825
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
1826
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
1827
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
1828
|
+
</mat-form-field>
|
|
1829
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1830
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"] }]
|
|
1831
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1832
|
+
type: Inject,
|
|
1833
|
+
args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
|
|
1834
|
+
}, {
|
|
1835
|
+
type: Optional
|
|
1836
|
+
}] }, { type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1837
|
+
type: Input
|
|
1838
|
+
}], layoutIndex: [{
|
|
1839
|
+
type: Input
|
|
1840
|
+
}], dataIndex: [{
|
|
1841
|
+
type: Input
|
|
1842
|
+
}] } });
|
|
1843
|
+
|
|
1844
|
+
class MaterialSliderComponent {
|
|
1845
|
+
constructor(jsf) {
|
|
1846
|
+
this.jsf = jsf;
|
|
1847
|
+
this.controlDisabled = false;
|
|
1848
|
+
this.boundControl = false;
|
|
1849
|
+
this.allowNegative = true;
|
|
1850
|
+
this.allowDecimal = true;
|
|
1851
|
+
this.allowExponents = false;
|
|
1852
|
+
this.lastValidNumber = '';
|
|
1853
|
+
}
|
|
1854
|
+
ngOnInit() {
|
|
1855
|
+
this.options = this.layoutNode.options || {};
|
|
1856
|
+
this.jsf.initializeControl(this, !this.options.readonly);
|
|
1857
|
+
}
|
|
1858
|
+
updateValue(event) {
|
|
1859
|
+
this.options.showErrors = true;
|
|
1860
|
+
this.jsf.updateValue(this, event.value);
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
MaterialSliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialSliderComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1864
|
+
MaterialSliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialSliderComponent, selector: "material-slider-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1865
|
+
<mat-slider thumbLabel *ngIf="boundControl"
|
|
1866
|
+
[formControl]="formControl"
|
|
1867
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1868
|
+
[id]="'control' + layoutNode?._id"
|
|
1869
|
+
[max]="options?.maximum"
|
|
1870
|
+
[min]="options?.minimum"
|
|
1871
|
+
[step]="options?.multipleOf || options?.step || 'any'"
|
|
1872
|
+
[style.width]="'100%'"
|
|
1873
|
+
(blur)="options.showErrors = true"></mat-slider>
|
|
1874
|
+
<mat-slider thumbLabel *ngIf="!boundControl"
|
|
1875
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1876
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1877
|
+
[id]="'control' + layoutNode?._id"
|
|
1878
|
+
[max]="options?.maximum"
|
|
1879
|
+
[min]="options?.minimum"
|
|
1880
|
+
[step]="options?.multipleOf || options?.step || 'any'"
|
|
1881
|
+
[style.width]="'100%'"
|
|
1882
|
+
[value]="controlValue"
|
|
1883
|
+
(blur)="options.showErrors = true"
|
|
1884
|
+
(change)="updateValue($event)"></mat-slider>
|
|
1885
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1886
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: ["mat-error{font-size:75%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i5$3.MatSlider, selector: "mat-slider", inputs: ["disabled", "color", "tabIndex", "invert", "max", "min", "step", "thumbLabel", "tickInterval", "value", "displayWith", "valueText", "vertical"], outputs: ["change", "input", "valueChange"], exportAs: ["matSlider"] }] });
|
|
1887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialSliderComponent, decorators: [{
|
|
1888
|
+
type: Component,
|
|
1889
|
+
args: [{ selector: 'material-slider-widget', template: `
|
|
1890
|
+
<mat-slider thumbLabel *ngIf="boundControl"
|
|
1891
|
+
[formControl]="formControl"
|
|
1892
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1893
|
+
[id]="'control' + layoutNode?._id"
|
|
1894
|
+
[max]="options?.maximum"
|
|
1895
|
+
[min]="options?.minimum"
|
|
1896
|
+
[step]="options?.multipleOf || options?.step || 'any'"
|
|
1897
|
+
[style.width]="'100%'"
|
|
1898
|
+
(blur)="options.showErrors = true"></mat-slider>
|
|
1899
|
+
<mat-slider thumbLabel *ngIf="!boundControl"
|
|
1900
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
1901
|
+
[disabled]="controlDisabled || options?.readonly"
|
|
1902
|
+
[id]="'control' + layoutNode?._id"
|
|
1903
|
+
[max]="options?.maximum"
|
|
1904
|
+
[min]="options?.minimum"
|
|
1905
|
+
[step]="options?.multipleOf || options?.step || 'any'"
|
|
1906
|
+
[style.width]="'100%'"
|
|
1907
|
+
[value]="controlValue"
|
|
1908
|
+
(blur)="options.showErrors = true"
|
|
1909
|
+
(change)="updateValue($event)"></mat-slider>
|
|
1910
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
1911
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: ["mat-error{font-size:75%}\n"] }]
|
|
1912
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1913
|
+
type: Input
|
|
1914
|
+
}], layoutIndex: [{
|
|
1915
|
+
type: Input
|
|
1916
|
+
}], dataIndex: [{
|
|
1917
|
+
type: Input
|
|
1918
|
+
}] } });
|
|
1919
|
+
|
|
1920
|
+
// TODO: Add this control
|
|
1921
|
+
class MaterialStepperComponent {
|
|
1922
|
+
constructor(jsf) {
|
|
1923
|
+
this.jsf = jsf;
|
|
1924
|
+
this.controlDisabled = false;
|
|
1925
|
+
this.boundControl = false;
|
|
1926
|
+
}
|
|
1927
|
+
ngOnInit() {
|
|
1928
|
+
this.options = this.layoutNode.options || {};
|
|
1929
|
+
this.jsf.initializeControl(this);
|
|
1930
|
+
}
|
|
1931
|
+
updateValue(event) {
|
|
1932
|
+
this.jsf.updateValue(this, event.target.value);
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
MaterialStepperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialStepperComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1936
|
+
MaterialStepperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialStepperComponent, selector: "material-stepper-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ``, isInline: true });
|
|
1937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialStepperComponent, decorators: [{
|
|
1938
|
+
type: Component,
|
|
1939
|
+
args: [{
|
|
1940
|
+
// tslint:disable-next-line:component-selector
|
|
1941
|
+
selector: 'material-stepper-widget',
|
|
1942
|
+
template: ``,
|
|
1943
|
+
}]
|
|
1944
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
1945
|
+
type: Input
|
|
1946
|
+
}], layoutIndex: [{
|
|
1947
|
+
type: Input
|
|
1948
|
+
}], dataIndex: [{
|
|
1949
|
+
type: Input
|
|
1950
|
+
}] } });
|
|
1951
|
+
|
|
1952
|
+
class MaterialTabsComponent {
|
|
1953
|
+
constructor(jsf) {
|
|
1954
|
+
this.jsf = jsf;
|
|
1955
|
+
this.selectedItem = 0;
|
|
1956
|
+
this.showAddTab = true;
|
|
1957
|
+
}
|
|
1958
|
+
ngOnInit() {
|
|
1959
|
+
this.options = this.layoutNode.options || {};
|
|
1960
|
+
this.itemCount = this.layoutNode.items.length - 1;
|
|
1961
|
+
this.updateControl();
|
|
1962
|
+
}
|
|
1963
|
+
select(index) {
|
|
1964
|
+
if (this.layoutNode.items[index].type === '$ref') {
|
|
1965
|
+
this.jsf.addItem({
|
|
1966
|
+
layoutNode: this.layoutNode.items[index],
|
|
1967
|
+
layoutIndex: this.layoutIndex.concat(index),
|
|
1968
|
+
dataIndex: this.dataIndex.concat(index)
|
|
1969
|
+
});
|
|
1970
|
+
this.updateControl();
|
|
1971
|
+
}
|
|
1972
|
+
this.selectedItem = index;
|
|
1973
|
+
}
|
|
1974
|
+
updateControl() {
|
|
1975
|
+
this.itemCount = this.layoutNode.items.length - 1;
|
|
1976
|
+
const lastItem = this.layoutNode.items[this.layoutNode.items.length - 1];
|
|
1977
|
+
this.showAddTab = lastItem.type === '$ref' &&
|
|
1978
|
+
this.itemCount < (lastItem.options.maxItems || 1000);
|
|
1979
|
+
}
|
|
1980
|
+
setTabTitle(item, index) {
|
|
1981
|
+
return this.jsf.setArrayItemTitle(this, item, index);
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
MaterialTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialTabsComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1985
|
+
MaterialTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialTabsComponent, selector: "material-tabs-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
1986
|
+
<nav mat-tab-nav-bar
|
|
1987
|
+
[attr.aria-label]="options?.label || options?.title || ''"
|
|
1988
|
+
[style.width]="'100%'">
|
|
1989
|
+
<a mat-tab-link *ngFor="let item of layoutNode?.items; let i = index"
|
|
1990
|
+
[active]="selectedItem === i"
|
|
1991
|
+
(click)="select(i)">
|
|
1992
|
+
<span *ngIf="showAddTab || item.type !== '$ref'"
|
|
1993
|
+
[innerHTML]="setTabTitle(item, i)"></span>
|
|
1994
|
+
</a>
|
|
1995
|
+
</nav>
|
|
1996
|
+
<div *ngFor="let layoutItem of layoutNode?.items; let i = index"
|
|
1997
|
+
[class]="options?.htmlClass || ''">
|
|
1998
|
+
<select-framework-widget *ngIf="selectedItem === i"
|
|
1999
|
+
[class]="(options?.fieldHtmlClass || '') + ' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')"
|
|
2000
|
+
[dataIndex]="layoutNode?.dataType === 'array' ? (dataIndex || []).concat(i) : dataIndex"
|
|
2001
|
+
[layoutIndex]="(layoutIndex || []).concat(i)"
|
|
2002
|
+
[layoutNode]="layoutItem"></select-framework-widget>
|
|
2003
|
+
</div>`, isInline: true, styles: ["a{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$4.MatTabNav, selector: "[mat-tab-nav-bar]", inputs: ["color"], exportAs: ["matTabNavBar", "matTabNav"] }, { kind: "directive", type: i3$4.MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matTabLink"] }, { kind: "component", type: i1.SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }] });
|
|
2004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialTabsComponent, decorators: [{
|
|
2005
|
+
type: Component,
|
|
2006
|
+
args: [{ selector: 'material-tabs-widget', template: `
|
|
2007
|
+
<nav mat-tab-nav-bar
|
|
2008
|
+
[attr.aria-label]="options?.label || options?.title || ''"
|
|
2009
|
+
[style.width]="'100%'">
|
|
2010
|
+
<a mat-tab-link *ngFor="let item of layoutNode?.items; let i = index"
|
|
2011
|
+
[active]="selectedItem === i"
|
|
2012
|
+
(click)="select(i)">
|
|
2013
|
+
<span *ngIf="showAddTab || item.type !== '$ref'"
|
|
2014
|
+
[innerHTML]="setTabTitle(item, i)"></span>
|
|
2015
|
+
</a>
|
|
2016
|
+
</nav>
|
|
2017
|
+
<div *ngFor="let layoutItem of layoutNode?.items; let i = index"
|
|
2018
|
+
[class]="options?.htmlClass || ''">
|
|
2019
|
+
<select-framework-widget *ngIf="selectedItem === i"
|
|
2020
|
+
[class]="(options?.fieldHtmlClass || '') + ' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')"
|
|
2021
|
+
[dataIndex]="layoutNode?.dataType === 'array' ? (dataIndex || []).concat(i) : dataIndex"
|
|
2022
|
+
[layoutIndex]="(layoutIndex || []).concat(i)"
|
|
2023
|
+
[layoutNode]="layoutItem"></select-framework-widget>
|
|
2024
|
+
</div>`, styles: ["a{cursor:pointer}\n"] }]
|
|
2025
|
+
}], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
2026
|
+
type: Input
|
|
2027
|
+
}], layoutIndex: [{
|
|
2028
|
+
type: Input
|
|
2029
|
+
}], dataIndex: [{
|
|
2030
|
+
type: Input
|
|
2031
|
+
}] } });
|
|
2032
|
+
|
|
2033
|
+
class MaterialTextareaComponent {
|
|
2034
|
+
constructor(matFormFieldDefaultOptions, jsf) {
|
|
2035
|
+
this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
|
|
2036
|
+
this.jsf = jsf;
|
|
2037
|
+
this.controlDisabled = false;
|
|
2038
|
+
this.boundControl = false;
|
|
2039
|
+
}
|
|
2040
|
+
ngOnInit() {
|
|
2041
|
+
this.options = this.layoutNode.options || {};
|
|
2042
|
+
this.jsf.initializeControl(this);
|
|
2043
|
+
if (!this.options.notitle && !this.options.description && this.options.placeholder) {
|
|
2044
|
+
this.options.description = this.options.placeholder;
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
updateValue(event) {
|
|
2048
|
+
this.jsf.updateValue(this, event.target.value);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
MaterialTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialTextareaComponent, deps: [{ token: MAT_FORM_FIELD_DEFAULT_OPTIONS, optional: true }, { token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2052
|
+
MaterialTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialTextareaComponent, selector: "material-textarea-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: `
|
|
2053
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
2054
|
+
[class]="options?.htmlClass || ''"
|
|
2055
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
2056
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
2057
|
+
[style.width]="'100%'">
|
|
2058
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
2059
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
2060
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
2061
|
+
<textarea matInput *ngIf="boundControl"
|
|
2062
|
+
[formControl]="formControl"
|
|
2063
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
2064
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
2065
|
+
[attr.maxlength]="options?.maxLength"
|
|
2066
|
+
[attr.minlength]="options?.minLength"
|
|
2067
|
+
[attr.pattern]="options?.pattern"
|
|
2068
|
+
[required]="options?.required"
|
|
2069
|
+
[id]="'control' + layoutNode?._id"
|
|
2070
|
+
[name]="controlName"
|
|
2071
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
2072
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
2073
|
+
[style.width]="'100%'"
|
|
2074
|
+
(blur)="options.showErrors = true"></textarea>
|
|
2075
|
+
<textarea matInput *ngIf="!boundControl"
|
|
2076
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
2077
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
2078
|
+
[attr.maxlength]="options?.maxLength"
|
|
2079
|
+
[attr.minlength]="options?.minLength"
|
|
2080
|
+
[attr.pattern]="options?.pattern"
|
|
2081
|
+
[required]="options?.required"
|
|
2082
|
+
[disabled]="controlDisabled"
|
|
2083
|
+
[id]="'control' + layoutNode?._id"
|
|
2084
|
+
[name]="controlName"
|
|
2085
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
2086
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
2087
|
+
[style.width]="'100%'"
|
|
2088
|
+
[value]="controlValue"
|
|
2089
|
+
(input)="updateValue($event)"
|
|
2090
|
+
(blur)="options.showErrors = true"></textarea>
|
|
2091
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
2092
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
2093
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
2094
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
2095
|
+
</mat-form-field>
|
|
2096
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
2097
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.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: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$3.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i3$3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3$3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i5$1.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"] }] });
|
|
2098
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialTextareaComponent, decorators: [{
|
|
2099
|
+
type: Component,
|
|
2100
|
+
args: [{ selector: 'material-textarea-widget', template: `
|
|
2101
|
+
<mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
|
|
2102
|
+
[class]="options?.htmlClass || ''"
|
|
2103
|
+
[floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
|
|
2104
|
+
[hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
|
|
2105
|
+
[style.width]="'100%'">
|
|
2106
|
+
<mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
|
|
2107
|
+
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
|
|
2108
|
+
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
|
|
2109
|
+
<textarea matInput *ngIf="boundControl"
|
|
2110
|
+
[formControl]="formControl"
|
|
2111
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
2112
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
2113
|
+
[attr.maxlength]="options?.maxLength"
|
|
2114
|
+
[attr.minlength]="options?.minLength"
|
|
2115
|
+
[attr.pattern]="options?.pattern"
|
|
2116
|
+
[required]="options?.required"
|
|
2117
|
+
[id]="'control' + layoutNode?._id"
|
|
2118
|
+
[name]="controlName"
|
|
2119
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
2120
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
2121
|
+
[style.width]="'100%'"
|
|
2122
|
+
(blur)="options.showErrors = true"></textarea>
|
|
2123
|
+
<textarea matInput *ngIf="!boundControl"
|
|
2124
|
+
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
|
|
2125
|
+
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
|
|
2126
|
+
[attr.maxlength]="options?.maxLength"
|
|
2127
|
+
[attr.minlength]="options?.minLength"
|
|
2128
|
+
[attr.pattern]="options?.pattern"
|
|
2129
|
+
[required]="options?.required"
|
|
2130
|
+
[disabled]="controlDisabled"
|
|
2131
|
+
[id]="'control' + layoutNode?._id"
|
|
2132
|
+
[name]="controlName"
|
|
2133
|
+
[placeholder]="options?.notitle ? options?.placeholder : options?.title"
|
|
2134
|
+
[readonly]="options?.readonly ? 'readonly' : null"
|
|
2135
|
+
[style.width]="'100%'"
|
|
2136
|
+
[value]="controlValue"
|
|
2137
|
+
(input)="updateValue($event)"
|
|
2138
|
+
(blur)="options.showErrors = true"></textarea>
|
|
2139
|
+
<span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
|
|
2140
|
+
[innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
|
|
2141
|
+
<mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
|
|
2142
|
+
align="end" [innerHTML]="options?.description"></mat-hint>
|
|
2143
|
+
</mat-form-field>
|
|
2144
|
+
<mat-error *ngIf="options?.showErrors && options?.errorMessage"
|
|
2145
|
+
[innerHTML]="options?.errorMessage"></mat-error>`, styles: ["mat-error{font-size:75%;margin-top:-1rem;margin-bottom:.5rem}::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex .mat-form-field-infix{width:auto;width:initial}\n"] }]
|
|
2146
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2147
|
+
type: Inject,
|
|
2148
|
+
args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
|
|
2149
|
+
}, {
|
|
2150
|
+
type: Optional
|
|
2151
|
+
}] }, { type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{
|
|
2152
|
+
type: Input
|
|
2153
|
+
}], layoutIndex: [{
|
|
2154
|
+
type: Input
|
|
2155
|
+
}], dataIndex: [{
|
|
2156
|
+
type: Input
|
|
2157
|
+
}] } });
|
|
2158
|
+
|
|
2159
|
+
const MATERIAL_FRAMEWORK_COMPONENTS = [
|
|
2160
|
+
FlexLayoutRootComponent, FlexLayoutSectionComponent,
|
|
2161
|
+
MaterialAddReferenceComponent, MaterialOneOfComponent,
|
|
2162
|
+
MaterialButtonComponent, MaterialButtonGroupComponent,
|
|
2163
|
+
MaterialCheckboxComponent, MaterialCheckboxesComponent,
|
|
2164
|
+
MaterialChipListComponent, MaterialDatepickerComponent,
|
|
2165
|
+
MaterialFileComponent, MaterialInputComponent, MaterialNumberComponent,
|
|
2166
|
+
MaterialRadiosComponent, MaterialSelectComponent, MaterialSliderComponent,
|
|
2167
|
+
MaterialStepperComponent, MaterialTabsComponent, MaterialTextareaComponent,
|
|
2168
|
+
MaterialDesignFrameworkComponent
|
|
2169
|
+
];
|
|
2170
|
+
|
|
2171
|
+
// Material Design Framework
|
|
2172
|
+
// https://github.com/angular/material2
|
|
2173
|
+
class MaterialDesignFramework extends Framework {
|
|
2174
|
+
constructor() {
|
|
2175
|
+
super(...arguments);
|
|
2176
|
+
this.name = 'material-design';
|
|
2177
|
+
this.framework = MaterialDesignFrameworkComponent;
|
|
2178
|
+
this.stylesheets = [
|
|
2179
|
+
'//fonts.googleapis.com/icon?family=Material+Icons',
|
|
2180
|
+
'//fonts.googleapis.com/css?family=Roboto:300,400,500,700',
|
|
2181
|
+
];
|
|
2182
|
+
this.widgets = {
|
|
2183
|
+
'root': FlexLayoutRootComponent,
|
|
2184
|
+
'section': FlexLayoutSectionComponent,
|
|
2185
|
+
'$ref': MaterialAddReferenceComponent,
|
|
2186
|
+
'button': MaterialButtonComponent,
|
|
2187
|
+
'button-group': MaterialButtonGroupComponent,
|
|
2188
|
+
'checkbox': MaterialCheckboxComponent,
|
|
2189
|
+
'checkboxes': MaterialCheckboxesComponent,
|
|
2190
|
+
'chip-list': MaterialChipListComponent,
|
|
2191
|
+
'date': MaterialDatepickerComponent,
|
|
2192
|
+
'file': MaterialFileComponent,
|
|
2193
|
+
'number': MaterialNumberComponent,
|
|
2194
|
+
'one-of': MaterialOneOfComponent,
|
|
2195
|
+
'radios': MaterialRadiosComponent,
|
|
2196
|
+
'select': MaterialSelectComponent,
|
|
2197
|
+
'slider': MaterialSliderComponent,
|
|
2198
|
+
'stepper': MaterialStepperComponent,
|
|
2199
|
+
'tabs': MaterialTabsComponent,
|
|
2200
|
+
'text': MaterialInputComponent,
|
|
2201
|
+
'textarea': MaterialTextareaComponent,
|
|
2202
|
+
'alt-date': 'date',
|
|
2203
|
+
'any-of': 'one-of',
|
|
2204
|
+
'card': 'section',
|
|
2205
|
+
'color': 'text',
|
|
2206
|
+
'expansion-panel': 'section',
|
|
2207
|
+
'hidden': 'none',
|
|
2208
|
+
'image': 'none',
|
|
2209
|
+
'integer': 'number',
|
|
2210
|
+
'radiobuttons': 'button-group',
|
|
2211
|
+
'range': 'slider',
|
|
2212
|
+
'submit': 'button',
|
|
2213
|
+
'tagsinput': 'chip-list',
|
|
2214
|
+
'wizard': 'stepper',
|
|
2215
|
+
};
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
MaterialDesignFramework.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFramework, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2219
|
+
MaterialDesignFramework.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFramework });
|
|
2220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFramework, decorators: [{
|
|
2221
|
+
type: Injectable
|
|
2222
|
+
}] });
|
|
2223
|
+
|
|
2224
|
+
function fixAngularFlex() {
|
|
2225
|
+
// monkey patch based on errors in console - https://github.com/angular/flex-layout/issues/1011
|
|
2226
|
+
const MediaMarshallerUpdateElement = MediaMarshaller.prototype.updateElement;
|
|
2227
|
+
MediaMarshaller.prototype.updateElement = function (element, key, value) {
|
|
2228
|
+
if (key === 'layout-gap' && (value === null || value === undefined)) {
|
|
2229
|
+
value = '0px';
|
|
2230
|
+
}
|
|
2231
|
+
MediaMarshallerUpdateElement.apply(this, [element, key, value]);
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* unused @angular/material modules:
|
|
2237
|
+
* MatDialogModule, MatGridListModule, MatListModule, MatMenuModule,
|
|
2238
|
+
* MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule,
|
|
2239
|
+
* MatSidenavModule, MatSnackBarModule, MatSortModule, MatTableModule,
|
|
2240
|
+
* ,
|
|
2241
|
+
*/
|
|
2242
|
+
const ANGULAR_MATERIAL_MODULES = [
|
|
2243
|
+
MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatCardModule,
|
|
2244
|
+
MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatExpansionModule,
|
|
2245
|
+
MatFormFieldModule, MatIconModule, MatInputModule, MatNativeDateModule,
|
|
2246
|
+
MatRadioModule, MatSelectModule, MatSliderModule, MatSlideToggleModule,
|
|
2247
|
+
MatStepperModule, MatTabsModule, MatTooltipModule,
|
|
2248
|
+
MatToolbarModule, MatMenuModule, MatToolbarModule,
|
|
2249
|
+
];
|
|
2250
|
+
class MaterialDesignFrameworkModule {
|
|
2251
|
+
constructor() {
|
|
2252
|
+
fixAngularFlex();
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
MaterialDesignFrameworkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2256
|
+
MaterialDesignFrameworkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFrameworkModule, declarations: [FlexLayoutRootComponent, FlexLayoutSectionComponent, MaterialAddReferenceComponent, MaterialOneOfComponent, MaterialButtonComponent, MaterialButtonGroupComponent, MaterialCheckboxComponent, MaterialCheckboxesComponent, MaterialChipListComponent, MaterialDatepickerComponent, MaterialFileComponent, MaterialInputComponent, MaterialNumberComponent, MaterialRadiosComponent, MaterialSelectComponent, MaterialSliderComponent, MaterialStepperComponent, MaterialTabsComponent, MaterialTextareaComponent, MaterialDesignFrameworkComponent], imports: [CommonModule,
|
|
2257
|
+
FormsModule,
|
|
2258
|
+
ReactiveFormsModule,
|
|
2259
|
+
FlexLayoutModule, MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatCardModule,
|
|
2260
|
+
MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatExpansionModule,
|
|
2261
|
+
MatFormFieldModule, MatIconModule, MatInputModule, MatNativeDateModule,
|
|
2262
|
+
MatRadioModule, MatSelectModule, MatSliderModule, MatSlideToggleModule,
|
|
2263
|
+
MatStepperModule, MatTabsModule, MatTooltipModule,
|
|
2264
|
+
MatToolbarModule, MatMenuModule, MatToolbarModule, WidgetLibraryModule,
|
|
2265
|
+
JsonSchemaFormModule], exports: [JsonSchemaFormModule, FlexLayoutRootComponent, FlexLayoutSectionComponent, MaterialAddReferenceComponent, MaterialOneOfComponent, MaterialButtonComponent, MaterialButtonGroupComponent, MaterialCheckboxComponent, MaterialCheckboxesComponent, MaterialChipListComponent, MaterialDatepickerComponent, MaterialFileComponent, MaterialInputComponent, MaterialNumberComponent, MaterialRadiosComponent, MaterialSelectComponent, MaterialSliderComponent, MaterialStepperComponent, MaterialTabsComponent, MaterialTextareaComponent, MaterialDesignFrameworkComponent] });
|
|
2266
|
+
MaterialDesignFrameworkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFrameworkModule, providers: [
|
|
2267
|
+
JsonSchemaFormService,
|
|
2268
|
+
FrameworkLibraryService,
|
|
2269
|
+
WidgetLibraryService,
|
|
2270
|
+
{ provide: Framework, useClass: MaterialDesignFramework, multi: true },
|
|
2271
|
+
], imports: [CommonModule,
|
|
2272
|
+
FormsModule,
|
|
2273
|
+
ReactiveFormsModule,
|
|
2274
|
+
FlexLayoutModule, ANGULAR_MATERIAL_MODULES, WidgetLibraryModule,
|
|
2275
|
+
JsonSchemaFormModule, JsonSchemaFormModule] });
|
|
2276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialDesignFrameworkModule, decorators: [{
|
|
2277
|
+
type: NgModule,
|
|
2278
|
+
args: [{
|
|
2279
|
+
imports: [
|
|
2280
|
+
CommonModule,
|
|
2281
|
+
FormsModule,
|
|
2282
|
+
ReactiveFormsModule,
|
|
2283
|
+
FlexLayoutModule,
|
|
2284
|
+
...ANGULAR_MATERIAL_MODULES,
|
|
2285
|
+
WidgetLibraryModule,
|
|
2286
|
+
JsonSchemaFormModule,
|
|
2287
|
+
],
|
|
2288
|
+
declarations: [
|
|
2289
|
+
...MATERIAL_FRAMEWORK_COMPONENTS,
|
|
2290
|
+
],
|
|
2291
|
+
exports: [
|
|
2292
|
+
JsonSchemaFormModule,
|
|
2293
|
+
...MATERIAL_FRAMEWORK_COMPONENTS,
|
|
2294
|
+
],
|
|
2295
|
+
providers: [
|
|
2296
|
+
JsonSchemaFormService,
|
|
2297
|
+
FrameworkLibraryService,
|
|
2298
|
+
WidgetLibraryService,
|
|
2299
|
+
{ provide: Framework, useClass: MaterialDesignFramework, multi: true },
|
|
2300
|
+
]
|
|
2301
|
+
}]
|
|
2302
|
+
}], ctorParameters: function () { return []; } });
|
|
2303
|
+
|
|
2304
|
+
/*
|
|
2305
|
+
* Public API Surface of @ajsf/material-framework
|
|
2306
|
+
*/
|
|
2307
|
+
|
|
2308
|
+
/**
|
|
2309
|
+
* Generated bundle index. Do not edit.
|
|
2310
|
+
*/
|
|
2311
|
+
|
|
2312
|
+
export { ANGULAR_MATERIAL_MODULES, FlexLayoutRootComponent, FlexLayoutSectionComponent, MATERIAL_FRAMEWORK_COMPONENTS, MaterialAddReferenceComponent, MaterialButtonComponent, MaterialButtonGroupComponent, MaterialCheckboxComponent, MaterialCheckboxesComponent, MaterialChipListComponent, MaterialDatepickerComponent, MaterialDesignFramework, MaterialDesignFrameworkComponent, MaterialDesignFrameworkModule, MaterialFileComponent, MaterialInputComponent, MaterialNumberComponent, MaterialOneOfComponent, MaterialRadiosComponent, MaterialSelectComponent, MaterialSliderComponent, MaterialStepperComponent, MaterialTabsComponent, MaterialTextareaComponent };
|
|
2313
|
+
//# sourceMappingURL=ajsf-material.mjs.map
|