@jsonforms/angular-material 3.2.0-alpha.4 → 3.2.0-beta.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/lib/cjs/controls/autocomplete.renderer.d.ts +2 -3
- package/lib/cjs/controls/autocomplete.renderer.js +7 -14
- package/lib/cjs/controls/autocomplete.renderer.js.map +1 -1
- package/lib/cjs/controls/boolean.renderer.js +4 -10
- package/lib/cjs/controls/boolean.renderer.js.map +1 -1
- package/lib/cjs/controls/date.renderer.js +4 -10
- package/lib/cjs/controls/date.renderer.js.map +1 -1
- package/lib/cjs/controls/number.renderer.js +4 -10
- package/lib/cjs/controls/number.renderer.js.map +1 -1
- package/lib/cjs/controls/range.renderer.d.ts +1 -1
- package/lib/cjs/controls/range.renderer.js +5 -11
- package/lib/cjs/controls/range.renderer.js.map +1 -1
- package/lib/cjs/controls/text.renderer.js +4 -10
- package/lib/cjs/controls/text.renderer.js.map +1 -1
- package/lib/cjs/controls/textarea.renderer.js +4 -10
- package/lib/cjs/controls/textarea.renderer.js.map +1 -1
- package/lib/cjs/controls/toggle.renderer.js +4 -5
- package/lib/cjs/controls/toggle.renderer.js.map +1 -1
- package/lib/cjs/layouts/array-layout.renderer.js +9 -11
- package/lib/cjs/layouts/array-layout.renderer.js.map +1 -1
- package/lib/cjs/layouts/categorization-layout.renderer.js +4 -5
- package/lib/cjs/layouts/categorization-layout.renderer.js.map +1 -1
- package/lib/cjs/layouts/group-layout.renderer.js +6 -12
- package/lib/cjs/layouts/group-layout.renderer.js.map +1 -1
- package/lib/cjs/layouts/horizontal-layout.renderer.js +5 -11
- package/lib/cjs/layouts/horizontal-layout.renderer.js.map +1 -1
- package/lib/cjs/layouts/layout.renderer.js +6 -6
- package/lib/cjs/layouts/vertical-layout.renderer.js +5 -11
- package/lib/cjs/layouts/vertical-layout.renderer.js.map +1 -1
- package/lib/cjs/module.d.ts +10 -11
- package/lib/cjs/module.js +4 -11
- package/lib/cjs/module.js.map +1 -1
- package/lib/cjs/other/label.renderer.js +4 -8
- package/lib/cjs/other/label.renderer.js.map +1 -1
- package/lib/cjs/other/master-detail/detail.d.ts +1 -1
- package/lib/cjs/other/master-detail/detail.js +3 -3
- package/lib/cjs/other/master-detail/master.js +7 -8
- package/lib/cjs/other/master-detail/master.js.map +1 -1
- package/lib/cjs/other/object.renderer.js +4 -8
- package/lib/cjs/other/object.renderer.js.map +1 -1
- package/lib/cjs/other/table.renderer.js +3 -3
- package/lib/esm/controls/autocomplete.renderer.d.ts +2 -3
- package/lib/esm/controls/autocomplete.renderer.js +7 -14
- package/lib/esm/controls/autocomplete.renderer.js.map +1 -1
- package/lib/esm/controls/boolean.renderer.js +4 -10
- package/lib/esm/controls/boolean.renderer.js.map +1 -1
- package/lib/esm/controls/date.renderer.js +4 -10
- package/lib/esm/controls/date.renderer.js.map +1 -1
- package/lib/esm/controls/number.renderer.js +4 -10
- package/lib/esm/controls/number.renderer.js.map +1 -1
- package/lib/esm/controls/range.renderer.d.ts +1 -1
- package/lib/esm/controls/range.renderer.js +5 -11
- package/lib/esm/controls/range.renderer.js.map +1 -1
- package/lib/esm/controls/text.renderer.js +4 -10
- package/lib/esm/controls/text.renderer.js.map +1 -1
- package/lib/esm/controls/textarea.renderer.js +4 -10
- package/lib/esm/controls/textarea.renderer.js.map +1 -1
- package/lib/esm/controls/toggle.renderer.js +4 -5
- package/lib/esm/controls/toggle.renderer.js.map +1 -1
- package/lib/esm/layouts/array-layout.renderer.js +9 -11
- package/lib/esm/layouts/array-layout.renderer.js.map +1 -1
- package/lib/esm/layouts/categorization-layout.renderer.js +4 -5
- package/lib/esm/layouts/categorization-layout.renderer.js.map +1 -1
- package/lib/esm/layouts/group-layout.renderer.js +6 -12
- package/lib/esm/layouts/group-layout.renderer.js.map +1 -1
- package/lib/esm/layouts/horizontal-layout.renderer.js +5 -11
- package/lib/esm/layouts/horizontal-layout.renderer.js.map +1 -1
- package/lib/esm/layouts/layout.renderer.js +6 -6
- package/lib/esm/layouts/vertical-layout.renderer.js +5 -11
- package/lib/esm/layouts/vertical-layout.renderer.js.map +1 -1
- package/lib/esm/module.d.ts +10 -11
- package/lib/esm/module.js +4 -11
- package/lib/esm/module.js.map +1 -1
- package/lib/esm/other/label.renderer.js +4 -8
- package/lib/esm/other/label.renderer.js.map +1 -1
- package/lib/esm/other/master-detail/detail.d.ts +1 -1
- package/lib/esm/other/master-detail/detail.js +3 -3
- package/lib/esm/other/master-detail/master.js +7 -8
- package/lib/esm/other/master-detail/master.js.map +1 -1
- package/lib/esm/other/object.renderer.js +4 -8
- package/lib/esm/other/object.renderer.js.map +1 -1
- package/lib/esm/other/table.renderer.js +3 -3
- package/package.json +38 -43
- package/src/controls/autocomplete.renderer.ts +13 -3
- package/src/controls/boolean.renderer.ts +16 -6
- package/src/controls/date.renderer.ts +12 -1
- package/src/controls/number.renderer.ts +12 -1
- package/src/controls/range.renderer.ts +16 -3
- package/src/controls/text.renderer.ts +12 -1
- package/src/controls/textarea.renderer.ts +12 -1
- package/src/controls/toggle.renderer.ts +1 -1
- package/src/layouts/array-layout.renderer.ts +21 -12
- package/src/layouts/categorization-layout.renderer.ts +4 -1
- package/src/layouts/group-layout.renderer.ts +18 -2
- package/src/layouts/horizontal-layout.renderer.ts +16 -5
- package/src/layouts/vertical-layout.renderer.ts +13 -2
- package/src/module.ts +0 -3
- package/src/other/label.renderer.ts +8 -1
- package/src/other/master-detail/master.ts +4 -4
- package/src/other/object.renderer.ts +8 -1
|
@@ -59,8 +59,7 @@ import { map, startWith } from 'rxjs/operators';
|
|
|
59
59
|
* <pre><code>
|
|
60
60
|
* ...
|
|
61
61
|
* imports: [JsonFormsAngularMaterialModule, MatAutocompleteModule],
|
|
62
|
-
* declarations: [AutocompleteControlRenderer]
|
|
63
|
-
* entryComponents: [AutocompleteControlRenderer]
|
|
62
|
+
* declarations: [AutocompleteControlRenderer]
|
|
64
63
|
* ...
|
|
65
64
|
* </code></pre>
|
|
66
65
|
*
|
|
@@ -68,7 +67,7 @@ import { map, startWith } from 'rxjs/operators';
|
|
|
68
67
|
@Component({
|
|
69
68
|
selector: 'AutocompleteControlRenderer',
|
|
70
69
|
template: `
|
|
71
|
-
<mat-form-field
|
|
70
|
+
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
|
|
72
71
|
<mat-label>{{ label }}</mat-label>
|
|
73
72
|
<input
|
|
74
73
|
matInput
|
|
@@ -99,6 +98,17 @@ import { map, startWith } from 'rxjs/operators';
|
|
|
99
98
|
<mat-error>{{ error }}</mat-error>
|
|
100
99
|
</mat-form-field>
|
|
101
100
|
`,
|
|
101
|
+
styles: [
|
|
102
|
+
`
|
|
103
|
+
:host {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: row;
|
|
106
|
+
}
|
|
107
|
+
mat-form-field {
|
|
108
|
+
flex: 1 1 auto;
|
|
109
|
+
}
|
|
110
|
+
`,
|
|
111
|
+
],
|
|
102
112
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
103
113
|
})
|
|
104
114
|
export class AutocompleteControlRenderer
|
|
@@ -34,12 +34,7 @@ import { isBooleanControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
34
34
|
@Component({
|
|
35
35
|
selector: 'BooleanControlRenderer',
|
|
36
36
|
template: `
|
|
37
|
-
<div
|
|
38
|
-
[fxHide]="hidden"
|
|
39
|
-
fxLayout="column"
|
|
40
|
-
fxLayoutAlign="center"
|
|
41
|
-
style="height:100%"
|
|
42
|
-
>
|
|
37
|
+
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="boolean-control">
|
|
43
38
|
<mat-checkbox
|
|
44
39
|
(change)="onChange($event)"
|
|
45
40
|
[checked]="isChecked()"
|
|
@@ -54,6 +49,21 @@ import { isBooleanControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
54
49
|
<mat-error class="mat-caption">{{ error }}</mat-error>
|
|
55
50
|
</div>
|
|
56
51
|
`,
|
|
52
|
+
styles: [
|
|
53
|
+
`
|
|
54
|
+
:host {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
}
|
|
58
|
+
.boolean-control {
|
|
59
|
+
flex: 1 1 auto;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
`,
|
|
66
|
+
],
|
|
57
67
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
58
68
|
})
|
|
59
69
|
export class BooleanControlRenderer extends JsonFormsControl {
|
|
@@ -29,7 +29,7 @@ import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
|
29
29
|
@Component({
|
|
30
30
|
selector: 'DateControlRenderer',
|
|
31
31
|
template: `
|
|
32
|
-
<mat-form-field
|
|
32
|
+
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
|
|
33
33
|
<mat-label>{{ label }}</mat-label>
|
|
34
34
|
<input
|
|
35
35
|
matInput
|
|
@@ -51,6 +51,17 @@ import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
|
51
51
|
<mat-error>{{ error }}</mat-error>
|
|
52
52
|
</mat-form-field>
|
|
53
53
|
`,
|
|
54
|
+
styles: [
|
|
55
|
+
`
|
|
56
|
+
:host {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
}
|
|
60
|
+
mat-form-field {
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
],
|
|
54
65
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
66
|
})
|
|
56
67
|
export class DateControlRenderer extends JsonFormsControl {
|
|
@@ -37,7 +37,7 @@ import merge from 'lodash/merge';
|
|
|
37
37
|
@Component({
|
|
38
38
|
selector: 'NumberControlRenderer',
|
|
39
39
|
template: `
|
|
40
|
-
<mat-form-field
|
|
40
|
+
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
|
|
41
41
|
<mat-label>{{ label }}</mat-label>
|
|
42
42
|
<input
|
|
43
43
|
matInput
|
|
@@ -57,6 +57,17 @@ import merge from 'lodash/merge';
|
|
|
57
57
|
<mat-error>{{ error }}</mat-error>
|
|
58
58
|
</mat-form-field>
|
|
59
59
|
`,
|
|
60
|
+
styles: [
|
|
61
|
+
`
|
|
62
|
+
:host {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
}
|
|
66
|
+
mat-form-field {
|
|
67
|
+
flex: 1 1 auto;
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
],
|
|
60
71
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
61
72
|
})
|
|
62
73
|
export class NumberControlRenderer extends JsonFormsControl {
|
|
@@ -33,7 +33,7 @@ import { isRangeControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
33
33
|
@Component({
|
|
34
34
|
selector: 'RangeControlRenderer',
|
|
35
35
|
template: `
|
|
36
|
-
<div
|
|
36
|
+
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="range-control">
|
|
37
37
|
<label class="mat-caption" style="color:rgba(0,0,0,.54)">{{
|
|
38
38
|
label
|
|
39
39
|
}}</label>
|
|
@@ -47,7 +47,7 @@ import { isRangeControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
47
47
|
showTickMarks
|
|
48
48
|
#ngSlider
|
|
49
49
|
>
|
|
50
|
-
<input matSliderThumb />
|
|
50
|
+
<input matSliderThumb (valueChange)="onChange($event)" />
|
|
51
51
|
</mat-slider>
|
|
52
52
|
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
|
|
53
53
|
description
|
|
@@ -55,6 +55,19 @@ import { isRangeControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
55
55
|
<mat-error class="mat-caption">{{ error }}</mat-error>
|
|
56
56
|
</div>
|
|
57
57
|
`,
|
|
58
|
+
styles: [
|
|
59
|
+
`
|
|
60
|
+
:host {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: row;
|
|
63
|
+
}
|
|
64
|
+
.range-control {
|
|
65
|
+
flex: 1 1 auto;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
],
|
|
58
71
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
59
72
|
})
|
|
60
73
|
export class RangeControlRenderer extends JsonFormsControl {
|
|
@@ -69,7 +82,7 @@ export class RangeControlRenderer extends JsonFormsControl {
|
|
|
69
82
|
) {
|
|
70
83
|
super(jsonformsService);
|
|
71
84
|
}
|
|
72
|
-
getEventValue = (event:
|
|
85
|
+
getEventValue = (event: number) => Number(event);
|
|
73
86
|
mapAdditionalProps() {
|
|
74
87
|
if (this.scopedSchema) {
|
|
75
88
|
this.min = this.scopedSchema.minimum;
|
|
@@ -29,7 +29,7 @@ import { isStringControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
29
29
|
@Component({
|
|
30
30
|
selector: 'TextControlRenderer',
|
|
31
31
|
template: `
|
|
32
|
-
<mat-form-field
|
|
32
|
+
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
|
|
33
33
|
<mat-label>{{ label }}</mat-label>
|
|
34
34
|
<input
|
|
35
35
|
matInput
|
|
@@ -46,6 +46,17 @@ import { isStringControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
46
46
|
<mat-error>{{ error }}</mat-error>
|
|
47
47
|
</mat-form-field>
|
|
48
48
|
`,
|
|
49
|
+
styles: [
|
|
50
|
+
`
|
|
51
|
+
:host {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
}
|
|
55
|
+
mat-form-field {
|
|
56
|
+
flex: 1 1 auto;
|
|
57
|
+
}
|
|
58
|
+
`,
|
|
59
|
+
],
|
|
49
60
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
61
|
})
|
|
51
62
|
export class TextControlRenderer extends JsonFormsControl {
|
|
@@ -29,7 +29,7 @@ import { isMultiLineControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
29
29
|
@Component({
|
|
30
30
|
selector: 'TextAreaRenderer',
|
|
31
31
|
template: `
|
|
32
|
-
<mat-form-field
|
|
32
|
+
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
|
|
33
33
|
<mat-label>{{ label }}</mat-label>
|
|
34
34
|
<textarea
|
|
35
35
|
matInput
|
|
@@ -45,6 +45,17 @@ import { isMultiLineControl, RankedTester, rankWith } from '@jsonforms/core';
|
|
|
45
45
|
<mat-error>{{ error }}</mat-error>
|
|
46
46
|
</mat-form-field>
|
|
47
47
|
`,
|
|
48
|
+
styles: [
|
|
49
|
+
`
|
|
50
|
+
:host {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
}
|
|
54
|
+
mat-form-field {
|
|
55
|
+
flex: 1 1 auto;
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
],
|
|
48
59
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
49
60
|
})
|
|
50
61
|
export class TextAreaRenderer extends JsonFormsControl {
|
|
@@ -55,26 +55,21 @@ import {
|
|
|
55
55
|
@Component({
|
|
56
56
|
selector: 'app-array-layout-renderer',
|
|
57
57
|
template: `
|
|
58
|
-
<div
|
|
59
|
-
<div
|
|
60
|
-
<h2
|
|
61
|
-
<span
|
|
58
|
+
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="array-layout">
|
|
59
|
+
<div class="array-layout-toolbar">
|
|
60
|
+
<h2 class="mat-h2 array-layout-title">{{ label }}</h2>
|
|
61
|
+
<span></span>
|
|
62
62
|
<mat-icon
|
|
63
63
|
*ngIf="this.error?.length"
|
|
64
64
|
color="warn"
|
|
65
|
-
matBadge="{{
|
|
66
|
-
this.error.split(
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
).length
|
|
70
|
-
}}"
|
|
65
|
+
matBadge="{{ this.error.split('').length }}"
|
|
71
66
|
matBadgeColor="warn"
|
|
72
67
|
matTooltip="{{ this.error }}"
|
|
73
68
|
matTooltipClass="error-message-tooltip"
|
|
74
69
|
>
|
|
75
70
|
error_outline
|
|
76
71
|
</mat-icon>
|
|
77
|
-
<span
|
|
72
|
+
<span></span>
|
|
78
73
|
<button
|
|
79
74
|
mat-button
|
|
80
75
|
matTooltip="{{ translations.addTooltip }}"
|
|
@@ -95,7 +90,7 @@ import {
|
|
|
95
90
|
first as first
|
|
96
91
|
"
|
|
97
92
|
>
|
|
98
|
-
<mat-card appearance="outlined">
|
|
93
|
+
<mat-card class="array-item" appearance="outlined">
|
|
99
94
|
<mat-card-content>
|
|
100
95
|
<jsonforms-outlet [renderProps]="getProps(idx)"></jsonforms-outlet>
|
|
101
96
|
</mat-card-content>
|
|
@@ -141,6 +136,14 @@ import {
|
|
|
141
136
|
`,
|
|
142
137
|
styles: [
|
|
143
138
|
`
|
|
139
|
+
.array-layout {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
gap: 16px;
|
|
143
|
+
}
|
|
144
|
+
.array-layout > * {
|
|
145
|
+
flex: 1 1 auto;
|
|
146
|
+
}
|
|
144
147
|
.array-layout-toolbar {
|
|
145
148
|
display: flex;
|
|
146
149
|
align-items: center;
|
|
@@ -148,6 +151,12 @@ import {
|
|
|
148
151
|
.array-layout-title {
|
|
149
152
|
margin: 0;
|
|
150
153
|
}
|
|
154
|
+
.array-layout-toolbar > span {
|
|
155
|
+
flex: 1 1 auto;
|
|
156
|
+
}
|
|
157
|
+
.array-item {
|
|
158
|
+
padding: 16px;
|
|
159
|
+
}
|
|
151
160
|
::ng-deep .error-message-tooltip {
|
|
152
161
|
white-space: pre-line;
|
|
153
162
|
}
|
|
@@ -48,7 +48,10 @@ import { Subscription } from 'rxjs';
|
|
|
48
48
|
@Component({
|
|
49
49
|
selector: 'jsonforms-categorization-layout',
|
|
50
50
|
template: `
|
|
51
|
-
<mat-tab-group
|
|
51
|
+
<mat-tab-group
|
|
52
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
53
|
+
dynamicHeight="true"
|
|
54
|
+
>
|
|
52
55
|
<mat-tab
|
|
53
56
|
*ngFor="let category of visibleCategories; let i = index"
|
|
54
57
|
[label]="categoryLabels[i]"
|
|
@@ -34,19 +34,35 @@ import { JsonFormsAngularService } from '@jsonforms/angular';
|
|
|
34
34
|
@Component({
|
|
35
35
|
selector: 'GroupLayoutRenderer',
|
|
36
36
|
template: `
|
|
37
|
-
<mat-card
|
|
37
|
+
<mat-card
|
|
38
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
39
|
+
appearance="outlined"
|
|
40
|
+
class="group-layout"
|
|
41
|
+
>
|
|
38
42
|
<mat-card-title class="mat-headline-6">{{ label }}</mat-card-title>
|
|
39
43
|
<div
|
|
40
44
|
*ngFor="
|
|
41
45
|
let props of uischema | layoutChildrenRenderProps : schema : path;
|
|
42
46
|
trackBy: trackElement
|
|
43
47
|
"
|
|
44
|
-
fxFlex
|
|
45
48
|
>
|
|
46
49
|
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
|
|
47
50
|
</div>
|
|
48
51
|
</mat-card>
|
|
49
52
|
`,
|
|
53
|
+
styles: [
|
|
54
|
+
`
|
|
55
|
+
.group-layout {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 16px;
|
|
59
|
+
padding: 16px;
|
|
60
|
+
}
|
|
61
|
+
.group-layout > div {
|
|
62
|
+
flex: 1 1 auto;
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
],
|
|
50
66
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
67
|
})
|
|
52
68
|
export class GroupLayoutRenderer extends LayoutRenderer<GroupLayout> {
|
|
@@ -40,22 +40,33 @@ import { JsonFormsAngularService } from '@jsonforms/angular';
|
|
|
40
40
|
selector: 'HorizontalLayoutRenderer',
|
|
41
41
|
template: `
|
|
42
42
|
<div
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
[fxHide]="hidden"
|
|
46
|
-
fxLayoutAlign="center start"
|
|
43
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
44
|
+
class="horizontal-layout"
|
|
47
45
|
>
|
|
48
46
|
<div
|
|
49
47
|
*ngFor="
|
|
50
48
|
let props of uischema | layoutChildrenRenderProps : schema : path;
|
|
51
49
|
trackBy: trackElement
|
|
52
50
|
"
|
|
53
|
-
fxFlex
|
|
54
51
|
>
|
|
55
52
|
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
|
|
56
53
|
</div>
|
|
57
54
|
</div>
|
|
58
55
|
`,
|
|
56
|
+
styles: [
|
|
57
|
+
`
|
|
58
|
+
.horizontal-layout {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 16px;
|
|
61
|
+
flex-flow: row wrap;
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
place-content: flex-start center;
|
|
64
|
+
}
|
|
65
|
+
.horizontal-layout > div {
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
}
|
|
68
|
+
`,
|
|
69
|
+
],
|
|
59
70
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
71
|
})
|
|
61
72
|
export class HorizontalLayoutRenderer extends LayoutRenderer<HorizontalLayout> {
|
|
@@ -39,18 +39,29 @@ import { JsonFormsAngularService } from '@jsonforms/angular';
|
|
|
39
39
|
@Component({
|
|
40
40
|
selector: 'VerticalLayoutRenderer',
|
|
41
41
|
template: `
|
|
42
|
-
<div
|
|
42
|
+
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="vertical-layout">
|
|
43
43
|
<div
|
|
44
44
|
*ngFor="
|
|
45
45
|
let props of uischema | layoutChildrenRenderProps : schema : path;
|
|
46
46
|
trackBy: trackElement
|
|
47
47
|
"
|
|
48
|
-
fxFlex
|
|
49
48
|
>
|
|
50
49
|
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
|
|
51
50
|
</div>
|
|
52
51
|
</div>
|
|
53
52
|
`,
|
|
53
|
+
styles: [
|
|
54
|
+
`
|
|
55
|
+
.vertical-layout {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 16px;
|
|
59
|
+
}
|
|
60
|
+
.vertical-layout > div {
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
],
|
|
54
65
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
66
|
})
|
|
56
67
|
export class VerticalLayoutRenderer extends LayoutRenderer<VerticalLayout> {
|
package/src/module.ts
CHANGED
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
import { CommonModule } from '@angular/common';
|
|
26
|
-
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
27
26
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
28
27
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
29
28
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -81,7 +80,6 @@ import { LayoutChildrenRenderPropsPipe } from './layouts';
|
|
|
81
80
|
MatSidenavModule,
|
|
82
81
|
MatListModule,
|
|
83
82
|
ReactiveFormsModule,
|
|
84
|
-
FlexLayoutModule,
|
|
85
83
|
MatCardModule,
|
|
86
84
|
MatSelectModule,
|
|
87
85
|
MatButtonModule,
|
|
@@ -127,7 +125,6 @@ import { LayoutChildrenRenderPropsPipe } from './layouts';
|
|
|
127
125
|
MatSidenavModule,
|
|
128
126
|
MatListModule,
|
|
129
127
|
ReactiveFormsModule,
|
|
130
|
-
FlexLayoutModule,
|
|
131
128
|
MatCardModule,
|
|
132
129
|
MatSelectModule,
|
|
133
130
|
MatButtonModule,
|
|
@@ -40,7 +40,14 @@ import { Subscription } from 'rxjs';
|
|
|
40
40
|
|
|
41
41
|
@Component({
|
|
42
42
|
selector: 'LabelRenderer',
|
|
43
|
-
template: ` <label class="mat-headline-6"
|
|
43
|
+
template: ` <label class="mat-headline-6"> {{ label }} </label> `,
|
|
44
|
+
styles: [
|
|
45
|
+
`
|
|
46
|
+
:host {
|
|
47
|
+
flex: 1 1 auto;
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
],
|
|
44
51
|
})
|
|
45
52
|
export class LabelRenderer
|
|
46
53
|
extends JsonFormsBaseRenderer<LabelElement>
|
|
@@ -66,7 +66,10 @@ export const removeSchemaKeywords = (path: string) => {
|
|
|
66
66
|
@Component({
|
|
67
67
|
selector: 'jsonforms-list-with-detail-master',
|
|
68
68
|
template: `
|
|
69
|
-
<mat-sidenav-container
|
|
69
|
+
<mat-sidenav-container
|
|
70
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
71
|
+
class="container"
|
|
72
|
+
>
|
|
70
73
|
<mat-sidenav mode="side" opened>
|
|
71
74
|
<mat-nav-list>
|
|
72
75
|
<mat-list-item *ngIf="masterItems.length === 0">{{
|
|
@@ -140,9 +143,6 @@ export const removeSchemaKeywords = (path: string) => {
|
|
|
140
143
|
top: 0;
|
|
141
144
|
right: 0;
|
|
142
145
|
}
|
|
143
|
-
.hide {
|
|
144
|
-
display: none;
|
|
145
|
-
}
|
|
146
146
|
.show {
|
|
147
147
|
display: inline-block;
|
|
148
148
|
}
|
|
@@ -45,7 +45,7 @@ import { cloneDeep } from 'lodash';
|
|
|
45
45
|
@Component({
|
|
46
46
|
selector: 'ObjectRenderer',
|
|
47
47
|
template: `
|
|
48
|
-
<mat-card appearance="outlined">
|
|
48
|
+
<mat-card class="object-layout" appearance="outlined">
|
|
49
49
|
<jsonforms-outlet
|
|
50
50
|
[uischema]="detailUiSchema"
|
|
51
51
|
[schema]="scopedSchema"
|
|
@@ -54,6 +54,13 @@ import { cloneDeep } from 'lodash';
|
|
|
54
54
|
</jsonforms-outlet>
|
|
55
55
|
</mat-card>
|
|
56
56
|
`,
|
|
57
|
+
styles: [
|
|
58
|
+
`
|
|
59
|
+
.object-layout {
|
|
60
|
+
padding: 16px;
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
],
|
|
57
64
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
58
65
|
})
|
|
59
66
|
export class ObjectControlRenderer extends JsonFormsControlWithDetail {
|