@genesislcap/foundation-entity-management 14.93.0 → 14.94.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/dist/custom-elements.json +22 -1
- package/dist/dts/entities/entities.d.ts.map +1 -1
- package/dist/dts/list/list.d.ts +3 -0
- package/dist/dts/list/list.d.ts.map +1 -1
- package/dist/dts/list/list.template.d.ts.map +1 -1
- package/dist/esm/entities/entities.js +5 -2
- package/dist/esm/list/list.js +29 -2
- package/dist/esm/list/list.template.js +1 -0
- package/package.json +15 -15
|
@@ -869,7 +869,7 @@
|
|
|
869
869
|
{
|
|
870
870
|
"kind": "variable",
|
|
871
871
|
"name": "listTemplate",
|
|
872
|
-
"default": "html<List>`\n <div class=\"container\">\n ${when(\n (x) => x.enableFilterBar,\n html<List>`\n <zero-filter-bar\n resource=${(x) => x.resourceName}\n only=${(x) => x.columns?.map((colDef) => colDef.field).filter((field) => !!field)}\n labels=${(x) => x.columns?.map((colDef) => colDef.headerName || '')}\n target=\"datasource\"\n ></zero-filter-bar>\n `,\n )}\n <zero-grid-pro\n ${ref('grid')}\n auto-cell-renderer-by-type\n rowSelection=\"single\"\n rowHeight=\"36\"\n headerHeight=\"36\"\n persist-column-state-key=${(x) => x.persistColumnStateKey}\n ?only-template-col-defs=${(x) => !!x.columns}\n suppressCellFocus=\"true\"\n suppressRowDeselection=\"true\"\n async-add=${(x) => x.asyncAdd}\n async-remove=${(x) => x.asyncRemove}\n async-update=${(x) => x.asyncUpdate}\n enable-cell-flashing=${(x) => x.enableCellFlashing}\n enable-row-flashing=${(x) => x.enableRowFlashing}\n >\n <grid-pro-genesis-datasource\n ${ref('datasource')}\n :deferredGridOptions=${(x) => x.gridOptions}\n criteria=${(x) => x.datasourceConfig?.criteria}\n fields=${(x) => x.datasourceConfig?.fields}\n is-snapshot=${(x) => x.datasourceConfig?.isSnapshot}\n max-rows=${(x) => x.datasourceConfig?.maxRows}\n max-view=${(x) => x.datasourceConfig?.maxView}\n moving-view=${(x) => x.datasourceConfig?.movingView}\n order-by=${(x) => x.datasourceConfig?.orderBy}\n polling-interval=${(x) => x.datasourceConfig?.pollingInterval}\n resource-name=${(x) => x.resourceName}\n reverse=${(x) => x.datasourceConfig?.reverse}\n ></grid-pro-genesis-datasource>\n ${repeat(\n (x) => x.columns,\n html`\n <grid-pro-column :definition=${(x) => x}></grid-pro-column>\n `,\n )}\n ${repeat(\n (x) => x.actionButtonsConfig,\n html`\n <grid-pro-column :definition=${(x) => x}></grid-pro-column>\n `,\n )}\n </zero-grid-pro>\n </div>\n`"
|
|
872
|
+
"default": "html<List>`\n <div class=\"container\">\n ${when(\n (x) => x.enableFilterBar,\n html<List>`\n <zero-filter-bar\n resource=${(x) => x.resourceName}\n only=${(x) => x.columns?.map((colDef) => colDef.field).filter((field) => !!field)}\n labels=${(x) => x.columns?.map((colDef) => colDef.headerName || '')}\n target=\"datasource\"\n ></zero-filter-bar>\n `,\n )}\n <zero-grid-pro\n ${ref('grid')}\n auto-cell-renderer-by-type\n rowSelection=\"single\"\n rowHeight=\"36\"\n headerHeight=\"36\"\n persist-column-state-key=${(x) => x.persistColumnStateKey}\n ?only-template-col-defs=${(x) => !!x.columns}\n suppressCellFocus=\"true\"\n suppressRowDeselection=\"true\"\n stopEditingWhenCellsLoseFocus=\"true\"\n async-add=${(x) => x.asyncAdd}\n async-remove=${(x) => x.asyncRemove}\n async-update=${(x) => x.asyncUpdate}\n enable-cell-flashing=${(x) => x.enableCellFlashing}\n enable-row-flashing=${(x) => x.enableRowFlashing}\n >\n <grid-pro-genesis-datasource\n ${ref('datasource')}\n :deferredGridOptions=${(x) => x.gridOptions}\n criteria=${(x) => x.datasourceConfig?.criteria}\n fields=${(x) => x.datasourceConfig?.fields}\n is-snapshot=${(x) => x.datasourceConfig?.isSnapshot}\n max-rows=${(x) => x.datasourceConfig?.maxRows}\n max-view=${(x) => x.datasourceConfig?.maxView}\n moving-view=${(x) => x.datasourceConfig?.movingView}\n order-by=${(x) => x.datasourceConfig?.orderBy}\n polling-interval=${(x) => x.datasourceConfig?.pollingInterval}\n resource-name=${(x) => x.resourceName}\n reverse=${(x) => x.datasourceConfig?.reverse}\n ></grid-pro-genesis-datasource>\n ${repeat(\n (x) => x.columns,\n html`\n <grid-pro-column :definition=${(x) => x}></grid-pro-column>\n `,\n )}\n ${repeat(\n (x) => x.actionButtonsConfig,\n html`\n <grid-pro-column :definition=${(x) => x}></grid-pro-column>\n `,\n )}\n </zero-grid-pro>\n </div>\n`"
|
|
873
873
|
}
|
|
874
874
|
],
|
|
875
875
|
"exports": [
|
|
@@ -1044,6 +1044,27 @@
|
|
|
1044
1044
|
"text": "string"
|
|
1045
1045
|
}
|
|
1046
1046
|
},
|
|
1047
|
+
{
|
|
1048
|
+
"kind": "field",
|
|
1049
|
+
"name": "connect",
|
|
1050
|
+
"type": {
|
|
1051
|
+
"text": "Connect"
|
|
1052
|
+
},
|
|
1053
|
+
"privacy": "protected"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"kind": "method",
|
|
1057
|
+
"name": "onCellEditingStopped",
|
|
1058
|
+
"privacy": "private",
|
|
1059
|
+
"parameters": [
|
|
1060
|
+
{
|
|
1061
|
+
"name": "event",
|
|
1062
|
+
"type": {
|
|
1063
|
+
"text": "CellEditingStoppedEvent"
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
]
|
|
1067
|
+
},
|
|
1047
1068
|
{
|
|
1048
1069
|
"kind": "method",
|
|
1049
1070
|
"name": "handleFilterChanged",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAa,aAAa,EAAE,MAAM,+BA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4BxB,OAAO,CAAC,UAAU;IAMX,UAAU;IAKV,eAAe,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAItC,yBAAyB,CAAC,CAAC,EAAE,WAAW;IA6B/C;;;;;OAKG;IACG,YAAY,CAAC,CAAC,EAAE,WAAW;IAK3B,aAAa;IAoBnB,OAAO,CAAC,sBAAsB;IAgB9B;;;OAGG;IACI,WAAW,CAAC,OAAO,KAAA;CAsB3B"}
|
package/dist/dts/list/list.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ColDef, GridOptions } from '@ag-grid-community/core';
|
|
2
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
3
|
import { GridProGenesisDatasource, ZeroGridPro } from '@genesislcap/foundation-zero-grid-pro';
|
|
3
4
|
import { FASTElement } from '@microsoft/fast-element';
|
|
4
5
|
import { DatasourceConfiguration } from '../entities/entities';
|
|
@@ -23,7 +24,9 @@ export declare class List extends FASTElement {
|
|
|
23
24
|
actionButtonsConfig: any[];
|
|
24
25
|
deleteEvent: string;
|
|
25
26
|
updateEvent: string;
|
|
27
|
+
protected connect: Connect;
|
|
26
28
|
connectedCallback(): void;
|
|
29
|
+
private onCellEditingStopped;
|
|
27
30
|
disconnectedCallback(): void;
|
|
28
31
|
private handleFilterChanged;
|
|
29
32
|
private handleFilterCleared;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/list/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/list/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAEL,wBAAwB,EACxB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAuB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAK/D,qBAKa,IAAK,SAAQ,WAAW;IAC7B,YAAY,EAAE,MAAM,CAAM;IAC1B,KAAK,EAAE,MAAM,CAAM;IACwB,qBAAqB,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACjC,QAAQ,UAAS;IACd,WAAW,UAAS;IACpB,WAAW,UAAQ;IACX,kBAAkB,UAAS;IAC5B,iBAAiB,UAAS;IACpC,QAAQ,UAAS;IACf,UAAU,UAAS;IACjE,IAAI,EAAG,WAAW,CAAC;IACnB,UAAU,EAAG,wBAAwB,CAAC;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,mBAAmB,QAAM;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAEvB,SAAS,CAAC,OAAO,EAAG,OAAO,CAAC;IAErC,iBAAiB;YA+BH,oBAAoB;IAsBlC,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,IAAI,CAEV;IAEI,MAAM,CAAC,CAAC,KAAA;CAGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.template.d.ts","sourceRoot":"","sources":["../../../src/list/list.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"list.template.d.ts","sourceRoot":"","sources":["../../../src/list/list.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY,2DA0DxB,CAAC"}
|
|
@@ -143,8 +143,11 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
143
143
|
copy.formUiSchema = structuredClone(this.formUiSchema);
|
|
144
144
|
copy.updateFormUiSchema = structuredClone(this.updateFormUiSchema);
|
|
145
145
|
copy.defaultEntityValues = structuredClone(this.defaultEntityValues);
|
|
146
|
-
// this.columns[number] might contain a function, so can't use structuredClone
|
|
146
|
+
// this.columns[number] and this.formRenderers[number] might contain a function, so can't use structuredClone
|
|
147
147
|
copy.columns = this.columns ? [...this.columns].map((x) => (Object.assign({}, x))) : this.columns;
|
|
148
|
+
copy.formRenderers = this.formRenderers
|
|
149
|
+
? [...this.formRenderers].map((x) => (Object.assign({}, x)))
|
|
150
|
+
: this.formRenderers;
|
|
148
151
|
return copy;
|
|
149
152
|
}
|
|
150
153
|
/**
|
|
@@ -227,7 +230,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
227
230
|
else {
|
|
228
231
|
showNotification(getNotificationBuilder()
|
|
229
232
|
.withTitle('Error submitting form')
|
|
230
|
-
.withBody(submitFailureError.
|
|
233
|
+
.withBody((submitFailureError.CODE + ': ' + submitFailureError.TEXT).toString())
|
|
231
234
|
.withSnackbar(getSnackbarBuilder()
|
|
232
235
|
.withType('error')
|
|
233
236
|
.withConfirmingAction({ label: '', action: () => { } })
|
package/dist/esm/list/list.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
2
|
import { Events } from '@ag-grid-community/core';
|
|
3
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
4
|
+
import { GRID_READY_EVENT, } from '@genesislcap/foundation-zero-grid-pro';
|
|
3
5
|
import { attr, customElement, FASTElement, observable } from '@microsoft/fast-element';
|
|
4
6
|
import { buttonCellRenderer } from '../utils';
|
|
5
7
|
import { listStyles } from './list.styles';
|
|
@@ -23,13 +25,14 @@ let List = class List extends FASTElement {
|
|
|
23
25
|
}
|
|
24
26
|
connectedCallback() {
|
|
25
27
|
super.connectedCallback();
|
|
26
|
-
this.grid.addEventListener(
|
|
28
|
+
this.grid.addEventListener(GRID_READY_EVENT, () => {
|
|
27
29
|
this.grid.gridApi.addEventListener(Events.EVENT_FIRST_DATA_RENDERED, () => {
|
|
28
30
|
if (this.sizeColumnsToFit) {
|
|
29
31
|
this.grid.gridApi.sizeColumnsToFit();
|
|
30
32
|
}
|
|
31
33
|
});
|
|
32
|
-
this.grid.gridApi.addEventListener(
|
|
34
|
+
this.grid.gridApi.addEventListener(Events.EVENT_ROW_CLICKED, (e) => this.select(e));
|
|
35
|
+
this.grid.gridApi.addEventListener(Events.EVENT_CELL_EDITING_STOPPED, (e) => this.onCellEditingStopped(e));
|
|
33
36
|
this.actionButtonsConfig = [];
|
|
34
37
|
if (this.deleteEvent && !this.hideDelete) {
|
|
35
38
|
this.actionButtonsConfig.push(buttonCellRenderer('Delete', (e) => this.delete(e)));
|
|
@@ -43,6 +46,27 @@ let List = class List extends FASTElement {
|
|
|
43
46
|
}
|
|
44
47
|
});
|
|
45
48
|
}
|
|
49
|
+
onCellEditingStopped(event) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
if (event.valueChanged) {
|
|
53
|
+
const jsonSchemaResponse = yield this.connect.getJSONSchema(this.updateEvent);
|
|
54
|
+
const jsonSchema = (_b = (_a = jsonSchemaResponse === null || jsonSchemaResponse === void 0 ? void 0 : jsonSchemaResponse.INBOUND) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.DETAILS;
|
|
55
|
+
// copy only properties required by schema
|
|
56
|
+
const payload = Object.fromEntries(Object.keys(jsonSchema.properties).map((key) => [key, event.data[key]]));
|
|
57
|
+
const updateReq = yield this.connect.commitEvent(this.updateEvent, {
|
|
58
|
+
// merge current payload with the newly edited cell value
|
|
59
|
+
DETAILS: Object.assign(Object.assign({}, payload), { [event.column.getColDef().field]: event.newValue }),
|
|
60
|
+
});
|
|
61
|
+
if (updateReq.ERROR) {
|
|
62
|
+
this.$emit('submit-failure', { payload, errors: updateReq.ERROR });
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.$emit('submit-success', { payload });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
46
70
|
disconnectedCallback() {
|
|
47
71
|
super.disconnectedCallback();
|
|
48
72
|
if (this.enableFilterBar) {
|
|
@@ -124,6 +148,9 @@ __decorate([
|
|
|
124
148
|
__decorate([
|
|
125
149
|
observable
|
|
126
150
|
], List.prototype, "updateEvent", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
Connect
|
|
153
|
+
], List.prototype, "connect", void 0);
|
|
127
154
|
List = __decorate([
|
|
128
155
|
customElement({
|
|
129
156
|
name: 'entity-list',
|
|
@@ -19,6 +19,7 @@ export const listTemplate = html `
|
|
|
19
19
|
?only-template-col-defs=${(x) => !!x.columns}
|
|
20
20
|
suppressCellFocus="true"
|
|
21
21
|
suppressRowDeselection="true"
|
|
22
|
+
stopEditingWhenCellsLoseFocus="true"
|
|
22
23
|
async-add=${(x) => x.asyncAdd}
|
|
23
24
|
async-remove=${(x) => x.asyncRemove}
|
|
24
25
|
async-update=${(x) => x.asyncUpdate}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-entity-management",
|
|
3
3
|
"description": "Genesis Foundation Entity Management",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.94.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -44,23 +44,23 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@genesislcap/foundation-login": "^14.40.0",
|
|
47
|
-
"@genesislcap/foundation-testing": "14.
|
|
48
|
-
"@genesislcap/genx": "14.
|
|
47
|
+
"@genesislcap/foundation-testing": "14.94.0",
|
|
48
|
+
"@genesislcap/genx": "14.94.0",
|
|
49
49
|
"rimraf": "^3.0.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@ag-grid-community/core": "29.2.0",
|
|
53
|
-
"@genesislcap/foundation-comms": "14.
|
|
54
|
-
"@genesislcap/foundation-errors": "14.
|
|
55
|
-
"@genesislcap/foundation-forms": "14.
|
|
56
|
-
"@genesislcap/foundation-logger": "14.
|
|
57
|
-
"@genesislcap/foundation-login": "14.
|
|
58
|
-
"@genesislcap/foundation-notifications": "14.
|
|
59
|
-
"@genesislcap/foundation-ui": "14.
|
|
60
|
-
"@genesislcap/foundation-utils": "14.
|
|
61
|
-
"@genesislcap/foundation-zero": "14.
|
|
62
|
-
"@genesislcap/foundation-zero-grid-pro": "14.
|
|
63
|
-
"@genesislcap/grid-pro": "14.
|
|
53
|
+
"@genesislcap/foundation-comms": "14.94.0",
|
|
54
|
+
"@genesislcap/foundation-errors": "14.94.0",
|
|
55
|
+
"@genesislcap/foundation-forms": "14.94.0",
|
|
56
|
+
"@genesislcap/foundation-logger": "14.94.0",
|
|
57
|
+
"@genesislcap/foundation-login": "14.94.0",
|
|
58
|
+
"@genesislcap/foundation-notifications": "14.94.0",
|
|
59
|
+
"@genesislcap/foundation-ui": "14.94.0",
|
|
60
|
+
"@genesislcap/foundation-utils": "14.94.0",
|
|
61
|
+
"@genesislcap/foundation-zero": "14.94.0",
|
|
62
|
+
"@genesislcap/foundation-zero-grid-pro": "14.94.0",
|
|
63
|
+
"@genesislcap/grid-pro": "14.94.0",
|
|
64
64
|
"@microsoft/fast-components": "^2.21.3",
|
|
65
65
|
"@microsoft/fast-element": "^1.7.0",
|
|
66
66
|
"@microsoft/fast-foundation": "^2.33.2",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
78
|
"customElements": "dist/custom-elements.json",
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "cb3b05d51d51d25f3558ab4436258df58268aa0e"
|
|
80
80
|
}
|