@sankhyalabs/ezui 5.22.0-dev.123 → 5.22.0-dev.124

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.
@@ -66,7 +66,6 @@ const EzPopoverCore = class {
66
66
  constructor(hostRef) {
67
67
  index.registerInstance(this, hostRef);
68
68
  this.ezVisibilityChange = index.createEvent(this, "ezVisibilityChange", 7);
69
- this.TIME_DEBOUNCE = 500;
70
69
  this.autoClose = true;
71
70
  this.boxWidth = "fit-content";
72
71
  this.opened = false;
@@ -170,11 +169,6 @@ const EzPopoverCore = class {
170
169
  return;
171
170
  }
172
171
  const currentAnchorElement = this.getAnchorElement();
173
- if (this.useAnchorSize) {
174
- const anchorSize = currentAnchorElement.getBoundingClientRect().width;
175
- const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
176
- this._box.style.width = `${width}px`;
177
- }
178
172
  await floatingUi_dom_esm.computePosition(currentAnchorElement, this._box, {
179
173
  placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
180
174
  middleware: [floatingUi_dom_esm.flip(), floatingUi_dom_esm.shift({ padding: 5 })],
@@ -202,6 +196,12 @@ const EzPopoverCore = class {
202
196
  }
203
197
  this._box.style.display = 'flex';
204
198
  this._box.style.visibility = 'hidden';
199
+ if (this.useAnchorSize) {
200
+ const currentAnchorElement = this.getAnchorElement();
201
+ const anchorSize = currentAnchorElement.getBoundingClientRect().width;
202
+ const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
203
+ this._box.style.width = `${width}px`;
204
+ }
205
205
  await this.updatePositionPopover();
206
206
  this.openOverlay();
207
207
  this.ezVisibilityChange.emit(true);
@@ -228,18 +228,15 @@ const EzPopoverCore = class {
228
228
  }
229
229
  return false;
230
230
  }
231
- updatePositionDebounce() {
231
+ handlePositionUpdate() {
232
232
  if (!this.opened) {
233
233
  return;
234
234
  }
235
- clearTimeout(this._timeoutDebounce);
236
- this._timeoutDebounce = setTimeout(() => {
237
- this.updatePositionPopover();
238
- }, this.TIME_DEBOUNCE);
235
+ this.updatePositionPopover();
239
236
  }
240
237
  componentWillLoad() {
241
- window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
242
- window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
238
+ window.addEventListener('scroll', this.handlePositionUpdate.bind(this), true);
239
+ window.addEventListener('resize', this.handlePositionUpdate.bind(this), true);
243
240
  }
244
241
  componentDidLoad() {
245
242
  this._overlayIsActive = this.checkStatusOverlay();
@@ -248,8 +245,8 @@ const EzPopoverCore = class {
248
245
  this.openPopover();
249
246
  }
250
247
  disconnectedCallback() {
251
- window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
252
- window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
248
+ window.removeEventListener('scroll', this.handlePositionUpdate.bind(this), true);
249
+ window.removeEventListener('resize', this.handlePositionUpdate.bind(this), true);
253
250
  this._resizeObserver.disconnect();
254
251
  }
255
252
  render() {
@@ -142,6 +142,8 @@ const SearchList = class {
142
142
  this.changePreSelection = index.createEvent(this, "changePreSelection", 7);
143
143
  this._startHighlightTag = "<span class='card-item__highlight'>";
144
144
  this._endHighlightTag = "</span>";
145
+ this.MAX_HEIGHT = 350;
146
+ this.HEADER_MENU_HEIGHT = 60;
145
147
  this.showLoading = undefined;
146
148
  this.visibleOptions = [];
147
149
  this.textEmptyList = undefined;
@@ -195,11 +197,38 @@ const SearchList = class {
195
197
  };
196
198
  return index.h("div", { style: { "height": "100%" }, class: index$1 === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this.changePreSelection.emit(index$1) }, index.h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
197
199
  }
200
+ componentDidLoad() {
201
+ if (this._optionsList) {
202
+ this._optionsList.style.maxHeight = `${this.MAX_HEIGHT}px`;
203
+ }
204
+ }
205
+ componentDidUpdate() {
206
+ if (this._optionsList) {
207
+ const rect = this._optionsList.getBoundingClientRect();
208
+ const spaceBelow = window.innerHeight - rect.bottom;
209
+ if (spaceBelow < 0) {
210
+ this.adjustMaxHeight(rect);
211
+ }
212
+ }
213
+ }
214
+ adjustMaxHeight(rect) {
215
+ if (this._optionsList) {
216
+ const spaceAbove = rect.top - this.HEADER_MENU_HEIGHT;
217
+ const maxHeight = this.MAX_HEIGHT;
218
+ const height = Math.min(spaceAbove, maxHeight);
219
+ this._optionsList.style.maxHeight = `${height}px`;
220
+ }
221
+ }
222
+ cleanEmptyObjectArray(arr) {
223
+ return arr.filter(item => {
224
+ return Object.values(item).some(valor => valor !== undefined);
225
+ });
226
+ }
198
227
  render() {
199
228
  return (index.h(index.Host, null, index.h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
200
- && this.visibleOptions.length === 0
229
+ && this.cleanEmptyObjectArray(this.visibleOptions).length === 0
201
230
  && index.h("div", { class: "message" }, index.h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
202
- && index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
231
+ && index.h("div", { class: "message" }, index.h("div", { class: "message__loading" })), this.canShowListOptions && this.cleanEmptyObjectArray(this.visibleOptions).map((opt, index) => this.buildItem(opt, index)))));
203
232
  }
204
233
  };
205
234
  SearchList.style = searchListCss;
@@ -475,6 +475,16 @@ const EzSearch = class {
475
475
  return;
476
476
  });
477
477
  });
478
+ this._intersectionObserver = new IntersectionObserver((entries) => {
479
+ entries.forEach(entry => {
480
+ if (!entry.isIntersecting && this._ezPopOverPlusElement) {
481
+ this._ezPopOverPlusElement.hide();
482
+ }
483
+ });
484
+ }, { threshold: 0.1 });
485
+ if (this._textInput) {
486
+ this._intersectionObserver.observe(this._textInput);
487
+ }
478
488
  await this.handleInitialValue();
479
489
  if (this.autoFocus) {
480
490
  requestAnimationFrame(() => {
@@ -483,8 +493,9 @@ const EzSearch = class {
483
493
  }
484
494
  }
485
495
  disconnectedCallback() {
486
- var _a;
496
+ var _a, _b;
487
497
  (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
498
+ (_b = this._intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
488
499
  }
489
500
  //---------------------------------------------
490
501
  // Event handlers
@@ -2,7 +2,6 @@ import { computePosition, flip, shift } from "@floating-ui/dom";
2
2
  import { h, Host } from "@stencil/core";
3
3
  export class EzPopoverCore {
4
4
  constructor() {
5
- this.TIME_DEBOUNCE = 500;
6
5
  this.autoClose = true;
7
6
  this.boxWidth = "fit-content";
8
7
  this.opened = false;
@@ -106,11 +105,6 @@ export class EzPopoverCore {
106
105
  return;
107
106
  }
108
107
  const currentAnchorElement = this.getAnchorElement();
109
- if (this.useAnchorSize) {
110
- const anchorSize = currentAnchorElement.getBoundingClientRect().width;
111
- const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
112
- this._box.style.width = `${width}px`;
113
- }
114
108
  await computePosition(currentAnchorElement, this._box, {
115
109
  placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
116
110
  middleware: [flip(), shift({ padding: 5 })],
@@ -138,6 +132,12 @@ export class EzPopoverCore {
138
132
  }
139
133
  this._box.style.display = 'flex';
140
134
  this._box.style.visibility = 'hidden';
135
+ if (this.useAnchorSize) {
136
+ const currentAnchorElement = this.getAnchorElement();
137
+ const anchorSize = currentAnchorElement.getBoundingClientRect().width;
138
+ const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
139
+ this._box.style.width = `${width}px`;
140
+ }
141
141
  await this.updatePositionPopover();
142
142
  this.openOverlay();
143
143
  this.ezVisibilityChange.emit(true);
@@ -164,18 +164,15 @@ export class EzPopoverCore {
164
164
  }
165
165
  return false;
166
166
  }
167
- updatePositionDebounce() {
167
+ handlePositionUpdate() {
168
168
  if (!this.opened) {
169
169
  return;
170
170
  }
171
- clearTimeout(this._timeoutDebounce);
172
- this._timeoutDebounce = setTimeout(() => {
173
- this.updatePositionPopover();
174
- }, this.TIME_DEBOUNCE);
171
+ this.updatePositionPopover();
175
172
  }
176
173
  componentWillLoad() {
177
- window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
178
- window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
174
+ window.addEventListener('scroll', this.handlePositionUpdate.bind(this), true);
175
+ window.addEventListener('resize', this.handlePositionUpdate.bind(this), true);
179
176
  }
180
177
  componentDidLoad() {
181
178
  this._overlayIsActive = this.checkStatusOverlay();
@@ -184,8 +181,8 @@ export class EzPopoverCore {
184
181
  this.openPopover();
185
182
  }
186
183
  disconnectedCallback() {
187
- window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
188
- window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
184
+ window.removeEventListener('scroll', this.handlePositionUpdate.bind(this), true);
185
+ window.removeEventListener('resize', this.handlePositionUpdate.bind(this), true);
189
186
  this._resizeObserver.disconnect();
190
187
  }
191
188
  render() {
@@ -462,6 +462,16 @@ export class EzSearch {
462
462
  return;
463
463
  });
464
464
  });
465
+ this._intersectionObserver = new IntersectionObserver((entries) => {
466
+ entries.forEach(entry => {
467
+ if (!entry.isIntersecting && this._ezPopOverPlusElement) {
468
+ this._ezPopOverPlusElement.hide();
469
+ }
470
+ });
471
+ }, { threshold: 0.1 });
472
+ if (this._textInput) {
473
+ this._intersectionObserver.observe(this._textInput);
474
+ }
465
475
  await this.handleInitialValue();
466
476
  if (this.autoFocus) {
467
477
  requestAnimationFrame(() => {
@@ -470,8 +480,9 @@ export class EzSearch {
470
480
  }
471
481
  }
472
482
  disconnectedCallback() {
473
- var _a;
483
+ var _a, _b;
474
484
  (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
485
+ (_b = this._intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
475
486
  }
476
487
  //---------------------------------------------
477
488
  // Event handlers
@@ -5,6 +5,8 @@ export class SearchList {
5
5
  constructor() {
6
6
  this._startHighlightTag = "<span class='card-item__highlight'>";
7
7
  this._endHighlightTag = "</span>";
8
+ this.MAX_HEIGHT = 350;
9
+ this.HEADER_MENU_HEIGHT = 60;
8
10
  this.showLoading = undefined;
9
11
  this.visibleOptions = [];
10
12
  this.textEmptyList = undefined;
@@ -58,11 +60,38 @@ export class SearchList {
58
60
  };
59
61
  return h("div", { style: { "height": "100%" }, class: index === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this.changePreSelection.emit(index) }, h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
60
62
  }
63
+ componentDidLoad() {
64
+ if (this._optionsList) {
65
+ this._optionsList.style.maxHeight = `${this.MAX_HEIGHT}px`;
66
+ }
67
+ }
68
+ componentDidUpdate() {
69
+ if (this._optionsList) {
70
+ const rect = this._optionsList.getBoundingClientRect();
71
+ const spaceBelow = window.innerHeight - rect.bottom;
72
+ if (spaceBelow < 0) {
73
+ this.adjustMaxHeight(rect);
74
+ }
75
+ }
76
+ }
77
+ adjustMaxHeight(rect) {
78
+ if (this._optionsList) {
79
+ const spaceAbove = rect.top - this.HEADER_MENU_HEIGHT;
80
+ const maxHeight = this.MAX_HEIGHT;
81
+ const height = Math.min(spaceAbove, maxHeight);
82
+ this._optionsList.style.maxHeight = `${height}px`;
83
+ }
84
+ }
85
+ cleanEmptyObjectArray(arr) {
86
+ return arr.filter(item => {
87
+ return Object.values(item).some(valor => valor !== undefined);
88
+ });
89
+ }
61
90
  render() {
62
91
  return (h(Host, null, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
63
- && this.visibleOptions.length === 0
92
+ && this.cleanEmptyObjectArray(this.visibleOptions).length === 0
64
93
  && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
65
- && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
94
+ && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.cleanEmptyObjectArray(this.visibleOptions).map((opt, index) => this.buildItem(opt, index)))));
66
95
  }
67
96
  static get is() { return "search-list"; }
68
97
  static get encapsulation() { return "shadow"; }
@@ -75922,7 +75922,6 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
75922
75922
  this.__registerHost();
75923
75923
  this.__attachShadow();
75924
75924
  this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
75925
- this.TIME_DEBOUNCE = 500;
75926
75925
  this.autoClose = true;
75927
75926
  this.boxWidth = "fit-content";
75928
75927
  this.opened = false;
@@ -76026,11 +76025,6 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
76026
76025
  return;
76027
76026
  }
76028
76027
  const currentAnchorElement = this.getAnchorElement();
76029
- if (this.useAnchorSize) {
76030
- const anchorSize = currentAnchorElement.getBoundingClientRect().width;
76031
- const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
76032
- this._box.style.width = `${width}px`;
76033
- }
76034
76028
  await computePosition(currentAnchorElement, this._box, {
76035
76029
  placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
76036
76030
  middleware: [flip(), shift({ padding: 5 })],
@@ -76058,6 +76052,12 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
76058
76052
  }
76059
76053
  this._box.style.display = 'flex';
76060
76054
  this._box.style.visibility = 'hidden';
76055
+ if (this.useAnchorSize) {
76056
+ const currentAnchorElement = this.getAnchorElement();
76057
+ const anchorSize = currentAnchorElement.getBoundingClientRect().width;
76058
+ const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
76059
+ this._box.style.width = `${width}px`;
76060
+ }
76061
76061
  await this.updatePositionPopover();
76062
76062
  this.openOverlay();
76063
76063
  this.ezVisibilityChange.emit(true);
@@ -76084,18 +76084,15 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
76084
76084
  }
76085
76085
  return false;
76086
76086
  }
76087
- updatePositionDebounce() {
76087
+ handlePositionUpdate() {
76088
76088
  if (!this.opened) {
76089
76089
  return;
76090
76090
  }
76091
- clearTimeout(this._timeoutDebounce);
76092
- this._timeoutDebounce = setTimeout(() => {
76093
- this.updatePositionPopover();
76094
- }, this.TIME_DEBOUNCE);
76091
+ this.updatePositionPopover();
76095
76092
  }
76096
76093
  componentWillLoad() {
76097
- window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
76098
- window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
76094
+ window.addEventListener('scroll', this.handlePositionUpdate.bind(this), true);
76095
+ window.addEventListener('resize', this.handlePositionUpdate.bind(this), true);
76099
76096
  }
76100
76097
  componentDidLoad() {
76101
76098
  this._overlayIsActive = this.checkStatusOverlay();
@@ -76104,8 +76101,8 @@ const EzPopoverCore$1 = class extends HTMLElement$1 {
76104
76101
  this.openPopover();
76105
76102
  }
76106
76103
  disconnectedCallback() {
76107
- window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
76108
- window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
76104
+ window.removeEventListener('scroll', this.handlePositionUpdate.bind(this), true);
76105
+ window.removeEventListener('resize', this.handlePositionUpdate.bind(this), true);
76109
76106
  this._resizeObserver.disconnect();
76110
76107
  }
76111
76108
  render() {
@@ -77053,6 +77050,16 @@ const EzSearch$1 = class extends HTMLElement$1 {
77053
77050
  return;
77054
77051
  });
77055
77052
  });
77053
+ this._intersectionObserver = new IntersectionObserver((entries) => {
77054
+ entries.forEach(entry => {
77055
+ if (!entry.isIntersecting && this._ezPopOverPlusElement) {
77056
+ this._ezPopOverPlusElement.hide();
77057
+ }
77058
+ });
77059
+ }, { threshold: 0.1 });
77060
+ if (this._textInput) {
77061
+ this._intersectionObserver.observe(this._textInput);
77062
+ }
77056
77063
  await this.handleInitialValue();
77057
77064
  if (this.autoFocus) {
77058
77065
  requestAnimationFrame(() => {
@@ -77061,8 +77068,9 @@ const EzSearch$1 = class extends HTMLElement$1 {
77061
77068
  }
77062
77069
  }
77063
77070
  disconnectedCallback() {
77064
- var _a;
77071
+ var _a, _b;
77065
77072
  (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
77073
+ (_b = this._intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
77066
77074
  }
77067
77075
  //---------------------------------------------
77068
77076
  // Event handlers
@@ -81471,6 +81479,8 @@ const SearchList$1 = class extends HTMLElement$1 {
81471
81479
  this.changePreSelection = createEvent(this, "changePreSelection", 7);
81472
81480
  this._startHighlightTag = "<span class='card-item__highlight'>";
81473
81481
  this._endHighlightTag = "</span>";
81482
+ this.MAX_HEIGHT = 350;
81483
+ this.HEADER_MENU_HEIGHT = 60;
81474
81484
  this.showLoading = undefined;
81475
81485
  this.visibleOptions = [];
81476
81486
  this.textEmptyList = undefined;
@@ -81524,11 +81534,38 @@ const SearchList$1 = class extends HTMLElement$1 {
81524
81534
  };
81525
81535
  return h("div", { style: { "height": "100%" }, class: index === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this.changePreSelection.emit(index) }, h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
81526
81536
  }
81537
+ componentDidLoad() {
81538
+ if (this._optionsList) {
81539
+ this._optionsList.style.maxHeight = `${this.MAX_HEIGHT}px`;
81540
+ }
81541
+ }
81542
+ componentDidUpdate() {
81543
+ if (this._optionsList) {
81544
+ const rect = this._optionsList.getBoundingClientRect();
81545
+ const spaceBelow = window.innerHeight - rect.bottom;
81546
+ if (spaceBelow < 0) {
81547
+ this.adjustMaxHeight(rect);
81548
+ }
81549
+ }
81550
+ }
81551
+ adjustMaxHeight(rect) {
81552
+ if (this._optionsList) {
81553
+ const spaceAbove = rect.top - this.HEADER_MENU_HEIGHT;
81554
+ const maxHeight = this.MAX_HEIGHT;
81555
+ const height = Math.min(spaceAbove, maxHeight);
81556
+ this._optionsList.style.maxHeight = `${height}px`;
81557
+ }
81558
+ }
81559
+ cleanEmptyObjectArray(arr) {
81560
+ return arr.filter(item => {
81561
+ return Object.values(item).some(valor => valor !== undefined);
81562
+ });
81563
+ }
81527
81564
  render() {
81528
81565
  return (h(Host, null, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
81529
- && this.visibleOptions.length === 0
81566
+ && this.cleanEmptyObjectArray(this.visibleOptions).length === 0
81530
81567
  && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
81531
- && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
81568
+ && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.cleanEmptyObjectArray(this.visibleOptions).map((opt, index) => this.buildItem(opt, index)))));
81532
81569
  }
81533
81570
  static get style() { return searchListCss; }
81534
81571
  };
@@ -62,7 +62,6 @@ const EzPopoverCore = class {
62
62
  constructor(hostRef) {
63
63
  registerInstance(this, hostRef);
64
64
  this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
65
- this.TIME_DEBOUNCE = 500;
66
65
  this.autoClose = true;
67
66
  this.boxWidth = "fit-content";
68
67
  this.opened = false;
@@ -166,11 +165,6 @@ const EzPopoverCore = class {
166
165
  return;
167
166
  }
168
167
  const currentAnchorElement = this.getAnchorElement();
169
- if (this.useAnchorSize) {
170
- const anchorSize = currentAnchorElement.getBoundingClientRect().width;
171
- const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
172
- this._box.style.width = `${width}px`;
173
- }
174
168
  await computePosition(currentAnchorElement, this._box, {
175
169
  placement: this.options.fromRight ? 'bottom-end' : 'bottom-start',
176
170
  middleware: [flip(), shift({ padding: 5 })],
@@ -198,6 +192,12 @@ const EzPopoverCore = class {
198
192
  }
199
193
  this._box.style.display = 'flex';
200
194
  this._box.style.visibility = 'hidden';
195
+ if (this.useAnchorSize) {
196
+ const currentAnchorElement = this.getAnchorElement();
197
+ const anchorSize = currentAnchorElement.getBoundingClientRect().width;
198
+ const width = anchorSize < this.minWidth ? this.minWidth : anchorSize;
199
+ this._box.style.width = `${width}px`;
200
+ }
201
201
  await this.updatePositionPopover();
202
202
  this.openOverlay();
203
203
  this.ezVisibilityChange.emit(true);
@@ -224,18 +224,15 @@ const EzPopoverCore = class {
224
224
  }
225
225
  return false;
226
226
  }
227
- updatePositionDebounce() {
227
+ handlePositionUpdate() {
228
228
  if (!this.opened) {
229
229
  return;
230
230
  }
231
- clearTimeout(this._timeoutDebounce);
232
- this._timeoutDebounce = setTimeout(() => {
233
- this.updatePositionPopover();
234
- }, this.TIME_DEBOUNCE);
231
+ this.updatePositionPopover();
235
232
  }
236
233
  componentWillLoad() {
237
- window.addEventListener('scroll', this.updatePositionDebounce.bind(this), true);
238
- window.addEventListener('resize', this.updatePositionDebounce.bind(this), true);
234
+ window.addEventListener('scroll', this.handlePositionUpdate.bind(this), true);
235
+ window.addEventListener('resize', this.handlePositionUpdate.bind(this), true);
239
236
  }
240
237
  componentDidLoad() {
241
238
  this._overlayIsActive = this.checkStatusOverlay();
@@ -244,8 +241,8 @@ const EzPopoverCore = class {
244
241
  this.openPopover();
245
242
  }
246
243
  disconnectedCallback() {
247
- window.removeEventListener('scroll', this.updatePositionDebounce.bind(this), true);
248
- window.removeEventListener('resize', this.updatePositionDebounce.bind(this), true);
244
+ window.removeEventListener('scroll', this.handlePositionUpdate.bind(this), true);
245
+ window.removeEventListener('resize', this.handlePositionUpdate.bind(this), true);
249
246
  this._resizeObserver.disconnect();
250
247
  }
251
248
  render() {
@@ -138,6 +138,8 @@ const SearchList = class {
138
138
  this.changePreSelection = createEvent(this, "changePreSelection", 7);
139
139
  this._startHighlightTag = "<span class='card-item__highlight'>";
140
140
  this._endHighlightTag = "</span>";
141
+ this.MAX_HEIGHT = 350;
142
+ this.HEADER_MENU_HEIGHT = 60;
141
143
  this.showLoading = undefined;
142
144
  this.visibleOptions = [];
143
145
  this.textEmptyList = undefined;
@@ -191,11 +193,38 @@ const SearchList = class {
191
193
  };
192
194
  return h("div", { style: { "height": "100%" }, class: index === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createOption(card), onMouseOver: () => this.changePreSelection.emit(index) }, h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
193
195
  }
196
+ componentDidLoad() {
197
+ if (this._optionsList) {
198
+ this._optionsList.style.maxHeight = `${this.MAX_HEIGHT}px`;
199
+ }
200
+ }
201
+ componentDidUpdate() {
202
+ if (this._optionsList) {
203
+ const rect = this._optionsList.getBoundingClientRect();
204
+ const spaceBelow = window.innerHeight - rect.bottom;
205
+ if (spaceBelow < 0) {
206
+ this.adjustMaxHeight(rect);
207
+ }
208
+ }
209
+ }
210
+ adjustMaxHeight(rect) {
211
+ if (this._optionsList) {
212
+ const spaceAbove = rect.top - this.HEADER_MENU_HEIGHT;
213
+ const maxHeight = this.MAX_HEIGHT;
214
+ const height = Math.min(spaceAbove, maxHeight);
215
+ this._optionsList.style.maxHeight = `${height}px`;
216
+ }
217
+ }
218
+ cleanEmptyObjectArray(arr) {
219
+ return arr.filter(item => {
220
+ return Object.values(item).some(valor => valor !== undefined);
221
+ });
222
+ }
194
223
  render() {
195
224
  return (h(Host, null, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
196
- && this.visibleOptions.length === 0
225
+ && this.cleanEmptyObjectArray(this.visibleOptions).length === 0
197
226
  && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
198
- && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
227
+ && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.cleanEmptyObjectArray(this.visibleOptions).map((opt, index) => this.buildItem(opt, index)))));
199
228
  }
200
229
  };
201
230
  SearchList.style = searchListCss;
@@ -471,6 +471,16 @@ const EzSearch = class {
471
471
  return;
472
472
  });
473
473
  });
474
+ this._intersectionObserver = new IntersectionObserver((entries) => {
475
+ entries.forEach(entry => {
476
+ if (!entry.isIntersecting && this._ezPopOverPlusElement) {
477
+ this._ezPopOverPlusElement.hide();
478
+ }
479
+ });
480
+ }, { threshold: 0.1 });
481
+ if (this._textInput) {
482
+ this._intersectionObserver.observe(this._textInput);
483
+ }
474
484
  await this.handleInitialValue();
475
485
  if (this.autoFocus) {
476
486
  requestAnimationFrame(() => {
@@ -479,8 +489,9 @@ const EzSearch = class {
479
489
  }
480
490
  }
481
491
  disconnectedCallback() {
482
- var _a;
492
+ var _a, _b;
483
493
  (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
494
+ (_b = this._intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
484
495
  }
485
496
  //---------------------------------------------
486
497
  // Event handlers
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t(JSON.parse('[["p-6b39b79a",[[6,"ez-grid",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"autoFocus":[4,"auto-focus"],"paginationCounterMode":[1,"pagination-counter-mode"],"enableGridInsert":[4,"enable-grid-insert"],"enableContinuousInsert":[4,"enable-continuous-insert"],"suppressCheckboxColumn":[4,"suppress-checkbox-column"],"outlineMode":[4,"outline-mode"],"enableRowTableStriped":[4,"enable-row-table-striped"],"compact":[4],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"_customFormatters":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"refreshSelectedRows":[64],"getCustomValueFormatter":[64],"setFocus":[64],"stopEdit":[64],"checkStopEditOutsideClick":[64]},[[0,"ezSelectionChange","onSelectionChange"],[2,"click","handleClick"]]]]],["p-7e677b7b",[[2,"ez-double-list",{"leftList":[1040],"leftTitle":[1,"left-title"],"rightList":[1040],"entityLabel":[1,"entity-label"],"entityLabelPlural":[1,"entity-label-plural"],"leftListLabel":[1,"left-list-label"],"rightListLabel":[1,"right-list-label"],"rightTitle":[1,"right-title"],"leftFilteredList":[32],"rightFilteredList":[32],"selectedLeftList":[32],"selectedRightList":[32],"isFilteringLeft":[32],"isFilteringRight":[32],"resetSelectedLists":[64]}]]],["p-09de35a2",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540],"_container":[32]}]]],["p-e6a9041d",[[1,"ez-sidebar-navigator",{"type":[1],"mode":[1025],"size":[1],"isResponsive":[4,"is-responsive"],"titleMenu":[1,"title-menu"],"showCollapseMenu":[4,"show-collapse-menu"],"showFixedButton":[4,"show-fixed-button"],"open":[32],"changeModeMenu":[64],"closeSidebar":[64],"openSidebar":[64]}]]],["p-1e7a8633",[[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-a4cee65d",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-ecaac11f",[[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],"showActions":[64],"isOpened":[64]}]]],["p-9478b13b",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-e75c7a23",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"alignItems":[1537,"align-items"],"hasSlot":[32]}]]],["p-e06a9886",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-d47dabdf",[[1,"ez-chart",{"type":[1],"xAxis":[16],"yAxis":[16],"chartTitle":[1,"chart-title"],"chartSubTitle":[1,"chart-sub-title"],"legendEnabled":[4,"legend-enabled"],"series":[16],"width":[2],"height":[2]}]]],["p-bac0f920",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"closeOutsideLeave":[4,"close-outside-leave"],"scrim":[1]}]]],["p-9c5cd3b2",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"],"enabledScroll":[4,"enabled-scroll"]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-c0d9c4f8",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"goToTab":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-6825bdc7",[[1,"ez-tooltip",{"message":[1],"anchoringElement":[16],"placement":[1],"gapOptions":[16],"type":[1],"debouncingTime":[2,"debouncing-time"],"active":[4],"maxWidth":[2,"max-width"],"useAnchorSize":[4,"use-anchor-size"]}]]],["p-c00df4be",[[1,"ez-text-input",{"label":[513],"alternativePlaceholder":[513,"alternative-placeholder"],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"hasInvalid":[1540,"has-invalid"],"mask":[1],"cleanValueMask":[4,"clean-value-mask"],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"autoFocus":[4,"auto-focus"],"hasRightSlotContent":[32],"forceLabelFloat":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-03c106f6",[[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"],"showCloseButton":[4,"show-close-button"]},[[4,"ezCloseModal","handleEzModalAction"]]]]],["p-f4861c6a",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"structural":[4],"_expanded":[32]}]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-fa6732f2",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"structural":[4],"rebuildLayout":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-bf9dec89",[[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"],"compacted":[4]}],[1,"ez-popover-core",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"overlayType":[513,"overlay-type"],"anchorElement":[1537,"anchor-element"],"options":[1040],"useAnchorSize":[516,"use-anchor-size"],"minWidth":[514,"min-width"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64],"setOptions":[64],"setAnchorElement":[64]}]]],["p-a148e994",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-da1b4a38",[[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],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]]]],["p-dc73e1fe",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-6754489a",[[1,"ez-search-plus",{"value":[1537],"enabled":[1540],"disableCodeInput":[1540,"disable-code-input"],"disableDescriptionInput":[1540,"disable-description-input"],"label":[1537],"codLabel":[1537,"cod-label"],"hideDescriptionInput":[1540,"hide-description-input"],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"mode":[513],"contextProperties":[8,"context-properties"],"optionLoader":[16],"showOptionValue":[4,"show-option-value"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"autoFocus":[4,"auto-focus"],"showSelectedValue":[4,"show-selected-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"suppressSearch":[4,"suppress-search"],"suppressPreLoad":[4,"suppress-pre-load"],"ensureClearButtonVisible":[4,"ensure-clear-button-visible"],"descriptionValue":[32],"codeValue":[32],"isLoadingDescription":[32],"searchDescriptionIsOpen":[32],"visibleOptions":[32],"showLoading":[32],"setFocus":[64],"getValueAsync":[64],"clearValue":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-ebd23857",[[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"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"isOpen":[32],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]}]]],["p-5ec0ae79",[[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],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-4bd6dd6a",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"allowNegative":[4,"allow-negative"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[1,"alternative-placeholder"],"_value":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-496f7832",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-7019f782",[[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"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-3ba9565c",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[1,"alternative-placeholder"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-4cf0aaeb",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-cb75eb46",[[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"],"autoRows":[516,"auto-rows"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"forceLabelFloat":[32],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[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-2b4df33d",[[1,"ez-search-result-list",{"showLoading":[4,"show-loading"],"visibleOptions":[16],"value":[1],"showOptionValue":[4,"show-option-value"],"_preSelection":[32],"nextOption":[64],"previousOption":[64],"selectCurrentItem":[64],"cancelSelection":[64]}]]],["p-629d15ed",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"contextProperties":[8,"context-properties"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"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"],"ensureClearButtonVisible":[4,"ensure-clear-button-visible"],"suppressPreLoad":[4,"suppress-pre-load"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_showLoadingDescription":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]}]]],["p-20c024f7",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"autoFocus":[4,"auto-focus"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}]]],["p-288631d1",[[1,"ez-sidebar-button"],[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"]]]]],["p-5a14f506",[[2,"ez-custom-form-input",{"customEditor":[16],"formViewField":[16],"value":[1032],"detailContext":[1,"detail-context"],"builderFallback":[16],"selectedRecord":[16],"gui":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}],[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}],[1,"ez-combo-box-list",{"showLoading":[4,"show-loading"],"visibleOptions":[16],"textEmptyList":[1,"text-empty-list"],"showOptionValue":[4,"show-option-value"],"preSelection":[2,"pre-selection"],"maxWidth":[2,"max-width"],"width":[2],"onOptionSelect":[16],"onOptionHover":[16],"nextOption":[64],"previousOption":[64],"selectCurrentOption":[64]},[[0,"keydown","handleKeyDown"]]]]],["p-b81881ac",[[1,"ez-check",{"label":[513],"alternativePlaceholder":[513,"alternative-placeholder"],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-0bffeffc",[[2,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"enableMultipleSelection":[4,"enable-multiple-selection"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-7742802c",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-56fe5341",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-2872fd16",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-f5a30e35",[[0,"multi-selection-box-message",{"message":[1]}],[1,"search-list",{"showLoading":[4,"show-loading"],"visibleOptions":[16],"textEmptyList":[1,"text-empty-list"],"canShowListOptions":[4,"can-show-list-options"],"value":[1],"showOptionValue":[4,"show-option-value"],"preSelection":[2,"pre-selection"],"nextOption":[64],"previousOption":[64]}],[1,"ez-popover-plus",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"overlayType":[513,"overlay-type"],"anchorElement":[1537,"anchor-element"],"options":[1040],"useAnchorSize":[516,"use-anchor-size"],"minWidth":[514,"min-width"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64],"setOptions":[64],"setAnchorElement":[64]}]]],["p-9567b31a",[[2,"ez-form-view",{"fields":[16],"selectedRecord":[16],"singleColumn":[4,"single-column"],"_customEditors":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-f6316720",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"onlyStaticFields":[4,"only-static-fields"],"_fieldsProps":[32],"_singleColumn":[32],"validate":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]]]'),e)));
1
+ import{p as e,b as t}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t(JSON.parse('[["p-6b39b79a",[[6,"ez-grid",{"enableLockManagerLoadingComp":[4,"enable-lock-manager-loading-comp"],"enableLockManagerTaskbarClick":[4,"enable-lock-manager-taskbar-click"],"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"autoFocus":[4,"auto-focus"],"paginationCounterMode":[1,"pagination-counter-mode"],"enableGridInsert":[4,"enable-grid-insert"],"enableContinuousInsert":[4,"enable-continuous-insert"],"suppressCheckboxColumn":[4,"suppress-checkbox-column"],"outlineMode":[4,"outline-mode"],"enableRowTableStriped":[4,"enable-row-table-striped"],"compact":[4],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"_customFormatters":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"refreshSelectedRows":[64],"getCustomValueFormatter":[64],"setFocus":[64],"stopEdit":[64],"checkStopEditOutsideClick":[64]},[[0,"ezSelectionChange","onSelectionChange"],[2,"click","handleClick"]]]]],["p-7e677b7b",[[2,"ez-double-list",{"leftList":[1040],"leftTitle":[1,"left-title"],"rightList":[1040],"entityLabel":[1,"entity-label"],"entityLabelPlural":[1,"entity-label-plural"],"leftListLabel":[1,"left-list-label"],"rightListLabel":[1,"right-list-label"],"rightTitle":[1,"right-title"],"leftFilteredList":[32],"rightFilteredList":[32],"selectedLeftList":[32],"selectedRightList":[32],"isFilteringLeft":[32],"isFilteringRight":[32],"resetSelectedLists":[64]}]]],["p-09de35a2",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540],"_container":[32]}]]],["p-e6a9041d",[[1,"ez-sidebar-navigator",{"type":[1],"mode":[1025],"size":[1],"isResponsive":[4,"is-responsive"],"titleMenu":[1,"title-menu"],"showCollapseMenu":[4,"show-collapse-menu"],"showFixedButton":[4,"show-fixed-button"],"open":[32],"changeModeMenu":[64],"closeSidebar":[64],"openSidebar":[64]}]]],["p-1e7a8633",[[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-a4cee65d",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-ecaac11f",[[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],"showActions":[64],"isOpened":[64]}]]],["p-9478b13b",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-e75c7a23",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"alignItems":[1537,"align-items"],"hasSlot":[32]}]]],["p-e06a9886",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-d47dabdf",[[1,"ez-chart",{"type":[1],"xAxis":[16],"yAxis":[16],"chartTitle":[1,"chart-title"],"chartSubTitle":[1,"chart-sub-title"],"legendEnabled":[4,"legend-enabled"],"series":[16],"width":[2],"height":[2]}]]],["p-bac0f920",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"closeOutsideLeave":[4,"close-outside-leave"],"scrim":[1]}]]],["p-9c5cd3b2",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"],"enabledScroll":[4,"enabled-scroll"]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-c0d9c4f8",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"goToTab":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-6825bdc7",[[1,"ez-tooltip",{"message":[1],"anchoringElement":[16],"placement":[1],"gapOptions":[16],"type":[1],"debouncingTime":[2,"debouncing-time"],"active":[4],"maxWidth":[2,"max-width"],"useAnchorSize":[4,"use-anchor-size"]}]]],["p-c00df4be",[[1,"ez-text-input",{"label":[513],"alternativePlaceholder":[513,"alternative-placeholder"],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"hasInvalid":[1540,"has-invalid"],"mask":[1],"cleanValueMask":[4,"clean-value-mask"],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"autoFocus":[4,"auto-focus"],"hasRightSlotContent":[32],"forceLabelFloat":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-03c106f6",[[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"],"showCloseButton":[4,"show-close-button"]},[[4,"ezCloseModal","handleEzModalAction"]]]]],["p-f4861c6a",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"structural":[4],"_expanded":[32]}]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-fa6732f2",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"structural":[4],"rebuildLayout":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-69937816",[[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"],"compacted":[4]}],[1,"ez-popover-core",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"overlayType":[513,"overlay-type"],"anchorElement":[1537,"anchor-element"],"options":[1040],"useAnchorSize":[516,"use-anchor-size"],"minWidth":[514,"min-width"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64],"setOptions":[64],"setAnchorElement":[64]}]]],["p-a148e994",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-da1b4a38",[[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],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]]]],["p-dc73e1fe",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-6754489a",[[1,"ez-search-plus",{"value":[1537],"enabled":[1540],"disableCodeInput":[1540,"disable-code-input"],"disableDescriptionInput":[1540,"disable-description-input"],"label":[1537],"codLabel":[1537,"cod-label"],"hideDescriptionInput":[1540,"hide-description-input"],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"mode":[513],"contextProperties":[8,"context-properties"],"optionLoader":[16],"showOptionValue":[4,"show-option-value"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"autoFocus":[4,"auto-focus"],"showSelectedValue":[4,"show-selected-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"suppressSearch":[4,"suppress-search"],"suppressPreLoad":[4,"suppress-pre-load"],"ensureClearButtonVisible":[4,"ensure-clear-button-visible"],"descriptionValue":[32],"codeValue":[32],"isLoadingDescription":[32],"searchDescriptionIsOpen":[32],"visibleOptions":[32],"showLoading":[32],"setFocus":[64],"getValueAsync":[64],"clearValue":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-ebd23857",[[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"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"isOpen":[32],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]}]]],["p-5ec0ae79",[[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],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-4bd6dd6a",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"allowNegative":[4,"allow-negative"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[1,"alternative-placeholder"],"_value":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-496f7832",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-7019f782",[[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"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-3ba9565c",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[1,"alternative-placeholder"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-4cf0aaeb",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-cb75eb46",[[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"],"autoRows":[516,"auto-rows"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"forceLabelFloat":[32],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[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-2b4df33d",[[1,"ez-search-result-list",{"showLoading":[4,"show-loading"],"visibleOptions":[16],"value":[1],"showOptionValue":[4,"show-option-value"],"_preSelection":[32],"nextOption":[64],"previousOption":[64],"selectCurrentItem":[64],"cancelSelection":[64]}]]],["p-ff1d8b8f",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"contextProperties":[8,"context-properties"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"stopPropagateEnterKeyEvent":[4,"stop-propagate-enter-key-event"],"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"],"ensureClearButtonVisible":[4,"ensure-clear-button-visible"],"suppressPreLoad":[4,"suppress-pre-load"],"autoFocus":[4,"auto-focus"],"alternativePlaceholder":[513,"alternative-placeholder"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_showLoadingDescription":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]}]]],["p-20c024f7",[[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"autoFocus":[4,"auto-focus"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}]]],["p-288631d1",[[1,"ez-sidebar-button"],[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"]]]]],["p-5a14f506",[[2,"ez-custom-form-input",{"customEditor":[16],"formViewField":[16],"value":[1032],"detailContext":[1,"detail-context"],"builderFallback":[16],"selectedRecord":[16],"gui":[32],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}],[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}],[1,"ez-combo-box-list",{"showLoading":[4,"show-loading"],"visibleOptions":[16],"textEmptyList":[1,"text-empty-list"],"showOptionValue":[4,"show-option-value"],"preSelection":[2,"pre-selection"],"maxWidth":[2,"max-width"],"width":[2],"onOptionSelect":[16],"onOptionHover":[16],"nextOption":[64],"previousOption":[64],"selectCurrentOption":[64]},[[0,"keydown","handleKeyDown"]]]]],["p-b81881ac",[[1,"ez-check",{"label":[513],"alternativePlaceholder":[513,"alternative-placeholder"],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-0bffeffc",[[2,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"enableMultipleSelection":[4,"enable-multiple-selection"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-7742802c",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-56fe5341",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-2872fd16",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-4b67138e",[[0,"multi-selection-box-message",{"message":[1]}],[1,"search-list",{"showLoading":[4,"show-loading"],"visibleOptions":[16],"textEmptyList":[1,"text-empty-list"],"canShowListOptions":[4,"can-show-list-options"],"value":[1],"showOptionValue":[4,"show-option-value"],"preSelection":[2,"pre-selection"],"nextOption":[64],"previousOption":[64]}],[1,"ez-popover-plus",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"overlayType":[513,"overlay-type"],"anchorElement":[1537,"anchor-element"],"options":[1040],"useAnchorSize":[516,"use-anchor-size"],"minWidth":[514,"min-width"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64],"setOptions":[64],"setAnchorElement":[64]}]]],["p-9567b31a",[[2,"ez-form-view",{"fields":[16],"selectedRecord":[16],"singleColumn":[4,"single-column"],"_customEditors":[32],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-f6316720",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"onlyStaticFields":[4,"only-static-fields"],"_fieldsProps":[32],"_singleColumn":[32],"validate":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]]]'),e)));
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as s,g as r}from"./p-23a36bb6.js";import{StringUtils as a}from"@sankhyalabs/core";import{a as o,r as l}from"./p-40a60148.js";const h=class{constructor(i){e(this,i),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}async observeOpened(e){e&&!this._popOverCore&&this.renderPopoverCore(),this._popOverCore.opened=e}async updatePosition(e,t){var i;await(null===(i=this._popOverCore)||void 0===i?void 0:i.updatePosition(e,t))}async show(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.show(e,t)}async showUnder(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.showUnder(e,t)}async hide(){var e;await(null===(e=this._popOverCore)||void 0===e?void 0:e.hide())}async setOptions(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setOptions(e))}async setAnchorElement(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setAnchorElement(e)),this.anchorElement=e}getFirstElement(e){return Array.isArray(e)&&e.length?e[0]:!Array.isArray(e)&&e.item?e.item(0):null}renderPopoverCore(){var e;this._popOverCore=document.createElement("ez-popover-core"),this._popOverCore.opened=this.opened,this._popOverCore.anchorElement=this.anchorElement,this._popOverCore.autoClose=this.autoClose,this._popOverCore.boxWidth=this.boxWidth,this._popOverCore.overlayType=this.overlayType,this._popOverCore.options=this.options,this._popOverCore.useAnchorSize=this.useAnchorSize,this._popOverCore.minWidth=this.minWidth,this._popOverCore.addEventListener("ezVisibilityChange",(({detail:e})=>{this.ezVisibilityChange.emit(e),this.opened=e}));const t=this.getFirstElement(this._host.children);t?this._popOverCore.appendChild(t):console.warn("O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.");const i=document.body.querySelector("#root"),s=this.getFirstElement(document.body.getElementsByTagName("div"));(null!==(e=null!=i?i:s)&&void 0!==e?e:document.body).appendChild(this._popOverCore)}render(){return i(s,null,i("slot",null))}get _host(){return r(this)}static get watchers(){return{opened:["observeOpened"]}}};h.style=":host{display:none}";const n=class{constructor(t){e(this,t),this.message=void 0}render(){return i("div",{class:"multi-selection__message"},i("span",{class:"multi-selection__text-message"},this.message))}};n.style=".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";const c=class{constructor(i){e(this,i),this.changeValue=t(this,"changeValue",7),this.changePreSelection=t(this,"changePreSelection",7),this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this.MAX_HEIGHT=350,this.HEADER_MENU_HEIGHT=60,this.showLoading=void 0,this.visibleOptions=[],this.textEmptyList=void 0,this.canShowListOptions=void 0,this.value=void 0,this.showOptionValue=!0,this.preSelection=void 0}async nextOption(){const e=void 0===this.preSelection?0:Math.min(this.preSelection+1,this.visibleOptions.length-1);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}async previousOption(){const e=void 0===this.preSelection?0:Math.max(this.preSelection-1,0);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}selectOption(e){const t=Object.assign(Object.assign({},e),{value:o(null==e?void 0:e.value),label:o(null==e?void 0:e.label)}),i=Object.assign(Object.assign({},t),{value:l(null==t?void 0:t.value),label:l(null==t?void 0:t.label)});this.changeValue.emit(i)}createOption(e){let{key:t,title:i}=e;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");i=a.decodeHtmlEntities(i);const o={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==i?void 0:i.replace(s,"").replace(r,"")};this.selectOption(o)}scrollToOption(e){window.requestAnimationFrame((()=>{const t=(null==e?void 0:e.value)?this._optionsList.querySelector(`div#item_${e.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}buildItem(e,t){e.label=e.label||e.value;const s={key:e.value,title:e.label,details:e.details};return i("div",{style:{height:"100%"},class:t===this.preSelection?"item preselected":"item",id:`item_${e.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this.changePreSelection.emit(t)},i("ez-card-item",{item:s,compacted:!0,enableKey:this.showOptionValue}))}componentDidLoad(){this._optionsList&&(this._optionsList.style.maxHeight=`${this.MAX_HEIGHT}px`)}componentDidUpdate(){if(this._optionsList){const e=this._optionsList.getBoundingClientRect();window.innerHeight-e.bottom<0&&this.adjustMaxHeight(e)}}adjustMaxHeight(e){if(this._optionsList){const t=Math.min(e.top-this.HEADER_MENU_HEIGHT,this.MAX_HEIGHT);this._optionsList.style.maxHeight=`${t}px`}}cleanEmptyObjectArray(e){return e.filter((e=>Object.values(e).some((e=>void 0!==e))))}render(){return i(s,null,i("ul",{class:"list-options",ref:e=>this._optionsList=e},!this.showLoading&&0===this.cleanEmptyObjectArray(this.visibleOptions).length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.canShowListOptions&&this.cleanEmptyObjectArray(this.visibleOptions).map(((e,t)=>this.buildItem(e,t)))))}};c.style=":host{--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__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--small, 6px);--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-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;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__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}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.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);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";export{h as ez_popover_plus,n as multi_selection_box_message,c as search_list}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,H as n,g as o}from"./p-23a36bb6.js";import{StringUtils as a,ElementIDUtils as r}from"@sankhyalabs/core";import{c as d,f as s,s as c}from"./p-e07e4671.js";const l=class{constructor(i){t(this,i),this.ezClick=e(this,"ezClick",7),this.item=void 0,this.enableKey=!0,this.compacted=!1}componentWillRender(){this.createDetailList()}componentDidLoad(){var t,e;const i={id:a.toCamelCase((null===(t=this.item)||void 0===t?void 0:t.key)||(null===(e=this.item)||void 0===e?void 0:e.title)||"")};r.addIDInfo(this._element,null,i)}createDetailList(){var t,e,i;this._details={detailsLeft:[],detailsRight:[]};let n=0;if(null===(t=this.item)||void 0===t?void 0:t.details)for(const t in this.item.details)n<3?this._details.detailsLeft.push({label:t,value:null===(e=this.item.details[t])||void 0===e?void 0:e.toString()}):this._details.detailsRight.push({label:t,value:null===(i=this.item.details[t])||void 0===i?void 0:i.toString()}),n++}buildDetailContentTitle(t){var e,i;if(null!=(null==t?void 0:t.label)||null!=(null==t?void 0:t.value))return`${null===(e=a.replaceAccentuatedCharsHtmlEntities(null==t?void 0:t.label))||void 0===e?void 0:e.replace(/<[^>]*>/g,"")}: ${null===(i=a.replaceAccentuatedCharsHtmlEntities(null==t?void 0:t.value))||void 0===i?void 0:i.replace(/<[^>]*>/g,"")}`}buildDetailContent(t){return i("div",{class:"card-item__detail "+(this.compacted?"":"card-item__detail-default"),title:this.buildDetailContentTitle(t)},i("label",{class:"card-item__detail-label "+(this.compacted?"card-item__detail-label-compacted":"")},`${t.label}: `)," ",i("label",{class:"card-item__detail-value "+(this.compacted?"card-item__detail-value-compacted":""),innerHTML:t.value}))}render(){return i(n,null,this.item&&i("div",{class:`card-item ${this.compacted?"card-item__compacted":"card-item__expanded"} `,onClick:()=>{this.ezClick.emit(this.item)}},i("div",{class:"ez-row card-item__content"},i("div",{class:"ez-col ez-col--sd-11 card-item__details"},i("label",{class:"card-item__title "+(this.compacted?"card-item__title-compacted":"")},this.enableKey&&i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:this.compacted?"card-item__details-container_compacted":"card-item__details-container_default"},i("div",{class:"card-item__details-container__left "+(this.compacted?"card-item__details-container__left-compacted":"")},this._details.detailsLeft.map((t=>this.buildDetailContent(t)))),i("div",{class:"card-item__details-container__right "+(this.compacted?"card-item__details-container__right-compacted":"")},this._details.detailsRight.map((t=>this.buildDetailContent(t)))))),i("div",{class:"ez-col ez-col--sd-1 card-item__details-slot"},i("slot",{name:"rightSlot"})))))}get _element(){return o(this)}};l.style=":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--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(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs) var(--space--small);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";const h=class{constructor(i){t(this,i),this.ezVisibilityChange=e(this,"ezVisibilityChange",7),this.TIME_DEBOUNCE=500,this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(t,e){t!==e&&(t?this.openPopover():this.hidePopover())}async updatePosition(t,e){this.updateOptionPosition(t,e),await this.updatePositionPopover()}async show(t,e){this.updateOptionPosition(t,e),this.opened=!0}async showUnder(t,e){e&&(this.options=e),this.anchorElement=t,this.opened=!0}async hide(){this.opened=!1}async setOptions(t){Object.assign(this.options,t)}async setAnchorElement(t){this.anchorElement=t}parseSizePixel(t,e){return t?"string"==typeof t?Number(t.replace("px","")):null!=t?t:0:null!=e?e:0}updateOptionPosition(t,e){Object.assign(this.options,{horizontalGap:this.parseSizePixel(e,this.options.horizontalGap),verticalGap:this.parseSizePixel(t,this.options.verticalGap)})}getElement(t){return"string"==typeof t?document.getElementById(t):t}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const t of this.anchorElement){const e=this.getElement(t);if(e)return e}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const t=this.getAnchorElement();if(this.useAnchorSize){const e=t.getBoundingClientRect().width;this._box.style.width=`${e<this.minWidth?this.minWidth:e}px`}await d(t,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[s(),c({padding:5})],strategy:"fixed"}).then((({x:t,y:e,placement:i})=>{const n=i.includes("bottom")?e+this.options.verticalGap:e-this.options.verticalGap,o=i.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${n}px`,left:`${o}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){this._box&&this.opened&&(this._box.style.display="flex",this._box.style.visibility="hidden",await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible")}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}updatePositionDebounce(){this.opened&&(clearTimeout(this._timeoutDebounce),this._timeoutDebounce=setTimeout((()=>{this.updatePositionPopover()}),this.TIME_DEBOUNCE))}componentWillLoad(){window.addEventListener("scroll",this.updatePositionDebounce.bind(this),!0),window.addEventListener("resize",this.updatePositionDebounce.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.updatePositionDebounce.bind(this),!0),window.removeEventListener("resize",this.updatePositionDebounce.bind(this),!0),this._resizeObserver.disconnect()}render(){return i(n,null,i("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),i("section",{ref:t=>this._box=t,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},i("slot",null)))}get _host(){return o(this)}static get watchers(){return{opened:["observeOpened"]}}};h.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--elevation--24, 24)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{l as ez_card_item,h as ez_popover_core}
1
+ import{r as t,c as e,h as i,H as n,g as o}from"./p-23a36bb6.js";import{StringUtils as a,ElementIDUtils as r}from"@sankhyalabs/core";import{c as d,f as s,s as l}from"./p-e07e4671.js";const c=class{constructor(i){t(this,i),this.ezClick=e(this,"ezClick",7),this.item=void 0,this.enableKey=!0,this.compacted=!1}componentWillRender(){this.createDetailList()}componentDidLoad(){var t,e;const i={id:a.toCamelCase((null===(t=this.item)||void 0===t?void 0:t.key)||(null===(e=this.item)||void 0===e?void 0:e.title)||"")};r.addIDInfo(this._element,null,i)}createDetailList(){var t,e,i;this._details={detailsLeft:[],detailsRight:[]};let n=0;if(null===(t=this.item)||void 0===t?void 0:t.details)for(const t in this.item.details)n<3?this._details.detailsLeft.push({label:t,value:null===(e=this.item.details[t])||void 0===e?void 0:e.toString()}):this._details.detailsRight.push({label:t,value:null===(i=this.item.details[t])||void 0===i?void 0:i.toString()}),n++}buildDetailContentTitle(t){var e,i;if(null!=(null==t?void 0:t.label)||null!=(null==t?void 0:t.value))return`${null===(e=a.replaceAccentuatedCharsHtmlEntities(null==t?void 0:t.label))||void 0===e?void 0:e.replace(/<[^>]*>/g,"")}: ${null===(i=a.replaceAccentuatedCharsHtmlEntities(null==t?void 0:t.value))||void 0===i?void 0:i.replace(/<[^>]*>/g,"")}`}buildDetailContent(t){return i("div",{class:"card-item__detail "+(this.compacted?"":"card-item__detail-default"),title:this.buildDetailContentTitle(t)},i("label",{class:"card-item__detail-label "+(this.compacted?"card-item__detail-label-compacted":"")},`${t.label}: `)," ",i("label",{class:"card-item__detail-value "+(this.compacted?"card-item__detail-value-compacted":""),innerHTML:t.value}))}render(){return i(n,null,this.item&&i("div",{class:`card-item ${this.compacted?"card-item__compacted":"card-item__expanded"} `,onClick:()=>{this.ezClick.emit(this.item)}},i("div",{class:"ez-row card-item__content"},i("div",{class:"ez-col ez-col--sd-11 card-item__details"},i("label",{class:"card-item__title "+(this.compacted?"card-item__title-compacted":"")},this.enableKey&&i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:this.compacted?"card-item__details-container_compacted":"card-item__details-container_default"},i("div",{class:"card-item__details-container__left "+(this.compacted?"card-item__details-container__left-compacted":"")},this._details.detailsLeft.map((t=>this.buildDetailContent(t)))),i("div",{class:"card-item__details-container__right "+(this.compacted?"card-item__details-container__right-compacted":"")},this._details.detailsRight.map((t=>this.buildDetailContent(t)))))),i("div",{class:"ez-col ez-col--sd-1 card-item__details-slot"},i("slot",{name:"rightSlot"})))))}get _element(){return o(this)}};c.style=":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--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(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs) var(--space--small);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";const h=class{constructor(i){t(this,i),this.ezVisibilityChange=e(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(t,e){t!==e&&(t?this.openPopover():this.hidePopover())}async updatePosition(t,e){this.updateOptionPosition(t,e),await this.updatePositionPopover()}async show(t,e){this.updateOptionPosition(t,e),this.opened=!0}async showUnder(t,e){e&&(this.options=e),this.anchorElement=t,this.opened=!0}async hide(){this.opened=!1}async setOptions(t){Object.assign(this.options,t)}async setAnchorElement(t){this.anchorElement=t}parseSizePixel(t,e){return t?"string"==typeof t?Number(t.replace("px","")):null!=t?t:0:null!=e?e:0}updateOptionPosition(t,e){Object.assign(this.options,{horizontalGap:this.parseSizePixel(e,this.options.horizontalGap),verticalGap:this.parseSizePixel(t,this.options.verticalGap)})}getElement(t){return"string"==typeof t?document.getElementById(t):t}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const t of this.anchorElement){const e=this.getElement(t);if(e)return e}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const t=this.getAnchorElement();await d(t,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[s(),l({padding:5})],strategy:"fixed"}).then((({x:t,y:e,placement:i})=>{const n=i.includes("bottom")?e+this.options.verticalGap:e-this.options.verticalGap,o=i.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${n}px`,left:`${o}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){if(this._box&&this.opened){if(this._box.style.display="flex",this._box.style.visibility="hidden",this.useAnchorSize){const t=this.getAnchorElement().getBoundingClientRect().width;this._box.style.width=`${t<this.minWidth?this.minWidth:t}px`}await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible"}}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}handlePositionUpdate(){this.opened&&this.updatePositionPopover()}componentWillLoad(){window.addEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.addEventListener("resize",this.handlePositionUpdate.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.removeEventListener("resize",this.handlePositionUpdate.bind(this),!0),this._resizeObserver.disconnect()}render(){return i(n,null,i("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),i("section",{ref:t=>this._box=t,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},i("slot",null)))}get _host(){return o(this)}static get watchers(){return{opened:["observeOpened"]}}};h.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--elevation--24, 24)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{c as ez_card_item,h as ez_popover_core}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as e,g as h}from"./p-23a36bb6.js";import{C as o}from"./p-ec7db713.js";import{ObjectUtils as r,StringUtils as a,ElementIDUtils as n}from"@sankhyalabs/core";import{A as l}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-5895e687.js";import"./p-173f68ea.js";import{R as c}from"./p-5eea9886.js";import{r as d,a as u}from"./p-40a60148.js";const v=class{constructor(s){t(this,s),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._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._showLoadingDescription=!1,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.contextProperties=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1,this.ensureClearButtonVisible=!1,this.suppressPreLoad=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,!(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())&&this.errorMessage&&this.setInputValue())}getValue(t){return"object"==typeof t?null==t?void 0:t.value:t}validateNewValue(t,i){const s=this.getValue(t),e=this.getValue(i);return!("[object Object]"===s||s===e)}async observeValue(t,i){if(this._textInput&&this.validateNewValue(t,i)){if("string"==typeof t)return void await this.handleValueAsString(t);const i=this.getSelectedOption(t),s=this.getSelectedOption(this._currentValue);this.isDifferentValues(s,i)&&(this._currentValue=i,this.setInputValue(),this.ezChange.emit(null!=i?i:void 0)),this.resetOptions()}}observeOptions(t,i){!t.length&&this.suppressPreLoad||(null==t?void 0:t.join(""))!==(null==i?void 0:i.join(""))&&this.loadOptions(p.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.value))}),100)}:t=>t(this.value))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}async handleValueAsString(t){this.getSelectedOption(t)?this.setInputValue():(await this.loadDescriptionValue(t),this._currentValue&&(this.setInputValue(),this.ezChange.emit(this.value),this._currentValue=this.value))}isDifferentValues(t,i){return r.objectToString(t||{})!==r.objectToString(i||{})}getFormattedText(t){if(null==t)return;let i=this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label;return i=null==i?void 0:i.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),i}getText(){const t=this.getSelectedOption(this._currentValue),i=this.getFormattedText(t);return d(i)}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t?Object.assign(Object.assign({},t),{value:u(null==t?void 0:t.value),label:u(null==t?void 0:t.label)}):t}updateVisibleOptions(){let t=this._source||[];this._visibleOptions=this.suppressEmptyOption?t:[{value:void 0,label:""}].concat(t),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var t;const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}showOptions(){this.enabled&&(this.isOptionsVisible()||this._ezPopOverPlusElement.showUnder(this._textInput))}hideOptions(){this._ezPopOverPlusElement.hide()}isOptionsVisible(){return this._ezPopOverPlusElement.opened}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,this._showLoadingDescription=!0,t.then((t=>{this.updateSource(t)})).finally((()=>{this._showLoading=!1,this._showLoadingDescription=!1})),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch(!1))):this.selectOption(t))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(t,i=!0){var s,e;const h=this.getSelectedOption(this.value),o=Object.assign(Object.assign({},t),{value:u(null==t?void 0:t.value),label:u(null==t?void 0:t.label)}),r=Object.assign(Object.assign({},o),{value:d(null==o?void 0:o.value),label:d(null==o?void 0:o.label)});if((null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(e=null==r?void 0:r.value)||void 0===e?void 0:e.toString())||null==h&&null!=r&&"value"in r){const t=(null==r?void 0:r.value)?r:void 0;this.value=t,this._currentValue=t}else this.setInputValue(),this.resetOptions();this._visibleOptions=[],this.clearSource(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i},this.contextProperties):this.options)}cancelPreselection(){!this._textInput.value&&this._currentValue&&this._source.length>0?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null,this._currentValue=null}controlListWithOnlyOne(t=!0){var i,s;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((t=>""!==t.label&&null!=t.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),h=new RegExp(this._endHighlightTag,"g");let o=a.decodeHtmlEntities(e[0].label);const r={value:null===(s=e[0].value)||void 0===s?void 0:s.replace(i,"").replace(h,""),label:null==o?void 0:o.replace(i,"").replace(h,"")};this.selectOption(r,t)}}controlEmptySearch(t=!0){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne(t):(this.clearSearch(),l.info(this._textEmptyList))}async loadDescriptionValue(t){var i,s;if(null==t)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(t);const e={mode:p.PREDICTIVE,argument:t},h=await(null===(s=this.optionLoader)||void 0===s?void 0:s.call(this,e,this.contextProperties));null!=h&&(h instanceof Promise?h.then((t=>{this.setDescriptionValue(t)})):this.setDescriptionValue(h))}setDescriptionValue(t){const i=(null==t?void 0:t[0])||t;null!=i&&Object.keys(i).length?(this._currentValue=i?Object.assign(Object.assign({},i),{value:u(i.value),label:u(i.label)}):i,this.value=this._currentValue,this.setTextInputValue()):this.showNoResultMessage()}setTextInputValue(){if(this._textInput&&null==this._textInput.value){if(null==this.value)return;const t="string"==typeof this.value?this.value:this.getFormattedText(this.value);this._textInput.value=d(t)}}loadOptionValue(t){var i;const s=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===t));null!=s?this.selectOption(s):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),l.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var t;return null===(t=this.label)||void 0===t?void 0:t.replace(c,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}async handleInitialValue(){if(!this.getValue(this.value))return;if("string"==typeof this.value)return void await this.handleValueAsString(this.value);let t=this.getFormattedText(this.value);t=d(t),this._textInput.value=t}componentWillLoad(){if(void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value"),e=t.getAttribute("details");s||(s=i),this.options.push({label:i,value:s,details:e}),t.hidden=!0}))}this.updateSource([])}componentDidRender(){var t;null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{n.addIDInfoIfNotExists(t,"itemSearch")}))}async componentDidLoad(){this._currentValue=this.value,o.applyVarsTextInput(this.el,this._textInput),this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)}))})),await this.handleInitialValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._resizeObserver)||void 0===t||t.disconnect()}handlerIconClick(){this.loadOptions(p.ADVANCED)}buildNumberArgument(t){return this.isTextSearch?NaN:Number(t||void 0)}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim(),e=this.buildNumberArgument(s);this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this._showLoading=!1,this.clearSource(),this.ignoreLimitCharsToSearch||!isNaN(e)||s.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(p.PREDICTIVE,isNaN(e)?s:e.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}async keyDownHandler(t){switch(this._tabPressed=!1,t.ctrlKey&&("f"!==t.key&&"F"!==t.key||(this.loadOptions(p.ADVANCED),t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault())),t.key){case"ArrowDown":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),this.isOptionsVisible()||this.showOptions(),await this._searchList.nextOption();break;case"ArrowUp":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),await this._searchList.previousOption();break;case"Enter":this.handleEventPropagation(t),this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne(!1)}}handleEventPropagation(t){this._ezPopOverPlusElement.opened&&this.stopPropagateEnterKeyEvent&&t.stopPropagation()}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}canShowLoadSpinDescription(){return this._showLoadingDescription&&!this._ezPopOverPlusElement.opened}onChangePreSelection(t){this._preSelection=t}render(){var t;return n.addIDInfoIfNotExists(this.el,"input"),s(e,null,s("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder},s("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},this.canShowLoadSpinDescription()?s("div",{class:"message__loading"}):s("ez-icon",{iconName:"search"})),(null===(t=this._textInput)||void 0===t?void 0:t.value)&&(this._criteria||this.value)||this.ensureClearButtonVisible?s("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},s("ez-icon",{iconName:"close"})):void 0),s("ez-popover-plus",{ref:t=>this._ezPopOverPlusElement=t,autoClose:!1,overlayType:"none",useAnchorSize:!0,anchorElement:[this._textInput,this.el]},s("search-list",{ref:t=>this._searchList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this._textEmptyList,canShowListOptions:this.canShowListOptions(),value:this.value,showOptionValue:this.showOptionValue,preSelection:this._preSelection,onChangeValue:({detail:t})=>this.selectOption(t),onChangePreSelection:({detail:t})=>this.onChangePreSelection(t)})))}get el(){return h(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var p;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(p||(p={})),v.style=":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--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);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)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;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}";export{v as ez_search}
1
+ import{r as t,c as i,h as s,H as e,g as h}from"./p-23a36bb6.js";import{C as o}from"./p-ec7db713.js";import{ObjectUtils as r,StringUtils as n,ElementIDUtils as a}from"@sankhyalabs/core";import{A as l}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-5895e687.js";import"./p-173f68ea.js";import{R as c}from"./p-5eea9886.js";import{r as d,a as u}from"./p-40a60148.js";const v=class{constructor(s){t(this,s),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._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._showLoadingDescription=!1,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.contextProperties=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1,this.ensureClearButtonVisible=!1,this.suppressPreLoad=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,!(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())&&this.errorMessage&&this.setInputValue())}getValue(t){return"object"==typeof t?null==t?void 0:t.value:t}validateNewValue(t,i){const s=this.getValue(t),e=this.getValue(i);return!("[object Object]"===s||s===e)}async observeValue(t,i){if(this._textInput&&this.validateNewValue(t,i)){if("string"==typeof t)return void await this.handleValueAsString(t);const i=this.getSelectedOption(t),s=this.getSelectedOption(this._currentValue);this.isDifferentValues(s,i)&&(this._currentValue=i,this.setInputValue(),this.ezChange.emit(null!=i?i:void 0)),this.resetOptions()}}observeOptions(t,i){!t.length&&this.suppressPreLoad||(null==t?void 0:t.join(""))!==(null==i?void 0:i.join(""))&&this.loadOptions(p.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.value))}),100)}:t=>t(this.value))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}async handleValueAsString(t){this.getSelectedOption(t)?this.setInputValue():(await this.loadDescriptionValue(t),this._currentValue&&(this.setInputValue(),this.ezChange.emit(this.value),this._currentValue=this.value))}isDifferentValues(t,i){return r.objectToString(t||{})!==r.objectToString(i||{})}getFormattedText(t){if(null==t)return;let i=this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label;return i=null==i?void 0:i.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),i}getText(){const t=this.getSelectedOption(this._currentValue),i=this.getFormattedText(t);return d(i)}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t?Object.assign(Object.assign({},t),{value:u(null==t?void 0:t.value),label:u(null==t?void 0:t.label)}):t}updateVisibleOptions(){let t=this._source||[];this._visibleOptions=this.suppressEmptyOption?t:[{value:void 0,label:""}].concat(t),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var t;const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}showOptions(){this.enabled&&(this.isOptionsVisible()||this._ezPopOverPlusElement.showUnder(this._textInput))}hideOptions(){this._ezPopOverPlusElement.hide()}isOptionsVisible(){return this._ezPopOverPlusElement.opened}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,this._showLoadingDescription=!0,t.then((t=>{this.updateSource(t)})).finally((()=>{this._showLoading=!1,this._showLoadingDescription=!1})),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch(!1))):this.selectOption(t))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(t,i=!0){var s,e;const h=this.getSelectedOption(this.value),o=Object.assign(Object.assign({},t),{value:u(null==t?void 0:t.value),label:u(null==t?void 0:t.label)}),r=Object.assign(Object.assign({},o),{value:d(null==o?void 0:o.value),label:d(null==o?void 0:o.label)});if((null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(e=null==r?void 0:r.value)||void 0===e?void 0:e.toString())||null==h&&null!=r&&"value"in r){const t=(null==r?void 0:r.value)?r:void 0;this.value=t,this._currentValue=t}else this.setInputValue(),this.resetOptions();this._visibleOptions=[],this.clearSource(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i},this.contextProperties):this.options)}cancelPreselection(){!this._textInput.value&&this._currentValue&&this._source.length>0?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null,this._currentValue=null}controlListWithOnlyOne(t=!0){var i,s;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((t=>""!==t.label&&null!=t.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),h=new RegExp(this._endHighlightTag,"g");let o=n.decodeHtmlEntities(e[0].label);const r={value:null===(s=e[0].value)||void 0===s?void 0:s.replace(i,"").replace(h,""),label:null==o?void 0:o.replace(i,"").replace(h,"")};this.selectOption(r,t)}}controlEmptySearch(t=!0){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne(t):(this.clearSearch(),l.info(this._textEmptyList))}async loadDescriptionValue(t){var i,s;if(null==t)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(t);const e={mode:p.PREDICTIVE,argument:t},h=await(null===(s=this.optionLoader)||void 0===s?void 0:s.call(this,e,this.contextProperties));null!=h&&(h instanceof Promise?h.then((t=>{this.setDescriptionValue(t)})):this.setDescriptionValue(h))}setDescriptionValue(t){const i=(null==t?void 0:t[0])||t;null!=i&&Object.keys(i).length?(this._currentValue=i?Object.assign(Object.assign({},i),{value:u(i.value),label:u(i.label)}):i,this.value=this._currentValue,this.setTextInputValue()):this.showNoResultMessage()}setTextInputValue(){if(this._textInput&&null==this._textInput.value){if(null==this.value)return;const t="string"==typeof this.value?this.value:this.getFormattedText(this.value);this._textInput.value=d(t)}}loadOptionValue(t){var i;const s=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===t));null!=s?this.selectOption(s):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),l.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var t;return null===(t=this.label)||void 0===t?void 0:t.replace(c,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}async handleInitialValue(){if(!this.getValue(this.value))return;if("string"==typeof this.value)return void await this.handleValueAsString(this.value);let t=this.getFormattedText(this.value);t=d(t),this._textInput.value=t}componentWillLoad(){if(void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value"),e=t.getAttribute("details");s||(s=i),this.options.push({label:i,value:s,details:e}),t.hidden=!0}))}this.updateSource([])}componentDidRender(){var t;null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{a.addIDInfoIfNotExists(t,"itemSearch")}))}async componentDidLoad(){this._currentValue=this.value,o.applyVarsTextInput(this.el,this._textInput),this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)}))})),this._intersectionObserver=new IntersectionObserver((t=>{t.forEach((t=>{!t.isIntersecting&&this._ezPopOverPlusElement&&this._ezPopOverPlusElement.hide()}))}),{threshold:.1}),this._textInput&&this._intersectionObserver.observe(this._textInput),await this.handleInitialValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t,i;null===(t=this._resizeObserver)||void 0===t||t.disconnect(),null===(i=this._intersectionObserver)||void 0===i||i.disconnect()}handlerIconClick(){this.loadOptions(p.ADVANCED)}buildNumberArgument(t){return this.isTextSearch?NaN:Number(t||void 0)}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim(),e=this.buildNumberArgument(s);this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this._showLoading=!1,this.clearSource(),this.ignoreLimitCharsToSearch||!isNaN(e)||s.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(p.PREDICTIVE,isNaN(e)?s:e.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}async keyDownHandler(t){switch(this._tabPressed=!1,t.ctrlKey&&("f"!==t.key&&"F"!==t.key||(this.loadOptions(p.ADVANCED),t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault())),t.key){case"ArrowDown":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),this.isOptionsVisible()||this.showOptions(),await this._searchList.nextOption();break;case"ArrowUp":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),await this._searchList.previousOption();break;case"Enter":this.handleEventPropagation(t),this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne(!1)}}handleEventPropagation(t){this._ezPopOverPlusElement.opened&&this.stopPropagateEnterKeyEvent&&t.stopPropagation()}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}canShowLoadSpinDescription(){return this._showLoadingDescription&&!this._ezPopOverPlusElement.opened}onChangePreSelection(t){this._preSelection=t}render(){var t;return a.addIDInfoIfNotExists(this.el,"input"),s(e,null,s("ez-text-input",{"data-element-id":a.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder},s("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},this.canShowLoadSpinDescription()?s("div",{class:"message__loading"}):s("ez-icon",{iconName:"search"})),(null===(t=this._textInput)||void 0===t?void 0:t.value)&&(this._criteria||this.value)||this.ensureClearButtonVisible?s("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},s("ez-icon",{iconName:"close"})):void 0),s("ez-popover-plus",{ref:t=>this._ezPopOverPlusElement=t,autoClose:!1,overlayType:"none",useAnchorSize:!0,anchorElement:[this._textInput,this.el]},s("search-list",{ref:t=>this._searchList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this._textEmptyList,canShowListOptions:this.canShowListOptions(),value:this.value,showOptionValue:this.showOptionValue,preSelection:this._preSelection,onChangeValue:({detail:t})=>this.selectOption(t),onChangePreSelection:({detail:t})=>this.onChangePreSelection(t)})))}get el(){return h(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var p;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(p||(p={})),v.style=":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--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);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)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;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}";export{v as ez_search}
@@ -3,9 +3,7 @@ export declare class EzPopoverCore {
3
3
  private _box;
4
4
  private _overlay;
5
5
  private _overlayIsActive;
6
- private _timeoutDebounce;
7
6
  private _resizeObserver;
8
- private TIME_DEBOUNCE;
9
7
  _host: HTMLElement;
10
8
  /**
11
9
  * Define se será fechado automaticamente quando o usuário clicar fora do conteúdo.
@@ -78,7 +76,7 @@ export declare class EzPopoverCore {
78
76
  private openOverlay;
79
77
  private hideOverlay;
80
78
  private checkStatusOverlay;
81
- private updatePositionDebounce;
79
+ private handlePositionUpdate;
82
80
  componentWillLoad(): void;
83
81
  componentDidLoad(): void;
84
82
  disconnectedCallback(): void;
@@ -16,6 +16,7 @@ export declare class EzSearch {
16
16
  private _textEmptyList;
17
17
  private _textEmptySearch;
18
18
  private _resizeObserver;
19
+ private _intersectionObserver;
19
20
  private _startHighlightTag;
20
21
  private _endHighlightTag;
21
22
  private _currentValue;
@@ -4,6 +4,8 @@ export declare class SearchList {
4
4
  private _startHighlightTag;
5
5
  private _endHighlightTag;
6
6
  private _optionsList;
7
+ private readonly MAX_HEIGHT;
8
+ private readonly HEADER_MENU_HEIGHT;
7
9
  showLoading: boolean;
8
10
  visibleOptions: Array<IOption>;
9
11
  textEmptyList: string;
@@ -19,5 +21,9 @@ export declare class SearchList {
19
21
  private createOption;
20
22
  private scrollToOption;
21
23
  private buildItem;
24
+ componentDidLoad(): void;
25
+ componentDidUpdate(): void;
26
+ private adjustMaxHeight;
27
+ private cleanEmptyObjectArray;
22
28
  render(): any;
23
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "5.22.0-dev.123",
3
+ "version": "5.22.0-dev.124",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i,H as s,g as r}from"./p-23a36bb6.js";import{StringUtils as a}from"@sankhyalabs/core";import{a as o,r as l}from"./p-40a60148.js";const n=class{constructor(i){e(this,i),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}async observeOpened(e){e&&!this._popOverCore&&this.renderPopoverCore(),this._popOverCore.opened=e}async updatePosition(e,t){var i;await(null===(i=this._popOverCore)||void 0===i?void 0:i.updatePosition(e,t))}async show(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.show(e,t)}async showUnder(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.showUnder(e,t)}async hide(){var e;await(null===(e=this._popOverCore)||void 0===e?void 0:e.hide())}async setOptions(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setOptions(e))}async setAnchorElement(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setAnchorElement(e)),this.anchorElement=e}getFirstElement(e){return Array.isArray(e)&&e.length?e[0]:!Array.isArray(e)&&e.item?e.item(0):null}renderPopoverCore(){var e;this._popOverCore=document.createElement("ez-popover-core"),this._popOverCore.opened=this.opened,this._popOverCore.anchorElement=this.anchorElement,this._popOverCore.autoClose=this.autoClose,this._popOverCore.boxWidth=this.boxWidth,this._popOverCore.overlayType=this.overlayType,this._popOverCore.options=this.options,this._popOverCore.useAnchorSize=this.useAnchorSize,this._popOverCore.minWidth=this.minWidth,this._popOverCore.addEventListener("ezVisibilityChange",(({detail:e})=>{this.ezVisibilityChange.emit(e),this.opened=e}));const t=this.getFirstElement(this._host.children);t?this._popOverCore.appendChild(t):console.warn("O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.");const i=document.body.querySelector("#root"),s=this.getFirstElement(document.body.getElementsByTagName("div"));(null!==(e=null!=i?i:s)&&void 0!==e?e:document.body).appendChild(this._popOverCore)}render(){return i(s,null,i("slot",null))}get _host(){return r(this)}static get watchers(){return{opened:["observeOpened"]}}};n.style=":host{display:none}";const h=class{constructor(t){e(this,t),this.message=void 0}render(){return i("div",{class:"multi-selection__message"},i("span",{class:"multi-selection__text-message"},this.message))}};h.style=".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";const c=class{constructor(i){e(this,i),this.changeValue=t(this,"changeValue",7),this.changePreSelection=t(this,"changePreSelection",7),this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this.showLoading=void 0,this.visibleOptions=[],this.textEmptyList=void 0,this.canShowListOptions=void 0,this.value=void 0,this.showOptionValue=!0,this.preSelection=void 0}async nextOption(){const e=void 0===this.preSelection?0:Math.min(this.preSelection+1,this.visibleOptions.length-1);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}async previousOption(){const e=void 0===this.preSelection?0:Math.max(this.preSelection-1,0);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}selectOption(e){const t=Object.assign(Object.assign({},e),{value:o(null==e?void 0:e.value),label:o(null==e?void 0:e.label)}),i=Object.assign(Object.assign({},t),{value:l(null==t?void 0:t.value),label:l(null==t?void 0:t.label)});this.changeValue.emit(i)}createOption(e){let{key:t,title:i}=e;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");i=a.decodeHtmlEntities(i);const o={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==i?void 0:i.replace(s,"").replace(r,"")};this.selectOption(o)}scrollToOption(e){window.requestAnimationFrame((()=>{const t=(null==e?void 0:e.value)?this._optionsList.querySelector(`div#item_${e.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}buildItem(e,t){e.label=e.label||e.value;const s={key:e.value,title:e.label,details:e.details};return i("div",{style:{height:"100%"},class:t===this.preSelection?"item preselected":"item",id:`item_${e.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this.changePreSelection.emit(t)},i("ez-card-item",{item:s,compacted:!0,enableKey:this.showOptionValue}))}render(){return i(s,null,i("ul",{class:"list-options",ref:e=>this._optionsList=e},!this.showLoading&&0===this.visibleOptions.length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.canShowListOptions&&this.visibleOptions.map(((e,t)=>this.buildItem(e,t)))))}};c.style=":host{--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__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--small, 6px);--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-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.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)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;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__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}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.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);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";export{n as ez_popover_plus,h as multi_selection_box_message,c as search_list}