@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,381 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-baa5e267.js';
|
|
2
|
-
import { ElementIDUtils, ObjectUtils, HTMLBuilder, StringUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CustomEditorSource } from './ICustomRender-875b5a40.js';
|
|
4
|
-
import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
|
|
5
|
-
import './DialogType-54a62731.js';
|
|
6
|
-
import './CheckMode-bdb2ec19.js';
|
|
7
|
-
|
|
8
|
-
const ezComboBoxListCss = ":host{--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);--ez-combo-box__list-container--padding:var(--space--extra-small, 3px)}.list-container{padding-top:var(--ez-combo-box__list-container--padding)}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow--medium, 0 8px 24px 0 rgba(43, 58, 84, 0.10));padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
9
|
-
|
|
10
|
-
const EzComboBoxList = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
registerInstance(this, hostRef);
|
|
13
|
-
this.showLoading = undefined;
|
|
14
|
-
this.visibleOptions = undefined;
|
|
15
|
-
this.textEmptyList = "Nenhum resultado encontrado";
|
|
16
|
-
this.showOptionValue = undefined;
|
|
17
|
-
this.preSelection = undefined;
|
|
18
|
-
this.maxWidth = undefined;
|
|
19
|
-
this.width = undefined;
|
|
20
|
-
this.onOptionSelect = undefined;
|
|
21
|
-
this.onOptionHover = undefined;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Move a seleção para a próxima opção na lista.
|
|
25
|
-
*/
|
|
26
|
-
async nextOption() {
|
|
27
|
-
var _a;
|
|
28
|
-
if (!this.visibleOptions || this.visibleOptions.length === 0)
|
|
29
|
-
return;
|
|
30
|
-
const isAtLastOption = this.preSelection !== undefined && this.preSelection >= this.visibleOptions.length - 1;
|
|
31
|
-
if (!isAtLastOption) {
|
|
32
|
-
this.preSelection = this.preSelection === undefined ? 0 : this.preSelection + 1;
|
|
33
|
-
this.scrollToOption(this.visibleOptions[this.preSelection]);
|
|
34
|
-
(_a = this.onOptionHover) === null || _a === void 0 ? void 0 : _a.call(this, this.preSelection);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Move a seleção para a opção anterior na lista, sem ultrapassar o início.
|
|
39
|
-
*/
|
|
40
|
-
async previousOption() {
|
|
41
|
-
var _a;
|
|
42
|
-
if (!this.visibleOptions || this.visibleOptions.length === 0)
|
|
43
|
-
return;
|
|
44
|
-
const isAtFirstOption = this.preSelection !== undefined && this.preSelection <= 0;
|
|
45
|
-
if (!isAtFirstOption) {
|
|
46
|
-
this.preSelection = this.preSelection === undefined ? this.visibleOptions.length - 1 : this.preSelection - 1;
|
|
47
|
-
this.scrollToOption(this.visibleOptions[this.preSelection]);
|
|
48
|
-
(_a = this.onOptionHover) === null || _a === void 0 ? void 0 : _a.call(this, this.preSelection);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Seleciona a opção atualmente pré-selecionada.
|
|
53
|
-
*/
|
|
54
|
-
async selectCurrentOption() {
|
|
55
|
-
if (this.preSelection !== undefined) {
|
|
56
|
-
this.onOptionSelect(this.visibleOptions[this.preSelection]);
|
|
57
|
-
this.preSelection = undefined;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Observa mudanças na propriedade `width` e ajusta a largura da lista.
|
|
62
|
-
*
|
|
63
|
-
* @param newValue O novo valor da largura.
|
|
64
|
-
* @param oldValue O valor anterior da largura.
|
|
65
|
-
*/
|
|
66
|
-
observeWidth(newValue, oldValue) {
|
|
67
|
-
if (newValue === oldValue)
|
|
68
|
-
return;
|
|
69
|
-
if (!this._listWrapper)
|
|
70
|
-
return;
|
|
71
|
-
this._listWrapper.style.width = `${this.width}px`;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Observa mudanças na propriedade `maxWidth` e ajusta a largura máxima da lista.
|
|
75
|
-
*
|
|
76
|
-
* @param newValue O novo valor da largura máxima.
|
|
77
|
-
* @param oldValue O valor anterior da largura máxima.
|
|
78
|
-
*/
|
|
79
|
-
observeMaxWidth(newValue, oldValue) {
|
|
80
|
-
if (newValue === oldValue)
|
|
81
|
-
return;
|
|
82
|
-
if (!this._listWrapper)
|
|
83
|
-
return;
|
|
84
|
-
this._listWrapper.style.maxWidth = this.maxWidth ? `${this.maxWidth}px` : '';
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Gerencia a navegação por teclado na lista do combo box.
|
|
88
|
-
*
|
|
89
|
-
* - `ArrowDown`: Move para a próxima opção.
|
|
90
|
-
* - `ArrowUp`: Move para a opção anterior.
|
|
91
|
-
* - `Enter`: Seleciona a opção atual.
|
|
92
|
-
* - `Escape`: Limpa a pré-seleção.
|
|
93
|
-
*
|
|
94
|
-
* @param event O evento de teclado.
|
|
95
|
-
*/
|
|
96
|
-
handleKeyDown(event) {
|
|
97
|
-
switch (event.key) {
|
|
98
|
-
case "ArrowDown":
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
event.stopPropagation();
|
|
101
|
-
this.nextOption();
|
|
102
|
-
break;
|
|
103
|
-
case "ArrowUp":
|
|
104
|
-
event.preventDefault();
|
|
105
|
-
event.stopPropagation();
|
|
106
|
-
this.previousOption();
|
|
107
|
-
break;
|
|
108
|
-
case "Enter":
|
|
109
|
-
this.selectCurrentOption();
|
|
110
|
-
break;
|
|
111
|
-
case "Escape":
|
|
112
|
-
this.preSelection = undefined;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
buildItem(opt, index) {
|
|
117
|
-
const widthValue = this.showOptionValue && this.maxWidth > 0 ? `${this.maxWidth}px` : '';
|
|
118
|
-
opt.label = opt.label || opt.value;
|
|
119
|
-
return h("li", { tabIndex: 1, class: index === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}_${index}`, key: `item_${opt.value}_${index}`, onMouseDown: () => this.onOptionSelect(opt), onMouseOver: () => this.preSelection = index }, this.showOptionValue
|
|
120
|
-
? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
|
|
121
|
-
: undefined, h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
|
|
122
|
-
}
|
|
123
|
-
scrollToOption(opt) {
|
|
124
|
-
if (!opt || !opt.value || !this._optionsList)
|
|
125
|
-
return;
|
|
126
|
-
const index = this.visibleOptions.indexOf(opt);
|
|
127
|
-
if (index === -1)
|
|
128
|
-
return;
|
|
129
|
-
const liElem = this._optionsList.querySelector(`li#item_${CSS.escape(opt.value)}_${CSS.escape(String(index))}`);
|
|
130
|
-
if (liElem) {
|
|
131
|
-
liElem.scrollIntoView({
|
|
132
|
-
behavior: "smooth",
|
|
133
|
-
block: "nearest"
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
componentDidLoad() {
|
|
138
|
-
this._listWrapper.style.width = `${this.width}px`;
|
|
139
|
-
this._listWrapper.style.maxWidth = this.maxWidth ? `${this.maxWidth}px` : '';
|
|
140
|
-
}
|
|
141
|
-
componentDidRender() {
|
|
142
|
-
var _a;
|
|
143
|
-
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
144
|
-
ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
render() {
|
|
148
|
-
return (h("section", { class: "list-container" }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading && this.visibleOptions.length === 0 && (h("div", { class: "message" }, h("span", { class: "message__no-result" }, this.textEmptyList))), this.showLoading && (h("div", { class: "message" }, h("div", { class: "message__loading" }))), this.showOptionValue && (h("span", { class: "item__value item__value--hidden" })), !this.showLoading && this.visibleOptions.length > 0 &&
|
|
149
|
-
this.visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
|
|
150
|
-
}
|
|
151
|
-
static get watchers() { return {
|
|
152
|
-
"width": ["observeWidth"],
|
|
153
|
-
"maxWidth": ["observeMaxWidth"]
|
|
154
|
-
}; }
|
|
155
|
-
};
|
|
156
|
-
EzComboBoxList.style = ezComboBoxListCss;
|
|
157
|
-
|
|
158
|
-
const EzCustomFormInput = class {
|
|
159
|
-
constructor(hostRef) {
|
|
160
|
-
registerInstance(this, hostRef);
|
|
161
|
-
this.gui = undefined;
|
|
162
|
-
this.customEditor = undefined;
|
|
163
|
-
this.formViewField = undefined;
|
|
164
|
-
this.value = undefined;
|
|
165
|
-
this.detailContext = undefined;
|
|
166
|
-
this.builderFallback = undefined;
|
|
167
|
-
this.selectedRecord = undefined;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Aplica foco no campo.
|
|
171
|
-
*/
|
|
172
|
-
async setFocus() {
|
|
173
|
-
var _a, _b;
|
|
174
|
-
(_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Remove o foco do campo.
|
|
178
|
-
*/
|
|
179
|
-
async setBlur() {
|
|
180
|
-
var _a, _b;
|
|
181
|
-
(_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["setBlur"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Retorna se o conteúdo é inválido.
|
|
185
|
-
*/
|
|
186
|
-
async isInvalid() {
|
|
187
|
-
var _a, _b;
|
|
188
|
-
return ((_b = (_a = this.gui) === null || _a === void 0 ? void 0 : _a["isInvalid"]) === null || _b === void 0 ? void 0 : _b.call(_a)) || false;
|
|
189
|
-
}
|
|
190
|
-
watchValue() {
|
|
191
|
-
this.handleValue(this.gui);
|
|
192
|
-
}
|
|
193
|
-
watchCustomEditor() {
|
|
194
|
-
this.getContent();
|
|
195
|
-
}
|
|
196
|
-
watchFormViewField(newValue, oldValue) {
|
|
197
|
-
if (!ObjectUtils.equals(newValue, oldValue))
|
|
198
|
-
this.getContent();
|
|
199
|
-
}
|
|
200
|
-
watchDetailContext() {
|
|
201
|
-
this.getContent();
|
|
202
|
-
}
|
|
203
|
-
watchBuilderFallback() {
|
|
204
|
-
this.getContent();
|
|
205
|
-
}
|
|
206
|
-
watchSelectedRecord(newValue, oldValue) {
|
|
207
|
-
const newRecordId = newValue === null || newValue === void 0 ? void 0 : newValue['__record__id__'];
|
|
208
|
-
const oldRecordId = oldValue === null || oldValue === void 0 ? void 0 : oldValue['__record__id__'];
|
|
209
|
-
if (newRecordId !== oldRecordId) {
|
|
210
|
-
this.getContent();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
getContent() {
|
|
214
|
-
var _a, _b, _c, _d, _e;
|
|
215
|
-
const fieldProps = new Map();
|
|
216
|
-
for (const prop in this.formViewField.props) {
|
|
217
|
-
fieldProps.set(prop, this.formViewField.props[prop]);
|
|
218
|
-
}
|
|
219
|
-
const params = {
|
|
220
|
-
value: this.value,
|
|
221
|
-
name: this.formViewField.name,
|
|
222
|
-
currentEditor: this.builderFallback(this.formViewField),
|
|
223
|
-
setValue: (value) => this.setValue(value),
|
|
224
|
-
getValue: this.getValue,
|
|
225
|
-
record: this.selectedRecord,
|
|
226
|
-
editorMetadata: {
|
|
227
|
-
label: this.formViewField.label,
|
|
228
|
-
hidden: ((_a = this.formViewField.props) === null || _a === void 0 ? void 0 : _a.visible) === false,
|
|
229
|
-
userInterface: this.formViewField.userInterface,
|
|
230
|
-
options: (_b = this.formViewField.props) === null || _b === void 0 ? void 0 : _b.options,
|
|
231
|
-
props: this.formViewField.props ? fieldProps : undefined,
|
|
232
|
-
optionLoader: this.formViewField.optionLoader
|
|
233
|
-
},
|
|
234
|
-
source: CustomEditorSource.FORM,
|
|
235
|
-
detailContext: this.detailContext
|
|
236
|
-
};
|
|
237
|
-
let gui = this.customEditor.getEditorElement(params);
|
|
238
|
-
if (!gui) {
|
|
239
|
-
gui = this.builderFallback(this.formViewField);
|
|
240
|
-
this.handleValue(gui);
|
|
241
|
-
this.gui = gui;
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (!(gui instanceof HTMLElement) && typeof gui !== 'string') {
|
|
245
|
-
this.handleValue(gui);
|
|
246
|
-
this.gui = gui;
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
if (typeof gui === 'string') {
|
|
250
|
-
gui = HTMLBuilder.parseElement(gui);
|
|
251
|
-
}
|
|
252
|
-
const value = (_e = (_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : this.value) !== null && _e !== void 0 ? _e : '';
|
|
253
|
-
gui.setAttribute('value', value);
|
|
254
|
-
this.gui = h("div", { key: StringUtils.generateUUID(), ref: el => el && el.appendChild(gui) });
|
|
255
|
-
}
|
|
256
|
-
setValue(value) {
|
|
257
|
-
this.value = value;
|
|
258
|
-
}
|
|
259
|
-
getValue() {
|
|
260
|
-
return this.value;
|
|
261
|
-
}
|
|
262
|
-
handleValue(gui) {
|
|
263
|
-
var _a;
|
|
264
|
-
//@ts-ignore
|
|
265
|
-
(_a = gui.$children$) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
266
|
-
child.$attrs$.value = this.value;
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
componentWillLoad() {
|
|
270
|
-
this.getContent();
|
|
271
|
-
}
|
|
272
|
-
render() {
|
|
273
|
-
return (h(Host, null, this.gui));
|
|
274
|
-
}
|
|
275
|
-
static get watchers() { return {
|
|
276
|
-
"value": ["watchValue"],
|
|
277
|
-
"customEditor": ["watchCustomEditor"],
|
|
278
|
-
"formViewField": ["watchFormViewField"],
|
|
279
|
-
"detailContext": ["watchDetailContext"],
|
|
280
|
-
"builderFallback": ["watchBuilderFallback"],
|
|
281
|
-
"selectedRecord": ["watchSelectedRecord"]
|
|
282
|
-
}; }
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
const ezTextEditCss = ":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";
|
|
286
|
-
|
|
287
|
-
const EzTextEdit = class {
|
|
288
|
-
constructor(hostRef) {
|
|
289
|
-
registerInstance(this, hostRef);
|
|
290
|
-
this.saveEdition = createEvent(this, "saveEdition", 7);
|
|
291
|
-
this.cancelEdition = createEvent(this, "cancelEdition", 7);
|
|
292
|
-
this._newValue = undefined;
|
|
293
|
-
this.value = undefined;
|
|
294
|
-
this.styled = undefined;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Aplica foco no campo.
|
|
298
|
-
*/
|
|
299
|
-
async applyFocusSelect() {
|
|
300
|
-
this.calcSizeInput(this.value, true);
|
|
301
|
-
}
|
|
302
|
-
calcSizeInput(value, setSelect = false) {
|
|
303
|
-
var _a, _b;
|
|
304
|
-
const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
305
|
-
if (textInput != undefined) {
|
|
306
|
-
const sizeText = this.getWidthValue(value);
|
|
307
|
-
textInput.style.width = sizeText + 'px';
|
|
308
|
-
if (setSelect) {
|
|
309
|
-
setTimeout(() => textInput.select(), 100);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
getWidthValue(value) {
|
|
314
|
-
if (this._valueBasis != undefined) {
|
|
315
|
-
const span = this._valueBasis;
|
|
316
|
-
if (value != undefined) {
|
|
317
|
-
const cursorSpace = 2;
|
|
318
|
-
span.innerHTML = value;
|
|
319
|
-
return span.clientWidth > 0 ? (span.clientWidth + cursorSpace) : cursorSpace;
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
span.innerHTML = "";
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return 0;
|
|
326
|
-
}
|
|
327
|
-
setStyledInput() {
|
|
328
|
-
var _a, _b;
|
|
329
|
-
let fontSize = "";
|
|
330
|
-
let fontWeight = "";
|
|
331
|
-
let fontFamily = "";
|
|
332
|
-
if (this.styled != undefined) {
|
|
333
|
-
fontSize = this.styled.fontSize;
|
|
334
|
-
fontWeight = this.styled.fontWeight;
|
|
335
|
-
fontFamily = this.styled.fontFamily;
|
|
336
|
-
}
|
|
337
|
-
const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
338
|
-
if (textInput != undefined) {
|
|
339
|
-
textInput.style.fontSize = fontSize;
|
|
340
|
-
textInput.style.fontWeight = fontWeight;
|
|
341
|
-
textInput.style.fontFamily = fontFamily;
|
|
342
|
-
}
|
|
343
|
-
const span = this._valueBasis;
|
|
344
|
-
if (span != undefined) {
|
|
345
|
-
span.style.fontSize = fontSize;
|
|
346
|
-
span.style.fontWeight = fontWeight;
|
|
347
|
-
span.style.fontFamily = fontFamily;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
handleSaveEdition() {
|
|
351
|
-
if (!this._newValue) {
|
|
352
|
-
ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
|
|
353
|
-
this.setNewValue(this.value, true);
|
|
354
|
-
});
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
this.saveEdition.emit({ value: this.value, newValue: this._newValue });
|
|
358
|
-
}
|
|
359
|
-
handleCancelEdition() {
|
|
360
|
-
this.cancelEdition.emit();
|
|
361
|
-
}
|
|
362
|
-
setNewValue(value, setSelect = false) {
|
|
363
|
-
this._newValue = value;
|
|
364
|
-
this.calcSizeInput(this._newValue, setSelect);
|
|
365
|
-
}
|
|
366
|
-
componentDidLoad() {
|
|
367
|
-
this.applyFocusSelect();
|
|
368
|
-
this.setNewValue(this.value);
|
|
369
|
-
}
|
|
370
|
-
componentDidRender() {
|
|
371
|
-
this.setStyledInput();
|
|
372
|
-
}
|
|
373
|
-
render() {
|
|
374
|
-
ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
|
|
375
|
-
return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), onInput: () => { this.calcSizeInput(this._newValue); }, class: "text-edit__form-input", value: this._newValue, ref: (elem) => this._inputElement = elem, mode: "slim", onEzChange: (evt) => this.setNewValue(evt === null || evt === void 0 ? void 0 : evt.detail), noBorder: true }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.handleCancelEdition(); } })));
|
|
376
|
-
}
|
|
377
|
-
get _element() { return getElement(this); }
|
|
378
|
-
};
|
|
379
|
-
EzTextEdit.style = ezTextEditCss;
|
|
380
|
-
|
|
381
|
-
export { EzComboBoxList as ez_combo_box_list, EzCustomFormInput as ez_custom_form_input, EzTextEdit as ez_text_edit };
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-baa5e267.js';
|
|
2
|
-
import { ArrayUtils } from '@sankhyalabs/core';
|
|
3
|
-
|
|
4
|
-
const ezMultiSelectionListCss = ".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;--ez-multi-selection-default-height:322px;display:block;width:304px;height:var(--ez-multi-selection-default-height);min-height:fit-content;max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
|
|
5
|
-
|
|
6
|
-
var ViewScenarios;
|
|
7
|
-
(function (ViewScenarios) {
|
|
8
|
-
ViewScenarios["DATASOURCE_RESULTS"] = "DATASOURCE_RESULTS";
|
|
9
|
-
ViewScenarios["DATASOURCE_RESULTS_EMPTY"] = "DATASOURCE_RESULTS_EMPTY";
|
|
10
|
-
ViewScenarios["DATASOURCE_INIT"] = "DATASOURCE_INIT";
|
|
11
|
-
ViewScenarios["OPTIONS_EMPTY"] = "OPTIONS_EMPTY";
|
|
12
|
-
ViewScenarios["OPTIONS"] = "OPTIONS";
|
|
13
|
-
})(ViewScenarios || (ViewScenarios = {}));
|
|
14
|
-
const EzMuiltiSelectionList = class {
|
|
15
|
-
constructor(hostRef) {
|
|
16
|
-
registerInstance(this, hostRef);
|
|
17
|
-
this.changeFilteredOptions = createEvent(this, "changeFilteredOptions", 7);
|
|
18
|
-
this.columnName = undefined;
|
|
19
|
-
this.dataSource = undefined;
|
|
20
|
-
this.useOptions = false;
|
|
21
|
-
this.options = undefined;
|
|
22
|
-
this.isTextSearch = false;
|
|
23
|
-
this.filteredOptions = undefined;
|
|
24
|
-
this.displayOptions = undefined;
|
|
25
|
-
this.viewScenario = undefined;
|
|
26
|
-
this.displayOptionToCheckAllItems = true;
|
|
27
|
-
}
|
|
28
|
-
async clearFilteredOptions() {
|
|
29
|
-
this.setInitialScenario();
|
|
30
|
-
this.filteredOptions = [];
|
|
31
|
-
if (this.searchInput) {
|
|
32
|
-
this.searchInput.value = '';
|
|
33
|
-
}
|
|
34
|
-
if (this.filterInput) {
|
|
35
|
-
this.filterInput.value = '';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
onChangeUseOptions() {
|
|
39
|
-
this.setInitialScenario();
|
|
40
|
-
}
|
|
41
|
-
onChangeOptions() {
|
|
42
|
-
if (this.options) {
|
|
43
|
-
this.filteredOptions = this.ordenationByCheckStateAndAlphabetically(this.options);
|
|
44
|
-
}
|
|
45
|
-
this.checkInput && this.changeCheckAllValeuFromFilteredOptions();
|
|
46
|
-
this.setInitialScenario();
|
|
47
|
-
}
|
|
48
|
-
onChangeFilteredOptions(optionsListUpdated) {
|
|
49
|
-
this.displayOptions = this.filteredOptions;
|
|
50
|
-
this.displayOptionToCheckAllItems = this.filteredOptions.length > 1;
|
|
51
|
-
this.checkInput && this.changeCheckAllValeuFromFilteredOptions();
|
|
52
|
-
this.changeFilteredOptions.emit(optionsListUpdated);
|
|
53
|
-
}
|
|
54
|
-
componentDidRender() {
|
|
55
|
-
this.changeCheckAllValeuFromFilteredOptions();
|
|
56
|
-
}
|
|
57
|
-
ordenationByCheckStateAndAlphabetically(filteredOptions) {
|
|
58
|
-
const listWithSelectChecked = [];
|
|
59
|
-
const listWithNotSelectChecked = [];
|
|
60
|
-
let emptyElement;
|
|
61
|
-
filteredOptions.forEach(item => {
|
|
62
|
-
if (item.value == undefined || item.label === "") {
|
|
63
|
-
emptyElement = Object.assign(Object.assign({}, item), { label: "(Vazio)" });
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
(item.check ? listWithSelectChecked.push(item) : listWithNotSelectChecked.push(item));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return (emptyElement == undefined ? [] : [emptyElement])
|
|
70
|
-
.concat(this.dataSource == undefined ? ArrayUtils.sortAlphabetically(listWithSelectChecked) : this.dataSource.sortItems(this.columnName, listWithSelectChecked))
|
|
71
|
-
.concat(this.dataSource == undefined ? ArrayUtils.sortAlphabetically(listWithNotSelectChecked) : this.dataSource.sortItems(this.columnName, listWithNotSelectChecked));
|
|
72
|
-
}
|
|
73
|
-
changeCheckAllValeuFromFilteredOptions() {
|
|
74
|
-
var _a, _b, _c, _d;
|
|
75
|
-
const selectAll = (_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.every(item => item.check === true);
|
|
76
|
-
const notSelectAll = (_b = this.filteredOptions) === null || _b === void 0 ? void 0 : _b.every(item => item.check === false);
|
|
77
|
-
const selectIndeterminated = ((_c = this.filteredOptions) === null || _c === void 0 ? void 0 : _c.some(item => item.check === false)) && ((_d = this.filteredOptions) === null || _d === void 0 ? void 0 : _d.some(item => item.check === true)) && (!selectAll || !notSelectAll);
|
|
78
|
-
if (this.checkInput && selectAll) {
|
|
79
|
-
this.checkInput.indeterminate = false;
|
|
80
|
-
this.checkInput.value = true;
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (this.checkInput && selectIndeterminated) {
|
|
84
|
-
this.checkInput.indeterminate = true;
|
|
85
|
-
this.checkInput.value = false;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (this.checkInput && notSelectAll) {
|
|
89
|
-
this.checkInput.indeterminate = false;
|
|
90
|
-
this.checkInput.value = false;
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
setInitialScenario() {
|
|
95
|
-
if (this.useOptions) {
|
|
96
|
-
this.viewScenario = ViewScenarios.OPTIONS;
|
|
97
|
-
this.changeCheckAllValeuFromFilteredOptions();
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
this.viewScenario = this.options && this.options.length > 0 ? ViewScenarios.DATASOURCE_RESULTS : ViewScenarios.DATASOURCE_INIT;
|
|
101
|
-
}
|
|
102
|
-
async searchWithDataSource(searchArgument, fieldName) {
|
|
103
|
-
const { argument, mode } = searchArgument;
|
|
104
|
-
if (mode !== 'PRELOAD' && fieldName) {
|
|
105
|
-
return this.dataSource.fetchData(argument, fieldName);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
handleSearchOnDataSource(event) {
|
|
109
|
-
var _a;
|
|
110
|
-
const optionsToSort = (_a = this.filteredOptions) !== null && _a !== void 0 ? _a : [];
|
|
111
|
-
if (event.detail && !optionsToSort.some(item => item.value == event.detail.value)) {
|
|
112
|
-
this.filteredOptions = this.ordenationByCheckStateAndAlphabetically([...optionsToSort, event.detail]);
|
|
113
|
-
}
|
|
114
|
-
this.viewScenario = ViewScenarios.DATASOURCE_RESULTS;
|
|
115
|
-
this.searchInput.value = "";
|
|
116
|
-
}
|
|
117
|
-
handleRemoveItemFromOptions(item) {
|
|
118
|
-
this.filteredOptions = this.ordenationByCheckStateAndAlphabetically(this.filteredOptions.filter(i => i.value !== item.value));
|
|
119
|
-
if (this.filteredOptions.length === 0) {
|
|
120
|
-
this.viewScenario = ViewScenarios.DATASOURCE_INIT;
|
|
121
|
-
}
|
|
122
|
-
if (this.searchInput) {
|
|
123
|
-
this.searchInput.value = '';
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
handleSearchOnOption(event) {
|
|
127
|
-
if (event.detail) {
|
|
128
|
-
this.displayOptions = ArrayUtils.applyStringFilter(event.detail, this.filteredOptions, true);
|
|
129
|
-
this.viewScenario = this.displayOptions.length === 0 ? ViewScenarios.OPTIONS_EMPTY : ViewScenarios.OPTIONS;
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
this.displayOptions = this.filteredOptions;
|
|
133
|
-
this.viewScenario = ViewScenarios.OPTIONS;
|
|
134
|
-
}
|
|
135
|
-
handleChangeSelectAllItems(event) {
|
|
136
|
-
this.filteredOptions = this.ordenationByCheckStateAndAlphabetically([
|
|
137
|
-
...this.filteredOptions.map(item => {
|
|
138
|
-
item.check = !!event.detail;
|
|
139
|
-
return item;
|
|
140
|
-
}),
|
|
141
|
-
]);
|
|
142
|
-
}
|
|
143
|
-
handleChangeSelectedItem(event) {
|
|
144
|
-
const { detail: itemCheckSelected } = event;
|
|
145
|
-
const itemSelected = this.filteredOptions.find(item => item.label === itemCheckSelected.label);
|
|
146
|
-
itemSelected.check = itemCheckSelected.check;
|
|
147
|
-
}
|
|
148
|
-
buildViewList(hasDelete) {
|
|
149
|
-
return (h(Fragment, null, this.displayOptionToCheckAllItems && (h("ez-check", { ref: (element) => (this.checkInput = element), label: "Selecionar todos", class: "multi-selection__select-all", onEzChange: this.handleChangeSelectAllItems.bind(this) })), h("ez-list", { class: "multi-selection__list", dataSource: this.displayOptions, listMode: "check", hoverFeedback: true, onEzCheckChange: this.handleChangeSelectedItem.bind(this), itemSlotBuilder: hasDelete ? this.buildDeleteIconSlot.bind(this) : null })));
|
|
150
|
-
}
|
|
151
|
-
buildDeleteIconSlot(item) {
|
|
152
|
-
return h("ez-icon", { style: { cursor: 'pointer' }, iconName: "delete", onClick: () => this.handleRemoveItemFromOptions(item) });
|
|
153
|
-
}
|
|
154
|
-
buildInitViewWithDataSource() {
|
|
155
|
-
return h("multi-selection-box-message", { message: "Selecione os valores a serem filtrados atrav\u00E9s do campo de busca." });
|
|
156
|
-
}
|
|
157
|
-
buildViewEmptyResults() {
|
|
158
|
-
return h("multi-selection-box-message", { message: "Nenhum resultado encontrado." });
|
|
159
|
-
}
|
|
160
|
-
scenarioToDisplay(view) {
|
|
161
|
-
const scenarios = {
|
|
162
|
-
[ViewScenarios.DATASOURCE_INIT]: () => this.buildInitViewWithDataSource(),
|
|
163
|
-
[ViewScenarios.DATASOURCE_RESULTS]: () => this.buildViewList(true),
|
|
164
|
-
[ViewScenarios.DATASOURCE_RESULTS_EMPTY]: () => this.buildViewEmptyResults(),
|
|
165
|
-
[ViewScenarios.OPTIONS_EMPTY]: () => this.buildViewEmptyResults(),
|
|
166
|
-
[ViewScenarios.OPTIONS]: () => this.buildViewList(false),
|
|
167
|
-
};
|
|
168
|
-
const scenarioBuilder = scenarios[view];
|
|
169
|
-
return scenarioBuilder ? scenarioBuilder() : undefined;
|
|
170
|
-
}
|
|
171
|
-
render() {
|
|
172
|
-
return (h(Host, null, h("div", { class: "multi-selection" }, this.useOptions ? (h("ez-filter-input", { ref: (element) => (this.filterInput = element), label: `Buscar..`, onEzChange: this.handleSearchOnOption.bind(this) })) : (h("ez-search", { class: "multi-selection__input", label: `Buscar...`, ref: (element) => (this.searchInput = element), suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, optionLoader: (search) => this.searchWithDataSource(search, this.columnName), onEzChange: this.handleSearchOnDataSource.bind(this), isTextSearch: this.isTextSearch })), h("ez-scroll", { class: "multi-selection__content-options" }, this.scenarioToDisplay(this.viewScenario)))));
|
|
173
|
-
}
|
|
174
|
-
static get watchers() { return {
|
|
175
|
-
"useOptions": ["onChangeUseOptions"],
|
|
176
|
-
"options": ["onChangeOptions"],
|
|
177
|
-
"filteredOptions": ["onChangeFilteredOptions"]
|
|
178
|
-
}; }
|
|
179
|
-
};
|
|
180
|
-
EzMuiltiSelectionList.style = ezMultiSelectionListCss;
|
|
181
|
-
|
|
182
|
-
export { EzMuiltiSelectionList as ez_multi_selection_list };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as o,c as e,g as s}from"./p-23a36bb6.js";import{ElementIDUtils as r,ObjectUtils as a,HTMLBuilder as l,StringUtils as n}from"@sankhyalabs/core";import{C as c}from"./p-4607fb89.js";import{A as h}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";const d=class{constructor(i){t(this,i),this.showLoading=void 0,this.visibleOptions=void 0,this.textEmptyList="Nenhum resultado encontrado",this.showOptionValue=void 0,this.preSelection=void 0,this.maxWidth=void 0,this.width=void 0,this.onOptionSelect=void 0,this.onOptionHover=void 0}async nextOption(){var t;this.visibleOptions&&0!==this.visibleOptions.length&&(void 0!==this.preSelection&&this.preSelection>=this.visibleOptions.length-1||(this.preSelection=void 0===this.preSelection?0:this.preSelection+1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(t=this.onOptionHover)||void 0===t||t.call(this,this.preSelection)))}async previousOption(){var t;this.visibleOptions&&0!==this.visibleOptions.length&&(void 0!==this.preSelection&&this.preSelection<=0||(this.preSelection=void 0===this.preSelection?this.visibleOptions.length-1:this.preSelection-1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(t=this.onOptionHover)||void 0===t||t.call(this,this.preSelection)))}async selectCurrentOption(){void 0!==this.preSelection&&(this.onOptionSelect(this.visibleOptions[this.preSelection]),this.preSelection=void 0)}observeWidth(t,i){t!==i&&this._listWrapper&&(this._listWrapper.style.width=`${this.width}px`)}observeMaxWidth(t,i){t!==i&&this._listWrapper&&(this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:"")}handleKeyDown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.nextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.preSelection=void 0}}buildItem(t,o){const e=this.showOptionValue&&this.maxWidth>0?`${this.maxWidth}px`:"";return t.label=t.label||t.value,i("li",{tabIndex:1,class:o===this.preSelection?"item preselected":"item",id:`item_${t.value}_${o}`,key:`item_${t.value}_${o}`,onMouseDown:()=>this.onOptionSelect(t),onMouseOver:()=>this.preSelection=o},this.showOptionValue?i("span",{class:"item__value",title:t.value,style:{width:e,minWidth:e,maxWidth:e}},t.value):void 0,i("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:t.label},t.label))}scrollToOption(t){if(!t||!t.value||!this._optionsList)return;const i=this.visibleOptions.indexOf(t);if(-1===i)return;const o=this._optionsList.querySelector(`li#item_${CSS.escape(t.value)}_${CSS.escape(String(i))}`);o&&o.scrollIntoView({behavior:"smooth",block:"nearest"})}componentDidLoad(){this._listWrapper.style.width=`${this.width}px`,this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:""}componentDidRender(){var t;null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{r.addIDInfoIfNotExists(t,"itemComboBox")}))}render(){return i("section",{class:"list-container"},i("div",{class:"list-wrapper",ref:t=>this._listWrapper=t},i("ul",{class:"list-options",ref:t=>this._optionsList=t},!this.showLoading&&0===this.visibleOptions.length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.showOptionValue&&i("span",{class:"item__value item__value--hidden"}),!this.showLoading&&this.visibleOptions.length>0&&this.visibleOptions.map(((t,i)=>this.buildItem(t,i))))))}static get watchers(){return{width:["observeWidth"],maxWidth:["observeMaxWidth"]}}};d.style=":host{--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);--ez-combo-box__list-container--padding:var(--space--extra-small, 3px)}.list-container{padding-top:var(--ez-combo-box__list-container--padding)}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow--medium, 0 8px 24px 0 rgba(43, 58, 84, 0.10));padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const b=class{constructor(i){t(this,i),this.gui=void 0,this.customEditor=void 0,this.formViewField=void 0,this.value=void 0,this.detailContext=void 0,this.builderFallback=void 0,this.selectedRecord=void 0}async setFocus(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t)}async setBlur(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setBlur)||void 0===i||i.call(t)}async isInvalid(){var t,i;return(null===(i=null===(t=this.gui)||void 0===t?void 0:t.isInvalid)||void 0===i?void 0:i.call(t))||!1}watchValue(){this.handleValue(this.gui)}watchCustomEditor(){this.getContent()}watchFormViewField(t,i){a.equals(t,i)||this.getContent()}watchDetailContext(){this.getContent()}watchBuilderFallback(){this.getContent()}watchSelectedRecord(t,i){(null==t?void 0:t.__record__id__)!==(null==i?void 0:i.__record__id__)&&this.getContent()}getContent(){var t,o,e,s,r;const a=new Map;for(const t in this.formViewField.props)a.set(t,this.formViewField.props[t]);const h={value:this.value,name:this.formViewField.name,currentEditor:this.builderFallback(this.formViewField),setValue:t=>this.setValue(t),getValue:this.getValue,record:this.selectedRecord,editorMetadata:{label:this.formViewField.label,hidden:!1===(null===(t=this.formViewField.props)||void 0===t?void 0:t.visible),userInterface:this.formViewField.userInterface,options:null===(o=this.formViewField.props)||void 0===o?void 0:o.options,props:this.formViewField.props?a:void 0,optionLoader:this.formViewField.optionLoader},source:c.FORM,detailContext:this.detailContext};let d=this.customEditor.getEditorElement(h);if(!d)return d=this.builderFallback(this.formViewField),this.handleValue(d),void(this.gui=d);if(!(d instanceof HTMLElement)&&"string"!=typeof d)return this.handleValue(d),void(this.gui=d);"string"==typeof d&&(d=l.parseElement(d));const b=null!==(r=null!==(s=null===(e=this.value)||void 0===e?void 0:e.value)&&void 0!==s?s:this.value)&&void 0!==r?r:"";d.setAttribute("value",b),this.gui=i("div",{key:n.generateUUID(),ref:t=>t&&t.appendChild(d)})}setValue(t){this.value=t}getValue(){return this.value}handleValue(t){var i;null===(i=t.t)||void 0===i||i.forEach((t=>{t.i.value=this.value}))}componentWillLoad(){this.getContent()}render(){return i(o,null,this.gui)}static get watchers(){return{value:["watchValue"],customEditor:["watchCustomEditor"],formViewField:["watchFormViewField"],detailContext:["watchDetailContext"],builderFallback:["watchBuilderFallback"],selectedRecord:["watchSelectedRecord"]}}},m=class{constructor(i){t(this,i),this.saveEdition=e(this,"saveEdition",7),this.cancelEdition=e(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var o,e;const s=null===(e=null===(o=this._inputElement)||void 0===o?void 0:o.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=s){const o=this.getWidthValue(t);s.style.width=o+"px",i&&setTimeout((()=>s.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const o=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+o:o}i.innerHTML=""}return 0}setStyledInput(){var t,i;let o="",e="",s="";null!=this.styled&&(o=this.styled.fontSize,e=this.styled.fontWeight,s=this.styled.fontFamily);const r=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=r&&(r.style.fontSize=o,r.style.fontWeight=e,r.style.fontFamily=s);const a=this._valueBasis;null!=a&&(a.style.fontSize=o,a.style.fontWeight=e,a.style.fontFamily=s)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):h.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return r.addIDInfoIfNotExists(this._element,"input"),i(o,null,i("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),i("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),i("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),i("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return s(this)}};m.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{d as ez_combo_box_list,b as ez_custom_form_input,m as ez_text_edit}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as a,H as t,g as i}from"./p-23a36bb6.js";import{ElementIDUtils as d}from"@sankhyalabs/core";var s;!function(e){e.EXTRA_LARGE="extra-large",e.LARGE="large",e.MEDIUM="medium",e.SMALL_MEDIUM="small-medium",e.SMALL="small",e.EXTRA_SMALL="extra-small"}(s||(s={}));const n=class{constructor(a){e(this,a),this._sizes={[s.EXTRA_LARGE]:{sufix:"xl"},[s.LARGE]:{sufix:"lg"},[s.MEDIUM]:{sufix:"md"},[s.SMALL_MEDIUM]:{sufix:"sm"},[s.SMALL]:{sufix:"xs"},[s.EXTRA_SMALL]:{sufix:"2xs"}},this.hasSlot=!1,this.size="small",this.label=void 0,this.iconLeft=void 0,this.iconRight=void 0,this.position={horizontal:"right",vertical:"top"}}getIconSize(){switch(this.size){case"large":return"large";case"medium":case"small-medium":return"small";case"small":return"x-small";default:return null}}componentDidLoad(){this._element&&d.addIDInfo(this._element),this._badge&&d.addIDInfo(this._badge,"ezBadge",{id:"embedded"})}handleSlotChange(){this.hasSlot=!0}validateIconLeft(){return this.iconLeft&&""!==this.iconLeft.trim()}validateIconRight(){return this.iconRight&&""!==this.iconRight.trim()}validateLabel(){return this.label&&""!==this.label.trim()}createContainerClassName(){let e=this._sizes[this.size].sufix,a=["badge__content"];return this.hasSlot&&(a.push("badge__content--fill-"+e),"bottom"==this.position.vertical&&"right"==this.position.horizontal&&a.push("badge__content--fill-bottom-right"),"bottom"==this.position.vertical&&"left"==this.position.horizontal&&a.push("badge__content--fill-bottom-left"),"top"==this.position.vertical&&"right"==this.position.horizontal&&a.push("badge__content--fill-top-right"),"top"==this.position.vertical&&"left"==this.position.horizontal&&a.push("badge__content--fill-top-left")),a.push(this.label?"badge__content--text-"+e:this.iconLeft||this.iconRight?"badge__content--icon-"+e:"badge__content--fill-"+e),a.join(" ")}render(){return a(t,null,a("div",{class:"badge"},a("div",null,a("slot",{name:"child-badge",onSlotchange:()=>{this.handleSlotChange()}})),a("div",{class:this.createContainerClassName(),ref:e=>this._badge=e},this.validateIconLeft()&&a("ez-icon",{class:"icon",iconName:this.iconLeft,size:this.getIconSize()}),this.validateLabel()&&a("label",{title:this.label},this.label),this.validateIconRight()&&a("ez-icon",{class:"icon",iconName:this.iconRight,size:this.getIconSize()}))))}get _element(){return i(this)}};n.style=":host{--ez-badge--size-2xs:var(--space--2xs, 8px);--ez-badge--size-xs:var(--space--xs, 12px);--ez-badge--size-sm:var(--space--sm, 16px);--ez-badge--size-md:var(--space--md, 20px);--ez-badge--size-lg:var(--space--lg, 24px);--ez-badge--size-xl:var(--space--xl, 32px);--ez-badge--padding-2xs:0;--ez-badge--padding-xs:var(--space--nano, 2px);--ez-badge--padding-sm:calc(var(--space--nano, 2px) + 1px);--ez-badge--padding-md:var(--space--3xs, 4px);--ez-badge--padding-lg:calc(var(--space--3xs, 4px) + 2px);--ez-badge--padding-xl:var(--space--2xs);--ez-badge--border-radius:calc(var(--border--radius-medium, 12px) + 8px);--ez-badge--font-family:var(--font-pattern, Roboto);--ez-badge--font-weight-medium:var(--text-weight--medium, 400);--ez-badge--background-color:var(--color--primary, #008561);--ez-badge--border-none:0;--ez-badge--color:var(--text--inverted, #ffffff);--ez-badge--gap:calc(var(--ez-badge--padding-xs) + 1px);--ez-badge--font-size-md:var(--text--medium);--ez-badge--font-size-sm:var(--text--medium);--ez-badge--font-size-xs:var(--text--small)}ez-icon{--ez-icon--color:inherit}.badge{display:flex;justify-content:center;align-items:center;position:relative}.badge__content{font-family:var(--ez-badge--font-family, Roboto);font-weight:var(--ez-badge--font-weight-medium, 400);background-color:var(--ez-badge--background-color, #008561);border:var(--ez-badge--border-none, 0);color:var(--ez-badge--color, #ffffff);border-radius:var(--ez-badge--border-radius, 20px);gap:var(--ez-badge--gap, 3px);display:flex;justify-content:center;align-items:center}.badge__content--fill-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px)}.badge__content--fill-2xs{height:var(--ez-badge--size-2xs, 8px);min-width:var(--ez-badge--size-2xs, 8px)}.badge__content--text-md{height:calc(var(--ez-badge--size-md, 20px) - 2px);min-width:var(--ez-badge--size-sm, 20px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-md)}.badge__content--text-sm{height:calc(var(--ez-badge--size-sm, 16px) - 2px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-sm)}.badge__content--text-xs{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-2xs);padding-bottom:var(--ez-badge--padding-2xs);padding-right:var(--ez-badge--padding-lg);padding-left:var(--ez-badge--padding-lg);font-size:var(--ez-badge--font-size-xs)}.badge__content--icon-lg{height:var(--ez-badge--size-lg, 24px);min-width:var(--ez-badge--size-lg, 24px);padding:var(--ez-badge--padding-md)}.badge__content--icon-md{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-md)}.badge__content--icon-sm{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-xs)}.badge__content--icon-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px);padding:var(--ez-badge--padding-xs)}.badge__content--fill{position:absolute;top:0;inset-inline-end:0;z-index:var(--most-visible, 2)}.badge__content--fill-top-right{transform:translate(50%, -50%);position:absolute;top:0;right:0}.badge__content--fill-top-left{transform:translate(-50%, -50%);position:absolute;top:0;left:0}.badge__content--fill-bottom-left{transform:translate(-50%, 50%);position:absolute;bottom:0;left:0}.badge__content--fill-bottom-right{transform:translate(50%, 50%);position:absolute;bottom:0;right:0}";export{n as ez_badge}
|