@sankhyalabs/ezui 5.20.0-dev.2 → 5.20.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/dist/cjs/ez-alert-list.cjs.entry.js +33 -28
- package/dist/cjs/ez-card-item.cjs.entry.js +52 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +155 -11
- package/dist/cjs/ez-filter-input_2.cjs.entry.js +137 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +4 -2
- package/dist/cjs/ez-grid.cjs.entry.js +3 -3
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +31 -611
- package/dist/cjs/ez-split-panel.cjs.entry.js +3 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +6 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +33 -28
- package/dist/collection/components/ez-card-item/ez-card-item.css +0 -16
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +173 -12
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
- package/dist/collection/components/ez-grid/ez-grid.css +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +2 -2
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-search/ez-search.css +0 -330
- package/dist/collection/components/ez-search/ez-search.js +55 -689
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +7 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +19 -1
- package/dist/custom-elements/index.js +240 -665
- package/dist/esm/ez-alert-list.entry.js +33 -28
- package/dist/esm/ez-card-item.entry.js +48 -0
- package/dist/esm/ez-combo-box.entry.js +156 -12
- package/dist/esm/ez-filter-input_2.entry.js +132 -0
- package/dist/esm/ez-form-view.entry.js +4 -2
- package/dist/esm/ez-grid.entry.js +3 -3
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +33 -613
- package/dist/esm/ez-split-panel.entry.js +3 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-05f5a778.entry.js +1 -0
- package/dist/ezui/p-13dbad96.entry.js +1 -0
- package/dist/ezui/p-5613fe63.entry.js +1 -0
- package/dist/ezui/p-60848ef6.entry.js +1 -0
- package/dist/ezui/{p-6e2f8e6b.entry.js → p-844ee673.entry.js} +1 -1
- package/dist/ezui/{p-f56dd1da.entry.js → p-93c3df4f.entry.js} +1 -1
- package/dist/ezui/p-940ed30b.entry.js +1 -0
- package/dist/ezui/p-a32aaac6.entry.js +1 -0
- package/dist/ezui/p-a5ac7151.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -0
- package/dist/types/components/ez-search/ez-search.d.ts +10 -100
- package/dist/types/components.d.ts +22 -23
- package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +1 -2
- package/package.json +16 -8
- package/dist/cjs/ez-card-item_3.cjs.entry.js +0 -182
- package/dist/esm/ez-card-item_3.entry.js +0 -176
- package/dist/ezui/p-133fae4a.entry.js +0 -1
- package/dist/ezui/p-43b03119.entry.js +0 -1
- package/dist/ezui/p-4a7f113d.entry.js +0 -1
- package/dist/ezui/p-76ba9d67.entry.js +0 -1
- package/dist/ezui/p-796c1a88.entry.js +0 -1
- package/dist/ezui/p-ba875f37.entry.js +0 -1
|
@@ -1171,11 +1171,13 @@ const EzAlertList$1 = class extends HTMLElement$1 {
|
|
|
1171
1171
|
/**
|
|
1172
1172
|
* Gerencia a exibição do overlay usando FloatingManager do Core.
|
|
1173
1173
|
*/
|
|
1174
|
-
|
|
1175
|
-
if (this.opened) {
|
|
1174
|
+
manageOverlay() {
|
|
1175
|
+
if (this.opened && this._container) {
|
|
1176
1176
|
this._overlayId = FloatingManager.float(this._container, this._overlayRef, this.getFloatOptions());
|
|
1177
1177
|
}
|
|
1178
1178
|
else {
|
|
1179
|
+
if (this._overlayId === undefined)
|
|
1180
|
+
return;
|
|
1179
1181
|
FloatingManager.close(this._overlayId);
|
|
1180
1182
|
this._overlayId = undefined;
|
|
1181
1183
|
}
|
|
@@ -1184,8 +1186,10 @@ const EzAlertList$1 = class extends HTMLElement$1 {
|
|
|
1184
1186
|
* Atualiza a posição da lista.
|
|
1185
1187
|
*/
|
|
1186
1188
|
updatePosition(right, bottom) {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
+
if (this.opened) {
|
|
1190
|
+
FloatingManager.updateFloatPosition(this._container, this._overlayRef, Object.assign(Object.assign({}, this.getFloatOptions()), { right,
|
|
1191
|
+
bottom }));
|
|
1192
|
+
}
|
|
1189
1193
|
}
|
|
1190
1194
|
;
|
|
1191
1195
|
/**
|
|
@@ -1194,7 +1198,7 @@ const EzAlertList$1 = class extends HTMLElement$1 {
|
|
|
1194
1198
|
getFloatOptions() {
|
|
1195
1199
|
return {
|
|
1196
1200
|
autoClose: false,
|
|
1197
|
-
isFixed:
|
|
1201
|
+
isFixed: true,
|
|
1198
1202
|
bottom: '10px',
|
|
1199
1203
|
right: '10px',
|
|
1200
1204
|
};
|
|
@@ -1216,9 +1220,9 @@ const EzAlertList$1 = class extends HTMLElement$1 {
|
|
|
1216
1220
|
const boxHeight = this._container.getBoundingClientRect().height;
|
|
1217
1221
|
return ((docHeight - boxHeight) / 2) + 'px';
|
|
1218
1222
|
}
|
|
1219
|
-
|
|
1223
|
+
componentDidLoad() {
|
|
1220
1224
|
this.manageOverlay();
|
|
1221
|
-
if (this.opened) {
|
|
1225
|
+
if (this.opened && this._container) {
|
|
1222
1226
|
this._container.focus();
|
|
1223
1227
|
}
|
|
1224
1228
|
}
|
|
@@ -1226,27 +1230,28 @@ const EzAlertList$1 = class extends HTMLElement$1 {
|
|
|
1226
1230
|
this.dataElementId = ElementIDUtils.addIDInfo(this._element, 'EzAlertList');
|
|
1227
1231
|
}
|
|
1228
1232
|
render() {
|
|
1229
|
-
return (h(Host, Object.assign({}, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: this.dataElementId }),
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1233
|
+
return (h(Host, Object.assign({}, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: this.dataElementId }), this.opened ?
|
|
1234
|
+
(h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
|
|
1235
|
+
this.opened = false;
|
|
1236
|
+
}, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
|
|
1237
|
+
return (h("a", { href: "#", style: {
|
|
1238
|
+
fontFamily: "var(--font-pattern, 'Roboto')",
|
|
1239
|
+
fontSize: 'var(--text--medium, 14px)',
|
|
1240
|
+
fontWeight: 'var(--text-weight--medium, 400)',
|
|
1241
|
+
color: 'var(--color--primary, #008561)',
|
|
1242
|
+
marginRight: '4px',
|
|
1243
|
+
cursor: 'pointer',
|
|
1244
|
+
display: 'flex',
|
|
1245
|
+
width: 'max-content',
|
|
1246
|
+
textDecoration: 'none'
|
|
1247
|
+
} }, this.getTitleText(item)));
|
|
1248
|
+
}, dataSource: this.alerts.map((alert, index) => {
|
|
1249
|
+
var _a;
|
|
1250
|
+
return {
|
|
1251
|
+
id: this.alertId(alert.title, index),
|
|
1252
|
+
label: (_a = alert.detail) !== null && _a !== void 0 ? _a : "",
|
|
1253
|
+
};
|
|
1254
|
+
}) })))))) : null));
|
|
1250
1255
|
}
|
|
1251
1256
|
get _element() { return this; }
|
|
1252
1257
|
static get watchers() { return {
|
|
@@ -1981,7 +1986,7 @@ const EzCalendar$1 = class extends HTMLElement$1 {
|
|
|
1981
1986
|
static get style() { return ezCalendarCss; }
|
|
1982
1987
|
};
|
|
1983
1988
|
|
|
1984
|
-
const ezCardItemCss = ":host
|
|
1989
|
+
const ezCardItemCss = ":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #2B3A54);--ez-card-item__key--color:var(--text--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{display:flex;align-items:center;line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom);gap:var(--space--small, 6px)}.card-item__key{color:var(--ez-card-item__key--color)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;line-break:anywhere;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";
|
|
1985
1990
|
|
|
1986
1991
|
const EzCardItem$1 = class extends HTMLElement$1 {
|
|
1987
1992
|
constructor() {
|
|
@@ -2348,6 +2353,10 @@ const EzCollapsibleBox$1 = class extends HTMLElement$1 {
|
|
|
2348
2353
|
static get style() { return ezCollapsibleBoxCss; }
|
|
2349
2354
|
};
|
|
2350
2355
|
|
|
2356
|
+
const REQUIRED_INFO = " (obrigatório) *";
|
|
2357
|
+
const DISTINCT_FILTER_NAME_PREFIX = 'FILTRO_COLUNA_';
|
|
2358
|
+
const EZ_GRID_LOADING_SOURCE = "EZ_GRID_LOADING_SOURCE";
|
|
2359
|
+
|
|
2351
2360
|
const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--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__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--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__list-min-width:64px;--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);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-combo-box__list-min-width);position:relative;width:100%}.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, 0px 0px 16px 0px #000);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)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
2352
2361
|
|
|
2353
2362
|
const EzComboBox$1 = class extends HTMLElement$1 {
|
|
@@ -2361,6 +2370,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2361
2370
|
this._maxWidthValue = 0;
|
|
2362
2371
|
this._tabPressed = false;
|
|
2363
2372
|
this._textEmptyList = "Nenhum resultado encontrado";
|
|
2373
|
+
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
2364
2374
|
this._lookupMode = false;
|
|
2365
2375
|
this._preSelection = undefined;
|
|
2366
2376
|
this._visibleOptions = undefined;
|
|
@@ -2373,6 +2383,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2373
2383
|
this.enabled = true;
|
|
2374
2384
|
this.options = undefined;
|
|
2375
2385
|
this.errorMessage = undefined;
|
|
2386
|
+
this.searchMode = undefined;
|
|
2376
2387
|
this.showSelectedValue = false;
|
|
2377
2388
|
this.showOptionValue = false;
|
|
2378
2389
|
this.suppressSearch = false;
|
|
@@ -2396,7 +2407,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2396
2407
|
observeValue(newValue, oldValue) {
|
|
2397
2408
|
if (this._textInput && newValue != oldValue) {
|
|
2398
2409
|
try {
|
|
2399
|
-
if (typeof newValue === "string") {
|
|
2410
|
+
if (this.searchMode && typeof newValue === "string") {
|
|
2400
2411
|
this.setInputValue();
|
|
2401
2412
|
return;
|
|
2402
2413
|
}
|
|
@@ -2423,7 +2434,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2423
2434
|
observeOptions(newOptions, oldOptions) {
|
|
2424
2435
|
if ((newOptions === null || newOptions === void 0 ? void 0 : newOptions.join('')) === (oldOptions === null || oldOptions === void 0 ? void 0 : oldOptions.join('')))
|
|
2425
2436
|
return;
|
|
2426
|
-
this.loadOptions(SearchMode
|
|
2437
|
+
this.loadOptions(SearchMode.PRELOAD);
|
|
2427
2438
|
}
|
|
2428
2439
|
/*
|
|
2429
2440
|
* Retorna uma promise com o valor da opção selecionada,
|
|
@@ -2559,7 +2570,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2559
2570
|
}
|
|
2560
2571
|
updateVisibleOptions() {
|
|
2561
2572
|
let opts = this._source || [];
|
|
2562
|
-
if (this._criteria) {
|
|
2573
|
+
if (!this.searchMode && this._criteria) {
|
|
2563
2574
|
const upperCriteria = this._criteria.toUpperCase();
|
|
2564
2575
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
2565
2576
|
}
|
|
@@ -2634,7 +2645,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2634
2645
|
return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
|
|
2635
2646
|
}
|
|
2636
2647
|
nextOption() {
|
|
2637
|
-
if (!this.isOptionsVisible()) {
|
|
2648
|
+
if (this.searchMode && !this.isOptionsVisible()) {
|
|
2638
2649
|
return;
|
|
2639
2650
|
}
|
|
2640
2651
|
this.showOptions();
|
|
@@ -2657,6 +2668,9 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2657
2668
|
this.selectOption(this._visibleOptions[this._preSelection]);
|
|
2658
2669
|
this._preSelection = undefined;
|
|
2659
2670
|
}
|
|
2671
|
+
else {
|
|
2672
|
+
this.controlListWithOnlyOne();
|
|
2673
|
+
}
|
|
2660
2674
|
}
|
|
2661
2675
|
updateSource(source) {
|
|
2662
2676
|
this._startLoading = false;
|
|
@@ -2675,6 +2689,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2675
2689
|
this.updateVisibleOptions();
|
|
2676
2690
|
if (this._tabPressed) {
|
|
2677
2691
|
this._tabPressed = false;
|
|
2692
|
+
this.controlEmptySearch();
|
|
2678
2693
|
}
|
|
2679
2694
|
}
|
|
2680
2695
|
else {
|
|
@@ -2682,6 +2697,10 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2682
2697
|
}
|
|
2683
2698
|
}
|
|
2684
2699
|
}
|
|
2700
|
+
clearSource() {
|
|
2701
|
+
this._source = [];
|
|
2702
|
+
this.updateVisibleOptions();
|
|
2703
|
+
}
|
|
2685
2704
|
selectOption(newOption) {
|
|
2686
2705
|
var _a, _b;
|
|
2687
2706
|
const currentValue = this.getSelectedOption(this.value);
|
|
@@ -2693,6 +2712,10 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2693
2712
|
else {
|
|
2694
2713
|
this.resetOptions();
|
|
2695
2714
|
}
|
|
2715
|
+
if (this.searchMode) {
|
|
2716
|
+
this._visibleOptions = [];
|
|
2717
|
+
this.clearSource();
|
|
2718
|
+
}
|
|
2696
2719
|
}
|
|
2697
2720
|
loadOptions(mode, argument = "") {
|
|
2698
2721
|
this._criteria = argument;
|
|
@@ -2728,6 +2751,93 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2728
2751
|
clearSearch() {
|
|
2729
2752
|
this.value = null;
|
|
2730
2753
|
}
|
|
2754
|
+
controlListWithOnlyOne() {
|
|
2755
|
+
var _a;
|
|
2756
|
+
if (this.searchMode) {
|
|
2757
|
+
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
2758
|
+
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
2759
|
+
this.selectOption(source[0]);
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
controlEmptySearch() {
|
|
2764
|
+
var _a;
|
|
2765
|
+
if (this.searchMode) {
|
|
2766
|
+
if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2767
|
+
this.clearSearch();
|
|
2768
|
+
ApplicationUtils.info(this._textEmptyList);
|
|
2769
|
+
}
|
|
2770
|
+
else {
|
|
2771
|
+
this.controlListWithOnlyOne();
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
validateDescriptionValue() {
|
|
2776
|
+
if (!this.searchMode || StringUtils$1.isEmpty(this.value)) {
|
|
2777
|
+
return;
|
|
2778
|
+
}
|
|
2779
|
+
let value = this.value;
|
|
2780
|
+
if (typeof value === "object") {
|
|
2781
|
+
return;
|
|
2782
|
+
}
|
|
2783
|
+
if (StringUtils$1.isEmpty(value)) {
|
|
2784
|
+
return;
|
|
2785
|
+
}
|
|
2786
|
+
this.loadDescriptionValue(value);
|
|
2787
|
+
}
|
|
2788
|
+
async loadDescriptionValue(argument) {
|
|
2789
|
+
var _a, _b;
|
|
2790
|
+
if (argument == undefined) {
|
|
2791
|
+
return;
|
|
2792
|
+
}
|
|
2793
|
+
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
2794
|
+
this.loadOptionValue(argument);
|
|
2795
|
+
return;
|
|
2796
|
+
}
|
|
2797
|
+
const searchArgument = {
|
|
2798
|
+
mode: SearchMode.PREDICTIVE,
|
|
2799
|
+
argument
|
|
2800
|
+
};
|
|
2801
|
+
const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
|
|
2802
|
+
if (source == undefined) {
|
|
2803
|
+
return;
|
|
2804
|
+
}
|
|
2805
|
+
if (source instanceof Promise) {
|
|
2806
|
+
source.then((result) => {
|
|
2807
|
+
this.setDescriptionValue(result);
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2810
|
+
else {
|
|
2811
|
+
this.setDescriptionValue(source);
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
setDescriptionValue(source) {
|
|
2815
|
+
const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
|
|
2816
|
+
if (value == undefined || !Object.keys(value).length) {
|
|
2817
|
+
this.showNoResultMessage();
|
|
2818
|
+
return;
|
|
2819
|
+
}
|
|
2820
|
+
this._lookupMode = true;
|
|
2821
|
+
this.value = value;
|
|
2822
|
+
}
|
|
2823
|
+
loadOptionValue(argument) {
|
|
2824
|
+
var _a;
|
|
2825
|
+
const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
|
|
2826
|
+
if (source != undefined) {
|
|
2827
|
+
this.selectOption(source);
|
|
2828
|
+
}
|
|
2829
|
+
else {
|
|
2830
|
+
this.showNoResultMessage();
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
async showNoResultMessage() {
|
|
2834
|
+
this.clearSearch();
|
|
2835
|
+
ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
|
|
2836
|
+
}
|
|
2837
|
+
getFieldLabel() {
|
|
2838
|
+
var _a;
|
|
2839
|
+
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
|
|
2840
|
+
}
|
|
2731
2841
|
resetOptions() {
|
|
2732
2842
|
this.hideOptions();
|
|
2733
2843
|
this._criteria = undefined;
|
|
@@ -2753,7 +2863,12 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2753
2863
|
});
|
|
2754
2864
|
}
|
|
2755
2865
|
}
|
|
2756
|
-
this.
|
|
2866
|
+
if (this.searchMode) {
|
|
2867
|
+
this.updateSource([]);
|
|
2868
|
+
}
|
|
2869
|
+
else {
|
|
2870
|
+
this.loadOptions(SearchMode.PRELOAD);
|
|
2871
|
+
}
|
|
2757
2872
|
}
|
|
2758
2873
|
componentDidRender() {
|
|
2759
2874
|
var _a;
|
|
@@ -2763,6 +2878,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2763
2878
|
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
2764
2879
|
ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
|
|
2765
2880
|
});
|
|
2881
|
+
this.validateDescriptionValue();
|
|
2766
2882
|
}
|
|
2767
2883
|
componentDidLoad() {
|
|
2768
2884
|
CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
|
|
@@ -2782,7 +2898,13 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2782
2898
|
// Event handlers
|
|
2783
2899
|
//---------------------------------------------
|
|
2784
2900
|
handlerIconClick() {
|
|
2785
|
-
this.showOptions();
|
|
2901
|
+
this.searchMode ? this.loadOptions(SearchMode.ADVANCED) : this.showOptions();
|
|
2902
|
+
}
|
|
2903
|
+
buildNumberArgument(argument) {
|
|
2904
|
+
if (this.isTextSearch) {
|
|
2905
|
+
return NaN;
|
|
2906
|
+
}
|
|
2907
|
+
return Number(argument || undefined);
|
|
2786
2908
|
}
|
|
2787
2909
|
onTextInputChangeHandler(event) {
|
|
2788
2910
|
var _a;
|
|
@@ -2799,12 +2921,36 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2799
2921
|
}
|
|
2800
2922
|
this._criteria = argument;
|
|
2801
2923
|
if (argument) {
|
|
2802
|
-
this.
|
|
2803
|
-
|
|
2924
|
+
if (this.searchMode) {
|
|
2925
|
+
this._showLoading = false;
|
|
2926
|
+
this.clearSource();
|
|
2927
|
+
const enoughChars = argument.length >= this.limitCharsToSearch;
|
|
2928
|
+
const argumentNumber = this.buildNumberArgument(argument);
|
|
2929
|
+
if (enoughChars || !isNaN(argumentNumber)) {
|
|
2930
|
+
this._showLoading = true;
|
|
2931
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
2932
|
+
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
2933
|
+
}, this._deboucingTime);
|
|
2934
|
+
this.showOptions();
|
|
2935
|
+
}
|
|
2936
|
+
else {
|
|
2937
|
+
this.hideOptions();
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
else {
|
|
2941
|
+
this.updateVisibleOptions();
|
|
2942
|
+
this.showOptions();
|
|
2943
|
+
}
|
|
2804
2944
|
}
|
|
2805
2945
|
else {
|
|
2806
2946
|
this.hideOptions();
|
|
2807
|
-
this.
|
|
2947
|
+
if (this.searchMode) {
|
|
2948
|
+
this._showLoading = false;
|
|
2949
|
+
this.clearSource();
|
|
2950
|
+
}
|
|
2951
|
+
else {
|
|
2952
|
+
this.updateVisibleOptions();
|
|
2953
|
+
}
|
|
2808
2954
|
}
|
|
2809
2955
|
}
|
|
2810
2956
|
clearDeboucingTimeout() {
|
|
@@ -2814,13 +2960,15 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2814
2960
|
}
|
|
2815
2961
|
}
|
|
2816
2962
|
onTextInputClickHandler() {
|
|
2817
|
-
this.
|
|
2963
|
+
if (!this.searchMode) {
|
|
2964
|
+
this.showOptions();
|
|
2965
|
+
}
|
|
2818
2966
|
}
|
|
2819
2967
|
keyDownHandler(event) {
|
|
2820
2968
|
this._tabPressed = false;
|
|
2821
2969
|
if (event.ctrlKey) {
|
|
2822
2970
|
if (event.key === "f" || event.key === "F") {
|
|
2823
|
-
this.loadOptions(SearchMode
|
|
2971
|
+
this.loadOptions(SearchMode.ADVANCED);
|
|
2824
2972
|
//ATENÇÃO: Ctrl + F tem ação específica nos browsers
|
|
2825
2973
|
//nesse caso, como vamos abrir o popup de busca avançada,
|
|
2826
2974
|
//não é interessante deixar o evento propagar;
|
|
@@ -2846,6 +2994,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2846
2994
|
break;
|
|
2847
2995
|
case "Tab":
|
|
2848
2996
|
this._tabPressed = true;
|
|
2997
|
+
this.controlListWithOnlyOne();
|
|
2849
2998
|
break;
|
|
2850
2999
|
}
|
|
2851
3000
|
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
@@ -2862,8 +3011,11 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2862
3011
|
return !this._showLoading && this._visibleOptions.length > 0;
|
|
2863
3012
|
}
|
|
2864
3013
|
render() {
|
|
3014
|
+
var _a;
|
|
2865
3015
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
2866
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName:
|
|
3016
|
+
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: this.searchMode ? "leftIcon" : "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: this.searchMode ? "search" : "chevron-down" })), this.searchMode && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
|
|
3017
|
+
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
3018
|
+
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
2867
3019
|
&& this._visibleOptions.length === 0
|
|
2868
3020
|
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
2869
3021
|
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
@@ -2878,12 +3030,12 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
2878
3030
|
}; }
|
|
2879
3031
|
static get style() { return ezComboBoxCss; }
|
|
2880
3032
|
};
|
|
2881
|
-
var SearchMode
|
|
3033
|
+
var SearchMode;
|
|
2882
3034
|
(function (SearchMode) {
|
|
2883
3035
|
SearchMode["ADVANCED"] = "ADVANCED";
|
|
2884
3036
|
SearchMode["PRELOAD"] = "PRELOAD";
|
|
2885
3037
|
SearchMode["PREDICTIVE"] = "PREDICTIVE";
|
|
2886
|
-
})(SearchMode
|
|
3038
|
+
})(SearchMode || (SearchMode = {}));
|
|
2887
3039
|
|
|
2888
3040
|
const ezDateInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
|
|
2889
3041
|
|
|
@@ -4687,10 +4839,6 @@ const EzForm$1 = class extends HTMLElement$1 {
|
|
|
4687
4839
|
static get style() { return ezFormCss; }
|
|
4688
4840
|
};
|
|
4689
4841
|
|
|
4690
|
-
const REQUIRED_INFO = " (obrigatório) *";
|
|
4691
|
-
const DISTINCT_FILTER_NAME_PREFIX = 'FILTRO_COLUNA_';
|
|
4692
|
-
const EZ_GRID_LOADING_SOURCE = "EZ_GRID_LOADING_SOURCE";
|
|
4693
|
-
|
|
4694
4842
|
const buildSwitch$1 = (field) => {
|
|
4695
4843
|
return buildField(field.name, field.label, field.readOnly, field.contextName, true);
|
|
4696
4844
|
};
|
|
@@ -4732,9 +4880,11 @@ const buildDateTime$1 = ({ name, label, readOnly, contextName, canShowError }) =
|
|
|
4732
4880
|
const buildFile = ({ name, label, readOnly, contextName, props }) => {
|
|
4733
4881
|
const uploadProps = ObjectUtils$1.removeEmptyValues({
|
|
4734
4882
|
subTitle: props.subTitle,
|
|
4735
|
-
requestHeaders: props.STORAGESTRATEGY
|
|
4883
|
+
requestHeaders: Object.assign(Object.assign({}, (props.STORAGESTRATEGY && {
|
|
4736
4884
|
STORAGESTRATEGY: props.STORAGESTRATEGY
|
|
4737
|
-
}
|
|
4885
|
+
})), (props.INTERNAL_FILENAME && {
|
|
4886
|
+
INTERNAL_FILENAME: props.INTERNAL_FILENAME
|
|
4887
|
+
})),
|
|
4738
4888
|
});
|
|
4739
4889
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
4740
4890
|
h("ez-upload", Object.assign({ enabled: !readOnly, label: label, "data-field-name": name, "data-context-name": contextName, key: name }, uploadProps))));
|
|
@@ -125498,13 +125648,13 @@ class InMemoryFilterColumnDataSource {
|
|
|
125498
125648
|
}
|
|
125499
125649
|
}
|
|
125500
125650
|
|
|
125501
|
-
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100
|
|
125651
|
+
const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;min-height:300px;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}";
|
|
125502
125652
|
|
|
125503
125653
|
const windowInstace$1 = window;
|
|
125504
125654
|
const matches = (text, filter) => {
|
|
125505
|
-
const normalizedText = StringUtils$1.replaceAccentuatedCharsLower(text.toLocaleLowerCase());
|
|
125655
|
+
const normalizedText = StringUtils$1.replaceAccentuatedCharsLower(text === null || text === void 0 ? void 0 : text.toLocaleLowerCase());
|
|
125506
125656
|
const normalizedFilter = StringUtils$1.replaceAccentuatedCharsLower(filter.toLocaleLowerCase());
|
|
125507
|
-
return normalizedText.includes(normalizedFilter);
|
|
125657
|
+
return normalizedText === null || normalizedText === void 0 ? void 0 : normalizedText.includes(normalizedFilter);
|
|
125508
125658
|
};
|
|
125509
125659
|
const EzGrid$1 = class extends HTMLElement$1 {
|
|
125510
125660
|
constructor() {
|
|
@@ -125938,7 +126088,7 @@ const EzGuideNavigator$1 = class extends HTMLElement$1 {
|
|
|
125938
126088
|
static get style() { return ezGuideNavigatorCss; }
|
|
125939
126089
|
};
|
|
125940
126090
|
|
|
125941
|
-
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-acao:before{content:\"\\ea03\"}.ez-icon-account-outline:before{content:\"\\ea04\"}.ez-icon-account:before{content:\"\\ea05\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea06\"}.ez-icon-alert-circle:before{content:\"\\ea07\"}.ez-icon-alert-mail:before{content:\"\\ea08\"}.ez-icon-alert-popup:before{content:\"\\ea09\"}.ez-icon-anexo:before{content:\"\\ea0a\"}.ez-icon-
|
|
126091
|
+
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-acao:before{content:\"\\ea03\"}.ez-icon-account-outline:before{content:\"\\ea04\"}.ez-icon-account:before{content:\"\\ea05\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea06\"}.ez-icon-alert-circle:before{content:\"\\ea07\"}.ez-icon-alert-mail:before{content:\"\\ea08\"}.ez-icon-alert-popup:before{content:\"\\ea09\"}.ez-icon-anexo:before{content:\"\\ea0a\"}.ez-icon-antecipacao:before{content:\"\\ea0b\"}.ez-icon-apps:before{content:\"\\ea0c\"}.ez-icon-arrow-forward:before{content:\"\\ea0d\"}.ez-icon-arrow-upward:before{content:\"\\ea0e\"}.ez-icon-arrow_back:before{content:\"\\ea0f\"}.ez-icon-arrow_downward:before{content:\"\\ea10\"}.ez-icon-baixa:before{content:\"\\ea11\"}.ez-icon-balance:before{content:\"\\ea12\"}.ez-icon-bell-inverted:before{content:\"\\ea13\"}.ez-icon-bell:before{content:\"\\ea14\"}.ez-icon-boleto:before{content:\"\\ea15\"}.ez-icon-boolean:before{content:\"\\ea16\"}.ez-icon-business-center:before{content:\"\\ea17\"}.ez-icon-calendar-clock:before{content:\"\\ea18\"}.ez-icon-calendar:before{content:\"\\ea19\"}.ez-icon-cash-remove:before{content:\"\\ea1a\"}.ez-icon-check-circle-inverted:before{content:\"\\ea1b\"}.ez-icon-check-circle:before{content:\"\\ea1c\"}.ez-icon-check:before{content:\"\\ea1d\"}.ez-icon-chevron-down:before{content:\"\\ea1e\"}.ez-icon-chevron-left:before{content:\"\\ea1f\"}.ez-icon-chevron-right:before{content:\"\\ea20\"}.ez-icon-chevron-up:before{content:\"\\ea21\"}.ez-icon-circle--medium:before{content:\"\\ea22\"}.ez-icon-circle:before{content:\"\\ea23\"}.ez-icon-cleaning:before{content:\"\\ea24\"}.ez-icon-clipboard:before{content:\"\\ea25\"}.ez-icon-close:before{content:\"\\ea26\"}.ez-icon-cobrar:before{content:\"\\ea27\"}.ez-icon-code:before{content:\"\\ea28\"}.ez-icon-configuration:before{content:\"\\ea29\"}.ez-icon-content-cut:before{content:\"\\ea2a\"}.ez-icon-copy:before{content:\"\\ea2b\"}.ez-icon-credit_card:before{content:\"\\ea2c\"}.ez-icon-crop:before{content:\"\\ea2d\"}.ez-icon-custom:before{content:\"\\ea2e\"}.ez-icon-delete-file:before{content:\"\\ea2f\"}.ez-icon-delete:before{content:\"\\ea30\"}.ez-icon-description:before{content:\"\\ea31\"}.ez-icon-dividir:before{content:\"\\ea32\"}.ez-icon-docx:before{content:\"\\ea33\"}.ez-icon-dot-notification:before{content:\"\\ea34\"}.ez-icon-dots-horizontal:before{content:\"\\ea35\"}.ez-icon-dots-vertical:before{content:\"\\ea36\"}.ez-icon-drag-indicator:before{content:\"\\ea37\"}.ez-icon-dual-chevron-down:before{content:\"\\ea38\"}.ez-icon-dual-chevron-left:before{content:\"\\ea39\"}.ez-icon-dual-chevron-right:before{content:\"\\ea3a\"}.ez-icon-dual-chevron-up:before{content:\"\\ea3b\"}.ez-icon-edit-file:before{content:\"\\ea3c\"}.ez-icon-edit-table:before{content:\"\\ea3d\"}.ez-icon-edit-time:before{content:\"\\ea3e\"}.ez-icon-edit-value:before{content:\"\\ea3f\"}.ez-icon-edit:before{content:\"\\ea40\"}.ez-icon-email:before{content:\"\\ea41\"}.ez-icon-estorno:before{content:\"\\ea42\"}.ez-icon-exe:before{content:\"\\ea43\"}.ez-icon-expand:before{content:\"\\ea44\"}.ez-icon-expandir_card:before{content:\"\\ea45\"}.ez-icon-extrato:before{content:\"\\ea46\"}.ez-icon-eye-off:before{content:\"\\ea47\"}.ez-icon-eye:before{content:\"\\ea48\"}.ez-icon-favorite:before{content:\"\\ea49\"}.ez-icon-figma:before{content:\"\\ea4a\"}.ez-icon-file-download:before{content:\"\\ea4b\"}.ez-icon-file-upload:before{content:\"\\ea4c\"}.ez-icon-filter:before{content:\"\\ea4d\"}.ez-icon-find-file:before{content:\"\\ea4e\"}.ez-icon-find-page:before{content:\"\\ea4f\"}.ez-icon-format-color-fill:before{content:\"\\ea50\"}.ez-icon-generic:before{content:\"\\ea51\"}.ez-icon-gif:before{content:\"\\ea52\"}.ez-icon-graph_bar:before{content:\"\\ea53\"}.ez-icon-handshake:before{content:\"\\ea54\"}.ez-icon-help-inverted:before{content:\"\\ea55\"}.ez-icon-help:before{content:\"\\ea56\"}.ez-icon-hide_menu:before{content:\"\\ea57\"}.ez-icon-home:before{content:\"\\ea58\"}.ez-icon-icons104:before{content:\"\\ea59\"}.ez-icon-language:before{content:\"\\ea5a\"}.ez-icon-launch:before{content:\"\\ea5b\"}.ez-icon-lightbulb:before{content:\"\\ea5c\"}.ez-icon-list:before{content:\"\\ea5d\"}.ez-icon-location:before{content:\"\\ea5e\"}.ez-icon-lock-outline:before{content:\"\\ea5f\"}.ez-icon-lock:before{content:\"\\ea60\"}.ez-icon-menu:before{content:\"\\ea61\"}.ez-icon-mid:before{content:\"\\ea62\"}.ez-icon-minus:before{content:\"\\ea63\"}.ez-icon-money-off:before{content:\"\\ea64\"}.ez-icon-money:before{content:\"\\ea65\"}.ez-icon-more:before{content:\"\\ea66\"}.ez-icon-mp3:before{content:\"\\ea67\"}.ez-icon-mp4:before{content:\"\\ea68\"}.ez-icon-multiple-files:before{content:\"\\ea69\"}.ez-icon-north-west:before{content:\"\\ea6a\"}.ez-icon-number:before{content:\"\\ea6b\"}.ez-icon-ordem-ascendente:before{content:\"\\ea6c\"}.ez-icon-ordem-descendente:before{content:\"\\ea6d\"}.ez-icon-parcelar:before{content:\"\\ea6e\"}.ez-icon-pause:before{content:\"\\ea6f\"}.ez-icon-payments:before{content:\"\\ea70\"}.ez-icon-pdf:before{content:\"\\ea71\"}.ez-icon-play:before{content:\"\\ea72\"}.ez-icon-plus:before{content:\"\\ea73\"}.ez-icon-png:before{content:\"\\ea74\"}.ez-icon-power:before{content:\"\\ea75\"}.ez-icon-pptx:before{content:\"\\ea76\"}.ez-icon-preview:before{content:\"\\ea77\"}.ez-icon-print:before{content:\"\\ea78\"}.ez-icon-push-pin:before{content:\"\\ea79\"}.ez-icon-rateio:before{content:\"\\ea7a\"}.ez-icon-receipt:before{content:\"\\ea7b\"}.ez-icon-recolher_card:before{content:\"\\ea7c\"}.ez-icon-restore:before{content:\"\\ea7d\"}.ez-icon-return:before{content:\"\\ea7e\"}.ez-icon-sankhya-place:before{content:\"\\ea7f\"}.ez-icon-save:before{content:\"\\ea80\"}.ez-icon-search:before{content:\"\\ea81\"}.ez-icon-settings-inverted:before{content:\"\\ea82\"}.ez-icon-settings:before{content:\"\\ea83\"}.ez-icon-share:before{content:\"\\ea84\"}.ez-icon-shield:before{content:\"\\ea85\"}.ez-icon-show_menu:before{content:\"\\ea86\"}.ez-icon-south-east:before{content:\"\\ea87\"}.ez-icon-sync:before{content:\"\\ea88\"}.ez-icon-table:before{content:\"\\ea89\"}.ez-icon-tag_code:before{content:\"\\ea8a\"}.ez-icon-text:before{content:\"\\ea8b\"}.ez-icon-timeline:before{content:\"\\ea8c\"}.ez-icon-timer-outline:before{content:\"\\ea8d\"}.ez-icon-trending-up:before{content:\"\\ea8e\"}.ez-icon-tune:before{content:\"\\ea8f\"}.ez-icon-txt:before{content:\"\\ea90\"}.ez-icon-un-pin:before{content:\"\\ea91\"}.ez-icon-unfold_less:before{content:\"\\ea92\"}.ez-icon-unfold_more:before{content:\"\\ea93\"}.ez-icon-user-circle:before{content:\"\\ea94\"}.ez-icon-warning-outline:before{content:\"\\ea95\"}.ez-icon-warning_triangle:before{content:\"\\ea96\"}.ez-icon-whatshot:before{content:\"\\ea97\"}.ez-icon-xlsx:before{content:\"\\ea98\"}.ez-icon-zip:before{content:\"\\ea99\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
|
|
125942
126092
|
|
|
125943
126093
|
const EzIcon$1 = class extends HTMLElement$1 {
|
|
125944
126094
|
constructor() {
|
|
@@ -127485,7 +127635,7 @@ class ScrollCtrl {
|
|
|
127485
127635
|
}
|
|
127486
127636
|
}
|
|
127487
127637
|
|
|
127488
|
-
const ezSearchCss = ":host{
|
|
127638
|
+
const ezSearchCss = ":host{width:100%}";
|
|
127489
127639
|
|
|
127490
127640
|
const EzSearch$1 = class extends HTMLElement$1 {
|
|
127491
127641
|
constructor() {
|
|
@@ -127493,21 +127643,6 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
127493
127643
|
this.__registerHost();
|
|
127494
127644
|
this.__attachShadow();
|
|
127495
127645
|
this.ezChange = createEvent(this, "ezChange", 7);
|
|
127496
|
-
this._changeDeboucingTimeout = null;
|
|
127497
|
-
this._limitCharsToSearch = 3;
|
|
127498
|
-
this._deboucingTime = 300;
|
|
127499
|
-
this._maxWidthValue = 0;
|
|
127500
|
-
this._tabPressed = false;
|
|
127501
|
-
this._textEmptyList = "Nenhum resultado encontrado";
|
|
127502
|
-
this._textEmptySearch = "Nenhum resultado de {0} encontrado";
|
|
127503
|
-
this._lookupMode = false;
|
|
127504
|
-
this._startHighlightTag = "<span class='card-item__highlight'>";
|
|
127505
|
-
this._endHighlightTag = "</span>";
|
|
127506
|
-
this._preSelection = undefined;
|
|
127507
|
-
this._visibleOptions = undefined;
|
|
127508
|
-
this._startLoading = false;
|
|
127509
|
-
this._showLoading = true;
|
|
127510
|
-
this._criteria = undefined;
|
|
127511
127646
|
this.value = undefined;
|
|
127512
127647
|
this.label = undefined;
|
|
127513
127648
|
this.enabled = true;
|
|
@@ -127522,82 +127657,28 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
127522
127657
|
this.listOptionsPosition = undefined;
|
|
127523
127658
|
this.isTextSearch = false;
|
|
127524
127659
|
this.ignoreLimitCharsToSearch = false;
|
|
127525
|
-
this.options = undefined;
|
|
127526
|
-
this.suppressSearch = false;
|
|
127527
127660
|
}
|
|
127528
127661
|
observeErrorMessage() {
|
|
127529
|
-
|
|
127530
|
-
|
|
127531
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
127532
|
-
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
127533
|
-
this.setInputValue();
|
|
127534
|
-
}
|
|
127662
|
+
if (this._comboElement) {
|
|
127663
|
+
this._comboElement.errorMessage = this.errorMessage;
|
|
127535
127664
|
}
|
|
127536
127665
|
}
|
|
127537
|
-
observeValue(
|
|
127538
|
-
if (this.
|
|
127539
|
-
|
|
127540
|
-
if (newValue === "string") {
|
|
127541
|
-
this.setInputValue();
|
|
127542
|
-
return;
|
|
127543
|
-
}
|
|
127544
|
-
const newValueSelected = this.getSelectedOption(newValue);
|
|
127545
|
-
const oldValueSelected = this.getSelectedOption(oldValue);
|
|
127546
|
-
const currentValue = this.getSelectedOption(this.value);
|
|
127547
|
-
if (this.isDifferentValues(currentValue, newValueSelected)) {
|
|
127548
|
-
this.value = newValueSelected;
|
|
127549
|
-
}
|
|
127550
|
-
if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
|
|
127551
|
-
this.setInputValue();
|
|
127552
|
-
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
127553
|
-
if (!this._lookupMode) {
|
|
127554
|
-
this.ezChange.emit(valueEmitted);
|
|
127555
|
-
}
|
|
127556
|
-
}
|
|
127557
|
-
this.resetOptions();
|
|
127558
|
-
}
|
|
127559
|
-
finally {
|
|
127560
|
-
this._lookupMode = false;
|
|
127561
|
-
}
|
|
127562
|
-
}
|
|
127563
|
-
}
|
|
127564
|
-
observeOptions(newOptions, oldOptions) {
|
|
127565
|
-
if ((newOptions === null || newOptions === void 0 ? void 0 : newOptions.join('')) === (oldOptions === null || oldOptions === void 0 ? void 0 : oldOptions.join('')))
|
|
127566
|
-
return;
|
|
127567
|
-
this.loadOptions(SearchMode.PRELOAD);
|
|
127568
|
-
}
|
|
127569
|
-
/*
|
|
127570
|
-
* Retorna uma promise com o valor da opção selecionada,
|
|
127571
|
-
* que será resolvida quando o backend devolver este dado.
|
|
127572
|
-
*/
|
|
127573
|
-
async getValueAsync() {
|
|
127574
|
-
if (!this._showLoading) {
|
|
127575
|
-
return new Promise(resolve => resolve(this.value));
|
|
127666
|
+
observeValue() {
|
|
127667
|
+
if (this._comboElement) {
|
|
127668
|
+
this._comboElement.value = this.value;
|
|
127576
127669
|
}
|
|
127577
|
-
return new Promise(resolve => {
|
|
127578
|
-
let id = setInterval(() => {
|
|
127579
|
-
if (!this._showLoading) {
|
|
127580
|
-
clearInterval(id);
|
|
127581
|
-
resolve(this.value);
|
|
127582
|
-
}
|
|
127583
|
-
}, 100);
|
|
127584
|
-
});
|
|
127585
127670
|
}
|
|
127586
127671
|
/**
|
|
127587
|
-
|
|
127588
|
-
|
|
127672
|
+
* Aplica o foco no campo.
|
|
127673
|
+
*/
|
|
127589
127674
|
async setFocus() {
|
|
127590
|
-
|
|
127591
|
-
this._textInput.setFocus();
|
|
127592
|
-
}
|
|
127675
|
+
this._comboElement.setFocus();
|
|
127593
127676
|
}
|
|
127594
127677
|
/**
|
|
127595
|
-
|
|
127596
|
-
|
|
127678
|
+
* Remove o foco do campo.
|
|
127679
|
+
*/
|
|
127597
127680
|
async setBlur() {
|
|
127598
|
-
|
|
127599
|
-
this._textInput.setBlur();
|
|
127600
|
-
}
|
|
127681
|
+
this._comboElement.setBlur();
|
|
127601
127682
|
}
|
|
127602
127683
|
/**
|
|
127603
127684
|
* Retorna se o conteúdo é inválido.
|
|
@@ -127609,547 +127690,40 @@ const EzSearch$1 = class extends HTMLElement$1 {
|
|
|
127609
127690
|
* Limpa o valor do campo de pesquisa
|
|
127610
127691
|
*/
|
|
127611
127692
|
async clearValue() {
|
|
127612
|
-
this.clearSearch();
|
|
127613
|
-
}
|
|
127614
|
-
scrollListener() {
|
|
127615
|
-
var _a;
|
|
127616
|
-
if (this._floatingID == undefined) {
|
|
127617
|
-
return;
|
|
127618
|
-
}
|
|
127619
|
-
if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
|
|
127620
|
-
this.hideOptions();
|
|
127621
|
-
}
|
|
127622
|
-
else {
|
|
127623
|
-
window.requestAnimationFrame(() => {
|
|
127624
|
-
this.updateListPosition();
|
|
127625
|
-
});
|
|
127626
|
-
}
|
|
127627
|
-
}
|
|
127628
|
-
updateListPosition() {
|
|
127629
|
-
let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
|
|
127630
|
-
const elementRect = this._listWrapper.getBoundingClientRect();
|
|
127631
|
-
const containerRect = this._listContainer.getBoundingClientRect();
|
|
127632
|
-
const textInputRect = this._textInput.getBoundingClientRect();
|
|
127633
|
-
const limitHeight = bottomLimit || window.innerHeight;
|
|
127634
|
-
const neededHeight = containerRect.bottom + elementRect.height;
|
|
127635
|
-
if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
|
|
127636
|
-
fromBottom = true;
|
|
127637
|
-
}
|
|
127638
|
-
if (!hardPosition) {
|
|
127639
|
-
verticalPosition = verticalPosition || 0;
|
|
127640
|
-
horizontalPosition = horizontalPosition || 0;
|
|
127641
|
-
if (fromBottom) {
|
|
127642
|
-
verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
|
|
127643
|
-
}
|
|
127644
|
-
else {
|
|
127645
|
-
verticalPosition += containerRect.top;
|
|
127646
|
-
}
|
|
127647
|
-
if (fromRight) {
|
|
127648
|
-
horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
|
|
127649
|
-
}
|
|
127650
|
-
else {
|
|
127651
|
-
horizontalPosition += containerRect.left;
|
|
127652
|
-
}
|
|
127653
|
-
}
|
|
127654
|
-
if (verticalPosition != undefined) {
|
|
127655
|
-
this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
|
|
127656
|
-
this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
|
|
127657
|
-
}
|
|
127658
|
-
if (horizontalPosition != undefined) {
|
|
127659
|
-
this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
|
|
127660
|
-
this._listWrapper.style[fromRight ? "left" : "right"] = "";
|
|
127661
|
-
}
|
|
127662
|
-
}
|
|
127663
|
-
getListPosition() {
|
|
127664
|
-
if (this.listOptionsPosition) {
|
|
127665
|
-
return this.listOptionsPosition;
|
|
127666
|
-
}
|
|
127667
|
-
return {
|
|
127668
|
-
verticalPosition: (this.errorMessage || !this.canShowError || this.mode === "slim") ? 6 : -13
|
|
127669
|
-
};
|
|
127670
|
-
}
|
|
127671
|
-
isDifferentValues(firstValue, secondValue) {
|
|
127672
|
-
return ObjectUtils$1.objectToString(firstValue || {}) !== ObjectUtils$1.objectToString(secondValue || {});
|
|
127673
|
-
}
|
|
127674
|
-
getFormattedText(currentValue) {
|
|
127675
|
-
if (currentValue == undefined) {
|
|
127676
|
-
return;
|
|
127677
|
-
}
|
|
127678
|
-
if (!this.showSelectedValue || currentValue.value == undefined) {
|
|
127679
|
-
return currentValue.label;
|
|
127680
|
-
}
|
|
127681
|
-
return currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
|
|
127682
|
-
}
|
|
127683
|
-
getText() {
|
|
127684
|
-
const currentValue = this.getSelectedOption(this.value);
|
|
127685
|
-
const text = this.getFormattedText(currentValue);
|
|
127686
|
-
if (text == undefined) {
|
|
127687
|
-
return;
|
|
127688
|
-
}
|
|
127689
|
-
return String(text)
|
|
127690
|
-
.replace(/&/g, '&')
|
|
127691
|
-
.replace(/</g, '<')
|
|
127692
|
-
.replace(/>/g, '>')
|
|
127693
|
-
.replace(/"/g, '"');
|
|
127694
|
-
}
|
|
127695
|
-
getSelectedOption(value) {
|
|
127696
|
-
if (typeof value === "string" || value instanceof String) {
|
|
127697
|
-
return this._visibleOptions.find(o => o.value === value);
|
|
127698
|
-
}
|
|
127699
|
-
return value;
|
|
127700
|
-
}
|
|
127701
|
-
updateVisibleOptions() {
|
|
127702
|
-
let opts = this._source || [];
|
|
127703
|
-
if (this.suppressEmptyOption) {
|
|
127704
|
-
this._visibleOptions = opts;
|
|
127705
|
-
}
|
|
127706
|
-
else {
|
|
127707
|
-
this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
|
|
127708
|
-
}
|
|
127709
|
-
this._maxWidthValue = this.getMaxWidthValue();
|
|
127710
|
-
}
|
|
127711
|
-
getMaxWidthValue() {
|
|
127712
|
-
var _a;
|
|
127713
|
-
const arrValues = [];
|
|
127714
|
-
(_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.forEach(opt => {
|
|
127715
|
-
const widthValue = this.getWidthValue(opt.value);
|
|
127716
|
-
if (!arrValues.includes(widthValue)) {
|
|
127717
|
-
arrValues.push(widthValue);
|
|
127718
|
-
}
|
|
127719
|
-
});
|
|
127720
|
-
return arrValues.length > 1 ? Math.max(...arrValues) : 0;
|
|
127721
|
-
}
|
|
127722
|
-
getWidthValue(value) {
|
|
127723
|
-
if (this._itemValueBasis != undefined) {
|
|
127724
|
-
const span = this._itemValueBasis;
|
|
127725
|
-
if (value != undefined) {
|
|
127726
|
-
span.innerHTML = value;
|
|
127727
|
-
return span.clientWidth > 0 ? (span.clientWidth + 2) : 0;
|
|
127728
|
-
}
|
|
127729
|
-
else {
|
|
127730
|
-
span.innerHTML = "";
|
|
127731
|
-
}
|
|
127732
|
-
}
|
|
127733
|
-
return 0;
|
|
127734
|
-
}
|
|
127735
|
-
createOption(detail) {
|
|
127736
|
-
let { key, title } = detail;
|
|
127737
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
127738
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
127739
|
-
title = StringUtils$1.decodeHtmlEntities(title);
|
|
127740
|
-
const option = {
|
|
127741
|
-
value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
|
|
127742
|
-
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
127743
|
-
};
|
|
127744
|
-
this.selectOption(option);
|
|
127745
|
-
}
|
|
127746
|
-
buildItem(opt, index) {
|
|
127747
|
-
opt.label = opt.label || opt.value;
|
|
127748
|
-
const card = {
|
|
127749
|
-
key: opt.value,
|
|
127750
|
-
title: opt.label,
|
|
127751
|
-
details: opt.details
|
|
127752
|
-
};
|
|
127753
|
-
return h("div", { style: { "height": "100%" }, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card }));
|
|
127754
|
-
}
|
|
127755
|
-
showOptions() {
|
|
127756
|
-
if (!this.enabled)
|
|
127757
|
-
return;
|
|
127758
|
-
if (this.isOptionsVisible()) {
|
|
127759
|
-
return;
|
|
127760
|
-
}
|
|
127761
|
-
if (!!this._resizeObserver)
|
|
127762
|
-
this._resizeObserver.observe(this._textInput);
|
|
127763
|
-
this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: false, isFixed: true, backClickListener: () => this.hideOptions() });
|
|
127764
|
-
this.setFocus();
|
|
127765
|
-
window.requestAnimationFrame(() => {
|
|
127766
|
-
this.updateListPosition();
|
|
127767
|
-
if (!this.listOptionsPosition) {
|
|
127768
|
-
this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
127769
|
-
}
|
|
127770
|
-
});
|
|
127771
|
-
}
|
|
127772
|
-
hideOptions() {
|
|
127773
|
-
if (this._floatingID !== undefined) {
|
|
127774
|
-
FloatingManager.close(this._floatingID);
|
|
127775
|
-
}
|
|
127776
|
-
this._floatingID = undefined;
|
|
127777
|
-
if (!!this._resizeObserver)
|
|
127778
|
-
this._resizeObserver.unobserve(this._textInput);
|
|
127779
|
-
}
|
|
127780
|
-
isOptionsVisible() {
|
|
127781
|
-
return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
|
|
127782
|
-
}
|
|
127783
|
-
nextOption() {
|
|
127784
|
-
if (!this.isOptionsVisible()) {
|
|
127785
|
-
return;
|
|
127786
|
-
}
|
|
127787
|
-
this.showOptions();
|
|
127788
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
|
|
127789
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
127790
|
-
}
|
|
127791
|
-
previousOption() {
|
|
127792
|
-
this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
|
|
127793
|
-
this.scrollToOption(this._visibleOptions[this._preSelection]);
|
|
127794
|
-
}
|
|
127795
|
-
scrollToOption(opt) {
|
|
127796
|
-
window.requestAnimationFrame(() => {
|
|
127797
|
-
const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
|
|
127798
|
-
if (liElem)
|
|
127799
|
-
liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
127800
|
-
});
|
|
127801
|
-
}
|
|
127802
|
-
selectCurrentOption() {
|
|
127803
|
-
if (this._preSelection !== undefined) {
|
|
127804
|
-
this.selectOption(this._visibleOptions[this._preSelection]);
|
|
127805
|
-
this._preSelection = undefined;
|
|
127806
|
-
}
|
|
127807
|
-
else {
|
|
127808
|
-
this.controlListWithOnlyOne();
|
|
127809
|
-
}
|
|
127810
|
-
}
|
|
127811
|
-
updateSource(source) {
|
|
127812
|
-
this._startLoading = false;
|
|
127813
|
-
if (source instanceof Promise) {
|
|
127814
|
-
this._showLoading = true;
|
|
127815
|
-
source.then(result => {
|
|
127816
|
-
this._showLoading = false;
|
|
127817
|
-
this.updateSource(result);
|
|
127818
|
-
}).catch(() => this._showLoading = false);
|
|
127819
|
-
this.updateVisibleOptions();
|
|
127820
|
-
}
|
|
127821
|
-
else {
|
|
127822
|
-
this._showLoading = false;
|
|
127823
|
-
if (Array.isArray(source)) {
|
|
127824
|
-
this._source = source;
|
|
127825
|
-
this.updateVisibleOptions();
|
|
127826
|
-
if (this._tabPressed) {
|
|
127827
|
-
this._tabPressed = false;
|
|
127828
|
-
this.controlEmptySearch();
|
|
127829
|
-
}
|
|
127830
|
-
}
|
|
127831
|
-
else {
|
|
127832
|
-
this.selectOption(source);
|
|
127833
|
-
}
|
|
127834
|
-
}
|
|
127835
|
-
}
|
|
127836
|
-
clearSource() {
|
|
127837
|
-
this._source = [];
|
|
127838
|
-
this.updateVisibleOptions();
|
|
127839
|
-
}
|
|
127840
|
-
selectOption(newOption) {
|
|
127841
127693
|
var _a, _b;
|
|
127842
|
-
|
|
127843
|
-
if ((((_a = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString()))
|
|
127844
|
-
|| (currentValue == undefined && newOption != undefined && "value" in newOption)) {
|
|
127845
|
-
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
127846
|
-
this.value = adjustedOpt;
|
|
127847
|
-
}
|
|
127848
|
-
else {
|
|
127849
|
-
this.resetOptions();
|
|
127850
|
-
}
|
|
127851
|
-
this._visibleOptions = [];
|
|
127852
|
-
this.clearSource();
|
|
127694
|
+
(_b = (_a = this._comboElement) === null || _a === void 0 ? void 0 : _a['clearValue']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
127853
127695
|
}
|
|
127854
|
-
|
|
127855
|
-
|
|
127856
|
-
|
|
127857
|
-
|
|
127858
|
-
|
|
127859
|
-
this.updateSource(this.optionLoader(searchArgument));
|
|
127860
|
-
}
|
|
127861
|
-
else {
|
|
127862
|
-
this.updateSource(this.options);
|
|
127863
|
-
}
|
|
127864
|
-
}
|
|
127865
|
-
cancelPreselection() {
|
|
127866
|
-
if (!this._textInput.value && this.value) {
|
|
127867
|
-
this.selectOption(undefined);
|
|
127868
|
-
}
|
|
127869
|
-
else {
|
|
127870
|
-
window.setTimeout(() => {
|
|
127871
|
-
this.setInputValue();
|
|
127872
|
-
}, this._deboucingTime);
|
|
127873
|
-
}
|
|
127874
|
-
this.resetOptions();
|
|
127875
|
-
}
|
|
127876
|
-
setInputValue(clearError = true) {
|
|
127877
|
-
const textValue = this.getText();
|
|
127878
|
-
if ((this._textInput.value || '') !== textValue) {
|
|
127879
|
-
this._textInput.value = textValue;
|
|
127880
|
-
if (clearError) {
|
|
127881
|
-
this.errorMessage = null;
|
|
127882
|
-
}
|
|
127883
|
-
}
|
|
127884
|
-
}
|
|
127885
|
-
clearSearch() {
|
|
127886
|
-
this.value = null;
|
|
127887
|
-
}
|
|
127888
|
-
controlListWithOnlyOne() {
|
|
127889
|
-
var _a, _b;
|
|
127890
|
-
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
127891
|
-
if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
|
|
127892
|
-
const startHighlight = new RegExp(this._startHighlightTag, 'g');
|
|
127893
|
-
const endHighlight = new RegExp(this._endHighlightTag, 'g');
|
|
127894
|
-
let title = StringUtils$1.decodeHtmlEntities(source[0].label);
|
|
127895
|
-
const option = {
|
|
127896
|
-
value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
|
|
127897
|
-
label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
|
|
127898
|
-
};
|
|
127899
|
-
this.selectOption(option);
|
|
127900
|
-
}
|
|
127901
|
-
}
|
|
127902
|
-
controlEmptySearch() {
|
|
127903
|
-
var _a;
|
|
127904
|
-
if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
127905
|
-
this.clearSearch();
|
|
127906
|
-
ApplicationUtils.info(this._textEmptyList);
|
|
127907
|
-
}
|
|
127908
|
-
else {
|
|
127909
|
-
this.controlListWithOnlyOne();
|
|
127910
|
-
}
|
|
127911
|
-
}
|
|
127912
|
-
validateDescriptionValue() {
|
|
127913
|
-
if (StringUtils$1.isEmpty(this.value)) {
|
|
127914
|
-
return;
|
|
127915
|
-
}
|
|
127916
|
-
let value = this.value;
|
|
127917
|
-
if (typeof value === "object") {
|
|
127918
|
-
return;
|
|
127919
|
-
}
|
|
127920
|
-
if (StringUtils$1.isEmpty(value)) {
|
|
127921
|
-
return;
|
|
127922
|
-
}
|
|
127923
|
-
this.loadDescriptionValue(value);
|
|
127924
|
-
}
|
|
127925
|
-
async loadDescriptionValue(argument) {
|
|
127926
|
-
var _a, _b;
|
|
127927
|
-
if (argument == undefined) {
|
|
127928
|
-
return;
|
|
127929
|
-
}
|
|
127930
|
-
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
127931
|
-
this.loadOptionValue(argument);
|
|
127932
|
-
return;
|
|
127933
|
-
}
|
|
127934
|
-
const searchArgument = {
|
|
127935
|
-
mode: SearchMode.PREDICTIVE,
|
|
127936
|
-
argument
|
|
127937
|
-
};
|
|
127938
|
-
const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
|
|
127939
|
-
if (source == undefined) {
|
|
127940
|
-
return;
|
|
127941
|
-
}
|
|
127942
|
-
if (source instanceof Promise) {
|
|
127943
|
-
source.then((result) => {
|
|
127944
|
-
this.setDescriptionValue(result);
|
|
127945
|
-
});
|
|
127946
|
-
}
|
|
127947
|
-
else {
|
|
127948
|
-
this.setDescriptionValue(source);
|
|
127949
|
-
}
|
|
127950
|
-
}
|
|
127951
|
-
setDescriptionValue(source) {
|
|
127952
|
-
const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
|
|
127953
|
-
if (value == undefined || !Object.keys(value).length) {
|
|
127954
|
-
this.showNoResultMessage();
|
|
127955
|
-
return;
|
|
127956
|
-
}
|
|
127957
|
-
this._lookupMode = true;
|
|
127958
|
-
this.value = value;
|
|
127959
|
-
}
|
|
127960
|
-
loadOptionValue(argument) {
|
|
127961
|
-
var _a;
|
|
127962
|
-
const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
|
|
127963
|
-
if (source != undefined) {
|
|
127964
|
-
this.selectOption(source);
|
|
127965
|
-
}
|
|
127966
|
-
else {
|
|
127967
|
-
this.showNoResultMessage();
|
|
127968
|
-
}
|
|
127969
|
-
}
|
|
127970
|
-
async showNoResultMessage() {
|
|
127971
|
-
this.clearSearch();
|
|
127972
|
-
ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
|
|
127973
|
-
}
|
|
127974
|
-
getFieldLabel() {
|
|
127696
|
+
/*
|
|
127697
|
+
* Retorna uma promise com o valor da opção selecionada,
|
|
127698
|
+
* que será resolvida quando o backend devolver este dado.
|
|
127699
|
+
*/
|
|
127700
|
+
async getValueAsync() {
|
|
127975
127701
|
var _a;
|
|
127976
|
-
return (_a = this.
|
|
127702
|
+
return (_a = this._comboElement) === null || _a === void 0 ? void 0 : _a.getValueAsync();
|
|
127977
127703
|
}
|
|
127978
|
-
|
|
127979
|
-
|
|
127980
|
-
this.
|
|
127981
|
-
this.
|
|
127982
|
-
this.
|
|
127983
|
-
|
|
127984
|
-
//---------------------------------------------
|
|
127985
|
-
// Lifecycle web component
|
|
127986
|
-
//---------------------------------------------
|
|
127987
|
-
componentWillLoad() {
|
|
127988
|
-
if (this.options === undefined) {
|
|
127989
|
-
this.options = [];
|
|
127990
|
-
const optionsTags = this.el.querySelectorAll("option");
|
|
127991
|
-
if (optionsTags) {
|
|
127992
|
-
optionsTags.forEach(e => {
|
|
127993
|
-
let label = e.innerText;
|
|
127994
|
-
let value = e.getAttribute("value");
|
|
127995
|
-
let details = e.getAttribute("details");
|
|
127996
|
-
if (!value) {
|
|
127997
|
-
value = label;
|
|
127998
|
-
}
|
|
127999
|
-
this.options.push({ label, value, details });
|
|
128000
|
-
e.hidden = true;
|
|
128001
|
-
});
|
|
128002
|
-
}
|
|
128003
|
-
}
|
|
128004
|
-
this.updateSource([]);
|
|
128005
|
-
}
|
|
128006
|
-
componentDidRender() {
|
|
128007
|
-
var _a;
|
|
128008
|
-
if (this._floatingID === undefined) {
|
|
128009
|
-
this._listWrapper.remove();
|
|
127704
|
+
onComboChange(event) {
|
|
127705
|
+
event.stopPropagation();
|
|
127706
|
+
this.value = event.detail;
|
|
127707
|
+
this.ezChange.emit(event.detail);
|
|
127708
|
+
if (this.errorMessage !== this._comboElement.errorMessage) {
|
|
127709
|
+
this.errorMessage = this._comboElement.errorMessage;
|
|
128010
127710
|
}
|
|
128011
|
-
(_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
|
|
128012
|
-
ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
|
|
128013
|
-
});
|
|
128014
|
-
this.validateDescriptionValue();
|
|
128015
127711
|
}
|
|
128016
127712
|
componentDidLoad() {
|
|
128017
|
-
CSSVarsUtils.applyVarsTextInput(this.
|
|
128018
|
-
this.setInputValue(false);
|
|
128019
|
-
this._resizeObserver = new ResizeObserver((entries) => {
|
|
128020
|
-
window.requestAnimationFrame(() => {
|
|
128021
|
-
if (!Array.isArray(entries) || !entries.length)
|
|
128022
|
-
return;
|
|
128023
|
-
const { clientWidth } = this._listContainer;
|
|
128024
|
-
if (clientWidth > 0 && !!this._listWrapper) {
|
|
128025
|
-
this._listWrapper.style.width = `${clientWidth}px`;
|
|
128026
|
-
}
|
|
128027
|
-
});
|
|
128028
|
-
});
|
|
128029
|
-
}
|
|
128030
|
-
//---------------------------------------------
|
|
128031
|
-
// Event handlers
|
|
128032
|
-
//---------------------------------------------
|
|
128033
|
-
handlerIconClick() {
|
|
128034
|
-
this.loadOptions(SearchMode.ADVANCED);
|
|
128035
|
-
}
|
|
128036
|
-
buildNumberArgument(argument) {
|
|
128037
|
-
if (this.isTextSearch) {
|
|
128038
|
-
return NaN;
|
|
128039
|
-
}
|
|
128040
|
-
return Number(argument || undefined);
|
|
128041
|
-
}
|
|
128042
|
-
onTextInputChangeHandler(event) {
|
|
128043
|
-
var _a;
|
|
128044
|
-
this.clearDeboucingTimeout();
|
|
128045
|
-
if (this._startLoading) {
|
|
128046
|
-
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
128047
|
-
this.onTextInputChangeHandler(event);
|
|
128048
|
-
}, this._deboucingTime);
|
|
128049
|
-
return;
|
|
128050
|
-
}
|
|
128051
|
-
const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
128052
|
-
const argumentNumber = this.buildNumberArgument(argument);
|
|
128053
|
-
if (!this._criteria) {
|
|
128054
|
-
this._textInput.value = event.data || argument;
|
|
128055
|
-
}
|
|
128056
|
-
this._criteria = argument;
|
|
128057
|
-
if (argument) {
|
|
128058
|
-
this._showLoading = false;
|
|
128059
|
-
this.clearSource();
|
|
128060
|
-
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
128061
|
-
this._showLoading = true;
|
|
128062
|
-
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
128063
|
-
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
128064
|
-
}, this._deboucingTime);
|
|
128065
|
-
this.showOptions();
|
|
128066
|
-
}
|
|
128067
|
-
else {
|
|
128068
|
-
this.hideOptions();
|
|
128069
|
-
}
|
|
128070
|
-
}
|
|
128071
|
-
else {
|
|
128072
|
-
this.hideOptions();
|
|
128073
|
-
this._showLoading = false;
|
|
128074
|
-
this.clearSource();
|
|
128075
|
-
}
|
|
128076
|
-
}
|
|
128077
|
-
clearDeboucingTimeout() {
|
|
128078
|
-
if (this._changeDeboucingTimeout) {
|
|
128079
|
-
window.clearTimeout(this._changeDeboucingTimeout);
|
|
128080
|
-
this._changeDeboucingTimeout = null;
|
|
128081
|
-
}
|
|
128082
|
-
}
|
|
128083
|
-
keyDownHandler(event) {
|
|
128084
|
-
this._tabPressed = false;
|
|
128085
|
-
if (event.ctrlKey) {
|
|
128086
|
-
if (event.key === "f" || event.key === "F") {
|
|
128087
|
-
this.loadOptions(SearchMode.ADVANCED);
|
|
128088
|
-
//ATENÇÃO: Ctrl + F tem ação específica nos browsers
|
|
128089
|
-
//nesse caso, como vamos abrir o popup de busca avançada,
|
|
128090
|
-
//não é interessante deixar o evento propagar;
|
|
128091
|
-
event.stopPropagation();
|
|
128092
|
-
event.stopImmediatePropagation();
|
|
128093
|
-
event.preventDefault();
|
|
128094
|
-
}
|
|
128095
|
-
}
|
|
128096
|
-
switch (event.key) {
|
|
128097
|
-
case "ArrowDown":
|
|
128098
|
-
this.nextOption();
|
|
128099
|
-
event.stopPropagation();
|
|
128100
|
-
break;
|
|
128101
|
-
case "ArrowUp":
|
|
128102
|
-
this.previousOption();
|
|
128103
|
-
event.stopPropagation();
|
|
128104
|
-
break;
|
|
128105
|
-
case "Enter":
|
|
128106
|
-
this.selectCurrentOption();
|
|
128107
|
-
break;
|
|
128108
|
-
case "Escape":
|
|
128109
|
-
this.cancelPreselection();
|
|
128110
|
-
break;
|
|
128111
|
-
case "Tab":
|
|
128112
|
-
this._tabPressed = true;
|
|
128113
|
-
this.controlListWithOnlyOne();
|
|
128114
|
-
break;
|
|
128115
|
-
}
|
|
128116
|
-
//ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
|
|
128117
|
-
//Por exemplo, quando o usuário dá um Enter, além de selecionar
|
|
128118
|
-
//um valor, também significa que a ateração finalizou,
|
|
128119
|
-
//e o contexto pode reagir (fechar um popup por exemplo).
|
|
128120
|
-
//event.stopPropagation();
|
|
128121
|
-
}
|
|
128122
|
-
onTextInputFocusOutHandler() {
|
|
128123
|
-
if (this.hideErrorOnFocusOut)
|
|
128124
|
-
this.cancelPreselection();
|
|
128125
|
-
}
|
|
128126
|
-
canShowListOptions() {
|
|
128127
|
-
return !this._showLoading && this._visibleOptions.length > 0;
|
|
127713
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
128128
127714
|
}
|
|
128129
127715
|
render() {
|
|
128130
|
-
|
|
128131
|
-
ElementIDUtils.
|
|
128132
|
-
return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "search" })), ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
|
|
128133
|
-
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
128134
|
-
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
128135
|
-
&& this._visibleOptions.length === 0
|
|
128136
|
-
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
128137
|
-
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem }), this.canShowListOptions() && this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
127716
|
+
ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
|
|
127717
|
+
return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, hideErrorOnFocusOut: this.hideErrorOnFocusOut, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode, canShowError: this.canShowError, listOptionsPosition: this.listOptionsPosition, isTextSearch: this.isTextSearch, limitCharsToSearch: this.ignoreLimitCharsToSearch ? 0 : 3 }));
|
|
128138
127718
|
}
|
|
128139
|
-
|
|
127719
|
+
;
|
|
127720
|
+
get _elem() { return this; }
|
|
128140
127721
|
static get watchers() { return {
|
|
128141
127722
|
"errorMessage": ["observeErrorMessage"],
|
|
128142
|
-
"value": ["observeValue"]
|
|
128143
|
-
"options": ["observeOptions"]
|
|
127723
|
+
"value": ["observeValue"]
|
|
128144
127724
|
}; }
|
|
128145
127725
|
static get style() { return ezSearchCss; }
|
|
128146
127726
|
};
|
|
128147
|
-
var SearchMode;
|
|
128148
|
-
(function (SearchMode) {
|
|
128149
|
-
SearchMode["ADVANCED"] = "ADVANCED";
|
|
128150
|
-
SearchMode["PRELOAD"] = "PRELOAD";
|
|
128151
|
-
SearchMode["PREDICTIVE"] = "PREDICTIVE";
|
|
128152
|
-
})(SearchMode || (SearchMode = {}));
|
|
128153
127727
|
|
|
128154
127728
|
const ezSidebarButtonCss = ":host{position:relative;--ez-sidebar-button--width:6px;--ez-sidebar-button--hover--width:12px;--ez-sidebar-button--height:96px;--ez-sidebar-button--background-color--xlight:var(--background--xlight, #fff);--ez-sidebar-button--background-color--primary:var(--color--primary);--ez-sidebar-button--space--small:var(--space--small, 6px);--ez-sidebar-button--space--medium:var(--space--medium, 12px);--ez-sidebar-button--box-shadow:var(--shadow--small, 0px 0px 16px rgba(0, 38, 111, 0.07));--ez-sidebar-button--hover--box-shadow:var(--shadow--hard, 0px 0px 16px rgba(43, 58, 84, 0.24));--ez-sidebar-button--border--radius-small:var(--border--radius-small);--ez-sidebar-button--border--radius-medium:var(--border--radius-medium)}button{position:absolute;display:flex;background:var(--ez-sidebar-button--background-color--xlight);border:0;border-radius:0 var(--ez-sidebar-button--border--radius-medium) var(--ez-sidebar-button--border--radius-medium) 0;box-shadow:var(--ez-sidebar-button--box-shadow);padding:0;cursor:pointer}span{width:var(--ez-sidebar-button--width);height:var(--ez-sidebar-button--height);margin:var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--small) var(--ez-sidebar-button--space--medium) 0;background:var(--ez-sidebar-button--background-color--primary);border-radius:0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0}button:hover{box-shadow:var(--ez-sidebar-button--hover--box-shadow)}button:hover span{width:var(--ez-sidebar-button--hover--width);margin:var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--medium) 0}";
|
|
128155
127729
|
|
|
@@ -128927,7 +128501,7 @@ Grid.prototype.destroy = function destroy (immediate) {
|
|
|
128927
128501
|
|
|
128928
128502
|
function index (options) { return new Grid(options); }
|
|
128929
128503
|
|
|
128930
|
-
const ezSplitPanelCss = ".ez-split-gutter{cursor:grab;background-color:transparent}";
|
|
128504
|
+
const ezSplitPanelCss = ".ez-split-gutter{cursor:grab;background-color:transparent}.ez-split-panel--header{display:flex;align-items:center;justify-content:space-between;height:30px}";
|
|
128931
128505
|
|
|
128932
128506
|
const SplitPanel = class extends HTMLElement$1 {
|
|
128933
128507
|
constructor() {
|
|
@@ -128935,6 +128509,7 @@ const SplitPanel = class extends HTMLElement$1 {
|
|
|
128935
128509
|
this.__registerHost();
|
|
128936
128510
|
this._items = [];
|
|
128937
128511
|
this.direction = 'column';
|
|
128512
|
+
this.label = undefined;
|
|
128938
128513
|
}
|
|
128939
128514
|
componentDidLoad() {
|
|
128940
128515
|
this._panelID = StringUtils$1.generateUUID();
|
|
@@ -129013,7 +128588,7 @@ const SplitPanel = class extends HTMLElement$1 {
|
|
|
129013
128588
|
return template;
|
|
129014
128589
|
}
|
|
129015
128590
|
render() {
|
|
129016
|
-
return (h(Host, { style: this.getElementStyle() }));
|
|
128591
|
+
return (h(Host, { style: this.getElementStyle() }, h("div", { class: "ez-split-panel--header ez-margin-top--small ez-margin-bottom--small" }, h("div", { class: "ez-margin-left--small" }, this.label), h("div", { class: "ez-margin-right--small" }, h("slot", { name: "rightButtons" }))), h("slot", null)));
|
|
129017
128592
|
}
|
|
129018
128593
|
get _element() { return this; }
|
|
129019
128594
|
static get style() { return ezSplitPanelCss; }
|
|
@@ -131231,7 +130806,7 @@ const EzCardItem = /*@__PURE__*/proxyCustomElement(EzCardItem$1, [1,"ez-card-ite
|
|
|
131231
130806
|
const EzCheck = /*@__PURE__*/proxyCustomElement(EzCheck$1, [1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4]}]);
|
|
131232
130807
|
const EzChip = /*@__PURE__*/proxyCustomElement(EzChip$1, [1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"]}]);
|
|
131233
130808
|
const EzCollapsibleBox = /*@__PURE__*/proxyCustomElement(EzCollapsibleBox$1, [1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32]}]);
|
|
131234
|
-
const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
|
|
130809
|
+
const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
|
|
131235
130810
|
const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"]}]);
|
|
131236
130811
|
const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"]}]);
|
|
131237
130812
|
const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040]},[[8,"keydown","handleKeyDown"]]]);
|
|
@@ -131253,11 +130828,11 @@ const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{
|
|
|
131253
130828
|
const EzPopup = /*@__PURE__*/proxyCustomElement(EzPopup$1, [1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]);
|
|
131254
130829
|
const EzRadioButton = /*@__PURE__*/proxyCustomElement(EzRadioButton$1, [1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]);
|
|
131255
130830
|
const EzScroller = /*@__PURE__*/proxyCustomElement(EzScroller$1, [1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]);
|
|
131256
|
-
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"]
|
|
130831
|
+
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"]}]);
|
|
131257
130832
|
const EzSidebarButton = /*@__PURE__*/proxyCustomElement(EzSidebarButton$1, [1,"ez-sidebar-button"]);
|
|
131258
130833
|
const EzSkeleton = /*@__PURE__*/proxyCustomElement(EzSkeleton$1, [0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]);
|
|
131259
130834
|
const EzSplitItem = /*@__PURE__*/proxyCustomElement(SplitItem, [0,"ez-split-item"]);
|
|
131260
|
-
const EzSplitPanel = /*@__PURE__*/proxyCustomElement(SplitPanel, [
|
|
130835
|
+
const EzSplitPanel = /*@__PURE__*/proxyCustomElement(SplitPanel, [4,"ez-split-panel",{"direction":[1],"label":[1]}]);
|
|
131261
130836
|
const EzTabselector = /*@__PURE__*/proxyCustomElement(EzTabselector$1, [1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]);
|
|
131262
130837
|
const EzTextArea = /*@__PURE__*/proxyCustomElement(EzTextArea$1, [1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"]}]);
|
|
131263
130838
|
const EzTextEdit = /*@__PURE__*/proxyCustomElement(EzTextEdit$1, [1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32]}]);
|