@sankhyalabs/ezui 5.20.4 → 5.21.0-dev.10
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 +4 -5
- package/dist/cjs/{CSSVarsUtils-b136a156.js → CSSVarsUtils-10c9d5b4.js} +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-alert-list.cjs.entry.js +123 -49
- 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 +183 -0
- package/dist/cjs/ez-check.cjs.entry.js +2 -2
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +20 -163
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -2
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +10 -4
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +48 -16
- package/dist/cjs/ez-form.cjs.entry.js +29 -3
- package/dist/cjs/ez-grid.cjs.entry.js +216 -72
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +2 -2
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +19 -3
- package/dist/cjs/ez-modal.cjs.entry.js +8 -9
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +10 -3
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +21 -8
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_3.cjs.entry.js +19 -5
- package/dist/cjs/ez-search.cjs.entry.js +625 -33
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +166 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +21 -3
- package/dist/cjs/ez-split-panel.cjs.entry.js +68 -14
- 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 +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +2 -2
- 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 +17 -6
- package/dist/cjs/{index-1064511f.js → index-a7b0c73d.js} +12 -10
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/ez-alert-list/ez-alert-list.css +16 -2
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +129 -48
- 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-card-item/ez-card-item.css +52 -3
- package/dist/collection/components/ez-card-item/ez-card-item.js +22 -3
- package/dist/collection/components/ez-check/ez-check.css +1 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +19 -179
- package/dist/collection/components/ez-dropdown/ez-dropdown.js +32 -3
- package/dist/collection/components/ez-form/ez-form.js +76 -2
- package/dist/collection/components/ez-form-view/ez-form-view.css +17 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +60 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +26 -13
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +3 -4
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js +21 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -3
- package/dist/collection/components/ez-grid/ez-grid.css +25 -1
- package/dist/collection/components/ez-grid/ez-grid.js +228 -35
- 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/filter-column.js +16 -5
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +24 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-icon/ez-icon.css +119 -117
- package/dist/collection/components/ez-modal/ez-modal.js +22 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +26 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +11 -0
- package/dist/collection/components/ez-popup/ez-popup.css +2 -5
- package/dist/collection/components/ez-popup/ez-popup.js +35 -8
- package/dist/collection/components/ez-search/ez-search.css +331 -0
- package/dist/collection/components/ez-search/ez-search.js +701 -55
- package/dist/collection/components/ez-split-button/ez-split-button.css +229 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js +455 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js +42 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +6 -7
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +103 -15
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +59 -12
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +82 -2
- package/dist/collection/components/ez-tree/ez-tree.css +26 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItemBadge.js +1 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +15 -2
- package/dist/collection/utils/CSSVarsUtils.js +13 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +9 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +1427 -397
- package/dist/esm/{CSSVarsUtils-a97cfa29.js → CSSVarsUtils-71ce76be.js} +13 -0
- package/dist/esm/ez-actions-button.entry.js +2 -2
- package/dist/esm/ez-alert-list.entry.js +123 -49
- 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 +177 -0
- package/dist/esm/ez-check.entry.js +2 -2
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +21 -164
- package/dist/esm/ez-date-input.entry.js +2 -2
- package/dist/esm/ez-date-time-input.entry.js +2 -2
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +10 -4
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +48 -16
- package/dist/esm/ez-form.entry.js +29 -3
- package/dist/esm/ez-grid.entry.js +217 -73
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +19 -3
- package/dist/esm/ez-modal.entry.js +9 -10
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +10 -3
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +22 -9
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_3.entry.js +19 -5
- package/dist/esm/ez-search.entry.js +626 -34
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +162 -0
- package/dist/esm/ez-split-item.entry.js +21 -3
- package/dist/esm/ez-split-panel.entry.js +68 -14
- 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 +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +2 -2
- 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 +17 -6
- package/dist/esm/{index-296b8458.js → index-baa5e267.js} +12 -10
- 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-871c1a07.entry.js → p-0447d17c.entry.js} +1 -1
- package/dist/ezui/p-072e6347.entry.js +1 -0
- package/dist/ezui/p-09de35a2.entry.js +1 -0
- package/dist/ezui/p-13d2fe2d.entry.js +1 -0
- package/dist/ezui/{p-f4208819.entry.js → p-17be134a.entry.js} +1 -1
- package/dist/ezui/{p-545b5b2f.entry.js → p-1db718ab.entry.js} +2 -2
- 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-245a44ed.entry.js → p-20ec22c0.entry.js} +1 -1
- package/dist/ezui/{p-e318d280.js → p-23a36bb6.js} +1 -1
- package/dist/ezui/p-30775e7f.entry.js +1 -0
- package/dist/ezui/{p-8252d9b5.entry.js → p-3a21618b.entry.js} +1 -1
- package/dist/ezui/p-3faa2b46.entry.js +1 -0
- package/dist/ezui/{p-9b347f04.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/{p-7319c253.entry.js → p-49456b34.entry.js} +1 -1
- package/dist/ezui/{p-ccb4ccd9.entry.js → p-555c9018.entry.js} +1 -1
- package/dist/ezui/{p-52dd8b4c.entry.js → p-5bd5e68f.entry.js} +1 -1
- package/dist/ezui/{p-7525e604.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/p-637f69f2.entry.js +1 -0
- package/dist/ezui/{p-c49dbf23.entry.js → p-650e4b6d.entry.js} +1 -1
- package/dist/ezui/{p-f55d75e7.entry.js → p-6e429cff.entry.js} +1 -1
- package/dist/ezui/{p-0b902469.entry.js → p-77a4bd35.entry.js} +1 -1
- package/dist/ezui/{p-81cd05c8.entry.js → p-784fe207.entry.js} +1 -1
- package/dist/ezui/p-7af81663.entry.js +1 -0
- package/dist/ezui/p-7bc07c31.entry.js +1 -0
- package/dist/ezui/p-7c770f14.entry.js +1 -0
- package/dist/ezui/p-836cdfdf.entry.js +1 -0
- package/dist/ezui/{p-5d6f2550.entry.js → p-85c8baae.entry.js} +1 -1
- package/dist/ezui/{p-d3b5228e.entry.js → p-8defa6d3.entry.js} +1 -1
- package/dist/ezui/{p-fbca293f.entry.js → p-8df1ca33.entry.js} +1 -1
- package/dist/ezui/{p-391de0e4.entry.js → p-9050d2cd.entry.js} +1 -1
- package/dist/ezui/p-91f626d3.entry.js +1 -0
- package/dist/ezui/{p-3e7cc8a4.entry.js → p-99ead599.entry.js} +1 -1
- package/dist/ezui/p-99f46950.entry.js +1 -0
- package/dist/ezui/{p-7eb3e1a5.js → p-9e11fc7b.js} +1 -1
- package/dist/ezui/{p-b11f035c.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/{p-2da09f70.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/{p-d20ed286.entry.js → p-af2ecb1b.entry.js} +1 -1
- package/dist/ezui/{p-e8f88361.entry.js → p-af95cd16.entry.js} +1 -1
- package/dist/ezui/p-bae3d0aa.entry.js +1 -0
- package/dist/ezui/{p-fb21d72f.entry.js → p-bae4e180.entry.js} +1 -1
- package/dist/ezui/p-baf80b13.entry.js +1 -0
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/p-bf79aaa1.entry.js +1 -0
- package/dist/ezui/{p-83885b21.entry.js → p-cc2dc4f4.entry.js} +1 -1
- package/dist/ezui/p-d9401ea0.entry.js +1 -0
- package/dist/ezui/{p-028f264f.entry.js → p-e85c48d7.entry.js} +1 -1
- package/dist/ezui/p-f3c526cc.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +38 -4
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +4 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -15
- package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +5 -0
- package/dist/types/components/ez-form/ez-form.d.ts +12 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +7 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +10 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSourceInterceptor.d.ts +8 -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 +35 -3
- 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/filter-column.d.ts +4 -1
- 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-guide-navigator/interfaces/IGuideItem.d.ts +0 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +4 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +9 -3
- package/dist/types/components/ez-search/ez-search.d.ts +101 -10
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +92 -0
- package/dist/types/components/ez-split-button/test/dropdownItems.d.ts +2 -0
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +29 -0
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +27 -0
- package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +3 -1
- package/dist/types/components/ez-tree/interfaces/ITreeItemBadge.d.ts +6 -0
- package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +0 -1
- package/dist/types/components.d.ts +225 -16
- package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
- package/dist/types/utils/form/test/DataBinder.test.d.ts +1 -0
- package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +2 -1
- package/dist/types/utils/interfaces/IAction.d.ts +1 -1
- package/package.json +13 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -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/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +0 -8
- 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-12526044.entry.js +0 -1
- package/dist/ezui/p-32b4163f.entry.js +0 -1
- package/dist/ezui/p-47afb974.entry.js +0 -1
- package/dist/ezui/p-59bcb27c.entry.js +0 -1
- package/dist/ezui/p-62304715.entry.js +0 -1
- package/dist/ezui/p-74049254.entry.js +0 -1
- package/dist/ezui/p-76d16a24.entry.js +0 -1
- package/dist/ezui/p-7fd54841.entry.js +0 -1
- package/dist/ezui/p-87e85160.entry.js +0 -1
- package/dist/ezui/p-95426f93.entry.js +0 -1
- package/dist/ezui/p-99692afa.entry.js +0 -1
- package/dist/ezui/p-a01068e1.entry.js +0 -1
- package/dist/ezui/p-a42fe2ce.entry.js +0 -1
- package/dist/ezui/p-af285e68.entry.js +0 -1
- package/dist/ezui/p-b6867f19.entry.js +0 -1
- package/dist/ezui/p-d51aa09b.entry.js +0 -1
- package/dist/ezui/p-d81917fd.entry.js +0 -1
- package/dist/ezui/p-f8653522.entry.js +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
2
|
import { fieldBuilder } from './fieldbuilder/FieldBuilder';
|
|
3
|
-
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
+
import { ElementIDUtils, UserInterface } from '@sankhyalabs/core';
|
|
4
4
|
import { FormItems } from './structure';
|
|
5
5
|
export class EzFormView {
|
|
6
6
|
constructor() {
|
|
@@ -9,6 +9,19 @@ export class EzFormView {
|
|
|
9
9
|
async showUp() {
|
|
10
10
|
this._element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Altera/adiciona uma propriedade nos metados do campo.
|
|
14
|
+
*/
|
|
15
|
+
async setFieldProp(fieldName, propName, value) {
|
|
16
|
+
const fields = this.fields.map(field => {
|
|
17
|
+
if (field.name === fieldName) {
|
|
18
|
+
field.props = field.props || {};
|
|
19
|
+
field.props[propName] = value;
|
|
20
|
+
}
|
|
21
|
+
return field;
|
|
22
|
+
});
|
|
23
|
+
this.fields = [...fields];
|
|
24
|
+
}
|
|
12
25
|
groupFields(fields) {
|
|
13
26
|
const result = new Map();
|
|
14
27
|
fields.forEach(item => {
|
|
@@ -32,19 +45,36 @@ export class EzFormView {
|
|
|
32
45
|
const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
|
|
33
46
|
this.formItemsReady.emit(formItems);
|
|
34
47
|
}
|
|
48
|
+
isItemFullWidth(userInterface) {
|
|
49
|
+
return [
|
|
50
|
+
UserInterface.FILE,
|
|
51
|
+
UserInterface.LONGTEXT
|
|
52
|
+
].includes(userInterface);
|
|
53
|
+
}
|
|
54
|
+
buildFormItemElement(item, classItem = "") {
|
|
55
|
+
if (this.isItemFullWidth(item.userInterface)) {
|
|
56
|
+
classItem += " input-full_width";
|
|
57
|
+
}
|
|
58
|
+
return h("div", { class: classItem }, fieldBuilder(item));
|
|
59
|
+
}
|
|
35
60
|
render() {
|
|
36
61
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
37
62
|
if (this.fields == undefined) {
|
|
38
63
|
return;
|
|
39
64
|
}
|
|
40
|
-
|
|
65
|
+
let nonArrayGrup = [];
|
|
66
|
+
let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
|
|
41
67
|
if (Array.isArray(value)) {
|
|
42
|
-
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi =>
|
|
68
|
+
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, h("div", { class: "form-view__content" }, value.map(fi => (this.buildFormItemElement(fi))))));
|
|
43
69
|
}
|
|
44
70
|
else {
|
|
45
|
-
|
|
71
|
+
nonArrayGrup.push(value);
|
|
46
72
|
}
|
|
47
|
-
})
|
|
73
|
+
});
|
|
74
|
+
// Filtra os elementos que não são arrays e os coloca dentro de uma única div
|
|
75
|
+
let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
|
|
76
|
+
let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
|
|
77
|
+
return (h(Host, null, groupedNonArrayElements, formContent));
|
|
48
78
|
}
|
|
49
79
|
static get is() { return "ez-form-view"; }
|
|
50
80
|
static get encapsulation() { return "scoped"; }
|
|
@@ -147,6 +177,31 @@ export class EzFormView {
|
|
|
147
177
|
"text": "",
|
|
148
178
|
"tags": []
|
|
149
179
|
}
|
|
180
|
+
},
|
|
181
|
+
"setFieldProp": {
|
|
182
|
+
"complexType": {
|
|
183
|
+
"signature": "(fieldName: string, propName: string, value: any) => Promise<void>",
|
|
184
|
+
"parameters": [{
|
|
185
|
+
"tags": [],
|
|
186
|
+
"text": ""
|
|
187
|
+
}, {
|
|
188
|
+
"tags": [],
|
|
189
|
+
"text": ""
|
|
190
|
+
}, {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": ""
|
|
193
|
+
}],
|
|
194
|
+
"references": {
|
|
195
|
+
"Promise": {
|
|
196
|
+
"location": "global"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"return": "Promise<void>"
|
|
200
|
+
},
|
|
201
|
+
"docs": {
|
|
202
|
+
"text": "Altera/adiciona uma propriedade nos metados do campo.",
|
|
203
|
+
"tags": []
|
|
204
|
+
}
|
|
150
205
|
}
|
|
151
206
|
};
|
|
152
207
|
}
|
|
@@ -7,5 +7,5 @@ export const buildCheckBox = (field) => {
|
|
|
7
7
|
return buildField(field.name, field.label, field.readOnly, field.contextName, false);
|
|
8
8
|
};
|
|
9
9
|
function buildField(fieldName, fieldLabel, readOnly, contextName, switchMode) {
|
|
10
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
10
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" }, h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName })));
|
|
11
11
|
}
|
|
@@ -9,5 +9,5 @@ export const buildComboBox = ({ name, label, readOnly, required, props, contextN
|
|
|
9
9
|
else {
|
|
10
10
|
options = prop;
|
|
11
11
|
}
|
|
12
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
12
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, options: options, canShowError: canShowError })));
|
|
13
13
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildDate = ({ name, label, readOnly, canShowError }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
|
|
4
4
|
};
|
|
5
5
|
export const buildTime = ({ name, label, readOnly, canShowError }) => {
|
|
6
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
6
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name, canShowError: canShowError })));
|
|
7
7
|
};
|
|
8
8
|
export const buildDateTime = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
9
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
9
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError })));
|
|
10
10
|
};
|
|
@@ -3,9 +3,11 @@ import { ObjectUtils } from "@sankhyalabs/core";
|
|
|
3
3
|
export const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
4
4
|
const uploadProps = ObjectUtils.removeEmptyValues({
|
|
5
5
|
subTitle: props.subTitle,
|
|
6
|
-
requestHeaders: props.STORAGESTRATEGY
|
|
6
|
+
requestHeaders: Object.assign(Object.assign({}, (props.STORAGESTRATEGY && {
|
|
7
7
|
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
8
|
-
}
|
|
8
|
+
})), (props.INTERNAL_FILENAME && {
|
|
9
|
+
INTERNAL_FILENAME: props.INTERNAL_FILENAME
|
|
10
|
+
})),
|
|
9
11
|
});
|
|
10
12
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
11
13
|
};
|
|
@@ -8,5 +8,5 @@ export const buildInteger = ({ name, label, readOnly, contextName, canShowError
|
|
|
8
8
|
return buildNumeric(name, label, readOnly, 0, 0, contextName, canShowError);
|
|
9
9
|
};
|
|
10
10
|
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision, contextName, canShowError) {
|
|
11
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
11
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, "data-context-name": contextName, key: fieldName, canShowError: canShowError })));
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader })));
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildTextInput = ({ name, label, readOnly, contextName, canShowError }) => {
|
|
3
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-
|
|
3
|
+
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" }, h("ez-text-input", { label: label, "data-field-name": name, "data-context-name": contextName, key: name, enabled: !readOnly, canShowError: canShowError })));
|
|
4
4
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface } from '@sankhyalabs/core';
|
|
2
|
-
import { Grid
|
|
1
|
+
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
|
+
import { Grid } from 'ag-grid-community';
|
|
3
3
|
import { Grid as EnterpriseGrid, LicenseManager } from 'ag-grid-enterprise';
|
|
4
4
|
import DataSource from './DataSource';
|
|
5
5
|
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 {
|
|
10
|
-
import { calcFilterColumnLeftPosition } from './AgGridUtils';
|
|
9
|
+
import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from '../../../../utils/constants';
|
|
11
10
|
import GridEditionManager from './GridEditionManager';
|
|
12
11
|
export default class AgGridController {
|
|
13
12
|
configFilterColumn(filterColumn) {
|
|
@@ -42,7 +41,8 @@ export default class AgGridController {
|
|
|
42
41
|
this._idAttribName = '__record__id__';
|
|
43
42
|
this._gridConfig = [];
|
|
44
43
|
this._filteredColumns = new Map();
|
|
45
|
-
this._filterColumnleftPosition =
|
|
44
|
+
this._filterColumnleftPosition = 0;
|
|
45
|
+
this._customFormatters = new Map();
|
|
46
46
|
this._enterprise = enterprise;
|
|
47
47
|
}
|
|
48
48
|
getGridConfig() {
|
|
@@ -188,6 +188,7 @@ export default class AgGridController {
|
|
|
188
188
|
this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
|
|
189
189
|
}
|
|
190
190
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
191
|
+
this._customFormatters = options.customFormatters;
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
194
|
processFormatterCellCallback(params) {
|
|
@@ -207,11 +208,9 @@ export default class AgGridController {
|
|
|
207
208
|
}
|
|
208
209
|
return params.value;
|
|
209
210
|
}
|
|
210
|
-
setFilterColumnLeftPosition(
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
const leftString = ePopup.style.left.replace('px', '');
|
|
214
|
-
this._filterColumnleftPosition = `${calcFilterColumnLeftPosition(parseInt(leftString))}px`;
|
|
211
|
+
setFilterColumnLeftPosition({ type, ePopup }) {
|
|
212
|
+
if (type === 'columnMenu') {
|
|
213
|
+
this._filterColumnleftPosition = ePopup.getBoundingClientRect().left;
|
|
215
214
|
return;
|
|
216
215
|
}
|
|
217
216
|
}
|
|
@@ -557,7 +556,7 @@ export default class AgGridController {
|
|
|
557
556
|
//Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
|
|
558
557
|
const columnsOffset = colDef.length - columns.length;
|
|
559
558
|
let sort = [];
|
|
560
|
-
state.forEach((cfgColumn, index) => {
|
|
559
|
+
state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
|
|
561
560
|
const colWidth = this.getColumnWidth(cfgColumn);
|
|
562
561
|
this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
|
|
563
562
|
this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
|
|
@@ -651,15 +650,22 @@ export default class AgGridController {
|
|
|
651
650
|
tooltip: tooltip,
|
|
652
651
|
isSortable: propSortable,
|
|
653
652
|
hasFilter: () => this.hasFilterColumn(source.name),
|
|
654
|
-
showColumnFilter: (leftPosition
|
|
653
|
+
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
655
654
|
},
|
|
656
655
|
valueFormatter: params => {
|
|
657
|
-
if (params.value
|
|
656
|
+
if (params.value === undefined) {
|
|
658
657
|
return "";
|
|
659
658
|
}
|
|
660
659
|
if (params.value instanceof Promise) {
|
|
661
660
|
return "Carregando...";
|
|
662
661
|
}
|
|
662
|
+
const customFormatter = this._customFormatters.get(source.name);
|
|
663
|
+
if (customFormatter) {
|
|
664
|
+
const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
|
|
665
|
+
if (formattedValue) {
|
|
666
|
+
return formattedValue;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
663
669
|
if (this._dataUnit) {
|
|
664
670
|
return this._dataUnit.getFormattedValue(source.name, params.value);
|
|
665
671
|
}
|
|
@@ -668,6 +674,13 @@ export default class AgGridController {
|
|
|
668
674
|
cellStyle: this.getStyleByColumn(source),
|
|
669
675
|
});
|
|
670
676
|
}
|
|
677
|
+
setCustomFormatters(customFormatters) {
|
|
678
|
+
this._customFormatters = customFormatters;
|
|
679
|
+
}
|
|
680
|
+
refreshSelectedRows() {
|
|
681
|
+
const selectedNodes = this._gridOptions.api.getSelectedNodes();
|
|
682
|
+
this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
|
|
683
|
+
}
|
|
671
684
|
getInitCellStyle() {
|
|
672
685
|
return {
|
|
673
686
|
'line-height': this.getRowHeight() - 1 + 'px',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Action, ObjectUtils } from '@sankhyalabs/core';
|
|
2
2
|
import { EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
3
|
+
import { DataSourceInterceptor } from "./DataSourceInterceptor";
|
|
3
4
|
export default class DataSource {
|
|
4
5
|
updateLoadedRecords(action) {
|
|
5
6
|
const records = action.payload;
|
|
@@ -31,16 +32,13 @@ export default class DataSource {
|
|
|
31
32
|
break;
|
|
32
33
|
case Action.LOADING_DATA:
|
|
33
34
|
this._waitingForLoad = true;
|
|
34
|
-
if (EZ_GRID_LOADING_SOURCE !== action.payload.source) {
|
|
35
|
-
this._controller.clearFilter();
|
|
36
|
-
}
|
|
37
35
|
this._controller.refresh();
|
|
38
36
|
break;
|
|
39
37
|
case Action.DATA_LOADED:
|
|
40
38
|
this._waitingForLoad = false;
|
|
41
39
|
this.callbackGetRows(this._lastLoadingParams);
|
|
42
40
|
if (this._options) {
|
|
43
|
-
this._options.onPaginationChange(this._dataUnit.getPaginationInfo());
|
|
41
|
+
this._options.onPaginationChange(this._dataUnit.getPaginationInfo(), action.payload.selectFirstRecord);
|
|
44
42
|
}
|
|
45
43
|
this.updateSelection();
|
|
46
44
|
break;
|
|
@@ -74,6 +72,7 @@ export default class DataSource {
|
|
|
74
72
|
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
75
73
|
this._options = options;
|
|
76
74
|
this._dataUnit.subscribe(this.duObserver);
|
|
75
|
+
this._dataUnit.addInterceptor(new DataSourceInterceptor(this._controller));
|
|
77
76
|
}
|
|
78
77
|
updateSelection() {
|
|
79
78
|
const selectionInfo = this._dataUnit.getSelectionInfo();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from "@sankhyalabs/core";
|
|
2
|
+
import { DISTINCT_FILTER_NAME_PREFIX, EZ_GRID_LOADING_SOURCE } from "../../../../utils/constants";
|
|
3
|
+
export class DataSourceInterceptor {
|
|
4
|
+
constructor(controller) {
|
|
5
|
+
this._controller = controller;
|
|
6
|
+
}
|
|
7
|
+
clearColumnFilter(filters) {
|
|
8
|
+
var _a;
|
|
9
|
+
return (_a = filters.filter(filter => !filter.name.startsWith(DISTINCT_FILTER_NAME_PREFIX))) !== null && _a !== void 0 ? _a : [];
|
|
10
|
+
}
|
|
11
|
+
interceptAction(action) {
|
|
12
|
+
var _a;
|
|
13
|
+
if (action.type === Action.LOADING_DATA) {
|
|
14
|
+
if (EZ_GRID_LOADING_SOURCE !== action.payload.source) {
|
|
15
|
+
action.payload.filters = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.filters) !== undefined ? this.clearColumnFilter(action.payload.filters) : action.payload.filters;
|
|
16
|
+
this._controller.clearFilter();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return action;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { calcFilterColumnLeftPosition } from '../AgGridUtils';
|
|
2
1
|
export class EzGridCustomHeader {
|
|
3
2
|
init(agParams) {
|
|
4
3
|
var _a;
|
|
@@ -35,8 +34,7 @@ export class EzGridCustomHeader {
|
|
|
35
34
|
}
|
|
36
35
|
onClickFilter() {
|
|
37
36
|
var _a;
|
|
38
|
-
|
|
39
|
-
this.params.showColumnFilter(`${calcFilterColumnLeftPosition(iconLeft)}px`, true);
|
|
37
|
+
this.params.showColumnFilter((_a = this.filterButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left);
|
|
40
38
|
}
|
|
41
39
|
configSortIcon() {
|
|
42
40
|
this.sortDownIcon.style.display = this.params.column.isSortDescending() ? 'flex' : 'none';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
grid-template-rows: auto 1fr auto;
|
|
5
5
|
height: 100%;
|
|
6
6
|
width: 100%;
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
/*public*/
|
|
9
9
|
/*@doc Define a cor de fundo do header do componente.*/
|
|
10
10
|
--ez-grid__header--background-color: var(--background--xlight, #FFF);
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
--ez-grid__selection-counter--z-index: var(--visible, 1);
|
|
13
13
|
/*@doc Define o sombreamento usado como borda.*/
|
|
14
14
|
--ez-grid__container--shadow: 0 0 16px 0 rgb(0 38 111 / 12%);
|
|
15
|
+
/*@doc Define altura mínima da grid */
|
|
16
|
+
--ez-grid--min-height: 300px;
|
|
17
|
+
|
|
18
|
+
min-height: var(--ez-grid--min-height);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.grid-header {
|
|
@@ -92,3 +96,23 @@
|
|
|
92
96
|
height: 0;
|
|
93
97
|
padding: 0;
|
|
94
98
|
}
|
|
99
|
+
|
|
100
|
+
.grid-header__pagination{
|
|
101
|
+
width: 30%;
|
|
102
|
+
min-width: 100px;
|
|
103
|
+
justify-content: flex-end;
|
|
104
|
+
flex-wrap: wrap;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.grid-header__left-container{
|
|
108
|
+
width: 70%
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.grid-header__pagination-label {
|
|
112
|
+
width: 100%;
|
|
113
|
+
white-space: nowrap
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.overflowed {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|