@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-6165.0 → 0.0.0-bugfix-dev-KB-17130.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/README.md +8 -10
- package/dist/cjs/{ApplicationUtils-2e444734.js → ApplicationUtils-c9d1205c.js} +56 -6
- package/dist/cjs/{RecordValidationProcessor-edd23705.js → RecordValidationProcessor-4c893e04.js} +1 -1
- package/dist/cjs/{constants-3a1d64fb.js → constants-2714478b.js} +2 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +56 -28
- package/dist/cjs/ez-alert-list.cjs.entry.js +148 -0
- 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 +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_3.cjs.entry.js +182 -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 +3 -4
- package/dist/cjs/ez-combo-box.cjs.entry.js +17 -152
- 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 +31 -5
- package/dist/cjs/ez-dropdown.cjs.entry.js +12 -6
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +44 -3
- package/dist/cjs/ez-form.cjs.entry.js +36 -4
- package/dist/cjs/ez-grid.cjs.entry.js +246 -64
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +7 -1
- package/dist/cjs/ez-icon.cjs.entry.js +2 -2
- package/dist/cjs/ez-list.cjs.entry.js +5 -3
- 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 +23 -10
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- 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_3.cjs.entry.js +8 -6
- package/dist/cjs/ez-search.cjs.entry.js +615 -32
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +19 -0
- package/dist/cjs/ez-split-panel.cjs.entry.js +776 -0
- 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-edit.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-input.cjs.entry.js +3 -2
- 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 +2 -2
- 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 +47 -12
- package/dist/cjs/{index-1064511f.js → index-a7b0c73d.js} +16 -6
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +6 -3
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +17 -3
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +105 -27
- package/dist/collection/components/ez-alert-list/ez-alert-list.css +87 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +268 -0
- package/dist/collection/components/ez-card-item/ez-card-item.css +17 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -1
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +0 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +71 -169
- package/dist/collection/components/ez-dialog/ez-dialog.css +1 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +39 -4
- package/dist/collection/components/ez-dropdown/ez-dropdown.css +4 -3
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +33 -4
- package/dist/collection/components/ez-form/ez-form.js +93 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +23 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +4 -1
- package/dist/collection/components/ez-form-view/structure/index.js +34 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +21 -9
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +23 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js +1 -1
- package/dist/collection/components/ez-grid/ez-grid.css +1 -4
- package/dist/collection/components/ez-grid/ez-grid.js +91 -51
- package/dist/collection/components/ez-grid/interfaces/IColumnFilter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +66 -12
- package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js +62 -0
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +94 -0
- package/dist/collection/components/ez-grid/utils/index.js +1 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js +22 -0
- package/dist/collection/components/ez-icon/ez-icon.css +148 -139
- package/dist/collection/components/ez-list/ez-list.css +12 -7
- package/dist/collection/components/ez-list/ez-list.js +3 -1
- package/dist/collection/components/ez-modal/ez-modal.css +1 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +41 -10
- package/dist/collection/components/ez-popup/ez-popup.css +2 -2
- package/dist/collection/components/ez-search/ez-search.css +330 -0
- package/dist/collection/components/ez-search/ez-search.js +746 -55
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +8 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +122 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +12 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +17 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +20 -1
- package/dist/collection/components/ez-tree/ez-tree.css +33 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +3 -3
- package/dist/collection/utils/ApplicationUtils.js +56 -6
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +12 -1
- package/dist/collection/utils/interfaces/IAction.js +1 -0
- package/dist/custom-elements/index.d.ts +18 -0
- package/dist/custom-elements/index.js +2138 -339
- package/dist/esm/{ApplicationUtils-d9a34a16.js → ApplicationUtils-eaf91331.js} +56 -6
- package/dist/esm/{RecordValidationProcessor-abc814af.js → RecordValidationProcessor-b00b8b77.js} +1 -1
- package/dist/esm/constants-4e0d35b7.js +5 -0
- package/dist/esm/ez-actions-button.entry.js +56 -28
- package/dist/esm/ez-alert-list.entry.js +144 -0
- 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 +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_3.entry.js +176 -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 +3 -4
- package/dist/esm/ez-combo-box.entry.js +18 -153
- 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 +31 -5
- package/dist/esm/ez-dropdown.entry.js +12 -6
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +44 -3
- package/dist/esm/ez-form.entry.js +36 -4
- package/dist/esm/ez-grid.entry.js +247 -65
- package/dist/esm/ez-guide-navigator.entry.js +7 -1
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +5 -3
- 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 +23 -10
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_3.entry.js +8 -6
- package/dist/esm/ez-search.entry.js +616 -33
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +15 -0
- package/dist/esm/ez-split-panel.entry.js +772 -0
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-edit.entry.js +2 -2
- package/dist/esm/ez-text-input.entry.js +3 -2
- 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 +2 -2
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +47 -12
- package/dist/esm/{index-296b8458.js → index-baa5e267.js} +16 -6
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-5cef0264.entry.js → p-0306dff7.entry.js} +1 -1
- package/dist/ezui/p-0447d17c.entry.js +1 -0
- package/dist/ezui/{p-86a2036d.js → p-04f24913.js} +1 -1
- package/dist/ezui/p-05e1f4e7.js +1 -0
- package/dist/ezui/p-072e6347.entry.js +1 -0
- package/dist/ezui/p-133fae4a.entry.js +1 -0
- package/dist/ezui/{p-f4208819.entry.js → p-17be134a.entry.js} +1 -1
- package/dist/ezui/{p-cd19a6f8.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-60ba28ea.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/{p-a5e09759.entry.js → p-20ec22c0.entry.js} +1 -1
- package/dist/ezui/p-2187f86c.js +1 -0
- package/dist/ezui/{p-e318d280.js → p-23a36bb6.js} +1 -1
- package/dist/ezui/{p-ce035beb.entry.js → p-24d3fede.entry.js} +1 -1
- package/dist/ezui/p-2a1a0e04.entry.js +1 -0
- package/dist/ezui/p-40f72de4.entry.js +1 -0
- package/dist/ezui/p-43b03119.entry.js +1 -0
- package/dist/ezui/{p-9b347f04.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/p-49456b34.entry.js +1 -0
- package/dist/ezui/p-4a7f113d.entry.js +1 -0
- package/dist/ezui/p-51c5e071.entry.js +1 -0
- package/dist/ezui/{p-ccb4ccd9.entry.js → p-555c9018.entry.js} +1 -1
- package/dist/ezui/{p-d43b22f3.entry.js → p-596634e9.entry.js} +1 -1
- package/dist/ezui/p-5bd5e68f.entry.js +1 -0
- package/dist/ezui/{p-a01068e1.entry.js → p-5d692ed1.entry.js} +1 -1
- package/dist/ezui/{p-95426f93.entry.js → p-5d86cca9.entry.js} +1 -1
- package/dist/ezui/p-5e1d036e.entry.js +1 -0
- package/dist/ezui/{p-7525e604.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/{p-c49dbf23.entry.js → p-650e4b6d.entry.js} +1 -1
- package/dist/ezui/{p-fd54b5b4.entry.js → p-6e2f8e6b.entry.js} +2 -2
- package/dist/ezui/p-6e429cff.entry.js +1 -0
- package/dist/ezui/p-76ba9d67.entry.js +1 -0
- package/dist/ezui/{p-37673563.entry.js → p-77a4bd35.entry.js} +1 -1
- package/dist/ezui/p-796c1a88.entry.js +1 -0
- package/dist/ezui/{p-5d6f2550.entry.js → p-85c8baae.entry.js} +1 -1
- package/dist/ezui/{p-fa571a4e.entry.js → p-8becebf8.entry.js} +1 -1
- package/dist/ezui/p-8defa6d3.entry.js +1 -0
- package/dist/ezui/{p-391de0e4.entry.js → p-9050d2cd.entry.js} +1 -1
- package/dist/ezui/{p-028f264f.entry.js → p-9cad9b6e.entry.js} +1 -1
- package/dist/ezui/{p-b11f035c.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/p-a08b309b.entry.js +1 -0
- package/dist/ezui/{p-2da09f70.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/p-af15c277.entry.js +1 -0
- package/dist/ezui/{p-32b4163f.entry.js → p-b041333c.entry.js} +1 -1
- package/dist/ezui/p-ba875f37.entry.js +1 -0
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/{p-e2dfd935.entry.js → p-c0f1715f.entry.js} +1 -1
- package/dist/ezui/{p-83885b21.entry.js → p-cc2dc4f4.entry.js} +1 -1
- package/dist/ezui/p-d6ffe679.entry.js +1 -0
- package/dist/ezui/p-eb36f072.entry.js +1 -0
- package/dist/ezui/p-f56dd1da.entry.js +1 -0
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +15 -7
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +76 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +12 -15
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +8 -2
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +5 -0
- package/dist/types/components/ez-form/ez-form.d.ts +19 -1
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +5 -0
- package/dist/types/components/ez-form-view/structure/index.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +9 -6
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -3
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +13 -5
- package/dist/types/components/ez-grid/interfaces/IColumnFilter.d.ts +4 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +8 -0
- package/dist/types/components/ez-grid/utils/ColumnFilterManager.d.ts +9 -0
- package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +19 -0
- package/dist/types/components/ez-grid/utils/index.d.ts +1 -0
- package/dist/types/components/ez-guide-navigator/ez-guide-navigator.d.ts +4 -0
- package/dist/types/components/ez-guide-navigator/interfaces/IGuideItem.d.ts +1 -0
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +4 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts +2 -0
- package/dist/types/components/ez-search/ez-search.d.ts +112 -10
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +3 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
- package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
- package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +1 -0
- package/dist/types/components.d.ts +236 -17
- package/dist/types/utils/ApplicationUtils.d.ts +24 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/form/DataBinder.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +2 -1
- package/dist/types/utils/interfaces/IAction.d.ts +7 -0
- package/package.json +4 -3
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +0 -52
- package/dist/cjs/ez-filter-input_2.cjs.entry.js +0 -137
- package/dist/esm/constants-6dab64f7.js +0 -4
- package/dist/esm/ez-card-item.entry.js +0 -48
- package/dist/esm/ez-filter-input_2.entry.js +0 -132
- package/dist/ezui/p-050247dc.entry.js +0 -1
- package/dist/ezui/p-1e7c4986.entry.js +0 -1
- package/dist/ezui/p-244dfe8a.entry.js +0 -1
- package/dist/ezui/p-27a01a26.js +0 -1
- package/dist/ezui/p-2a0e1679.entry.js +0 -1
- package/dist/ezui/p-4535da17.entry.js +0 -1
- package/dist/ezui/p-4c8b029b.entry.js +0 -1
- package/dist/ezui/p-4e31b69b.entry.js +0 -1
- package/dist/ezui/p-5495fa45.entry.js +0 -1
- package/dist/ezui/p-5ce6548c.entry.js +0 -1
- package/dist/ezui/p-68352e41.entry.js +0 -1
- package/dist/ezui/p-87e85160.entry.js +0 -1
- package/dist/ezui/p-8bd3903b.entry.js +0 -1
- package/dist/ezui/p-90fa4cb3.entry.js +0 -1
- package/dist/ezui/p-9285b53e.entry.js +0 -1
- package/dist/ezui/p-a510a4c5.entry.js +0 -1
- package/dist/ezui/p-d51aa09b.entry.js +0 -1
- package/dist/ezui/p-db528b31.entry.js +0 -1
- package/dist/ezui/p-e67d0bd5.entry.js +0 -1
- package/dist/ezui/p-e7fa0ad6.entry.js +0 -1
- package/dist/ezui/p-f15ec3bb.js +0 -1
- package/dist/ezui/p-ff82b176.entry.js +0 -1
|
@@ -14,6 +14,7 @@ export class EzForm {
|
|
|
14
14
|
this.dataUnit = undefined;
|
|
15
15
|
this.config = undefined;
|
|
16
16
|
this.recordsValidator = undefined;
|
|
17
|
+
this.fieldToFocus = undefined;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Realiza validação no conteúdo de todos os campos.
|
|
@@ -48,6 +49,7 @@ export class EzForm {
|
|
|
48
49
|
if (currentSheet == undefined) {
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
52
|
+
this.ezFormSetFields.emit(fields);
|
|
51
53
|
const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
|
|
52
54
|
return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
|
|
53
55
|
}
|
|
@@ -79,6 +81,22 @@ export class EzForm {
|
|
|
79
81
|
metadata.addRequiredFields(this._staticFields.filter(f => f.dataset.required).map(f => f.dataset.fieldName));
|
|
80
82
|
this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
|
|
81
83
|
this.ezReady.emit();
|
|
84
|
+
this.handleFieldToFocus();
|
|
85
|
+
}
|
|
86
|
+
handleFieldToFocus() {
|
|
87
|
+
var _a;
|
|
88
|
+
if (this.fieldToFocus == undefined) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
|
|
92
|
+
const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
|
|
93
|
+
if (!fields.some(item => item.name === this.fieldToFocus)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
this._dataBinder.setFocus(this.fieldToFocus);
|
|
98
|
+
this.ezFormRequestClearFieldToFocus.emit();
|
|
99
|
+
});
|
|
82
100
|
}
|
|
83
101
|
disconnectedCallback() {
|
|
84
102
|
this.dataUnit.unsubscribe(this.onDataUnitAction);
|
|
@@ -166,11 +184,66 @@ export class EzForm {
|
|
|
166
184
|
"tags": [],
|
|
167
185
|
"text": "Define um validador respons\u00E1vel pela integridade dos registros."
|
|
168
186
|
}
|
|
187
|
+
},
|
|
188
|
+
"fieldToFocus": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "string",
|
|
193
|
+
"resolved": "string",
|
|
194
|
+
"references": {}
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"optional": false,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Determina o campo que deve ficar em evid\u00EAncia."
|
|
201
|
+
},
|
|
202
|
+
"attribute": "field-to-focus",
|
|
203
|
+
"reflect": false
|
|
169
204
|
}
|
|
170
205
|
};
|
|
171
206
|
}
|
|
172
207
|
static get events() {
|
|
173
208
|
return [{
|
|
209
|
+
"method": "ezFormRequestClearFieldToFocus",
|
|
210
|
+
"name": "ezFormRequestClearFieldToFocus",
|
|
211
|
+
"bubbles": true,
|
|
212
|
+
"cancelable": true,
|
|
213
|
+
"composed": true,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": "Emitido quando o campo recebe foco"
|
|
217
|
+
},
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "void",
|
|
220
|
+
"resolved": "void",
|
|
221
|
+
"references": {}
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
"method": "ezFormSetFields",
|
|
225
|
+
"name": "ezFormSetFields",
|
|
226
|
+
"bubbles": true,
|
|
227
|
+
"cancelable": true,
|
|
228
|
+
"composed": true,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "Emitido quando o campo recebe foco"
|
|
232
|
+
},
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "Array<IFieldConfig>",
|
|
235
|
+
"resolved": "IFieldConfig[]",
|
|
236
|
+
"references": {
|
|
237
|
+
"Array": {
|
|
238
|
+
"location": "global"
|
|
239
|
+
},
|
|
240
|
+
"IFieldConfig": {
|
|
241
|
+
"location": "import",
|
|
242
|
+
"path": "../../utils/form/interfaces"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}, {
|
|
174
247
|
"method": "ezReady",
|
|
175
248
|
"name": "ezReady",
|
|
176
249
|
"bubbles": true,
|
|
@@ -185,6 +258,26 @@ export class EzForm {
|
|
|
185
258
|
"resolved": "void",
|
|
186
259
|
"references": {}
|
|
187
260
|
}
|
|
261
|
+
}, {
|
|
262
|
+
"method": "formItemsReady",
|
|
263
|
+
"name": "formItemsReady",
|
|
264
|
+
"bubbles": true,
|
|
265
|
+
"cancelable": true,
|
|
266
|
+
"composed": true,
|
|
267
|
+
"docs": {
|
|
268
|
+
"tags": [],
|
|
269
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
|
270
|
+
},
|
|
271
|
+
"complexType": {
|
|
272
|
+
"original": "FormItems",
|
|
273
|
+
"resolved": "FormItems",
|
|
274
|
+
"references": {
|
|
275
|
+
"FormItems": {
|
|
276
|
+
"location": "import",
|
|
277
|
+
"path": "../ez-form-view/structure"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
188
281
|
}];
|
|
189
282
|
}
|
|
190
283
|
static get methods() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
2
|
import { fieldBuilder } from './fieldbuilder/FieldBuilder';
|
|
3
3
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
4
|
+
import { FormItems } from './structure';
|
|
4
5
|
export class EzFormView {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.fields = undefined;
|
|
@@ -28,6 +29,8 @@ export class EzFormView {
|
|
|
28
29
|
}
|
|
29
30
|
componentDidRender() {
|
|
30
31
|
this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));
|
|
32
|
+
const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
|
|
33
|
+
this.formItemsReady.emit(formItems);
|
|
31
34
|
}
|
|
32
35
|
render() {
|
|
33
36
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
@@ -105,6 +108,26 @@ export class EzFormView {
|
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
}
|
|
111
|
+
}, {
|
|
112
|
+
"method": "formItemsReady",
|
|
113
|
+
"name": "formItemsReady",
|
|
114
|
+
"bubbles": true,
|
|
115
|
+
"cancelable": true,
|
|
116
|
+
"composed": true,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
|
120
|
+
},
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "FormItems",
|
|
123
|
+
"resolved": "FormItems",
|
|
124
|
+
"references": {
|
|
125
|
+
"FormItems": {
|
|
126
|
+
"location": "import",
|
|
127
|
+
"path": "./structure"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
108
131
|
}];
|
|
109
132
|
}
|
|
110
133
|
static get methods() {
|
|
@@ -23,5 +23,8 @@ uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
|
|
|
23
23
|
export const fieldBuilder = (field) => {
|
|
24
24
|
const builder = uiBuilders.get(field.userInterface) || buildTextInput;
|
|
25
25
|
const label = field.required ? `${field.label}${REQUIRED_INFO}` : field.label;
|
|
26
|
-
|
|
26
|
+
const builtElement = builder(Object.assign(Object.assign({}, field), { label }));
|
|
27
|
+
//@ts-ignore
|
|
28
|
+
builtElement.$attrs$['data-form-item'] = field.name;
|
|
29
|
+
return builtElement;
|
|
27
30
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
class FormItem {
|
|
2
|
+
constructor(elem) {
|
|
3
|
+
this.elem = elem;
|
|
4
|
+
}
|
|
5
|
+
addRightElement(el) {
|
|
6
|
+
this.removeRightElement();
|
|
7
|
+
el.classList.add('ez-padding-left--small');
|
|
8
|
+
el.setAttribute('data-custom-item', 'true');
|
|
9
|
+
this.elem.classList.add('ez-col--nowrap');
|
|
10
|
+
this.elem.appendChild(el);
|
|
11
|
+
}
|
|
12
|
+
removeRightElement() {
|
|
13
|
+
Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach(item => item.remove());
|
|
14
|
+
}
|
|
15
|
+
get fieldName() {
|
|
16
|
+
return this.elem.getAttribute('data-form-item');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class FormItems {
|
|
20
|
+
constructor(items, formId) {
|
|
21
|
+
this.items = new Map();
|
|
22
|
+
this.formId = formId;
|
|
23
|
+
items.forEach(item => {
|
|
24
|
+
const formItem = new FormItem(item);
|
|
25
|
+
this.items.set(formItem.fieldName, formItem);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
getItem(name) {
|
|
29
|
+
return this.items.get(name);
|
|
30
|
+
}
|
|
31
|
+
get formName() {
|
|
32
|
+
return this.formId;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -6,7 +6,7 @@ import { EzGridCustomHeader } from './components/EzGridCustomHeader';
|
|
|
6
6
|
import { CellRendererStatus } from './components/cellRendererStatus';
|
|
7
7
|
import SelectionHeader from './components/selectionHeader';
|
|
8
8
|
import gridTerms from './i18n/pt-BR.js';
|
|
9
|
-
import { DISTINCT_FILTER_NAME_PREFIX } from '../../../../utils/constants';
|
|
9
|
+
import { EZ_GRID_LOADING_SOURCE, DISTINCT_FILTER_NAME_PREFIX } from '../../../../utils/constants';
|
|
10
10
|
import { calcFilterColumnLeftPosition } from './AgGridUtils';
|
|
11
11
|
import GridEditionManager from './GridEditionManager';
|
|
12
12
|
export default class AgGridController {
|
|
@@ -18,7 +18,7 @@ export default class AgGridController {
|
|
|
18
18
|
const applied = event.detail;
|
|
19
19
|
this._filteredColumns.set(applied.field, applied.values);
|
|
20
20
|
this._gridOptions.api.refreshHeader();
|
|
21
|
-
this._dataUnit.loadData();
|
|
21
|
+
this._dataUnit.loadData(undefined, undefined, undefined, EZ_GRID_LOADING_SOURCE);
|
|
22
22
|
}
|
|
23
23
|
showFilterColumn(configs) {
|
|
24
24
|
var _a;
|
|
@@ -30,7 +30,7 @@ export default class AgGridController {
|
|
|
30
30
|
this.CHECK_BOX_COL_ID = 'checkBoxColumn';
|
|
31
31
|
this.STATUS_COL_ID = 'statusColumn';
|
|
32
32
|
this.RECORD_ARCHIVE_COL_ID = '__RECORD_ARCHIVE__';
|
|
33
|
-
this.BLOCK_LOAD_DEBOUNCE =
|
|
33
|
+
this.BLOCK_LOAD_DEBOUNCE = 100;
|
|
34
34
|
this.DEFAULT_FONT_SIZE = 14;
|
|
35
35
|
this.DEFAULT_ICON_SIZE = 12;
|
|
36
36
|
this.DEFAULT_MAX_SIZE = 200;
|
|
@@ -44,10 +44,10 @@ export default class AgGridController {
|
|
|
44
44
|
getGridConfig() {
|
|
45
45
|
return this._gridConfig;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
locateColumn(columnName) {
|
|
48
|
+
this._gridOptions.api.ensureColumnVisible(columnName);
|
|
49
49
|
}
|
|
50
|
-
getSort() {
|
|
50
|
+
getSort(_dataUnitName, defaultSorting) {
|
|
51
51
|
const sortedColumns = [];
|
|
52
52
|
this._gridOptions.columnApi
|
|
53
53
|
.getColumnState()
|
|
@@ -60,7 +60,7 @@ export default class AgGridController {
|
|
|
60
60
|
sortedColumns.push(sortField);
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
return sortedColumns;
|
|
63
|
+
return sortedColumns.length === 0 && this._gridConfig === undefined ? defaultSorting : sortedColumns;
|
|
64
64
|
}
|
|
65
65
|
getFilter() {
|
|
66
66
|
if (!this._filteredColumns || this._filteredColumns.size === 0) {
|
|
@@ -131,6 +131,7 @@ export default class AgGridController {
|
|
|
131
131
|
height: '100%'
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
suppressFieldDotNotation: true,
|
|
134
135
|
components: Object.assign({ ezGridHeaderComponent: SelectionHeader, ezGridCustomHeader: EzGridCustomHeader }, this._editionManager.getComponents()),
|
|
135
136
|
context: {
|
|
136
137
|
editionManager: this._editionManager,
|
|
@@ -149,6 +150,10 @@ export default class AgGridController {
|
|
|
149
150
|
else {
|
|
150
151
|
this._grid = new Grid(container, this._gridOptions);
|
|
151
152
|
}
|
|
153
|
+
container.addEventListener('focusout', (event) => {
|
|
154
|
+
if (!container.contains(event.relatedTarget))
|
|
155
|
+
this._gridOptions.api.clearFocusedCell();
|
|
156
|
+
});
|
|
152
157
|
const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectionInfo();
|
|
153
158
|
if (selection === null || selection === void 0 ? void 0 : selection.isAllRecords()) {
|
|
154
159
|
this.selectAll(true);
|
|
@@ -424,7 +429,7 @@ export default class AgGridController {
|
|
|
424
429
|
if (this._grid === undefined) {
|
|
425
430
|
throw new Error('Erro interno: Grid ainda não inicializado.');
|
|
426
431
|
}
|
|
427
|
-
this._gridOptions.api.refreshServerSide({ purge:
|
|
432
|
+
this._gridOptions.api.refreshServerSide({ purge: true });
|
|
428
433
|
}
|
|
429
434
|
setFocusFirstRow() {
|
|
430
435
|
const firstRow = this._gridOptions.api.getDisplayedRowAtIndex(0);
|
|
@@ -603,7 +608,7 @@ export default class AgGridController {
|
|
|
603
608
|
tooltip: tooltip,
|
|
604
609
|
isSortable: propSortable,
|
|
605
610
|
hasFilter: () => this.hasFilterColumn(source.name),
|
|
606
|
-
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name) }),
|
|
611
|
+
showColumnFilter: (leftPosition, fromIcon) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon }),
|
|
607
612
|
},
|
|
608
613
|
valueFormatter: params => {
|
|
609
614
|
if (params.value == undefined) {
|
|
@@ -698,6 +703,13 @@ export default class AgGridController {
|
|
|
698
703
|
return maskFormatter.format(formattedValue);
|
|
699
704
|
}
|
|
700
705
|
}
|
|
706
|
+
if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.FILE) {
|
|
707
|
+
if (!params.value || !Array.isArray(params.value))
|
|
708
|
+
return '';
|
|
709
|
+
if (params.value.length === 1)
|
|
710
|
+
return params.value[0].name;
|
|
711
|
+
return `${params.value.length} arquivos`;
|
|
712
|
+
}
|
|
701
713
|
}
|
|
702
714
|
onCallStateChange(type, e) {
|
|
703
715
|
const finished = !('finished' in e) || e['finished'];
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { Action, ObjectUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
2
3
|
export default class DataSource {
|
|
4
|
+
isSilentChange(action) {
|
|
5
|
+
//TODO: Provisorio p/ não atualizar a grade quando a alteração for apenas de campos transisntes
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (!(action === null || action === void 0 ? void 0 : action.payload)) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (action.type === Action.DATA_CHANGED) {
|
|
11
|
+
return ((_a = Object.keys(action === null || action === void 0 ? void 0 : action.payload)) === null || _a === void 0 ? void 0 : _a.filter(changeName => changeName.startsWith("transient.") || changeName === "records").length) > 0;
|
|
12
|
+
}
|
|
13
|
+
if (action.type === Action.EDITION_CANCELED) {
|
|
14
|
+
return ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.silent) === true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
3
17
|
constructor(dataUnit, controller, options) {
|
|
4
18
|
this.RECORD_ARCHIVE = "__RECORD_ARCHIVE__";
|
|
5
19
|
this.duObserver = (action) => {
|
|
@@ -19,11 +33,19 @@ export default class DataSource {
|
|
|
19
33
|
}
|
|
20
34
|
this.updateSelection();
|
|
21
35
|
break;
|
|
36
|
+
case Action.PAGINATION_UPDATED:
|
|
37
|
+
if (this._options) {
|
|
38
|
+
this._options.onPaginationUpdate(this._dataUnit.getPaginationInfo());
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
22
41
|
case Action.RECORDS_REMOVED:
|
|
23
42
|
case Action.DATA_SAVED:
|
|
24
43
|
case Action.EDITION_CANCELED:
|
|
25
44
|
case Action.DATA_CHANGED:
|
|
26
45
|
case Action.DATA_RESOLVED:
|
|
46
|
+
if (this.isSilentChange(action)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
27
49
|
this._controller.refresh();
|
|
28
50
|
break;
|
|
29
51
|
case Action.SELECTION_CHANGED:
|
|
@@ -51,7 +73,7 @@ export default class DataSource {
|
|
|
51
73
|
getRows(params) {
|
|
52
74
|
if (this.needReload(params)) {
|
|
53
75
|
this._lastLoadingParams = params;
|
|
54
|
-
this._dataUnit.loadData(this.quickFilter).then(() => this.updateSelection());
|
|
76
|
+
this._dataUnit.loadData(this.quickFilter, undefined, true, EZ_GRID_LOADING_SOURCE).then(() => this.updateSelection());
|
|
55
77
|
}
|
|
56
78
|
else {
|
|
57
79
|
this._lastLoadingParams = params;
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js
CHANGED
|
@@ -36,7 +36,7 @@ export class EzGridCustomHeader {
|
|
|
36
36
|
onClickFilter() {
|
|
37
37
|
var _a;
|
|
38
38
|
const iconLeft = (_a = this.filterButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left;
|
|
39
|
-
this.params.showColumnFilter(`${calcFilterColumnLeftPosition(iconLeft)}px
|
|
39
|
+
this.params.showColumnFilter(`${calcFilterColumnLeftPosition(iconLeft)}px`, true);
|
|
40
40
|
}
|
|
41
41
|
configSortIcon() {
|
|
42
42
|
this.sortDownIcon.style.display = this.params.column.isSortDescending() ? 'flex' : 'none';
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
display: grid;
|
|
19
19
|
justify-content: space-between;
|
|
20
20
|
align-items: center;
|
|
21
|
+
grid-row-start: 1;
|
|
21
22
|
grid-template-columns: 1fr;
|
|
22
23
|
background-color: var(--ez-grid__header--background-color, #FFF);
|
|
23
|
-
z-index: var(--more-visible, 2);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.grid__container {
|
|
@@ -60,9 +60,6 @@
|
|
|
60
60
|
opacity: 0;
|
|
61
61
|
bottom: -100%;
|
|
62
62
|
transition: opacity 0.1s, bottom 0.5s;
|
|
63
|
-
|
|
64
|
-
/*public*/
|
|
65
|
-
z-index: var(--ez-grid__selection-counter--z-index);
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
.grid__selection-counter--opened {
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { ElementIDUtils, JSUtils,
|
|
1
|
+
import { ElementIDUtils, JSUtils, StringUtils, } from '@sankhyalabs/core';
|
|
2
2
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
3
|
-
import {
|
|
3
|
+
import { h, Host } from '@stencil/core';
|
|
4
4
|
import AgGridController from './controller/ag-grid/AgGridController';
|
|
5
5
|
import { SelectionCounter } from './subcomponents/selection-counter';
|
|
6
6
|
import { ApplicationUtils } from '../../utils';
|
|
7
|
+
import InMemoryFilterColumnDataSource from './utils/InMemoryFilterColumnDataSource';
|
|
7
8
|
const windowInstace = window;
|
|
9
|
+
const matches = (text, filter) => {
|
|
10
|
+
const normalizedText = StringUtils.replaceAccentuatedCharsLower(text.toLocaleLowerCase());
|
|
11
|
+
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(filter.toLocaleLowerCase());
|
|
12
|
+
return normalizedText.includes(normalizedFilter);
|
|
13
|
+
};
|
|
8
14
|
export class EzGrid {
|
|
9
15
|
constructor() {
|
|
10
16
|
this._gridController = new AgGridController(false);
|
|
11
17
|
this._messageFilterAppliedSuccess = 'Filtro de coluna aplicado com sucesso!';
|
|
12
|
-
this.onDataUnitAction = (action) => {
|
|
13
|
-
if (action.type === Action.DATA_SAVED || action.type === Action.RECORDS_REMOVED) {
|
|
14
|
-
this._originalRecords = this.dataUnit.records;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
18
|
this._paginationInfo = undefined;
|
|
18
19
|
this._paginationChangedByKeyboard = true;
|
|
19
20
|
this._showSelectionCounter = false;
|
|
20
21
|
this._isAllSelection = false;
|
|
21
22
|
this._currentPageSelected = undefined;
|
|
22
23
|
this._selectionCount = undefined;
|
|
23
|
-
this.
|
|
24
|
+
this._hasLeftButtons = false;
|
|
24
25
|
this.multipleSelection = undefined;
|
|
25
26
|
this.config = undefined;
|
|
26
27
|
this.selectionToastConfig = undefined;
|
|
@@ -80,6 +81,18 @@ export class EzGrid {
|
|
|
80
81
|
async quickFilter(term) {
|
|
81
82
|
this._gridController.quickFilter(term);
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Localiza determinada coluna tornando-a visível.
|
|
86
|
+
*/
|
|
87
|
+
async locateColumn(columnName) {
|
|
88
|
+
this._gridController.locateColumn(columnName);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Usa um argumento para filtrar as colunas po label
|
|
92
|
+
*/
|
|
93
|
+
async filterColumns(search) {
|
|
94
|
+
return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
|
|
95
|
+
}
|
|
83
96
|
observeConfig(config) {
|
|
84
97
|
this._gridController.setColumnsState(config.columns);
|
|
85
98
|
}
|
|
@@ -221,21 +234,26 @@ export class EzGrid {
|
|
|
221
234
|
}
|
|
222
235
|
previousPage() {
|
|
223
236
|
if (this.dataUnit) {
|
|
224
|
-
this.dataUnit.previousPage()
|
|
225
|
-
|
|
237
|
+
this.dataUnit.previousPage()
|
|
238
|
+
.then(() => this.resetPaginationState());
|
|
226
239
|
}
|
|
227
240
|
}
|
|
228
241
|
nextPage() {
|
|
229
242
|
if (this.dataUnit) {
|
|
230
|
-
this.dataUnit.nextPage()
|
|
231
|
-
|
|
243
|
+
this.dataUnit.nextPage()
|
|
244
|
+
.then(() => this.resetPaginationState());
|
|
232
245
|
}
|
|
233
246
|
}
|
|
247
|
+
resetPaginationState() {
|
|
248
|
+
var _a;
|
|
249
|
+
this._paginationChangedByKeyboard = false;
|
|
250
|
+
(_a = this._gridApi) === null || _a === void 0 ? void 0 : _a.clearRangeSelection();
|
|
251
|
+
}
|
|
234
252
|
getPaginationControl() {
|
|
235
253
|
if (this._paginationInfo) {
|
|
236
|
-
const { firstRecord, lastRecord, total, currentPage, hasMore } = this._paginationInfo;
|
|
254
|
+
const { firstRecord, lastRecord, total, count, currentPage, hasMore } = this._paginationInfo;
|
|
237
255
|
return [
|
|
238
|
-
h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, `${firstRecord}-${lastRecord}`), ` de ${total}`),
|
|
256
|
+
h("div", { class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium" }, h("strong", { class: "ez-text ez-text--primary ez-text--medium" }, `${firstRecord}-${lastRecord}`), total == undefined ? ` de ${count + 1} ou mais` : ` de ${total}`),
|
|
239
257
|
h("ez-button", { size: "small", iconName: "chevron-left", class: "ez-margin-right--medium", mode: "icon", enabled: currentPage > 0, onClick: () => this.previousPage(), label: "P\u00E1gina anterior" }),
|
|
240
258
|
h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: hasMore, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" }),
|
|
241
259
|
];
|
|
@@ -257,6 +275,9 @@ export class EzGrid {
|
|
|
257
275
|
}
|
|
258
276
|
this._paginationInfo = paginationInfo;
|
|
259
277
|
},
|
|
278
|
+
onPaginationUpdate: (paginationInfo) => {
|
|
279
|
+
this._paginationInfo = paginationInfo;
|
|
280
|
+
},
|
|
260
281
|
onDoubleClick: (row) => {
|
|
261
282
|
this.ezDoubleClick.emit(row);
|
|
262
283
|
},
|
|
@@ -271,15 +292,13 @@ export class EzGrid {
|
|
|
271
292
|
if (this.config) {
|
|
272
293
|
this.observeConfig(this.config);
|
|
273
294
|
}
|
|
295
|
+
if (this.dataUnit != undefined) {
|
|
296
|
+
this._paginationInfo = this.dataUnit.getPaginationInfo();
|
|
297
|
+
}
|
|
274
298
|
this.buildDataElementId();
|
|
275
299
|
this.setEvents();
|
|
276
300
|
this.componentReady.emit();
|
|
277
301
|
this._gridController.configFilterColumn(this._filterColumn);
|
|
278
|
-
this._container.addEventListener('focusout', (event) => {
|
|
279
|
-
const api = this._gridController.getGridApi();
|
|
280
|
-
if (api && !this._container.contains(event.relatedTarget))
|
|
281
|
-
api.clearFocusedCell();
|
|
282
|
-
});
|
|
283
302
|
}
|
|
284
303
|
componentWillRender() {
|
|
285
304
|
this.configSelectionCounter();
|
|
@@ -290,46 +309,22 @@ export class EzGrid {
|
|
|
290
309
|
});
|
|
291
310
|
}
|
|
292
311
|
componentWillLoad() {
|
|
312
|
+
this._hasLeftButtons = !!this._element.querySelector('[slot="leftButtons"]');
|
|
293
313
|
if (!this.dataUnit.name.includes("InMemoryDataUnit"))
|
|
294
314
|
return;
|
|
295
|
-
this.dataUnit.subscribe(this.onDataUnitAction);
|
|
296
315
|
}
|
|
297
316
|
getDataSource() {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
buildDefaultDataSource() {
|
|
301
|
-
var _a, _b;
|
|
302
|
-
if (this._originalRecords.length === 0) {
|
|
303
|
-
this._originalRecords = (_b = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.records) !== null && _b !== void 0 ? _b : [];
|
|
304
|
-
}
|
|
305
|
-
return {
|
|
306
|
-
fetchData: (filterTerm, fieldName) => {
|
|
307
|
-
return new Promise(resolve => {
|
|
308
|
-
const filteredRecords = this._originalRecords.filter(record => {
|
|
309
|
-
var _a, _b;
|
|
310
|
-
const label = typeof record[fieldName] === "object" ? `${(_a = record[fieldName]) === null || _a === void 0 ? void 0 : _a.value} - ${(_b = record[fieldName]) === null || _b === void 0 ? void 0 : _b.label}` : record[fieldName];
|
|
311
|
-
return label === null || label === void 0 ? void 0 : label.toString().toLowerCase().includes(filterTerm.toLowerCase());
|
|
312
|
-
});
|
|
313
|
-
const options = filteredRecords.map(item => {
|
|
314
|
-
return { value: item[fieldName].toString(), label: this.formatLabel(fieldName, item[fieldName]), check: true };
|
|
315
|
-
});
|
|
316
|
-
resolve(options);
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
};
|
|
317
|
+
var _a;
|
|
318
|
+
return (_a = this.columnfilterDataSource) !== null && _a !== void 0 ? _a : new InMemoryFilterColumnDataSource(this.dataUnit);
|
|
320
319
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (userInterface === UserInterface.DATETIME) {
|
|
324
|
-
return DateUtils.formatDate(this.dataUnit.valueFromString(fieldName, value));
|
|
325
|
-
}
|
|
326
|
-
return String(this.dataUnit.getFormattedValue(fieldName, value));
|
|
320
|
+
hideHeader() {
|
|
321
|
+
return (!!this._element.getAttribute("no-header") && !this._paginationInfo);
|
|
327
322
|
}
|
|
328
323
|
render() {
|
|
329
324
|
var _a;
|
|
330
|
-
return (h(Host,
|
|
325
|
+
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" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => (this._refPaginationControl = ref) }, this.getPaginationControl()))), h("div", { ref: (ref) => (this._gridSelectionCounter = ref), class: `grid__selection-counter ez-elevation--4
|
|
331
326
|
${this._showSelectionCounter ? 'grid__selection-counter--opened' : ''}
|
|
332
|
-
` }, 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: "
|
|
327
|
+
` }, 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" }))));
|
|
333
328
|
}
|
|
334
329
|
static get is() { return "ez-grid"; }
|
|
335
330
|
static get encapsulation() { return "scoped"; }
|
|
@@ -550,7 +545,7 @@ export class EzGrid {
|
|
|
550
545
|
"_isAllSelection": {},
|
|
551
546
|
"_currentPageSelected": {},
|
|
552
547
|
"_selectionCount": {},
|
|
553
|
-
"
|
|
548
|
+
"_hasLeftButtons": {}
|
|
554
549
|
};
|
|
555
550
|
}
|
|
556
551
|
static get events() {
|
|
@@ -839,6 +834,51 @@ export class EzGrid {
|
|
|
839
834
|
"text": "Aplica um filtro r\u00E1pido.",
|
|
840
835
|
"tags": []
|
|
841
836
|
}
|
|
837
|
+
},
|
|
838
|
+
"locateColumn": {
|
|
839
|
+
"complexType": {
|
|
840
|
+
"signature": "(columnName: string) => Promise<void>",
|
|
841
|
+
"parameters": [{
|
|
842
|
+
"tags": [],
|
|
843
|
+
"text": ""
|
|
844
|
+
}],
|
|
845
|
+
"references": {
|
|
846
|
+
"Promise": {
|
|
847
|
+
"location": "global"
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
"return": "Promise<void>"
|
|
851
|
+
},
|
|
852
|
+
"docs": {
|
|
853
|
+
"text": "Localiza determinada coluna tornando-a vis\u00EDvel.",
|
|
854
|
+
"tags": []
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
"filterColumns": {
|
|
858
|
+
"complexType": {
|
|
859
|
+
"signature": "(search: string) => Promise<Array<EzGridColumn>>",
|
|
860
|
+
"parameters": [{
|
|
861
|
+
"tags": [],
|
|
862
|
+
"text": ""
|
|
863
|
+
}],
|
|
864
|
+
"references": {
|
|
865
|
+
"Promise": {
|
|
866
|
+
"location": "global"
|
|
867
|
+
},
|
|
868
|
+
"EzGridColumn": {
|
|
869
|
+
"location": "import",
|
|
870
|
+
"path": "./controller/EzGridController"
|
|
871
|
+
},
|
|
872
|
+
"Array": {
|
|
873
|
+
"location": "global"
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
"return": "Promise<EzGridColumn[]>"
|
|
877
|
+
},
|
|
878
|
+
"docs": {
|
|
879
|
+
"text": "Usa um argumento para filtrar as colunas po label",
|
|
880
|
+
"tags": []
|
|
881
|
+
}
|
|
842
882
|
}
|
|
843
883
|
};
|
|
844
884
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|