@sankhyalabs/ezui 5.21.0-dev.2 → 5.21.0-dev.21
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/README.md +1 -1
- package/dist/cjs/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +7 -5
- 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 +3 -3
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +433 -0
- 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 +2 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -1
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +95 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.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 +34 -4
- package/dist/cjs/ez-form.cjs.entry.js +78 -3
- package/dist/cjs/ez-grid.cjs.entry.js +333 -33
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +16 -5
- package/dist/cjs/ez-modal.cjs.entry.js +8 -9
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +35 -29
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +15 -9
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +18 -6
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +2 -2
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.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-a7b0c73d.js → index-9e5554cb.js} +11 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
- package/dist/collection/components/ez-button/ez-button.css +7 -0
- package/dist/collection/components/ez-button/ez-button.js +1 -1
- package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
- package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
- package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
- package/dist/collection/components/ez-chart/components/index.js +5 -0
- package/dist/collection/components/ez-chart/ez-chart.css +5 -0
- package/dist/collection/components/ez-chart/ez-chart.js +284 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
- package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +253 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +89 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +56 -5
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +58 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +6 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/ez-grid.css +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +233 -11
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +22 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.css +6 -2
- package/dist/collection/components/ez-modal/ez-modal.js +22 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +23 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +42 -27
- package/dist/collection/components/ez-popup/ez-popup.js +14 -8
- package/dist/collection/components/ez-search/ez-search.js +16 -5
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +1 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +26 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
- package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1081 -105
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +2 -1
- package/dist/esm/ez-alert-list.entry.js +7 -5
- 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 +3 -3
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +429 -0
- 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 +2 -1
- package/dist/esm/ez-combo-box.entry.js +2 -1
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +96 -3
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +34 -4
- package/dist/esm/ez-form.entry.js +79 -4
- package/dist/esm/ez-grid.entry.js +333 -33
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +2 -2
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +16 -5
- package/dist/esm/ez-modal.entry.js +9 -10
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +35 -29
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +15 -9
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_3.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +18 -6
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +2 -1
- package/dist/esm/ez-split-panel.entry.js +2 -2
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.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-baa5e267.js → index-5a720e56.js} +11 -5
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/p-085babb4.entry.js +1 -0
- package/dist/ezui/{p-91f626d3.entry.js → p-0e551dd4.entry.js} +1 -1
- package/dist/ezui/{p-af2ecb1b.entry.js → p-11b09aa1.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/p-23a796cc.entry.js +1 -0
- package/dist/ezui/{p-af95cd16.entry.js → p-24ca32a3.entry.js} +1 -1
- package/dist/ezui/{p-cc2dc4f4.entry.js → p-2a6e44a0.entry.js} +1 -1
- package/dist/ezui/p-2af4e2de.entry.js +1 -0
- package/dist/ezui/{p-baf80b13.entry.js → p-30951bd7.entry.js} +1 -1
- package/dist/ezui/p-31674f8e.entry.js +1 -0
- package/dist/ezui/{p-bf79aaa1.entry.js → p-33792b2b.entry.js} +1 -1
- package/dist/ezui/{p-b44741b0.entry.js → p-355c20f5.entry.js} +2 -2
- package/dist/ezui/{p-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
- package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
- package/dist/ezui/p-4559c266.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-507ec8ed.entry.js +1 -0
- package/dist/ezui/{p-8defa6d3.entry.js → p-51e4c040.entry.js} +1 -1
- package/dist/ezui/p-569a0b9a.entry.js +1 -0
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-072e6347.entry.js → p-82ac8b06.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/p-868b56f7.entry.js +1 -0
- package/dist/ezui/{p-85c8baae.entry.js → p-8eef0f70.entry.js} +1 -1
- package/dist/ezui/p-91ccae0c.entry.js +1 -0
- package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
- package/dist/ezui/p-9a11e223.entry.js +1 -0
- package/dist/ezui/{p-7af81663.entry.js → p-9a23d513.entry.js} +1 -1
- package/dist/ezui/p-9aa27e69.entry.js +1 -0
- package/dist/ezui/{p-784fe207.entry.js → p-9c2e2d68.entry.js} +1 -1
- package/dist/ezui/{p-9050d2cd.entry.js → p-b0e71d23.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-5bd5e68f.entry.js → p-c3b7a23e.entry.js} +1 -1
- package/dist/ezui/p-cd1a2e6b.entry.js +1 -0
- package/dist/ezui/p-d62ff380.entry.js +1 -0
- package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/p-e151e795.entry.js +1 -0
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/p-f1c3f85d.entry.js +1 -0
- package/dist/ezui/{p-49456b34.entry.js → p-f291db18.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
- package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/index.d.ts +5 -0
- package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
- package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
- package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
- package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
- package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
- package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +43 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +30 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +34 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +3 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
- package/dist/types/components/ez-search/ez-search.d.ts +2 -1
- package/dist/types/components.d.ts +223 -4
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +29 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-2a1a0e04.entry.js +0 -1
- package/dist/ezui/p-5e1d036e.entry.js +0 -1
- package/dist/ezui/p-5ef056ce.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-701231f0.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-9aefaa52.entry.js +0 -1
- package/dist/ezui/p-a1ec32ef.entry.js +0 -1
- package/dist/ezui/p-b041333c.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
|
@@ -6,6 +6,7 @@ export class EzNumberInput {
|
|
|
6
6
|
this._focused = false;
|
|
7
7
|
this._changePending = false;
|
|
8
8
|
this._valuePromiseCallbacks = [];
|
|
9
|
+
this._value = undefined;
|
|
9
10
|
this.label = undefined;
|
|
10
11
|
this.value = undefined;
|
|
11
12
|
this.enabled = true;
|
|
@@ -61,33 +62,40 @@ export class EzNumberInput {
|
|
|
61
62
|
}
|
|
62
63
|
observeValue(newValue, oldValue) {
|
|
63
64
|
if (this._textInput && newValue != oldValue) {
|
|
64
|
-
|
|
65
|
-
const oldValueValidated = this.validateValue(oldValue);
|
|
66
|
-
if (newValueValidated === null) {
|
|
67
|
-
this._textInput.value = '';
|
|
68
|
-
}
|
|
69
|
-
if (newValueValidated != oldValueValidated) {
|
|
70
|
-
const textValue = this.getTextValue(newValueValidated) || '';
|
|
71
|
-
if ((this._textInput.value || '') !== textValue) {
|
|
72
|
-
const parsedNumber = this.getParsedNumber(textValue);
|
|
73
|
-
if (parsedNumber !== undefined || !this._focused) {
|
|
74
|
-
this._textInput.value = textValue;
|
|
75
|
-
this._focused = false;
|
|
76
|
-
this.errorMessage = "";
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
80
|
-
this.ezChange.emit(valueEmitted);
|
|
81
|
-
}
|
|
65
|
+
this.handleNewValue(newValue, oldValue);
|
|
82
66
|
}
|
|
83
67
|
this._changePending = false;
|
|
84
68
|
}
|
|
69
|
+
observePrecision() {
|
|
70
|
+
if (this._textInput) {
|
|
71
|
+
this.setInputValue();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
handleNewValue(newValue, oldValue) {
|
|
75
|
+
const newValueValidated = this.validateValue(newValue);
|
|
76
|
+
const oldValueValidated = this.validateValue(oldValue);
|
|
77
|
+
if (newValueValidated === null) {
|
|
78
|
+
this._value = '';
|
|
79
|
+
}
|
|
80
|
+
if (newValueValidated === oldValueValidated) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const textValue = this.getTextValue(newValueValidated) || '';
|
|
84
|
+
const parsedNumber = this.getParsedNumber(textValue);
|
|
85
|
+
if ((this._value || '') !== textValue && (parsedNumber !== undefined || !this._focused)) {
|
|
86
|
+
this._value = textValue;
|
|
87
|
+
this._focused = false;
|
|
88
|
+
this.errorMessage = "";
|
|
89
|
+
}
|
|
90
|
+
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
91
|
+
this.ezChange.emit(valueEmitted);
|
|
92
|
+
}
|
|
85
93
|
validateValue(value) {
|
|
86
94
|
return isNaN(value) || value === undefined ? null : value;
|
|
87
95
|
}
|
|
88
96
|
getTextValue(value) {
|
|
89
97
|
if (value != undefined) {
|
|
90
|
-
return this.precision
|
|
98
|
+
return this.precision >= 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
91
99
|
}
|
|
92
100
|
return undefined;
|
|
93
101
|
}
|
|
@@ -140,17 +148,13 @@ export class EzNumberInput {
|
|
|
140
148
|
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
|
-
getParsedNumber(value) {
|
|
144
|
-
var _a;
|
|
145
|
-
if (value === void 0) {
|
|
146
|
-
value = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value;
|
|
147
|
-
}
|
|
151
|
+
getParsedNumber(value = this._textInput.value) {
|
|
148
152
|
return (value === null || value === void 0 ? void 0 : value.trim()) ? NumberUtils.stringToNumber(value) : undefined;
|
|
149
153
|
}
|
|
150
154
|
setInputValue() {
|
|
151
155
|
const textValue = this.getTextValue(this.value) || '';
|
|
152
|
-
if ((this.
|
|
153
|
-
this.
|
|
156
|
+
if ((this._value || '') !== textValue) {
|
|
157
|
+
this._value = textValue;
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
componentDidLoad() {
|
|
@@ -159,7 +163,7 @@ export class EzNumberInput {
|
|
|
159
163
|
}
|
|
160
164
|
render() {
|
|
161
165
|
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
162
|
-
return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }));
|
|
166
|
+
return (h("ez-text-input", { class: "number__input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError, value: this._value }));
|
|
163
167
|
}
|
|
164
168
|
static get is() { return "ez-number-input"; }
|
|
165
169
|
static get encapsulation() { return "shadow"; }
|
|
@@ -316,6 +320,11 @@ export class EzNumberInput {
|
|
|
316
320
|
}
|
|
317
321
|
};
|
|
318
322
|
}
|
|
323
|
+
static get states() {
|
|
324
|
+
return {
|
|
325
|
+
"_value": {}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
319
328
|
static get events() {
|
|
320
329
|
return [{
|
|
321
330
|
"method": "ezChange",
|
|
@@ -455,6 +464,12 @@ export class EzNumberInput {
|
|
|
455
464
|
}, {
|
|
456
465
|
"propName": "value",
|
|
457
466
|
"methodName": "observeValue"
|
|
467
|
+
}, {
|
|
468
|
+
"propName": "precision",
|
|
469
|
+
"methodName": "observePrecision"
|
|
470
|
+
}, {
|
|
471
|
+
"propName": "prettyPrecision",
|
|
472
|
+
"methodName": "observePrecision"
|
|
458
473
|
}];
|
|
459
474
|
}
|
|
460
475
|
}
|
|
@@ -20,10 +20,18 @@ export class EzPopup {
|
|
|
20
20
|
this.manageOverflow();
|
|
21
21
|
}
|
|
22
22
|
componentDidLoad() {
|
|
23
|
+
if (this.opened && this._popupRef) {
|
|
24
|
+
this._popupRef.focus();
|
|
25
|
+
}
|
|
23
26
|
new KeyboardManager({ propagate: false, element: this._element })
|
|
24
27
|
.bind("Enter", this.ezPopupAction.emit.bind("OK"))
|
|
25
|
-
.bind("Escape", () => this.
|
|
26
|
-
.bind("Esc", () => this.
|
|
28
|
+
.bind("Escape", () => this.closePopup())
|
|
29
|
+
.bind("Esc", () => this.closePopup());
|
|
30
|
+
}
|
|
31
|
+
closePopup() {
|
|
32
|
+
this.opened = false;
|
|
33
|
+
this.manageOverflow();
|
|
34
|
+
this.ezClosePopup.emit();
|
|
27
35
|
}
|
|
28
36
|
manageOverflow() {
|
|
29
37
|
if (this.opened) {
|
|
@@ -35,23 +43,20 @@ export class EzPopup {
|
|
|
35
43
|
}
|
|
36
44
|
manageOverlay() {
|
|
37
45
|
if (this.opened) {
|
|
38
|
-
this._overlayId = FloatingManager.subscribeOverlayControl(this.
|
|
46
|
+
this._overlayId = FloatingManager.subscribeOverlayControl(this._popupRef);
|
|
39
47
|
}
|
|
40
48
|
else {
|
|
41
|
-
FloatingManager.unsubscribeOverlayControl(this.
|
|
49
|
+
FloatingManager.unsubscribeOverlayControl(this._popupRef || this._overlayId);
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
getGridSize() {
|
|
45
53
|
return this._sizeClasses[this.size] || this._sizeClasses["medium"];
|
|
46
54
|
}
|
|
47
55
|
componentDidRender() {
|
|
48
|
-
if (this._container) {
|
|
49
|
-
this._container.focus();
|
|
50
|
-
}
|
|
51
56
|
this.manageOverlay();
|
|
52
57
|
}
|
|
53
58
|
render() {
|
|
54
|
-
return (h(Host, null, this.opened ? (h("div", { class: "overlay", ref: ref => this.
|
|
59
|
+
return (h(Host, null, this.opened ? (h("div", { class: "overlay", ref: ref => this._popupRef = ref, tabIndex: -1 }, h("div", { class: "popup col " + this.getGridSize() }, h("div", { class: "popup__container " + (this.heightMode === "auto" ? "popup__container--auto" : "") }, h("div", { class: "popup__content" }, h("div", { class: "popup__header " + (this.useHeader ? "popup__header--padding" : "") }, this.useHeader &&
|
|
55
60
|
h(Fragment, null, !!this.ezTitle && h("div", { class: "popup__title" }, this.ezTitle), h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } }))), h("div", { class: "popup__expandable-content" }, h("slot", null))))))) : undefined));
|
|
56
61
|
}
|
|
57
62
|
static get is() { return "ez-popup"; }
|
|
@@ -192,6 +197,7 @@ export class EzPopup {
|
|
|
192
197
|
}
|
|
193
198
|
}];
|
|
194
199
|
}
|
|
200
|
+
static get elementRef() { return "_element"; }
|
|
195
201
|
static get watchers() {
|
|
196
202
|
return [{
|
|
197
203
|
"propName": "opened",
|
|
@@ -46,11 +46,11 @@ export class EzSearch {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
observeValue(newValue, oldValue) {
|
|
49
|
+
async observeValue(newValue, oldValue) {
|
|
50
50
|
if (this._textInput && newValue != oldValue) {
|
|
51
51
|
try {
|
|
52
|
-
if (newValue === "string") {
|
|
53
|
-
this.
|
|
52
|
+
if (typeof newValue === "string") {
|
|
53
|
+
await this.handleValueAsString(newValue);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
const newValueSelected = this.getSelectedOption(newValue);
|
|
@@ -137,6 +137,14 @@ export class EzSearch {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
async handleValueAsString(value) {
|
|
141
|
+
if (this.getSelectedOption(value)) {
|
|
142
|
+
this.setInputValue();
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
await this.loadDescriptionValue(value);
|
|
146
|
+
this.ezChange.emit(this.value);
|
|
147
|
+
}
|
|
140
148
|
updateListPosition() {
|
|
141
149
|
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
142
150
|
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
@@ -308,9 +316,12 @@ export class EzSearch {
|
|
|
308
316
|
}
|
|
309
317
|
scrollToOption(opt) {
|
|
310
318
|
window.requestAnimationFrame(() => {
|
|
311
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
312
|
-
|
|
319
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
|
|
320
|
+
? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
|
|
321
|
+
: undefined;
|
|
322
|
+
if (liElem) {
|
|
313
323
|
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
324
|
+
}
|
|
314
325
|
});
|
|
315
326
|
}
|
|
316
327
|
selectCurrentOption() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -35,6 +35,13 @@ export default class DataBinder {
|
|
|
35
35
|
this.applyDefaultValues();
|
|
36
36
|
this._dataUnit.subscribe(this.onDataUnitEvent);
|
|
37
37
|
this._dataUnit.addInterceptor(this);
|
|
38
|
+
this.setContextDataBinder(dataUnit);
|
|
39
|
+
}
|
|
40
|
+
setContextDataBinder(dataUnit) {
|
|
41
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__") || new Map();
|
|
42
|
+
const dataBinders = [...(dataBindersByDataUnit.get(dataUnit.dataUnitId) || []), this];
|
|
43
|
+
dataBindersByDataUnit.set(dataUnit.dataUnitId, dataBinders);
|
|
44
|
+
ApplicationContext.setContextValue("__DATABINDER_BY_DATAUNIT__", dataBindersByDataUnit);
|
|
38
45
|
}
|
|
39
46
|
applyDefaultValues() {
|
|
40
47
|
const recordIds = (this._dataUnit.getAddedRecords() || []).map(r => r.__record__id__);
|
|
@@ -61,9 +68,17 @@ export default class DataBinder {
|
|
|
61
68
|
getMessageForField: field => this.getErrorMessage(field)
|
|
62
69
|
}, recordsValidator);
|
|
63
70
|
}
|
|
71
|
+
disconnectDataUnit() {
|
|
72
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__") || new Map();
|
|
73
|
+
const dataBinders = dataBindersByDataUnit.get(this._dataUnit.dataUnitId);
|
|
74
|
+
const dataBindersFiltered = dataBinders.filter((dataBinder) => JSON.stringify(dataBinder) !== JSON.stringify(this));
|
|
75
|
+
dataBindersByDataUnit.set(this._dataUnit.dataUnitId, dataBindersFiltered);
|
|
76
|
+
ApplicationContext.setContextValue("__DATABINDER_BY_DATAUNIT__", dataBindersByDataUnit);
|
|
77
|
+
}
|
|
64
78
|
onDisconnectedCallback() {
|
|
65
79
|
this._dataUnit.unsubscribe(this.onDataUnitEvent);
|
|
66
80
|
this._dataUnit.removeInterceptor(this);
|
|
81
|
+
this.disconnectDataUnit();
|
|
67
82
|
}
|
|
68
83
|
getCurrentRecordId() {
|
|
69
84
|
const record = this._dataUnit.getSelectedRecord();
|
|
@@ -110,6 +125,17 @@ export default class DataBinder {
|
|
|
110
125
|
validate() {
|
|
111
126
|
return this._recordValidatorProcessor.validate();
|
|
112
127
|
}
|
|
128
|
+
static async validateByDataunit(dataUnit) {
|
|
129
|
+
try {
|
|
130
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__");
|
|
131
|
+
const dataBinders = dataBindersByDataUnit.get(dataUnit.dataUnitId) || [];
|
|
132
|
+
await Promise.all(dataBinders.map((dataBinder) => dataBinder.validate()));
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
catch (_a) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
113
139
|
updateErrorMessage(fieldName, field, message) {
|
|
114
140
|
if (message == undefined) {
|
|
115
141
|
message = this._dataUnit.getInvalidMessage(this.getCurrentRecordId(), fieldName);
|
|
@@ -1,9 +1,46 @@
|
|
|
1
|
-
import { DataUnit } from "@sankhyalabs/core";
|
|
1
|
+
import { ApplicationContext, DataUnit } from "@sankhyalabs/core";
|
|
2
2
|
import DataBinder from "../DataBinder";
|
|
3
|
+
import { metadataTest } from "./resources/metadataTest";
|
|
3
4
|
describe('DataBinder', () => {
|
|
5
|
+
let dataBinder;
|
|
6
|
+
let dataUnit;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
dataUnit = new DataUnit();
|
|
9
|
+
dataUnit.metadata = metadataTest;
|
|
10
|
+
dataUnit.addRecord();
|
|
11
|
+
dataUnit.selectFirst();
|
|
12
|
+
dataBinder = new DataBinder(dataUnit);
|
|
13
|
+
});
|
|
4
14
|
it('constructor', async () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
expect(dataBinder).toBeTruthy();
|
|
16
|
+
});
|
|
17
|
+
it('ApplicationContext should be filled', () => {
|
|
18
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__") || new Map();
|
|
19
|
+
expect(dataBindersByDataUnit.get(dataUnit.dataUnitId).length).toBeGreaterThan(0);
|
|
20
|
+
});
|
|
21
|
+
it('ApplicationContext should be filled with two binders', () => {
|
|
22
|
+
new DataBinder(dataUnit);
|
|
23
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__") || new Map();
|
|
24
|
+
expect(dataBindersByDataUnit.get(dataUnit.dataUnitId).length).toBe(2);
|
|
25
|
+
});
|
|
26
|
+
it('should be invalid for empty fields', async () => {
|
|
27
|
+
const isValid = await DataBinder.validateByDataunit(dataUnit);
|
|
28
|
+
dataBinder['_recordValidatorProcessor'] = {
|
|
29
|
+
validate: () => Promise.reject(),
|
|
30
|
+
};
|
|
31
|
+
expect(isValid).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it('should be valid for filled fields', async () => {
|
|
34
|
+
await dataUnit.setFieldValue('NAME', 'João');
|
|
35
|
+
dataBinder['_recordValidatorProcessor'] = {
|
|
36
|
+
validate: () => Promise.resolve(),
|
|
37
|
+
};
|
|
38
|
+
const isValid = await DataBinder.validateByDataunit(dataUnit);
|
|
39
|
+
expect(isValid).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
it('should be remove dataBinder on disconnected', async () => {
|
|
42
|
+
dataBinder.onDisconnectedCallback();
|
|
43
|
+
const dataBindersByDataUnit = ApplicationContext.getContextValue("__DATABINDER_BY_DATAUNIT__") || new Map();
|
|
44
|
+
expect(dataBindersByDataUnit.get(dataUnit.dataUnitId).length).toBe(0);
|
|
8
45
|
});
|
|
9
46
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataType, UserInterface } from "@sankhyalabs/core";
|
|
2
|
+
export const metadataTest = {
|
|
3
|
+
"name": "clients",
|
|
4
|
+
"label": "clients",
|
|
5
|
+
"fields": [
|
|
6
|
+
{
|
|
7
|
+
"name": "NAME",
|
|
8
|
+
"label": "Nome",
|
|
9
|
+
"dataType": DataType.TEXT,
|
|
10
|
+
"userInterface": UserInterface.SHORTTEXT,
|
|
11
|
+
"readOnly": false,
|
|
12
|
+
"required": true
|
|
13
|
+
},
|
|
14
|
+
]
|
|
15
|
+
};
|
|
@@ -4,3 +4,5 @@ export { DialogType } from '../components/ez-dialog/DialogType';
|
|
|
4
4
|
export { CheckMode } from '../components/ez-check/CheckMode';
|
|
5
5
|
export { FormMetadata } from './form/FormMetadata';
|
|
6
6
|
export { default as DataBinder } from './form/DataBinder';
|
|
7
|
+
export { CustomEditorSource } from './customEditor/interfaces/ICustomEditor';
|
|
8
|
+
export { CustomRenderSource } from './customRender/interfaces/ICustomRender';
|
|
@@ -56,6 +56,12 @@ export const EzCardItem: {
|
|
|
56
56
|
new (): EzCardItem;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
interface EzChart extends Components.EzChart, HTMLElement {}
|
|
60
|
+
export const EzChart: {
|
|
61
|
+
prototype: EzChart;
|
|
62
|
+
new (): EzChart;
|
|
63
|
+
};
|
|
64
|
+
|
|
59
65
|
interface EzCheck extends Components.EzCheck, HTMLElement {}
|
|
60
66
|
export const EzCheck: {
|
|
61
67
|
prototype: EzCheck;
|
|
@@ -80,6 +86,12 @@ export const EzComboBox: {
|
|
|
80
86
|
new (): EzComboBox;
|
|
81
87
|
};
|
|
82
88
|
|
|
89
|
+
interface EzCustomFormInput extends Components.EzCustomFormInput, HTMLElement {}
|
|
90
|
+
export const EzCustomFormInput: {
|
|
91
|
+
prototype: EzCustomFormInput;
|
|
92
|
+
new (): EzCustomFormInput;
|
|
93
|
+
};
|
|
94
|
+
|
|
83
95
|
interface EzDateInput extends Components.EzDateInput, HTMLElement {}
|
|
84
96
|
export const EzDateInput: {
|
|
85
97
|
prototype: EzDateInput;
|