@sankhyalabs/ezui 5.20.0-dev.4 → 5.20.0-dev.6

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.
Files changed (39) hide show
  1. package/dist/cjs/ez-card-item_3.cjs.entry.js +182 -0
  2. package/dist/cjs/ez-combo-box.cjs.entry.js +11 -155
  3. package/dist/cjs/ez-search.cjs.entry.js +611 -31
  4. package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
  5. package/dist/cjs/ezui.cjs.js +1 -1
  6. package/dist/cjs/index-a7b0c73d.js +2 -6
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/collection-manifest.json +2 -2
  9. package/dist/collection/components/ez-card-item/ez-card-item.css +35 -0
  10. package/dist/collection/components/ez-combo-box/ez-combo-box.js +12 -173
  11. package/dist/collection/components/ez-search/ez-search.css +331 -0
  12. package/dist/collection/components/ez-search/ez-search.js +689 -55
  13. package/dist/collection/components/ez-split-panel/ez-split-panel.js +1 -1
  14. package/dist/custom-elements/index.js +630 -197
  15. package/dist/esm/ez-card-item_3.entry.js +176 -0
  16. package/dist/esm/ez-combo-box.entry.js +12 -156
  17. package/dist/esm/ez-search.entry.js +613 -33
  18. package/dist/esm/ez-split-panel.entry.js +1 -1
  19. package/dist/esm/ezui.js +1 -1
  20. package/dist/esm/index-baa5e267.js +2 -6
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/ezui/ezui.esm.js +1 -1
  23. package/dist/ezui/p-133fae4a.entry.js +1 -0
  24. package/dist/ezui/p-428a05fe.entry.js +1 -0
  25. package/dist/ezui/{p-93c3df4f.entry.js → p-8d80101c.entry.js} +1 -1
  26. package/dist/ezui/p-e52cbcc7.entry.js +1 -0
  27. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +0 -15
  28. package/dist/types/components/ez-search/ez-search.d.ts +100 -10
  29. package/dist/types/components.d.ts +23 -14
  30. package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +2 -1
  31. package/package.json +1 -1
  32. package/dist/cjs/ez-card-item.cjs.entry.js +0 -52
  33. package/dist/cjs/ez-filter-input_2.cjs.entry.js +0 -137
  34. package/dist/esm/ez-card-item.entry.js +0 -48
  35. package/dist/esm/ez-filter-input_2.entry.js +0 -132
  36. package/dist/ezui/p-05f5a778.entry.js +0 -1
  37. package/dist/ezui/p-5613fe63.entry.js +0 -1
  38. package/dist/ezui/p-a32aaac6.entry.js +0 -1
  39. package/dist/ezui/p-a5ac7151.entry.js +0 -1
@@ -1986,7 +1986,7 @@ const EzCalendar$1 = class extends HTMLElement$1 {
1986
1986
  static get style() { return ezCalendarCss; }
1987
1987
  };
1988
1988
 
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)}";
1989
+ const ezCardItemCss = ":host {\n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--title--primary, #2B3A54);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n padding: 12px;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n cursor: pointer;\n justify-content: space-between;\n gap: var(--space--small, 6px);\n}\n\n.card-item__details-left {\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-right {\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail:not(:last-child) {\n cursor: pointer;\n white-space: pre-line;\n\n /*public*/\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item__detail-label--color);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n color: var(--ez-card-item--color);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-left {\n width: 100%;\n }\n \n .card-item__details-right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
1990
1990
 
1991
1991
  const EzCardItem$1 = class extends HTMLElement$1 {
1992
1992
  constructor() {
@@ -2353,10 +2353,6 @@ const EzCollapsibleBox$1 = class extends HTMLElement$1 {
2353
2353
  static get style() { return ezCollapsibleBoxCss; }
2354
2354
  };
2355
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
-
2360
2356
  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)}}";
2361
2357
 
2362
2358
  const EzComboBox$1 = class extends HTMLElement$1 {
@@ -2370,7 +2366,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2370
2366
  this._maxWidthValue = 0;
2371
2367
  this._tabPressed = false;
2372
2368
  this._textEmptyList = "Nenhum resultado encontrado";
2373
- this._textEmptySearch = "Nenhum resultado de {0} encontrado";
2374
2369
  this._lookupMode = false;
2375
2370
  this._preSelection = undefined;
2376
2371
  this._visibleOptions = undefined;
@@ -2383,7 +2378,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2383
2378
  this.enabled = true;
2384
2379
  this.options = undefined;
2385
2380
  this.errorMessage = undefined;
2386
- this.searchMode = undefined;
2387
2381
  this.showSelectedValue = false;
2388
2382
  this.showOptionValue = false;
2389
2383
  this.suppressSearch = false;
@@ -2407,7 +2401,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2407
2401
  observeValue(newValue, oldValue) {
2408
2402
  if (this._textInput && newValue != oldValue) {
2409
2403
  try {
2410
- if (this.searchMode && typeof newValue === "string") {
2404
+ if (typeof newValue === "string") {
2411
2405
  this.setInputValue();
2412
2406
  return;
2413
2407
  }
@@ -2434,7 +2428,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2434
2428
  observeOptions(newOptions, oldOptions) {
2435
2429
  if ((newOptions === null || newOptions === void 0 ? void 0 : newOptions.join('')) === (oldOptions === null || oldOptions === void 0 ? void 0 : oldOptions.join('')))
2436
2430
  return;
2437
- this.loadOptions(SearchMode.PRELOAD);
2431
+ this.loadOptions(SearchMode$1.PRELOAD);
2438
2432
  }
2439
2433
  /*
2440
2434
  * Retorna uma promise com o valor da opção selecionada,
@@ -2570,7 +2564,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2570
2564
  }
2571
2565
  updateVisibleOptions() {
2572
2566
  let opts = this._source || [];
2573
- if (!this.searchMode && this._criteria) {
2567
+ if (this._criteria) {
2574
2568
  const upperCriteria = this._criteria.toUpperCase();
2575
2569
  opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
2576
2570
  }
@@ -2645,7 +2639,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2645
2639
  return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
2646
2640
  }
2647
2641
  nextOption() {
2648
- if (this.searchMode && !this.isOptionsVisible()) {
2642
+ if (!this.isOptionsVisible()) {
2649
2643
  return;
2650
2644
  }
2651
2645
  this.showOptions();
@@ -2668,9 +2662,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2668
2662
  this.selectOption(this._visibleOptions[this._preSelection]);
2669
2663
  this._preSelection = undefined;
2670
2664
  }
2671
- else {
2672
- this.controlListWithOnlyOne();
2673
- }
2674
2665
  }
2675
2666
  updateSource(source) {
2676
2667
  this._startLoading = false;
@@ -2689,7 +2680,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2689
2680
  this.updateVisibleOptions();
2690
2681
  if (this._tabPressed) {
2691
2682
  this._tabPressed = false;
2692
- this.controlEmptySearch();
2693
2683
  }
2694
2684
  }
2695
2685
  else {
@@ -2697,10 +2687,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2697
2687
  }
2698
2688
  }
2699
2689
  }
2700
- clearSource() {
2701
- this._source = [];
2702
- this.updateVisibleOptions();
2703
- }
2704
2690
  selectOption(newOption) {
2705
2691
  var _a, _b;
2706
2692
  const currentValue = this.getSelectedOption(this.value);
@@ -2712,10 +2698,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2712
2698
  else {
2713
2699
  this.resetOptions();
2714
2700
  }
2715
- if (this.searchMode) {
2716
- this._visibleOptions = [];
2717
- this.clearSource();
2718
- }
2719
2701
  }
2720
2702
  loadOptions(mode, argument = "") {
2721
2703
  this._criteria = argument;
@@ -2751,93 +2733,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2751
2733
  clearSearch() {
2752
2734
  this.value = null;
2753
2735
  }
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
- }
2841
2736
  resetOptions() {
2842
2737
  this.hideOptions();
2843
2738
  this._criteria = undefined;
@@ -2863,12 +2758,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2863
2758
  });
2864
2759
  }
2865
2760
  }
2866
- if (this.searchMode) {
2867
- this.updateSource([]);
2868
- }
2869
- else {
2870
- this.loadOptions(SearchMode.PRELOAD);
2871
- }
2761
+ this.loadOptions(SearchMode$1.PRELOAD);
2872
2762
  }
2873
2763
  componentDidRender() {
2874
2764
  var _a;
@@ -2878,7 +2768,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2878
2768
  (_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
2879
2769
  ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
2880
2770
  });
2881
- this.validateDescriptionValue();
2882
2771
  }
2883
2772
  componentDidLoad() {
2884
2773
  CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
@@ -2898,13 +2787,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2898
2787
  // Event handlers
2899
2788
  //---------------------------------------------
2900
2789
  handlerIconClick() {
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);
2790
+ this.showOptions();
2908
2791
  }
2909
2792
  onTextInputChangeHandler(event) {
2910
2793
  var _a;
@@ -2921,36 +2804,12 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2921
2804
  }
2922
2805
  this._criteria = argument;
2923
2806
  if (argument) {
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
- }
2807
+ this.updateVisibleOptions();
2808
+ this.showOptions();
2944
2809
  }
2945
2810
  else {
2946
2811
  this.hideOptions();
2947
- if (this.searchMode) {
2948
- this._showLoading = false;
2949
- this.clearSource();
2950
- }
2951
- else {
2952
- this.updateVisibleOptions();
2953
- }
2812
+ this.updateVisibleOptions();
2954
2813
  }
2955
2814
  }
2956
2815
  clearDeboucingTimeout() {
@@ -2960,15 +2819,13 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2960
2819
  }
2961
2820
  }
2962
2821
  onTextInputClickHandler() {
2963
- if (!this.searchMode) {
2964
- this.showOptions();
2965
- }
2822
+ this.showOptions();
2966
2823
  }
2967
2824
  keyDownHandler(event) {
2968
2825
  this._tabPressed = false;
2969
2826
  if (event.ctrlKey) {
2970
2827
  if (event.key === "f" || event.key === "F") {
2971
- this.loadOptions(SearchMode.ADVANCED);
2828
+ this.loadOptions(SearchMode$1.ADVANCED);
2972
2829
  //ATENÇÃO: Ctrl + F tem ação específica nos browsers
2973
2830
  //nesse caso, como vamos abrir o popup de busca avançada,
2974
2831
  //não é interessante deixar o evento propagar;
@@ -2994,7 +2851,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2994
2851
  break;
2995
2852
  case "Tab":
2996
2853
  this._tabPressed = true;
2997
- this.controlListWithOnlyOne();
2998
2854
  break;
2999
2855
  }
3000
2856
  //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
@@ -3011,11 +2867,8 @@ const EzComboBox$1 = class extends HTMLElement$1 {
3011
2867
  return !this._showLoading && this._visibleOptions.length > 0;
3012
2868
  }
3013
2869
  render() {
3014
- var _a;
3015
2870
  ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
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
2871
+ 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: "chevron-down" }))), 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
3019
2872
  && this._visibleOptions.length === 0
3020
2873
  && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
3021
2874
  && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
@@ -3030,12 +2883,12 @@ const EzComboBox$1 = class extends HTMLElement$1 {
3030
2883
  }; }
3031
2884
  static get style() { return ezComboBoxCss; }
3032
2885
  };
3033
- var SearchMode;
2886
+ var SearchMode$1;
3034
2887
  (function (SearchMode) {
3035
2888
  SearchMode["ADVANCED"] = "ADVANCED";
3036
2889
  SearchMode["PRELOAD"] = "PRELOAD";
3037
2890
  SearchMode["PREDICTIVE"] = "PREDICTIVE";
3038
- })(SearchMode || (SearchMode = {}));
2891
+ })(SearchMode$1 || (SearchMode$1 = {}));
3039
2892
 
3040
2893
  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)}";
3041
2894
 
@@ -4839,6 +4692,10 @@ const EzForm$1 = class extends HTMLElement$1 {
4839
4692
  static get style() { return ezFormCss; }
4840
4693
  };
4841
4694
 
4695
+ const REQUIRED_INFO = " (obrigatório) *";
4696
+ const DISTINCT_FILTER_NAME_PREFIX = 'FILTRO_COLUNA_';
4697
+ const EZ_GRID_LOADING_SOURCE = "EZ_GRID_LOADING_SOURCE";
4698
+
4842
4699
  const buildSwitch$1 = (field) => {
4843
4700
  return buildField(field.name, field.label, field.readOnly, field.contextName, true);
4844
4701
  };
@@ -127635,7 +127492,7 @@ class ScrollCtrl {
127635
127492
  }
127636
127493
  }
127637
127494
 
127638
- const ezSearchCss = ":host{width:100%}";
127495
+ const ezSearchCss = ":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--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-search__list-min-width);overflow:auto;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:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-search--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-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-search__scrollbar--color-background);width:var(--ez-search__scrollbar--width);max-width:var(--ez-search__scrollbar--width);min-width:var(--ez-search__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__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-search--border-radius-small);padding:var(--ez-search--space--small);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--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-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--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-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__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)}}";
127639
127496
 
127640
127497
  const EzSearch$1 = class extends HTMLElement$1 {
127641
127498
  constructor() {
@@ -127643,6 +127500,21 @@ const EzSearch$1 = class extends HTMLElement$1 {
127643
127500
  this.__registerHost();
127644
127501
  this.__attachShadow();
127645
127502
  this.ezChange = createEvent(this, "ezChange", 7);
127503
+ this._changeDeboucingTimeout = null;
127504
+ this._limitCharsToSearch = 3;
127505
+ this._deboucingTime = 300;
127506
+ this._maxWidthValue = 0;
127507
+ this._tabPressed = false;
127508
+ this._textEmptyList = "Nenhum resultado encontrado";
127509
+ this._textEmptySearch = "Nenhum resultado de {0} encontrado";
127510
+ this._lookupMode = false;
127511
+ this._startHighlightTag = "<span class='card-item__highlight'>";
127512
+ this._endHighlightTag = "</span>";
127513
+ this._preSelection = undefined;
127514
+ this._visibleOptions = undefined;
127515
+ this._startLoading = false;
127516
+ this._showLoading = true;
127517
+ this._criteria = undefined;
127646
127518
  this.value = undefined;
127647
127519
  this.label = undefined;
127648
127520
  this.enabled = true;
@@ -127657,28 +127529,82 @@ const EzSearch$1 = class extends HTMLElement$1 {
127657
127529
  this.listOptionsPosition = undefined;
127658
127530
  this.isTextSearch = false;
127659
127531
  this.ignoreLimitCharsToSearch = false;
127532
+ this.options = undefined;
127533
+ this.suppressSearch = false;
127660
127534
  }
127661
127535
  observeErrorMessage() {
127662
- if (this._comboElement) {
127663
- this._comboElement.errorMessage = this.errorMessage;
127536
+ var _a;
127537
+ if (this._textInput) {
127538
+ this._textInput.errorMessage = this.errorMessage;
127539
+ if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
127540
+ this.setInputValue();
127541
+ }
127664
127542
  }
127665
127543
  }
127666
- observeValue() {
127667
- if (this._comboElement) {
127668
- this._comboElement.value = this.value;
127544
+ observeValue(newValue, oldValue) {
127545
+ if (this._textInput && newValue != oldValue) {
127546
+ try {
127547
+ if (newValue === "string") {
127548
+ this.setInputValue();
127549
+ return;
127550
+ }
127551
+ const newValueSelected = this.getSelectedOption(newValue);
127552
+ const oldValueSelected = this.getSelectedOption(oldValue);
127553
+ const currentValue = this.getSelectedOption(this.value);
127554
+ if (this.isDifferentValues(currentValue, newValueSelected)) {
127555
+ this.value = newValueSelected;
127556
+ }
127557
+ if (this.isDifferentValues(newValueSelected, oldValueSelected)) {
127558
+ this.setInputValue();
127559
+ const valueEmitted = newValueSelected === null ? undefined : newValueSelected;
127560
+ if (!this._lookupMode) {
127561
+ this.ezChange.emit(valueEmitted);
127562
+ }
127563
+ }
127564
+ this.resetOptions();
127565
+ }
127566
+ finally {
127567
+ this._lookupMode = false;
127568
+ }
127569
+ }
127570
+ }
127571
+ observeOptions(newOptions, oldOptions) {
127572
+ if ((newOptions === null || newOptions === void 0 ? void 0 : newOptions.join('')) === (oldOptions === null || oldOptions === void 0 ? void 0 : oldOptions.join('')))
127573
+ return;
127574
+ this.loadOptions(SearchMode.PRELOAD);
127575
+ }
127576
+ /*
127577
+ * Retorna uma promise com o valor da opção selecionada,
127578
+ * que será resolvida quando o backend devolver este dado.
127579
+ */
127580
+ async getValueAsync() {
127581
+ if (!this._showLoading) {
127582
+ return new Promise(resolve => resolve(this.value));
127669
127583
  }
127584
+ return new Promise(resolve => {
127585
+ let id = setInterval(() => {
127586
+ if (!this._showLoading) {
127587
+ clearInterval(id);
127588
+ resolve(this.value);
127589
+ }
127590
+ }, 100);
127591
+ });
127670
127592
  }
127671
127593
  /**
127672
- * Aplica o foco no campo.
127673
- */
127594
+ * Aplica o foco no campo.
127595
+ */
127674
127596
  async setFocus() {
127675
- this._comboElement.setFocus();
127597
+ if (this._textInput) {
127598
+ this._textInput.setFocus();
127599
+ }
127676
127600
  }
127677
127601
  /**
127678
- * Remove o foco do campo.
127679
- */
127602
+ * Remove o foco do campo.
127603
+ */
127680
127604
  async setBlur() {
127681
- this._comboElement.setBlur();
127605
+ if (this._textInput) {
127606
+ this._textInput.setBlur();
127607
+ }
127682
127608
  }
127683
127609
  /**
127684
127610
  * Retorna se o conteúdo é inválido.
@@ -127690,40 +127616,547 @@ const EzSearch$1 = class extends HTMLElement$1 {
127690
127616
  * Limpa o valor do campo de pesquisa
127691
127617
  */
127692
127618
  async clearValue() {
127619
+ this.clearSearch();
127620
+ }
127621
+ scrollListener() {
127622
+ var _a;
127623
+ if (this._floatingID == undefined) {
127624
+ return;
127625
+ }
127626
+ if ((_a = this.listOptionsPosition) === null || _a === void 0 ? void 0 : _a.hardPosition) {
127627
+ this.hideOptions();
127628
+ }
127629
+ else {
127630
+ window.requestAnimationFrame(() => {
127631
+ this.updateListPosition();
127632
+ });
127633
+ }
127634
+ }
127635
+ updateListPosition() {
127636
+ let { verticalPosition, horizontalPosition, fromBottom, fromRight, bottomLimit, hardPosition } = this.getListPosition();
127637
+ const elementRect = this._listWrapper.getBoundingClientRect();
127638
+ const containerRect = this._listContainer.getBoundingClientRect();
127639
+ const textInputRect = this._textInput.getBoundingClientRect();
127640
+ const limitHeight = bottomLimit || window.innerHeight;
127641
+ const neededHeight = containerRect.bottom + elementRect.height;
127642
+ if (!fromBottom && (elementRect.top < 0 || neededHeight > limitHeight)) {
127643
+ fromBottom = true;
127644
+ }
127645
+ if (!hardPosition) {
127646
+ verticalPosition = verticalPosition || 0;
127647
+ horizontalPosition = horizontalPosition || 0;
127648
+ if (fromBottom) {
127649
+ verticalPosition = window.innerHeight - textInputRect.top + verticalPosition;
127650
+ }
127651
+ else {
127652
+ verticalPosition += containerRect.top;
127653
+ }
127654
+ if (fromRight) {
127655
+ horizontalPosition = window.innerWidth - textInputRect.right + horizontalPosition;
127656
+ }
127657
+ else {
127658
+ horizontalPosition += containerRect.left;
127659
+ }
127660
+ }
127661
+ if (verticalPosition != undefined) {
127662
+ this._listWrapper.style[fromBottom ? "bottom" : "top"] = `${verticalPosition}px`;
127663
+ this._listWrapper.style[fromBottom ? "top" : "bottom"] = "";
127664
+ }
127665
+ if (horizontalPosition != undefined) {
127666
+ this._listWrapper.style[fromRight ? "right" : "left"] = `${horizontalPosition}px`;
127667
+ this._listWrapper.style[fromRight ? "left" : "right"] = "";
127668
+ }
127669
+ }
127670
+ getListPosition() {
127671
+ if (this.listOptionsPosition) {
127672
+ return this.listOptionsPosition;
127673
+ }
127674
+ return {
127675
+ verticalPosition: (this.errorMessage || !this.canShowError || this.mode === "slim") ? 6 : -13
127676
+ };
127677
+ }
127678
+ isDifferentValues(firstValue, secondValue) {
127679
+ return ObjectUtils$1.objectToString(firstValue || {}) !== ObjectUtils$1.objectToString(secondValue || {});
127680
+ }
127681
+ getFormattedText(currentValue) {
127682
+ if (currentValue == undefined) {
127683
+ return;
127684
+ }
127685
+ if (!this.showSelectedValue || currentValue.value == undefined) {
127686
+ return currentValue.label;
127687
+ }
127688
+ return currentValue.label ? `${currentValue.value} - ${currentValue.label}` : currentValue.value;
127689
+ }
127690
+ getText() {
127691
+ const currentValue = this.getSelectedOption(this.value);
127692
+ const text = this.getFormattedText(currentValue);
127693
+ if (text == undefined) {
127694
+ return;
127695
+ }
127696
+ return String(text)
127697
+ .replace(/&amp;/g, '&')
127698
+ .replace(/&lt;/g, '<')
127699
+ .replace(/&gt;/g, '>')
127700
+ .replace(/&quot;/g, '"');
127701
+ }
127702
+ getSelectedOption(value) {
127703
+ if (typeof value === "string" || value instanceof String) {
127704
+ return this._visibleOptions.find(o => o.value === value);
127705
+ }
127706
+ return value;
127707
+ }
127708
+ updateVisibleOptions() {
127709
+ let opts = this._source || [];
127710
+ if (this.suppressEmptyOption) {
127711
+ this._visibleOptions = opts;
127712
+ }
127713
+ else {
127714
+ this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
127715
+ }
127716
+ this._maxWidthValue = this.getMaxWidthValue();
127717
+ }
127718
+ getMaxWidthValue() {
127719
+ var _a;
127720
+ const arrValues = [];
127721
+ (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.forEach(opt => {
127722
+ const widthValue = this.getWidthValue(opt.value);
127723
+ if (!arrValues.includes(widthValue)) {
127724
+ arrValues.push(widthValue);
127725
+ }
127726
+ });
127727
+ return arrValues.length > 1 ? Math.max(...arrValues) : 0;
127728
+ }
127729
+ getWidthValue(value) {
127730
+ if (this._itemValueBasis != undefined) {
127731
+ const span = this._itemValueBasis;
127732
+ if (value != undefined) {
127733
+ span.innerHTML = value;
127734
+ return span.clientWidth > 0 ? (span.clientWidth + 2) : 0;
127735
+ }
127736
+ else {
127737
+ span.innerHTML = "";
127738
+ }
127739
+ }
127740
+ return 0;
127741
+ }
127742
+ createOption(detail) {
127743
+ let { key, title } = detail;
127744
+ const startHighlight = new RegExp(this._startHighlightTag, 'g');
127745
+ const endHighlight = new RegExp(this._endHighlightTag, 'g');
127746
+ title = StringUtils$1.decodeHtmlEntities(title);
127747
+ const option = {
127748
+ value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
127749
+ label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
127750
+ };
127751
+ this.selectOption(option);
127752
+ }
127753
+ buildItem(opt, index) {
127754
+ opt.label = opt.label || opt.value;
127755
+ const card = {
127756
+ key: opt.value,
127757
+ title: opt.label,
127758
+ details: opt.details
127759
+ };
127760
+ return h("div", { style: { "height": "100%" }, class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this._preSelection = index }, h("ez-card-item", { item: card }));
127761
+ }
127762
+ showOptions() {
127763
+ if (!this.enabled)
127764
+ return;
127765
+ if (this.isOptionsVisible()) {
127766
+ return;
127767
+ }
127768
+ if (!!this._resizeObserver)
127769
+ this._resizeObserver.observe(this._textInput);
127770
+ this._floatingID = FloatingManager.float(this._listWrapper, this._listContainer, { autoClose: false, isFixed: true, backClickListener: () => this.hideOptions() });
127771
+ this.setFocus();
127772
+ window.requestAnimationFrame(() => {
127773
+ this.updateListPosition();
127774
+ if (!this.listOptionsPosition) {
127775
+ this._listWrapper.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
127776
+ }
127777
+ });
127778
+ }
127779
+ hideOptions() {
127780
+ if (this._floatingID !== undefined) {
127781
+ FloatingManager.close(this._floatingID);
127782
+ }
127783
+ this._floatingID = undefined;
127784
+ if (!!this._resizeObserver)
127785
+ this._resizeObserver.unobserve(this._textInput);
127786
+ }
127787
+ isOptionsVisible() {
127788
+ return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
127789
+ }
127790
+ nextOption() {
127791
+ if (!this.isOptionsVisible()) {
127792
+ return;
127793
+ }
127794
+ this.showOptions();
127795
+ this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
127796
+ this.scrollToOption(this._visibleOptions[this._preSelection]);
127797
+ }
127798
+ previousOption() {
127799
+ this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
127800
+ this.scrollToOption(this._visibleOptions[this._preSelection]);
127801
+ }
127802
+ scrollToOption(opt) {
127803
+ window.requestAnimationFrame(() => {
127804
+ const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`div#item_${opt.value.replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
127805
+ if (liElem)
127806
+ liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
127807
+ });
127808
+ }
127809
+ selectCurrentOption() {
127810
+ if (this._preSelection !== undefined) {
127811
+ this.selectOption(this._visibleOptions[this._preSelection]);
127812
+ this._preSelection = undefined;
127813
+ }
127814
+ else {
127815
+ this.controlListWithOnlyOne();
127816
+ }
127817
+ }
127818
+ updateSource(source) {
127819
+ this._startLoading = false;
127820
+ if (source instanceof Promise) {
127821
+ this._showLoading = true;
127822
+ source.then(result => {
127823
+ this._showLoading = false;
127824
+ this.updateSource(result);
127825
+ }).catch(() => this._showLoading = false);
127826
+ this.updateVisibleOptions();
127827
+ }
127828
+ else {
127829
+ this._showLoading = false;
127830
+ if (Array.isArray(source)) {
127831
+ this._source = source;
127832
+ this.updateVisibleOptions();
127833
+ if (this._tabPressed) {
127834
+ this._tabPressed = false;
127835
+ this.controlEmptySearch();
127836
+ }
127837
+ }
127838
+ else {
127839
+ this.selectOption(source);
127840
+ }
127841
+ }
127842
+ }
127843
+ clearSource() {
127844
+ this._source = [];
127845
+ this.updateVisibleOptions();
127846
+ }
127847
+ selectOption(newOption) {
127693
127848
  var _a, _b;
127694
- (_b = (_a = this._comboElement) === null || _a === void 0 ? void 0 : _a['clearValue']) === null || _b === void 0 ? void 0 : _b.call(_a);
127849
+ const currentValue = this.getSelectedOption(this.value);
127850
+ 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()))
127851
+ || (currentValue == undefined && newOption != undefined && "value" in newOption)) {
127852
+ const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
127853
+ this.value = adjustedOpt;
127854
+ }
127855
+ else {
127856
+ this.resetOptions();
127857
+ }
127858
+ this._visibleOptions = [];
127859
+ this.clearSource();
127695
127860
  }
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() {
127861
+ loadOptions(mode, argument = "") {
127862
+ this._criteria = argument;
127863
+ this._startLoading = true;
127864
+ if (this.optionLoader) {
127865
+ const searchArgument = { mode, argument };
127866
+ this.updateSource(this.optionLoader(searchArgument));
127867
+ }
127868
+ else {
127869
+ this.updateSource(this.options);
127870
+ }
127871
+ }
127872
+ cancelPreselection() {
127873
+ if (!this._textInput.value && this.value) {
127874
+ this.selectOption(undefined);
127875
+ }
127876
+ else {
127877
+ window.setTimeout(() => {
127878
+ this.setInputValue();
127879
+ }, this._deboucingTime);
127880
+ }
127881
+ this.resetOptions();
127882
+ }
127883
+ setInputValue(clearError = true) {
127884
+ const textValue = this.getText();
127885
+ if ((this._textInput.value || '') !== textValue) {
127886
+ this._textInput.value = textValue;
127887
+ if (clearError) {
127888
+ this.errorMessage = null;
127889
+ }
127890
+ }
127891
+ }
127892
+ clearSearch() {
127893
+ this.value = null;
127894
+ }
127895
+ controlListWithOnlyOne() {
127896
+ var _a, _b;
127897
+ const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
127898
+ if ((source === null || source === void 0 ? void 0 : source.length) > 0) {
127899
+ const startHighlight = new RegExp(this._startHighlightTag, 'g');
127900
+ const endHighlight = new RegExp(this._endHighlightTag, 'g');
127901
+ let title = StringUtils$1.decodeHtmlEntities(source[0].label);
127902
+ const option = {
127903
+ value: (_b = source[0].value) === null || _b === void 0 ? void 0 : _b.replace(startHighlight, '').replace(endHighlight, ''),
127904
+ label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
127905
+ };
127906
+ this.selectOption(option);
127907
+ }
127908
+ }
127909
+ controlEmptySearch() {
127701
127910
  var _a;
127702
- return (_a = this._comboElement) === null || _a === void 0 ? void 0 : _a.getValueAsync();
127911
+ if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
127912
+ this.clearSearch();
127913
+ ApplicationUtils.info(this._textEmptyList);
127914
+ }
127915
+ else {
127916
+ this.controlListWithOnlyOne();
127917
+ }
127703
127918
  }
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;
127919
+ validateDescriptionValue() {
127920
+ if (StringUtils$1.isEmpty(this.value)) {
127921
+ return;
127710
127922
  }
127923
+ let value = this.value;
127924
+ if (typeof value === "object") {
127925
+ return;
127926
+ }
127927
+ if (StringUtils$1.isEmpty(value)) {
127928
+ return;
127929
+ }
127930
+ this.loadDescriptionValue(value);
127931
+ }
127932
+ async loadDescriptionValue(argument) {
127933
+ var _a, _b;
127934
+ if (argument == undefined) {
127935
+ return;
127936
+ }
127937
+ if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
127938
+ this.loadOptionValue(argument);
127939
+ return;
127940
+ }
127941
+ const searchArgument = {
127942
+ mode: SearchMode.PREDICTIVE,
127943
+ argument
127944
+ };
127945
+ const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
127946
+ if (source == undefined) {
127947
+ return;
127948
+ }
127949
+ if (source instanceof Promise) {
127950
+ source.then((result) => {
127951
+ this.setDescriptionValue(result);
127952
+ });
127953
+ }
127954
+ else {
127955
+ this.setDescriptionValue(source);
127956
+ }
127957
+ }
127958
+ setDescriptionValue(source) {
127959
+ const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
127960
+ if (value == undefined || !Object.keys(value).length) {
127961
+ this.showNoResultMessage();
127962
+ return;
127963
+ }
127964
+ this._lookupMode = true;
127965
+ this.value = value;
127966
+ }
127967
+ loadOptionValue(argument) {
127968
+ var _a;
127969
+ const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
127970
+ if (source != undefined) {
127971
+ this.selectOption(source);
127972
+ }
127973
+ else {
127974
+ this.showNoResultMessage();
127975
+ }
127976
+ }
127977
+ async showNoResultMessage() {
127978
+ this.clearSearch();
127979
+ ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
127980
+ }
127981
+ getFieldLabel() {
127982
+ var _a;
127983
+ return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
127984
+ }
127985
+ resetOptions() {
127986
+ this.hideOptions();
127987
+ this._criteria = undefined;
127988
+ this._preSelection = undefined;
127989
+ this.updateVisibleOptions();
127990
+ }
127991
+ //---------------------------------------------
127992
+ // Lifecycle web component
127993
+ //---------------------------------------------
127994
+ componentWillLoad() {
127995
+ if (this.options === undefined) {
127996
+ this.options = [];
127997
+ const optionsTags = this.el.querySelectorAll("option");
127998
+ if (optionsTags) {
127999
+ optionsTags.forEach(e => {
128000
+ let label = e.innerText;
128001
+ let value = e.getAttribute("value");
128002
+ let details = e.getAttribute("details");
128003
+ if (!value) {
128004
+ value = label;
128005
+ }
128006
+ this.options.push({ label, value, details });
128007
+ e.hidden = true;
128008
+ });
128009
+ }
128010
+ }
128011
+ this.updateSource([]);
128012
+ }
128013
+ componentDidRender() {
128014
+ var _a;
128015
+ if (this._floatingID === undefined) {
128016
+ this._listWrapper.remove();
128017
+ }
128018
+ (_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
128019
+ ElementIDUtils.addIDInfoIfNotExists(elem, "itemSearch");
128020
+ });
128021
+ this.validateDescriptionValue();
127711
128022
  }
127712
128023
  componentDidLoad() {
127713
- CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
128024
+ CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
128025
+ this.setInputValue(false);
128026
+ this._resizeObserver = new ResizeObserver((entries) => {
128027
+ window.requestAnimationFrame(() => {
128028
+ if (!Array.isArray(entries) || !entries.length)
128029
+ return;
128030
+ const { clientWidth } = this._listContainer;
128031
+ if (clientWidth > 0 && !!this._listWrapper) {
128032
+ this._listWrapper.style.width = `${clientWidth}px`;
128033
+ }
128034
+ });
128035
+ });
128036
+ }
128037
+ //---------------------------------------------
128038
+ // Event handlers
128039
+ //---------------------------------------------
128040
+ handlerIconClick() {
128041
+ this.loadOptions(SearchMode.ADVANCED);
128042
+ }
128043
+ buildNumberArgument(argument) {
128044
+ if (this.isTextSearch) {
128045
+ return NaN;
128046
+ }
128047
+ return Number(argument || undefined);
128048
+ }
128049
+ onTextInputChangeHandler(event) {
128050
+ var _a;
128051
+ this.clearDeboucingTimeout();
128052
+ if (this._startLoading) {
128053
+ this._changeDeboucingTimeout = window.setTimeout(() => {
128054
+ this.onTextInputChangeHandler(event);
128055
+ }, this._deboucingTime);
128056
+ return;
128057
+ }
128058
+ const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
128059
+ const argumentNumber = this.buildNumberArgument(argument);
128060
+ if (!this._criteria) {
128061
+ this._textInput.value = event.data || argument;
128062
+ }
128063
+ this._criteria = argument;
128064
+ if (argument) {
128065
+ this._showLoading = false;
128066
+ this.clearSource();
128067
+ if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
128068
+ this._showLoading = true;
128069
+ this._changeDeboucingTimeout = window.setTimeout(() => {
128070
+ this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
128071
+ }, this._deboucingTime);
128072
+ this.showOptions();
128073
+ }
128074
+ else {
128075
+ this.hideOptions();
128076
+ }
128077
+ }
128078
+ else {
128079
+ this.hideOptions();
128080
+ this._showLoading = false;
128081
+ this.clearSource();
128082
+ }
128083
+ }
128084
+ clearDeboucingTimeout() {
128085
+ if (this._changeDeboucingTimeout) {
128086
+ window.clearTimeout(this._changeDeboucingTimeout);
128087
+ this._changeDeboucingTimeout = null;
128088
+ }
128089
+ }
128090
+ keyDownHandler(event) {
128091
+ this._tabPressed = false;
128092
+ if (event.ctrlKey) {
128093
+ if (event.key === "f" || event.key === "F") {
128094
+ this.loadOptions(SearchMode.ADVANCED);
128095
+ //ATENÇÃO: Ctrl + F tem ação específica nos browsers
128096
+ //nesse caso, como vamos abrir o popup de busca avançada,
128097
+ //não é interessante deixar o evento propagar;
128098
+ event.stopPropagation();
128099
+ event.stopImmediatePropagation();
128100
+ event.preventDefault();
128101
+ }
128102
+ }
128103
+ switch (event.key) {
128104
+ case "ArrowDown":
128105
+ this.nextOption();
128106
+ event.stopPropagation();
128107
+ break;
128108
+ case "ArrowUp":
128109
+ this.previousOption();
128110
+ event.stopPropagation();
128111
+ break;
128112
+ case "Enter":
128113
+ this.selectCurrentOption();
128114
+ break;
128115
+ case "Escape":
128116
+ this.cancelPreselection();
128117
+ break;
128118
+ case "Tab":
128119
+ this._tabPressed = true;
128120
+ this.controlListWithOnlyOne();
128121
+ break;
128122
+ }
128123
+ //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
128124
+ //Por exemplo, quando o usuário dá um Enter, além de selecionar
128125
+ //um valor, também significa que a ateração finalizou,
128126
+ //e o contexto pode reagir (fechar um popup por exemplo).
128127
+ //event.stopPropagation();
128128
+ }
128129
+ onTextInputFocusOutHandler() {
128130
+ if (this.hideErrorOnFocusOut)
128131
+ this.cancelPreselection();
128132
+ }
128133
+ canShowListOptions() {
128134
+ return !this._showLoading && this._visibleOptions.length > 0;
127714
128135
  }
127715
128136
  render() {
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 }));
128137
+ var _a;
128138
+ ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
128139
+ 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)
128140
+ ? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
128141
+ : 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
128142
+ && this._visibleOptions.length === 0
128143
+ && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
128144
+ && 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)))))));
127718
128145
  }
127719
- ;
127720
- get _elem() { return this; }
128146
+ get el() { return this; }
127721
128147
  static get watchers() { return {
127722
128148
  "errorMessage": ["observeErrorMessage"],
127723
- "value": ["observeValue"]
128149
+ "value": ["observeValue"],
128150
+ "options": ["observeOptions"]
127724
128151
  }; }
127725
128152
  static get style() { return ezSearchCss; }
127726
128153
  };
128154
+ var SearchMode;
128155
+ (function (SearchMode) {
128156
+ SearchMode["ADVANCED"] = "ADVANCED";
128157
+ SearchMode["PRELOAD"] = "PRELOAD";
128158
+ SearchMode["PREDICTIVE"] = "PREDICTIVE";
128159
+ })(SearchMode || (SearchMode = {}));
127727
128160
 
127728
128161
  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}";
127729
128162
 
@@ -128588,7 +129021,7 @@ const SplitPanel = class extends HTMLElement$1 {
128588
129021
  return template;
128589
129022
  }
128590
129023
  render() {
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)));
129024
+ return (h(Host, { style: this.getElementStyle() }));
128592
129025
  }
128593
129026
  get _element() { return this; }
128594
129027
  static get style() { return ezSplitPanelCss; }
@@ -130806,7 +131239,7 @@ const EzCardItem = /*@__PURE__*/proxyCustomElement(EzCardItem$1, [1,"ez-card-ite
130806
131239
  const EzCheck = /*@__PURE__*/proxyCustomElement(EzCheck$1, [1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4]}]);
130807
131240
  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"]}]);
130808
131241
  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]}]);
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"]]]);
131242
+ 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"]]]);
130810
131243
  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"]}]);
130811
131244
  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"]}]);
130812
131245
  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"]]]);
@@ -130828,11 +131261,11 @@ const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{
130828
131261
  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"]}]);
130829
131262
  const EzRadioButton = /*@__PURE__*/proxyCustomElement(EzRadioButton$1, [1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]);
130830
131263
  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"]]]);
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"]}]);
131264
+ 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"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
130832
131265
  const EzSidebarButton = /*@__PURE__*/proxyCustomElement(EzSidebarButton$1, [1,"ez-sidebar-button"]);
130833
131266
  const EzSkeleton = /*@__PURE__*/proxyCustomElement(EzSkeleton$1, [0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]);
130834
131267
  const EzSplitItem = /*@__PURE__*/proxyCustomElement(SplitItem, [0,"ez-split-item"]);
130835
- const EzSplitPanel = /*@__PURE__*/proxyCustomElement(SplitPanel, [4,"ez-split-panel",{"direction":[1],"label":[1]}]);
131268
+ const EzSplitPanel = /*@__PURE__*/proxyCustomElement(SplitPanel, [0,"ez-split-panel",{"direction":[1],"label":[1]}]);
130836
131269
  const EzTabselector = /*@__PURE__*/proxyCustomElement(EzTabselector$1, [1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]);
130837
131270
  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"]}]);
130838
131271
  const EzTextEdit = /*@__PURE__*/proxyCustomElement(EzTextEdit$1, [1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32]}]);