@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-83282.0 → 0.0.0-bugfix-dev-KB-75065.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/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +15 -3
- 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_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +185 -59
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +236 -0
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +1 -59
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/{ez-popover-core_2.cjs.entry.js → ez-multi-selection-list_2.cjs.entry.js} +197 -116
- 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 +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- 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-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +7 -8
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/ez-badge/ez-badge.css +12 -1
- package/dist/collection/components/ez-badge/ez-badge.js +31 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +250 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +194 -61
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +0 -3
- package/dist/collection/components/ez-grid/ez-grid.js +1 -56
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +64 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +127 -47
- package/dist/custom-elements/index.d.ts +0 -12
- package/dist/custom-elements/index.js +218 -394
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +15 -3
- 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_2.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/ez-combo-box.entry.js +186 -60
- package/dist/esm/ez-custom-form-input_2.entry.js +231 -0
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-dropdown_2.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +2 -60
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/{ez-popover-core_2.entry.js → ez-multi-selection-list_2.entry.js} +197 -116
- 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 +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +7 -9
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-000159dc.entry.js +1 -0
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/{p-65f471bc.entry.js → p-03b0ed5a.entry.js} +1 -1
- package/dist/ezui/{p-5b205c80.entry.js → p-044d46d5.entry.js} +1 -1
- package/dist/ezui/{p-a4cee65d.entry.js → p-0cfbbe82.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/{p-7e677b7b.entry.js → p-2069c78a.entry.js} +1 -1
- package/dist/ezui/{p-31b71e50.entry.js → p-23dab72f.entry.js} +1 -1
- package/dist/ezui/{p-17eabf46.entry.js → p-24b42f3d.entry.js} +1 -1
- package/dist/ezui/{p-556468d9.entry.js → p-3791d9c8.entry.js} +1 -1
- package/dist/ezui/{p-1ad6c61b.entry.js → p-3885e66e.entry.js} +1 -1
- package/dist/ezui/p-3af64edd.entry.js +1 -0
- package/dist/ezui/{p-fa6732f2.entry.js → p-44b39e81.entry.js} +1 -1
- package/dist/ezui/{p-c1527804.entry.js → p-4818b8ce.entry.js} +1 -1
- package/dist/ezui/{p-d9548bdf.entry.js → p-5010315a.entry.js} +1 -1
- package/dist/ezui/{p-ea54d056.entry.js → p-68b2e579.entry.js} +1 -1
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/{p-2bb2a0c4.entry.js → p-6d31c43c.entry.js} +1 -1
- package/dist/ezui/{p-6cdd3e0a.entry.js → p-6d8b3298.entry.js} +1 -1
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-da1b4a38.entry.js → p-708b196e.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/{p-0fa52b0f.entry.js → p-88c615f0.entry.js} +1 -1
- package/dist/ezui/{p-56fe5341.entry.js → p-9066b0b0.entry.js} +1 -1
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
- package/dist/ezui/{p-0faf71c5.entry.js → p-92fbaf2b.entry.js} +1 -1
- package/dist/ezui/{p-e6a9041d.entry.js → p-9e95bfeb.entry.js} +1 -1
- package/dist/ezui/{p-3195a7a7.entry.js → p-9fc250d4.entry.js} +1 -1
- package/dist/ezui/{p-53116373.entry.js → p-a3319796.entry.js} +46 -46
- package/dist/ezui/{p-990b4318.entry.js → p-a921e3e7.entry.js} +1 -1
- package/dist/ezui/{p-3429080c.entry.js → p-b22889ea.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-cb1535f7.entry.js → p-b9282c79.entry.js} +1 -1
- package/dist/ezui/{p-e347df9c.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-17de16e5.entry.js → p-c96fbbef.entry.js} +1 -1
- package/dist/ezui/{p-2f45506d.entry.js → p-ca8936df.entry.js} +1 -1
- package/dist/ezui/p-cba34702.entry.js +1 -0
- package/dist/ezui/{p-20c024f7.entry.js → p-cf33bc48.entry.js} +1 -1
- package/dist/ezui/{p-58783dcf.entry.js → p-cf3b60fd.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/{p-7fdd479f.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/{p-fd0a19d6.entry.js → p-e3f8660b.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-b26f6c5b.entry.js → p-f30e0590.entry.js} +1 -1
- package/dist/ezui/{p-cf87aacb.entry.js → p-f4da7e1e.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/ezui/p-fcc78b7f.entry.js +1 -0
- package/dist/types/components/ez-badge/ez-badge.d.ts +5 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +16 -7
- package/dist/types/components/ez-grid/ez-grid.d.ts +0 -5
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +19 -6
- package/dist/types/components.d.ts +11 -218
- package/package.json +1 -1
- package/react/components.d.ts +0 -2
- package/react/components.js +0 -2
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +0 -387
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +0 -186
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +0 -205
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +0 -426
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +0 -67
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +0 -468
- package/dist/esm/ez-combo-box-list_3.entry.js +0 -381
- package/dist/esm/ez-multi-selection-list.entry.js +0 -182
- package/dist/ezui/p-3a009184.entry.js +0 -1
- package/dist/ezui/p-650e4b6d.entry.js +0 -1
- package/dist/ezui/p-7bd15498.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-dc73e1fe.entry.js +0 -1
- package/dist/ezui/p-f5931caa.entry.js +0 -1
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +0 -104
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +0 -81
|
@@ -1,27 +1,105 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
|
|
2
3
|
/* dimensions */
|
|
4
|
+
/*@doc Define altura do input.*/
|
|
3
5
|
--ez-combo-box--height: 42px;
|
|
6
|
+
/*@doc Define largura do input.*/
|
|
4
7
|
--ez-combo-box--width: 100%;
|
|
8
|
+
/*@doc Define largura do slot do ícone do input.*/
|
|
9
|
+
--ez-combo-box__icon--width: 48px;
|
|
10
|
+
|
|
11
|
+
/*@doc Define a largura maxima do componente.*/
|
|
12
|
+
--ez-combo-box__min-width: 0px;
|
|
13
|
+
/*@doc Define a largura minima do componente.*/
|
|
14
|
+
--ez-combo-box__max-width: 100%;
|
|
5
15
|
|
|
6
16
|
/* general */
|
|
17
|
+
/*@doc Define o raio da borda do input.*/
|
|
7
18
|
--ez-combo-box--border-radius: var(--border--radius-medium, 12px);
|
|
19
|
+
/*@doc Define o raio da borda do input quando pequeno.*/
|
|
20
|
+
--ez-combo-box--border-radius-small: var(--border--radius-small, 6px);
|
|
21
|
+
/*@doc Define o tamanho da fonte dentro do input.*/
|
|
8
22
|
--ez-combo-box--font-size: var(--text--medium, 14px);
|
|
23
|
+
/*@doc Define a família da fonte dentro do input.*/
|
|
9
24
|
--ez-combo-box--font-family: var(--font-pattern, Arial);
|
|
25
|
+
/*@doc Define o peso da fonte dentro do input quando pesada.*/
|
|
26
|
+
--ez-combo-box--font-weight--large: var(--text-weight--large, 500);
|
|
27
|
+
/*@doc Define o peso da fonte dentro do input quando média.*/
|
|
28
|
+
--ez-combo-box--font-weight--medium: var(--text-weight--medium, 400);
|
|
29
|
+
/*@doc Define a cor de fundo da lista de opções.*/
|
|
10
30
|
--ez-combo-box--background-color--xlight: var(--background--xlight, #fff);
|
|
31
|
+
/*@doc Define a cor de fundo dos itens da lista de opções.*/
|
|
32
|
+
--ez-combo-box--background-medium: var(--background--medium, #f0f3f7);
|
|
33
|
+
/*@doc Define a altura da linha do texto dentro do input.*/
|
|
34
|
+
--ez-combo-box--line-height: calc(var(--text--medium, 14px) + 4px);
|
|
11
35
|
|
|
12
36
|
/* input */
|
|
37
|
+
/*@doc Define a cor de fundo do input.*/
|
|
13
38
|
--ez-combo-box__input--background-color: var(--background--medium, #e0e0e0);
|
|
39
|
+
/*@doc Define o estilo da borda do input.*/
|
|
14
40
|
--ez-combo-box__input--border: var(--border--medium, 2px solid);
|
|
41
|
+
/*@doc Define a cor da borda do input.*/
|
|
15
42
|
--ez-combo-box__input--border-color: var(--ez-combo-box__input--background-color);
|
|
43
|
+
/*no modo normal usamos a borda com a mesma cor do bg*/
|
|
44
|
+
/*@doc Define a cor da borda do input quando focado.*/
|
|
16
45
|
--ez-combo-box__input--focus--border-color: var(--color--primary, #008561);
|
|
46
|
+
/*@doc Define a cor de fundo do input quando desabilitado.*/
|
|
17
47
|
--ez-combo-box__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
|
|
48
|
+
/*@doc Define a cor do texto dentro do input quando desabilitado.*/
|
|
18
49
|
--ez-combo-box__input--disabled--color: var(--text--disable, #AFB6C0);
|
|
50
|
+
/*@doc Define a cor da borda do input quando com erro.*/
|
|
51
|
+
--ez-combo-box__input--error--border-color: #CC2936;
|
|
19
52
|
|
|
20
53
|
/* buttons */
|
|
54
|
+
/*@doc Define a cor do botão de pesquisa do componente.*/
|
|
21
55
|
--ez-combo-box__btn--color: var(--title--primary, #2B3A54);
|
|
56
|
+
/*@doc Define a cor do botão de pesquisa do componente quando desabilitado.*/
|
|
22
57
|
--ez-combo-box__btn-disabled--color: var(--text--disable, #AFB6C0);
|
|
58
|
+
/*@doc Define a cor do botão de pesquisa do componente quando o mouse está sobre ele.*/
|
|
23
59
|
--ez-combo-box__btn-hover--color: var(--color--primary, #4e4e4e);
|
|
24
60
|
|
|
61
|
+
/* label */
|
|
62
|
+
/*@doc Define a cor do label.*/
|
|
63
|
+
--ez-combo-box__label--color: var(--title--primary, #2B3A54);
|
|
64
|
+
|
|
65
|
+
/* list */
|
|
66
|
+
/*@doc Define a cor do texto da lista de opções.*/
|
|
67
|
+
--ez-combo-box__list-title--primary: var(--title--primary, #2B3A54);
|
|
68
|
+
/*@doc Define a cor do texto do value da lista de opções.*/
|
|
69
|
+
--ez-combo-box__list-text--primary: var(--text--primary, #626e82);
|
|
70
|
+
/*@doc Define a altura do box da lista de opções.*/
|
|
71
|
+
--ez-combo-box__list-height: calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);
|
|
72
|
+
/*@doc Define a largura mínima da lista de opções.*/
|
|
73
|
+
--ez-combo-box__list-min-width: 64px;
|
|
74
|
+
|
|
75
|
+
/* espaçamento */
|
|
76
|
+
/*@doc Define um espaçamento mediano entre elementos do componente.*/
|
|
77
|
+
--ez-combo-box--space--medium: var(--space--medium, 12px);
|
|
78
|
+
/*@doc Define um espaçamento pequeno entre elementos do componente.*/
|
|
79
|
+
--ez-combo-box--space--small: var(--space--small, 6px);
|
|
80
|
+
|
|
81
|
+
/* scrollbar */
|
|
82
|
+
/*@doc Define a cor da barra de rolagem do componente.*/
|
|
83
|
+
--ez-combo-box__scrollbar--color-default: var(--scrollbar--default, #626e82);
|
|
84
|
+
/*@doc Define a cor de fundo da barra de rolagem do componente.*/
|
|
85
|
+
--ez-combo-box__scrollbar--color-background: var(--scrollbar--background, #E5EAF0);
|
|
86
|
+
/*@doc Define a cor do hover na barra de rolagem do componente.*/
|
|
87
|
+
--ez-combo-box__scrollbar--color-hover: var(--scrollbar--hover, #2B3A54);
|
|
88
|
+
/*@doc Define a cor do active na barra de rolagem do componente.*/
|
|
89
|
+
--ez-combo-box__scrollbar--color-clicked: var(--scrollbar--clicked, #a2abb9);
|
|
90
|
+
/*@doc Define o raio da borda da barra de rolagem do componente.*/
|
|
91
|
+
--ez-combo-box__scrollbar--border-radius: var(--border--radius-small, 6px);
|
|
92
|
+
/*@doc Define a largura da barra de rolagem do componente.*/
|
|
93
|
+
--ez-combo-box__scrollbar--width: var(--space--small, 6px);
|
|
94
|
+
|
|
95
|
+
/***************
|
|
96
|
+
host style
|
|
97
|
+
***************/
|
|
98
|
+
/*private*/
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-wrap: wrap;
|
|
101
|
+
position: relative;
|
|
102
|
+
|
|
25
103
|
/*public*/
|
|
26
104
|
width: var(--ez-combo-box--width);
|
|
27
105
|
}
|
|
@@ -40,6 +118,178 @@ ez-icon {
|
|
|
40
118
|
--ez-text-input__input--disabled--color: var(--title--primary, #2B3A54);
|
|
41
119
|
}
|
|
42
120
|
|
|
121
|
+
.list-container {
|
|
122
|
+
/*public*/
|
|
123
|
+
min-width: var(--ez-combo-box__list-min-width);
|
|
124
|
+
|
|
125
|
+
/*private*/
|
|
126
|
+
position: relative;
|
|
127
|
+
width: 100%;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.list-wrapper {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
width: 0;
|
|
135
|
+
|
|
136
|
+
/*public*/
|
|
137
|
+
z-index: var(--more-visible, 2);
|
|
138
|
+
max-height: calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);
|
|
139
|
+
background-color: var(--ez-combo-box--background-color--xlight);
|
|
140
|
+
border-radius: var(--ez-combo-box--border-radius);
|
|
141
|
+
box-shadow: var(--shadow, 0px 0px 16px 0px #000);
|
|
142
|
+
padding: var(--ez-combo-box--space--small);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.list-options {
|
|
146
|
+
box-sizing: border-box;
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: 100%;
|
|
149
|
+
padding: 0;
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
scroll-behavior: smooth;
|
|
153
|
+
overflow: auto;
|
|
154
|
+
scrollbar-width: thin;
|
|
155
|
+
gap: 3px;
|
|
156
|
+
|
|
157
|
+
/*public*/
|
|
158
|
+
scrollbar-color: var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.list-options::-webkit-scrollbar {
|
|
162
|
+
/*public*/
|
|
163
|
+
background-color: var(--ez-combo-box__scrollbar--color-background);
|
|
164
|
+
width: var(--ez-combo-box__scrollbar--width);
|
|
165
|
+
max-width: var(--ez-combo-box__scrollbar--width);
|
|
166
|
+
min-width: var(--ez-combo-box__scrollbar--width);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.list-options::-webkit-scrollbar-track {
|
|
170
|
+
/*public*/
|
|
171
|
+
background-color: var(--ez-combo-box__scrollbar--color-background);
|
|
172
|
+
border-radius: var(--ez-combo-box__scrollbar--border-radius);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.list-options::-webkit-scrollbar-thumb {
|
|
176
|
+
/*public*/
|
|
177
|
+
background-color: var(--ez-combo-box__scrollbar--color-default);
|
|
178
|
+
border-radius: var(--ez-combo-box__scrollbar--border-radius);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.list-options::-webkit-scrollbar-thumb:vertical:hover,
|
|
182
|
+
.list-options::-webkit-scrollbar-thumb:horizontal:hover {
|
|
183
|
+
/*public*/
|
|
184
|
+
background-color: var(--ez-combo-box__scrollbar--color-hover);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.list-options::-webkit-scrollbar-thumb:vertical:active,
|
|
188
|
+
.list-options::-webkit-scrollbar-thumb:horizontal:active {
|
|
189
|
+
/*public*/
|
|
190
|
+
background-color: var(--ez-combo-box__scrollbar--color-clicked);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.item {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
width: 100%;
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
list-style-type: none;
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
|
|
201
|
+
/*public*/
|
|
202
|
+
border-radius: var(--ez-combo-box--border-radius-small);
|
|
203
|
+
padding: var(--ez-combo-box--space--small);
|
|
204
|
+
min-height: var(--ez-combo-box__list-height);
|
|
205
|
+
gap: var(--space--small, 6px);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.item__value,
|
|
209
|
+
.item__label {
|
|
210
|
+
flex-basis: auto;
|
|
211
|
+
white-space: nowrap;
|
|
212
|
+
overflow: hidden;
|
|
213
|
+
text-overflow: ellipsis;
|
|
214
|
+
|
|
215
|
+
/*public*/
|
|
216
|
+
color: var(--ez-combo-box__list-title--primary);
|
|
217
|
+
font-family: var(--ez-combo-box--font-family);
|
|
218
|
+
font-size: var(--ez-combo-box--font-size);
|
|
219
|
+
line-height: var(--ez-combo-box--line-height);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.item__label {
|
|
223
|
+
/*public*/
|
|
224
|
+
font-weight: var(--ez-combo-box--font-weight--medium);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.item__label--bold {
|
|
228
|
+
/*public*/
|
|
229
|
+
font-weight: var(--ez-combo-box--font-weight--large);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.item__value {
|
|
233
|
+
text-align: center;
|
|
234
|
+
|
|
235
|
+
/*public*/
|
|
236
|
+
color: var(--ez-combo-box__list-text--primary);
|
|
237
|
+
font-weight: var(--ez-combo-box--font-weight--large);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.item__value--hidden {
|
|
241
|
+
visibility: hidden;
|
|
242
|
+
position: absolute;
|
|
243
|
+
white-space: nowrap;
|
|
244
|
+
z-index: -1;
|
|
245
|
+
top: 0;
|
|
246
|
+
left: 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.item__label {
|
|
250
|
+
text-align: left;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.message {
|
|
254
|
+
text-align: center;
|
|
255
|
+
display: flex;
|
|
256
|
+
justify-content: center;
|
|
257
|
+
align-items: center;
|
|
258
|
+
list-style-type: none;
|
|
259
|
+
|
|
260
|
+
/*public*/
|
|
261
|
+
min-height: var(--ez-combo-box__list-height);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.message__no-result {
|
|
265
|
+
/*public*/
|
|
266
|
+
color: var(--ez-combo-box__list-title--primary);
|
|
267
|
+
font-family: var(--ez-combo-box--font-family);
|
|
268
|
+
font-size: var(--ez-combo-box--font-size);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.message__loading {
|
|
272
|
+
border-radius: 50%;
|
|
273
|
+
width: 14px;
|
|
274
|
+
height: 14px;
|
|
275
|
+
-webkit-animation: spin 1s linear infinite;
|
|
276
|
+
animation: spin 1s linear infinite;
|
|
277
|
+
|
|
278
|
+
/*public*/
|
|
279
|
+
border: 3px solid var(--ez-combo-box__list-title--primary);
|
|
280
|
+
border-top: 3px solid transparent;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
li:hover {
|
|
284
|
+
/*public*/
|
|
285
|
+
background-color: var(--ez-combo-box--background-medium);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.preselected {
|
|
289
|
+
/*public*/
|
|
290
|
+
background-color: var(--background--medium);
|
|
291
|
+
}
|
|
292
|
+
|
|
43
293
|
.btn {
|
|
44
294
|
outline: none;
|
|
45
295
|
border: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils, ObjectUtils } from "@sankhyalabs/core";
|
|
1
|
+
import { ElementIDUtils, FloatingManager, ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import { CSSVarsUtils } from "../../utils";
|
|
4
4
|
export class EzComboBox {
|
|
@@ -9,13 +9,11 @@ export class EzComboBox {
|
|
|
9
9
|
this._tabPressed = false;
|
|
10
10
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
11
11
|
this._lookupMode = false;
|
|
12
|
-
this.isOpen = false;
|
|
13
12
|
this._preSelection = undefined;
|
|
14
13
|
this._visibleOptions = undefined;
|
|
15
14
|
this._startLoading = false;
|
|
16
15
|
this._showLoading = true;
|
|
17
16
|
this._criteria = undefined;
|
|
18
|
-
this._textInputReady = undefined;
|
|
19
17
|
this.limitCharsToSearch = 3;
|
|
20
18
|
this.value = undefined;
|
|
21
19
|
this.label = undefined;
|
|
@@ -121,6 +119,63 @@ export class EzComboBox {
|
|
|
121
119
|
async clearValue() {
|
|
122
120
|
this.clearSearch();
|
|
123
121
|
}
|
|
122
|
+
scrollListener() {
|
|
123
|
+
var _a;
|
|
124
|
+
if (this._floatingID == undefined) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
|
|
128
|
+
this.hideOptions();
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
window.requestAnimationFrame(() => {
|
|
132
|
+
this.updateListPosition();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
updateListPosition() {
|
|
137
|
+
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
138
|
+
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
139
|
+
const containerRect = this._listContainer.getBoundingClientRect();
|
|
140
|
+
const textInputRect = this._textInput.getBoundingClientRect();
|
|
141
|
+
const limitHeight = bottomLimit || window.innerHeight;
|
|
142
|
+
const neededHeight = containerRect.bottom + elementRect.height;
|
|
143
|
+
if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
|
|
144
|
+
fromBottom = true;
|
|
145
|
+
}
|
|
146
|
+
if (!hardPosition) {
|
|
147
|
+
verticalPosition = verticalPosition || 0;
|
|
148
|
+
horizontalPosition = horizontalPosition || 0;
|
|
149
|
+
if (fromBottom) {
|
|
150
|
+
verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
verticalPosition += containerRect.top;
|
|
154
|
+
}
|
|
155
|
+
if (fromRight) {
|
|
156
|
+
horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
horizontalPosition += containerRect.left;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (verticalPosition != undefined) {
|
|
163
|
+
this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
|
|
164
|
+
this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
|
|
165
|
+
}
|
|
166
|
+
if (horizontalPosition != undefined) {
|
|
167
|
+
this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
|
|
168
|
+
this._listWrapper.style[fromRight ? "left" : "right"] = "";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
getListPosition() {
|
|
172
|
+
if (this.listOptionsPosition) {
|
|
173
|
+
return this.listOptionsPosition;
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
verticalPosition: 6
|
|
177
|
+
};
|
|
178
|
+
}
|
|
124
179
|
isDifferentValues(firstValue, secondValue) {
|
|
125
180
|
return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
|
|
126
181
|
}
|
|
@@ -193,24 +248,85 @@ export class EzComboBox {
|
|
|
193
248
|
}
|
|
194
249
|
return 0;
|
|
195
250
|
}
|
|
251
|
+
buildItem(opt, index) {
|
|
252
|
+
const widthValue = this.showOptionValue && this._maxWidthValue > 0 ? `${this._maxWidthValue}px` : '';
|
|
253
|
+
opt.label = opt.label || opt.value;
|
|
254
|
+
return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = index }, this.showOptionValue
|
|
255
|
+
? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
|
|
256
|
+
: undefined, h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
|
|
257
|
+
}
|
|
196
258
|
showOptions() {
|
|
197
259
|
var _a, _b;
|
|
198
260
|
if (!this.enabled)
|
|
199
261
|
return;
|
|
200
|
-
this.
|
|
262
|
+
if (this.isOptionsVisible()) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
201
265
|
const valueString = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.value;
|
|
202
266
|
const indexValue = this._visibleOptions.findIndex(option => option.value === valueString);
|
|
203
267
|
this._preSelection = indexValue === -1 ? 0 : indexValue;
|
|
204
268
|
if (!!this._resizeObserver)
|
|
205
269
|
this._resizeObserver.observe(this._textInput);
|
|
270
|
+
this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: true, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
206
271
|
this.setFocus();
|
|
272
|
+
window.requestAnimationFrame(() => {
|
|
273
|
+
this.updateListPosition();
|
|
274
|
+
if (!this.listOptionsPosition) {
|
|
275
|
+
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
276
|
+
}
|
|
277
|
+
});
|
|
207
278
|
}
|
|
208
279
|
hideOptions() {
|
|
209
|
-
|
|
210
|
-
|
|
280
|
+
if (this._floatingID !== undefined) {
|
|
281
|
+
FloatingManager.close(this._floatingID);
|
|
282
|
+
}
|
|
283
|
+
this._floatingID = undefined;
|
|
211
284
|
if (!!this._resizeObserver)
|
|
212
285
|
this._resizeObserver.unobserve(this._textInput);
|
|
213
286
|
}
|
|
287
|
+
isOptionsVisible() {
|
|
288
|
+
return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
|
|
289
|
+
}
|
|
290
|
+
nextOption() {
|
|
291
|
+
if (!this.isOptionsVisible()) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this.showOptions();
|
|
295
|
+
this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
|
|
296
|
+
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
297
|
+
}
|
|
298
|
+
previousOption() {
|
|
299
|
+
this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
|
|
300
|
+
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
301
|
+
}
|
|
302
|
+
scrollToOption(opt) {
|
|
303
|
+
window.requestAnimationFrame(() => {
|
|
304
|
+
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
|
|
305
|
+
if (liElem)
|
|
306
|
+
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
selectCurrentOption(focusOnInput = true) {
|
|
310
|
+
if (this._preSelection !== undefined) {
|
|
311
|
+
this.selectOption(this._visibleOptions[this._preSelection], focusOnInput);
|
|
312
|
+
this._preSelection = undefined;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
this.controlListWithOnlyOne(focusOnInput);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
controlListWithOnlyOne(focusOnInput = true) {
|
|
319
|
+
var _a;
|
|
320
|
+
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
321
|
+
if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
|
|
322
|
+
let title = StringUtils.decodeHtmlEntities(source[0].label);
|
|
323
|
+
const option = {
|
|
324
|
+
value: source[0].value,
|
|
325
|
+
label: title,
|
|
326
|
+
};
|
|
327
|
+
this.selectOption(option, focusOnInput);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
214
330
|
updateSource(source) {
|
|
215
331
|
this._startLoading = false;
|
|
216
332
|
if (source instanceof Promise) {
|
|
@@ -236,13 +352,12 @@ export class EzComboBox {
|
|
|
236
352
|
}
|
|
237
353
|
}
|
|
238
354
|
selectOption(newOption, focusOnInput = true) {
|
|
239
|
-
var _a, _b
|
|
355
|
+
var _a, _b;
|
|
240
356
|
const currentValue = this.getSelectedOption(this.value);
|
|
241
357
|
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
242
358
|
|| (currentValue == undefined && newOption != undefined && "value" in newOption)) {
|
|
243
359
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
244
360
|
this.value = adjustedOpt;
|
|
245
|
-
(_c = this._popover) === null || _c === void 0 ? void 0 : _c.hide();
|
|
246
361
|
}
|
|
247
362
|
else {
|
|
248
363
|
this.resetOptions();
|
|
@@ -295,11 +410,6 @@ export class EzComboBox {
|
|
|
295
410
|
//---------------------------------------------
|
|
296
411
|
// Lifecycle web component
|
|
297
412
|
//---------------------------------------------
|
|
298
|
-
componentDidRender() {
|
|
299
|
-
if (this._textInput) {
|
|
300
|
-
this._textInputReady = true;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
413
|
componentWillLoad() {
|
|
304
414
|
if (this.options === undefined) {
|
|
305
415
|
this.options = [];
|
|
@@ -318,6 +428,15 @@ export class EzComboBox {
|
|
|
318
428
|
}
|
|
319
429
|
this.loadOptions(SearchMode.PRELOAD);
|
|
320
430
|
}
|
|
431
|
+
componentDidRender() {
|
|
432
|
+
var _a;
|
|
433
|
+
if (this._floatingID === undefined) {
|
|
434
|
+
this._listWrapper.remove();
|
|
435
|
+
}
|
|
436
|
+
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
437
|
+
ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
438
|
+
});
|
|
439
|
+
}
|
|
321
440
|
componentDidLoad() {
|
|
322
441
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
323
442
|
this.setInputValue(false);
|
|
@@ -325,12 +444,10 @@ export class EzComboBox {
|
|
|
325
444
|
window.requestAnimationFrame(() => {
|
|
326
445
|
if (!Array.isArray(entries) || !entries.length)
|
|
327
446
|
return;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const textInputWidth = this._textInput.clientWidth;
|
|
333
|
-
this._comboBoxList.width = textInputWidth;
|
|
447
|
+
const { clientWidth } = this._listContainer;
|
|
448
|
+
if (clientWidth > 0 && !!this._listWrapper) {
|
|
449
|
+
this._listWrapper.style.width = `${clientWidth}px`;
|
|
450
|
+
}
|
|
334
451
|
});
|
|
335
452
|
});
|
|
336
453
|
if (this.autoFocus) {
|
|
@@ -339,13 +456,6 @@ export class EzComboBox {
|
|
|
339
456
|
});
|
|
340
457
|
}
|
|
341
458
|
}
|
|
342
|
-
disconnectedCallback() {
|
|
343
|
-
var _a;
|
|
344
|
-
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.remove();
|
|
345
|
-
if (this._resizeObserver) {
|
|
346
|
-
this._resizeObserver.disconnect();
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
459
|
//---------------------------------------------
|
|
350
460
|
// Event handlers
|
|
351
461
|
//---------------------------------------------
|
|
@@ -385,48 +495,65 @@ export class EzComboBox {
|
|
|
385
495
|
this.showOptions();
|
|
386
496
|
}
|
|
387
497
|
keyDownHandler(event) {
|
|
388
|
-
|
|
389
|
-
if (event.ctrlKey
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
498
|
+
this._tabPressed = false;
|
|
499
|
+
if (event.ctrlKey) {
|
|
500
|
+
if (event.key === "f" || event.key === "F") {
|
|
501
|
+
this.loadOptions(SearchMode.ADVANCED);
|
|
502
|
+
//ATENÇÃO: Ctrl + F tem ação específica nos browsers
|
|
503
|
+
//nesse caso, como vamos abrir o popup de busca avançada,
|
|
504
|
+
//não é interessante deixar o evento propagar;
|
|
505
|
+
event.stopPropagation();
|
|
506
|
+
event.stopImmediatePropagation();
|
|
507
|
+
event.preventDefault();
|
|
508
|
+
}
|
|
394
509
|
}
|
|
395
510
|
switch (event.key) {
|
|
396
511
|
case "ArrowDown":
|
|
397
|
-
event.
|
|
398
|
-
if (this.canShowListOptions())
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
512
|
+
event.stopPropagation();
|
|
513
|
+
if (this.canShowListOptions())
|
|
514
|
+
event.preventDefault();
|
|
515
|
+
this.showOptions();
|
|
516
|
+
this.nextOption();
|
|
402
517
|
break;
|
|
403
518
|
case "ArrowUp":
|
|
404
|
-
event.
|
|
405
|
-
if (this.canShowListOptions())
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
519
|
+
event.stopPropagation();
|
|
520
|
+
if (this.canShowListOptions())
|
|
521
|
+
event.preventDefault();
|
|
522
|
+
this.showOptions();
|
|
523
|
+
this.previousOption();
|
|
409
524
|
break;
|
|
410
525
|
case "Enter":
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
526
|
+
this.handleEventPropagation(event);
|
|
527
|
+
if (this.isOptionsVisible()) {
|
|
528
|
+
this.selectCurrentOption();
|
|
414
529
|
}
|
|
415
530
|
break;
|
|
416
531
|
case "Escape":
|
|
417
|
-
if (this.
|
|
418
|
-
event.
|
|
419
|
-
(_d = this._popover) === null || _d === void 0 ? void 0 : _d.hide();
|
|
532
|
+
if (this.isOptionsVisible()) {
|
|
533
|
+
event.stopPropagation();
|
|
420
534
|
}
|
|
535
|
+
this.cancelPreselection();
|
|
536
|
+
this.resetOptions();
|
|
421
537
|
break;
|
|
422
538
|
case "Tab":
|
|
423
539
|
this._tabPressed = true;
|
|
424
|
-
if (this.
|
|
425
|
-
|
|
426
|
-
(_f = this._popover) === null || _f === void 0 ? void 0 : _f.hide();
|
|
540
|
+
if (this.isOptionsVisible()) {
|
|
541
|
+
this.selectCurrentOption(false);
|
|
427
542
|
}
|
|
543
|
+
this.resetOptions();
|
|
428
544
|
break;
|
|
429
545
|
}
|
|
546
|
+
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
547
|
+
//Por exemplo, quando o usuário dá um Enter, além de selecionar
|
|
548
|
+
//um valor, também significa que a ateração finalizou,
|
|
549
|
+
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
550
|
+
//event.stopPropagation();
|
|
551
|
+
}
|
|
552
|
+
//O evento deve ter sua propagação interrompida, apenas se a lista de opções estiver sendo exibida.
|
|
553
|
+
handleEventPropagation(event) {
|
|
554
|
+
if (this._listContainer.hasChildNodes() && this.stopPropagateEnterKeyEvent) {
|
|
555
|
+
event.stopPropagation();
|
|
556
|
+
}
|
|
430
557
|
}
|
|
431
558
|
onTextInputFocusOutHandler() {
|
|
432
559
|
if (this.hideErrorOnFocusOut)
|
|
@@ -435,15 +562,14 @@ export class EzComboBox {
|
|
|
435
562
|
canShowListOptions() {
|
|
436
563
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
437
564
|
}
|
|
438
|
-
openPopover() {
|
|
439
|
-
var _a;
|
|
440
|
-
this.isOpen = true;
|
|
441
|
-
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.show();
|
|
442
|
-
}
|
|
443
565
|
render() {
|
|
444
|
-
var _a;
|
|
445
566
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
446
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: `text-input-slot-container ${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("
|
|
567
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: `text-input-slot-container ${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
|
|
568
|
+
&& this._visibleOptions.length === 0
|
|
569
|
+
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
570
|
+
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
571
|
+
? h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
|
|
572
|
+
: undefined, this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
447
573
|
}
|
|
448
574
|
static get is() { return "ez-combo-box"; }
|
|
449
575
|
static get encapsulation() { return "shadow"; }
|
|
@@ -803,13 +929,11 @@ export class EzComboBox {
|
|
|
803
929
|
}
|
|
804
930
|
static get states() {
|
|
805
931
|
return {
|
|
806
|
-
"isOpen": {},
|
|
807
932
|
"_preSelection": {},
|
|
808
933
|
"_visibleOptions": {},
|
|
809
934
|
"_startLoading": {},
|
|
810
935
|
"_showLoading": {},
|
|
811
|
-
"_criteria": {}
|
|
812
|
-
"_textInputReady": {}
|
|
936
|
+
"_criteria": {}
|
|
813
937
|
};
|
|
814
938
|
}
|
|
815
939
|
static get events() {
|
|
@@ -938,6 +1062,15 @@ export class EzComboBox {
|
|
|
938
1062
|
"methodName": "observeOptions"
|
|
939
1063
|
}];
|
|
940
1064
|
}
|
|
1065
|
+
static get listeners() {
|
|
1066
|
+
return [{
|
|
1067
|
+
"name": "scroll",
|
|
1068
|
+
"method": "scrollListener",
|
|
1069
|
+
"target": "window",
|
|
1070
|
+
"capture": true,
|
|
1071
|
+
"passive": true
|
|
1072
|
+
}];
|
|
1073
|
+
}
|
|
941
1074
|
}
|
|
942
1075
|
var SearchMode;
|
|
943
1076
|
(function (SearchMode) {
|
|
@@ -1106,9 +1106,6 @@ export default class AgGridController {
|
|
|
1106
1106
|
if (cfgColumn.customWidth != undefined) {
|
|
1107
1107
|
return cfgColumn.customWidth;
|
|
1108
1108
|
}
|
|
1109
|
-
if (cfgColumn.width != undefined) {
|
|
1110
|
-
return cfgColumn.width;
|
|
1111
|
-
}
|
|
1112
1109
|
const field = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(cfgColumn.name);
|
|
1113
1110
|
if ((field === null || field === void 0 ? void 0 : field.userInterface) === UserInterface.SEARCH) {
|
|
1114
1111
|
return this.DEFAULT_MAX_SIZE;
|