@sankhyalabs/ezui 5.21.0-dev.4 → 5.21.0-dev.41
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 +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 +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} +100 -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 +35 -4
- package/dist/cjs/ez-form.cjs.entry.js +78 -3
- package/dist/cjs/ez-grid.cjs.entry.js +376 -54
- 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 +12 -4
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +3 -3
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +38 -32
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- 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 +45 -35
- 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 +35 -30
- 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-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 +278 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +110 -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 +71 -23
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +10 -1
- 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 +59 -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 +10 -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/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
- package/dist/collection/components/ez-grid/ez-grid.css +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +265 -13
- 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-list/ez-list.js +28 -2
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +43 -34
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +1 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +34 -29
- 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 +1163 -166
- 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 +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 +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} +101 -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 +35 -4
- package/dist/esm/ez-form.entry.js +79 -4
- package/dist/esm/ez-grid.entry.js +376 -54
- 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 +12 -4
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +3 -3
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +39 -33
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- 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 +45 -35
- 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 +35 -30
- 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-034e21ca.entry.js +1 -0
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- 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-af95cd16.entry.js → p-24ca32a3.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-e85c48d7.entry.js → p-36180f4d.entry.js} +1 -1
- package/dist/ezui/{p-b44741b0.entry.js → p-3bb2491c.entry.js} +2 -2
- package/dist/ezui/{p-7bc07c31.entry.js → p-3f8c33e0.entry.js} +1 -1
- package/dist/ezui/p-439fbc78.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-569a0b9a.entry.js +1 -0
- package/dist/ezui/p-5fefcdc9.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-81cffa53.entry.js +1 -0
- 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-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-3faa2b46.entry.js → p-9634631d.entry.js} +1 -1
- package/dist/ezui/{p-f3c526cc.entry.js → p-9a11e223.entry.js} +1 -1
- 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-a35b41e6.entry.js +1 -0
- 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-c5a80844.entry.js +1 -0
- package/dist/ezui/{p-d9401ea0.entry.js → p-cd1a2e6b.entry.js} +1 -1
- package/dist/ezui/{p-bae4e180.entry.js → p-dbeee5aa.entry.js} +1 -1
- package/dist/ezui/p-de870657.entry.js +1 -0
- 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-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 +48 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +16 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +42 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +17 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -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 +6 -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/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +39 -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-list/ez-list.d.ts +5 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
- package/dist/types/components/ez-search/ez-search.d.ts +4 -2
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +3 -2
- package/dist/types/components.d.ts +248 -5
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +31 -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-44c5b6a5.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-8defa6d3.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-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-cc2dc4f4.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLBuilder } from "@sankhyalabs/core";
|
|
2
2
|
export const buildDecimal = ({ readOnly, props }) => {
|
|
3
|
-
|
|
4
|
-
const
|
|
3
|
+
var _a, _b;
|
|
4
|
+
const precision = Number((_a = props === null || props === void 0 ? void 0 : props.precision) !== null && _a !== void 0 ? _a : 2);
|
|
5
|
+
const prettyPrecision = Number((_b = props === null || props === void 0 ? void 0 : props.prettyPrecision) !== null && _b !== void 0 ? _b : precision);
|
|
5
6
|
return buildNumeric(readOnly, precision, prettyPrecision);
|
|
6
7
|
};
|
|
7
8
|
export const buildInteger = ({ readOnly }) => {
|
package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StringUtils } from "@sankhyalabs/core";
|
|
2
|
+
const columnsState = [{
|
|
3
|
+
colId: StringUtils.generateUUID(),
|
|
4
|
+
}];
|
|
5
|
+
const colDef = {
|
|
6
|
+
headerName: 'name',
|
|
7
|
+
checkboxSelection: false,
|
|
8
|
+
};
|
|
9
|
+
export const gridEditionImplementation = {
|
|
10
|
+
getComponents: () => ({}),
|
|
11
|
+
configureGrid: (option) => (Object.assign(Object.assign({}, option), { api: {
|
|
12
|
+
setHeaderHeight: () => { },
|
|
13
|
+
forEachNode: () => { },
|
|
14
|
+
}, context: {}, columnApi: {
|
|
15
|
+
moveColumn: () => { },
|
|
16
|
+
setColumnWidth: () => { },
|
|
17
|
+
setColumnsVisible: () => { },
|
|
18
|
+
applyColumnState: () => { },
|
|
19
|
+
getColumns: () => ([]),
|
|
20
|
+
getColumn: () => ({
|
|
21
|
+
getActualWidth: () => 30,
|
|
22
|
+
getColDef: () => colDef,
|
|
23
|
+
}),
|
|
24
|
+
getColumnState: () => columnsState,
|
|
25
|
+
} }))
|
|
26
|
+
};
|
|
27
|
+
export function buildOptions(dataUnit) {
|
|
28
|
+
return ({
|
|
29
|
+
allowMultipleSelection: true,
|
|
30
|
+
dataUnit,
|
|
31
|
+
onColumnStateChange: () => { },
|
|
32
|
+
onDoubleClick: () => { },
|
|
33
|
+
onPaginationChange: () => { },
|
|
34
|
+
onPaginationUpdate: () => { },
|
|
35
|
+
onSelectionChange: () => { },
|
|
36
|
+
serverURL: '',
|
|
37
|
+
statusResolver: {},
|
|
38
|
+
useEnterLikeTab: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -15,6 +15,8 @@ export class EzGrid {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
this._gridController = new AgGridController(false);
|
|
17
17
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
18
|
+
this._customEditor = new Map();
|
|
19
|
+
this._customRenders = new Map();
|
|
18
20
|
this._paginationInfo = undefined;
|
|
19
21
|
this._paginationChangedByKeyboard = true;
|
|
20
22
|
this._showSelectionCounter = false;
|
|
@@ -22,6 +24,7 @@ export class EzGrid {
|
|
|
22
24
|
this._currentPageSelected = undefined;
|
|
23
25
|
this._selectionCount = undefined;
|
|
24
26
|
this._hasLeftButtons = false;
|
|
27
|
+
this._customFormatters = new Map();
|
|
25
28
|
this.multipleSelection = undefined;
|
|
26
29
|
this.config = undefined;
|
|
27
30
|
this.selectionToastConfig = undefined;
|
|
@@ -32,6 +35,7 @@ export class EzGrid {
|
|
|
32
35
|
this.useEnterLikeTab = false;
|
|
33
36
|
this.recordsValidator = undefined;
|
|
34
37
|
this.canEdit = true;
|
|
38
|
+
this.autoFocus = true;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Aplica a definição de colunas.
|
|
@@ -93,6 +97,69 @@ export class EzGrid {
|
|
|
93
97
|
async filterColumns(search) {
|
|
94
98
|
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
95
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
102
|
+
*/
|
|
103
|
+
async addCustomEditor(fieldName, customEditor, detailContext) {
|
|
104
|
+
const newCustomEditor = new Map(this._customEditor);
|
|
105
|
+
newCustomEditor.set(fieldName, {
|
|
106
|
+
customEditor,
|
|
107
|
+
detailContext,
|
|
108
|
+
});
|
|
109
|
+
this._customEditor = newCustomEditor;
|
|
110
|
+
this._gridController.setCellEditors(newCustomEditor);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Registra um render customizado para colunas da grid.
|
|
114
|
+
*/
|
|
115
|
+
async addGridCustomRender(fieldName, customRender, detailContext) {
|
|
116
|
+
const newCustomRenders = new Map(this._customRenders);
|
|
117
|
+
newCustomRenders.set(fieldName, { customRender, detailContext });
|
|
118
|
+
this._customRenders = newCustomRenders;
|
|
119
|
+
this._gridController.setCellRenders(newCustomRenders);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Registra um formatador de valores para uma coluna da grid.
|
|
123
|
+
*/
|
|
124
|
+
async addCustomValueFormatter(columnName, customFormatter) {
|
|
125
|
+
if (!columnName || !customFormatter) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
129
|
+
newCustomFormatters.set(columnName, customFormatter);
|
|
130
|
+
this._customFormatters = newCustomFormatters;
|
|
131
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Remove o formatador de valores de uma coluna da grid.
|
|
135
|
+
*/
|
|
136
|
+
async removeCustomValueFormatter(columnName) {
|
|
137
|
+
if (!columnName) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const newCustomFormatters = new Map(this._customFormatters);
|
|
141
|
+
newCustomFormatters.delete(columnName);
|
|
142
|
+
this._customFormatters = newCustomFormatters;
|
|
143
|
+
this._gridController.setCustomFormatters(newCustomFormatters);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Atualiza linhas da grade.
|
|
147
|
+
*/
|
|
148
|
+
async refreshSelectedRows() {
|
|
149
|
+
this._gridController.refreshSelectedRows();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Retorna o formatador customizado da coluna caso exista.
|
|
153
|
+
*/
|
|
154
|
+
async getCustomValueFormatter(columnName) {
|
|
155
|
+
return this._customFormatters.get(columnName);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Atribui o foco para a grade.
|
|
159
|
+
*/
|
|
160
|
+
async setFocus() {
|
|
161
|
+
this._gridController.setFocus();
|
|
162
|
+
}
|
|
96
163
|
observeConfig(config) {
|
|
97
164
|
this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
|
|
98
165
|
}
|
|
@@ -246,7 +313,9 @@ export class EzGrid {
|
|
|
246
313
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
247
314
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
248
315
|
const dtInfo = { id: 'ezGrid' };
|
|
249
|
-
|
|
316
|
+
if (this._refPaginationControl) {
|
|
317
|
+
ElementIDUtils.addIDInfo(this._refPaginationControl, 'pagination', dtInfo);
|
|
318
|
+
}
|
|
250
319
|
}
|
|
251
320
|
previousPage() {
|
|
252
321
|
if (this.dataUnit) {
|
|
@@ -266,14 +335,10 @@ export class EzGrid {
|
|
|
266
335
|
(_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
|
|
267
336
|
}
|
|
268
337
|
getPaginationControl() {
|
|
269
|
-
if (this._paginationInfo)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })),
|
|
274
|
-
];
|
|
275
|
-
}
|
|
276
|
-
return null;
|
|
338
|
+
if (!this._paginationInfo)
|
|
339
|
+
return null;
|
|
340
|
+
const { currentPage, hasMore } = this._paginationInfo;
|
|
341
|
+
return (h("div", { class: "grid-header__container grid-header__pagination", ref: ref => (this._refPaginationControl = ref) }, h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium", ref: (element) => (this._refPaginationLabel = element) }, h("span", { class: "grid-header__pagination-label" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, this._getActualPageLabel()), this._getRemainingPageLabel())), h("div", { id: "grid-pagination-tooltip", ref: (element) => (this._refPaginationLabelTooltip = element), class: "ez-flex ez-margin-right--medium" }, h("ez-button", { size: "small", class: "ez-margin-right--medium", iconName: "chevron-left", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }), h("ez-button", { size: "small", iconName: "chevron-right", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }))));
|
|
277
342
|
}
|
|
278
343
|
componentDidLoad() {
|
|
279
344
|
this._gridController.initDatagrid(this._container, {
|
|
@@ -294,7 +359,14 @@ export class EzGrid {
|
|
|
294
359
|
statusResolver: this.statusResolver,
|
|
295
360
|
useEnterLikeTab: this.useEnterLikeTab,
|
|
296
361
|
recordsValidator: this.recordsValidator,
|
|
297
|
-
editionIsDisabled: () => !this.canEdit
|
|
362
|
+
editionIsDisabled: () => !this.canEdit,
|
|
363
|
+
customFormatters: this._customFormatters,
|
|
364
|
+
autoFocus: this.autoFocus,
|
|
365
|
+
onRefresh: () => {
|
|
366
|
+
if (this.dataUnit) {
|
|
367
|
+
this.setSelection(this.dataUnit.getSelectionInfo());
|
|
368
|
+
}
|
|
369
|
+
}
|
|
298
370
|
});
|
|
299
371
|
if (this.config) {
|
|
300
372
|
this.observeConfig(this.config);
|
|
@@ -310,7 +382,7 @@ export class EzGrid {
|
|
|
310
382
|
}
|
|
311
383
|
handlePaginationChange(selectFirstRecord, paginationInfo) {
|
|
312
384
|
var _a;
|
|
313
|
-
if (selectFirstRecord !== false) {
|
|
385
|
+
if (selectFirstRecord !== false && this.autoFocus) {
|
|
314
386
|
if (((_a = this._paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) > (paginationInfo === null || paginationInfo === void 0 ? void 0 : paginationInfo.currentPage) && this._paginationChangedByKeyboard) {
|
|
315
387
|
this._gridController.setFocusLastRow();
|
|
316
388
|
}
|
|
@@ -380,6 +452,9 @@ export class EzGrid {
|
|
|
380
452
|
if (!this.dataUnit.name.includes("InMemoryDataUnit"))
|
|
381
453
|
return;
|
|
382
454
|
}
|
|
455
|
+
componentDidUpdate() {
|
|
456
|
+
this._gridController.setAutoFocus(this.autoFocus);
|
|
457
|
+
}
|
|
383
458
|
getDataSource() {
|
|
384
459
|
var _a;
|
|
385
460
|
return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
@@ -389,7 +464,7 @@ export class EzGrid {
|
|
|
389
464
|
}
|
|
390
465
|
render() {
|
|
391
466
|
var _a;
|
|
392
|
-
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })),
|
|
467
|
+
return (h(Host, { "no-header": this.hideHeader() }, h("div", { class: "grid__container ez-grid", ref: elem => (this._container = elem) }), h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("filter-column", { class: "grid-header__popover", noHeaderTaskBar: !this._hasLeftButtons, dataSource: this.getDataSource(), dataUnit: this.dataUnit, gridHeaderHidden: this.hideHeader(), ref: (element) => (this._filterColumn = element) }), h("div", { class: "grid-header__position" }, h("div", { class: "grid-header__container grid-header__left-container" }, h("slot", { name: "leftButtons" })), this.getPaginationControl())), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
393
468
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
394
469
|
` }, h(SelectionCounter, { selectionCount: this._selectionCount, currentPageSelected: this._currentPageSelected, paginationInfo: this._paginationInfo, canSelectAll: (_a = this.selectionToastConfig) === null || _a === void 0 ? void 0 : _a.canSelectAll, allRecordSelected: this._isAllSelection, onSelectAll: () => this.onSelectAllRecords(), onSelectPage: () => this.onSelectPageRecords(), onClearAll: () => this.onClearSelectedRecords(), onClose: () => (this._showSelectionCounter = false) })), h("div", { class: "grid__footer" }, h("slot", { name: "footer" }))));
|
|
395
470
|
}
|
|
@@ -601,6 +676,24 @@ export class EzGrid {
|
|
|
601
676
|
"attribute": "can-edit",
|
|
602
677
|
"reflect": false,
|
|
603
678
|
"defaultValue": "true"
|
|
679
|
+
},
|
|
680
|
+
"autoFocus": {
|
|
681
|
+
"type": "boolean",
|
|
682
|
+
"mutable": false,
|
|
683
|
+
"complexType": {
|
|
684
|
+
"original": "boolean",
|
|
685
|
+
"resolved": "boolean",
|
|
686
|
+
"references": {}
|
|
687
|
+
},
|
|
688
|
+
"required": false,
|
|
689
|
+
"optional": true,
|
|
690
|
+
"docs": {
|
|
691
|
+
"tags": [],
|
|
692
|
+
"text": "Define se a grid ser\u00E1 focada ao ser carregada."
|
|
693
|
+
},
|
|
694
|
+
"attribute": "auto-focus",
|
|
695
|
+
"reflect": false,
|
|
696
|
+
"defaultValue": "true"
|
|
604
697
|
}
|
|
605
698
|
};
|
|
606
699
|
}
|
|
@@ -612,7 +705,8 @@ export class EzGrid {
|
|
|
612
705
|
"_isAllSelection": {},
|
|
613
706
|
"_currentPageSelected": {},
|
|
614
707
|
"_selectionCount": {},
|
|
615
|
-
"_hasLeftButtons": {}
|
|
708
|
+
"_hasLeftButtons": {},
|
|
709
|
+
"_customFormatters": {}
|
|
616
710
|
};
|
|
617
711
|
}
|
|
618
712
|
static get events() {
|
|
@@ -946,6 +1040,164 @@ export class EzGrid {
|
|
|
946
1040
|
"text": "Usa um argumento para filtrar as colunas po label",
|
|
947
1041
|
"tags": []
|
|
948
1042
|
}
|
|
1043
|
+
},
|
|
1044
|
+
"addCustomEditor": {
|
|
1045
|
+
"complexType": {
|
|
1046
|
+
"signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
|
|
1047
|
+
"parameters": [{
|
|
1048
|
+
"tags": [],
|
|
1049
|
+
"text": ""
|
|
1050
|
+
}, {
|
|
1051
|
+
"tags": [],
|
|
1052
|
+
"text": ""
|
|
1053
|
+
}, {
|
|
1054
|
+
"tags": [],
|
|
1055
|
+
"text": ""
|
|
1056
|
+
}],
|
|
1057
|
+
"references": {
|
|
1058
|
+
"Promise": {
|
|
1059
|
+
"location": "global"
|
|
1060
|
+
},
|
|
1061
|
+
"ICustomEditor": {
|
|
1062
|
+
"location": "import",
|
|
1063
|
+
"path": "../../utils/customEditor/interfaces/ICustomEditor"
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
"return": "Promise<void>"
|
|
1067
|
+
},
|
|
1068
|
+
"docs": {
|
|
1069
|
+
"text": "Registra um editor customizado para campos da grade e formul\u00E1rio.",
|
|
1070
|
+
"tags": []
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
"addGridCustomRender": {
|
|
1074
|
+
"complexType": {
|
|
1075
|
+
"signature": "(fieldName: string, customRender: ICustomRender, detailContext?: string) => Promise<void>",
|
|
1076
|
+
"parameters": [{
|
|
1077
|
+
"tags": [],
|
|
1078
|
+
"text": ""
|
|
1079
|
+
}, {
|
|
1080
|
+
"tags": [],
|
|
1081
|
+
"text": ""
|
|
1082
|
+
}, {
|
|
1083
|
+
"tags": [],
|
|
1084
|
+
"text": ""
|
|
1085
|
+
}],
|
|
1086
|
+
"references": {
|
|
1087
|
+
"Promise": {
|
|
1088
|
+
"location": "global"
|
|
1089
|
+
},
|
|
1090
|
+
"ICustomRender": {
|
|
1091
|
+
"location": "import",
|
|
1092
|
+
"path": "../../utils/customRender/interfaces/ICustomRender"
|
|
1093
|
+
}
|
|
1094
|
+
},
|
|
1095
|
+
"return": "Promise<void>"
|
|
1096
|
+
},
|
|
1097
|
+
"docs": {
|
|
1098
|
+
"text": "Registra um render customizado para colunas da grid.",
|
|
1099
|
+
"tags": []
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
"addCustomValueFormatter": {
|
|
1103
|
+
"complexType": {
|
|
1104
|
+
"signature": "(columnName: string, customFormatter: ICustomFormatter) => Promise<void>",
|
|
1105
|
+
"parameters": [{
|
|
1106
|
+
"tags": [],
|
|
1107
|
+
"text": ""
|
|
1108
|
+
}, {
|
|
1109
|
+
"tags": [],
|
|
1110
|
+
"text": ""
|
|
1111
|
+
}],
|
|
1112
|
+
"references": {
|
|
1113
|
+
"Promise": {
|
|
1114
|
+
"location": "global"
|
|
1115
|
+
},
|
|
1116
|
+
"ICustomFormatter": {
|
|
1117
|
+
"location": "import",
|
|
1118
|
+
"path": "./interfaces"
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
"return": "Promise<void>"
|
|
1122
|
+
},
|
|
1123
|
+
"docs": {
|
|
1124
|
+
"text": "Registra um formatador de valores para uma coluna da grid.",
|
|
1125
|
+
"tags": []
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
"removeCustomValueFormatter": {
|
|
1129
|
+
"complexType": {
|
|
1130
|
+
"signature": "(columnName: string) => Promise<void>",
|
|
1131
|
+
"parameters": [{
|
|
1132
|
+
"tags": [],
|
|
1133
|
+
"text": ""
|
|
1134
|
+
}],
|
|
1135
|
+
"references": {
|
|
1136
|
+
"Promise": {
|
|
1137
|
+
"location": "global"
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
"return": "Promise<void>"
|
|
1141
|
+
},
|
|
1142
|
+
"docs": {
|
|
1143
|
+
"text": "Remove o formatador de valores de uma coluna da grid.",
|
|
1144
|
+
"tags": []
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
"refreshSelectedRows": {
|
|
1148
|
+
"complexType": {
|
|
1149
|
+
"signature": "() => Promise<void>",
|
|
1150
|
+
"parameters": [],
|
|
1151
|
+
"references": {
|
|
1152
|
+
"Promise": {
|
|
1153
|
+
"location": "global"
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
"return": "Promise<void>"
|
|
1157
|
+
},
|
|
1158
|
+
"docs": {
|
|
1159
|
+
"text": "Atualiza linhas da grade.",
|
|
1160
|
+
"tags": []
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
"getCustomValueFormatter": {
|
|
1164
|
+
"complexType": {
|
|
1165
|
+
"signature": "(columnName: string) => Promise<ICustomFormatter | undefined>",
|
|
1166
|
+
"parameters": [{
|
|
1167
|
+
"tags": [],
|
|
1168
|
+
"text": ""
|
|
1169
|
+
}],
|
|
1170
|
+
"references": {
|
|
1171
|
+
"Promise": {
|
|
1172
|
+
"location": "global"
|
|
1173
|
+
},
|
|
1174
|
+
"ICustomFormatter": {
|
|
1175
|
+
"location": "import",
|
|
1176
|
+
"path": "./interfaces"
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
"return": "Promise<ICustomFormatter>"
|
|
1180
|
+
},
|
|
1181
|
+
"docs": {
|
|
1182
|
+
"text": "Retorna o formatador customizado da coluna caso exista.",
|
|
1183
|
+
"tags": []
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
"setFocus": {
|
|
1187
|
+
"complexType": {
|
|
1188
|
+
"signature": "() => Promise<void>",
|
|
1189
|
+
"parameters": [],
|
|
1190
|
+
"references": {
|
|
1191
|
+
"Promise": {
|
|
1192
|
+
"location": "global"
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
"return": "Promise<void>"
|
|
1196
|
+
},
|
|
1197
|
+
"docs": {
|
|
1198
|
+
"text": "Atribui o foco para a grade.",
|
|
1199
|
+
"tags": []
|
|
1200
|
+
}
|
|
949
1201
|
}
|
|
950
1202
|
};
|
|
951
1203
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ElementIDUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h } from "@stencil/core";
|
|
3
|
+
import { buildSelectAllLabel, buildSelectAllTitle, enableSelectAll, getText } from './utils/selectionCounterUtils';
|
|
3
4
|
export const SelectionCounter = (props) => {
|
|
4
5
|
const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
|
|
5
|
-
const { total, hasMore } = paginationInfo || {};
|
|
6
|
+
const { total, hasMore, count } = paginationInfo || {};
|
|
6
7
|
const shouldRenderSelectionButton = () => {
|
|
7
8
|
if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
|
|
8
9
|
return false;
|
|
@@ -11,17 +12,8 @@ export const SelectionCounter = (props) => {
|
|
|
11
12
|
return !!paginationInfo && (currentPageSelected || allRecordSelected);
|
|
12
13
|
};
|
|
13
14
|
return (h("div", Object.assign({ class: "ez-box ez-box--shadow-small" }, getElementID("ezGridSelectionCounter")), h("div", { class: "ez-flex ez-flex--align-items-center ez-size-width--full ez-padding-horizontal--medium" }, h("div", { class: "ez-flex ez-flex--wrap ez-flex--align-items-baseline ez-flex--justify-center" }, h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))), h("div", { class: "ez-flex ez-margin-right--medium" }, shouldRenderSelectionButton() &&
|
|
14
|
-
h("ez-button", Object.assign({ class: "ez-margin-right--medium", label:
|
|
15
|
+
h("ez-button", Object.assign({ key: "selectAllRecordsEzButton", title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))), h("ez-button", Object.assign({ key: "clearAllSelectionEzButton", class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))), h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")), h("ez-icon", { iconName: "close" })))));
|
|
15
16
|
};
|
|
16
|
-
function getText(selectionCount, allSelectedRecords) {
|
|
17
|
-
if (allSelectedRecords) {
|
|
18
|
-
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const pluralChar = selectionCount > 1 ? "s" : "";
|
|
22
|
-
return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
17
|
function getElementID(sufix) {
|
|
26
18
|
return {
|
|
27
19
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function enableSelectAll(total) {
|
|
2
|
+
return total !== undefined;
|
|
3
|
+
}
|
|
4
|
+
export function buildSelectAllLabel(allRecordSelected, count, total) {
|
|
5
|
+
if (allRecordSelected)
|
|
6
|
+
return 'Selecionar apenas a página atual';
|
|
7
|
+
if (total === undefined)
|
|
8
|
+
return `Carregando todos os ${count} registros`;
|
|
9
|
+
return `Selecionar todos os ${total} registros`;
|
|
10
|
+
}
|
|
11
|
+
export function buildSelectAllTitle(total) {
|
|
12
|
+
if (enableSelectAll(total))
|
|
13
|
+
return '';
|
|
14
|
+
return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
|
|
15
|
+
}
|
|
16
|
+
export function getText(selectionCount, allSelectedRecords) {
|
|
17
|
+
if (allSelectedRecords) {
|
|
18
|
+
return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
|
|
19
|
+
}
|
|
20
|
+
const pluralCharacter = selectionCount > 1 ? "s" : "";
|
|
21
|
+
return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DataType, DataUnit, StringUtils } from "@sankhyalabs/core";
|
|
2
|
+
export function getDataUnit() {
|
|
3
|
+
const dataUnit = new DataUnit('EzGridDU');
|
|
4
|
+
dataUnit.pageSize = 3;
|
|
5
|
+
dataUnit.metadata = {
|
|
6
|
+
name: "exemplo.datagrid",
|
|
7
|
+
label: "Exemplo data grid",
|
|
8
|
+
fields: [
|
|
9
|
+
{ name: "PRODUTO", label: "Produto", dataType: DataType.TEXT },
|
|
10
|
+
{ name: "QUANTIDADE", label: "Quantidade", dataType: DataType.NUMBER }
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
dataUnit.records = [
|
|
14
|
+
{ __record__id__: StringUtils.generateUUID(), "PRODUTO": "Mamão", "QUANTIDADE": 1 },
|
|
15
|
+
{ __record__id__: StringUtils.generateUUID(), "PRODUTO": "Mexerica", "QUANTIDADE": 2 }
|
|
16
|
+
];
|
|
17
|
+
dataUnit.selectFirst();
|
|
18
|
+
return dataUnit;
|
|
19
|
+
}
|
|
@@ -168,14 +168,18 @@ p {
|
|
|
168
168
|
display: flex;
|
|
169
169
|
|
|
170
170
|
/*public*/
|
|
171
|
-
padding: var(--space--2xs, 8px) var(--space--3xs, 4px);
|
|
172
|
-
margin: var(--ez-list__item--margin);
|
|
173
171
|
font-family: var(--ez-list__item--font-family);
|
|
174
172
|
font-size: var(--ez-list__item--font-size);
|
|
175
173
|
color: var(--ez-list__item--color);
|
|
176
174
|
border-bottom: var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color);
|
|
177
175
|
}
|
|
178
176
|
|
|
177
|
+
.draggable-list li > div {
|
|
178
|
+
/*public*/
|
|
179
|
+
padding: var(--space--2xs, 8px) var(--space--3xs, 4px);
|
|
180
|
+
margin: var(--ez-list__item--margin);
|
|
181
|
+
}
|
|
182
|
+
|
|
179
183
|
.over {
|
|
180
184
|
/*public*/
|
|
181
185
|
border-top: 1px dashed var(--ez-list__over--border--color);
|
|
@@ -514,6 +514,9 @@ export class EzList {
|
|
|
514
514
|
}
|
|
515
515
|
return h("div", { class: className, innerHTML: customContent });
|
|
516
516
|
}
|
|
517
|
+
doubleClickItem(item) {
|
|
518
|
+
this.ezDoubleClick.emit(item);
|
|
519
|
+
}
|
|
517
520
|
render() {
|
|
518
521
|
return (h(Host, { ref: el => (this._element = el) }, this.useGroups ? (h("div", { class: "group-container", ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => {
|
|
519
522
|
this.keyDownHandler(event);
|
|
@@ -523,7 +526,9 @@ export class EzList {
|
|
|
523
526
|
'hover-feedback': this.hoverFeedback,
|
|
524
527
|
}, key: 'item_' + item.id }, {
|
|
525
528
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`),
|
|
526
|
-
}), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''),
|
|
529
|
+
}), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDblClick: () => {
|
|
530
|
+
this.doubleClickItem(item);
|
|
531
|
+
}, onClick: () => {
|
|
527
532
|
this.setSelection(item);
|
|
528
533
|
}, onDragLeave: () => {
|
|
529
534
|
group.sort ? undefined : this.removeOverClass();
|
|
@@ -537,7 +542,9 @@ export class EzList {
|
|
|
537
542
|
} }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
|
|
538
543
|
'selectable-container': this.ezSelectable,
|
|
539
544
|
'hover-feedback': this.hoverFeedback,
|
|
540
|
-
}, key: 'item_' + item.id }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`) }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index }),
|
|
545
|
+
}, key: 'item_' + item.id }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezListItem__${StringUtils.replaceAccentuatedChars(item.label)}`) }), h("div", { class: 'draggable' + (item.selected == true ? ' selected-item ' : '') + (this.ezSelectable == true ? ' selectable ' : ''), onDragStart: () => this.onDragStart({ item: item, index: index }), onDblClick: () => {
|
|
546
|
+
this.doubleClickItem(item);
|
|
547
|
+
}, onClick: () => {
|
|
541
548
|
this.setSelection(item);
|
|
542
549
|
}, onDragLeave: () => this.removeOverClass(), onDragOver: event => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: event => this.onDrop(event, { item: item, index: index }), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.listMode === 'regular' ? (h(Fragment, null, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, !!this.itemLeftSlotBuilder && this.getContainerItemBuilder('left', item), h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label))) : (h(Fragment, null, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("ez-check", { label: item.label, value: item.check, onEzChange: evt => this.ezCheckChange.emit({ id: item.id, label: item.label, check: evt.detail }) })))), !!this.itemSlotBuilder && this.getContainerItemBuilder('right', item))))), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: event => {
|
|
543
550
|
this.onDragOverLastIndex(event);
|
|
@@ -787,6 +794,25 @@ export class EzList {
|
|
|
787
794
|
}
|
|
788
795
|
}
|
|
789
796
|
}
|
|
797
|
+
}, {
|
|
798
|
+
"method": "ezDoubleClick",
|
|
799
|
+
"name": "ezDoubleClick",
|
|
800
|
+
"bubbles": true,
|
|
801
|
+
"cancelable": true,
|
|
802
|
+
"composed": true,
|
|
803
|
+
"docs": {
|
|
804
|
+
"tags": [],
|
|
805
|
+
"text": "Emitido quando ocorre um duplo clique em um item da lista."
|
|
806
|
+
},
|
|
807
|
+
"complexType": {
|
|
808
|
+
"original": "ListItem",
|
|
809
|
+
"resolved": "ListItem",
|
|
810
|
+
"references": {
|
|
811
|
+
"ListItem": {
|
|
812
|
+
"location": "local"
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
790
816
|
}];
|
|
791
817
|
}
|
|
792
818
|
static get methods() {
|
|
@@ -47,7 +47,7 @@ export class EzModalContainer {
|
|
|
47
47
|
this._closeButton.focus();
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1 }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
50
|
+
return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "ez-modal-container"; }
|
|
53
53
|
static get encapsulation() { return "scoped"; }
|