@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-75065.1 → 0.0.0-bugfix-dev-KB-74406.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/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 +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_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 +2 -2
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +366 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +59 -185
- 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 +2 -2
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +61 -1
- 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-multi-selection-list.cjs.entry.js +186 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/{ez-multi-selection-list_2.cjs.entry.js → ez-popover-core_2.cjs.entry.js} +116 -197
- 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 +2 -2
- 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-9e5554cb.js → index-a7b0c73d.js} +8 -7
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-chip/ez-chip.css +5 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +405 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +5 -0
- package/dist/collection/components/ez-grid/ez-grid.js +56 -1
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css +0 -64
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +47 -127
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +67 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +468 -0
- package/dist/collection/components/ez-scroller/ez-scroller.css +3 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +375 -206
- 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 +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_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 +2 -2
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_3.entry.js +360 -0
- package/dist/esm/ez-combo-box.entry.js +60 -186
- 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 +2 -2
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +62 -2
- 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-multi-selection-list.entry.js +182 -0
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/{ez-multi-selection-list_2.entry.js → ez-popover-core_2.entry.js} +116 -197
- 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 +2 -2
- 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-5a720e56.js → index-baa5e267.js} +9 -7
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e6b38ade.entry.js → p-0306dff7.entry.js} +1 -1
- package/dist/ezui/{p-91ccae0c.entry.js → p-09de35a2.entry.js} +1 -1
- package/dist/ezui/{p-88c615f0.entry.js → p-0fa52b0f.entry.js} +1 -1
- package/dist/ezui/{p-92fbaf2b.entry.js → p-0faf71c5.entry.js} +1 -1
- package/dist/ezui/p-15134d97.entry.js +1 -0
- package/dist/ezui/{p-c96fbbef.entry.js → p-17de16e5.entry.js} +1 -1
- package/dist/ezui/{p-24b42f3d.entry.js → p-17eabf46.entry.js} +1 -1
- package/dist/ezui/{p-3885e66e.entry.js → p-1ad6c61b.entry.js} +1 -1
- package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
- package/dist/ezui/p-20cb13fa.entry.js +1 -0
- package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
- package/dist/ezui/p-288631d1.entry.js +1 -0
- package/dist/ezui/{p-6d31c43c.entry.js → p-2bb2a0c4.entry.js} +1 -1
- package/dist/ezui/{p-ca8936df.entry.js → p-2f45506d.entry.js} +1 -1
- package/dist/ezui/{p-9fc250d4.entry.js → p-3195a7a7.entry.js} +1 -1
- package/dist/ezui/{p-23dab72f.entry.js → p-31b71e50.entry.js} +1 -1
- package/dist/ezui/{p-b22889ea.entry.js → p-3429080c.entry.js} +1 -1
- package/dist/ezui/{p-0378416a.entry.js → p-44caad9a.entry.js} +1 -1
- package/dist/ezui/{p-7567ccdd.entry.js → p-555c9018.entry.js} +1 -1
- package/dist/ezui/{p-3791d9c8.entry.js → p-556468d9.entry.js} +1 -1
- package/dist/ezui/{p-9066b0b0.entry.js → p-56fe5341.entry.js} +1 -1
- package/dist/ezui/{p-cf3b60fd.entry.js → p-58783dcf.entry.js} +1 -1
- package/dist/ezui/{p-044d46d5.entry.js → p-5b205c80.entry.js} +1 -1
- package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/{p-03b0ed5a.entry.js → p-65f471bc.entry.js} +1 -1
- package/dist/ezui/{p-a3319796.entry.js → p-664b91e8.entry.js} +46 -46
- package/dist/ezui/{p-6d8b3298.entry.js → p-6cdd3e0a.entry.js} +1 -1
- package/dist/ezui/{p-fc194825.entry.js → p-6e429cff.entry.js} +1 -1
- package/dist/ezui/{p-11bfeca3.entry.js → p-77a4bd35.entry.js} +1 -1
- package/dist/ezui/p-7bd15498.entry.js +1 -0
- package/dist/ezui/{p-2069c78a.entry.js → p-7e677b7b.entry.js} +1 -1
- package/dist/ezui/{p-e18d9e6a.entry.js → p-7fdd479f.entry.js} +1 -1
- package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
- package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/{p-0cfbbe82.entry.js → p-a4cee65d.entry.js} +1 -1
- package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/{p-92748142.entry.js → p-c0d9c4f8.entry.js} +1 -1
- package/dist/ezui/{p-4818b8ce.entry.js → p-c1527804.entry.js} +1 -1
- package/dist/ezui/{p-b9282c79.entry.js → p-cb1535f7.entry.js} +1 -1
- package/dist/ezui/{p-f4da7e1e.entry.js → p-cf87aacb.entry.js} +1 -1
- package/dist/ezui/{p-5010315a.entry.js → p-d9548bdf.entry.js} +1 -1
- package/dist/ezui/{p-708b196e.entry.js → p-da1b4a38.entry.js} +1 -1
- package/dist/ezui/p-dc73e1fe.entry.js +1 -0
- package/dist/ezui/{p-b2f6bc0a.entry.js → p-e06a9886.entry.js} +1 -1
- package/dist/ezui/{p-bef7daac.entry.js → p-e347df9c.entry.js} +1 -1
- package/dist/ezui/{p-9e95bfeb.entry.js → p-e6a9041d.entry.js} +1 -1
- package/dist/ezui/{p-000159dc.entry.js → p-e75c7a23.entry.js} +1 -1
- package/dist/ezui/{p-68b2e579.entry.js → p-ea54d056.entry.js} +1 -1
- package/dist/ezui/p-f5931caa.entry.js +1 -0
- package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
- package/dist/ezui/{p-e3f8660b.entry.js → p-fd0a19d6.entry.js} +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
- package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +6 -19
- package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +81 -0
- package/dist/types/components.d.ts +218 -3
- package/package.json +1 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
- package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
- package/dist/ezui/p-3af64edd.entry.js +0 -1
- package/dist/ezui/p-6ec40dec.entry.js +0 -1
- package/dist/ezui/p-a921e3e7.entry.js +0 -1
- package/dist/ezui/p-cba34702.entry.js +0 -1
- package/dist/ezui/p-f30e0590.entry.js +0 -1
- package/dist/ezui/p-fcc78b7f.entry.js +0 -1
|
@@ -1,105 +1,27 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
|
|
3
2
|
/* dimensions */
|
|
4
|
-
/*@doc Define altura do input.*/
|
|
5
3
|
--ez-combo-box--height: 42px;
|
|
6
|
-
/*@doc Define largura do input.*/
|
|
7
4
|
--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%;
|
|
15
5
|
|
|
16
6
|
/* general */
|
|
17
|
-
/*@doc Define o raio da borda do input.*/
|
|
18
7
|
--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.*/
|
|
22
8
|
--ez-combo-box--font-size: var(--text--medium, 14px);
|
|
23
|
-
/*@doc Define a família da fonte dentro do input.*/
|
|
24
9
|
--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.*/
|
|
30
10
|
--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);
|
|
35
11
|
|
|
36
12
|
/* input */
|
|
37
|
-
/*@doc Define a cor de fundo do input.*/
|
|
38
13
|
--ez-combo-box__input--background-color: var(--background--medium, #e0e0e0);
|
|
39
|
-
/*@doc Define o estilo da borda do input.*/
|
|
40
14
|
--ez-combo-box__input--border: var(--border--medium, 2px solid);
|
|
41
|
-
/*@doc Define a cor da borda do input.*/
|
|
42
15
|
--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.*/
|
|
45
16
|
--ez-combo-box__input--focus--border-color: var(--color--primary, #008561);
|
|
46
|
-
/*@doc Define a cor de fundo do input quando desabilitado.*/
|
|
47
17
|
--ez-combo-box__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
|
|
48
|
-
/*@doc Define a cor do texto dentro do input quando desabilitado.*/
|
|
49
18
|
--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;
|
|
52
19
|
|
|
53
20
|
/* buttons */
|
|
54
|
-
/*@doc Define a cor do botão de pesquisa do componente.*/
|
|
55
21
|
--ez-combo-box__btn--color: var(--title--primary, #2B3A54);
|
|
56
|
-
/*@doc Define a cor do botão de pesquisa do componente quando desabilitado.*/
|
|
57
22
|
--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.*/
|
|
59
23
|
--ez-combo-box__btn-hover--color: var(--color--primary, #4e4e4e);
|
|
60
24
|
|
|
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
|
-
|
|
103
25
|
/*public*/
|
|
104
26
|
width: var(--ez-combo-box--width);
|
|
105
27
|
}
|
|
@@ -118,178 +40,6 @@ ez-icon {
|
|
|
118
40
|
--ez-text-input__input--disabled--color: var(--title--primary, #2B3A54);
|
|
119
41
|
}
|
|
120
42
|
|
|
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
|
-
|
|
293
43
|
.btn {
|
|
294
44
|
outline: none;
|
|
295
45
|
border: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils,
|
|
1
|
+
import { ElementIDUtils, ObjectUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import { CSSVarsUtils } from "../../utils";
|
|
4
4
|
export class EzComboBox {
|
|
@@ -9,11 +9,13 @@ export class EzComboBox {
|
|
|
9
9
|
this._tabPressed = false;
|
|
10
10
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
11
11
|
this._lookupMode = false;
|
|
12
|
+
this.isOpen = false;
|
|
12
13
|
this._preSelection = undefined;
|
|
13
14
|
this._visibleOptions = undefined;
|
|
14
15
|
this._startLoading = false;
|
|
15
16
|
this._showLoading = true;
|
|
16
17
|
this._criteria = undefined;
|
|
18
|
+
this._textInputReady = undefined;
|
|
17
19
|
this.limitCharsToSearch = 3;
|
|
18
20
|
this.value = undefined;
|
|
19
21
|
this.label = undefined;
|
|
@@ -119,63 +121,6 @@ export class EzComboBox {
|
|
|
119
121
|
async clearValue() {
|
|
120
122
|
this.clearSearch();
|
|
121
123
|
}
|
|
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
|
-
}
|
|
179
124
|
isDifferentValues(firstValue, secondValue) {
|
|
180
125
|
return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
|
|
181
126
|
}
|
|
@@ -248,85 +193,24 @@ export class EzComboBox {
|
|
|
248
193
|
}
|
|
249
194
|
return 0;
|
|
250
195
|
}
|
|
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
|
-
}
|
|
258
196
|
showOptions() {
|
|
259
197
|
var _a, _b;
|
|
260
198
|
if (!this.enabled)
|
|
261
199
|
return;
|
|
262
|
-
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
200
|
+
this.openPopover();
|
|
265
201
|
const valueString = (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.value;
|
|
266
202
|
const indexValue = this._visibleOptions.findIndex(option => option.value === valueString);
|
|
267
203
|
this._preSelection = indexValue === -1 ? 0 : indexValue;
|
|
268
204
|
if (!!this._resizeObserver)
|
|
269
205
|
this._resizeObserver.observe(this._textInput);
|
|
270
|
-
this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: true, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
271
206
|
this.setFocus();
|
|
272
|
-
window.requestAnimationFrame(() => {
|
|
273
|
-
this.updateListPosition();
|
|
274
|
-
if (!this.listOptionsPosition) {
|
|
275
|
-
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
207
|
}
|
|
279
208
|
hideOptions() {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
this._floatingID = undefined;
|
|
209
|
+
var _a;
|
|
210
|
+
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.hide();
|
|
284
211
|
if (!!this._resizeObserver)
|
|
285
212
|
this._resizeObserver.unobserve(this._textInput);
|
|
286
213
|
}
|
|
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
|
-
}
|
|
330
214
|
updateSource(source) {
|
|
331
215
|
this._startLoading = false;
|
|
332
216
|
if (source instanceof Promise) {
|
|
@@ -352,12 +236,13 @@ export class EzComboBox {
|
|
|
352
236
|
}
|
|
353
237
|
}
|
|
354
238
|
selectOption(newOption, focusOnInput = true) {
|
|
355
|
-
var _a, _b;
|
|
239
|
+
var _a, _b, _c;
|
|
356
240
|
const currentValue = this.getSelectedOption(this.value);
|
|
357
241
|
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()))
|
|
358
242
|
|| (currentValue == undefined && newOption != undefined && "value" in newOption)) {
|
|
359
243
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
360
244
|
this.value = adjustedOpt;
|
|
245
|
+
(_c = this._popover) === null || _c === void 0 ? void 0 : _c.hide();
|
|
361
246
|
}
|
|
362
247
|
else {
|
|
363
248
|
this.resetOptions();
|
|
@@ -410,6 +295,11 @@ export class EzComboBox {
|
|
|
410
295
|
//---------------------------------------------
|
|
411
296
|
// Lifecycle web component
|
|
412
297
|
//---------------------------------------------
|
|
298
|
+
componentDidRender() {
|
|
299
|
+
if (this._textInput) {
|
|
300
|
+
this._textInputReady = true;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
413
303
|
componentWillLoad() {
|
|
414
304
|
if (this.options === undefined) {
|
|
415
305
|
this.options = [];
|
|
@@ -428,15 +318,6 @@ export class EzComboBox {
|
|
|
428
318
|
}
|
|
429
319
|
this.loadOptions(SearchMode.PRELOAD);
|
|
430
320
|
}
|
|
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
|
-
}
|
|
440
321
|
componentDidLoad() {
|
|
441
322
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
442
323
|
this.setInputValue(false);
|
|
@@ -444,10 +325,12 @@ export class EzComboBox {
|
|
|
444
325
|
window.requestAnimationFrame(() => {
|
|
445
326
|
if (!Array.isArray(entries) || !entries.length)
|
|
446
327
|
return;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
328
|
+
if (!this._textInput)
|
|
329
|
+
return;
|
|
330
|
+
if (!this._comboBoxList)
|
|
331
|
+
return;
|
|
332
|
+
const textInputWidth = this._textInput.clientWidth;
|
|
333
|
+
this._comboBoxList.width = textInputWidth;
|
|
451
334
|
});
|
|
452
335
|
});
|
|
453
336
|
if (this.autoFocus) {
|
|
@@ -456,6 +339,13 @@ export class EzComboBox {
|
|
|
456
339
|
});
|
|
457
340
|
}
|
|
458
341
|
}
|
|
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
|
+
}
|
|
459
349
|
//---------------------------------------------
|
|
460
350
|
// Event handlers
|
|
461
351
|
//---------------------------------------------
|
|
@@ -495,65 +385,48 @@ export class EzComboBox {
|
|
|
495
385
|
this.showOptions();
|
|
496
386
|
}
|
|
497
387
|
keyDownHandler(event) {
|
|
498
|
-
|
|
499
|
-
if (event.ctrlKey) {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
//não é interessante deixar o evento propagar;
|
|
505
|
-
event.stopPropagation();
|
|
506
|
-
event.stopImmediatePropagation();
|
|
507
|
-
event.preventDefault();
|
|
508
|
-
}
|
|
388
|
+
var _a, _b, _c, _d, _e, _f;
|
|
389
|
+
if (event.ctrlKey && (event.key === "f" || event.key === "F")) {
|
|
390
|
+
this.loadOptions(SearchMode.ADVANCED);
|
|
391
|
+
event.preventDefault();
|
|
392
|
+
event.stopPropagation();
|
|
393
|
+
return;
|
|
509
394
|
}
|
|
510
395
|
switch (event.key) {
|
|
511
396
|
case "ArrowDown":
|
|
512
|
-
event.
|
|
513
|
-
if (this.canShowListOptions())
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
397
|
+
event.preventDefault();
|
|
398
|
+
if (this.canShowListOptions()) {
|
|
399
|
+
this.showOptions();
|
|
400
|
+
(_a = this._comboBoxList) === null || _a === void 0 ? void 0 : _a.nextOption();
|
|
401
|
+
}
|
|
517
402
|
break;
|
|
518
403
|
case "ArrowUp":
|
|
519
|
-
event.
|
|
520
|
-
if (this.canShowListOptions())
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
404
|
+
event.preventDefault();
|
|
405
|
+
if (this.canShowListOptions()) {
|
|
406
|
+
this.showOptions();
|
|
407
|
+
(_b = this._comboBoxList) === null || _b === void 0 ? void 0 : _b.previousOption();
|
|
408
|
+
}
|
|
524
409
|
break;
|
|
525
410
|
case "Enter":
|
|
526
|
-
this.
|
|
527
|
-
|
|
528
|
-
this.selectCurrentOption();
|
|
411
|
+
if (this.isOpen) {
|
|
412
|
+
event.preventDefault();
|
|
413
|
+
(_c = this._comboBoxList) === null || _c === void 0 ? void 0 : _c.selectCurrentOption();
|
|
529
414
|
}
|
|
530
415
|
break;
|
|
531
416
|
case "Escape":
|
|
532
|
-
if (this.
|
|
533
|
-
event.
|
|
417
|
+
if (this.isOpen) {
|
|
418
|
+
event.preventDefault();
|
|
419
|
+
(_d = this._popover) === null || _d === void 0 ? void 0 : _d.hide();
|
|
534
420
|
}
|
|
535
|
-
this.cancelPreselection();
|
|
536
|
-
this.resetOptions();
|
|
537
421
|
break;
|
|
538
422
|
case "Tab":
|
|
539
423
|
this._tabPressed = true;
|
|
540
|
-
if (this.
|
|
541
|
-
this.selectCurrentOption(
|
|
424
|
+
if (this.isOpen) {
|
|
425
|
+
(_e = this._comboBoxList) === null || _e === void 0 ? void 0 : _e.selectCurrentOption();
|
|
426
|
+
(_f = this._popover) === null || _f === void 0 ? void 0 : _f.hide();
|
|
542
427
|
}
|
|
543
|
-
this.resetOptions();
|
|
544
428
|
break;
|
|
545
429
|
}
|
|
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
|
-
}
|
|
557
430
|
}
|
|
558
431
|
onTextInputFocusOutHandler() {
|
|
559
432
|
if (this.hideErrorOnFocusOut)
|
|
@@ -562,14 +435,15 @@ export class EzComboBox {
|
|
|
562
435
|
canShowListOptions() {
|
|
563
436
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
564
437
|
}
|
|
438
|
+
openPopover() {
|
|
439
|
+
var _a;
|
|
440
|
+
this.isOpen = true;
|
|
441
|
+
(_a = this._popover) === null || _a === void 0 ? void 0 : _a.show();
|
|
442
|
+
}
|
|
565
443
|
render() {
|
|
444
|
+
var _a;
|
|
566
445
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
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("
|
|
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)))))));
|
|
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("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none', onEzVisibilityChange: event => this.isOpen = event.detail }, h("ez-combo-box-list", { ref: ref => this._comboBoxList = ref, showLoading: this._showLoading, visibleOptions: this._visibleOptions, textEmptyList: this._textEmptyList, showOptionValue: this.showOptionValue, preSelection: this._preSelection, maxWidth: this._maxWidthValue, width: (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.clientWidth, onOptionSelect: (opt) => this.selectOption(opt), onOptionHover: (index) => this._preSelection = index }))));
|
|
573
447
|
}
|
|
574
448
|
static get is() { return "ez-combo-box"; }
|
|
575
449
|
static get encapsulation() { return "shadow"; }
|
|
@@ -929,11 +803,13 @@ export class EzComboBox {
|
|
|
929
803
|
}
|
|
930
804
|
static get states() {
|
|
931
805
|
return {
|
|
806
|
+
"isOpen": {},
|
|
932
807
|
"_preSelection": {},
|
|
933
808
|
"_visibleOptions": {},
|
|
934
809
|
"_startLoading": {},
|
|
935
810
|
"_showLoading": {},
|
|
936
|
-
"_criteria": {}
|
|
811
|
+
"_criteria": {},
|
|
812
|
+
"_textInputReady": {}
|
|
937
813
|
};
|
|
938
814
|
}
|
|
939
815
|
static get events() {
|
|
@@ -1062,15 +938,6 @@ export class EzComboBox {
|
|
|
1062
938
|
"methodName": "observeOptions"
|
|
1063
939
|
}];
|
|
1064
940
|
}
|
|
1065
|
-
static get listeners() {
|
|
1066
|
-
return [{
|
|
1067
|
-
"name": "scroll",
|
|
1068
|
-
"method": "scrollListener",
|
|
1069
|
-
"target": "window",
|
|
1070
|
-
"capture": true,
|
|
1071
|
-
"passive": true
|
|
1072
|
-
}];
|
|
1073
|
-
}
|
|
1074
941
|
}
|
|
1075
942
|
var SearchMode;
|
|
1076
943
|
(function (SearchMode) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const buildSearch = ({ name, label, readOnly, required, contextName, canShowError, optionLoader, props }) => {
|
|
3
3
|
var _a;
|
|
4
|
-
return (h("div", { class: "ez-col ez-col--sd-12" }, h("ez-search", { class: "ez-input__no-margin", enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader, ignoreLimitCharsToSearch: (_a = props.ignoreLimitCharsToSearch) !== null && _a !== void 0 ? _a : false })));
|
|
4
|
+
return (h("div", { class: "ez-col ez-col--sd-12" }, h("ez-search", { class: "ez-input__no-margin", enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, "data-context-name": contextName, key: name, canShowError: canShowError, optionLoader: optionLoader, ignoreLimitCharsToSearch: (_a = props === null || props === void 0 ? void 0 : props.ignoreLimitCharsToSearch) !== null && _a !== void 0 ? _a : false })));
|
|
5
5
|
};
|