@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-76362.1 → 0.0.0-bugfix-dev-KB-79020.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/cjs/DataBinder-3b083480.js +445 -0
- package/dist/cjs/FocusResolver-885f2173.js +35 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +13 -20
- package/dist/cjs/ez-chart.cjs.entry.js +2 -2
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +49 -13
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +5 -4
- package/dist/cjs/ez-date-input.cjs.entry.js +9 -3
- package/dist/cjs/ez-date-time-input.cjs.entry.js +9 -3
- package/dist/cjs/ez-dialog.cjs.entry.js +11 -3
- package/dist/cjs/ez-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +3 -3
- package/dist/cjs/ez-form.cjs.entry.js +6 -326
- package/dist/cjs/ez-grid.cjs.entry.js +14620 -70502
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +2 -2
- package/dist/cjs/ez-list.cjs.entry.js +152 -101
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +2 -2
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -2
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +68 -23
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +15 -5
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +67 -5
- package/dist/cjs/ez-text-input.cjs.entry.js +80 -8
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +0 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +3 -2
- package/dist/collection/components/ez-button/ez-button.css +2 -2
- package/dist/collection/components/ez-card-item/ez-card-item.css +14 -5
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +12 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +76 -15
- package/dist/collection/components/ez-date-input/ez-date-input.js +35 -4
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +35 -4
- package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
- package/dist/collection/components/ez-dialog/ez-dialog.js +9 -1
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +0 -11
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +22 -52
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +3 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +100 -27
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +8 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +164 -46
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +7 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +4 -1
- package/dist/collection/components/ez-grid/ez-grid.js +90 -3
- package/dist/collection/components/ez-icon/ez-icon.css +153 -149
- package/dist/collection/components/ez-list/ez-list.css +5 -5
- package/dist/collection/components/ez-list/ez-list.js +152 -170
- package/dist/collection/components/ez-modal/ez-modal.css +4 -0
- package/dist/collection/components/ez-modal/ez-modal.js +2 -2
- package/dist/collection/components/ez-number-input/ez-number-input.css +8 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +25 -0
- package/dist/collection/components/ez-popover/ez-popover.css +3 -10
- package/dist/collection/components/ez-popup/ez-popup.css +4 -8
- package/dist/collection/components/ez-search/ez-search.css +1 -1
- package/dist/collection/components/ez-search/ez-search.js +94 -24
- package/dist/collection/components/ez-split-button/ez-split-button.css +2 -2
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +35 -4
- package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +1 -0
- package/dist/collection/components/ez-text-area/ez-text-area.css +49 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +102 -2
- package/dist/collection/components/ez-text-input/ez-text-input.css +33 -53
- package/dist/collection/components/ez-text-input/ez-text-input.js +88 -6
- package/dist/collection/components/ez-time-input/ez-time-input.js +24 -0
- package/dist/collection/utils/FocusResolver.js +31 -0
- package/dist/collection/utils/ResponsiveInputUtils.js +26 -0
- package/dist/collection/utils/form/DataBinder.js +18 -3
- package/dist/collection/utils/form/FormMetadata.js +1 -1
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +15381 -70913
- package/dist/esm/DataBinder-02fa9bb9.js +441 -0
- package/dist/esm/FocusResolver-1ccbf850.js +33 -0
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +2 -2
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +13 -20
- package/dist/esm/ez-chart.entry.js +2 -2
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +50 -14
- package/dist/esm/ez-custom-form-input_2.entry.js +5 -4
- package/dist/esm/ez-date-input.entry.js +9 -3
- package/dist/esm/ez-date-time-input.entry.js +9 -3
- package/dist/esm/ez-dialog.entry.js +11 -3
- package/dist/esm/ez-dropdown_2.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +3 -3
- package/dist/esm/ez-form.entry.js +5 -325
- package/dist/esm/ez-grid.entry.js +14589 -70471
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +153 -102
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +2 -2
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +9 -2
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +68 -23
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +15 -5
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +67 -5
- package/dist/esm/ez-text-input.entry.js +80 -8
- package/dist/esm/ez-time-input.entry.js +7 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +1 -3
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e6b38ade.entry.js → p-0306dff7.entry.js} +1 -1
- package/dist/ezui/p-039a95bd.entry.js +1 -0
- package/dist/ezui/{p-91ccae0c.entry.js → p-09de35a2.entry.js} +1 -1
- package/dist/ezui/p-0a75bb05.entry.js +1 -0
- package/dist/ezui/p-0db68715.entry.js +1 -0
- package/dist/ezui/p-151fc744.entry.js +1 -0
- package/dist/ezui/p-15d7af92.entry.js +1 -0
- package/dist/ezui/{p-b2f6bc0a.entry.js → p-17be134a.entry.js} +1 -1
- package/dist/ezui/p-19098a3f.entry.js +1 -0
- package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
- package/dist/ezui/p-2b46b37b.entry.js +1 -0
- package/dist/ezui/p-2bb2a0c4.entry.js +1 -0
- package/dist/ezui/p-3175fe8c.entry.js +1 -0
- package/dist/ezui/p-43b41d3e.entry.js +309 -0
- package/dist/ezui/{p-0378416a.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/p-455e737c.js +1 -0
- package/dist/ezui/p-4575d511.entry.js +1 -0
- package/dist/ezui/{p-7567ccdd.entry.js → p-555c9018.entry.js} +1 -1
- package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/{p-f1c2c19e.entry.js → p-650e4b6d.entry.js} +1 -1
- package/dist/ezui/{p-554522db.entry.js → p-6d79930d.entry.js} +1 -1
- package/dist/ezui/{p-fc194825.entry.js → p-6e429cff.entry.js} +1 -1
- package/dist/ezui/{p-3b546374.entry.js → p-7409eeaa.entry.js} +1 -1
- package/dist/ezui/{p-11bfeca3.entry.js → p-77a4bd35.entry.js} +1 -1
- package/dist/ezui/p-783ea398.entry.js +1 -0
- package/dist/ezui/p-7ed30844.entry.js +1 -0
- package/dist/ezui/{p-e18d9e6a.entry.js → p-7fdd479f.entry.js} +1 -1
- package/dist/ezui/p-7fde6c1d.entry.js +1 -0
- package/dist/ezui/p-8481a08a.entry.js +1 -0
- package/dist/ezui/{p-1b08bf3c.entry.js → p-8888d9ed.entry.js} +1 -1
- package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
- package/dist/ezui/{p-e7395eae.entry.js → p-90bcd2ba.entry.js} +1 -1
- package/dist/ezui/{p-a921e3e7.entry.js → p-990b4318.entry.js} +1 -1
- package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/p-a5b91a77.entry.js +1 -0
- package/dist/ezui/p-a80b1287.entry.js +1 -0
- package/dist/ezui/{p-30951bd7.entry.js → p-baf80b13.entry.js} +1 -1
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/p-bfad39eb.entry.js +1 -0
- package/dist/ezui/{p-92748142.entry.js → p-c0d9c4f8.entry.js} +1 -1
- package/dist/ezui/{p-b858fc6e.entry.js → p-c3045972.entry.js} +1 -1
- package/dist/ezui/{p-a563df31.entry.js → p-c4320a39.entry.js} +1 -1
- package/dist/ezui/p-cd2e78f0.entry.js +1 -0
- package/dist/ezui/p-d0ca26fe.entry.js +1 -0
- package/dist/ezui/p-dc628ed3.js +1 -0
- package/dist/ezui/p-dc8b36c3.entry.js +1 -0
- package/dist/ezui/{p-bef7daac.entry.js → p-e347df9c.entry.js} +1 -1
- package/dist/ezui/{p-70f1c812.entry.js → p-f9e551de.entry.js} +1 -1
- package/dist/ezui/p-fec696ab.entry.js +1 -0
- package/dist/ezui/p-ffd246f5.entry.js +1 -0
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +6 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +6 -1
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +2 -0
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +4 -11
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +12 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +7 -2
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +19 -7
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +3 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +11 -1
- package/dist/types/components/ez-list/ez-list.d.ts +3 -26
- package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +10 -2
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +4 -0
- package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +9 -0
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +17 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +9 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components.d.ts +114 -44
- package/dist/types/utils/FocusResolver.d.ts +5 -0
- package/dist/types/utils/ResponsiveInputUtils.d.ts +6 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/package.json +11 -4
- package/dist/cjs/RecordValidationProcessor-10846595.js +0 -108
- package/dist/esm/RecordValidationProcessor-9c6cc267.js +0 -105
- package/dist/ezui/p-00687830.entry.js +0 -1
- package/dist/ezui/p-044d46d5.entry.js +0 -1
- package/dist/ezui/p-11b09aa1.entry.js +0 -1
- package/dist/ezui/p-190c190f.entry.js +0 -304
- package/dist/ezui/p-2de9f0aa.entry.js +0 -1
- package/dist/ezui/p-36180f4d.entry.js +0 -1
- package/dist/ezui/p-3f8c33e0.entry.js +0 -1
- package/dist/ezui/p-52100a6e.entry.js +0 -1
- package/dist/ezui/p-5a40c77a.entry.js +0 -1
- package/dist/ezui/p-61059f6b.entry.js +0 -1
- package/dist/ezui/p-68267f59.entry.js +0 -1
- package/dist/ezui/p-6ec40dec.entry.js +0 -1
- package/dist/ezui/p-823cc11b.entry.js +0 -1
- package/dist/ezui/p-85b500bb.entry.js +0 -1
- package/dist/ezui/p-868b56f7.entry.js +0 -1
- package/dist/ezui/p-8ac13678.entry.js +0 -1
- package/dist/ezui/p-940760bf.entry.js +0 -1
- package/dist/ezui/p-9e08ddb0.entry.js +0 -1
- package/dist/ezui/p-b2a1398f.entry.js +0 -1
- package/dist/ezui/p-ba5f4ee7.entry.js +0 -1
- package/dist/ezui/p-d40b93a7.entry.js +0 -1
- package/dist/ezui/p-d4aba783.entry.js +0 -1
- package/dist/ezui/p-e3ec7422.entry.js +0 -1
- package/dist/ezui/p-f291db18.entry.js +0 -1
- package/dist/ezui/p-f42855b9.js +0 -1
|
@@ -94,6 +94,7 @@ export class EzForm {
|
|
|
94
94
|
if (this.dataUnit === undefined) {
|
|
95
95
|
this.dataUnit = new DataUnit("ez-form");
|
|
96
96
|
}
|
|
97
|
+
this.dataUnit.unsubscribe(this.onDataUnitAction);
|
|
97
98
|
this.dataUnit.subscribe(this.onDataUnitAction);
|
|
98
99
|
this._dataBinder = new DataBinder(this.dataUnit);
|
|
99
100
|
this._store = createStore(formReducer);
|
|
@@ -56,7 +56,7 @@ export class EzCustomFormInput {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
getContent() {
|
|
59
|
-
var _a, _b;
|
|
59
|
+
var _a, _b, _c, _d, _e;
|
|
60
60
|
const fieldProps = new Map();
|
|
61
61
|
for (const prop in this.formViewField.props) {
|
|
62
62
|
fieldProps.set(prop, this.formViewField.props[prop]);
|
|
@@ -94,7 +94,8 @@ export class EzCustomFormInput {
|
|
|
94
94
|
if (typeof gui === 'string') {
|
|
95
95
|
gui = HTMLBuilder.parseElement(gui);
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
const value = (_e = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : this.value) !== null && _e !== void 0 ? _e : '';
|
|
98
|
+
gui.setAttribute('value', value);
|
|
98
99
|
this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
99
100
|
}
|
|
100
101
|
setValue(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
|
|
2
|
+
export const buildTextInput = ({ name, label, readOnly, contextName, canShowError, props }) => {
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError, mask: props === null || props === void 0 ? void 0 : props.mask, "clean-value-mask": props === null || props === void 0 ? void 0 : props.cleanValueMask })));
|
|
4
4
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
|
-
import { Grid
|
|
3
|
-
import {
|
|
1
|
+
import { ApplicationContext, DataType, LockManager, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
|
+
import { Grid } from "@ag-grid-community/core";
|
|
3
|
+
import { LicenseManager } from '@ag-grid-enterprise/core';
|
|
4
4
|
import DataSource from './DataSource';
|
|
5
5
|
import { EzGridCustomHeader } from './components/EzGridCustomHeader';
|
|
6
6
|
import { CellRendererStatus } from './components/cellRendererStatus';
|
|
@@ -8,6 +8,12 @@ import SelectionHeader from './components/selectionHeader';
|
|
|
8
8
|
import gridTerms from './i18n/pt-BR';
|
|
9
9
|
import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from '../../../../utils/constants';
|
|
10
10
|
import GridEditionManager from './GridEditionManager';
|
|
11
|
+
import { ModuleRegistry } from '@ag-grid-community/core';
|
|
12
|
+
import { EnterpriseCoreModule } from '@ag-grid-enterprise/core';
|
|
13
|
+
import { RangeSelectionModule } from '@ag-grid-enterprise/range-selection';
|
|
14
|
+
import { ServerSideRowModelModule } from '@ag-grid-enterprise/server-side-row-model';
|
|
15
|
+
import { ClipboardModule } from '@ag-grid-enterprise/clipboard';
|
|
16
|
+
import { MenuModule } from '@ag-grid-enterprise/menu';
|
|
11
17
|
export default class AgGridController {
|
|
12
18
|
configFilterColumn(filterColumn) {
|
|
13
19
|
this._filterColumn = filterColumn;
|
|
@@ -27,7 +33,7 @@ export default class AgGridController {
|
|
|
27
33
|
var _a;
|
|
28
34
|
(_a = this._filterColumn) === null || _a === void 0 ? void 0 : _a.show(configs);
|
|
29
35
|
}
|
|
30
|
-
constructor(
|
|
36
|
+
constructor(_enterprise) {
|
|
31
37
|
this.DEFAULT_ROW_HEIGHT = 30;
|
|
32
38
|
this.DEFAULT_HEADER_ROW_HEIGHT = 32;
|
|
33
39
|
this.CHECK_BOX_COL_ID = 'checkBoxColumn';
|
|
@@ -43,7 +49,13 @@ export default class AgGridController {
|
|
|
43
49
|
this._customFormatters = new Map();
|
|
44
50
|
this._gridShowDom = false;
|
|
45
51
|
this.peddingExecutionsOnGridShow = [];
|
|
46
|
-
|
|
52
|
+
ModuleRegistry.registerModules([
|
|
53
|
+
EnterpriseCoreModule,
|
|
54
|
+
RangeSelectionModule,
|
|
55
|
+
ServerSideRowModelModule,
|
|
56
|
+
ClipboardModule,
|
|
57
|
+
MenuModule
|
|
58
|
+
]);
|
|
47
59
|
}
|
|
48
60
|
getGridConfig() {
|
|
49
61
|
return this._gridConfig;
|
|
@@ -121,6 +133,7 @@ export default class AgGridController {
|
|
|
121
133
|
var _a;
|
|
122
134
|
this._options = options;
|
|
123
135
|
this._container = container;
|
|
136
|
+
const lockerId = options.enableLockManger ? LockManager.addLockManagerCtxId(this._container) : null;
|
|
124
137
|
if (this._grid === undefined) {
|
|
125
138
|
LicenseManager.setLicenseKey(ApplicationContext.getContextValue('__EZUI__GRID_LICENSE__'));
|
|
126
139
|
this._columnStateChangeCallback = options.onColumnStateChange;
|
|
@@ -128,7 +141,7 @@ export default class AgGridController {
|
|
|
128
141
|
this._doubleClickCallBack = options.onDoubleClick;
|
|
129
142
|
this._multipleSelection = options.allowMultipleSelection;
|
|
130
143
|
this._dataUnit = options.dataUnit;
|
|
131
|
-
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert);
|
|
144
|
+
this._editionManager = new GridEditionManager(this._dataUnit, options.useEnterLikeTab, options.recordsValidator, options.editionIsDisabled, options.customEditors || this._customEditors, options.customRenders || this._customRenders, options.enableContinuousInsert, options.enableGridInsert, lockerId);
|
|
132
145
|
this._statusResolver = options.statusResolver;
|
|
133
146
|
if (this._dataUnit) {
|
|
134
147
|
this._dataUnit.sortingProvider = this;
|
|
@@ -175,12 +188,7 @@ export default class AgGridController {
|
|
|
175
188
|
this.setOptionsEvents(this._gridOptions);
|
|
176
189
|
this.setOptionsSupress(this._gridOptions);
|
|
177
190
|
this._gridOptions = this._editionManager.configureGrid(this._gridOptions);
|
|
178
|
-
|
|
179
|
-
this._grid = new EnterpriseGrid(container, this._gridOptions);
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
this._grid = new Grid(container, this._gridOptions);
|
|
183
|
-
}
|
|
191
|
+
this._grid = new Grid(container, this._gridOptions);
|
|
184
192
|
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
|
|
185
193
|
if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
|
|
186
194
|
this.selectAll(true);
|
|
@@ -340,7 +348,7 @@ export default class AgGridController {
|
|
|
340
348
|
defineRowModelType(opt, sourceOptions) {
|
|
341
349
|
if (this._dataUnit != undefined) {
|
|
342
350
|
opt.rowModelType = 'serverSide';
|
|
343
|
-
opt.serverSideDatasource = new DataSource(this._dataUnit, this, sourceOptions);
|
|
351
|
+
opt.serverSideDatasource = this._dataSource = new DataSource(this._dataUnit, this, sourceOptions);
|
|
344
352
|
opt.serverSideSortOnServer = true;
|
|
345
353
|
opt.columnDefs = this._colDefs;
|
|
346
354
|
}
|
|
@@ -491,7 +499,7 @@ export default class AgGridController {
|
|
|
491
499
|
r.setData(data);
|
|
492
500
|
});
|
|
493
501
|
this._gridOptions.api.refreshCells({ force: true });
|
|
494
|
-
const invalidCell = this._editionManager.
|
|
502
|
+
const invalidCell = this._editionManager.getNextInvalidCell();
|
|
495
503
|
if (invalidCell) {
|
|
496
504
|
const rowNode = this._gridOptions.api.getRowNode(invalidCell.recordId);
|
|
497
505
|
if (rowNode && invalidCell.field) {
|
|
@@ -501,6 +509,8 @@ export default class AgGridController {
|
|
|
501
509
|
}
|
|
502
510
|
}
|
|
503
511
|
savingCanceled(fields, recordId) {
|
|
512
|
+
if (!this._gridShowDom)
|
|
513
|
+
return;
|
|
504
514
|
const displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
505
515
|
const rowIndex = this._gridOptions.api.getRowNode(recordId).rowIndex;
|
|
506
516
|
const columnFocus = displayedColumns.find(column => this.isColumnEditable(rowIndex, column) && fields.find(field => field.name === column.getColId()));
|
|
@@ -511,6 +521,7 @@ export default class AgGridController {
|
|
|
511
521
|
if (this._grid === undefined) {
|
|
512
522
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
513
523
|
}
|
|
524
|
+
this._gridOptions.api.clearRangeSelection();
|
|
514
525
|
this._gridOptions.api.refreshServerSide({ purge: true });
|
|
515
526
|
this._options.onRefresh();
|
|
516
527
|
if (scrollToSelectedRow)
|
|
@@ -533,12 +544,15 @@ export default class AgGridController {
|
|
|
533
544
|
}
|
|
534
545
|
setFocus() {
|
|
535
546
|
var _a, _b;
|
|
536
|
-
if ((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) {
|
|
537
|
-
this.setFocusFirstRow();
|
|
538
|
-
}
|
|
539
|
-
else {
|
|
547
|
+
if (!((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
540
548
|
this.focusOnGridContainer();
|
|
549
|
+
return;
|
|
541
550
|
}
|
|
551
|
+
if (!this._dataUnit.getSelectedRecord()) {
|
|
552
|
+
this.setFocusFirstRow();
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
this.syncSelectWithDataUnit();
|
|
542
556
|
}
|
|
543
557
|
setAutoFocus(autoFocus) {
|
|
544
558
|
var _a;
|
|
@@ -582,7 +596,26 @@ export default class AgGridController {
|
|
|
582
596
|
this.startEditionOnRowByIndex(newRowIndex);
|
|
583
597
|
}
|
|
584
598
|
}
|
|
599
|
+
syncSelectWithDataUnit() {
|
|
600
|
+
const rowNode = this._gridOptions.api.getRowNode(this._dataUnit.getSelectedRecord().__record__id__);
|
|
601
|
+
if ((rowNode === null || rowNode === void 0 ? void 0 : rowNode.rowIndex) < 0)
|
|
602
|
+
return;
|
|
603
|
+
const rowRange = this._gridOptions.api.getCellRanges().find(row => row.startRow.rowIndex === rowNode.rowIndex);
|
|
604
|
+
if ((rowRange === null || rowRange === void 0 ? void 0 : rowRange.columns.length) > 0) {
|
|
605
|
+
if (this._dataUnit.hasNewRecord()) {
|
|
606
|
+
this.startEdition(rowNode.rowIndex, rowRange.columns[0]);
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
this.focusByCollAndRow(rowRange.columns[0], rowNode.rowIndex);
|
|
610
|
+
this._gridOptions.api.addCellRange({ rowStartIndex: rowNode.rowIndex, rowEndIndex: rowNode.rowIndex, columns: rowRange.columns });
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
this._gridOptions.api.clearRangeSelection();
|
|
614
|
+
this.setFocusOnRow(rowNode.rowIndex);
|
|
615
|
+
}
|
|
585
616
|
startEdition(rowIndex, firstCol) {
|
|
617
|
+
if (!this._gridShowDom)
|
|
618
|
+
return;
|
|
586
619
|
this._gridOptions.api.clearRangeSelection();
|
|
587
620
|
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstCol] });
|
|
588
621
|
this._gridOptions.api.setFocusedCell(rowIndex, firstCol);
|
|
@@ -612,6 +645,7 @@ export default class AgGridController {
|
|
|
612
645
|
let displayedColumns = this._gridOptions.columnApi.getAllDisplayedColumns();
|
|
613
646
|
let firstColl = displayedColumns.find(column => column.getColDef().headerName !== '');
|
|
614
647
|
this.focusByCollAndRow(firstColl, rowIndex);
|
|
648
|
+
this._gridOptions.api.addCellRange({ rowStartIndex: rowIndex, rowEndIndex: rowIndex, columns: [firstColl] });
|
|
615
649
|
}
|
|
616
650
|
focusByCollAndRow(firstCell, rowIndex) {
|
|
617
651
|
this._gridOptions.api.ensureColumnVisible(firstCell);
|
|
@@ -651,6 +685,14 @@ export default class AgGridController {
|
|
|
651
685
|
this._gridOptions.api.setColumnDefs(this._colDefs);
|
|
652
686
|
}
|
|
653
687
|
}
|
|
688
|
+
hideSelectionColumn() {
|
|
689
|
+
var _a, _b;
|
|
690
|
+
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.columnApi) === null || _b === void 0 ? void 0 : _b.setColumnVisible(this.CHECK_BOX_COL_ID, false);
|
|
691
|
+
}
|
|
692
|
+
showSelectionColumn() {
|
|
693
|
+
var _a, _b;
|
|
694
|
+
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.columnApi) === null || _b === void 0 ? void 0 : _b.setColumnVisible(this.CHECK_BOX_COL_ID, true);
|
|
695
|
+
}
|
|
654
696
|
getColumnsDef() {
|
|
655
697
|
if (this._grid === undefined) {
|
|
656
698
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
@@ -935,18 +977,24 @@ export default class AgGridController {
|
|
|
935
977
|
return false;
|
|
936
978
|
}
|
|
937
979
|
onSelectionChange(event) {
|
|
980
|
+
var _a, _b;
|
|
981
|
+
const selectedRowId = (_b = (_a = event.api.getSelectedNodes()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
982
|
+
const isNewRecord = this._dataUnit.isNewRecord(selectedRowId);
|
|
938
983
|
if (!this._selectionChangeCallback)
|
|
939
984
|
return;
|
|
940
985
|
clearTimeout(this._selectionChangeDeboucing);
|
|
941
|
-
this._selectionChangeDeboucing = window.setTimeout(() => {
|
|
942
|
-
this.handleExecuteProceedAutosave();
|
|
986
|
+
this._selectionChangeDeboucing = window.setTimeout(async () => {
|
|
987
|
+
const saveSuccess = (!isNewRecord && selectedRowId) ? await this.handleExecuteProceedAutosave() : true;
|
|
988
|
+
if (!saveSuccess)
|
|
989
|
+
return;
|
|
943
990
|
this.processBuildSelectionChangeCallback(event);
|
|
944
991
|
}, 0);
|
|
945
992
|
}
|
|
946
|
-
handleExecuteProceedAutosave() {
|
|
993
|
+
async handleExecuteProceedAutosave() {
|
|
947
994
|
if (this._gridShowDom) {
|
|
948
|
-
this._editionManager.proceedAutoSave();
|
|
995
|
+
return await this._editionManager.proceedAutoSave();
|
|
949
996
|
}
|
|
997
|
+
return true;
|
|
950
998
|
}
|
|
951
999
|
processBuildSelectionChangeCallback(event) {
|
|
952
1000
|
if (this._dataUnit) {
|
|
@@ -971,7 +1019,12 @@ export default class AgGridController {
|
|
|
971
1019
|
});
|
|
972
1020
|
}
|
|
973
1021
|
onRowDoubleClick(evt) {
|
|
974
|
-
|
|
1022
|
+
var _a, _b;
|
|
1023
|
+
if (this._doubleClickCallBack && (!this._options.enableGridInsert || !this._dataUnit.hasNewRecord())) {
|
|
1024
|
+
/**
|
|
1025
|
+
* Evita mudança de view e a grade permanecer no modo de edição.
|
|
1026
|
+
*/
|
|
1027
|
+
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.stopEditing();
|
|
975
1028
|
this._doubleClickCallBack(evt.data);
|
|
976
1029
|
}
|
|
977
1030
|
}
|
|
@@ -987,22 +1040,29 @@ export default class AgGridController {
|
|
|
987
1040
|
}
|
|
988
1041
|
}
|
|
989
1042
|
setCellEditors(customEditors) {
|
|
990
|
-
var _a;
|
|
1043
|
+
var _a, _b, _c, _d, _e;
|
|
991
1044
|
if (!this._editionManager) {
|
|
992
1045
|
this._customEditors = customEditors;
|
|
993
1046
|
return;
|
|
994
1047
|
}
|
|
1048
|
+
const currentEditingCells = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.getEditingCells();
|
|
995
1049
|
this._editionManager.setCellEditors(customEditors);
|
|
996
|
-
(
|
|
1050
|
+
if ((currentEditingCells === null || currentEditingCells === void 0 ? void 0 : currentEditingCells.length) > 0) {
|
|
1051
|
+
this._gridOptions.api.startEditingCell({ colKey: (_d = (_c = currentEditingCells[0]) === null || _c === void 0 ? void 0 : _c.column) === null || _d === void 0 ? void 0 : _d.getColId(), rowIndex: (_e = currentEditingCells[0]) === null || _e === void 0 ? void 0 : _e.rowIndex });
|
|
1052
|
+
}
|
|
997
1053
|
}
|
|
998
1054
|
setCellRenders(customRenders) {
|
|
999
|
-
var _a;
|
|
1055
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1000
1056
|
if (!this._editionManager) {
|
|
1001
1057
|
this._customRenders = customRenders;
|
|
1002
1058
|
return;
|
|
1003
1059
|
}
|
|
1004
1060
|
this._editionManager.setCellRenders(customRenders);
|
|
1005
|
-
(_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api.
|
|
1061
|
+
const currentEditingCells = (_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.getEditingCells();
|
|
1062
|
+
(_c = this._gridOptions) === null || _c === void 0 ? void 0 : _c.api.redrawRows();
|
|
1063
|
+
if ((currentEditingCells === null || currentEditingCells === void 0 ? void 0 : currentEditingCells.length) > 0) {
|
|
1064
|
+
this._gridOptions.api.startEditingCell({ colKey: (_e = (_d = currentEditingCells[0]) === null || _d === void 0 ? void 0 : _d.column) === null || _e === void 0 ? void 0 : _e.getColId(), rowIndex: (_f = currentEditingCells[0]) === null || _f === void 0 ? void 0 : _f.rowIndex });
|
|
1065
|
+
}
|
|
1006
1066
|
}
|
|
1007
1067
|
clearInvalidCells(stopEdition) {
|
|
1008
1068
|
if (!this._editionManager)
|
|
@@ -1014,6 +1074,19 @@ export default class AgGridController {
|
|
|
1014
1074
|
this._editionManager.processContinuousInsert();
|
|
1015
1075
|
}
|
|
1016
1076
|
destroy() {
|
|
1077
|
+
var _a;
|
|
1017
1078
|
this.observer.disconnect();
|
|
1079
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1080
|
+
}
|
|
1081
|
+
registryListeners() {
|
|
1082
|
+
var _a;
|
|
1083
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.registryListeners();
|
|
1084
|
+
}
|
|
1085
|
+
resetPaginationState() {
|
|
1086
|
+
var _a, _b;
|
|
1087
|
+
(_b = (_a = this._gridOptions) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.clearRangeSelection();
|
|
1088
|
+
}
|
|
1089
|
+
stopEdit() {
|
|
1090
|
+
this._gridOptions.api.stopEditing();
|
|
1018
1091
|
}
|
|
1019
1092
|
}
|
|
@@ -6,12 +6,14 @@ export default class DataSource {
|
|
|
6
6
|
this._controller.clearInvalidCells();
|
|
7
7
|
this.handleRefreshOrReload(action);
|
|
8
8
|
this._controller.processContinuousInsert();
|
|
9
|
+
this._controller.showSelectionColumn();
|
|
9
10
|
}
|
|
10
11
|
handleEditionCanceled(action) {
|
|
11
12
|
if (this._options.enableGridInsert) {
|
|
12
13
|
this._controller.processEditionCanceled();
|
|
13
14
|
}
|
|
14
15
|
this.handleRefreshOrReload(action);
|
|
16
|
+
this._controller.showSelectionColumn();
|
|
15
17
|
}
|
|
16
18
|
handleSavingCanceled(action) {
|
|
17
19
|
var _a, _b, _c, _d;
|
|
@@ -66,6 +68,7 @@ export default class DataSource {
|
|
|
66
68
|
}
|
|
67
69
|
handleRecordsAdded() {
|
|
68
70
|
if (this._options.enableGridInsert) {
|
|
71
|
+
this._controller.hideSelectionColumn();
|
|
69
72
|
this._controller.refresh();
|
|
70
73
|
this.focusOnNewRecord();
|
|
71
74
|
}
|
|
@@ -213,6 +216,11 @@ export default class DataSource {
|
|
|
213
216
|
destroy() {
|
|
214
217
|
this._dataUnit.unsubscribe(this.duObserver);
|
|
215
218
|
}
|
|
219
|
+
registryListeners() {
|
|
220
|
+
var _a, _b;
|
|
221
|
+
(_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.duObserver);
|
|
222
|
+
(_b = this._dataUnit) === null || _b === void 0 ? void 0 : _b.subscribe(this.duObserver);
|
|
223
|
+
}
|
|
216
224
|
buildColumnDefs() {
|
|
217
225
|
const gridConfig = this._controller.getGridConfig() || [];
|
|
218
226
|
const columnDefs = [];
|