@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-74406.0 → 0.0.0-bugfix-dev-KB-75940.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-card-item_2.cjs.entry.js +1416 -7
  3. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +32 -11
  4. package/dist/cjs/ez-date-input.cjs.entry.js +4 -17
  5. package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -16
  6. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  7. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +195 -0
  10. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-search.cjs.entry.js +28 -158
  12. package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
  13. package/dist/cjs/ezui.cjs.js +1 -1
  14. package/dist/cjs/index-a7b0c73d.js +4 -4
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/cjs/searchFormatters-b7e1ed1e.js +23 -0
  17. package/dist/collection/collection-manifest.json +2 -1
  18. package/dist/collection/components/ez-button/ez-button.css +1 -1
  19. package/dist/collection/components/ez-card-item/ez-card-item.css +1 -3
  20. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +33 -12
  21. package/dist/collection/components/ez-date-input/ez-date-input.js +4 -17
  22. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +4 -16
  23. package/dist/collection/components/ez-list/ez-list.js +2 -2
  24. package/dist/collection/components/ez-modal/ez-modal.js +1 -1
  25. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  26. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +49 -14
  27. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +2 -2
  28. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +72 -12
  29. package/dist/collection/components/ez-popup/ez-popup.js +1 -1
  30. package/dist/collection/components/ez-search/ez-search.css +0 -219
  31. package/dist/collection/components/ez-search/ez-search.js +28 -167
  32. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +227 -0
  33. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +289 -0
  34. package/dist/collection/components/ez-search/utils/searchFormatters.js +18 -0
  35. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +1 -1
  36. package/dist/custom-elements/index.d.ts +6 -0
  37. package/dist/custom-elements/index.js +214 -229
  38. package/dist/esm/ez-button.entry.js +1 -1
  39. package/dist/esm/ez-card-item_2.entry.js +1416 -7
  40. package/dist/esm/ez-combo-box-list_3.entry.js +32 -11
  41. package/dist/esm/ez-date-input.entry.js +4 -17
  42. package/dist/esm/ez-date-time-input.entry.js +4 -16
  43. package/dist/esm/ez-list.entry.js +2 -2
  44. package/dist/esm/ez-modal-container.entry.js +1 -1
  45. package/dist/esm/ez-modal.entry.js +1 -1
  46. package/dist/esm/ez-popover-plus_3.entry.js +189 -0
  47. package/dist/esm/ez-popup.entry.js +1 -1
  48. package/dist/esm/ez-search.entry.js +29 -159
  49. package/dist/esm/ez-split-item.entry.js +1 -1
  50. package/dist/esm/ezui.js +1 -1
  51. package/dist/esm/index-baa5e267.js +4 -4
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/searchFormatters-8229207e.js +20 -0
  54. package/dist/ezui/ezui.esm.js +1 -1
  55. package/dist/ezui/p-0bffeffc.entry.js +1 -0
  56. package/dist/ezui/p-23b6128c.entry.js +1 -0
  57. package/dist/ezui/p-248d4f54.entry.js +1 -0
  58. package/dist/ezui/p-2872fd16.entry.js +1 -0
  59. package/dist/ezui/p-40a60148.js +1 -0
  60. package/dist/ezui/p-4e0628a7.entry.js +1 -0
  61. package/dist/ezui/p-788467fe.entry.js +1 -0
  62. package/dist/ezui/p-84b1c99e.entry.js +1 -0
  63. package/dist/ezui/p-b7706b43.entry.js +1 -0
  64. package/dist/ezui/p-c297aa52.entry.js +1 -0
  65. package/dist/ezui/p-d2bc2f06.entry.js +1 -0
  66. package/dist/ezui/p-dcf3c8e5.entry.js +1 -0
  67. package/dist/ezui/p-e5c3ed19.entry.js +1 -0
  68. package/dist/types/components/ez-calendar/ez-calendar.d.ts +3 -3
  69. package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +1 -1
  70. package/dist/types/components/ez-date-input/ez-date-input.d.ts +2 -2
  71. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +2 -2
  72. package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +9 -4
  73. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +12 -2
  74. package/dist/types/components/ez-search/ez-search.d.ts +3 -13
  75. package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +23 -0
  76. package/dist/types/components/ez-search/utils/searchFormatters.d.ts +2 -0
  77. package/dist/types/components.d.ts +73 -5
  78. package/package.json +1 -1
  79. package/react/components.d.ts +1 -0
  80. package/react/components.js +1 -0
  81. package/react/components.js.map +1 -1
  82. package/dist/cjs/ez-popover-core_2.cjs.entry.js +0 -1504
  83. package/dist/esm/ez-popover-core_2.entry.js +0 -1499
  84. package/dist/ezui/p-0faf71c5.entry.js +0 -1
  85. package/dist/ezui/p-15134d97.entry.js +0 -1
  86. package/dist/ezui/p-17eabf46.entry.js +0 -1
  87. package/dist/ezui/p-1ad6c61b.entry.js +0 -1
  88. package/dist/ezui/p-2bb2a0c4.entry.js +0 -1
  89. package/dist/ezui/p-3195a7a7.entry.js +0 -1
  90. package/dist/ezui/p-3429080c.entry.js +0 -1
  91. package/dist/ezui/p-58783dcf.entry.js +0 -1
  92. package/dist/ezui/p-65f471bc.entry.js +0 -1
  93. package/dist/ezui/p-7bd15498.entry.js +0 -1
  94. package/dist/ezui/p-cb1535f7.entry.js +0 -1
  95. package/dist/ezui/p-d9548bdf.entry.js +0 -1
@@ -24,15 +24,29 @@ const EzComboBoxList = class {
24
24
  * Move a seleção para a próxima opção na lista.
25
25
  */
26
26
  async nextOption() {
27
- this.preSelection = this.preSelection === undefined ? 0 : Math.min(this.preSelection + 1, this.visibleOptions.length - 1);
28
- this.scrollToOption(this.visibleOptions[this.preSelection]);
27
+ var _a, _b;
28
+ if (!((_a = this.visibleOptions) === null || _a === void 0 ? void 0 : _a.length))
29
+ return;
30
+ const isAtLastOption = this.preSelection !== undefined && this.preSelection >= this.visibleOptions.length - 1;
31
+ if (!isAtLastOption) {
32
+ this.preSelection = this.preSelection === undefined ? 0 : this.preSelection + 1;
33
+ this.scrollToOption(this.visibleOptions[this.preSelection]);
34
+ (_b = this.onOptionHover) === null || _b === void 0 ? void 0 : _b.call(this, this.preSelection);
35
+ }
29
36
  }
30
37
  /**
31
- * Move a seleção para a opção anterior na lista.
38
+ * Move a seleção para a opção anterior na lista, sem ultrapassar o início.
32
39
  */
33
40
  async previousOption() {
34
- this.preSelection = this.preSelection === undefined ? 0 : Math.max(this.preSelection - 1, 0);
35
- this.scrollToOption(this.visibleOptions[this.preSelection]);
41
+ var _a, _b;
42
+ if (!((_a = this.visibleOptions) === null || _a === void 0 ? void 0 : _a.length))
43
+ return;
44
+ const isAtFirstOption = this.preSelection !== undefined && this.preSelection <= 0;
45
+ if (!isAtFirstOption) {
46
+ this.preSelection = this.preSelection === undefined ? this.visibleOptions.length - 1 : this.preSelection - 1;
47
+ this.scrollToOption(this.visibleOptions[this.preSelection]);
48
+ (_b = this.onOptionHover) === null || _b === void 0 ? void 0 : _b.call(this, this.preSelection);
49
+ }
36
50
  }
37
51
  /**
38
52
  * Seleciona a opção atualmente pré-selecionada.
@@ -102,16 +116,23 @@ const EzComboBoxList = class {
102
116
  buildItem(opt, index) {
103
117
  const widthValue = this.showOptionValue && this.maxWidth > 0 ? `${this.maxWidth}px` : '';
104
118
  opt.label = opt.label || opt.value;
105
- return h("li", { class: index === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.onOptionSelect(opt), onMouseOver: () => this.preSelection = index }, this.showOptionValue
119
+ return h("li", { tabIndex: 1, class: index === this.preSelection ? "item preselected" : "item", id: `item_${opt.value}_${index}`, key: `item_${opt.value}_${index}`, onMouseDown: () => this.onOptionSelect(opt), onMouseOver: () => this.preSelection = index }, this.showOptionValue
106
120
  ? h("span", { class: "item__value", title: opt.value, style: { width: widthValue, minWidth: widthValue, maxWidth: widthValue } }, opt.value)
107
121
  : undefined, h("span", { class: "item__label " + (this.showOptionValue ? "item__label--bold" : ""), title: opt.label }, opt.label));
108
122
  }
109
123
  scrollToOption(opt) {
110
- window.requestAnimationFrame(() => {
111
- const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`li#item_${opt.value.replace(/[ <>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
112
- if (liElem)
113
- liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
114
- });
124
+ if (!(opt === null || opt === void 0 ? void 0 : opt.value) || !this._optionsList)
125
+ return;
126
+ const index = this.visibleOptions.indexOf(opt);
127
+ if (index === -1)
128
+ return;
129
+ const liElem = this._optionsList.querySelector(`li#item_${CSS.escape(opt.value)}_${CSS.escape(String(index))}`);
130
+ if (liElem) {
131
+ liElem.scrollIntoView({
132
+ behavior: "smooth",
133
+ block: "nearest"
134
+ });
135
+ }
115
136
  }
116
137
  componentDidLoad() {
117
138
  this._listWrapper.style.width = `${this.width}px`;
@@ -93,22 +93,9 @@ const EzDateInput = class {
93
93
  this._changePending = false;
94
94
  }
95
95
  }
96
- showCalendar() {
97
- this.handleBlur();
98
- this._calendar.value = this.value;
99
- let top;
100
- if (this.isFixed()) {
101
- top = 29;
102
- this._calendar.fitHorizontal(0);
103
- }
104
- else {
105
- top = this.errorMessage || this.mode === "slim" ? 6 : -13;
106
- }
107
- this._calendar.fitVertical(top, this._elem.clientHeight);
108
- }
109
96
  hideCalendar() {
110
97
  this.changeValue(this._calendar.value);
111
- this._calendar.hide();
98
+ this._popover.hide();
112
99
  }
113
100
  handleBlur() {
114
101
  if (!this._changePending) {
@@ -169,8 +156,8 @@ const EzDateInput = class {
169
156
  this._textInput.value = textValue;
170
157
  }
171
158
  }
172
- isFixed() {
173
- return this._elem.dataset.isFixed === "true";
159
+ disconnectedCallback() {
160
+ this.hideCalendar();
174
161
  }
175
162
  componentDidLoad() {
176
163
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
@@ -183,7 +170,7 @@ const EzDateInput = class {
183
170
  }
184
171
  render() {
185
172
  ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
186
- return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { ref: elem => this._calendar = elem, "data-element-id": ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, "data-is-fixed": this._elem.dataset.isFixed })));
173
+ return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, canShowError: this.canShowError }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => { var _a; return (_a = this._popover) === null || _a === void 0 ? void 0 : _a.showUnder(this._textInput); }, slot: "leftIcon" })), h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none' }, h("ez-calendar", { ref: elem => this._calendar = elem, "data-element-id": ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); } }))));
187
174
  }
188
175
  get _elem() { return getElement(this); }
189
176
  static get watchers() { return {
@@ -127,21 +127,9 @@ const EzDateTimeInput = class {
127
127
  this.value = newValueValidated;
128
128
  }
129
129
  }
130
- showCalendar() {
131
- let top;
132
- if (this.isFixed()) {
133
- top = 29;
134
- this._calendar.fitHorizontal(0);
135
- }
136
- else {
137
- top = this.errorMessage || this.mode === "slim" ? 6 : -13;
138
- }
139
- this._calendar.fitVertical(top, this._elem.clientHeight);
140
- this._calendar.style.visibility = 'inherit';
141
- }
142
130
  hideCalendar() {
143
131
  this.changeValue(this._calendar.value);
144
- this._calendar.hide();
132
+ this._popover.hide();
145
133
  }
146
134
  getParsedDateTime(strValue) {
147
135
  var _a, _b;
@@ -219,8 +207,8 @@ const EzDateTimeInput = class {
219
207
  this._textInput.value = textValue;
220
208
  }
221
209
  }
222
- isFixed() {
223
- return this._elem.dataset.isFixed === "true";
210
+ disconnectedCallback() {
211
+ this.hideCalendar();
224
212
  }
225
213
  componentDidLoad() {
226
214
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
@@ -233,7 +221,7 @@ const EzDateTimeInput = class {
233
221
  }
234
222
  render() {
235
223
  ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
236
- return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onKeyDown: event => { this.handleKeyDown(event); }, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), onFocus: () => this.handleFocus(), onClick: () => this.handleClick(), canShowError: this.canShowError }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { ref: elem => this._calendar = elem, "data-element-id": ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, time: true, showSeconds: this.showSeconds, "data-is-fixed": this._elem.dataset.isFixed })));
224
+ return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onKeyDown: event => { this.handleKeyDown(event); }, onBlur: () => this.handleBlur(), onInput: (evt) => this.handleInput(evt), onFocus: () => this.handleFocus(), onClick: () => this.handleClick(), canShowError: this.canShowError }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => { var _a; return (_a = this._popover) === null || _a === void 0 ? void 0 : _a.showUnder(this._textInput); }, slot: "leftIcon" })), h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInput, autoClose: true, boxWidth: 'fit-content', overlayType: 'none' }, h("ez-calendar", { ref: elem => this._calendar = elem, "data-element-id": ElementIDUtils.getInternalIDInfo("calendar"), onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, time: true, showSeconds: this.showSeconds }))));
237
225
  }
238
226
  get _elem() { return getElement(this); }
239
227
  static get watchers() { return {
@@ -585,7 +585,7 @@ const EzList = class {
585
585
  return { id: item.id, label: item.label, check: evt.detail };
586
586
  }
587
587
  renderListWithGroups() {
588
- return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: 0, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
588
+ return h("div", { class: 'group-container', ref: el => (this._groupContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => this.keyDownHandler(event) }, this._listGroupItems.map(group => {
589
589
  return (h("div", { id: this.getDivGroupId(group.group), class: 'group', key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, h("label", { draggable: false, class: 'group-name', title: group.group }, group.group), h("section", { class: 'section-container', onDragOver: ev => ev.preventDefault() }, h("div", { class: 'group-items-container' }, h("div", { class: 'draggable-list' }, group.items.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
590
590
  'selectable-container': this.ezSelectable,
591
591
  'hover-feedback': this.hoverFeedback,
@@ -595,7 +595,7 @@ const EzList = class {
595
595
  }));
596
596
  }
597
597
  renderList() {
598
- return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: 0, onKeyDown: event => {
598
+ return h("div", { class: 'items-container', ref: el => (this._itemContainer = el), tabIndex: this.ezSelectable ? 0 : undefined, onKeyDown: event => {
599
599
  this.keyDownHandler(event);
600
600
  } }, h("div", { class: 'draggable-list' }, this._listItems.map((item, index) => (h("li", Object.assign({ id: 'item_' + item.id, class: {
601
601
  'selectable-container': this.ezSelectable,
@@ -68,7 +68,7 @@ const EzModalContainer = class {
68
68
  this._closeButton.focus();
69
69
  }
70
70
  render() {
71
- return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
71
+ return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { tabIndex: -1, class: "ez-modal-container__content" }, h("slot", null)), h("div", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
72
72
  }
73
73
  get _element() { return getElement(this); }
74
74
  };
@@ -32,7 +32,7 @@ const EzModal = class {
32
32
  }
33
33
  componentDidLoad() {
34
34
  this.observeOpened();
35
- new KeyboardManager({ propagate: false, element: this._element })
35
+ new KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
36
36
  .bind("Enter", this.ezModalAction.emit.bind("OK"))
37
37
  .bind("Escape", () => this.closeModal())
38
38
  .bind("Esc", () => this.closeModal());
@@ -0,0 +1,189 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
+ import { StringUtils } from '@sankhyalabs/core';
3
+ import { a as replaceHighlight, r as replaceQuotes } from './searchFormatters-8229207e.js';
4
+
5
+ const ezPopoverPlusCss = ":host{display:none}";
6
+
7
+ const EzPopoverPlus = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
11
+ this.autoClose = true;
12
+ this.boxWidth = "fit-content";
13
+ this.opened = false;
14
+ this.overlayType = "light";
15
+ this.anchorElement = undefined;
16
+ this.options = { horizontalGap: 0, verticalGap: 0, fromRight: false };
17
+ this.useAnchorSize = false;
18
+ this.minWidth = 150;
19
+ }
20
+ async observeOpened(newValue) {
21
+ if (newValue && !this._popOverCore) {
22
+ this.renderPopoverCore();
23
+ }
24
+ this._popOverCore.opened = newValue;
25
+ }
26
+ /**
27
+ * Atualiza a posição do popover.
28
+ */
29
+ async updatePosition(top, left) {
30
+ var _a;
31
+ await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.updatePosition(top, left));
32
+ }
33
+ /**
34
+ * Exibe o ez-popover.
35
+ */
36
+ async show(top, left) {
37
+ if (!this._popOverCore) {
38
+ this.renderPopoverCore();
39
+ }
40
+ await this._popOverCore.show(top, left);
41
+ }
42
+ /**
43
+ * Ancora a exibição do popOver a um elemento HTML.
44
+ */
45
+ async showUnder(element, options) {
46
+ if (!this._popOverCore) {
47
+ this.renderPopoverCore();
48
+ }
49
+ await this._popOverCore.showUnder(element, options);
50
+ }
51
+ /**
52
+ * Oculta o ez-popover.
53
+ */
54
+ async hide() {
55
+ var _a;
56
+ await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.hide());
57
+ }
58
+ /**
59
+ * Altera as opções.
60
+ */
61
+ async setOptions(options) {
62
+ var _a;
63
+ await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setOptions(options));
64
+ }
65
+ /**
66
+ * Altera o elemento de ancoragem.
67
+ */
68
+ async setAnchorElement(anchor) {
69
+ var _a;
70
+ await ((_a = this._popOverCore) === null || _a === void 0 ? void 0 : _a.setAnchorElement(anchor));
71
+ }
72
+ renderPopoverCore() {
73
+ this._popOverCore = document.createElement('ez-popover-core');
74
+ this._popOverCore.opened = this.opened;
75
+ this._popOverCore.anchorElement = this.anchorElement;
76
+ this._popOverCore.autoClose = this.autoClose;
77
+ this._popOverCore.boxWidth = this.boxWidth;
78
+ this._popOverCore.overlayType = this.overlayType;
79
+ this._popOverCore.options = this.options;
80
+ this._popOverCore.useAnchorSize = this.useAnchorSize;
81
+ this._popOverCore.minWidth = this.minWidth;
82
+ this._popOverCore.addEventListener('ezVisibilityChange', ({ detail }) => {
83
+ this.ezVisibilityChange.emit(detail);
84
+ this.opened = detail;
85
+ });
86
+ const firstChild = this._host.children.item(0);
87
+ if (firstChild) {
88
+ this._popOverCore.appendChild(firstChild);
89
+ }
90
+ else {
91
+ console.warn('O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.');
92
+ }
93
+ document.body.appendChild(this._popOverCore);
94
+ }
95
+ render() {
96
+ return (h(Host, null, h("slot", null)));
97
+ }
98
+ get _host() { return getElement(this); }
99
+ static get watchers() { return {
100
+ "opened": ["observeOpened"]
101
+ }; }
102
+ };
103
+ EzPopoverPlus.style = ezPopoverPlusCss;
104
+
105
+ const multiSelectionBoxMessageCss = ".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)}";
106
+
107
+ const MultiSelectionBoxMessage = class {
108
+ constructor(hostRef) {
109
+ registerInstance(this, hostRef);
110
+ this.message = undefined;
111
+ }
112
+ render() {
113
+ return (h("div", { class: "multi-selection__message" }, h("span", { class: "multi-selection__text-message" }, this.message)));
114
+ }
115
+ };
116
+ MultiSelectionBoxMessage.style = multiSelectionBoxMessageCss;
117
+
118
+ const searchListCss = ":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}}";
119
+
120
+ const SearchList = class {
121
+ constructor(hostRef) {
122
+ registerInstance(this, hostRef);
123
+ this.changeValue = createEvent(this, "changeValue", 7);
124
+ this.changePreSelection = createEvent(this, "changePreSelection", 7);
125
+ this._startHighlightTag = "<span class='card-item__highlight'>";
126
+ this._endHighlightTag = "</span>";
127
+ this.showLoading = undefined;
128
+ this.visibleOptions = [];
129
+ this.textEmptyList = undefined;
130
+ this.canShowListOptions = undefined;
131
+ this.value = undefined;
132
+ this.showOptionValue = true;
133
+ this.preSelection = undefined;
134
+ }
135
+ async nextOption() {
136
+ const newPreSelection = this.preSelection === undefined ? 0 : Math.min(this.preSelection + 1, this.visibleOptions.length - 1);
137
+ this.changePreSelection.emit(newPreSelection);
138
+ this.scrollToOption(this.visibleOptions[newPreSelection]);
139
+ }
140
+ async previousOption() {
141
+ const newPreSelection = this.preSelection === undefined ? 0 : Math.max(this.preSelection - 1, 0);
142
+ this.changePreSelection.emit(newPreSelection);
143
+ this.scrollToOption(this.visibleOptions[newPreSelection]);
144
+ }
145
+ selectOption(newOption) {
146
+ const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.value), label: replaceHighlight(newOption === null || newOption === void 0 ? void 0 : newOption.label) });
147
+ const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value), label: replaceQuotes(newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label) });
148
+ this.changeValue.emit(newOptionsFormatted);
149
+ }
150
+ createOption(detail) {
151
+ let { key, title } = detail;
152
+ const startHighlight = new RegExp(this._startHighlightTag, 'g');
153
+ const endHighlight = new RegExp(this._endHighlightTag, 'g');
154
+ title = StringUtils.decodeHtmlEntities(title);
155
+ const option = {
156
+ value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
157
+ label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
158
+ };
159
+ this.selectOption(option);
160
+ }
161
+ scrollToOption(opt) {
162
+ window.requestAnimationFrame(() => {
163
+ const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
164
+ ? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
165
+ : undefined;
166
+ if (liElem) {
167
+ liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
168
+ }
169
+ });
170
+ }
171
+ buildItem(opt, index) {
172
+ opt.label = opt.label || opt.value;
173
+ const card = {
174
+ key: opt.value,
175
+ title: opt.label,
176
+ details: opt.details
177
+ };
178
+ 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 }));
179
+ }
180
+ render() {
181
+ return (h(Host, null, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
182
+ && this.visibleOptions.length === 0
183
+ && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this.textEmptyList)), this.showLoading
184
+ && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
185
+ }
186
+ };
187
+ SearchList.style = searchListCss;
188
+
189
+ export { EzPopoverPlus as ez_popover_plus, MultiSelectionBoxMessage as multi_selection_box_message, SearchList as search_list };
@@ -31,7 +31,7 @@ const EzPopup = class {
31
31
  if (this.opened && this._popupRef) {
32
32
  this._popupRef.focus();
33
33
  }
34
- new KeyboardManager({ propagate: false, element: this._element })
34
+ new KeyboardManager({ propagate: false, element: this._element, enableShadowDom: true })
35
35
  .bind("Enter", this.ezPopupAction.emit.bind("OK"))
36
36
  .bind("Escape", () => this.closePopup())
37
37
  .bind("Esc", () => this.closePopup());