@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
|
@@ -1,28 +1,25 @@
|
|
|
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;
|
|
8
|
-
this._limitCharsToSearch = 3;
|
|
9
7
|
this._deboucingTime = 300;
|
|
10
8
|
this._maxWidthValue = 0;
|
|
11
9
|
this._tabPressed = false;
|
|
12
10
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
13
|
-
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
14
11
|
this._lookupMode = false;
|
|
15
12
|
this._preSelection = undefined;
|
|
16
13
|
this._visibleOptions = undefined;
|
|
17
14
|
this._startLoading = false;
|
|
18
15
|
this._showLoading = true;
|
|
19
16
|
this._criteria = undefined;
|
|
17
|
+
this.limitCharsToSearch = 3;
|
|
20
18
|
this.value = undefined;
|
|
21
19
|
this.label = undefined;
|
|
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;
|
|
@@ -30,7 +27,9 @@ export class EzComboBox {
|
|
|
30
27
|
this.suppressEmptyOption = false;
|
|
31
28
|
this.canShowError = true;
|
|
32
29
|
this.mode = "regular";
|
|
30
|
+
this.hideErrorOnFocusOut = true;
|
|
33
31
|
this.listOptionsPosition = undefined;
|
|
32
|
+
this.isTextSearch = false;
|
|
34
33
|
}
|
|
35
34
|
observeErrorMessage() {
|
|
36
35
|
var _a;
|
|
@@ -44,7 +43,7 @@ export class EzComboBox {
|
|
|
44
43
|
observeValue(newValue, oldValue) {
|
|
45
44
|
if (this._textInput && newValue != oldValue) {
|
|
46
45
|
try {
|
|
47
|
-
if (
|
|
46
|
+
if (typeof newValue === "string") {
|
|
48
47
|
this.setInputValue();
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
@@ -207,7 +206,7 @@ export class EzComboBox {
|
|
|
207
206
|
}
|
|
208
207
|
updateVisibleOptions() {
|
|
209
208
|
let opts = this._source || [];
|
|
210
|
-
if (
|
|
209
|
+
if (this._criteria) {
|
|
211
210
|
const upperCriteria = this._criteria.toUpperCase();
|
|
212
211
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
213
212
|
}
|
|
@@ -282,7 +281,7 @@ export class EzComboBox {
|
|
|
282
281
|
return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
|
|
283
282
|
}
|
|
284
283
|
nextOption() {
|
|
285
|
-
if (
|
|
284
|
+
if (!this.isOptionsVisible()) {
|
|
286
285
|
return;
|
|
287
286
|
}
|
|
288
287
|
this.showOptions();
|
|
@@ -305,9 +304,6 @@ export class EzComboBox {
|
|
|
305
304
|
this.selectOption(this._visibleOptions[this._preSelection]);
|
|
306
305
|
this._preSelection = undefined;
|
|
307
306
|
}
|
|
308
|
-
else {
|
|
309
|
-
this.controlListWithOnlyOne();
|
|
310
|
-
}
|
|
311
307
|
}
|
|
312
308
|
updateSource(source) {
|
|
313
309
|
this._startLoading = false;
|
|
@@ -326,7 +322,6 @@ export class EzComboBox {
|
|
|
326
322
|
this.updateVisibleOptions();
|
|
327
323
|
if (this._tabPressed) {
|
|
328
324
|
this._tabPressed = false;
|
|
329
|
-
this.controlEmptySearch();
|
|
330
325
|
}
|
|
331
326
|
}
|
|
332
327
|
else {
|
|
@@ -334,10 +329,6 @@ export class EzComboBox {
|
|
|
334
329
|
}
|
|
335
330
|
}
|
|
336
331
|
}
|
|
337
|
-
clearSource() {
|
|
338
|
-
this._source = [];
|
|
339
|
-
this.updateVisibleOptions();
|
|
340
|
-
}
|
|
341
332
|
selectOption(newOption) {
|
|
342
333
|
var _a, _b;
|
|
343
334
|
const currentValue = this.getSelectedOption(this.value);
|
|
@@ -349,11 +340,6 @@ export class EzComboBox {
|
|
|
349
340
|
else {
|
|
350
341
|
this.resetOptions();
|
|
351
342
|
}
|
|
352
|
-
if (this.searchMode) {
|
|
353
|
-
this._visibleOptions = [];
|
|
354
|
-
this.clearSource();
|
|
355
|
-
}
|
|
356
|
-
this.setFocus();
|
|
357
343
|
}
|
|
358
344
|
loadOptions(mode, argument = "") {
|
|
359
345
|
this._criteria = argument;
|
|
@@ -389,93 +375,6 @@ export class EzComboBox {
|
|
|
389
375
|
clearSearch() {
|
|
390
376
|
this.value = null;
|
|
391
377
|
}
|
|
392
|
-
controlListWithOnlyOne() {
|
|
393
|
-
var _a;
|
|
394
|
-
if (this.searchMode) {
|
|
395
|
-
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
396
|
-
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
397
|
-
this.selectOption(source[0]);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
controlEmptySearch() {
|
|
402
|
-
var _a;
|
|
403
|
-
if (this.searchMode) {
|
|
404
|
-
if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
405
|
-
this.clearSearch();
|
|
406
|
-
ApplicationUtils.info(this._textEmptyList);
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
this.controlListWithOnlyOne();
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
validateDescriptionValue() {
|
|
414
|
-
if (!this.searchMode || StringUtils.isEmpty(this.value)) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
let value = this.value;
|
|
418
|
-
if (typeof value === "object") {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
if (StringUtils.isEmpty(value)) {
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
this.loadDescriptionValue(value);
|
|
425
|
-
}
|
|
426
|
-
async loadDescriptionValue(argument) {
|
|
427
|
-
var _a, _b;
|
|
428
|
-
if (argument == undefined) {
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
432
|
-
this.loadOptionValue(argument);
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
const searchArgument = {
|
|
436
|
-
mode: SearchMode.PREDICTIVE,
|
|
437
|
-
argument
|
|
438
|
-
};
|
|
439
|
-
const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
|
|
440
|
-
if (source == undefined) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
if (source instanceof Promise) {
|
|
444
|
-
source.then((result) => {
|
|
445
|
-
this.setDescriptionValue(result);
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
this.setDescriptionValue(source);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
setDescriptionValue(source) {
|
|
453
|
-
const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
|
|
454
|
-
if (value == undefined || !Object.keys(value).length) {
|
|
455
|
-
this.showNoResultMessage();
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
this._lookupMode = true;
|
|
459
|
-
this.value = value;
|
|
460
|
-
}
|
|
461
|
-
loadOptionValue(argument) {
|
|
462
|
-
var _a;
|
|
463
|
-
const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
|
|
464
|
-
if (source != undefined) {
|
|
465
|
-
this.selectOption(source);
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
this.showNoResultMessage();
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
async showNoResultMessage() {
|
|
472
|
-
this.clearSearch();
|
|
473
|
-
ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
|
|
474
|
-
}
|
|
475
|
-
getFieldLabel() {
|
|
476
|
-
var _a;
|
|
477
|
-
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
|
|
478
|
-
}
|
|
479
378
|
resetOptions() {
|
|
480
379
|
this.hideOptions();
|
|
481
380
|
this._criteria = undefined;
|
|
@@ -501,12 +400,7 @@ export class EzComboBox {
|
|
|
501
400
|
});
|
|
502
401
|
}
|
|
503
402
|
}
|
|
504
|
-
|
|
505
|
-
this.updateSource([]);
|
|
506
|
-
}
|
|
507
|
-
else {
|
|
508
|
-
this.loadOptions(SearchMode.PRELOAD);
|
|
509
|
-
}
|
|
403
|
+
this.loadOptions(SearchMode.PRELOAD);
|
|
510
404
|
}
|
|
511
405
|
componentDidRender() {
|
|
512
406
|
var _a;
|
|
@@ -516,7 +410,6 @@ export class EzComboBox {
|
|
|
516
410
|
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
517
411
|
ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
518
412
|
});
|
|
519
|
-
this.validateDescriptionValue();
|
|
520
413
|
}
|
|
521
414
|
componentDidLoad() {
|
|
522
415
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
@@ -536,7 +429,7 @@ export class EzComboBox {
|
|
|
536
429
|
// Event handlers
|
|
537
430
|
//---------------------------------------------
|
|
538
431
|
handlerIconClick() {
|
|
539
|
-
this.
|
|
432
|
+
this.showOptions();
|
|
540
433
|
}
|
|
541
434
|
onTextInputChangeHandler(event) {
|
|
542
435
|
var _a;
|
|
@@ -548,40 +441,17 @@ export class EzComboBox {
|
|
|
548
441
|
return;
|
|
549
442
|
}
|
|
550
443
|
const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
551
|
-
const argumentNumber = Number(argument || undefined);
|
|
552
444
|
if (!this._criteria) {
|
|
553
445
|
this._textInput.value = event.data || argument;
|
|
554
446
|
}
|
|
555
447
|
this._criteria = argument;
|
|
556
448
|
if (argument) {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
this.clearSource();
|
|
560
|
-
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
561
|
-
this._showLoading = true;
|
|
562
|
-
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
563
|
-
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
564
|
-
}, this._deboucingTime);
|
|
565
|
-
this.showOptions();
|
|
566
|
-
}
|
|
567
|
-
else {
|
|
568
|
-
this.hideOptions();
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
572
|
-
this.updateVisibleOptions();
|
|
573
|
-
this.showOptions();
|
|
574
|
-
}
|
|
449
|
+
this.updateVisibleOptions();
|
|
450
|
+
this.showOptions();
|
|
575
451
|
}
|
|
576
452
|
else {
|
|
577
453
|
this.hideOptions();
|
|
578
|
-
|
|
579
|
-
this._showLoading = false;
|
|
580
|
-
this.clearSource();
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
this.updateVisibleOptions();
|
|
584
|
-
}
|
|
454
|
+
this.updateVisibleOptions();
|
|
585
455
|
}
|
|
586
456
|
}
|
|
587
457
|
clearDeboucingTimeout() {
|
|
@@ -591,9 +461,7 @@ export class EzComboBox {
|
|
|
591
461
|
}
|
|
592
462
|
}
|
|
593
463
|
onTextInputClickHandler() {
|
|
594
|
-
|
|
595
|
-
this.showOptions();
|
|
596
|
-
}
|
|
464
|
+
this.showOptions();
|
|
597
465
|
}
|
|
598
466
|
keyDownHandler(event) {
|
|
599
467
|
this._tabPressed = false;
|
|
@@ -625,7 +493,6 @@ export class EzComboBox {
|
|
|
625
493
|
break;
|
|
626
494
|
case "Tab":
|
|
627
495
|
this._tabPressed = true;
|
|
628
|
-
this.controlListWithOnlyOne();
|
|
629
496
|
break;
|
|
630
497
|
}
|
|
631
498
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -635,17 +502,15 @@ export class EzComboBox {
|
|
|
635
502
|
//event.stopPropagation();
|
|
636
503
|
}
|
|
637
504
|
onTextInputFocusOutHandler() {
|
|
638
|
-
this.
|
|
505
|
+
if (this.hideErrorOnFocusOut)
|
|
506
|
+
this.cancelPreselection();
|
|
639
507
|
}
|
|
640
508
|
canShowListOptions() {
|
|
641
509
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
642
510
|
}
|
|
643
511
|
render() {
|
|
644
|
-
var _a;
|
|
645
512
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
646
|
-
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:
|
|
647
|
-
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
648
|
-
: 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
|
|
513
|
+
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
|
|
649
514
|
&& this._visibleOptions.length === 0
|
|
650
515
|
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
651
516
|
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
@@ -666,6 +531,24 @@ export class EzComboBox {
|
|
|
666
531
|
}
|
|
667
532
|
static get properties() {
|
|
668
533
|
return {
|
|
534
|
+
"limitCharsToSearch": {
|
|
535
|
+
"type": "number",
|
|
536
|
+
"mutable": false,
|
|
537
|
+
"complexType": {
|
|
538
|
+
"original": "number",
|
|
539
|
+
"resolved": "number",
|
|
540
|
+
"references": {}
|
|
541
|
+
},
|
|
542
|
+
"required": false,
|
|
543
|
+
"optional": false,
|
|
544
|
+
"docs": {
|
|
545
|
+
"tags": [],
|
|
546
|
+
"text": "Define o limite de caracteres m\u00EDnimo para realizar uma pesquisa"
|
|
547
|
+
},
|
|
548
|
+
"attribute": "limit-chars-to-search",
|
|
549
|
+
"reflect": false,
|
|
550
|
+
"defaultValue": "3"
|
|
551
|
+
},
|
|
669
552
|
"value": {
|
|
670
553
|
"type": "string",
|
|
671
554
|
"mutable": true,
|
|
@@ -761,23 +644,6 @@ export class EzComboBox {
|
|
|
761
644
|
"attribute": "error-message",
|
|
762
645
|
"reflect": true
|
|
763
646
|
},
|
|
764
|
-
"searchMode": {
|
|
765
|
-
"type": "boolean",
|
|
766
|
-
"mutable": false,
|
|
767
|
-
"complexType": {
|
|
768
|
-
"original": "boolean",
|
|
769
|
-
"resolved": "boolean",
|
|
770
|
-
"references": {}
|
|
771
|
-
},
|
|
772
|
-
"required": false,
|
|
773
|
-
"optional": false,
|
|
774
|
-
"docs": {
|
|
775
|
-
"tags": [],
|
|
776
|
-
"text": "Se true ativa o modo pesquisa do ez-combo-box."
|
|
777
|
-
},
|
|
778
|
-
"attribute": "search-mode",
|
|
779
|
-
"reflect": false
|
|
780
|
-
},
|
|
781
647
|
"showSelectedValue": {
|
|
782
648
|
"type": "boolean",
|
|
783
649
|
"mutable": false,
|
|
@@ -914,6 +780,24 @@ export class EzComboBox {
|
|
|
914
780
|
"reflect": true,
|
|
915
781
|
"defaultValue": "\"regular\""
|
|
916
782
|
},
|
|
783
|
+
"hideErrorOnFocusOut": {
|
|
784
|
+
"type": "boolean",
|
|
785
|
+
"mutable": false,
|
|
786
|
+
"complexType": {
|
|
787
|
+
"original": "boolean",
|
|
788
|
+
"resolved": "boolean",
|
|
789
|
+
"references": {}
|
|
790
|
+
},
|
|
791
|
+
"required": false,
|
|
792
|
+
"optional": false,
|
|
793
|
+
"docs": {
|
|
794
|
+
"tags": [],
|
|
795
|
+
"text": "Quando verdadeiro deixa de exibir a mensagem de erro (se existente) quando focar em um elemento diferente."
|
|
796
|
+
},
|
|
797
|
+
"attribute": "hide-error-on-focus-out",
|
|
798
|
+
"reflect": false,
|
|
799
|
+
"defaultValue": "true"
|
|
800
|
+
},
|
|
917
801
|
"listOptionsPosition": {
|
|
918
802
|
"type": "unknown",
|
|
919
803
|
"mutable": false,
|
|
@@ -932,6 +816,24 @@ export class EzComboBox {
|
|
|
932
816
|
"tags": [],
|
|
933
817
|
"text": "Define um posicionamento fixo para a lista de op\u00E7\u00F5es do CheckBox."
|
|
934
818
|
}
|
|
819
|
+
},
|
|
820
|
+
"isTextSearch": {
|
|
821
|
+
"type": "boolean",
|
|
822
|
+
"mutable": false,
|
|
823
|
+
"complexType": {
|
|
824
|
+
"original": "boolean",
|
|
825
|
+
"resolved": "boolean",
|
|
826
|
+
"references": {}
|
|
827
|
+
},
|
|
828
|
+
"required": false,
|
|
829
|
+
"optional": false,
|
|
830
|
+
"docs": {
|
|
831
|
+
"tags": [],
|
|
832
|
+
"text": "Informa se a pesquisa \u00E9 do tipo texto."
|
|
833
|
+
},
|
|
834
|
+
"attribute": "is-text-search",
|
|
835
|
+
"reflect": false,
|
|
836
|
+
"defaultValue": "false"
|
|
935
837
|
}
|
|
936
838
|
};
|
|
937
839
|
}
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
--dialog__success--background-color: var(--color--alert-success-500, #00523c);
|
|
49
49
|
|
|
50
50
|
/*@doc Define a camada que o dialog será exibido.*/
|
|
51
|
-
--dialog-z-index: var(--
|
|
51
|
+
--dialog-z-index: var(--elevation--100, 100);
|
|
52
52
|
/*@doc Contém a imagem do ícone de alerta.*/
|
|
53
53
|
--dialog--warning__image: url('data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>');
|
|
54
54
|
/*@doc Contém a imagem do ícone crítico.*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, forceUpdate } from
|
|
1
|
+
import { h, forceUpdate, } from '@stencil/core';
|
|
2
2
|
import { DialogType } from "./DialogType";
|
|
3
3
|
import { ElementIDUtils, FloatingManager } from "@sankhyalabs/core";
|
|
4
4
|
class Message {
|
|
@@ -17,10 +17,12 @@ class Message {
|
|
|
17
17
|
}
|
|
18
18
|
export class EzDialog {
|
|
19
19
|
constructor() {
|
|
20
|
+
this.PRIMARY_BUTTON_ID = "EZ_DIALOG_PRIMARY_BUTTON";
|
|
20
21
|
this.labelConfirm = 'Sim';
|
|
21
22
|
this.labelCancel = 'Não';
|
|
22
23
|
this.btnConfirmDanger = false;
|
|
23
24
|
this._messageQueue = [];
|
|
25
|
+
this._canFocusOnPrimaryBtn = false;
|
|
24
26
|
this.confirm = false;
|
|
25
27
|
this.dialogType = undefined;
|
|
26
28
|
this.message = undefined;
|
|
@@ -29,8 +31,17 @@ export class EzDialog {
|
|
|
29
31
|
this.ezTitle = undefined;
|
|
30
32
|
this.beforeClose = undefined;
|
|
31
33
|
}
|
|
32
|
-
observeConfig() {
|
|
34
|
+
observeConfig(newValue, oldValue) {
|
|
33
35
|
this.manageOverflow();
|
|
36
|
+
//Eh preciso verificar se gouve de fato mudança do estado opened de FALSE para TRUE
|
|
37
|
+
if (newValue && !oldValue) {
|
|
38
|
+
this._canFocusOnPrimaryBtn = true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleKeyDown(event) {
|
|
42
|
+
if (event.key === 'Escape' || event.key === 'Esc') {
|
|
43
|
+
this.handleButtonClick(false);
|
|
44
|
+
}
|
|
34
45
|
}
|
|
35
46
|
manageOverflow() {
|
|
36
47
|
if (this.opened) {
|
|
@@ -146,17 +157,32 @@ export class EzDialog {
|
|
|
146
157
|
}
|
|
147
158
|
componentDidRender() {
|
|
148
159
|
this.manageOverlay();
|
|
160
|
+
this.focusOnDialog();
|
|
161
|
+
this.handleFocusOnPrimaryButton();
|
|
162
|
+
}
|
|
163
|
+
focusOnDialog() {
|
|
149
164
|
const dialog = this._element.shadowRoot.querySelector('.overlay .dialog');
|
|
150
165
|
if (dialog instanceof HTMLDivElement) {
|
|
151
166
|
dialog.style.outline = 'none';
|
|
152
167
|
dialog.focus();
|
|
153
168
|
}
|
|
154
169
|
}
|
|
170
|
+
handleFocusOnPrimaryButton() {
|
|
171
|
+
if (this._canFocusOnPrimaryBtn) {
|
|
172
|
+
this.focusOnPrimaryButton();
|
|
173
|
+
this._canFocusOnPrimaryBtn = false;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
focusOnPrimaryButton() {
|
|
177
|
+
const btnConfirm = this._element.shadowRoot.querySelector(`#${this.PRIMARY_BUTTON_ID}`);
|
|
178
|
+
const buttonElement = btnConfirm === null || btnConfirm === void 0 ? void 0 : btnConfirm.shadowRoot.querySelector('button');
|
|
179
|
+
buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.focus();
|
|
180
|
+
}
|
|
155
181
|
render() {
|
|
156
182
|
if (this.opened && this._currentMessage) {
|
|
157
183
|
return (h("div", { class: "overlay", ref: ref => this._overlayRef = ref }, h("div", { tabindex: "-1", class: "dialog" }, this.getTypeIndicatorElement(this._currentMessage), h("div", { class: this.getClassContainer(this._currentMessage) }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.getIconElement(this._currentMessage), h("div", { class: this.getClassTitleLabel(this._currentMessage), innerHTML: this._currentMessage.title, "data-element-id": ElementIDUtils.getInternalIDInfo("title") })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false), "data-element-id": ElementIDUtils.getInternalIDInfo("buttonClose") })), h("div", { class: "message", innerHTML: this._currentMessage.message, "data-element-id": ElementIDUtils.getInternalIDInfo("message") }), this._currentMessage.confirm &&
|
|
158
|
-
h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__cancel", "data-element-id": ElementIDUtils.getInternalIDInfo("cancel"), label: this._currentMessage.labelCancel, onClick: () => this.handleButtonClick(false) }), h("ez-button", { class: !this._currentMessage.btnConfirmDanger ? "button__confirm" : "button__confirm--danger", "data-element-id": ElementIDUtils.getInternalIDInfo("confirm"), label: this._currentMessage.labelConfirm, onClick: () => this.handleButtonClick(true) })), !this._currentMessage.confirm &&
|
|
159
|
-
h("div", { class: "button__confirm--container" }, h("ez-button", { label: 'Ok', "data-element-id": ElementIDUtils.getInternalIDInfo("ok"), class: "button__confirm", onClick: () => this.handleButtonClick(true) }))))));
|
|
184
|
+
h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__cancel", "data-element-id": ElementIDUtils.getInternalIDInfo("cancel"), label: this._currentMessage.labelCancel, onClick: () => this.handleButtonClick(false) }), h("ez-button", { id: this.PRIMARY_BUTTON_ID, class: !this._currentMessage.btnConfirmDanger ? "button__confirm" : "button__confirm--danger", "data-element-id": ElementIDUtils.getInternalIDInfo("confirm"), label: this._currentMessage.labelConfirm, onClick: () => this.handleButtonClick(true) })), !this._currentMessage.confirm &&
|
|
185
|
+
h("div", { class: "button__confirm--container" }, h("ez-button", { id: this.PRIMARY_BUTTON_ID, label: 'Ok', "data-element-id": ElementIDUtils.getInternalIDInfo("ok"), class: "button__confirm", onClick: () => this.handleButtonClick(true) }))))));
|
|
160
186
|
}
|
|
161
187
|
return null;
|
|
162
188
|
}
|
|
@@ -398,4 +424,13 @@ export class EzDialog {
|
|
|
398
424
|
"methodName": "observeConfig"
|
|
399
425
|
}];
|
|
400
426
|
}
|
|
427
|
+
static get listeners() {
|
|
428
|
+
return [{
|
|
429
|
+
"name": "keydown",
|
|
430
|
+
"method": "handleKeyDown",
|
|
431
|
+
"target": "window",
|
|
432
|
+
"capture": false,
|
|
433
|
+
"passive": false
|
|
434
|
+
}];
|
|
435
|
+
}
|
|
401
436
|
}
|
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
--ez-dropdown--background-color: var(--background--xlight, #fff);
|
|
13
13
|
/*@doc Define a fonte do componente.*/
|
|
14
14
|
--ez-dropdown--font-family: var(--font-pattern, 'Roboto');
|
|
15
|
-
/*@doc Define a largura máxima do componente.*/
|
|
16
|
-
--ez-dropdown--max-width: 320px;
|
|
17
15
|
/*@doc Define a altura máxima do componente.*/
|
|
18
|
-
--ez-dropdown--max-height:
|
|
16
|
+
--ez-dropdown--max-height: 415px;
|
|
19
17
|
|
|
20
18
|
/* item*/
|
|
21
19
|
/*@doc Define o espaçamento interno de cada item do componente.*/
|
|
@@ -120,6 +118,9 @@
|
|
|
120
118
|
border-radius: var(--ez-dropdown--border-radius);
|
|
121
119
|
background-color: var(--ez-dropdown--background-color);
|
|
122
120
|
max-width: var(--ez-dropdown--max-width);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ez-dropdown__max-height {
|
|
123
124
|
max-height: var(--ez-dropdown--max-height);
|
|
124
125
|
}
|
|
125
126
|
|
|
@@ -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 &&
|
|
@@ -137,7 +142,7 @@ export class EzDropdown {
|
|
|
137
142
|
const hasGroup = this.hasGroup(branchItems);
|
|
138
143
|
const hasIcon = this.hasIcon(branchItems);
|
|
139
144
|
const hasChildren = this.hasChildren(branchItems);
|
|
140
|
-
return (h("div", { class: "ez-dropdown", "data-level": level }, h("div", { class: "ez-dropdown__container" }, Object.keys(itemsByGroup)
|
|
145
|
+
return (h("div", { class: "ez-dropdown ez-dropdown__max-height", "data-level": level }, h("div", { class: "ez-dropdown__container" }, Object.keys(itemsByGroup)
|
|
141
146
|
.map((groupLabel) => {
|
|
142
147
|
return (h("div", Object.assign({ class: "ez-dropdown__group" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`${groupLabel}_ezDropdownGroup`) }), groupLabel !== "noGroup" &&
|
|
143
148
|
h("label", { class: "ez-dropdown__group-label", title: groupLabel }, groupLabel), hasGroup &&
|
|
@@ -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
|
}
|