@sankhyalabs/ezui 5.20.3 → 5.21.0-dev.1
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 +121 -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 +1 -1
- 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 +35 -16
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +132 -58
- 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 +6 -1
- 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 +2 -2
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +9 -2
- 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 +622 -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 +127 -48
- 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-view/ez-form-view.css +17 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +22 -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 +8 -11
- 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 +103 -33
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +16 -5
- package/dist/collection/components/ez-icon/ez-icon.css +119 -117
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +5 -0
- package/dist/collection/components/ez-popup/ez-popup.css +2 -5
- package/dist/collection/components/ez-popup/ez-popup.js +23 -2
- package/dist/collection/components/ez-search/ez-search.css +331 -0
- package/dist/collection/components/ez-search/ez-search.js +698 -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 +1252 -359
- 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 +121 -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 +1 -1
- 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 +35 -16
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +133 -59
- 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 +6 -1
- 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 +2 -2
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +10 -3
- 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 +623 -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-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-245a44ed.entry.js → p-20ec22c0.entry.js} +1 -1
- package/dist/ezui/{p-e318d280.js → p-23a36bb6.js} +1 -1
- package/dist/ezui/{p-8252d9b5.entry.js → p-2a1a0e04.entry.js} +1 -1
- package/dist/ezui/{p-62903ab9.entry.js → p-384247cd.entry.js} +2 -2
- 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-62304715.entry.js → p-5e1d036e.entry.js} +1 -1
- package/dist/ezui/{p-7525e604.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/p-5ef056ce.entry.js +1 -0
- 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-701231f0.entry.js +1 -0
- 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-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-9aefaa52.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-a1ec32ef.entry.js +1 -0
- 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-32b4163f.entry.js → p-b041333c.entry.js} +1 -1
- package/dist/ezui/{p-12526044.entry.js → p-b567fa8c.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-db77a984.entry.js +1 -0
- package/dist/ezui/{p-028f264f.entry.js → p-e85c48d7.entry.js} +1 -1
- 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-view/ez-form-view.d.ts +3 -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 +17 -2
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +4 -1
- package/dist/types/components/ez-guide-navigator/interfaces/IGuideItem.d.ts +0 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +1 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +7 -1
- 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 +188 -15
- 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-47afb974.entry.js +0 -1
- package/dist/ezui/p-59bcb27c.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,7 +1,6 @@
|
|
|
1
|
-
import { ElementIDUtils, FloatingManager, ObjectUtils
|
|
1
|
+
import { ElementIDUtils, FloatingManager, ObjectUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
|
-
import {
|
|
4
|
-
import { REQUIRED_INFO } from "../../utils/constants";
|
|
3
|
+
import { CSSVarsUtils } from "../../utils";
|
|
5
4
|
export class EzComboBox {
|
|
6
5
|
constructor() {
|
|
7
6
|
this._changeDeboucingTimeout = null;
|
|
@@ -9,7 +8,6 @@ export class EzComboBox {
|
|
|
9
8
|
this._maxWidthValue = 0;
|
|
10
9
|
this._tabPressed = false;
|
|
11
10
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
12
|
-
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
13
11
|
this._lookupMode = false;
|
|
14
12
|
this._preSelection = undefined;
|
|
15
13
|
this._visibleOptions = undefined;
|
|
@@ -22,7 +20,6 @@ export class EzComboBox {
|
|
|
22
20
|
this.enabled = true;
|
|
23
21
|
this.options = undefined;
|
|
24
22
|
this.errorMessage = undefined;
|
|
25
|
-
this.searchMode = undefined;
|
|
26
23
|
this.showSelectedValue = false;
|
|
27
24
|
this.showOptionValue = false;
|
|
28
25
|
this.suppressSearch = false;
|
|
@@ -46,7 +43,7 @@ export class EzComboBox {
|
|
|
46
43
|
observeValue(newValue, oldValue) {
|
|
47
44
|
if (this._textInput && newValue != oldValue) {
|
|
48
45
|
try {
|
|
49
|
-
if (
|
|
46
|
+
if (typeof newValue === "string") {
|
|
50
47
|
this.setInputValue();
|
|
51
48
|
return;
|
|
52
49
|
}
|
|
@@ -71,7 +68,7 @@ export class EzComboBox {
|
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
observeOptions(newOptions, oldOptions) {
|
|
74
|
-
if ((newOptions
|
|
71
|
+
if (ObjectUtils.equals(newOptions, oldOptions))
|
|
75
72
|
return;
|
|
76
73
|
this.loadOptions(SearchMode.PRELOAD);
|
|
77
74
|
}
|
|
@@ -209,18 +206,19 @@ export class EzComboBox {
|
|
|
209
206
|
}
|
|
210
207
|
updateVisibleOptions() {
|
|
211
208
|
let opts = this._source || [];
|
|
212
|
-
if (
|
|
209
|
+
if (this._criteria) {
|
|
213
210
|
const upperCriteria = this._criteria.toUpperCase();
|
|
214
211
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
215
212
|
}
|
|
216
|
-
if (this.
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
|
|
213
|
+
if (this.hasToAddEmptyoption(opts)) {
|
|
214
|
+
opts = [{ value: undefined, label: "" }].concat(opts);
|
|
221
215
|
}
|
|
216
|
+
this._visibleOptions = opts;
|
|
222
217
|
this._maxWidthValue = this.getMaxWidthValue();
|
|
223
218
|
}
|
|
219
|
+
hasToAddEmptyoption(opts) {
|
|
220
|
+
return !this.suppressEmptyOption && !opts.filter(opt => !opt.value).length;
|
|
221
|
+
}
|
|
224
222
|
getMaxWidthValue() {
|
|
225
223
|
var _a;
|
|
226
224
|
if (this.showOptionValue) {
|
|
@@ -284,7 +282,7 @@ export class EzComboBox {
|
|
|
284
282
|
return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
|
|
285
283
|
}
|
|
286
284
|
nextOption() {
|
|
287
|
-
if (
|
|
285
|
+
if (!this.isOptionsVisible()) {
|
|
288
286
|
return;
|
|
289
287
|
}
|
|
290
288
|
this.showOptions();
|
|
@@ -307,9 +305,6 @@ export class EzComboBox {
|
|
|
307
305
|
this.selectOption(this._visibleOptions[this._preSelection]);
|
|
308
306
|
this._preSelection = undefined;
|
|
309
307
|
}
|
|
310
|
-
else {
|
|
311
|
-
this.controlListWithOnlyOne();
|
|
312
|
-
}
|
|
313
308
|
}
|
|
314
309
|
updateSource(source) {
|
|
315
310
|
this._startLoading = false;
|
|
@@ -328,7 +323,6 @@ export class EzComboBox {
|
|
|
328
323
|
this.updateVisibleOptions();
|
|
329
324
|
if (this._tabPressed) {
|
|
330
325
|
this._tabPressed = false;
|
|
331
|
-
this.controlEmptySearch();
|
|
332
326
|
}
|
|
333
327
|
}
|
|
334
328
|
else {
|
|
@@ -336,10 +330,6 @@ export class EzComboBox {
|
|
|
336
330
|
}
|
|
337
331
|
}
|
|
338
332
|
}
|
|
339
|
-
clearSource() {
|
|
340
|
-
this._source = [];
|
|
341
|
-
this.updateVisibleOptions();
|
|
342
|
-
}
|
|
343
333
|
selectOption(newOption) {
|
|
344
334
|
var _a, _b;
|
|
345
335
|
const currentValue = this.getSelectedOption(this.value);
|
|
@@ -351,10 +341,6 @@ export class EzComboBox {
|
|
|
351
341
|
else {
|
|
352
342
|
this.resetOptions();
|
|
353
343
|
}
|
|
354
|
-
if (this.searchMode) {
|
|
355
|
-
this._visibleOptions = [];
|
|
356
|
-
this.clearSource();
|
|
357
|
-
}
|
|
358
344
|
}
|
|
359
345
|
loadOptions(mode, argument = "") {
|
|
360
346
|
this._criteria = argument;
|
|
@@ -390,93 +376,6 @@ export class EzComboBox {
|
|
|
390
376
|
clearSearch() {
|
|
391
377
|
this.value = null;
|
|
392
378
|
}
|
|
393
|
-
controlListWithOnlyOne() {
|
|
394
|
-
var _a;
|
|
395
|
-
if (this.searchMode) {
|
|
396
|
-
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
397
|
-
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
398
|
-
this.selectOption(source[0]);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
controlEmptySearch() {
|
|
403
|
-
var _a;
|
|
404
|
-
if (this.searchMode) {
|
|
405
|
-
if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
406
|
-
this.clearSearch();
|
|
407
|
-
ApplicationUtils.info(this._textEmptyList);
|
|
408
|
-
}
|
|
409
|
-
else {
|
|
410
|
-
this.controlListWithOnlyOne();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
validateDescriptionValue() {
|
|
415
|
-
if (!this.searchMode || StringUtils.isEmpty(this.value)) {
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
let value = this.value;
|
|
419
|
-
if (typeof value === "object") {
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
if (StringUtils.isEmpty(value)) {
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
this.loadDescriptionValue(value);
|
|
426
|
-
}
|
|
427
|
-
async loadDescriptionValue(argument) {
|
|
428
|
-
var _a, _b;
|
|
429
|
-
if (argument == undefined) {
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
433
|
-
this.loadOptionValue(argument);
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
const searchArgument = {
|
|
437
|
-
mode: SearchMode.PREDICTIVE,
|
|
438
|
-
argument
|
|
439
|
-
};
|
|
440
|
-
const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
|
|
441
|
-
if (source == undefined) {
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
if (source instanceof Promise) {
|
|
445
|
-
source.then((result) => {
|
|
446
|
-
this.setDescriptionValue(result);
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
this.setDescriptionValue(source);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
setDescriptionValue(source) {
|
|
454
|
-
const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
|
|
455
|
-
if (value == undefined || !Object.keys(value).length) {
|
|
456
|
-
this.showNoResultMessage();
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
this._lookupMode = true;
|
|
460
|
-
this.value = value;
|
|
461
|
-
}
|
|
462
|
-
loadOptionValue(argument) {
|
|
463
|
-
var _a;
|
|
464
|
-
const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
|
|
465
|
-
if (source != undefined) {
|
|
466
|
-
this.selectOption(source);
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
this.showNoResultMessage();
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
async showNoResultMessage() {
|
|
473
|
-
this.clearSearch();
|
|
474
|
-
ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
|
|
475
|
-
}
|
|
476
|
-
getFieldLabel() {
|
|
477
|
-
var _a;
|
|
478
|
-
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
|
|
479
|
-
}
|
|
480
379
|
resetOptions() {
|
|
481
380
|
this.hideOptions();
|
|
482
381
|
this._criteria = undefined;
|
|
@@ -502,12 +401,7 @@ export class EzComboBox {
|
|
|
502
401
|
});
|
|
503
402
|
}
|
|
504
403
|
}
|
|
505
|
-
|
|
506
|
-
this.updateSource([]);
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
this.loadOptions(SearchMode.PRELOAD);
|
|
510
|
-
}
|
|
404
|
+
this.loadOptions(SearchMode.PRELOAD);
|
|
511
405
|
}
|
|
512
406
|
componentDidRender() {
|
|
513
407
|
var _a;
|
|
@@ -517,7 +411,6 @@ export class EzComboBox {
|
|
|
517
411
|
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
518
412
|
ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
519
413
|
});
|
|
520
|
-
this.validateDescriptionValue();
|
|
521
414
|
}
|
|
522
415
|
componentDidLoad() {
|
|
523
416
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
@@ -537,13 +430,7 @@ export class EzComboBox {
|
|
|
537
430
|
// Event handlers
|
|
538
431
|
//---------------------------------------------
|
|
539
432
|
handlerIconClick() {
|
|
540
|
-
this.
|
|
541
|
-
}
|
|
542
|
-
buildNumberArgument(argument) {
|
|
543
|
-
if (this.isTextSearch) {
|
|
544
|
-
return NaN;
|
|
545
|
-
}
|
|
546
|
-
return Number(argument || undefined);
|
|
433
|
+
this.showOptions();
|
|
547
434
|
}
|
|
548
435
|
onTextInputChangeHandler(event) {
|
|
549
436
|
var _a;
|
|
@@ -560,36 +447,12 @@ export class EzComboBox {
|
|
|
560
447
|
}
|
|
561
448
|
this._criteria = argument;
|
|
562
449
|
if (argument) {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
this.clearSource();
|
|
566
|
-
const enoughChars = argument.length >= this.limitCharsToSearch;
|
|
567
|
-
const argumentNumber = this.buildNumberArgument(argument);
|
|
568
|
-
if (enoughChars || !isNaN(argumentNumber)) {
|
|
569
|
-
this._showLoading = true;
|
|
570
|
-
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
571
|
-
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
572
|
-
}, this._deboucingTime);
|
|
573
|
-
this.showOptions();
|
|
574
|
-
}
|
|
575
|
-
else {
|
|
576
|
-
this.hideOptions();
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
this.updateVisibleOptions();
|
|
581
|
-
this.showOptions();
|
|
582
|
-
}
|
|
450
|
+
this.updateVisibleOptions();
|
|
451
|
+
this.showOptions();
|
|
583
452
|
}
|
|
584
453
|
else {
|
|
585
454
|
this.hideOptions();
|
|
586
|
-
|
|
587
|
-
this._showLoading = false;
|
|
588
|
-
this.clearSource();
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
this.updateVisibleOptions();
|
|
592
|
-
}
|
|
455
|
+
this.updateVisibleOptions();
|
|
593
456
|
}
|
|
594
457
|
}
|
|
595
458
|
clearDeboucingTimeout() {
|
|
@@ -599,9 +462,7 @@ export class EzComboBox {
|
|
|
599
462
|
}
|
|
600
463
|
}
|
|
601
464
|
onTextInputClickHandler() {
|
|
602
|
-
|
|
603
|
-
this.showOptions();
|
|
604
|
-
}
|
|
465
|
+
this.showOptions();
|
|
605
466
|
}
|
|
606
467
|
keyDownHandler(event) {
|
|
607
468
|
this._tabPressed = false;
|
|
@@ -633,7 +494,6 @@ export class EzComboBox {
|
|
|
633
494
|
break;
|
|
634
495
|
case "Tab":
|
|
635
496
|
this._tabPressed = true;
|
|
636
|
-
this.controlListWithOnlyOne();
|
|
637
497
|
break;
|
|
638
498
|
}
|
|
639
499
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -650,11 +510,8 @@ export class EzComboBox {
|
|
|
650
510
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
651
511
|
}
|
|
652
512
|
render() {
|
|
653
|
-
var _a;
|
|
654
513
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
655
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot:
|
|
656
|
-
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
657
|
-
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
514
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "chevron-down" }))), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
658
515
|
&& this._visibleOptions.length === 0
|
|
659
516
|
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
660
517
|
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
@@ -788,23 +645,6 @@ export class EzComboBox {
|
|
|
788
645
|
"attribute": "error-message",
|
|
789
646
|
"reflect": true
|
|
790
647
|
},
|
|
791
|
-
"searchMode": {
|
|
792
|
-
"type": "boolean",
|
|
793
|
-
"mutable": false,
|
|
794
|
-
"complexType": {
|
|
795
|
-
"original": "boolean",
|
|
796
|
-
"resolved": "boolean",
|
|
797
|
-
"references": {}
|
|
798
|
-
},
|
|
799
|
-
"required": false,
|
|
800
|
-
"optional": false,
|
|
801
|
-
"docs": {
|
|
802
|
-
"tags": [],
|
|
803
|
-
"text": "Se true ativa o modo pesquisa do ez-combo-box."
|
|
804
|
-
},
|
|
805
|
-
"attribute": "search-mode",
|
|
806
|
-
"reflect": false
|
|
807
|
-
},
|
|
808
648
|
"showSelectedValue": {
|
|
809
649
|
"type": "boolean",
|
|
810
650
|
"mutable": false,
|
|
@@ -16,6 +16,11 @@ export class EzDropdown {
|
|
|
16
16
|
this.value = undefined;
|
|
17
17
|
this.itemBuilder = undefined;
|
|
18
18
|
}
|
|
19
|
+
handleClickOutside(event) {
|
|
20
|
+
if (!this._element.contains(event.target)) {
|
|
21
|
+
this.ezOutsideClick.emit();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
19
24
|
//---------------------------------------------
|
|
20
25
|
// Private methods
|
|
21
26
|
//---------------------------------------------
|
|
@@ -94,13 +99,13 @@ export class EzDropdown {
|
|
|
94
99
|
this._itemList[item.id] = {};
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
|
-
getContainerItemBuilder(item, level) {
|
|
102
|
+
getContainerItemBuilder(item, level, isLockedLevels, hasIcon, hasChildren) {
|
|
98
103
|
if (this.itemBuilder == undefined) {
|
|
99
104
|
return;
|
|
100
105
|
}
|
|
101
106
|
const customContent = this.itemBuilder(item, level);
|
|
102
107
|
if (customContent == undefined) {
|
|
103
|
-
return;
|
|
108
|
+
return this.defaultItemBuilder(item, isLockedLevels, hasIcon, hasChildren);
|
|
104
109
|
}
|
|
105
110
|
if (typeof customContent !== "string") {
|
|
106
111
|
return (h("div", { class: "ez-dropdown__item-builder" }, customContent));
|
|
@@ -121,7 +126,7 @@ export class EzDropdown {
|
|
|
121
126
|
var _a;
|
|
122
127
|
return (item.type !== "divider"
|
|
123
128
|
? h("div", Object.assign({ ref: (ref) => this._itemList[item.id] = ref, class: "ez-dropdown__item", "data-level": level }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`${item.id}_ezDropdownItem`) }), h("div", { class: "ez-dropdown__item-content", onClick: (evt) => this.onItemClick(evt, item), onMouseOver: (evt) => this.onShowSubmenu(evt, item) }, this.itemBuilder
|
|
124
|
-
? this.getContainerItemBuilder(item, level)
|
|
129
|
+
? this.getContainerItemBuilder(item, level, isLockedLevels, hasIcon, hasChildren)
|
|
125
130
|
: this.defaultItemBuilder(item, isLockedLevels, hasIcon, hasChildren)), ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
126
131
|
!isLockedLevels &&
|
|
127
132
|
hasChildren &&
|
|
@@ -350,7 +355,31 @@ export class EzDropdown {
|
|
|
350
355
|
}
|
|
351
356
|
}
|
|
352
357
|
}
|
|
358
|
+
}, {
|
|
359
|
+
"method": "ezOutsideClick",
|
|
360
|
+
"name": "ezOutsideClick",
|
|
361
|
+
"bubbles": true,
|
|
362
|
+
"cancelable": true,
|
|
363
|
+
"composed": true,
|
|
364
|
+
"docs": {
|
|
365
|
+
"tags": [],
|
|
366
|
+
"text": "Emitido quando ocorrer um click fora do componente."
|
|
367
|
+
},
|
|
368
|
+
"complexType": {
|
|
369
|
+
"original": "void",
|
|
370
|
+
"resolved": "void",
|
|
371
|
+
"references": {}
|
|
372
|
+
}
|
|
353
373
|
}];
|
|
354
374
|
}
|
|
355
375
|
static get elementRef() { return "_element"; }
|
|
376
|
+
static get listeners() {
|
|
377
|
+
return [{
|
|
378
|
+
"name": "click",
|
|
379
|
+
"method": "handleClickOutside",
|
|
380
|
+
"target": "document",
|
|
381
|
+
"capture": false,
|
|
382
|
+
"passive": false
|
|
383
|
+
}];
|
|
384
|
+
}
|
|
356
385
|
}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
3
|
flex-wrap: wrap;
|
|
5
4
|
width: 100%;
|
|
5
|
+
|
|
6
|
+
/*@doc Define o tamanho mínimo dos itens do formulário.*/
|
|
7
|
+
--ez-form-view__item--min-width: 220px;
|
|
8
|
+
/*@doc Define o espaçamento entre itens do formulário.*/
|
|
9
|
+
--ez-form-view__item--sapce-width: 5px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.form-view__content{
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));
|
|
15
|
+
gap: var(--ez-form-view__item--sapce-width);
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.input-full_width {
|
|
20
|
+
grid-column: 1 / -1;
|
|
21
|
+
width: 100%;
|
|
6
22
|
}
|
|
@@ -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() {
|
|
@@ -32,19 +32,36 @@ export class EzFormView {
|
|
|
32
32
|
const formItems = new FormItems(Array.from(this._element.querySelectorAll("[data-form-item]")));
|
|
33
33
|
this.formItemsReady.emit(formItems);
|
|
34
34
|
}
|
|
35
|
+
isItemFullWidth(userInterface) {
|
|
36
|
+
return [
|
|
37
|
+
UserInterface.FILE,
|
|
38
|
+
UserInterface.LONGTEXT
|
|
39
|
+
].includes(userInterface);
|
|
40
|
+
}
|
|
41
|
+
buildFormItemElement(item, classItem = "") {
|
|
42
|
+
if (this.isItemFullWidth(item.userInterface)) {
|
|
43
|
+
classItem += " input-full_width";
|
|
44
|
+
}
|
|
45
|
+
return h("div", { class: classItem }, fieldBuilder(item));
|
|
46
|
+
}
|
|
35
47
|
render() {
|
|
36
48
|
ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
|
|
37
49
|
if (this.fields == undefined) {
|
|
38
50
|
return;
|
|
39
51
|
}
|
|
40
|
-
|
|
52
|
+
let nonArrayGrup = [];
|
|
53
|
+
let formContent = Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
|
|
41
54
|
if (Array.isArray(value)) {
|
|
42
|
-
return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi =>
|
|
55
|
+
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
56
|
}
|
|
44
57
|
else {
|
|
45
|
-
|
|
58
|
+
nonArrayGrup.push(value);
|
|
46
59
|
}
|
|
47
|
-
})
|
|
60
|
+
});
|
|
61
|
+
// Filtra os elementos que não são arrays e os coloca dentro de uma única div
|
|
62
|
+
let nonArrayElements = nonArrayGrup.map((value) => this.buildFormItemElement(value));
|
|
63
|
+
let groupedNonArrayElements = h("div", { class: "form-view__content" }, nonArrayElements);
|
|
64
|
+
return (h(Host, null, groupedNonArrayElements, formContent));
|
|
48
65
|
}
|
|
49
66
|
static get is() { return "ez-form-view"; }
|
|
50
67
|
static get encapsulation() { return "scoped"; }
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, DataType, MaskFormatter, NumberUtils, SortMode, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
2
|
import { Grid, } from 'ag-grid-community';
|
|
3
3
|
import { Grid as EnterpriseGrid, LicenseManager } from 'ag-grid-enterprise';
|
|
4
4
|
import DataSource from './DataSource';
|
|
@@ -6,8 +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 {
|
|
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,7 @@ 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;
|
|
46
45
|
this._enterprise = enterprise;
|
|
47
46
|
}
|
|
48
47
|
getGridConfig() {
|
|
@@ -183,11 +182,9 @@ export default class AgGridController {
|
|
|
183
182
|
this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
|
|
184
183
|
}
|
|
185
184
|
}
|
|
186
|
-
setFilterColumnLeftPosition(
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
const leftString = ePopup.style.left.replace('px', '');
|
|
190
|
-
this._filterColumnleftPosition = `${calcFilterColumnLeftPosition(parseInt(leftString))}px`;
|
|
185
|
+
setFilterColumnLeftPosition({ type, ePopup }) {
|
|
186
|
+
if (type === 'columnMenu') {
|
|
187
|
+
this._filterColumnleftPosition = ePopup.getBoundingClientRect().left;
|
|
191
188
|
return;
|
|
192
189
|
}
|
|
193
190
|
}
|
|
@@ -627,10 +624,10 @@ export default class AgGridController {
|
|
|
627
624
|
tooltip: tooltip,
|
|
628
625
|
isSortable: propSortable,
|
|
629
626
|
hasFilter: () => this.hasFilterColumn(source.name),
|
|
630
|
-
showColumnFilter: (leftPosition
|
|
627
|
+
showColumnFilter: (leftPosition) => this.showFilterColumn({ columnName: source.name, columnLabel: source.label, leftPosition, filteredOptions: this._filteredColumns.get(source.name), fromIcon: true }),
|
|
631
628
|
},
|
|
632
629
|
valueFormatter: params => {
|
|
633
|
-
if (params.value
|
|
630
|
+
if (params.value === undefined) {
|
|
634
631
|
return "";
|
|
635
632
|
}
|
|
636
633
|
if (params.value instanceof Promise) {
|
|
@@ -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();
|