@sankhyalabs/ezui 6.4.0-dev.2 → 6.4.0-dev.3
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/{ApplicationUtils-6a76ac09.js → ApplicationUtils-e920876b.js} +1 -1
- package/dist/cjs/{app-globals-0a67e214.js → app-globals-cc9fa51a.js} +1 -1
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-avatar.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 → ez-card-item.cjs.entry.js} +0 -205
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js +324 -0
- package/dist/cjs/ez-classic-input.cjs.entry.js +26 -9
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +2 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
- 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-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +3 -3
- package/dist/cjs/ez-grid.cjs.entry.js +3 -3
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.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 +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-core.cjs.entry.js +211 -0
- package/dist/cjs/ez-search-plus.cjs.entry.js +2 -2
- package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +2 -2
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-sortable-list.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 +2 -2
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +12 -4
- package/dist/cjs/{index-425b1f67.js → index-a8b00749.js} +12 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{search-column-78dd20d5.js → search-column-ac3e37a1.js} +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css +99 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js +798 -0
- package/dist/collection/components/ez-classic-combo-box/interfaces/IOption.js +1 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css +29 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.js +42 -8
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +1 -1
- package/dist/collection/utils/i18n/locales/en-us.js +4 -0
- package/dist/collection/utils/i18n/locales/es-es.js +4 -0
- package/dist/collection/utils/i18n/locales/pt-br.js +4 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +360 -12
- package/dist/esm/{ApplicationUtils-1fd662ab.js → ApplicationUtils-70608555.js} +1 -1
- package/dist/esm/{app-globals-8a94d86c.js → app-globals-ba0c56ec.js} +1 -1
- package/dist/esm/ez-actions-button.entry.js +2 -2
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-avatar.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/{ez-card-item_2.entry.js → ez-card-item.entry.js} +1 -205
- package/dist/esm/ez-classic-combo-box.entry.js +320 -0
- package/dist/esm/ez-classic-input.entry.js +26 -9
- package/dist/esm/ez-collapsible-box.entry.js +2 -2
- package/dist/esm/ez-combo-box-list_4.entry.js +2 -2
- package/dist/esm/ez-combo-box.entry.js +2 -2
- 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-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +3 -3
- package/dist/esm/ez-grid.entry.js +3 -3
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list.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 +2 -2
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover-core.entry.js +207 -0
- package/dist/esm/ez-search-plus.entry.js +2 -2
- package/dist/esm/ez-search-result-list.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +2 -2
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-sortable-list.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-498e0126.js → index-5004bd27.js} +12 -0
- package/dist/esm/index-baa5e267.js +12 -4
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{search-column-729f3655.js → search-column-eadd8a51.js} +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-9dc31fc6.js → p-0e539c0f.js} +1 -1
- package/dist/ezui/{p-7e5c7b4c.js → p-0e6cbfc8.js} +1 -1
- package/dist/ezui/{p-e5e623d9.entry.js → p-0ff1bee4.entry.js} +1 -1
- package/dist/ezui/{p-31450a28.entry.js → p-25e71e8c.entry.js} +1 -1
- package/dist/ezui/{p-0c1a288c.entry.js → p-26e898c9.entry.js} +1 -1
- package/dist/ezui/{p-da4419a6.entry.js → p-2a265ae2.entry.js} +1 -1
- package/dist/ezui/{p-86b065e6.entry.js → p-314e3bfe.entry.js} +1 -1
- package/dist/ezui/{p-52d9b604.entry.js → p-35ca0988.entry.js} +1 -1
- package/dist/ezui/{p-2879c45f.entry.js → p-3b296bad.entry.js} +1 -1
- package/dist/ezui/p-3bf7f94b.entry.js +1 -0
- package/dist/ezui/{p-d512cb84.entry.js → p-4476b0ac.entry.js} +1 -1
- package/dist/ezui/{p-5dd12c80.entry.js → p-4638d099.entry.js} +1 -1
- package/dist/ezui/{p-1e21d31b.entry.js → p-47962426.entry.js} +1 -1
- package/dist/ezui/{p-24732fea.entry.js → p-47c7b561.entry.js} +1 -1
- package/dist/ezui/p-4c619e2d.js +1 -0
- package/dist/ezui/{p-5172793a.entry.js → p-50a2fa06.entry.js} +1 -1
- package/dist/ezui/{p-82fa431b.entry.js → p-59700a63.entry.js} +1 -1
- package/dist/ezui/{p-94630d41.entry.js → p-5ac4e99a.entry.js} +1 -1
- package/dist/ezui/{p-d845fa56.entry.js → p-5bdaa387.entry.js} +1 -1
- package/dist/ezui/{p-762a1033.entry.js → p-5bf5da85.entry.js} +1 -1
- package/dist/ezui/{p-39b16566.entry.js → p-69c1f7db.entry.js} +1 -1
- package/dist/ezui/{p-ec04285e.entry.js → p-6d3fa2dd.entry.js} +1 -1
- package/dist/ezui/{p-5ac7c4b3.entry.js → p-740b4ff5.entry.js} +1 -1
- package/dist/ezui/{p-66b00dec.entry.js → p-777b23fa.entry.js} +1 -1
- package/dist/ezui/{p-559b915a.entry.js → p-7999daa0.entry.js} +1 -1
- package/dist/ezui/{p-af47458b.js → p-8031e29e.js} +1 -1
- package/dist/ezui/{p-7aed8d32.entry.js → p-875d0bd2.entry.js} +1 -1
- package/dist/ezui/{p-3cecb4cb.entry.js → p-9adcab8a.entry.js} +1 -1
- package/dist/ezui/{p-bc22f56d.entry.js → p-9ae1f716.entry.js} +1 -1
- package/dist/ezui/p-9b2e6438.entry.js +1 -0
- package/dist/ezui/{p-4e6e0740.entry.js → p-9e35c475.entry.js} +1 -1
- package/dist/ezui/{p-57b40333.entry.js → p-a429a86c.entry.js} +1 -1
- package/dist/ezui/{p-5b9060ad.entry.js → p-ab52e931.entry.js} +1 -1
- package/dist/ezui/{p-60f5483c.entry.js → p-b1c4bbf2.entry.js} +1 -1
- package/dist/ezui/{p-e20ad35d.entry.js → p-b297d3f8.entry.js} +1 -1
- package/dist/ezui/{p-451a17ad.entry.js → p-b881cb64.entry.js} +1 -1
- package/dist/ezui/{p-3751da14.entry.js → p-b9158a92.entry.js} +1 -1
- package/dist/ezui/p-baf90704.entry.js +1 -0
- package/dist/ezui/p-d6f50207.entry.js +1 -0
- package/dist/ezui/{p-c2d38fbf.entry.js → p-db324ab1.entry.js} +1 -1
- package/dist/ezui/{p-4c5cb0da.entry.js → p-e1ee0b5a.entry.js} +1 -1
- package/dist/ezui/{p-02e1efa8.entry.js → p-f5ed1a75.entry.js} +1 -1
- package/dist/types/components/ez-classic-combo-box/ez-classic-combo-box.d.ts +115 -0
- package/dist/types/components/ez-classic-combo-box/interfaces/IOption.d.ts +4 -0
- package/dist/types/components/ez-classic-input/ez-classic-input.d.ts +7 -0
- package/dist/types/components.d.ts +199 -20
- package/dist/types/utils/i18n/locales/en-us.d.ts +4 -0
- package/dist/types/utils/i18n/locales/es-es.d.ts +4 -0
- package/dist/types/utils/i18n/locales/pt-br.d.ts +4 -0
- package/dist/types/utils/i18n/translations.d.ts +12 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-07819d50.js +0 -1
- package/dist/ezui/p-5e495d47.entry.js +0 -1
- package/dist/ezui/p-e78e87f5.entry.js +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { c as computePosition, f as flip, s as shift } from './floating-ui.dom.esm-5d3da819.js';
|
|
4
3
|
|
|
5
4
|
const ezCardItemCss = ":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--font-weight--semi-bold, 600);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--font-weight--semi-bold, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define a cor da fonte do valor do detalhe do componente.*/\n --ez-card-item__detail-value--color: var(--color--petroleum-500, #404E65);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: 0.95;\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item__detail-value--color);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs) var(--space--small);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
|
|
6
5
|
|
|
@@ -56,207 +55,4 @@ const EzCardItem = class {
|
|
|
56
55
|
};
|
|
57
56
|
EzCardItem.style = ezCardItemCss;
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const EzPopoverCore = class {
|
|
62
|
-
constructor(hostRef) {
|
|
63
|
-
registerInstance(this, hostRef);
|
|
64
|
-
this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
|
|
65
|
-
this.autoClose = true;
|
|
66
|
-
this.boxWidth = "fit-content";
|
|
67
|
-
this.opened = false;
|
|
68
|
-
this.overlayType = "light";
|
|
69
|
-
this.anchorElement = undefined;
|
|
70
|
-
this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
|
|
71
|
-
this.useAnchorSize = false;
|
|
72
|
-
this.minWidth = 150;
|
|
73
|
-
}
|
|
74
|
-
observeOpened(newValue, oldValue) {
|
|
75
|
-
if (newValue === oldValue) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (newValue) {
|
|
79
|
-
this.openPopover();
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this.hidePopover();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Atualiza a posição do popover.
|
|
87
|
-
*/
|
|
88
|
-
async updatePosition(top, left) {
|
|
89
|
-
this.updateOptionPosition(top, left);
|
|
90
|
-
await this.updatePositionPopover();
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Exibe o ez-popover.
|
|
94
|
-
*/
|
|
95
|
-
async show(top, left) {
|
|
96
|
-
this.updateOptionPosition(top, left);
|
|
97
|
-
this.opened = true;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Ancora a exibição do popOver a um elemento HTML.
|
|
101
|
-
*/
|
|
102
|
-
async showUnder(element, options) {
|
|
103
|
-
if (options) {
|
|
104
|
-
this.options = options;
|
|
105
|
-
}
|
|
106
|
-
this.anchorElement = element;
|
|
107
|
-
this.opened = true;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Oculta o ez-popover.
|
|
111
|
-
*/
|
|
112
|
-
async hide() {
|
|
113
|
-
this.opened = false;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Altera as opções.
|
|
117
|
-
*/
|
|
118
|
-
async setOptions(options) {
|
|
119
|
-
Object.assign(this.options, options);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Altera o elemento de ancoragem.
|
|
123
|
-
*/
|
|
124
|
-
async setAnchorElement(anchor) {
|
|
125
|
-
this.anchorElement = anchor;
|
|
126
|
-
}
|
|
127
|
-
parseSizePixel(sizePixel, defaultValue) {
|
|
128
|
-
if (!sizePixel) {
|
|
129
|
-
return defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0;
|
|
130
|
-
}
|
|
131
|
-
if (typeof sizePixel === "string") {
|
|
132
|
-
return Number(sizePixel.replace("px", ""));
|
|
133
|
-
}
|
|
134
|
-
return sizePixel !== null && sizePixel !== void 0 ? sizePixel : 0;
|
|
135
|
-
}
|
|
136
|
-
updateOptionPosition(top, left) {
|
|
137
|
-
Object.assign(this.options, {
|
|
138
|
-
horizontalGap: this.parseSizePixel(left, this.options.horizontalGap),
|
|
139
|
-
verticalGap: this.parseSizePixel(top, this.options.verticalGap),
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
getElement(element) {
|
|
143
|
-
if (typeof element === 'string') {
|
|
144
|
-
return document.getElementById(element);
|
|
145
|
-
}
|
|
146
|
-
return element;
|
|
147
|
-
}
|
|
148
|
-
getAnchorElement() {
|
|
149
|
-
if (!this.anchorElement) {
|
|
150
|
-
return this._host;
|
|
151
|
-
}
|
|
152
|
-
if (Array.isArray(this.anchorElement)) {
|
|
153
|
-
for (const element of this.anchorElement) {
|
|
154
|
-
const htmlElement = this.getElement(element);
|
|
155
|
-
if (htmlElement) {
|
|
156
|
-
return htmlElement;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return this._host;
|
|
160
|
-
}
|
|
161
|
-
return this.getElement(this.anchorElement);
|
|
162
|
-
}
|
|
163
|
-
async updatePositionPopover() {
|
|
164
|
-
if (!this._box || !this.opened) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const currentAnchorElement = this.getAnchorElement();
|
|
168
|
-
await computePosition(currentAnchorElement, this._box, {
|
|
169
|
-
placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
|
|
170
|
-
middleware: [flip(), shift({ padding: 5 })],
|
|
171
|
-
strategy: 'fixed',
|
|
172
|
-
}).then(({ x, y, placement }) => {
|
|
173
|
-
const newTop = placement.includes("bottom") ? y + this.options.verticalGap : y - this.options.verticalGap;
|
|
174
|
-
const newLeft = placement.includes("start") ? x + this.options.horizontalGap : x - this.options.horizontalGap;
|
|
175
|
-
Object.assign(this._box.style, {
|
|
176
|
-
top: `${newTop}px`,
|
|
177
|
-
left: `${newLeft}px`,
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
hidePopover() {
|
|
182
|
-
if (!this._box) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
this._box.style.display = '';
|
|
186
|
-
this.hideOverlay();
|
|
187
|
-
this.ezVisibilityChange.emit(false);
|
|
188
|
-
}
|
|
189
|
-
async openPopover() {
|
|
190
|
-
if (!this._box || !this.opened) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
this._box.style.display = 'flex';
|
|
194
|
-
this._box.style.visibility = 'hidden';
|
|
195
|
-
if (this.useAnchorSize) {
|
|
196
|
-
const currentAnchorElement = this.getAnchorElement();
|
|
197
|
-
const anchorSize = currentAnchorElement.getBoundingClientRect().width;
|
|
198
|
-
const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
|
|
199
|
-
this._box.style.width = `${width}px`;
|
|
200
|
-
}
|
|
201
|
-
await this.updatePositionPopover();
|
|
202
|
-
this.openOverlay();
|
|
203
|
-
this.ezVisibilityChange.emit(true);
|
|
204
|
-
this._box.style.visibility = 'visible';
|
|
205
|
-
}
|
|
206
|
-
openOverlay() {
|
|
207
|
-
if (!this._overlay || !this._overlayIsActive) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
this._overlay.style.display = 'block';
|
|
211
|
-
}
|
|
212
|
-
hideOverlay() {
|
|
213
|
-
if (!this._overlay) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
this._overlay.style.display = 'none';
|
|
217
|
-
}
|
|
218
|
-
checkStatusOverlay() {
|
|
219
|
-
if (this.overlayType !== "none") {
|
|
220
|
-
return true;
|
|
221
|
-
}
|
|
222
|
-
if (this.overlayType === "none" && this.autoClose) {
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
|
-
handlePositionUpdate() {
|
|
228
|
-
if (!this.opened) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
this.updatePositionPopover();
|
|
232
|
-
}
|
|
233
|
-
componentWillLoad() {
|
|
234
|
-
window.addEventListener('scroll', this.handlePositionUpdate.bind(this), true);
|
|
235
|
-
window.addEventListener('resize', this.handlePositionUpdate.bind(this), true);
|
|
236
|
-
}
|
|
237
|
-
componentDidLoad() {
|
|
238
|
-
this._overlayIsActive = this.checkStatusOverlay();
|
|
239
|
-
this._resizeObserver = new ResizeObserver(this.updatePositionPopover.bind(this));
|
|
240
|
-
this._resizeObserver.observe(this._box);
|
|
241
|
-
this.openPopover();
|
|
242
|
-
}
|
|
243
|
-
disconnectedCallback() {
|
|
244
|
-
window.removeEventListener('scroll', this.handlePositionUpdate.bind(this), true);
|
|
245
|
-
window.removeEventListener('resize', this.handlePositionUpdate.bind(this), true);
|
|
246
|
-
this._resizeObserver.disconnect();
|
|
247
|
-
}
|
|
248
|
-
render() {
|
|
249
|
-
return (h(Host, null, h("div", { ref: el => this._overlay = el, onClick: () => this.hide(), class: `popover__overlay popover__overlay--${this.overlayType}` }), h("section", { ref: el => this._box = el, class: {
|
|
250
|
-
"popover__box": true,
|
|
251
|
-
"popover__box--fit-content": this.boxWidth === "fit-content",
|
|
252
|
-
"popover__box--full-width": this.boxWidth !== "fit-content",
|
|
253
|
-
} }, h("slot", null))));
|
|
254
|
-
}
|
|
255
|
-
get _host() { return getElement(this); }
|
|
256
|
-
static get watchers() { return {
|
|
257
|
-
"opened": ["observeOpened"]
|
|
258
|
-
}; }
|
|
259
|
-
};
|
|
260
|
-
EzPopoverCore.style = ezPopoverCoreCss;
|
|
261
|
-
|
|
262
|
-
export { EzCardItem as ez_card_item, EzPopoverCore as ez_popover_core };
|
|
58
|
+
export { EzCardItem as ez_card_item };
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
|
|
2
|
+
import { ElementIDUtils, KeyboardManager } from '@sankhyalabs/core';
|
|
3
|
+
import { i as initI18n } from './index-5004bd27.js';
|
|
4
|
+
|
|
5
|
+
const ezClassicComboBoxCss = ":host{display:block;box-sizing:border-box;font-family:var(--font--pattern, 'Roboto', Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--gray-500, #494A4E);--ez-classic-combo-box-highlighted-bg-color:var(--color--gray-90, #EAEAEA);--ez-classic-combo-box-max-height:180px;--ez-classic-combo-box-list-bg-color:var(--color--gray-70, #FFFFFF);--ez-classic-combo-box-item-hover-bg-color:var(--color--gray-100, #DEDEDE);--ez-classic-combo-box-selected-bg-color:var(--color--ocean-green-90, #E6F3EF);--ez-classic-combo-box-selected-text-color:var(--color--ocean-green-600, #008561);--ez-classic-combo-box-selected-font-weight:var(--font-weight--medium, 500);--ez-classic-combo-box-item-padding:var(--space--8, 8px) var(--space--4, 4px);--ez-classic-combo-box-item-border-radius:var(--border--radius-8, 8px);--ez-classic-combo-box-list-margin:var(--space--6, 6px);--ez-classic-combo-box-transition-duration:150ms;--ez-classic-combo-box-scrollbar-color:var(--color--gray-300, #C4C4C4);--ez-classic-combo-box-no-results-margin:var(--space--52, 52px) 0;--ez-classic-combo-box-item-text-color:inherit;--ez-classic-combo-box-item-min-height:auto}ul{list-style:none;padding:0;margin:var(--ez-classic-combo-box-list-margin);display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--ez-classic-combo-box-scrollbar-color) transparent;max-height:var(--ez-classic-combo-box-max-height);scroll-behavior:smooth;background-color:var(--ez-classic-combo-box-list-bg-color)}li{cursor:pointer;border-radius:var(--ez-classic-combo-box-item-border-radius);padding:var(--ez-classic-combo-box-item-padding);transition:var(--ez-classic-combo-box-transition-duration) background-color linear;color:var(--ez-classic-combo-box-item-text-color);min-height:var(--ez-classic-combo-box-item-min-height)}li:hover{background-color:var(--ez-classic-combo-box-item-hover-bg-color)}li.highlighted{background-color:var(--ez-classic-combo-box-highlighted-bg-color)}li.selected{background-color:var(--ez-classic-combo-box-selected-bg-color);color:var(--ez-classic-combo-box-selected-text-color);font-weight:var(--ez-classic-combo-box-selected-font-weight)}span.no-results{margin:var(--ez-classic-combo-box-no-results-margin);cursor:default;text-align:center;display:flex;align-items:center;justify-content:center}";
|
|
6
|
+
|
|
7
|
+
const EzClassicComboBox = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
11
|
+
this.ezBlur = createEvent(this, "ezBlur", 7);
|
|
12
|
+
this.iconClick = createEvent(this, "iconClick", 7);
|
|
13
|
+
this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
|
|
14
|
+
this.ezType = createEvent(this, "ezType", 7);
|
|
15
|
+
this._keyboardManager = undefined;
|
|
16
|
+
this._boundHandleDocumentClick = this.handleDocumentClick.bind(this);
|
|
17
|
+
this.popoverVisible = false;
|
|
18
|
+
this.hasSlotContent = false;
|
|
19
|
+
this.highlightedIndex = 0;
|
|
20
|
+
this.filteredOptions = [];
|
|
21
|
+
this.inputValue = '';
|
|
22
|
+
this.value = null;
|
|
23
|
+
this.label = undefined;
|
|
24
|
+
this.placeholder = undefined;
|
|
25
|
+
this.enabled = true;
|
|
26
|
+
this.readonly = false;
|
|
27
|
+
this.name = undefined;
|
|
28
|
+
this.state = "default";
|
|
29
|
+
this.helpText = undefined;
|
|
30
|
+
this.iconName = undefined;
|
|
31
|
+
this.titleIcon = undefined;
|
|
32
|
+
this.iconClickable = false;
|
|
33
|
+
this.suppressSearch = false;
|
|
34
|
+
this.options = undefined;
|
|
35
|
+
this.textEmptyOption = undefined;
|
|
36
|
+
this.suppressEmptyOption = false;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Aplica o foco no campo.
|
|
40
|
+
*/
|
|
41
|
+
async setFocus(option) {
|
|
42
|
+
var _a;
|
|
43
|
+
await ((_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.setFocus(option));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Remove o foco do campo.
|
|
47
|
+
*/
|
|
48
|
+
async setBlur() {
|
|
49
|
+
var _a;
|
|
50
|
+
await ((_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.setBlur());
|
|
51
|
+
await this.hidePopover();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Exibe o popover abaixo do input.
|
|
55
|
+
*/
|
|
56
|
+
async showPopover() {
|
|
57
|
+
var _a, _b, _c;
|
|
58
|
+
if (!this._popoverElem || !this._inputElem || this.popoverVisible) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.popoverVisible = true;
|
|
62
|
+
const inputContainer = (_b = (_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.input-container');
|
|
63
|
+
await ((_c = this._popoverElem) === null || _c === void 0 ? void 0 : _c.showUnder(inputContainer !== null && inputContainer !== void 0 ? inputContainer : this._inputElem));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Oculta o popover.
|
|
67
|
+
*/
|
|
68
|
+
async hidePopover() {
|
|
69
|
+
var _a;
|
|
70
|
+
this.popoverVisible = false;
|
|
71
|
+
await ((_a = this._popoverElem) === null || _a === void 0 ? void 0 : _a.hide());
|
|
72
|
+
}
|
|
73
|
+
compareOptionValues(option1, option2) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return JSON.stringify((_a = option1 === null || option1 === void 0 ? void 0 : option1.value) !== null && _a !== void 0 ? _a : null) === JSON.stringify((_b = option2 === null || option2 === void 0 ? void 0 : option2.value) !== null && _b !== void 0 ? _b : null);
|
|
76
|
+
}
|
|
77
|
+
setEmptyValue() {
|
|
78
|
+
this.value = null;
|
|
79
|
+
this.inputValue = '';
|
|
80
|
+
}
|
|
81
|
+
async setValue(option) {
|
|
82
|
+
if (!option || !this.options) {
|
|
83
|
+
this.setEmptyValue();
|
|
84
|
+
await this.hidePopover();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (this.compareOptionValues(this.value, option)) {
|
|
88
|
+
await this.hidePopover();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (!option.value) {
|
|
92
|
+
this.setEmptyValue();
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.value = option;
|
|
96
|
+
this.inputValue = option.label;
|
|
97
|
+
}
|
|
98
|
+
this.ezChange.emit(this.value);
|
|
99
|
+
await this.hidePopover();
|
|
100
|
+
}
|
|
101
|
+
async optionsChanged() {
|
|
102
|
+
this.filterOptions('');
|
|
103
|
+
}
|
|
104
|
+
async valueChanged(newValue) {
|
|
105
|
+
if (newValue) {
|
|
106
|
+
this.inputValue = newValue.label;
|
|
107
|
+
this.setHighlightedIndexToValue();
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.inputValue = '';
|
|
111
|
+
this.highlightedIndex = 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async handleIconClick(event) {
|
|
115
|
+
event.stopPropagation();
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
if (event.detail.icon === 'right') {
|
|
118
|
+
if (!this.popoverVisible) {
|
|
119
|
+
await this.showPopover();
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
await this.hidePopover();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.iconClick.emit();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async handleEzChange(event) {
|
|
130
|
+
event.stopPropagation();
|
|
131
|
+
this.inputValue = event.detail;
|
|
132
|
+
if (!this.popoverVisible && this.inputValue.length > 0) {
|
|
133
|
+
await this.showPopover();
|
|
134
|
+
}
|
|
135
|
+
this.ezType.emit(this.inputValue);
|
|
136
|
+
this.highlightedIndex = 0;
|
|
137
|
+
this.filterOptions(this.inputValue);
|
|
138
|
+
}
|
|
139
|
+
async handleEzBlur(event) {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
event.stopPropagation();
|
|
142
|
+
if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.label) !== this.inputValue) {
|
|
143
|
+
this.inputValue = ((_b = this.value) === null || _b === void 0 ? void 0 : _b.label) || '';
|
|
144
|
+
}
|
|
145
|
+
this.ezBlur.emit(this.value);
|
|
146
|
+
}
|
|
147
|
+
filterOptions(searchTerm) {
|
|
148
|
+
if (!this.options) {
|
|
149
|
+
this.filteredOptions = [];
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
let currentOptions = [];
|
|
153
|
+
if (!searchTerm || searchTerm.trim() === '') {
|
|
154
|
+
currentOptions = currentOptions.concat([...this.options]);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
const term = searchTerm.toLowerCase().trim();
|
|
158
|
+
currentOptions = currentOptions.concat(this.options.filter(option => option.label.toLowerCase().includes(term) ||
|
|
159
|
+
option.value.toLowerCase().includes(term)));
|
|
160
|
+
}
|
|
161
|
+
if (!this.suppressEmptyOption && currentOptions.length > 0) {
|
|
162
|
+
currentOptions = [
|
|
163
|
+
{
|
|
164
|
+
value: null,
|
|
165
|
+
label: this.textEmptyOption || this.i18n('ez-classic-combo-box.emptyOption')
|
|
166
|
+
},
|
|
167
|
+
...currentOptions
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
this.filteredOptions = currentOptions;
|
|
171
|
+
this.setHighlightedIndexToValue();
|
|
172
|
+
this.scrollToHighlightedOption();
|
|
173
|
+
}
|
|
174
|
+
scrollToHighlightedOption() {
|
|
175
|
+
if (this.highlightedIndex < 0 || !this._listElem) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const highlightedOption = this._listElem.children[this.highlightedIndex];
|
|
179
|
+
if (highlightedOption) {
|
|
180
|
+
highlightedOption.scrollIntoView({
|
|
181
|
+
behavior: 'smooth',
|
|
182
|
+
block: 'nearest',
|
|
183
|
+
inline: 'start'
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async selectOption(option) {
|
|
188
|
+
if (!option || this.readonly || !this.enabled) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
await this.setValue(option);
|
|
192
|
+
}
|
|
193
|
+
async handleArrowUp() {
|
|
194
|
+
var _a;
|
|
195
|
+
if (!this.popoverVisible) {
|
|
196
|
+
await this.showPopover();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const optionsLength = ((_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
200
|
+
if (optionsLength <= 0 || this.highlightedIndex <= 0) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.highlightedIndex = Math.max(0, this.highlightedIndex - 1);
|
|
204
|
+
this.scrollToHighlightedOption();
|
|
205
|
+
}
|
|
206
|
+
handleArrowDown() {
|
|
207
|
+
var _a;
|
|
208
|
+
if (!this.popoverVisible) {
|
|
209
|
+
this.showPopover();
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const optionsLength = ((_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
213
|
+
if (optionsLength <= 0) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.highlightedIndex = Math.min(optionsLength - 1, this.highlightedIndex + 1);
|
|
217
|
+
this.scrollToHighlightedOption();
|
|
218
|
+
}
|
|
219
|
+
async selectCurrentItem() {
|
|
220
|
+
if (!this.popoverVisible || this.highlightedIndex < 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (this.hasSlotContent || this.filteredOptions.length === 0 || this.readonly || !this.enabled) {
|
|
224
|
+
await this.hidePopover();
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (this.filteredOptions && this.filteredOptions[this.highlightedIndex]) {
|
|
228
|
+
this.selectOption(this.filteredOptions[this.highlightedIndex]);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
handleVisibilityChange(event) {
|
|
232
|
+
this.popoverVisible = event.detail;
|
|
233
|
+
this.ezVisibilityChange.emit(this.popoverVisible);
|
|
234
|
+
}
|
|
235
|
+
checkSlotContent() {
|
|
236
|
+
const slot = this._element.querySelector('slot') || this._element;
|
|
237
|
+
if (slot instanceof HTMLSlotElement) {
|
|
238
|
+
this.hasSlotContent = slot.assignedNodes().length > 0;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
this.hasSlotContent = slot.children.length > 0;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
setHighlightedIndexToValue() {
|
|
245
|
+
if (this.value && this.filteredOptions) {
|
|
246
|
+
const index = this.filteredOptions.findIndex(opt => opt.value === this.value.value);
|
|
247
|
+
if (index >= 0) {
|
|
248
|
+
this.highlightedIndex = index;
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this.highlightedIndex = 0;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async handleDocumentClick(event) {
|
|
255
|
+
const target = event.target;
|
|
256
|
+
if (!this._element.contains(target) && !this._popoverElem.contains(target)) {
|
|
257
|
+
await this.hidePopover();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
addInfoId() {
|
|
261
|
+
const dataInfo = { id: 'embedded' };
|
|
262
|
+
if (this._element) {
|
|
263
|
+
ElementIDUtils.addIDInfo(this._element);
|
|
264
|
+
}
|
|
265
|
+
if (this._inputElem) {
|
|
266
|
+
ElementIDUtils.addIDInfo(this._inputElem, 'classic-combo-box-input', dataInfo);
|
|
267
|
+
}
|
|
268
|
+
if (this._popoverElem) {
|
|
269
|
+
ElementIDUtils.addIDInfo(this._popoverElem, 'classic-combo-box-popover', dataInfo);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
async initKeyboardManager() {
|
|
273
|
+
this._keyboardManager = new KeyboardManager({ element: this._element, propagate: true });
|
|
274
|
+
this._keyboardManager
|
|
275
|
+
.bind("ArrowUp", () => this.handleArrowUp(), { propagate: false })
|
|
276
|
+
.bind("ArrowDown", () => this.handleArrowDown(), { propagate: false })
|
|
277
|
+
.bind("Enter", () => this.selectCurrentItem(), { propagate: false })
|
|
278
|
+
.bind("Tab", () => this.selectCurrentItem())
|
|
279
|
+
.bind("shift+Tab", () => this.selectCurrentItem())
|
|
280
|
+
.bind("Escape", () => this.hidePopover());
|
|
281
|
+
}
|
|
282
|
+
async connectedCallback() {
|
|
283
|
+
this.i18n = await initI18n();
|
|
284
|
+
await this.initKeyboardManager();
|
|
285
|
+
document.addEventListener('mouseup', this._boundHandleDocumentClick);
|
|
286
|
+
}
|
|
287
|
+
disconnectedCallback() {
|
|
288
|
+
this._keyboardManager.unbindAllShortcutKeys();
|
|
289
|
+
document.removeEventListener('mouseup', this._boundHandleDocumentClick);
|
|
290
|
+
}
|
|
291
|
+
componentWillLoad() {
|
|
292
|
+
this.filterOptions('');
|
|
293
|
+
}
|
|
294
|
+
componentDidLoad() {
|
|
295
|
+
this.addInfoId();
|
|
296
|
+
this.checkSlotContent();
|
|
297
|
+
if (this.value) {
|
|
298
|
+
this.inputValue = this.value.label;
|
|
299
|
+
this.setHighlightedIndexToValue();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
render() {
|
|
303
|
+
var _a;
|
|
304
|
+
return (h(Host, null, h("ez-classic-input", { ref: ref => this._inputElem = ref, name: this.name, label: this.label, placeholder: this.placeholder, value: this.inputValue, state: this.state, enabled: this.enabled, readonly: this.readonly || this.suppressSearch, leftIconName: this.iconName, leftIconTooltip: this.titleIcon, leftIconClickable: this.iconClickable, rightIconClickable: true, helpText: this.helpText, rightIconName: this.popoverVisible ? 'angle-up' : 'angle-down', onIconClick: this.handleIconClick.bind(this), onEzChange: this.handleEzChange.bind(this), onEzFocus: this.showPopover.bind(this), onEzBlur: this.handleEzBlur.bind(this) }), h("ez-popover-core", { ref: ref => this._popoverElem = ref, useAnchorSize: true, onEzVisibilityChange: this.handleVisibilityChange.bind(this), overlayType: "none", options: { verticalGap: 2, horizontalGap: 0 }, autoClose: false }, h("slot", { onSlotchange: this.checkSlotContent.bind(this) }), !this.hasSlotContent && (((_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) > 0 ? (h("ul", { ref: ref => this._listElem = ref, tabIndex: -1 }, this.filteredOptions.map((option, index) => {
|
|
305
|
+
var _a, _b;
|
|
306
|
+
return (h("li", { key: (_a = option.value) !== null && _a !== void 0 ? _a : '__empty__', value: option.value, class: {
|
|
307
|
+
'highlighted': this.highlightedIndex === index,
|
|
308
|
+
'selected': ((_b = this.value) === null || _b === void 0 ? void 0 : _b.value) === option.value
|
|
309
|
+
}, onMouseDown: () => this.selectOption(option) }, option.label));
|
|
310
|
+
}))) : (h("span", { class: "no-results" }, this.i18n('ez-classic-combo-box.noResults')))))));
|
|
311
|
+
}
|
|
312
|
+
get _element() { return getElement(this); }
|
|
313
|
+
static get watchers() { return {
|
|
314
|
+
"options": ["optionsChanged"],
|
|
315
|
+
"value": ["valueChanged"]
|
|
316
|
+
}; }
|
|
317
|
+
};
|
|
318
|
+
EzClassicComboBox.style = ezClassicComboBoxCss;
|
|
319
|
+
|
|
320
|
+
export { EzClassicComboBox as ez_classic_combo_box };
|
|
@@ -196,14 +196,16 @@ class MaskFormatter {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
const ezClassicInputCss = ":host{display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);border:none;padding:0;--ez-classic-input--label-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--border-color-default:var(--color--gray-200, #D2D2D3);--ez-classic-input--border-color-focus:var(--color--gray-300, #A4A5A7);--ez-classic-input--border-color-success:var(--color--green-600, #157A00);--ez-classic-input--border-color-error:var(--color--red-600, #BD0025);--ez-classic-input--border-color-warning:var(--color--yellow-600, #EFB103);--ez-classic-input--background-color:var(--color--gray-70, #FFFFFF);--ez-classic-input--background-color-disabled:var(--color--gray-90, #EAEAEA);--ez-classic-input--text-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--placeholder-color:#bdbdbd;--ez-classic-input--icon-color:var(--color--gray-400, #77777A);--ez-classic-input--helptext-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--height:56px}.input-container{display:flex;flex-direction:row;align-items:center;width:100%;border:none;border-radius:var(--border--radius-8, 8px);padding:var(--space--16, 16px);box-sizing:border-box;gap:var(--space--10, 10px);margin:var(--space--4, 4px) var(--space--2, 2px);transition:box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);height:var(--ez-classic-input--height);background-color:var(--ez-classic-input--background-color)}.input-container,.input-container[data-state=\"default\"]{box-shadow:0 0 0 1px var(--ez-classic-input--border-color-default)}.input-container[data-state=\"success\"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-success)}.input-container[data-state=\"error\"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-error)}.input-container[data-state=\"warning\"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-warning)}.input-container:focus-within{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-focus)}ez-icon{min-width:var(--space--24, 24px);color:var(--ez-classic-input--icon-color)}input{flex:1;border:none;outline:none;background:transparent;height:100%;width:100%;padding:0;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);text-overflow:ellipsis;color:var(--ez-classic-input--text-color)}input::placeholder{color:var(--ez-classic-input--placeholder-color)}.input-container[data-disabled=\"true\"]{cursor:not-allowed;background:var(--ez-classic-input--background-color-disabled);border-color:var(--ez-classic-input--border-color-default)}.input-container[data-disabled=\"true\"]>*{cursor:not-allowed}@keyframes ez-helptext-fadein{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-classic-input--helptext-color)}label{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--line-height--20, 20px);color:var(--ez-classic-input--label-color)}.icon-clickable{cursor:pointer}";
|
|
199
|
+
const ezClassicInputCss = ":host{display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);border:none;padding:0;--ez-classic-input--label-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--border-color-default:var(--color--gray-200, #D2D2D3);--ez-classic-input--border-color-focus:var(--color--gray-300, #A4A5A7);--ez-classic-input--border-color-success:var(--color--green-600, #157A00);--ez-classic-input--border-color-error:var(--color--red-600, #BD0025);--ez-classic-input--border-color-warning:var(--color--yellow-600, #EFB103);--ez-classic-input--background-color:var(--color--gray-70, #FFFFFF);--ez-classic-input--background-color-disabled:var(--color--gray-90, #EAEAEA);--ez-classic-input--text-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--placeholder-color:#bdbdbd;--ez-classic-input--icon-color:var(--color--gray-400, #77777A);--ez-classic-input--helptext-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--height:56px}.input-container{display:flex;flex-direction:row;align-items:center;width:100%;border:none;border-radius:var(--border--radius-8, 8px);padding:var(--space--16, 16px);box-sizing:border-box;gap:var(--space--10, 10px);margin:var(--space--4, 4px) var(--space--2, 2px);transition:box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);height:var(--ez-classic-input--height);background-color:var(--ez-classic-input--background-color)}.input-container,.input-container[data-state=\"default\"]{box-shadow:0 0 0 1px var(--ez-classic-input--border-color-default)}.input-container[data-state=\"success\"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-success)}.input-container[data-state=\"error\"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-error)}.input-container[data-state=\"warning\"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-warning)}.input-container:focus-within{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-focus)}ez-icon{min-width:var(--space--24, 24px);color:var(--ez-classic-input--icon-color)}input{flex:1;border:none;outline:none;background:transparent;height:100%;width:100%;padding:0;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);text-overflow:ellipsis;color:var(--ez-classic-input--text-color)}input::placeholder{color:var(--ez-classic-input--placeholder-color)}.input-container[data-disabled=\"true\"]{cursor:not-allowed;background:var(--ez-classic-input--background-color-disabled);border-color:var(--ez-classic-input--border-color-default)}.input-container[data-disabled=\"true\"]>*{cursor:not-allowed}.input-container input:read-only{cursor:default}@keyframes ez-helptext-fadein{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-classic-input--helptext-color)}label{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--line-height--20, 20px);color:var(--ez-classic-input--label-color)}.icon-clickable{cursor:pointer}";
|
|
200
200
|
|
|
201
201
|
const EzClassicInput = class {
|
|
202
202
|
constructor(hostRef) {
|
|
203
203
|
registerInstance(this, hostRef);
|
|
204
204
|
this.ezChange = createEvent(this, "ezChange", 7);
|
|
205
205
|
this.ezBlur = createEvent(this, "ezBlur", 7);
|
|
206
|
+
this.ezFocus = createEvent(this, "ezFocus", 7);
|
|
206
207
|
this.iconClick = createEvent(this, "iconClick", 7);
|
|
208
|
+
this._internalValueChange = false;
|
|
207
209
|
this.type = 'text';
|
|
208
210
|
this.value = undefined;
|
|
209
211
|
this.label = undefined;
|
|
@@ -242,6 +244,19 @@ const EzClassicInput = class {
|
|
|
242
244
|
async setBlur() {
|
|
243
245
|
this._inputElem.blur();
|
|
244
246
|
}
|
|
247
|
+
async syncValue() {
|
|
248
|
+
if (this._internalValueChange) {
|
|
249
|
+
this._internalValueChange = false;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (this.value && this._maskFormatter && this._inputElem) {
|
|
253
|
+
const formattedValue = this._maskFormatter.format(this.value);
|
|
254
|
+
this._inputElem.value = formattedValue;
|
|
255
|
+
}
|
|
256
|
+
else if (this._inputElem) {
|
|
257
|
+
this._inputElem.value = this.value || '';
|
|
258
|
+
}
|
|
259
|
+
}
|
|
245
260
|
onInput(event) {
|
|
246
261
|
try {
|
|
247
262
|
const inputElement = event.target;
|
|
@@ -250,11 +265,13 @@ const EzClassicInput = class {
|
|
|
250
265
|
const formattedValue = this._maskFormatter.format(inputValue);
|
|
251
266
|
const cleanValue = this._maskFormatter.removeMask(formattedValue);
|
|
252
267
|
inputElement.value = formattedValue;
|
|
268
|
+
this._internalValueChange = true;
|
|
253
269
|
this.value = cleanValue;
|
|
254
270
|
const emitValue = this.emitMaskedValue ? formattedValue : cleanValue;
|
|
255
271
|
this.ezChange.emit(emitValue);
|
|
256
272
|
}
|
|
257
273
|
else {
|
|
274
|
+
this._internalValueChange = true;
|
|
258
275
|
this.value = inputValue;
|
|
259
276
|
this.ezChange.emit(inputValue);
|
|
260
277
|
}
|
|
@@ -266,6 +283,9 @@ const EzClassicInput = class {
|
|
|
266
283
|
onBlur() {
|
|
267
284
|
this.ezBlur.emit(this.value);
|
|
268
285
|
}
|
|
286
|
+
onFocus() {
|
|
287
|
+
this.ezFocus.emit(this.value);
|
|
288
|
+
}
|
|
269
289
|
handleIconClick(event, icon) {
|
|
270
290
|
if (!this.enabled) {
|
|
271
291
|
return;
|
|
@@ -295,19 +315,16 @@ const EzClassicInput = class {
|
|
|
295
315
|
}
|
|
296
316
|
}
|
|
297
317
|
componentDidLoad() {
|
|
298
|
-
|
|
299
|
-
const formattedValue = this._maskFormatter.format(this.value);
|
|
300
|
-
this._inputElem.value = formattedValue;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
this._inputElem.value = this.value || '';
|
|
304
|
-
}
|
|
318
|
+
this.syncValue();
|
|
305
319
|
this.addInfoId();
|
|
306
320
|
}
|
|
307
321
|
render() {
|
|
308
|
-
return (h(Host, null, h("label", { title: this.label, htmlFor: this.name }, this.label), h("div", { class: "input-container", "data-state": this.state, "data-disabled": (!this.enabled).toString(), onClick: () => this.setFocus({ preventScroll: true }) }, this.leftIconName && (h("ez-icon", { iconName: this.leftIconName, title: this.leftIconTooltip, onClick: (event) => this.handleIconClick(event, "left"), class: { 'icon-clickable': this.leftIconClickable } })), h("input", { ref: el => this._inputElem = el, id: this.name, type: this.type, title: this.value, placeholder: this.placeholder, disabled: !this.enabled, readonly: this.readonly, name: this.name, minlength: this.minlength, maxlength: this.maxlength, onInput: this.onInput.bind(this),
|
|
322
|
+
return (h(Host, null, h("label", { title: this.label, htmlFor: this.name }, this.label), h("div", { class: "input-container", "data-state": this.state, "data-disabled": (!this.enabled).toString(), onClick: () => this.setFocus({ preventScroll: true }) }, this.leftIconName && (h("ez-icon", { iconName: this.leftIconName, title: this.leftIconTooltip, onClick: (event) => this.handleIconClick(event, "left"), class: { 'icon-clickable': this.leftIconClickable } })), h("input", { ref: el => this._inputElem = el, id: this.name, type: this.type, title: this.value, placeholder: this.placeholder, disabled: !this.enabled, readonly: this.readonly, name: this.name, minlength: this.minlength, maxlength: this.maxlength, onInput: (event) => this.onInput(event), onBlur: this.onBlur.bind(this), onFocus: this.onFocus.bind(this) }), this.rightIconName && (h("ez-icon", { iconName: this.rightIconName, title: this.rightIconTooltip, onClick: (event) => this.handleIconClick(event, "right"), class: { 'icon-clickable': this.rightIconClickable } }))), this.helpText && (h("span", { title: this.helpText }, this.helpText))));
|
|
309
323
|
}
|
|
310
324
|
get _element() { return getElement(this); }
|
|
325
|
+
static get watchers() { return {
|
|
326
|
+
"value": ["syncValue"]
|
|
327
|
+
}; }
|
|
311
328
|
};
|
|
312
329
|
EzClassicInput.style = ezClassicInputCss;
|
|
313
330
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-baa5e267.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { A as ApplicationUtils } from './ApplicationUtils-
|
|
3
|
+
import { A as ApplicationUtils } from './ApplicationUtils-70608555.js';
|
|
4
4
|
import './DialogType-54a62731.js';
|
|
5
5
|
import './CheckMode-bdb2ec19.js';
|
|
6
|
-
import { i as initI18n } from './index-
|
|
6
|
+
import { i as initI18n } from './index-5004bd27.js';
|
|
7
7
|
import './FormLayout-071d324c.js';
|
|
8
8
|
|
|
9
9
|
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--subtitle--font-size:var(--text--medium, 14px);--ez-collapsible-box--subtitle--font-family:var(--font-pattern, 'Roboto');--ez-collapsible-box--subtitle--font-weight:var(--text-weight--medium, 400);--ez-collapsible-box--subtitle--color:var(--text--primary);--ez-collapsible-box--subtitle--margin-bottom:var(--space--medium, 12px);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%;overflow:hidden}.collapsable-box--bordered{border:var(--border--small);border-color:var(--color--strokes);border-radius:var(--border--radius-medium);padding:var(--space--xs)}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:100%;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.subtitle-box__label{display:flex;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;font-family:var(--ez-collapsible-box--subtitle--font-family);font-size:var(--ez-collapsible-box--subtitle--font-size);font-weight:var(--ez-collapsible-box--subtitle--font-weight);color:var(--ez-collapsible-box--subtitle--color);margin-bottom:var(--ez-collapsible-box--subtitle--margin-bottom)}.subtitle-box__content{width:100%}.collapsible-box__label ez-icon{visibility:hidden;transition:2s all ease-in-out}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--left{margin-right:auto}.collapsible-box__title--right{margin-left:auto}.collapsible-box__title--center{margin-left:auto;margin-right:auto}.collapsible-box__title--stretch{justify-content:space-between;width:100%}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
|