@sankhyalabs/ezui 3.1.6 → 3.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-combo-box.cjs.entry.js +45 -22
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +46 -23
- package/dist/custom-elements/index.js +46 -23
- package/dist/esm/ez-combo-box.entry.js +46 -23
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-5473e08d.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-30afcb93.entry.js +0 -1
|
@@ -64,10 +64,7 @@ const EzComboBox = class {
|
|
|
64
64
|
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
65
65
|
this.ezChange.emit(valueEmitted);
|
|
66
66
|
}
|
|
67
|
-
this.
|
|
68
|
-
this._criteria = undefined;
|
|
69
|
-
this._preSelection = undefined;
|
|
70
|
-
this.updateVisibleOptions();
|
|
67
|
+
this.resetOptions();
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
/**
|
|
@@ -89,7 +86,7 @@ const EzComboBox = class {
|
|
|
89
86
|
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
90
87
|
}
|
|
91
88
|
isDifferentValues(firstValue, secondValue) {
|
|
92
|
-
return
|
|
89
|
+
return core.ObjectUtils.objectToString(firstValue || {}) !== core.ObjectUtils.objectToString(secondValue || {});
|
|
93
90
|
}
|
|
94
91
|
getFormattedText(currentValue) {
|
|
95
92
|
if (currentValue == undefined) {
|
|
@@ -261,19 +258,17 @@ const EzComboBox = class {
|
|
|
261
258
|
selectOption(newOption) {
|
|
262
259
|
var _a, _b;
|
|
263
260
|
const currentValue = this.getSelectedOption(this.value);
|
|
264
|
-
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()))
|
|
261
|
+
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()))
|
|
262
|
+
|| (currentValue == undefined && "value" in newOption)) {
|
|
265
263
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
266
264
|
this.value = adjustedOpt;
|
|
267
265
|
}
|
|
268
266
|
else {
|
|
269
|
-
this.
|
|
270
|
-
this.hideOptions();
|
|
271
|
-
}
|
|
272
|
-
if (this.searchMode) {
|
|
273
|
-
this._visibleOptions = [];
|
|
267
|
+
this.resetOptions();
|
|
274
268
|
}
|
|
275
269
|
if (this.searchMode) {
|
|
276
270
|
this._visibleOptions = [];
|
|
271
|
+
this.clearSource();
|
|
277
272
|
}
|
|
278
273
|
}
|
|
279
274
|
loadOptions(mode, argument = "") {
|
|
@@ -292,8 +287,11 @@ const EzComboBox = class {
|
|
|
292
287
|
this.selectOption(undefined);
|
|
293
288
|
}
|
|
294
289
|
else {
|
|
295
|
-
|
|
290
|
+
window.setTimeout(() => {
|
|
291
|
+
this.setInputValue();
|
|
292
|
+
}, this._deboucingTime);
|
|
296
293
|
}
|
|
294
|
+
this.resetOptions();
|
|
297
295
|
}
|
|
298
296
|
setInputValue(clearError = true) {
|
|
299
297
|
const textValue = this.getText();
|
|
@@ -308,8 +306,9 @@ const EzComboBox = class {
|
|
|
308
306
|
this.value = null;
|
|
309
307
|
}
|
|
310
308
|
controlListWithOnlyOne() {
|
|
309
|
+
var _a;
|
|
311
310
|
if (this.searchMode) {
|
|
312
|
-
const source = this._visibleOptions;
|
|
311
|
+
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
313
312
|
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
314
313
|
this.selectOption(source[0]);
|
|
315
314
|
}
|
|
@@ -392,6 +391,12 @@ const EzComboBox = class {
|
|
|
392
391
|
var _a;
|
|
393
392
|
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(constants.REQUIRED_INFO, "").toUpperCase();
|
|
394
393
|
}
|
|
394
|
+
resetOptions() {
|
|
395
|
+
this.hideOptions();
|
|
396
|
+
this._criteria = undefined;
|
|
397
|
+
this._preSelection = undefined;
|
|
398
|
+
this.updateVisibleOptions();
|
|
399
|
+
}
|
|
395
400
|
//---------------------------------------------
|
|
396
401
|
// Lifecycle web component
|
|
397
402
|
//---------------------------------------------
|
|
@@ -457,21 +462,35 @@ const EzComboBox = class {
|
|
|
457
462
|
this._textInput.value = event.data || argument;
|
|
458
463
|
}
|
|
459
464
|
this._criteria = argument;
|
|
460
|
-
if (argument
|
|
465
|
+
if (argument) {
|
|
461
466
|
if (this.searchMode) {
|
|
462
|
-
this._showLoading =
|
|
467
|
+
this._showLoading = false;
|
|
463
468
|
this.clearSource();
|
|
464
|
-
|
|
465
|
-
this.
|
|
466
|
-
|
|
469
|
+
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
470
|
+
this._showLoading = true;
|
|
471
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
472
|
+
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
473
|
+
}, this._deboucingTime);
|
|
474
|
+
this.showOptions();
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
this.hideOptions();
|
|
478
|
+
}
|
|
467
479
|
}
|
|
468
480
|
else {
|
|
469
481
|
this.updateVisibleOptions();
|
|
482
|
+
this.showOptions();
|
|
470
483
|
}
|
|
471
|
-
this.showOptions();
|
|
472
484
|
}
|
|
473
485
|
else {
|
|
474
486
|
this.hideOptions();
|
|
487
|
+
if (this.searchMode) {
|
|
488
|
+
this._showLoading = false;
|
|
489
|
+
this.clearSource();
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
this.updateVisibleOptions();
|
|
493
|
+
}
|
|
475
494
|
}
|
|
476
495
|
}
|
|
477
496
|
clearDeboucingTimeout() {
|
|
@@ -530,10 +549,14 @@ const EzComboBox = class {
|
|
|
530
549
|
core.ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
531
550
|
return (index.h(index.Host, null, index.h("ez-text-input", { "data-element-id": core.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 }, index.h("button", { class: "btn", slot: this.searchMode ? "leftIcon" : "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, index.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)
|
|
532
551
|
? index.h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, index.h("ez-icon", { iconName: "close" }))
|
|
533
|
-
: undefined), index.h("section", { class: "list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, index.h("div", { class: "list-options", ref: elem => this._optionsList = elem }, this.
|
|
534
|
-
&&
|
|
552
|
+
: undefined), index.h("section", { class: "list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, index.h("div", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
553
|
+
&& this._visibleOptions.length === 0
|
|
554
|
+
&& index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
555
|
+
&& index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.showOptionValue
|
|
535
556
|
? index.h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
|
|
536
|
-
: undefined, this.
|
|
557
|
+
: undefined, !this._showLoading
|
|
558
|
+
&& this._visibleOptions.length > 0
|
|
559
|
+
&& this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
537
560
|
}
|
|
538
561
|
get el() { return index.getElement(this); }
|
|
539
562
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementIDUtils, FloatingManager } from "@sankhyalabs/core";
|
|
1
|
+
import { ElementIDUtils, FloatingManager, ObjectUtils } from "@sankhyalabs/core";
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import { ApplicationUtils, CSSVarsUtils } from "../../utils";
|
|
4
4
|
import { REQUIRED_INFO } from "../../utils/constants";
|
|
@@ -52,10 +52,7 @@ export class EzComboBox {
|
|
|
52
52
|
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
53
53
|
this.ezChange.emit(valueEmitted);
|
|
54
54
|
}
|
|
55
|
-
this.
|
|
56
|
-
this._criteria = undefined;
|
|
57
|
-
this._preSelection = undefined;
|
|
58
|
-
this.updateVisibleOptions();
|
|
55
|
+
this.resetOptions();
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
/**
|
|
@@ -77,7 +74,7 @@ export class EzComboBox {
|
|
|
77
74
|
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
78
75
|
}
|
|
79
76
|
isDifferentValues(firstValue, secondValue) {
|
|
80
|
-
return
|
|
77
|
+
return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
|
|
81
78
|
}
|
|
82
79
|
getFormattedText(currentValue) {
|
|
83
80
|
if (currentValue == undefined) {
|
|
@@ -249,19 +246,17 @@ export class EzComboBox {
|
|
|
249
246
|
selectOption(newOption) {
|
|
250
247
|
var _a, _b;
|
|
251
248
|
const currentValue = this.getSelectedOption(this.value);
|
|
252
|
-
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()))
|
|
249
|
+
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()))
|
|
250
|
+
|| (currentValue == undefined && "value" in newOption)) {
|
|
253
251
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
254
252
|
this.value = adjustedOpt;
|
|
255
253
|
}
|
|
256
254
|
else {
|
|
257
|
-
this.
|
|
258
|
-
this.hideOptions();
|
|
259
|
-
}
|
|
260
|
-
if (this.searchMode) {
|
|
261
|
-
this._visibleOptions = [];
|
|
255
|
+
this.resetOptions();
|
|
262
256
|
}
|
|
263
257
|
if (this.searchMode) {
|
|
264
258
|
this._visibleOptions = [];
|
|
259
|
+
this.clearSource();
|
|
265
260
|
}
|
|
266
261
|
}
|
|
267
262
|
loadOptions(mode, argument = "") {
|
|
@@ -280,8 +275,11 @@ export class EzComboBox {
|
|
|
280
275
|
this.selectOption(undefined);
|
|
281
276
|
}
|
|
282
277
|
else {
|
|
283
|
-
|
|
278
|
+
window.setTimeout(() => {
|
|
279
|
+
this.setInputValue();
|
|
280
|
+
}, this._deboucingTime);
|
|
284
281
|
}
|
|
282
|
+
this.resetOptions();
|
|
285
283
|
}
|
|
286
284
|
setInputValue(clearError = true) {
|
|
287
285
|
const textValue = this.getText();
|
|
@@ -296,8 +294,9 @@ export class EzComboBox {
|
|
|
296
294
|
this.value = null;
|
|
297
295
|
}
|
|
298
296
|
controlListWithOnlyOne() {
|
|
297
|
+
var _a;
|
|
299
298
|
if (this.searchMode) {
|
|
300
|
-
const source = this._visibleOptions;
|
|
299
|
+
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
301
300
|
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
302
301
|
this.selectOption(source[0]);
|
|
303
302
|
}
|
|
@@ -380,6 +379,12 @@ export class EzComboBox {
|
|
|
380
379
|
var _a;
|
|
381
380
|
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
|
|
382
381
|
}
|
|
382
|
+
resetOptions() {
|
|
383
|
+
this.hideOptions();
|
|
384
|
+
this._criteria = undefined;
|
|
385
|
+
this._preSelection = undefined;
|
|
386
|
+
this.updateVisibleOptions();
|
|
387
|
+
}
|
|
383
388
|
//---------------------------------------------
|
|
384
389
|
// Lifecycle web component
|
|
385
390
|
//---------------------------------------------
|
|
@@ -445,21 +450,35 @@ export class EzComboBox {
|
|
|
445
450
|
this._textInput.value = event.data || argument;
|
|
446
451
|
}
|
|
447
452
|
this._criteria = argument;
|
|
448
|
-
if (argument
|
|
453
|
+
if (argument) {
|
|
449
454
|
if (this.searchMode) {
|
|
450
|
-
this._showLoading =
|
|
455
|
+
this._showLoading = false;
|
|
451
456
|
this.clearSource();
|
|
452
|
-
|
|
453
|
-
this.
|
|
454
|
-
|
|
457
|
+
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
458
|
+
this._showLoading = true;
|
|
459
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
460
|
+
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
461
|
+
}, this._deboucingTime);
|
|
462
|
+
this.showOptions();
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
this.hideOptions();
|
|
466
|
+
}
|
|
455
467
|
}
|
|
456
468
|
else {
|
|
457
469
|
this.updateVisibleOptions();
|
|
470
|
+
this.showOptions();
|
|
458
471
|
}
|
|
459
|
-
this.showOptions();
|
|
460
472
|
}
|
|
461
473
|
else {
|
|
462
474
|
this.hideOptions();
|
|
475
|
+
if (this.searchMode) {
|
|
476
|
+
this._showLoading = false;
|
|
477
|
+
this.clearSource();
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
this.updateVisibleOptions();
|
|
481
|
+
}
|
|
463
482
|
}
|
|
464
483
|
}
|
|
465
484
|
clearDeboucingTimeout() {
|
|
@@ -518,10 +537,14 @@ export class EzComboBox {
|
|
|
518
537
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
519
538
|
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)
|
|
520
539
|
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
521
|
-
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, this.
|
|
522
|
-
&&
|
|
540
|
+
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
541
|
+
&& this._visibleOptions.length === 0
|
|
542
|
+
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
543
|
+
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
523
544
|
? h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
|
|
524
|
-
: undefined, this.
|
|
545
|
+
: undefined, !this._showLoading
|
|
546
|
+
&& this._visibleOptions.length > 0
|
|
547
|
+
&& this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
525
548
|
}
|
|
526
549
|
static get is() { return "ez-combo-box"; }
|
|
527
550
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLElement as HTMLElement$1, createEvent, h, Host, forceUpdate, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
|
-
import { FloatingManager, ElementIDUtils, JSUtils, StringUtils as StringUtils$1,
|
|
3
|
+
import { FloatingManager, ElementIDUtils, JSUtils, StringUtils as StringUtils$1, ObjectUtils as ObjectUtils$1, DateUtils as DateUtils$1, TimeFormatter, Action, WaitingChangeException, ApplicationContext, UserInterface, DataUnitAction, DataUnit, NumberUtils as NumberUtils$1, DataType, SortMode, MaskFormatter } from '@sankhyalabs/core';
|
|
4
4
|
|
|
5
5
|
var DialogType;
|
|
6
6
|
(function (DialogType) {
|
|
@@ -1361,10 +1361,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1361
1361
|
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
1362
1362
|
this.ezChange.emit(valueEmitted);
|
|
1363
1363
|
}
|
|
1364
|
-
this.
|
|
1365
|
-
this._criteria = undefined;
|
|
1366
|
-
this._preSelection = undefined;
|
|
1367
|
-
this.updateVisibleOptions();
|
|
1364
|
+
this.resetOptions();
|
|
1368
1365
|
}
|
|
1369
1366
|
}
|
|
1370
1367
|
/**
|
|
@@ -1386,7 +1383,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1386
1383
|
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
1387
1384
|
}
|
|
1388
1385
|
isDifferentValues(firstValue, secondValue) {
|
|
1389
|
-
return
|
|
1386
|
+
return ObjectUtils$1.objectToString(firstValue || {}) !== ObjectUtils$1.objectToString(secondValue || {});
|
|
1390
1387
|
}
|
|
1391
1388
|
getFormattedText(currentValue) {
|
|
1392
1389
|
if (currentValue == undefined) {
|
|
@@ -1558,19 +1555,17 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1558
1555
|
selectOption(newOption) {
|
|
1559
1556
|
var _a, _b;
|
|
1560
1557
|
const currentValue = this.getSelectedOption(this.value);
|
|
1561
|
-
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()))
|
|
1558
|
+
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()))
|
|
1559
|
+
|| (currentValue == undefined && "value" in newOption)) {
|
|
1562
1560
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
1563
1561
|
this.value = adjustedOpt;
|
|
1564
1562
|
}
|
|
1565
1563
|
else {
|
|
1566
|
-
this.
|
|
1567
|
-
this.hideOptions();
|
|
1568
|
-
}
|
|
1569
|
-
if (this.searchMode) {
|
|
1570
|
-
this._visibleOptions = [];
|
|
1564
|
+
this.resetOptions();
|
|
1571
1565
|
}
|
|
1572
1566
|
if (this.searchMode) {
|
|
1573
1567
|
this._visibleOptions = [];
|
|
1568
|
+
this.clearSource();
|
|
1574
1569
|
}
|
|
1575
1570
|
}
|
|
1576
1571
|
loadOptions(mode, argument = "") {
|
|
@@ -1589,8 +1584,11 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1589
1584
|
this.selectOption(undefined);
|
|
1590
1585
|
}
|
|
1591
1586
|
else {
|
|
1592
|
-
|
|
1587
|
+
window.setTimeout(() => {
|
|
1588
|
+
this.setInputValue();
|
|
1589
|
+
}, this._deboucingTime);
|
|
1593
1590
|
}
|
|
1591
|
+
this.resetOptions();
|
|
1594
1592
|
}
|
|
1595
1593
|
setInputValue(clearError = true) {
|
|
1596
1594
|
const textValue = this.getText();
|
|
@@ -1605,8 +1603,9 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1605
1603
|
this.value = null;
|
|
1606
1604
|
}
|
|
1607
1605
|
controlListWithOnlyOne() {
|
|
1606
|
+
var _a;
|
|
1608
1607
|
if (this.searchMode) {
|
|
1609
|
-
const source = this._visibleOptions;
|
|
1608
|
+
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
1610
1609
|
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
1611
1610
|
this.selectOption(source[0]);
|
|
1612
1611
|
}
|
|
@@ -1689,6 +1688,12 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1689
1688
|
var _a;
|
|
1690
1689
|
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
|
|
1691
1690
|
}
|
|
1691
|
+
resetOptions() {
|
|
1692
|
+
this.hideOptions();
|
|
1693
|
+
this._criteria = undefined;
|
|
1694
|
+
this._preSelection = undefined;
|
|
1695
|
+
this.updateVisibleOptions();
|
|
1696
|
+
}
|
|
1692
1697
|
//---------------------------------------------
|
|
1693
1698
|
// Lifecycle web component
|
|
1694
1699
|
//---------------------------------------------
|
|
@@ -1754,21 +1759,35 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1754
1759
|
this._textInput.value = event.data || argument;
|
|
1755
1760
|
}
|
|
1756
1761
|
this._criteria = argument;
|
|
1757
|
-
if (argument
|
|
1762
|
+
if (argument) {
|
|
1758
1763
|
if (this.searchMode) {
|
|
1759
|
-
this._showLoading =
|
|
1764
|
+
this._showLoading = false;
|
|
1760
1765
|
this.clearSource();
|
|
1761
|
-
|
|
1762
|
-
this.
|
|
1763
|
-
|
|
1766
|
+
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
1767
|
+
this._showLoading = true;
|
|
1768
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
1769
|
+
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
1770
|
+
}, this._deboucingTime);
|
|
1771
|
+
this.showOptions();
|
|
1772
|
+
}
|
|
1773
|
+
else {
|
|
1774
|
+
this.hideOptions();
|
|
1775
|
+
}
|
|
1764
1776
|
}
|
|
1765
1777
|
else {
|
|
1766
1778
|
this.updateVisibleOptions();
|
|
1779
|
+
this.showOptions();
|
|
1767
1780
|
}
|
|
1768
|
-
this.showOptions();
|
|
1769
1781
|
}
|
|
1770
1782
|
else {
|
|
1771
1783
|
this.hideOptions();
|
|
1784
|
+
if (this.searchMode) {
|
|
1785
|
+
this._showLoading = false;
|
|
1786
|
+
this.clearSource();
|
|
1787
|
+
}
|
|
1788
|
+
else {
|
|
1789
|
+
this.updateVisibleOptions();
|
|
1790
|
+
}
|
|
1772
1791
|
}
|
|
1773
1792
|
}
|
|
1774
1793
|
clearDeboucingTimeout() {
|
|
@@ -1827,10 +1846,14 @@ const EzComboBox$1 = class extends HTMLElement$1 {
|
|
|
1827
1846
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
1828
1847
|
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)
|
|
1829
1848
|
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
1830
|
-
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, this.
|
|
1831
|
-
&&
|
|
1849
|
+
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
1850
|
+
&& this._visibleOptions.length === 0
|
|
1851
|
+
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
1852
|
+
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
1832
1853
|
? h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
|
|
1833
|
-
: undefined, this.
|
|
1854
|
+
: undefined, !this._showLoading
|
|
1855
|
+
&& this._visibleOptions.length > 0
|
|
1856
|
+
&& this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
1834
1857
|
}
|
|
1835
1858
|
get el() { return this; }
|
|
1836
1859
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c27164d3.js';
|
|
2
|
-
import { FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ObjectUtils, FloatingManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as ApplicationUtils } from './ApplicationUtils-79bf1d95.js';
|
|
4
4
|
import { C as CSSVarsUtils } from './CSSVarsUtils-00f67f32.js';
|
|
5
5
|
import './DialogType-54a62731.js';
|
|
@@ -60,10 +60,7 @@ const EzComboBox = class {
|
|
|
60
60
|
const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
|
|
61
61
|
this.ezChange.emit(valueEmitted);
|
|
62
62
|
}
|
|
63
|
-
this.
|
|
64
|
-
this._criteria = undefined;
|
|
65
|
-
this._preSelection = undefined;
|
|
66
|
-
this.updateVisibleOptions();
|
|
63
|
+
this.resetOptions();
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
/**
|
|
@@ -85,7 +82,7 @@ const EzComboBox = class {
|
|
|
85
82
|
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
86
83
|
}
|
|
87
84
|
isDifferentValues(firstValue, secondValue) {
|
|
88
|
-
return
|
|
85
|
+
return ObjectUtils.objectToString(firstValue || {}) !== ObjectUtils.objectToString(secondValue || {});
|
|
89
86
|
}
|
|
90
87
|
getFormattedText(currentValue) {
|
|
91
88
|
if (currentValue == undefined) {
|
|
@@ -257,19 +254,17 @@ const EzComboBox = class {
|
|
|
257
254
|
selectOption(newOption) {
|
|
258
255
|
var _a, _b;
|
|
259
256
|
const currentValue = this.getSelectedOption(this.value);
|
|
260
|
-
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()))
|
|
257
|
+
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()))
|
|
258
|
+
|| (currentValue == undefined && "value" in newOption)) {
|
|
261
259
|
const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
|
|
262
260
|
this.value = adjustedOpt;
|
|
263
261
|
}
|
|
264
262
|
else {
|
|
265
|
-
this.
|
|
266
|
-
this.hideOptions();
|
|
267
|
-
}
|
|
268
|
-
if (this.searchMode) {
|
|
269
|
-
this._visibleOptions = [];
|
|
263
|
+
this.resetOptions();
|
|
270
264
|
}
|
|
271
265
|
if (this.searchMode) {
|
|
272
266
|
this._visibleOptions = [];
|
|
267
|
+
this.clearSource();
|
|
273
268
|
}
|
|
274
269
|
}
|
|
275
270
|
loadOptions(mode, argument = "") {
|
|
@@ -288,8 +283,11 @@ const EzComboBox = class {
|
|
|
288
283
|
this.selectOption(undefined);
|
|
289
284
|
}
|
|
290
285
|
else {
|
|
291
|
-
|
|
286
|
+
window.setTimeout(() => {
|
|
287
|
+
this.setInputValue();
|
|
288
|
+
}, this._deboucingTime);
|
|
292
289
|
}
|
|
290
|
+
this.resetOptions();
|
|
293
291
|
}
|
|
294
292
|
setInputValue(clearError = true) {
|
|
295
293
|
const textValue = this.getText();
|
|
@@ -304,8 +302,9 @@ const EzComboBox = class {
|
|
|
304
302
|
this.value = null;
|
|
305
303
|
}
|
|
306
304
|
controlListWithOnlyOne() {
|
|
305
|
+
var _a;
|
|
307
306
|
if (this.searchMode) {
|
|
308
|
-
const source = this._visibleOptions;
|
|
307
|
+
const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
|
|
309
308
|
if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
|
|
310
309
|
this.selectOption(source[0]);
|
|
311
310
|
}
|
|
@@ -388,6 +387,12 @@ const EzComboBox = class {
|
|
|
388
387
|
var _a;
|
|
389
388
|
return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
|
|
390
389
|
}
|
|
390
|
+
resetOptions() {
|
|
391
|
+
this.hideOptions();
|
|
392
|
+
this._criteria = undefined;
|
|
393
|
+
this._preSelection = undefined;
|
|
394
|
+
this.updateVisibleOptions();
|
|
395
|
+
}
|
|
391
396
|
//---------------------------------------------
|
|
392
397
|
// Lifecycle web component
|
|
393
398
|
//---------------------------------------------
|
|
@@ -453,21 +458,35 @@ const EzComboBox = class {
|
|
|
453
458
|
this._textInput.value = event.data || argument;
|
|
454
459
|
}
|
|
455
460
|
this._criteria = argument;
|
|
456
|
-
if (argument
|
|
461
|
+
if (argument) {
|
|
457
462
|
if (this.searchMode) {
|
|
458
|
-
this._showLoading =
|
|
463
|
+
this._showLoading = false;
|
|
459
464
|
this.clearSource();
|
|
460
|
-
|
|
461
|
-
this.
|
|
462
|
-
|
|
465
|
+
if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
|
|
466
|
+
this._showLoading = true;
|
|
467
|
+
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
468
|
+
this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
|
|
469
|
+
}, this._deboucingTime);
|
|
470
|
+
this.showOptions();
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
this.hideOptions();
|
|
474
|
+
}
|
|
463
475
|
}
|
|
464
476
|
else {
|
|
465
477
|
this.updateVisibleOptions();
|
|
478
|
+
this.showOptions();
|
|
466
479
|
}
|
|
467
|
-
this.showOptions();
|
|
468
480
|
}
|
|
469
481
|
else {
|
|
470
482
|
this.hideOptions();
|
|
483
|
+
if (this.searchMode) {
|
|
484
|
+
this._showLoading = false;
|
|
485
|
+
this.clearSource();
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
this.updateVisibleOptions();
|
|
489
|
+
}
|
|
471
490
|
}
|
|
472
491
|
}
|
|
473
492
|
clearDeboucingTimeout() {
|
|
@@ -526,10 +545,14 @@ const EzComboBox = class {
|
|
|
526
545
|
ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
|
|
527
546
|
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)
|
|
528
547
|
? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
|
529
|
-
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, this.
|
|
530
|
-
&&
|
|
548
|
+
: undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("div", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
|
|
549
|
+
&& this._visibleOptions.length === 0
|
|
550
|
+
&& h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
|
|
551
|
+
&& h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
|
|
531
552
|
? h("span", { class: "item__value item__value--hidden", ref: elem => this._itemValueBasis = elem })
|
|
532
|
-
: undefined, this.
|
|
553
|
+
: undefined, !this._showLoading
|
|
554
|
+
&& this._visibleOptions.length > 0
|
|
555
|
+
&& this._visibleOptions.map((opt, index) => this.buildItem(opt, index)))))));
|
|
533
556
|
}
|
|
534
557
|
get el() { return getElement(this); }
|
|
535
558
|
static get watchers() { return {
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-00ea9b50.js";export{s as setNonce}from"./p-00ea9b50.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-8f1a5e21",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-51ecf138",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-bb0607a6",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],show:[64]}]]],["p-bf442859",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-7932f93d",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-064e558f",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-85c1e00f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-149442dd",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-a0e47238",[[0,"ez-application"]]],["p-216e1153",[[1,"ez-card-item",{item:[16]}]]],["p-74b3615b",[[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-044a3427",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-1cfae451",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-bb011a51",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-78b28632",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-936ae3ac",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-68acdc61",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-93c8bdc6",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-90c3d4fd",[[2,"ez-form-view",{fields:[16]}]]],["p-38520b9c",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-1806b3c6",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-bfca509e",[[1,"ez-guide-navigator",{open:[1540],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64]}]]],["p-e6cf82e8",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-d015295f",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-e8271a0e",[[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],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-77d70bae",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-cd1e0679",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-124859c3",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-aaba630e",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-330aef41",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[516],mode:[513],getMode:[64],setFocus:[64]}]]],["p-66dba09c",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-74379544",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-00ea9b50.js";export{s as setNonce}from"./p-00ea9b50.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-8f1a5e21",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-51ecf138",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-bb0607a6",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],show:[64]}]]],["p-bf442859",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-7932f93d",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-064e558f",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-85c1e00f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-149442dd",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-a0e47238",[[0,"ez-application"]]],["p-216e1153",[[1,"ez-card-item",{item:[16]}]]],["p-74b3615b",[[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-044a3427",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-1cfae451",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-bb011a51",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-78b28632",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-936ae3ac",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-68acdc61",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-93c8bdc6",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-90c3d4fd",[[2,"ez-form-view",{fields:[16]}]]],["p-38520b9c",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-1806b3c6",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-bfca509e",[[1,"ez-guide-navigator",{open:[1540],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64]}]]],["p-e6cf82e8",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-d015295f",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-e8271a0e",[[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],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-77d70bae",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-cd1e0679",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-124859c3",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-aaba630e",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-330aef41",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[516],mode:[513],getMode:[64],setFocus:[64]}]]],["p-66dba09c",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-74379544",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-5473e08d",[[1,"ez-combo-box",{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],_preSelection:[32],_visibleOptions:[32],_startLoading:[32],_showLoading:[32],_criteria:[32],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-7ff5d0cc",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-ce1408dd",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-0e4ab096",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}],[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"]]],[1,"ez-sidebar-button"],[1,"ez-tree",{items:[1040],value:[1040],selectedId:[1537,"selected-id"],iconResolver:[16],tooltipResolver:[16],_tree:[32],_waintingForLoad:[32],selectItem:[64],openItem:[64],disableItem:[64],enableItem:[64],addChild:[64],applyFilter:[64]},[[2,"keydown","onKeyDownListener"]]]]],["p-80f79b1c",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-07d71b7a",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-1a1c2eda",[[2,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],multiLevel:[4,"multi-level"],levelResolver:[16],contentBuilder:[16],validate:[64]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as i,h as t,H as s,g as e}from"./p-00ea9b50.js";import{ObjectUtils as r,FloatingManager as l,ElementIDUtils as a}from"@sankhyalabs/core";import{A as h}from"./p-efb43dd8.js";import{C as n}from"./p-4a5e37a7.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as c}from"./p-3f4ae3a3.js";const b=class{constructor(t){o(this,t),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.searchMode=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var o;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(o=this.errorMessage)||void 0===o?void 0:o.trim())||this.setInputValue())}observeValue(o,i){if(this._textInput&&o!=i){const t=this.getSelectedOption(o),s=this.getSelectedOption(i),e=this.getSelectedOption(this.value);this.isDifferentValues(e,t)&&(this.value=t),this.isDifferentValues(t,s)&&(this.setInputValue(),this.ezChange.emit(null===t?void 0:t)),this.resetOptions()}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}isDifferentValues(o,i){return r.objectToString(o||{})!==r.objectToString(i||{})}getFormattedText(o){if(null!=o){if(!this.showSelectedValue||null==o.value)return o.label;if(o.label)return`${o.value} - ${o.label}`}}getText(){const o=this.getSelectedOption(this.value),i=this.getFormattedText(o);if(null!=i)return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(o){return"string"==typeof o||o instanceof String?this._visibleOptions.find((i=>i.value===o)):o}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const i=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(i)>-1))}this._visibleOptions=this.suppressEmptyOption?o:[{value:void 0,label:""}].concat(o),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var o;if(this.showOptionValue){const i=[];return null===(o=this._visibleOptions)||void 0===o||o.forEach((o=>{const t=this.getWidthValue(o.value);i.includes(t)||i.push(t)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(o){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=o)return i.innerHTML=o,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}buildItem(o,i){const s=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return o.label=o.label||(o.value?`<SEM ${this.getFieldLabel()}>`:""),t("li",{class:i===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=i},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:s,minWidth:s,maxWidth:s}},o.value):void 0,t("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:o.label},o.label))}showOptions(){this.enabled&&(this._floatingID=l.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"6px":"-13px"}),this.setFocus(),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&l.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&l.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,i){window.requestAnimationFrame((()=>{const t=(null==o?void 0:o.value)?this._optionsList.querySelector(`li#item_${o.value}`):void 0;if(t){const o=t.parentElement,s=o.getBoundingClientRect(),e=t.getBoundingClientRect();i&&e.bottom>s.bottom?o.scrollTop=e.height*(this._preSelection-3):!i&&e.top<s.top&&(o.scrollTop=e.height*this._preSelection)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(o){this._startLoading=!1,o instanceof Promise?(this._showLoading=!0,o.then((o=>{this._showLoading=!1,this.updateSource(o)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(o)?(this._source=o,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(o))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(o){var i,t;const s=this.getSelectedOption(this.value);(null===(i=null==s?void 0:s.value)||void 0===i?void 0:i.toString())!==(null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.toString())||null==s&&"value"in o?this.value=(null==o?void 0:o.value)?o:void 0:this.resetOptions(),this.searchMode&&(this._visibleOptions=[],this.clearSource())}loadOptions(o,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(o=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,o&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var o;if(this.searchMode){const i=null===(o=this._visibleOptions)||void 0===o?void 0:o.filter((o=>""!==o.label&&null!=o.value));1===(null==i?void 0:i.length)&&this.selectOption(i[0])}}controlEmptySearch(){var o;this.searchMode&&((null===(o=this._visibleOptions)||void 0===o?void 0:o.length)?this.controlListWithOnlyOne():(this.clearSearch(),h.info(this._textEmptyList)))}validateDescriptionValue(){if(!this.searchMode||"object"!=typeof this.value)return;const{label:o,value:i}=this.value||{};o||null==i||this.loadDescriptionValue(i)}async loadDescriptionValue(o){var i,t;if(null==o)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(o);const s={mode:d.PREDICTIVE,argument:o},e=await(null===(t=this.optionLoader)||void 0===t?void 0:t.call(this,s));null!=e&&(e instanceof Promise?e.then((o=>{this.setDescriptionValue(o)})):this.setDescriptionValue(e))}setDescriptionValue(o){const i=(null==o?void 0:o[0])||o;null!=i&&Object.keys(i).length?(i.label||(i.label=`<SEM ${this.getFieldLabel()}>`),this.value=i):this.showNoResultMessage()}loadOptionValue(o){var i;const t=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===o));null!=t?this.selectOption(t):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),h.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var o;return null===(o=this.label)||void 0===o?void 0:o.replace(c,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let i=o.innerText,t=o.getAttribute("value");t||(t=i),this.options.push({label:i,value:t}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(d.PRELOAD)}componentDidRender(){var o;void 0===this._floatingID&&this._listWrapper.remove(),null===(o=this._optionsList)||void 0===o||o.querySelectorAll(".item").forEach((o=>{a.addIDInfoIfNotExists(o,"itemComboBox")}))}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}componentShouldUpdate(o,i){this.isDifferentValues(o,i)&&this.validateDescriptionValue()}handlerIconClick(){this.searchMode?this.loadOptions(d.ADVANCED):this.showOptions()}onTextInputChangeHandler(o){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(o)}),this._deboucingTime));const t=null===(i=o.target.value)||void 0===i?void 0:i.trim(),s=Number(t||void 0);this._criteria||(this._textInput.value=o.data||t),this._criteria=t,t?this.searchMode?(this._showLoading=!1,this.clearSource(),!isNaN(s)||t.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(d.PREDICTIVE,isNaN(s)?t:s.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.updateVisibleOptions(),this.showOptions()):(this.hideOptions(),this.searchMode?(this._showLoading=!1,this.clearSource()):this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(this._tabPressed=!1,o.ctrlKey&&("f"!==o.key&&"F"!==o.key||(this.loadOptions(d.ADVANCED),o.stopPropagation(),o.stopImmediatePropagation(),o.preventDefault())),o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){var o;return a.addIDInfoIfNotExists(this.el,"input"),t(s,null,t("ez-text-input",{"data-element-id":a.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:o=>this._textInput=o,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(o=this._textInput)||void 0===o?void 0:o.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:o=>this._listContainer=o},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("div",{class:"list-options",ref:o=>this._optionsList=o},!this._showLoading&&0===this._visibleOptions.length&&t("div",{class:"message"},t("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&t("div",{class:"message"},t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:o=>this._itemValueBasis=o}):void 0,!this._showLoading&&this._visibleOptions.length>0&&this._visibleOptions.map(((o,i)=>this.buildItem(o,i)))))))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var d;!function(o){o.ADVANCED="ADVANCED",o.PRELOAD="PRELOAD",o.PREDICTIVE="PREDICTIVE"}(d||(d={})),b.style=":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--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{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;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%;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)}}";export{b as ez_combo_box}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as i,h as t,H as e,g as s}from"./p-00ea9b50.js";import{FloatingManager as r,ElementIDUtils as l}from"@sankhyalabs/core";import{A as a}from"./p-efb43dd8.js";import{C as h}from"./p-4a5e37a7.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as n}from"./p-3f4ae3a3.js";const c=class{constructor(t){o(this,t),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.searchMode=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var o;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(o=this.errorMessage)||void 0===o?void 0:o.trim())||this.setInputValue())}observeValue(o,i){if(this._textInput&&o!=i){const t=this.getSelectedOption(o),e=this.getSelectedOption(i),s=this.getSelectedOption(this.value);this.isDifferentValues(s,t)&&(this.value=t),this.isDifferentValues(t,e)&&(this.setInputValue(),this.ezChange.emit(null===t?void 0:t)),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}isDifferentValues(o,i){return JSON.stringify(o||{})!==JSON.stringify(i||{})}getFormattedText(o){if(null!=o){if(!this.showSelectedValue||null==o.value)return o.label;if(o.label)return`${o.value} - ${o.label}`}}getText(){const o=this.getSelectedOption(this.value),i=this.getFormattedText(o);if(null!=i)return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(o){return"string"==typeof o||o instanceof String?this._visibleOptions.find((i=>i.value===o)):o}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const i=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(i)>-1))}this._visibleOptions=this.suppressEmptyOption?o:[{value:void 0,label:""}].concat(o),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var o;if(this.showOptionValue){const i=[];return null===(o=this._visibleOptions)||void 0===o||o.forEach((o=>{const t=this.getWidthValue(o.value);i.includes(t)||i.push(t)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(o){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=o)return i.innerHTML=o,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}buildItem(o,i){const e=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return o.label=o.label||(o.value?`<SEM ${this.getFieldLabel()}>`:""),t("li",{class:i===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=i},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:e,minWidth:e,maxWidth:e}},o.value):void 0,t("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:o.label},o.label))}showOptions(){this.enabled&&(this._floatingID=r.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"6px":"-13px"}),this.setFocus(),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,i){window.requestAnimationFrame((()=>{const t=(null==o?void 0:o.value)?this._optionsList.querySelector(`li#item_${o.value}`):void 0;if(t){const o=t.parentElement,e=o.getBoundingClientRect(),s=t.getBoundingClientRect();i&&s.bottom>e.bottom?o.scrollTop=s.height*(this._preSelection-3):!i&&s.top<e.top&&(o.scrollTop=s.height*this._preSelection)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(o){this._startLoading=!1,o instanceof Promise?(this._showLoading=!0,o.then((o=>{this._showLoading=!1,this.updateSource(o)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(o)?(this._source=o,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(o))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(o){var i,t;const e=this.getSelectedOption(this.value);(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.toString())!==(null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.toString())?this.value=(null==o?void 0:o.value)?o:void 0:(this.setInputValue(),this.hideOptions()),this.searchMode&&(this._visibleOptions=[]),this.searchMode&&(this._visibleOptions=[])}loadOptions(o,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):this.setInputValue()}setInputValue(o=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,o&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){if(this.searchMode){const o=this._visibleOptions;1===(null==o?void 0:o.length)&&this.selectOption(o[0])}}controlEmptySearch(){var o;this.searchMode&&((null===(o=this._visibleOptions)||void 0===o?void 0:o.length)?this.controlListWithOnlyOne():(this.clearSearch(),a.info(this._textEmptyList)))}validateDescriptionValue(){if(!this.searchMode||"object"!=typeof this.value)return;const{label:o,value:i}=this.value||{};o||null==i||this.loadDescriptionValue(i)}async loadDescriptionValue(o){var i,t;if(null==o)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(o);const e={mode:b.PREDICTIVE,argument:o},s=await(null===(t=this.optionLoader)||void 0===t?void 0:t.call(this,e));null!=s&&(s instanceof Promise?s.then((o=>{this.setDescriptionValue(o)})):this.setDescriptionValue(s))}setDescriptionValue(o){const i=(null==o?void 0:o[0])||o;null!=i&&Object.keys(i).length?(i.label||(i.label=`<SEM ${this.getFieldLabel()}>`),this.value=i):this.showNoResultMessage()}loadOptionValue(o){var i;const t=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===o));null!=t?this.selectOption(t):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),a.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var o;return null===(o=this.label)||void 0===o?void 0:o.replace(n,"").toUpperCase()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let i=o.innerText,t=o.getAttribute("value");t||(t=i),this.options.push({label:i,value:t}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(b.PRELOAD)}componentDidRender(){var o;void 0===this._floatingID&&this._listWrapper.remove(),null===(o=this._optionsList)||void 0===o||o.querySelectorAll(".item").forEach((o=>{l.addIDInfoIfNotExists(o,"itemComboBox")}))}componentDidLoad(){h.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}componentShouldUpdate(o,i){this.isDifferentValues(o,i)&&this.validateDescriptionValue()}handlerIconClick(){this.searchMode?this.loadOptions(b.ADVANCED):this.showOptions()}onTextInputChangeHandler(o){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(o)}),this._deboucingTime));const t=null===(i=o.target.value)||void 0===i?void 0:i.trim(),e=Number(t||void 0);this._criteria||(this._textInput.value=o.data||t),this._criteria=t,t&&(!isNaN(e)||t.length>=this._limitCharsToSearch)?(this.searchMode?(this._showLoading=!0,this.clearSource(),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(b.PREDICTIVE,isNaN(e)?t:e.toString())}),this._deboucingTime)):this.updateVisibleOptions(),this.showOptions()):this.hideOptions()}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(this._tabPressed=!1,o.ctrlKey&&("f"!==o.key&&"F"!==o.key||(this.loadOptions(b.ADVANCED),o.stopPropagation(),o.stopImmediatePropagation(),o.preventDefault())),o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){var o;return l.addIDInfoIfNotExists(this.el,"input"),t(e,null,t("ez-text-input",{"data-element-id":l.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:o=>this._textInput=o,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(o=this._textInput)||void 0===o?void 0:o.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:o=>this._listContainer=o},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("div",{class:"list-options",ref:o=>this._optionsList=o},0===this._visibleOptions.length&&t("div",{class:"message"},!this._showLoading&&t("span",{class:"message__no-result"},this._textEmptyList),this._showLoading&&t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:o=>this._itemValueBasis=o}):void 0,this._visibleOptions.length>0&&this._visibleOptions.map(((o,i)=>this.buildItem(o,i)))))))}get el(){return s(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var b;!function(o){o.ADVANCED="ADVANCED",o.PRELOAD="PRELOAD",o.PREDICTIVE="PREDICTIVE"}(b||(b={})),c.style=":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--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{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;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%;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)}}";export{c as ez_combo_box}
|