@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-81596.0 → 0.0.0-bugfix-dev-KB-81596.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 (170) hide show
  1. package/dist/cjs/{DataBinder-e92314c2.js → DataBinder-c2060474.js} +3 -2
  2. package/dist/cjs/FormLayout-c2451c7f.js +7 -0
  3. package/dist/cjs/{constants-2714478b.js → constants-569271bc.js} +4 -0
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -1
  5. package/dist/cjs/ez-card-item_2.cjs.entry.js +3 -1217
  6. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -1
  7. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +3 -2
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -7
  9. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-form-view.cjs.entry.js +18 -10
  12. package/dist/cjs/ez-form.cjs.entry.js +29 -3
  13. package/dist/cjs/ez-grid.cjs.entry.js +165 -28
  14. package/dist/cjs/ez-list.cjs.entry.js +2 -2
  15. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-search-plus.cjs.entry.js +369 -0
  19. package/dist/cjs/ez-search-result-list.cjs.entry.js +98 -0
  20. package/dist/cjs/ez-search.cjs.entry.js +3 -2
  21. package/dist/cjs/ez-split-item.cjs.entry.js +2 -1
  22. package/dist/cjs/ez-text-input.cjs.entry.js +20 -87
  23. package/dist/cjs/ez-tooltip.cjs.entry.js +104 -29
  24. package/dist/cjs/ezui.cjs.js +1 -1
  25. package/dist/cjs/floating-ui.dom.esm-017acce4.js +1404 -0
  26. package/dist/cjs/index-a7b0c73d.js +8 -0
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/{ICustomRender-6fafffce.js → types-6a5df0c7.js} +8 -0
  29. package/dist/collection/collection-manifest.json +12 -0
  30. package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -8
  31. package/dist/collection/components/ez-date-input/ez-date-input.js +1 -1
  32. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +1 -1
  33. package/dist/collection/components/ez-form/ez-form.js +31 -4
  34. package/dist/collection/components/ez-form-view/ez-form-view.css +8 -0
  35. package/dist/collection/components/ez-form-view/ez-form-view.js +21 -2
  36. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +3 -1
  37. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js +6 -0
  38. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +96 -16
  39. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +21 -4
  40. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +31 -7
  41. package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +2 -0
  42. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.js +15 -0
  43. package/dist/collection/components/ez-list/ez-list.js +2 -2
  44. package/dist/collection/components/ez-modal/ez-modal.js +1 -1
  45. package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -1
  46. package/dist/collection/components/ez-popup/ez-popup.js +1 -1
  47. package/dist/collection/components/ez-search-plus/ez-search-plus.css +373 -0
  48. package/dist/collection/components/ez-search-plus/ez-search-plus.js +952 -0
  49. package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css +227 -0
  50. package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js +279 -0
  51. package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
  52. package/dist/collection/components/ez-text-input/ez-text-input.js +39 -60
  53. package/dist/collection/components/ez-tooltip/ez-tooltip.css +52 -12
  54. package/dist/collection/components/ez-tooltip/ez-tooltip.js +217 -46
  55. package/dist/collection/utils/constants.js +2 -0
  56. package/dist/collection/utils/form/DataBinder.js +3 -2
  57. package/dist/collection/utils/form/interfaces/FormLayout.js +5 -0
  58. package/dist/collection/utils/form/interfaces/index.js +1 -1
  59. package/dist/collection/utils/index.js +2 -0
  60. package/dist/collection/utils/search/types.js +7 -0
  61. package/dist/custom-elements/index.d.ts +12 -0
  62. package/dist/custom-elements/index.js +992 -170
  63. package/dist/esm/{DataBinder-9c877244.js → DataBinder-89946126.js} +3 -2
  64. package/dist/esm/FormLayout-54092963.js +7 -0
  65. package/dist/esm/constants-b036528f.js +7 -0
  66. package/dist/esm/ez-actions-button.entry.js +2 -1
  67. package/dist/esm/ez-card-item_2.entry.js +1 -1215
  68. package/dist/esm/ez-collapsible-box.entry.js +2 -1
  69. package/dist/esm/ez-combo-box-list_3.entry.js +2 -1
  70. package/dist/esm/ez-combo-box.entry.js +2 -7
  71. package/dist/esm/ez-date-input.entry.js +1 -1
  72. package/dist/esm/ez-date-time-input.entry.js +1 -1
  73. package/dist/esm/ez-form-view.entry.js +19 -11
  74. package/dist/esm/ez-form.entry.js +30 -4
  75. package/dist/esm/ez-grid.entry.js +164 -27
  76. package/dist/esm/ez-list.entry.js +2 -2
  77. package/dist/esm/ez-modal-container.entry.js +1 -1
  78. package/dist/esm/ez-modal.entry.js +1 -1
  79. package/dist/esm/ez-popup.entry.js +1 -1
  80. package/dist/esm/ez-search-plus.entry.js +365 -0
  81. package/dist/esm/ez-search-result-list.entry.js +94 -0
  82. package/dist/esm/ez-search.entry.js +3 -2
  83. package/dist/esm/ez-split-item.entry.js +2 -1
  84. package/dist/esm/ez-text-input.entry.js +20 -87
  85. package/dist/esm/ez-tooltip.entry.js +105 -30
  86. package/dist/esm/ezui.js +1 -1
  87. package/dist/esm/floating-ui.dom.esm-5d3da819.js +1398 -0
  88. package/dist/esm/index-baa5e267.js +8 -0
  89. package/dist/esm/loader.js +1 -1
  90. package/dist/esm/{ICustomRender-875b5a40.js → types-6f6b2650.js} +9 -1
  91. package/dist/ezui/ezui.esm.js +1 -1
  92. package/dist/ezui/p-0bffeffc.entry.js +1 -0
  93. package/dist/ezui/p-173f68ea.js +1 -0
  94. package/dist/ezui/p-1a060042.entry.js +1 -0
  95. package/dist/ezui/{p-cb5cd243.entry.js → p-1ec8bdd2.entry.js} +46 -46
  96. package/dist/ezui/p-248d4f54.entry.js +1 -0
  97. package/dist/ezui/p-3176a6ef.entry.js +1 -0
  98. package/dist/ezui/p-4e0628a7.entry.js +1 -0
  99. package/dist/ezui/p-5895e687.js +1 -0
  100. package/dist/ezui/p-5a14f506.entry.js +1 -0
  101. package/dist/ezui/p-5ec0ae79.entry.js +1 -0
  102. package/dist/ezui/p-5eea9886.js +1 -0
  103. package/dist/ezui/p-81145609.entry.js +1 -0
  104. package/dist/ezui/p-84b1c99e.entry.js +1 -0
  105. package/dist/ezui/p-8ac8093c.entry.js +1 -0
  106. package/dist/ezui/p-9142b27a.entry.js +1 -0
  107. package/dist/ezui/p-9567b31a.entry.js +1 -0
  108. package/dist/ezui/p-9f22e1dc.entry.js +1 -0
  109. package/dist/ezui/{p-acddfb2e.js → p-a64cfcfc.js} +1 -1
  110. package/dist/ezui/p-bf9dec89.entry.js +1 -0
  111. package/dist/ezui/p-c5df78be.entry.js +1 -0
  112. package/dist/ezui/p-cd07f8be.entry.js +1 -0
  113. package/dist/ezui/p-e07e4671.js +1 -0
  114. package/dist/ezui/p-e3544d23.entry.js +1 -0
  115. package/dist/ezui/p-ecaac11f.entry.js +1 -0
  116. package/dist/ezui/p-f4861c6a.entry.js +1 -0
  117. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +0 -2
  118. package/dist/types/components/ez-form/ez-form.d.ts +5 -1
  119. package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
  120. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.d.ts +2 -0
  121. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
  122. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -2
  123. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
  124. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -0
  125. package/dist/types/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.d.ts +3 -0
  126. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +184 -0
  127. package/dist/types/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.d.ts +26 -0
  128. package/dist/types/components/ez-text-input/ez-text-input.d.ts +6 -9
  129. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +37 -5
  130. package/dist/types/components.d.ts +338 -12
  131. package/dist/types/utils/constants.d.ts +2 -0
  132. package/dist/types/utils/form/interfaces/FormLayout.d.ts +4 -0
  133. package/dist/types/utils/form/interfaces/index.d.ts +1 -0
  134. package/dist/types/utils/index.d.ts +2 -0
  135. package/dist/types/utils/search/types.d.ts +12 -0
  136. package/package.json +3 -3
  137. package/react/components.d.ts +62 -60
  138. package/react/components.js +2 -0
  139. package/react/components.js.map +1 -1
  140. package/react/react-component-lib/createComponent.d.ts +1 -1
  141. package/react/react-component-lib/createComponent.js.map +1 -1
  142. package/react/react-component-lib/createOverlayComponent.js.map +1 -1
  143. package/react/react-component-lib/interfaces.js +1 -0
  144. package/react/react-component-lib/utils/attachProps.d.ts +1 -1
  145. package/react/react-component-lib/utils/attachProps.js.map +1 -1
  146. package/react/react-component-lib/utils/dev.js.map +1 -1
  147. package/react/react-component-lib/utils/index.d.ts +2 -2
  148. package/react/react-component-lib/utils/index.js.map +1 -1
  149. package/dist/collection/utils/ResponsiveInputUtils.js +0 -26
  150. package/dist/esm/constants-4e0d35b7.js +0 -5
  151. package/dist/ezui/p-05e1f4e7.js +0 -1
  152. package/dist/ezui/p-17eabf46.entry.js +0 -1
  153. package/dist/ezui/p-1ad6c61b.entry.js +0 -1
  154. package/dist/ezui/p-20cb13fa.entry.js +0 -1
  155. package/dist/ezui/p-23b6128c.entry.js +0 -1
  156. package/dist/ezui/p-3195a7a7.entry.js +0 -1
  157. package/dist/ezui/p-4607fb89.js +0 -1
  158. package/dist/ezui/p-556468d9.entry.js +0 -1
  159. package/dist/ezui/p-6cdd3e0a.entry.js +0 -1
  160. package/dist/ezui/p-788467fe.entry.js +0 -1
  161. package/dist/ezui/p-af1a478e.entry.js +0 -1
  162. package/dist/ezui/p-bbdc3996.entry.js +0 -1
  163. package/dist/ezui/p-c297aa52.entry.js +0 -1
  164. package/dist/ezui/p-cb1535f7.entry.js +0 -1
  165. package/dist/ezui/p-cf87aacb.entry.js +0 -1
  166. package/dist/ezui/p-dcf3c8e5.entry.js +0 -1
  167. package/dist/ezui/p-e347df9c.entry.js +0 -1
  168. package/dist/ezui/p-f5931caa.entry.js +0 -1
  169. package/dist/ezui/p-fd0a19d6.entry.js +0 -1
  170. package/dist/types/utils/ResponsiveInputUtils.d.ts +0 -6
@@ -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());
@@ -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());
@@ -0,0 +1,365 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
+ import { StringUtils, KeyboardManager, ElementIDUtils } from '@sankhyalabs/core';
3
+ import './ApplicationUtils-eaf91331.js';
4
+ import { C as CSSVarsUtils } from './CSSVarsUtils-acba92d7.js';
5
+ import './DialogType-54a62731.js';
6
+ import './CheckMode-bdb2ec19.js';
7
+ import { S as SearchMode } from './types-6f6b2650.js';
8
+ import './FormLayout-54092963.js';
9
+
10
+ const ezSearchPlusCss = ":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);overflow:auto;position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:350px;min-width:150px;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.list-options{margin-top:0px;box-sizing:border-box;width:100%;height:100%;padding:0;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)}.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)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor: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}@-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}}.ez-search-plus__container{display:flex;flex-grow:1;gap:3px}.ez-search-plus__text-input{--ez-text-input--border-top-left-radius:0px;--ez-text-input--border-bottom-left-radius:0px}.ez-search-plus__code-input-no-border{--ez-text-input--border-top-right-radius:0px;--ez-text-input--border-bottom-right-radius:0px}.ez-search-plus__code-input{width:107px}.ez-search-plus__code-input-full{width:100%}.description-input-container{width:100%}";
11
+
12
+ const EzSearchPlus = class {
13
+ constructor(hostRef) {
14
+ registerInstance(this, hostRef);
15
+ this.ezChange = createEvent(this, "ezChange", 7);
16
+ this.SEARCH_DESCRIPTION_TIMEOUT = 300;
17
+ this.INTERVAL_TO_RETRY_ASYNC_VALUE = 100;
18
+ this.value = undefined;
19
+ this.enabled = true;
20
+ this.disableCodeInput = false;
21
+ this.disableDescriptionInput = false;
22
+ this.label = undefined;
23
+ this.codLabel = undefined;
24
+ this.hideDescriptionInput = false;
25
+ this.canShowError = true;
26
+ this.errorMessage = undefined;
27
+ this.mode = "regular";
28
+ this.contextProperties = undefined;
29
+ this.optionLoader = undefined;
30
+ this.showOptionValue = true;
31
+ this.stopPropagateEnterKeyEvent = false;
32
+ this.autoFocus = false;
33
+ this.showSelectedValue = true;
34
+ this.suppressEmptyOption = false;
35
+ this.hideErrorOnFocusOut = true;
36
+ this.listOptionsPosition = undefined;
37
+ this.isTextSearch = false;
38
+ this.ignoreLimitCharsToSearch = false;
39
+ this.suppressSearch = false;
40
+ this.suppressPreLoad = true;
41
+ this.ensureClearButtonVisible = false;
42
+ this.descriptionValue = "";
43
+ this.codeValue = "";
44
+ this.isLoadingDescription = false;
45
+ this.searchDescriptionIsOpen = false;
46
+ this.visibleOptions = undefined;
47
+ this.showLoading = true;
48
+ }
49
+ async observeValue(newValue, oldValue) {
50
+ const newNormalizedValue = this.normalizeValueToCodeValue(newValue);
51
+ const oldNormalizedValue = this.normalizeValueToCodeValue(oldValue);
52
+ if (newNormalizedValue == oldNormalizedValue)
53
+ return;
54
+ if (newNormalizedValue == undefined) {
55
+ this.codeValue = undefined;
56
+ this.descriptionValue = undefined;
57
+ this.ezChange.emit(undefined);
58
+ return;
59
+ }
60
+ this.codeValue = newNormalizedValue;
61
+ try {
62
+ this.descriptionValue = await this.normalizeCodeToDescriptionValue(newValue);
63
+ }
64
+ catch (err) {
65
+ this.value = undefined;
66
+ console.warn("[EzSearchPlus] Erro ao obter descrição do registro.", err);
67
+ throw err;
68
+ }
69
+ this.ezChange.emit(this.buildCurrentValue());
70
+ }
71
+ canShowLoadSpinDescription() {
72
+ return this.isLoadingDescription;
73
+ }
74
+ /**
75
+ * Aplica o foco no campo.
76
+ */
77
+ async setFocus(options) {
78
+ var _a;
79
+ if (this.disableCodeInput) {
80
+ (_a = this._textInputDescriptionValue) === null || _a === void 0 ? void 0 : _a.setFocus(options);
81
+ return;
82
+ }
83
+ if (this._latestFocusedInputElement) {
84
+ this._latestFocusedInputElement.setFocus(options);
85
+ return;
86
+ }
87
+ this._textInputCodeValue.setFocus(options);
88
+ }
89
+ /**
90
+ * Obtém o valor do componente só após a compo de apresentação
91
+ * ter sido resolvido pelo option loader quando necessário
92
+ */
93
+ async getValueAsync() {
94
+ if (!this.isLoadingDescription) {
95
+ const currentOpt = this.buildCurrentValue();
96
+ return new Promise(resolve => resolve(currentOpt));
97
+ }
98
+ return new Promise(resolve => {
99
+ let id = setInterval(() => {
100
+ if (!this.isLoadingDescription) {
101
+ clearInterval(id);
102
+ const currentOpt = this.buildCurrentValue();
103
+ resolve(currentOpt);
104
+ }
105
+ }, this.INTERVAL_TO_RETRY_ASYNC_VALUE);
106
+ });
107
+ }
108
+ /**
109
+ * Limpa o valor do campo de pesquisa
110
+ */
111
+ async clearValue() {
112
+ this.clearSearch();
113
+ }
114
+ /**
115
+ * Remove o foco do campo.
116
+ */
117
+ async setBlur() {
118
+ var _a, _b;
119
+ (_a = this._textInputCodeValue) === null || _a === void 0 ? void 0 : _a.setBlur();
120
+ (_b = this._textInputDescriptionValue) === null || _b === void 0 ? void 0 : _b.setBlur();
121
+ }
122
+ /**
123
+ * Retorna se o conteúdo é inválido.
124
+ */
125
+ async isInvalid() {
126
+ return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
127
+ }
128
+ componentWillLoad() {
129
+ if (this.value && StringUtils.isEmpty(this.codeValue)) {
130
+ this.observeValue(this.value, undefined);
131
+ }
132
+ }
133
+ componentDidLoad() {
134
+ CSSVarsUtils.applyVarsTextInput(this.el, this._textInputCodeValue);
135
+ CSSVarsUtils.applyVarsTextInput(this.el, this._textInputDescriptionValue);
136
+ this.initKeyboardManager();
137
+ if (this.autoFocus) {
138
+ requestAnimationFrame(() => {
139
+ this.setFocus({ selectText: true });
140
+ });
141
+ }
142
+ }
143
+ clearSearch() {
144
+ this.value = null;
145
+ }
146
+ getCodLabel() {
147
+ var _a;
148
+ if (this.hideDescriptionInput) {
149
+ return this.label;
150
+ }
151
+ return (_a = this.codLabel) !== null && _a !== void 0 ? _a : "Cód.";
152
+ }
153
+ async normalizeCodeToDescriptionValue(valueToNormalize) {
154
+ if (!valueToNormalize) {
155
+ return "";
156
+ }
157
+ if (typeof valueToNormalize == 'string') {
158
+ try {
159
+ valueToNormalize = JSON.parse(valueToNormalize);
160
+ if ((valueToNormalize === null || valueToNormalize === void 0 ? void 0 : valueToNormalize.value) && !(valueToNormalize === null || valueToNormalize === void 0 ? void 0 : valueToNormalize.label)) {
161
+ return await this.loadDescriptionValueByCode(valueToNormalize === null || valueToNormalize === void 0 ? void 0 : valueToNormalize.value);
162
+ }
163
+ }
164
+ catch (e) {
165
+ return await this.loadDescriptionValueByCode(valueToNormalize);
166
+ }
167
+ }
168
+ //Se é diferente de objeto, temos que resolver a descrição
169
+ if (typeof valueToNormalize != 'object') {
170
+ return await this.loadDescriptionValueByCode(valueToNormalize);
171
+ }
172
+ return valueToNormalize === null || valueToNormalize === void 0 ? void 0 : valueToNormalize.label;
173
+ }
174
+ normalizeValueToCodeValue(valueToNormalize) {
175
+ if (!valueToNormalize) {
176
+ return undefined;
177
+ }
178
+ if (typeof valueToNormalize == 'string') {
179
+ try {
180
+ valueToNormalize = JSON.parse(valueToNormalize);
181
+ }
182
+ catch (e) {
183
+ return valueToNormalize;
184
+ }
185
+ }
186
+ if (typeof valueToNormalize != 'object') {
187
+ return valueToNormalize;
188
+ }
189
+ return valueToNormalize === null || valueToNormalize === void 0 ? void 0 : valueToNormalize.value;
190
+ }
191
+ async loadDescriptionValueByCode(codeValue) {
192
+ if (!this.optionLoader) {
193
+ console.warn("optionLoader não definido");
194
+ return "";
195
+ }
196
+ try {
197
+ this.isLoadingDescription = true;
198
+ const searchArgument = { mode: SearchMode.LOAD_DESCRIPTION, argument: codeValue };
199
+ const loadedOption = await this.optionLoader(searchArgument);
200
+ if (!loadedOption) {
201
+ return "";
202
+ }
203
+ return loadedOption.label;
204
+ }
205
+ finally {
206
+ this.isLoadingDescription = false;
207
+ }
208
+ }
209
+ handleCodeInputFocusOut() {
210
+ this.cancelSelection();
211
+ if (this.codeValue == this._textInputCodeValue.value)
212
+ return;
213
+ this.value = this._textInputCodeValue.value;
214
+ }
215
+ handleSearchClick() {
216
+ this.loadAdvancedSearch();
217
+ }
218
+ async loadAdvancedSearch() {
219
+ if (!this.optionLoader) {
220
+ console.warn("optionLoader não definido");
221
+ return;
222
+ }
223
+ const searchArgument = { mode: SearchMode.ADVANCED, argument: "" };
224
+ let selectedItem = undefined;
225
+ try {
226
+ selectedItem = await this.optionLoader(searchArgument, this.contextProperties);
227
+ }
228
+ catch (ignore) { }
229
+ if (!selectedItem)
230
+ return;
231
+ this.value = selectedItem;
232
+ }
233
+ buildCurrentValue() {
234
+ if (StringUtils.isEmpty(this.codeValue)) {
235
+ return undefined;
236
+ }
237
+ return {
238
+ value: this.codeValue,
239
+ label: this.descriptionValue
240
+ };
241
+ }
242
+ async handleTextInputChangeHandler(event) {
243
+ if (!this.searchDescriptionIsOpen) {
244
+ this._popover.show();
245
+ }
246
+ const argument = event.target.value;
247
+ await this.debounceLoaderOptions(argument);
248
+ }
249
+ async debounceLoaderOptions(argument) {
250
+ if (this._debounceSearch)
251
+ clearTimeout(this._debounceSearch);
252
+ return new Promise((resolve) => {
253
+ this._debounceSearch = setTimeout(async () => {
254
+ await this.processOptionsLoader(argument);
255
+ resolve();
256
+ }, this.SEARCH_DESCRIPTION_TIMEOUT);
257
+ });
258
+ }
259
+ async processOptionsLoader(argument) {
260
+ try {
261
+ this.showLoading = true;
262
+ const searchArgument = { mode: SearchMode.PREDICTIVE, argument };
263
+ this.visibleOptions = await this.optionLoader(searchArgument);
264
+ }
265
+ finally {
266
+ this.showLoading = false;
267
+ }
268
+ }
269
+ handleSelectItem(evt) {
270
+ const currentOpt = evt.detail;
271
+ this.value = currentOpt;
272
+ this._popover.hide();
273
+ window.requestAnimationFrame(() => {
274
+ var _a;
275
+ (_a = this._textInputDescriptionValue) === null || _a === void 0 ? void 0 : _a.setFocus({ selectText: true });
276
+ });
277
+ }
278
+ async handleArrowUp() {
279
+ if (!this.isOptionsVisible()) {
280
+ return;
281
+ }
282
+ await this._searchList.previousOption();
283
+ }
284
+ async handleArrowDown() {
285
+ if (!this.isOptionsVisible()) {
286
+ return;
287
+ }
288
+ await this._searchList.nextOption();
289
+ }
290
+ async selectCurrentItem() {
291
+ var _a;
292
+ await ((_a = this._searchList) === null || _a === void 0 ? void 0 : _a.selectCurrentItem());
293
+ }
294
+ async cancelSelection() {
295
+ var _a, _b, _c, _d;
296
+ if (this._textInputDescriptionValue && this._textInputDescriptionValue.value != ((_a = this.value) === null || _a === void 0 ? void 0 : _a.label)) {
297
+ this._textInputDescriptionValue.value = (_b = this.value) === null || _b === void 0 ? void 0 : _b.label;
298
+ }
299
+ await ((_c = this._searchList) === null || _c === void 0 ? void 0 : _c.cancelSelection());
300
+ (_d = this._popover) === null || _d === void 0 ? void 0 : _d.hide();
301
+ }
302
+ async handleInputTab() {
303
+ await this.cancelSelection();
304
+ }
305
+ async handleInputEsc() {
306
+ var _a;
307
+ await this.cancelSelection();
308
+ await ((_a = this._latestFocusedInputElement) === null || _a === void 0 ? void 0 : _a.setFocus({ selectText: true }));
309
+ }
310
+ async initKeyboardManager() {
311
+ this._keyboardManager = new KeyboardManager();
312
+ const opts = { element: this.el, propagate: true };
313
+ this._keyboardManager
314
+ .bind("ArrowUp", () => this.handleArrowUp(), opts)
315
+ .bind("ArrowDown", () => this.handleArrowDown(), opts)
316
+ .bind("Enter", () => this.selectCurrentItem(), opts)
317
+ .bind("Tab", () => this.handleInputTab(), opts)
318
+ .bind("Escape", () => this.handleInputEsc(), opts);
319
+ }
320
+ disconnectedCallback() {
321
+ this._keyboardManager
322
+ .unbind("ArrowUp")
323
+ .unbind("ArrowDown")
324
+ .unbind("Enter")
325
+ .unbind("Tab")
326
+ .unbind("Escape");
327
+ }
328
+ isOptionsVisible() {
329
+ return this._popover.opened;
330
+ }
331
+ setLatestFocusedInputElement(el) {
332
+ this._latestFocusedInputElement = el;
333
+ }
334
+ handleCodeInputFocus() {
335
+ this.setLatestFocusedInputElement(this._textInputCodeValue);
336
+ }
337
+ handleDescriptionInputFocus() {
338
+ this.setLatestFocusedInputElement(this._textInputDescriptionValue);
339
+ }
340
+ getRightIconElement() {
341
+ var _a, _b;
342
+ if (!this.ensureClearButtonVisible && (!this.value && !((_a = this._textInputCodeValue) === null || _a === void 0 ? void 0 : _a.value) && !((_b = this._textInputDescriptionValue) === null || _b === void 0 ? void 0 : _b.value))) {
343
+ return null;
344
+ }
345
+ return h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }));
346
+ }
347
+ getLeftIconElement() {
348
+ return h("button", { class: "btn", slot: "leftIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handleSearchClick() }, this.canShowLoadSpinDescription() ? h("div", { class: "message__loading" }) : h("ez-icon", { iconName: "search" }));
349
+ }
350
+ render() {
351
+ ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
352
+ return (h(Host, null, h("div", { class: "ez-search-plus__container" }, h("ez-text-input", { ref: elem => this._textInputCodeValue = elem, class: {
353
+ "ez-search-plus__code-input": true,
354
+ "ez-search-plus__code-input-no-border": !this.hideDescriptionInput,
355
+ "ez-search-plus__code-input-full": this.hideDescriptionInput
356
+ }, "data-element-id": ElementIDUtils.getInternalIDInfo("codeInput"), "data-slave-mode": "true", enabled: !this.disableCodeInput && this.enabled, mode: this.mode, label: this.getCodLabel(), hasInvalid: !StringUtils.isEmpty(this.errorMessage), errorMessage: this.hideDescriptionInput ? this.errorMessage : "", value: this.codeValue, onFocusout: () => this.handleCodeInputFocusOut(), onFocus: () => this.handleCodeInputFocus() }, this.getLeftIconElement()), !this.hideDescriptionInput && h("div", { class: "description-input-container" }, h("ez-text-input", { ref: elem => this._textInputDescriptionValue = elem, tabIndex: -1, class: "ez-search-plus__text-input", "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), "data-slave-mode": "true", enabled: !this.disableDescriptionInput && this.enabled, label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode, value: this.descriptionValue, onInput: event => this.handleTextInputChangeHandler(event), onFocus: () => this.handleDescriptionInputFocus() }, this.getRightIconElement()), h("ez-popover-plus", { ref: elem => this._popover = elem, anchorElement: this._textInputDescriptionValue, autoClose: true, boxWidth: 'fit-content', overlayType: 'none', useAnchorSize: true, onEzVisibilityChange: event => this.searchDescriptionIsOpen = event.detail }, h("ez-search-result-list", { ref: (ref) => this._searchList = ref, showLoading: this.showLoading, visibleOptions: this.visibleOptions, value: this.value, showOptionValue: this.showOptionValue, onChangeValue: (evt) => this.handleSelectItem(evt) }))))));
357
+ }
358
+ get el() { return getElement(this); }
359
+ static get watchers() { return {
360
+ "value": ["observeValue"]
361
+ }; }
362
+ };
363
+ EzSearchPlus.style = ezSearchPlusCss;
364
+
365
+ export { EzSearchPlus as ez_search_plus };
@@ -0,0 +1,94 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
2
+ import { StringUtils } from '@sankhyalabs/core';
3
+
4
+ const ezSearchResultListCss = ":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}}";
5
+
6
+ const EzSearchResultList = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.changeValue = createEvent(this, "changeValue", 7);
10
+ this._textEmptyList = "Nenhum resultado encontrado";
11
+ this._startHighlightTag = "<span class='card-item__highlight'>";
12
+ this._endHighlightTag = "</span>";
13
+ this.showLoading = undefined;
14
+ this.visibleOptions = [];
15
+ this.value = undefined;
16
+ this.showOptionValue = true;
17
+ this._preSelection = undefined;
18
+ }
19
+ async nextOption() {
20
+ const newPreSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this.visibleOptions.length - 1);
21
+ this.preSelectItemByIndex(newPreSelection);
22
+ }
23
+ async previousOption() {
24
+ const newPreSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
25
+ this.preSelectItemByIndex(newPreSelection);
26
+ }
27
+ preSelectItemByIndex(newIndex) {
28
+ this._preSelection = newIndex;
29
+ const option = this.visibleOptions[newIndex];
30
+ this.scrollToOption(option);
31
+ }
32
+ selectOption(newOption) {
33
+ const newOptionsReplaced = Object.assign(Object.assign({}, newOption), { value: newOption === null || newOption === void 0 ? void 0 : newOption.value, label: newOption === null || newOption === void 0 ? void 0 : newOption.label });
34
+ const newOptionsFormatted = Object.assign(Object.assign({}, newOptionsReplaced), { value: newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.value, label: newOptionsReplaced === null || newOptionsReplaced === void 0 ? void 0 : newOptionsReplaced.label });
35
+ this.changeValue.emit(newOptionsFormatted);
36
+ }
37
+ createAndSelectOption(detail) {
38
+ let { key, title } = detail;
39
+ key = String(key !== null && key !== void 0 ? key : "");
40
+ const startHighlight = new RegExp(this._startHighlightTag, 'g');
41
+ const endHighlight = new RegExp(this._endHighlightTag, 'g');
42
+ title = StringUtils.decodeHtmlEntities(title);
43
+ const option = {
44
+ value: key === null || key === void 0 ? void 0 : key.replace(startHighlight, '').replace(endHighlight, ''),
45
+ label: title === null || title === void 0 ? void 0 : title.replace(startHighlight, '').replace(endHighlight, '')
46
+ };
47
+ this.selectOption(option);
48
+ }
49
+ scrollToOption(opt) {
50
+ if (!(opt === null || opt === void 0 ? void 0 : opt.value) || !this._optionsList)
51
+ return;
52
+ window.requestAnimationFrame(() => {
53
+ var _a;
54
+ const currentValue = String((_a = opt === null || opt === void 0 ? void 0 : opt.value) !== null && _a !== void 0 ? _a : "");
55
+ const liElem = currentValue
56
+ ? this._optionsList.querySelector(`div#item_${currentValue.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
57
+ : undefined;
58
+ if (liElem) {
59
+ liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
60
+ }
61
+ });
62
+ }
63
+ buildItem(opt, index) {
64
+ var _a;
65
+ opt.label = opt.label || opt.value;
66
+ const card = {
67
+ key: String((_a = opt.presentationValue) !== null && _a !== void 0 ? _a : ""),
68
+ title: opt.presentationLabel,
69
+ details: opt.details
70
+ };
71
+ return h("div", { style: { "height": "100%" }, class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.createAndSelectOption(card), onMouseOver: () => { this._preSelection = index; } }, h("ez-card-item", { item: card, compacted: true, enableKey: this.showOptionValue }));
72
+ }
73
+ async selectCurrentItem() {
74
+ this.selectOption(this.visibleOptions[this._preSelection]);
75
+ }
76
+ async cancelSelection() {
77
+ this.cancelPreselection();
78
+ }
79
+ cancelPreselection() {
80
+ this._preSelection = undefined;
81
+ }
82
+ canShowListOptions() {
83
+ return !this.showLoading && this.visibleOptions.length > 0;
84
+ }
85
+ render() {
86
+ return (h(Host, null, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this.showLoading
87
+ && this.visibleOptions.length === 0
88
+ && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this.showLoading
89
+ && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.canShowListOptions() && this.visibleOptions.map((opt, index) => this.buildItem(opt, index)))));
90
+ }
91
+ };
92
+ EzSearchResultList.style = ezSearchResultListCss;
93
+
94
+ export { EzSearchResultList as ez_search_result_list };
@@ -4,8 +4,9 @@ import { ObjectUtils, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
4
4
  import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
- import './ICustomRender-875b5a40.js';
8
- import { R as REQUIRED_INFO } from './constants-4e0d35b7.js';
7
+ import './types-6f6b2650.js';
8
+ import './FormLayout-54092963.js';
9
+ import { R as REQUIRED_INFO } from './constants-b036528f.js';
9
10
  import { r as replaceQuotes, a as replaceHighlight } from './searchFormatters-8229207e.js';
10
11
 
11
12
  const ezSearchCss = ":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search--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}";
@@ -4,7 +4,8 @@ import { C as CSSVarsUtils } from './CSSVarsUtils-acba92d7.js';
4
4
  import './DialogType-54a62731.js';
5
5
  import './CheckMode-bdb2ec19.js';
6
6
  import '@sankhyalabs/core';
7
- import './ICustomRender-875b5a40.js';
7
+ import './types-6f6b2650.js';
8
+ import './FormLayout-54092963.js';
8
9
 
9
10
  const ezSplitItemCss = ".box_split-item{background-color:var(--background--xlight);width:100%;height:100%;border-radius:var(--border--radius-medium);box-shadow:var(--shadow--xsmall);flex-direction:column;overflow:hidden;display:flex;padding:var(--space--nano)}.box_split-item>.ez-split-item--content{overflow:auto}.expanded__item{position:absolute;z-index:var(--more-visible);top:0;left:0;width:100%;height:100%}.ez-split-item--header{display:flex;align-items:center;justify-content:space-between}.ez-split-item--header-title{flex:1;white-space:nowrap;overflow:hidden}.ez-split-item--header-title h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.ez-split-item--header-buttons{display:flex;align-items:center;max-height:20px}.ez-split-item--content{display:block;height:100%}h3.ez-margin--small{margin-left:var(--space--small)}.structural__item{background:none;box-shadow:none;padding:0;margin:0;border:0}.content__item{margin:var(--space--extra-small);width:calc(100% - 2*(var(--space--extra-small)));height:calc(100% - 2*(var(--space--extra-small)))}";
10
11