@jsonforms/angular-material 3.2.0-alpha.4 → 3.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/LICENSE +22 -0
- package/lib/README.md +137 -0
- package/lib/esm2022/jsonforms-angular-material.mjs +5 -0
- package/lib/esm2022/library/controls/autocomplete.renderer.mjs +171 -0
- package/lib/esm2022/library/controls/boolean.renderer.mjs +84 -0
- package/lib/esm2022/library/controls/date.renderer.mjs +93 -0
- package/lib/esm2022/library/controls/index.mjs +33 -0
- package/lib/esm2022/library/controls/number.renderer.mjs +173 -0
- package/lib/esm2022/library/controls/range.renderer.mjs +104 -0
- package/lib/esm2022/library/controls/text.renderer.mjs +98 -0
- package/lib/esm2022/library/controls/textarea.renderer.mjs +80 -0
- package/lib/esm2022/library/controls/toggle.renderer.mjs +86 -0
- package/lib/esm2022/library/index.mjs +69 -0
- package/lib/esm2022/library/layouts/array-layout.renderer.mjs +259 -0
- package/lib/esm2022/library/layouts/categorization-layout.renderer.mjs +105 -0
- package/lib/esm2022/library/layouts/group-layout.renderer.mjs +78 -0
- package/lib/esm2022/library/layouts/horizontal-layout.renderer.mjs +73 -0
- package/lib/esm2022/library/layouts/index.mjs +30 -0
- package/lib/esm2022/library/layouts/layout.renderer.mjs +86 -0
- package/lib/esm2022/library/layouts/vertical-layout.renderer.mjs +67 -0
- package/lib/esm2022/library/module.mjs +239 -0
- package/lib/esm2022/library/other/index.mjs +29 -0
- package/lib/esm2022/library/other/label.renderer.mjs +61 -0
- package/lib/esm2022/library/other/master-detail/detail.mjs +59 -0
- package/lib/esm2022/library/other/master-detail/index.mjs +27 -0
- package/lib/esm2022/library/other/master-detail/master.mjs +250 -0
- package/lib/esm2022/library/other/object.renderer.mjs +84 -0
- package/lib/esm2022/library/other/table.renderer.mjs +314 -0
- package/lib/esm2022/public_api.mjs +2 -0
- package/lib/fesm2022/jsonforms-angular-material.mjs +2564 -0
- package/lib/fesm2022/jsonforms-angular-material.mjs.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/jsonforms-angular-material.d.ts.map +1 -0
- package/lib/{cjs → library}/controls/autocomplete.renderer.d.ts +3 -3
- package/lib/library/controls/autocomplete.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/controls/boolean.renderer.d.ts +1 -0
- package/lib/library/controls/boolean.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/controls/date.renderer.d.ts +1 -0
- package/lib/library/controls/date.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/controls/index.d.ts +1 -0
- package/lib/library/controls/index.d.ts.map +1 -0
- package/lib/{esm → library}/controls/number.renderer.d.ts +1 -0
- package/lib/library/controls/number.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/controls/range.renderer.d.ts +2 -1
- package/lib/library/controls/range.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/controls/text.renderer.d.ts +1 -0
- package/lib/library/controls/text.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/controls/textarea.renderer.d.ts +1 -0
- package/lib/library/controls/textarea.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/controls/toggle.renderer.d.ts +1 -0
- package/lib/library/controls/toggle.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/index.d.ts +1 -0
- package/lib/library/index.d.ts.map +1 -0
- package/lib/{esm → library}/layouts/array-layout.renderer.d.ts +1 -0
- package/lib/library/layouts/array-layout.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/layouts/categorization-layout.renderer.d.ts +1 -0
- package/lib/library/layouts/categorization-layout.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/layouts/group-layout.renderer.d.ts +1 -0
- package/lib/library/layouts/group-layout.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/layouts/horizontal-layout.renderer.d.ts +1 -0
- package/lib/library/layouts/horizontal-layout.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/layouts/index.d.ts +1 -0
- package/lib/library/layouts/index.d.ts.map +1 -0
- package/lib/{esm → library}/layouts/layout.renderer.d.ts +1 -0
- package/lib/library/layouts/layout.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/layouts/vertical-layout.renderer.d.ts +1 -0
- package/lib/library/layouts/vertical-layout.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/module.d.ts +11 -11
- package/lib/library/module.d.ts.map +1 -0
- package/lib/{esm → library}/other/index.d.ts +1 -0
- package/lib/library/other/index.d.ts.map +1 -0
- package/lib/{esm → library}/other/label.renderer.d.ts +1 -0
- package/lib/library/other/label.renderer.d.ts.map +1 -0
- package/lib/{esm → library}/other/master-detail/detail.d.ts +2 -1
- package/lib/library/other/master-detail/detail.d.ts.map +1 -0
- package/lib/{cjs → library}/other/master-detail/index.d.ts +1 -0
- package/lib/library/other/master-detail/index.d.ts.map +1 -0
- package/lib/{esm → library}/other/master-detail/master.d.ts +1 -0
- package/lib/library/other/master-detail/master.d.ts.map +1 -0
- package/lib/{esm → library}/other/object.renderer.d.ts +1 -0
- package/lib/library/other/object.renderer.d.ts.map +1 -0
- package/lib/{cjs → library}/other/table.renderer.d.ts +1 -0
- package/lib/library/other/table.renderer.d.ts.map +1 -0
- package/lib/package.json +75 -0
- package/lib/public_api.d.ts +2 -0
- package/lib/public_api.d.ts.map +1 -0
- package/package.json +40 -53
- package/src/index.ts +1 -121
- package/src/{controls → library/controls}/autocomplete.renderer.ts +13 -3
- package/src/{controls → library/controls}/boolean.renderer.ts +16 -6
- package/src/{controls → library/controls}/date.renderer.ts +12 -1
- package/src/{controls → library/controls}/number.renderer.ts +12 -1
- package/src/{controls → library/controls}/range.renderer.ts +16 -3
- package/src/{controls → library/controls}/text.renderer.ts +12 -1
- package/src/{controls → library/controls}/textarea.renderer.ts +12 -1
- package/src/{controls → library/controls}/toggle.renderer.ts +1 -1
- package/src/library/index.ts +121 -0
- package/src/{layouts → library/layouts}/array-layout.renderer.ts +21 -12
- package/src/{layouts → library/layouts}/categorization-layout.renderer.ts +4 -1
- package/src/{layouts → library/layouts}/group-layout.renderer.ts +18 -2
- package/src/{layouts → library/layouts}/horizontal-layout.renderer.ts +16 -5
- package/src/{layouts → library/layouts}/vertical-layout.renderer.ts +13 -2
- package/src/{module.ts → library/module.ts} +0 -3
- package/src/{other → library/other}/label.renderer.ts +8 -1
- package/src/{other → library/other}/master-detail/master.ts +4 -4
- package/src/{other → library/other}/object.renderer.ts +8 -1
- package/src/public_api.ts +1 -0
- package/lib/cjs/controls/autocomplete.renderer.js +0 -122
- package/lib/cjs/controls/autocomplete.renderer.js.map +0 -1
- package/lib/cjs/controls/boolean.renderer.d.ts +0 -14
- package/lib/cjs/controls/boolean.renderer.js +0 -67
- package/lib/cjs/controls/boolean.renderer.js.map +0 -1
- package/lib/cjs/controls/date.renderer.js +0 -63
- package/lib/cjs/controls/date.renderer.js.map +0 -1
- package/lib/cjs/controls/index.js +0 -36
- package/lib/cjs/controls/index.js.map +0 -1
- package/lib/cjs/controls/number.renderer.d.ts +0 -23
- package/lib/cjs/controls/number.renderer.js +0 -140
- package/lib/cjs/controls/number.renderer.js.map +0 -1
- package/lib/cjs/controls/range.renderer.d.ts +0 -17
- package/lib/cjs/controls/range.renderer.js +0 -70
- package/lib/cjs/controls/range.renderer.js.map +0 -1
- package/lib/cjs/controls/text.renderer.d.ts +0 -12
- package/lib/cjs/controls/text.renderer.js +0 -78
- package/lib/cjs/controls/text.renderer.js.map +0 -1
- package/lib/cjs/controls/textarea.renderer.d.ts +0 -11
- package/lib/cjs/controls/textarea.renderer.js +0 -62
- package/lib/cjs/controls/textarea.renderer.js.map +0 -1
- package/lib/cjs/controls/toggle.renderer.js +0 -64
- package/lib/cjs/controls/toggle.renderer.js.map +0 -1
- package/lib/cjs/index.js +0 -73
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/layouts/array-layout.renderer.d.ts +0 -29
- package/lib/cjs/layouts/array-layout.renderer.js +0 -103
- package/lib/cjs/layouts/array-layout.renderer.js.map +0 -1
- package/lib/cjs/layouts/categorization-layout.renderer.d.ts +0 -17
- package/lib/cjs/layouts/categorization-layout.renderer.js +0 -78
- package/lib/cjs/layouts/categorization-layout.renderer.js.map +0 -1
- package/lib/cjs/layouts/group-layout.renderer.js +0 -59
- package/lib/cjs/layouts/group-layout.renderer.js.map +0 -1
- package/lib/cjs/layouts/horizontal-layout.renderer.d.ts +0 -11
- package/lib/cjs/layouts/horizontal-layout.renderer.js +0 -58
- package/lib/cjs/layouts/horizontal-layout.renderer.js.map +0 -1
- package/lib/cjs/layouts/index.d.ts +0 -5
- package/lib/cjs/layouts/index.js +0 -33
- package/lib/cjs/layouts/index.js.map +0 -1
- package/lib/cjs/layouts/layout.renderer.d.ts +0 -22
- package/lib/cjs/layouts/layout.renderer.js +0 -94
- package/lib/cjs/layouts/layout.renderer.js.map +0 -1
- package/lib/cjs/layouts/vertical-layout.renderer.js +0 -58
- package/lib/cjs/layouts/vertical-layout.renderer.js.map +0 -1
- package/lib/cjs/module.js +0 -254
- package/lib/cjs/module.js.map +0 -1
- package/lib/cjs/other/index.d.ts +0 -4
- package/lib/cjs/other/index.js +0 -32
- package/lib/cjs/other/index.js.map +0 -1
- package/lib/cjs/other/label.renderer.d.ts +0 -16
- package/lib/cjs/other/label.renderer.js +0 -70
- package/lib/cjs/other/label.renderer.js.map +0 -1
- package/lib/cjs/other/master-detail/detail.d.ts +0 -9
- package/lib/cjs/other/master-detail/detail.js +0 -61
- package/lib/cjs/other/master-detail/detail.js.map +0 -1
- package/lib/cjs/other/master-detail/index.js +0 -30
- package/lib/cjs/other/master-detail/index.js.map +0 -1
- package/lib/cjs/other/master-detail/master.d.ts +0 -27
- package/lib/cjs/other/master-detail/master.js +0 -153
- package/lib/cjs/other/master-detail/master.js.map +0 -1
- package/lib/cjs/other/object.renderer.d.ts +0 -11
- package/lib/cjs/other/object.renderer.js +0 -77
- package/lib/cjs/other/object.renderer.js.map +0 -1
- package/lib/cjs/other/table.renderer.js +0 -147
- package/lib/cjs/other/table.renderer.js.map +0 -1
- package/lib/esm/controls/autocomplete.renderer.d.ts +0 -49
- package/lib/esm/controls/autocomplete.renderer.js +0 -119
- package/lib/esm/controls/autocomplete.renderer.js.map +0 -1
- package/lib/esm/controls/boolean.renderer.js +0 -64
- package/lib/esm/controls/boolean.renderer.js.map +0 -1
- package/lib/esm/controls/date.renderer.d.ts +0 -11
- package/lib/esm/controls/date.renderer.js +0 -60
- package/lib/esm/controls/date.renderer.js.map +0 -1
- package/lib/esm/controls/index.d.ts +0 -8
- package/lib/esm/controls/index.js +0 -33
- package/lib/esm/controls/index.js.map +0 -1
- package/lib/esm/controls/number.renderer.js +0 -137
- package/lib/esm/controls/number.renderer.js.map +0 -1
- package/lib/esm/controls/range.renderer.js +0 -67
- package/lib/esm/controls/range.renderer.js.map +0 -1
- package/lib/esm/controls/text.renderer.js +0 -75
- package/lib/esm/controls/text.renderer.js.map +0 -1
- package/lib/esm/controls/textarea.renderer.js +0 -59
- package/lib/esm/controls/textarea.renderer.js.map +0 -1
- package/lib/esm/controls/toggle.renderer.d.ts +0 -14
- package/lib/esm/controls/toggle.renderer.js +0 -61
- package/lib/esm/controls/toggle.renderer.js.map +0 -1
- package/lib/esm/index.d.ts +0 -10
- package/lib/esm/index.js +0 -69
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/layouts/array-layout.renderer.js +0 -100
- package/lib/esm/layouts/array-layout.renderer.js.map +0 -1
- package/lib/esm/layouts/categorization-layout.renderer.js +0 -75
- package/lib/esm/layouts/categorization-layout.renderer.js.map +0 -1
- package/lib/esm/layouts/group-layout.renderer.d.ts +0 -11
- package/lib/esm/layouts/group-layout.renderer.js +0 -56
- package/lib/esm/layouts/group-layout.renderer.js.map +0 -1
- package/lib/esm/layouts/horizontal-layout.renderer.js +0 -55
- package/lib/esm/layouts/horizontal-layout.renderer.js.map +0 -1
- package/lib/esm/layouts/index.js +0 -30
- package/lib/esm/layouts/index.js.map +0 -1
- package/lib/esm/layouts/layout.renderer.js +0 -91
- package/lib/esm/layouts/layout.renderer.js.map +0 -1
- package/lib/esm/layouts/vertical-layout.renderer.d.ts +0 -11
- package/lib/esm/layouts/vertical-layout.renderer.js +0 -55
- package/lib/esm/layouts/vertical-layout.renderer.js.map +0 -1
- package/lib/esm/module.d.ts +0 -48
- package/lib/esm/module.js +0 -250
- package/lib/esm/module.js.map +0 -1
- package/lib/esm/other/index.js +0 -29
- package/lib/esm/other/index.js.map +0 -1
- package/lib/esm/other/label.renderer.js +0 -67
- package/lib/esm/other/label.renderer.js.map +0 -1
- package/lib/esm/other/master-detail/detail.js +0 -57
- package/lib/esm/other/master-detail/detail.js.map +0 -1
- package/lib/esm/other/master-detail/index.d.ts +0 -2
- package/lib/esm/other/master-detail/index.js +0 -27
- package/lib/esm/other/master-detail/index.js.map +0 -1
- package/lib/esm/other/master-detail/master.js +0 -149
- package/lib/esm/other/master-detail/master.js.map +0 -1
- package/lib/esm/other/object.renderer.js +0 -74
- package/lib/esm/other/object.renderer.js.map +0 -1
- package/lib/esm/other/table.renderer.d.ts +0 -36
- package/lib/esm/other/table.renderer.js +0 -143
- package/lib/esm/other/table.renderer.js.map +0 -1
- /package/src/{controls → library/controls}/index.ts +0 -0
- /package/src/{layouts → library/layouts}/index.ts +0 -0
- /package/src/{layouts → library/layouts}/layout.renderer.ts +0 -0
- /package/src/{other → library/other}/index.ts +0 -0
- /package/src/{other → library/other}/master-detail/detail.ts +0 -0
- /package/src/{other → library/other}/master-detail/index.ts +0 -0
- /package/src/{other → library/other}/table.renderer.ts +0 -0
- /package/src/{other → library/other}/util.ts +0 -0
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { __assign, __extends } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
import some from 'lodash/some';
|
|
27
|
-
import get from 'lodash/get';
|
|
28
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, } from '@angular/core';
|
|
29
|
-
import { JsonFormsAngularService, JsonFormsArrayControl, } from '@jsonforms/angular';
|
|
30
|
-
import { createDefaultValue, decode, findUISchema, getFirstPrimitiveProp, mapDispatchToArrayControlProps, mapStateToArrayControlProps, rankWith, setReadonly, uiTypeIs, } from '@jsonforms/core';
|
|
31
|
-
import * as i0 from "@angular/core";
|
|
32
|
-
import * as i1 from "@jsonforms/angular";
|
|
33
|
-
import * as i2 from "@angular/common";
|
|
34
|
-
import * as i3 from "@angular/material/sidenav";
|
|
35
|
-
import * as i4 from "@angular/material/list";
|
|
36
|
-
import * as i5 from "@angular/flex-layout/extended";
|
|
37
|
-
import * as i6 from "@angular/material/button";
|
|
38
|
-
import * as i7 from "@angular/material/icon";
|
|
39
|
-
import * as i8 from "./detail";
|
|
40
|
-
var keywords = ['#', 'properties', 'items'];
|
|
41
|
-
export var removeSchemaKeywords = function (path) {
|
|
42
|
-
return decode(path
|
|
43
|
-
.split('/')
|
|
44
|
-
.filter(function (s) { return !some(keywords, function (key) { return key === s; }); })
|
|
45
|
-
.join('.'));
|
|
46
|
-
};
|
|
47
|
-
var MasterListComponent = /** @class */ (function (_super) {
|
|
48
|
-
__extends(MasterListComponent, _super);
|
|
49
|
-
function MasterListComponent(jsonformsService, changeDetectorRef) {
|
|
50
|
-
var _this = _super.call(this, jsonformsService) || this;
|
|
51
|
-
_this.changeDetectorRef = changeDetectorRef;
|
|
52
|
-
return _this;
|
|
53
|
-
}
|
|
54
|
-
MasterListComponent.prototype.onListItemHover = function (idx) {
|
|
55
|
-
this.highlightedIdx = idx;
|
|
56
|
-
};
|
|
57
|
-
MasterListComponent.prototype.trackElement = function (_index, element) {
|
|
58
|
-
return element ? element.label : null;
|
|
59
|
-
};
|
|
60
|
-
MasterListComponent.prototype.ngOnInit = function () {
|
|
61
|
-
_super.prototype.ngOnInit.call(this);
|
|
62
|
-
var dispatch = this.jsonFormsService.updateCore.bind(this.jsonFormsService);
|
|
63
|
-
var _a = mapDispatchToArrayControlProps(dispatch), addItem = _a.addItem, removeItems = _a.removeItems;
|
|
64
|
-
this.addItem = addItem;
|
|
65
|
-
this.removeItems = removeItems;
|
|
66
|
-
};
|
|
67
|
-
MasterListComponent.prototype.mapAdditionalProps = function (props) {
|
|
68
|
-
var data = props.data, path = props.path, schema = props.schema, uischema = props.uischema;
|
|
69
|
-
var controlElement = uischema;
|
|
70
|
-
this.propsPath = props.path;
|
|
71
|
-
var detailUISchema = findUISchema(props.uischemas, schema, "".concat(controlElement.scope, "/items"), props.path, 'VerticalLayout', controlElement, props.rootSchema);
|
|
72
|
-
if (!this.isEnabled()) {
|
|
73
|
-
setReadonly(detailUISchema);
|
|
74
|
-
}
|
|
75
|
-
this.translations = props.translations;
|
|
76
|
-
var masterItems = (data || []).map(function (d, index) {
|
|
77
|
-
var _a;
|
|
78
|
-
var labelRefInstancePath = ((_a = controlElement.options) === null || _a === void 0 ? void 0 : _a.labelRef) &&
|
|
79
|
-
removeSchemaKeywords(controlElement.options.labelRef);
|
|
80
|
-
var isPrimitive = d !== undefined && typeof d !== 'object';
|
|
81
|
-
var masterItem = {
|
|
82
|
-
label: isPrimitive
|
|
83
|
-
? d.toString()
|
|
84
|
-
: get(d, labelRefInstancePath !== null && labelRefInstancePath !== void 0 ? labelRefInstancePath : getFirstPrimitiveProp(schema)),
|
|
85
|
-
data: d,
|
|
86
|
-
path: "".concat(path, ".").concat(index),
|
|
87
|
-
schema: schema,
|
|
88
|
-
uischema: detailUISchema,
|
|
89
|
-
};
|
|
90
|
-
return masterItem;
|
|
91
|
-
});
|
|
92
|
-
this.masterItems = masterItems;
|
|
93
|
-
var newSelectedIdx = -1;
|
|
94
|
-
var newSelectedItem;
|
|
95
|
-
if (this.masterItems.length === 0) {
|
|
96
|
-
// unset select if no elements anymore
|
|
97
|
-
this.selectedItem = undefined;
|
|
98
|
-
this.selectedItemIdx = -1;
|
|
99
|
-
}
|
|
100
|
-
else if (this.selectedItemIdx >= this.masterItems.length) {
|
|
101
|
-
// the previous index is to high, reduce it to the maximal possible
|
|
102
|
-
newSelectedIdx = this.masterItems.length - 1;
|
|
103
|
-
newSelectedItem = this.masterItems[newSelectedIdx];
|
|
104
|
-
}
|
|
105
|
-
else if (this.selectedItemIdx !== -1 &&
|
|
106
|
-
this.selectedItemIdx < this.masterItems.length) {
|
|
107
|
-
newSelectedIdx = this.selectedItemIdx;
|
|
108
|
-
newSelectedItem = this.masterItems[this.selectedItemIdx];
|
|
109
|
-
}
|
|
110
|
-
if (newSelectedItem !== undefined &&
|
|
111
|
-
this.selectedItem !== undefined &&
|
|
112
|
-
(newSelectedItem.label === this.selectedItem.label ||
|
|
113
|
-
newSelectedItem.path === this.selectedItem.path)) {
|
|
114
|
-
// after checking that we are on the same path, set selection
|
|
115
|
-
this.selectedItem = newSelectedItem;
|
|
116
|
-
this.selectedItemIdx = newSelectedIdx;
|
|
117
|
-
}
|
|
118
|
-
else if (this.masterItems.length > 0) {
|
|
119
|
-
// pre-select 1st entry if the previous selected element as fallback
|
|
120
|
-
this.selectedItem = this.masterItems[0];
|
|
121
|
-
this.selectedItemIdx = 0;
|
|
122
|
-
}
|
|
123
|
-
this.changeDetectorRef.markForCheck();
|
|
124
|
-
};
|
|
125
|
-
MasterListComponent.prototype.onSelect = function (item, idx) {
|
|
126
|
-
this.selectedItem = item;
|
|
127
|
-
this.selectedItemIdx = idx;
|
|
128
|
-
};
|
|
129
|
-
MasterListComponent.prototype.onAddClick = function () {
|
|
130
|
-
this.addItem(this.propsPath, createDefaultValue(this.scopedSchema, this.rootSchema))();
|
|
131
|
-
};
|
|
132
|
-
MasterListComponent.prototype.onDeleteClick = function (item) {
|
|
133
|
-
this.removeItems(this.propsPath, [item])();
|
|
134
|
-
};
|
|
135
|
-
MasterListComponent.prototype.mapToProps = function (state) {
|
|
136
|
-
var props = mapStateToArrayControlProps(state, this.getOwnProps());
|
|
137
|
-
return __assign({}, props);
|
|
138
|
-
};
|
|
139
|
-
MasterListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MasterListComponent, deps: [{ token: i1.JsonFormsAngularService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
140
|
-
MasterListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MasterListComponent, selector: "jsonforms-list-with-detail-master", usesInheritance: true, ngImport: i0, template: "\n <mat-sidenav-container class=\"container\" [fxHide]=\"hidden\">\n <mat-sidenav mode=\"side\" opened>\n <mat-nav-list>\n <mat-list-item *ngIf=\"masterItems.length === 0\">{{\n translations.noDataMessage\n }}</mat-list-item>\n <mat-list-item\n *ngFor=\"\n let item of masterItems;\n let i = index;\n trackBy: trackElement\n \"\n [class.selected]=\"item === selectedItem\"\n (click)=\"onSelect(item, i)\"\n (mouseover)=\"onListItemHover(i)\"\n (mouseout)=\"onListItemHover(undefined)\"\n >\n <a matLine>{{ item.label || 'No label set' }}</a>\n <button\n mat-icon-button\n class=\"button item-button hide\"\n (click)=\"onDeleteClick(i)\"\n [ngClass]=\"{ show: highlightedIdx == i }\"\n *ngIf=\"isEnabled()\"\n >\n <mat-icon mat-list-icon>delete</mat-icon>\n </button>\n </mat-list-item>\n </mat-nav-list>\n <button\n mat-fab\n color=\"primary\"\n class=\"add-button\"\n (click)=\"onAddClick()\"\n *ngIf=\"isEnabled()\"\n >\n <mat-icon [attr.aria-label]=\"translations.addAriaLabel\">add</mat-icon>\n </button>\n </mat-sidenav>\n <mat-sidenav-content class=\"content\">\n <jsonforms-detail\n *ngIf=\"selectedItem\"\n [item]=\"selectedItem\"\n ></jsonforms-detail>\n </mat-sidenav-content>\n </mat-sidenav-container>\n ", isInline: true, styles: ["\n /* TODO(mdc-migration): The following rule targets internal classes of list that may no longer apply for the MDC version. */\n mat-list-item.selected {\n background: rgba(0, 0, 0, 0.04);\n }\n .container {\n height: 100vh;\n }\n .content {\n padding: 15px;\n background-color: #fff;\n }\n .add-button {\n float: right;\n margin-top: 0.5em;\n margin-right: 0.25em;\n }\n .button {\n float: right;\n margin-right: 0.25em;\n }\n .item-button {\n position: absolute;\n top: 0;\n right: 0;\n }\n .hide {\n display: none;\n }\n .show {\n display: inline-block;\n }\n mat-sidenav {\n width: 20%;\n }\n "], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i3.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i3.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "component", type: i4.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i5.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "directive", type: i5.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: i6.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatFabButton, selector: "button[mat-fab]", inputs: ["disabled", "disableRipple", "color", "tabIndex", "extended"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.JsonFormsDetailComponent, selector: "jsonforms-detail", inputs: ["item"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
141
|
-
return MasterListComponent;
|
|
142
|
-
}(JsonFormsArrayControl));
|
|
143
|
-
export { MasterListComponent };
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MasterListComponent, decorators: [{
|
|
145
|
-
type: Component,
|
|
146
|
-
args: [{ selector: 'jsonforms-list-with-detail-master', template: "\n <mat-sidenav-container class=\"container\" [fxHide]=\"hidden\">\n <mat-sidenav mode=\"side\" opened>\n <mat-nav-list>\n <mat-list-item *ngIf=\"masterItems.length === 0\">{{\n translations.noDataMessage\n }}</mat-list-item>\n <mat-list-item\n *ngFor=\"\n let item of masterItems;\n let i = index;\n trackBy: trackElement\n \"\n [class.selected]=\"item === selectedItem\"\n (click)=\"onSelect(item, i)\"\n (mouseover)=\"onListItemHover(i)\"\n (mouseout)=\"onListItemHover(undefined)\"\n >\n <a matLine>{{ item.label || 'No label set' }}</a>\n <button\n mat-icon-button\n class=\"button item-button hide\"\n (click)=\"onDeleteClick(i)\"\n [ngClass]=\"{ show: highlightedIdx == i }\"\n *ngIf=\"isEnabled()\"\n >\n <mat-icon mat-list-icon>delete</mat-icon>\n </button>\n </mat-list-item>\n </mat-nav-list>\n <button\n mat-fab\n color=\"primary\"\n class=\"add-button\"\n (click)=\"onAddClick()\"\n *ngIf=\"isEnabled()\"\n >\n <mat-icon [attr.aria-label]=\"translations.addAriaLabel\">add</mat-icon>\n </button>\n </mat-sidenav>\n <mat-sidenav-content class=\"content\">\n <jsonforms-detail\n *ngIf=\"selectedItem\"\n [item]=\"selectedItem\"\n ></jsonforms-detail>\n </mat-sidenav-content>\n </mat-sidenav-container>\n ", changeDetection: ChangeDetectionStrategy.OnPush, styles: ["\n /* TODO(mdc-migration): The following rule targets internal classes of list that may no longer apply for the MDC version. */\n mat-list-item.selected {\n background: rgba(0, 0, 0, 0.04);\n }\n .container {\n height: 100vh;\n }\n .content {\n padding: 15px;\n background-color: #fff;\n }\n .add-button {\n float: right;\n margin-top: 0.5em;\n margin-right: 0.25em;\n }\n .button {\n float: right;\n margin-right: 0.25em;\n }\n .item-button {\n position: absolute;\n top: 0;\n right: 0;\n }\n .hide {\n display: none;\n }\n .show {\n display: inline-block;\n }\n mat-sidenav {\n width: 20%;\n }\n "] }]
|
|
147
|
-
}], ctorParameters: function () { return [{ type: i1.JsonFormsAngularService }, { type: i0.ChangeDetectorRef }]; } });
|
|
148
|
-
export var masterDetailTester = rankWith(4, uiTypeIs('ListWithDetail'));
|
|
149
|
-
//# sourceMappingURL=master.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"master.js","sourceRoot":"","sources":["../../../../src/other/master-detail/master.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SA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|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
import isEmpty from 'lodash/isEmpty';
|
|
27
|
-
import startCase from 'lodash/startCase';
|
|
28
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
29
|
-
import { JsonFormsAngularService, JsonFormsControlWithDetail, } from '@jsonforms/angular';
|
|
30
|
-
import { findUISchema, Generate, isObjectControl, rankWith, setReadonly, } from '@jsonforms/core';
|
|
31
|
-
import { cloneDeep } from 'lodash';
|
|
32
|
-
import * as i0 from "@angular/core";
|
|
33
|
-
import * as i1 from "@jsonforms/angular";
|
|
34
|
-
import * as i2 from "@angular/material/card";
|
|
35
|
-
var ObjectControlRenderer = /** @class */ (function (_super) {
|
|
36
|
-
__extends(ObjectControlRenderer, _super);
|
|
37
|
-
function ObjectControlRenderer(jsonformsService) {
|
|
38
|
-
return _super.call(this, jsonformsService) || this;
|
|
39
|
-
}
|
|
40
|
-
ObjectControlRenderer.prototype.mapAdditionalProps = function (props) {
|
|
41
|
-
var _this = this;
|
|
42
|
-
this.detailUiSchema = findUISchema(props.uischemas, props.schema, props.uischema.scope, props.path, function () {
|
|
43
|
-
var newSchema = cloneDeep(props.schema);
|
|
44
|
-
// delete unsupported operators
|
|
45
|
-
delete newSchema.oneOf;
|
|
46
|
-
delete newSchema.anyOf;
|
|
47
|
-
delete newSchema.allOf;
|
|
48
|
-
return Generate.uiSchema(newSchema, 'Group', undefined, _this.rootSchema);
|
|
49
|
-
}, props.uischema, props.rootSchema);
|
|
50
|
-
if (isEmpty(props.path)) {
|
|
51
|
-
this.detailUiSchema.type = 'VerticalLayout';
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.detailUiSchema.label = startCase(props.path);
|
|
55
|
-
}
|
|
56
|
-
if (!this.isEnabled()) {
|
|
57
|
-
setReadonly(this.detailUiSchema);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
ObjectControlRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ObjectControlRenderer, deps: [{ token: i1.JsonFormsAngularService }], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
-
ObjectControlRenderer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ObjectControlRenderer, selector: "ObjectRenderer", usesInheritance: true, ngImport: i0, template: "\n <mat-card appearance=\"outlined\">\n <jsonforms-outlet\n [uischema]=\"detailUiSchema\"\n [schema]=\"scopedSchema\"\n [path]=\"propsPath\"\n >\n </jsonforms-outlet>\n </mat-card>\n ", isInline: true, dependencies: [{ kind: "directive", type: i1.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "component", type: i2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
62
|
-
return ObjectControlRenderer;
|
|
63
|
-
}(JsonFormsControlWithDetail));
|
|
64
|
-
export { ObjectControlRenderer };
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ObjectControlRenderer, decorators: [{
|
|
66
|
-
type: Component,
|
|
67
|
-
args: [{
|
|
68
|
-
selector: 'ObjectRenderer',
|
|
69
|
-
template: "\n <mat-card appearance=\"outlined\">\n <jsonforms-outlet\n [uischema]=\"detailUiSchema\"\n [schema]=\"scopedSchema\"\n [path]=\"propsPath\"\n >\n </jsonforms-outlet>\n </mat-card>\n ",
|
|
70
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
71
|
-
}]
|
|
72
|
-
}], ctorParameters: function () { return [{ type: i1.JsonFormsAngularService }]; } });
|
|
73
|
-
export var ObjectControlRendererTester = rankWith(2, isObjectControl);
|
|
74
|
-
//# sourceMappingURL=object.renderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object.renderer.js","sourceRoot":"","sources":["../../../src/other/object.renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,YAAY,EACZ,QAAQ,EAER,eA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T,QAAQ,EAAE,gBAAgB;oBAC1B,QAAQ,EAAE,oOAST;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;AAsCD,MAAM,CAAC,IAAM,2BAA2B,GAAiB,QAAQ,CAC/D,CAAC,EACD,eAAe,CAChB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { JsonFormsAngularService, JsonFormsArrayControl } from '@jsonforms/angular';
|
|
3
|
-
import { ArrayControlProps, ArrayTranslations, ControlElement, JsonSchema, OwnPropsOfRenderer, RankedTester, UISchemaElement } from '@jsonforms/core';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class TableRenderer extends JsonFormsArrayControl implements OnInit {
|
|
6
|
-
detailUiSchema: UISchemaElement;
|
|
7
|
-
displayedColumns: string[];
|
|
8
|
-
items: ColumnDescription[];
|
|
9
|
-
readonly columnsToIgnore: string[];
|
|
10
|
-
addItem: (path: string, value: any) => () => void;
|
|
11
|
-
moveItemUp: (path: string, index: number) => () => void;
|
|
12
|
-
moveItemDown: (path: string, index: number) => () => void;
|
|
13
|
-
removeItems: (path: string, toDelete: number[]) => () => void;
|
|
14
|
-
translations: ArrayTranslations;
|
|
15
|
-
constructor(jsonformsService: JsonFormsAngularService);
|
|
16
|
-
trackElement(index: number, _element: any): number;
|
|
17
|
-
mapAdditionalProps(props: ArrayControlProps): void;
|
|
18
|
-
getProps(index: number, props: OwnPropsOfRenderer): OwnPropsOfRenderer;
|
|
19
|
-
remove(index: number): void;
|
|
20
|
-
add(): void;
|
|
21
|
-
up(index: number): void;
|
|
22
|
-
down(index: number): void;
|
|
23
|
-
ngOnInit(): void;
|
|
24
|
-
generateCells: (schema: JsonSchema, rowPath: string) => ColumnDescription[];
|
|
25
|
-
getValidColumnProps: (scopedSchema: JsonSchema) => string[];
|
|
26
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TableRenderer, never>;
|
|
27
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableRenderer, "TableRenderer", never, {}, {}, never, never, false, never>;
|
|
28
|
-
}
|
|
29
|
-
export declare const TableRendererTester: RankedTester;
|
|
30
|
-
interface ColumnDescription {
|
|
31
|
-
property: string;
|
|
32
|
-
header: string;
|
|
33
|
-
props: OwnPropsOfRenderer;
|
|
34
|
-
}
|
|
35
|
-
export declare const controlWithoutLabel: (scope: string) => ControlElement;
|
|
36
|
-
export {};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
The MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2017-2019 EclipseSource Munich
|
|
6
|
-
https://github.com/eclipsesource/jsonforms
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
-
in the Software without restriction, including without limitation the rights
|
|
11
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
furnished to do so, subject to the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be included in
|
|
16
|
-
all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
import startCase from 'lodash/startCase';
|
|
27
|
-
import { Component } from '@angular/core';
|
|
28
|
-
import { JsonFormsAngularService, JsonFormsArrayControl, } from '@jsonforms/angular';
|
|
29
|
-
import { createDefaultValue, deriveTypes, encode, isObjectArrayControl, isPrimitiveArrayControl, mapDispatchToArrayControlProps, or, Paths, rankWith, setReadonly, } from '@jsonforms/core';
|
|
30
|
-
import * as i0 from "@angular/core";
|
|
31
|
-
import * as i1 from "@jsonforms/angular";
|
|
32
|
-
import * as i2 from "@angular/common";
|
|
33
|
-
import * as i3 from "@angular/material/button";
|
|
34
|
-
import * as i4 from "@angular/material/icon";
|
|
35
|
-
import * as i5 from "@angular/material/table";
|
|
36
|
-
import * as i6 from "@angular/material/tooltip";
|
|
37
|
-
var TableRenderer = /** @class */ (function (_super) {
|
|
38
|
-
__extends(TableRenderer, _super);
|
|
39
|
-
function TableRenderer(jsonformsService) {
|
|
40
|
-
var _this = _super.call(this, jsonformsService) || this;
|
|
41
|
-
_this.columnsToIgnore = ['array', 'object'];
|
|
42
|
-
_this.generateCells = function (schema, rowPath) {
|
|
43
|
-
if (schema.type === 'object') {
|
|
44
|
-
return _this.getValidColumnProps(schema).map(function (prop) {
|
|
45
|
-
var encProp = encode(prop);
|
|
46
|
-
var uischema = controlWithoutLabel("#/properties/".concat(encProp));
|
|
47
|
-
if (!_this.isEnabled()) {
|
|
48
|
-
setReadonly(uischema);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
property: prop,
|
|
52
|
-
header: startCase(prop),
|
|
53
|
-
props: {
|
|
54
|
-
schema: schema,
|
|
55
|
-
uischema: uischema,
|
|
56
|
-
path: rowPath,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
// needed to correctly render input control for multi attributes
|
|
62
|
-
return [
|
|
63
|
-
{
|
|
64
|
-
property: 'DUMMY',
|
|
65
|
-
header: _this.label,
|
|
66
|
-
props: {
|
|
67
|
-
schema: schema,
|
|
68
|
-
uischema: controlWithoutLabel("#"),
|
|
69
|
-
path: rowPath,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
];
|
|
73
|
-
};
|
|
74
|
-
_this.getValidColumnProps = function (scopedSchema) {
|
|
75
|
-
if (scopedSchema.type === 'object') {
|
|
76
|
-
return Object.keys(scopedSchema.properties).filter(function (prop) {
|
|
77
|
-
var types = deriveTypes(scopedSchema.properties[prop]);
|
|
78
|
-
if (types.length > 1) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
return _this.columnsToIgnore.indexOf(types[0]) === -1;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
// primitives
|
|
85
|
-
return [''];
|
|
86
|
-
};
|
|
87
|
-
return _this;
|
|
88
|
-
}
|
|
89
|
-
TableRenderer.prototype.trackElement = function (index, _element) {
|
|
90
|
-
return index ? index : null;
|
|
91
|
-
};
|
|
92
|
-
TableRenderer.prototype.mapAdditionalProps = function (props) {
|
|
93
|
-
this.items = this.generateCells(props.schema, props.path);
|
|
94
|
-
this.displayedColumns = this.items.map(function (item) { return item.property; });
|
|
95
|
-
if (this.isEnabled()) {
|
|
96
|
-
this.displayedColumns.push('action');
|
|
97
|
-
}
|
|
98
|
-
this.translations = props.translations;
|
|
99
|
-
};
|
|
100
|
-
TableRenderer.prototype.getProps = function (index, props) {
|
|
101
|
-
var rowPath = Paths.compose(props.path, "".concat(index));
|
|
102
|
-
return {
|
|
103
|
-
schema: props.schema,
|
|
104
|
-
uischema: props.uischema,
|
|
105
|
-
path: rowPath,
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
TableRenderer.prototype.remove = function (index) {
|
|
109
|
-
this.removeItems(this.propsPath, [index])();
|
|
110
|
-
};
|
|
111
|
-
TableRenderer.prototype.add = function () {
|
|
112
|
-
this.addItem(this.propsPath, createDefaultValue(this.scopedSchema, this.rootSchema))();
|
|
113
|
-
};
|
|
114
|
-
TableRenderer.prototype.up = function (index) {
|
|
115
|
-
this.moveItemUp(this.propsPath, index)();
|
|
116
|
-
};
|
|
117
|
-
TableRenderer.prototype.down = function (index) {
|
|
118
|
-
this.moveItemDown(this.propsPath, index)();
|
|
119
|
-
};
|
|
120
|
-
TableRenderer.prototype.ngOnInit = function () {
|
|
121
|
-
_super.prototype.ngOnInit.call(this);
|
|
122
|
-
var _a = mapDispatchToArrayControlProps(this.jsonFormsService.updateCore.bind(this.jsonFormsService)), addItem = _a.addItem, removeItems = _a.removeItems, moveUp = _a.moveUp, moveDown = _a.moveDown;
|
|
123
|
-
this.addItem = addItem;
|
|
124
|
-
this.moveItemUp = moveUp;
|
|
125
|
-
this.moveItemDown = moveDown;
|
|
126
|
-
this.removeItems = removeItems;
|
|
127
|
-
};
|
|
128
|
-
TableRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableRenderer, deps: [{ token: i1.JsonFormsAngularService }], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
-
TableRenderer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableRenderer, selector: "TableRenderer", usesInheritance: true, ngImport: i0, template: "\n <table\n mat-table\n [dataSource]=\"data\"\n class=\"mat-elevation-z8\"\n [trackBy]=\"trackElement\"\n >\n <ng-container matColumnDef=\"action\">\n <tr>\n <th mat-header-cell *matHeaderCellDef>\n <button\n mat-button\n color=\"primary\"\n (click)=\"add()\"\n [disabled]=\"!isEnabled()\"\n [matTooltip]=\"translations.addTooltip\"\n >\n <mat-icon>add</mat-icon>\n </button>\n </th>\n </tr>\n <tr>\n <td\n mat-cell\n *matCellDef=\"\n let row;\n let i = index;\n let first = first;\n let last = last\n \"\n >\n <button\n *ngIf=\"uischema?.options?.showSortButtons\"\n class=\"item-up\"\n mat-button\n [disabled]=\"first\"\n (click)=\"up(i)\"\n [matTooltip]=\"translations.upAriaLabel\"\n matTooltipPosition=\"right\"\n >\n <mat-icon>arrow_upward</mat-icon>\n </button>\n <button\n *ngIf=\"uischema?.options?.showSortButtons\"\n class=\"item-down\"\n mat-button\n [disabled]=\"last\"\n (click)=\"down(i)\"\n [matTooltip]=\"translations.downAriaLabel\"\n matTooltipPosition=\"right\"\n >\n <mat-icon>arrow_downward</mat-icon>\n </button>\n <button\n mat-button\n color=\"warn\"\n (click)=\"remove(i)\"\n [disabled]=\"!isEnabled()\"\n matTooltipPosition=\"right\"\n [matTooltip]=\"translations.removeTooltip\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </tr>\n\n <tr></tr\n ></ng-container>\n\n <ng-container\n *ngFor=\"let item of items\"\n matColumnDef=\"{{ item.property }}\"\n >\n <th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>\n <td mat-cell *matCellDef=\"let index = index\">\n <jsonforms-outlet\n [renderProps]=\"getProps(index, item.props)\"\n ></jsonforms-outlet>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n ", isInline: true, styles: ["table {width: 100%;}", ".cdk-column-action { width: 15%}"], 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: i1.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
130
|
-
return TableRenderer;
|
|
131
|
-
}(JsonFormsArrayControl));
|
|
132
|
-
export { TableRenderer };
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableRenderer, decorators: [{
|
|
134
|
-
type: Component,
|
|
135
|
-
args: [{ selector: 'TableRenderer', template: "\n <table\n mat-table\n [dataSource]=\"data\"\n class=\"mat-elevation-z8\"\n [trackBy]=\"trackElement\"\n >\n <ng-container matColumnDef=\"action\">\n <tr>\n <th mat-header-cell *matHeaderCellDef>\n <button\n mat-button\n color=\"primary\"\n (click)=\"add()\"\n [disabled]=\"!isEnabled()\"\n [matTooltip]=\"translations.addTooltip\"\n >\n <mat-icon>add</mat-icon>\n </button>\n </th>\n </tr>\n <tr>\n <td\n mat-cell\n *matCellDef=\"\n let row;\n let i = index;\n let first = first;\n let last = last\n \"\n >\n <button\n *ngIf=\"uischema?.options?.showSortButtons\"\n class=\"item-up\"\n mat-button\n [disabled]=\"first\"\n (click)=\"up(i)\"\n [matTooltip]=\"translations.upAriaLabel\"\n matTooltipPosition=\"right\"\n >\n <mat-icon>arrow_upward</mat-icon>\n </button>\n <button\n *ngIf=\"uischema?.options?.showSortButtons\"\n class=\"item-down\"\n mat-button\n [disabled]=\"last\"\n (click)=\"down(i)\"\n [matTooltip]=\"translations.downAriaLabel\"\n matTooltipPosition=\"right\"\n >\n <mat-icon>arrow_downward</mat-icon>\n </button>\n <button\n mat-button\n color=\"warn\"\n (click)=\"remove(i)\"\n [disabled]=\"!isEnabled()\"\n matTooltipPosition=\"right\"\n [matTooltip]=\"translations.removeTooltip\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </tr>\n\n <tr></tr\n ></ng-container>\n\n <ng-container\n *ngFor=\"let item of items\"\n matColumnDef=\"{{ item.property }}\"\n >\n <th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>\n <td mat-cell *matCellDef=\"let index = index\">\n <jsonforms-outlet\n [renderProps]=\"getProps(index, item.props)\"\n ></jsonforms-outlet>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n ", styles: ["table {width: 100%;}", ".cdk-column-action { width: 15%}"] }]
|
|
136
|
-
}], ctorParameters: function () { return [{ type: i1.JsonFormsAngularService }]; } });
|
|
137
|
-
export var TableRendererTester = rankWith(3, or(isObjectArrayControl, isPrimitiveArrayControl));
|
|
138
|
-
export var controlWithoutLabel = function (scope) { return ({
|
|
139
|
-
type: 'Control',
|
|
140
|
-
scope: scope,
|
|
141
|
-
label: false,
|
|
142
|
-
}); };
|
|
143
|
-
//# sourceMappingURL=table.renderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table.renderer.js","sourceRoot":"","sources":["../../../src/other/table.renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;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7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;+GA5DU,aAAa;mGAAb,aAAa,4EAvFd,khFAoFT;wBAxIH;CA0PC,AAxMD,CAyFmC,qBAAqB,GA+GvD;SA/GY,aAAa;4FAAb,aAAa;kBAzFzB,SAAS;+BACE,eAAe,YACf,khFAoFT;;AAmHH,MAAM,CAAC,IAAM,mBAAmB,GAAiB,QAAQ,CACvD,CAAC,EACD,EAAE,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAClD,CAAC;AAQF,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,KAAa,IAAqB,OAAA,CAAC;IACrE,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;CACb,CAAC,EAJoE,CAIpE,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|