@genesislcap/foundation-entity-management 14.108.0 → 14.109.1-alpha-cf055218219.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.
@@ -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 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`"
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 readOnlyEdit=\"true\"\n tooltipMouseTrack=\"true\"\n tooltipShowDelay=\"0\"\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": [
@@ -1060,7 +1060,7 @@
1060
1060
  {
1061
1061
  "name": "event",
1062
1062
  "type": {
1063
- "text": "CellEditingStoppedEvent"
1063
+ "text": "CellEditRequestEvent"
1064
1064
  }
1065
1065
  }
1066
1066
  ]
@@ -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,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAEL,wBAAwB,EACxB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAuB,WAAW,EAAoB,MAAM,yBAAyB,CAAC;AAC7F,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,O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AAoB;IA+ClC,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"}
@@ -2,6 +2,7 @@ import { __awaiter, __decorate } from "tslib";
2
2
  import { Events } from '@ag-grid-community/core';
3
3
  import { Connect } from '@genesislcap/foundation-comms';
4
4
  import { GRID_READY_EVENT, } from '@genesislcap/foundation-zero-grid-pro';
5
+ import { EDITED_COLUMN_FIELD, ERROR_COLUMN_FIELD } from '@genesislcap/grid-pro';
5
6
  import { attr, customElement, FASTElement, html, observable } from '@microsoft/fast-element';
6
7
  import { buttonCellRenderer } from '../utils';
7
8
  import { listStyles } from './list.styles';
@@ -33,7 +34,7 @@ let List = class List extends FASTElement {
33
34
  });
34
35
  this.grid.gridApi.addEventListener(Events.EVENT_ROW_CLICKED, (e) => this.select(e));
35
36
  if (this.updateEvent) {
36
- this.grid.gridApi.addEventListener(Events.EVENT_CELL_EDITING_STOPPED, (e) => this.onCellEditingStopped(e));
37
+ this.grid.gridApi.addEventListener(Events.EVENT_CELL_EDIT_REQUEST, (e) => this.onCellEditingStopped(e));
37
38
  }
38
39
  this.actionButtonsConfig = [];
39
40
  if (this.updateEvent && !this.hideEdit) {
@@ -66,26 +67,31 @@ let List = class List extends FASTElement {
66
67
  onCellEditingStopped(event) {
67
68
  var _a, _b;
68
69
  return __awaiter(this, void 0, void 0, function* () {
69
- if (event.valueChanged) {
70
- const jsonSchemaResponse = yield this.connect.getJSONSchema(this.updateEvent);
71
- 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;
72
- // copy only properties required by schema
73
- const payload = Object.fromEntries(Object.keys(jsonSchema.properties).map((key) => [
74
- key,
75
- // if column config was provided get data using grid api, so it takes into account
76
- // methods like valueGetter
77
- event.api.getColumnDef(key) ? event.api.getValue(key, event.node) : event.data[key],
78
- ]));
79
- const updateReq = yield this.connect.commitEvent(this.updateEvent, {
80
- // merge current payload with the newly edited cell value
81
- DETAILS: Object.assign(Object.assign({}, payload), { [event.column.getColDef().field]: event.newValue }),
82
- });
83
- if (updateReq.ERROR) {
84
- this.$emit('submit-failure', { payload, errors: updateReq.ERROR });
85
- }
86
- else {
87
- this.$emit('submit-success', { payload });
88
- }
70
+ const jsonSchemaResponse = yield this.connect.getJSONSchema(this.updateEvent);
71
+ 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;
72
+ const editedField = event.column.getColDef().field;
73
+ event.node.setData(Object.assign(Object.assign({}, event.data), { [ERROR_COLUMN_FIELD]: undefined, [EDITED_COLUMN_FIELD]: editedField, [editedField]: event.newValue }));
74
+ // copy only properties required by schema
75
+ const payload = Object.fromEntries(Object.keys(jsonSchema.properties).map((key) => [
76
+ key,
77
+ // if column config was provided get data using grid api, so it takes into account
78
+ // methods like valueGetter
79
+ event.api.getColumnDef(key) ? event.api.getValue(key, event.node) : event.data[key],
80
+ ]));
81
+ const updateReq = yield this.connect.commitEvent(this.updateEvent, {
82
+ // merge current payload with the newly edited cell value
83
+ DETAILS: Object.assign(Object.assign({}, payload), { [editedField]: event.newValue }),
84
+ });
85
+ if (updateReq.ERROR) {
86
+ this.$emit('submit-failure', { payload, errors: updateReq.ERROR });
87
+ event.node.setData(Object.assign(Object.assign({}, event.data), { [editedField]: event.oldValue, [EDITED_COLUMN_FIELD]: '', [ERROR_COLUMN_FIELD]: {
88
+ column: editedField,
89
+ message: updateReq.ERROR.map((error) => `${error.CODE}: ${error.TEXT}`),
90
+ } }));
91
+ }
92
+ else {
93
+ event.node.setData(Object.assign(Object.assign({}, event.data), { [editedField]: event.newValue, [EDITED_COLUMN_FIELD]: '' }));
94
+ this.$emit('submit-success', { payload });
89
95
  }
90
96
  });
91
97
  }
@@ -17,9 +17,9 @@ export const listTemplate = html `
17
17
  headerHeight="36"
18
18
  persist-column-state-key=${(x) => x.persistColumnStateKey}
19
19
  ?only-template-col-defs=${(x) => !!x.columns}
20
- suppressCellFocus="true"
21
- suppressRowDeselection="true"
22
- stopEditingWhenCellsLoseFocus="true"
20
+ readOnlyEdit="true"
21
+ tooltipMouseTrack="true"
22
+ tooltipShowDelay="0"
23
23
  async-add=${(x) => x.asyncAdd}
24
24
  async-remove=${(x) => x.asyncRemove}
25
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.108.0",
4
+ "version": "14.109.1-alpha-cf055218219.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.108.0",
48
- "@genesislcap/genx": "14.108.0",
47
+ "@genesislcap/foundation-testing": "14.109.1-alpha-cf055218219.0",
48
+ "@genesislcap/genx": "14.109.1-alpha-cf055218219.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.108.0",
54
- "@genesislcap/foundation-errors": "14.108.0",
55
- "@genesislcap/foundation-forms": "14.108.0",
56
- "@genesislcap/foundation-logger": "14.108.0",
57
- "@genesislcap/foundation-login": "14.108.0",
58
- "@genesislcap/foundation-notifications": "14.108.0",
59
- "@genesislcap/foundation-ui": "14.108.0",
60
- "@genesislcap/foundation-utils": "14.108.0",
61
- "@genesislcap/foundation-zero": "14.108.0",
62
- "@genesislcap/foundation-zero-grid-pro": "14.108.0",
63
- "@genesislcap/grid-pro": "14.108.0",
53
+ "@genesislcap/foundation-comms": "14.109.1-alpha-cf055218219.0",
54
+ "@genesislcap/foundation-errors": "14.109.1-alpha-cf055218219.0",
55
+ "@genesislcap/foundation-forms": "14.109.1-alpha-cf055218219.0",
56
+ "@genesislcap/foundation-logger": "14.109.1-alpha-cf055218219.0",
57
+ "@genesislcap/foundation-login": "14.109.1-alpha-cf055218219.0",
58
+ "@genesislcap/foundation-notifications": "14.109.1-alpha-cf055218219.0",
59
+ "@genesislcap/foundation-ui": "14.109.1-alpha-cf055218219.0",
60
+ "@genesislcap/foundation-utils": "14.109.1-alpha-cf055218219.0",
61
+ "@genesislcap/foundation-zero": "14.109.1-alpha-cf055218219.0",
62
+ "@genesislcap/foundation-zero-grid-pro": "14.109.1-alpha-cf055218219.0",
63
+ "@genesislcap/grid-pro": "14.109.1-alpha-cf055218219.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": "37e4aa6b9f3b1ba8fd0e88156693232fd139fe2e"
79
+ "gitHead": "2aca46b6e2d2e0df7aae4314ce806468e43e8c57"
80
80
  }