@sankhyalabs/ezui 7.2.0-dev.7 → 7.2.0-dev.8

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 (171) hide show
  1. package/dist/cjs/{ApplicationUtils-dc653b57.js → ApplicationUtils-50f74c38.js} +1 -1
  2. package/dist/cjs/{app-globals-16ec1ff7.js → app-globals-18e8b9df.js} +1 -1
  3. package/dist/cjs/classic-search-list_7.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  5. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-classic-date-input.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-classic-number-input.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-classic-search-plus.cjs.entry.js +25 -12
  12. package/dist/cjs/ez-classic-search.cjs.entry.js +2 -2
  13. package/dist/cjs/ez-classic-time-input.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  15. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
  16. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  23. package/dist/cjs/ez-grid-pagination.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-grid.cjs.entry.js +3 -3
  25. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-record-navigation.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-search-plus.cjs.entry.js +11 -2
  37. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-search.cjs.entry.js +2 -2
  39. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  42. package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  45. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  48. package/dist/cjs/ezui.cjs.js +3 -3
  49. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  50. package/dist/cjs/{index-a8537087.js → index-8faf8416.js} +3 -0
  51. package/dist/cjs/loader.cjs.js +3 -3
  52. package/dist/cjs/{search-column-cd0e44be.js → search-column-1c884d08.js} +2 -2
  53. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js +26 -11
  54. package/dist/collection/components/ez-search-plus/ez-search-plus.js +9 -0
  55. package/dist/collection/utils/i18n/locales/en-us.js +1 -0
  56. package/dist/collection/utils/i18n/locales/es-es.js +1 -0
  57. package/dist/collection/utils/i18n/locales/pt-br.js +1 -0
  58. package/dist/custom-elements/index.js +36 -11
  59. package/dist/esm/{ApplicationUtils-e99e53c8.js → ApplicationUtils-7eb5d339.js} +1 -1
  60. package/dist/esm/{app-globals-6e27b3bb.js → app-globals-94e67ab2.js} +1 -1
  61. package/dist/esm/classic-search-list_7.entry.js +2 -2
  62. package/dist/esm/ez-actions-button.entry.js +2 -2
  63. package/dist/esm/ez-alert-list.entry.js +1 -1
  64. package/dist/esm/ez-avatar.entry.js +1 -1
  65. package/dist/esm/ez-calendar.entry.js +1 -1
  66. package/dist/esm/ez-classic-date-input.entry.js +1 -1
  67. package/dist/esm/ez-classic-date-time-input.entry.js +1 -1
  68. package/dist/esm/ez-classic-number-input.entry.js +1 -1
  69. package/dist/esm/ez-classic-search-plus.entry.js +25 -12
  70. package/dist/esm/ez-classic-search.entry.js +2 -2
  71. package/dist/esm/ez-classic-time-input.entry.js +1 -1
  72. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  73. package/dist/esm/ez-combo-box.entry.js +2 -2
  74. package/dist/esm/ez-date-input.entry.js +1 -1
  75. package/dist/esm/ez-date-time-input.entry.js +1 -1
  76. package/dist/esm/ez-dialog.entry.js +1 -1
  77. package/dist/esm/ez-double-list.entry.js +1 -1
  78. package/dist/esm/ez-file-item.entry.js +1 -1
  79. package/dist/esm/ez-form-view.entry.js +1 -1
  80. package/dist/esm/ez-form.entry.js +3 -3
  81. package/dist/esm/ez-grid-pagination.entry.js +1 -1
  82. package/dist/esm/ez-grid.entry.js +3 -3
  83. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  84. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  85. package/dist/esm/ez-list.entry.js +1 -1
  86. package/dist/esm/ez-modal-container.entry.js +1 -1
  87. package/dist/esm/ez-modal.entry.js +1 -1
  88. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  89. package/dist/esm/ez-number-input.entry.js +1 -1
  90. package/dist/esm/ez-pagination.entry.js +1 -1
  91. package/dist/esm/ez-popup.entry.js +1 -1
  92. package/dist/esm/ez-record-navigation.entry.js +1 -1
  93. package/dist/esm/ez-scroller_2.entry.js +1 -1
  94. package/dist/esm/ez-search-plus.entry.js +11 -2
  95. package/dist/esm/ez-search-result-list.entry.js +1 -1
  96. package/dist/esm/ez-search.entry.js +2 -2
  97. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  98. package/dist/esm/ez-skeleton.entry.js +1 -1
  99. package/dist/esm/ez-sortable-list.entry.js +1 -1
  100. package/dist/esm/ez-spinner.entry.js +1 -1
  101. package/dist/esm/ez-split-button.entry.js +1 -1
  102. package/dist/esm/ez-split-item.entry.js +2 -2
  103. package/dist/esm/ez-time-input.entry.js +1 -1
  104. package/dist/esm/ez-tree.entry.js +1 -1
  105. package/dist/esm/ez-upload.entry.js +2 -2
  106. package/dist/esm/ezui.js +3 -3
  107. package/dist/esm/filter-column.entry.js +1 -1
  108. package/dist/esm/{index-a031816b.js → index-4dc8ed82.js} +3 -0
  109. package/dist/esm/loader.js +3 -3
  110. package/dist/esm/{search-column-33d72c20.js → search-column-e79eb0f3.js} +2 -2
  111. package/dist/ezui/ezui.esm.js +1 -1
  112. package/dist/ezui/{p-318d4dc9.entry.js → p-00162042.entry.js} +1 -1
  113. package/dist/ezui/{p-91ff4511.entry.js → p-0298252e.entry.js} +1 -1
  114. package/dist/ezui/{p-510eccc7.entry.js → p-05ee4e45.entry.js} +1 -1
  115. package/dist/ezui/{p-8980b477.entry.js → p-159f4beb.entry.js} +1 -1
  116. package/dist/ezui/{p-b5f45319.entry.js → p-19a60062.entry.js} +1 -1
  117. package/dist/ezui/{p-4991931a.entry.js → p-1b01db47.entry.js} +1 -1
  118. package/dist/ezui/{p-caf3cd8f.entry.js → p-1ec7f65c.entry.js} +1 -1
  119. package/dist/ezui/{p-8a5efec5.entry.js → p-1f1ba5b9.entry.js} +1 -1
  120. package/dist/ezui/{p-ea0f78d1.entry.js → p-2490ff37.entry.js} +1 -1
  121. package/dist/ezui/{p-a4911d89.entry.js → p-28658422.entry.js} +1 -1
  122. package/dist/ezui/{p-0fc981e9.entry.js → p-2a1c1daf.entry.js} +1 -1
  123. package/dist/ezui/{p-2e07f3d5.entry.js → p-361a4bfa.entry.js} +1 -1
  124. package/dist/ezui/{p-879cee4d.entry.js → p-373a7b4e.entry.js} +1 -1
  125. package/dist/ezui/{p-3311e7ef.entry.js → p-377125c7.entry.js} +1 -1
  126. package/dist/ezui/{p-4f76dc28.entry.js → p-39e1c05d.entry.js} +1 -1
  127. package/dist/ezui/{p-473a397f.entry.js → p-3a167b3f.entry.js} +1 -1
  128. package/dist/ezui/{p-24582dd6.js → p-46b0b0c7.js} +1 -1
  129. package/dist/ezui/{p-1244fac0.entry.js → p-4cf0ed43.entry.js} +1 -1
  130. package/dist/ezui/{p-ab41edab.entry.js → p-4dca017c.entry.js} +1 -1
  131. package/dist/ezui/p-517498c1.js +1 -0
  132. package/dist/ezui/{p-54975948.entry.js → p-57bf1a88.entry.js} +1 -1
  133. package/dist/ezui/{p-4ca4e8d1.entry.js → p-61e11a7a.entry.js} +1 -1
  134. package/dist/ezui/{p-3d772561.entry.js → p-6fde1c11.entry.js} +1 -1
  135. package/dist/ezui/{p-c8584e28.entry.js → p-714f2b21.entry.js} +1 -1
  136. package/dist/ezui/{p-700af412.entry.js → p-77f112e0.entry.js} +1 -1
  137. package/dist/ezui/{p-c33d46e0.entry.js → p-78c8a5e7.entry.js} +1 -1
  138. package/dist/ezui/{p-ab4da973.entry.js → p-78d2b5a5.entry.js} +1 -1
  139. package/dist/ezui/{p-93097edc.entry.js → p-854fa107.entry.js} +1 -1
  140. package/dist/ezui/{p-1ab5ba19.entry.js → p-8c0ad73d.entry.js} +1 -1
  141. package/dist/ezui/{p-2887cbf9.entry.js → p-96120941.entry.js} +1 -1
  142. package/dist/ezui/{p-d98dd01a.entry.js → p-9883faa0.entry.js} +1 -1
  143. package/dist/ezui/{p-f1390be9.entry.js → p-9f58cc27.entry.js} +1 -1
  144. package/dist/ezui/{p-0bc16f75.entry.js → p-b39b7880.entry.js} +1 -1
  145. package/dist/ezui/{p-69344c23.js → p-b6579f86.js} +1 -1
  146. package/dist/ezui/{p-a8f807ed.entry.js → p-b72322ad.entry.js} +1 -1
  147. package/dist/ezui/{p-adee66db.entry.js → p-b8a83790.entry.js} +1 -1
  148. package/dist/ezui/{p-32b8f057.entry.js → p-bce082cf.entry.js} +1 -1
  149. package/dist/ezui/{p-2b65728f.entry.js → p-c626a0e4.entry.js} +1 -1
  150. package/dist/ezui/{p-ed6b6e0f.entry.js → p-d5c2d721.entry.js} +1 -1
  151. package/dist/ezui/{p-ddc6432d.entry.js → p-dce34f38.entry.js} +1 -1
  152. package/dist/ezui/{p-84be1391.entry.js → p-dd522434.entry.js} +1 -1
  153. package/dist/ezui/{p-96e5eaa2.entry.js → p-dfe374b1.entry.js} +1 -1
  154. package/dist/ezui/{p-a383fbc5.entry.js → p-e5df0199.entry.js} +1 -1
  155. package/dist/ezui/{p-dd5326e6.entry.js → p-f01c3171.entry.js} +1 -1
  156. package/dist/ezui/{p-c2d44132.entry.js → p-f678b330.entry.js} +1 -1
  157. package/dist/ezui/p-f8e18112.entry.js +1 -0
  158. package/dist/ezui/{p-f71a4d97.js → p-fc57648e.js} +1 -1
  159. package/dist/ezui/{p-7f475884.entry.js → p-fd784a7f.entry.js} +1 -1
  160. package/dist/ezui/p-fda563e0.entry.js +1 -0
  161. package/dist/ezui/{p-39d2bce5.entry.js → p-ffffdccf.entry.js} +1 -1
  162. package/dist/types/components/ez-classic-search-plus/ez-classic-search-plus.d.ts +3 -0
  163. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
  164. package/dist/types/utils/i18n/locales/en-us.d.ts +1 -0
  165. package/dist/types/utils/i18n/locales/es-es.d.ts +1 -0
  166. package/dist/types/utils/i18n/locales/pt-br.d.ts +1 -0
  167. package/dist/types/utils/i18n/translations.d.ts +3 -0
  168. package/package.json +1 -1
  169. package/dist/ezui/p-2241dea1.js +0 -1
  170. package/dist/ezui/p-6bb36afc.entry.js +0 -1
  171. package/dist/ezui/p-fcdd861e.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as r,g as s}from"./p-23a36bb6.js";import{StringUtils as a,KeyboardManager as o,ElementIDUtils as l}from"@sankhyalabs/core";import{A as n}from"./p-46b0b0c7.js";import{C as h}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as c}from"./p-b6579f86.js";import{S as d}from"./p-5895e687.js";import"./p-47e4a8ce.js";const u=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.ezEmptySearch=t(this,"ezEmptySearch",7),this.SEARCH_DESCRIPTION_TIMEOUT=300,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,this._ignoreNextValue=!1,this.value=void 0,this.enabled=!0,this.disableCodeInput=!1,this.disableDescriptionInput=!1,this.label=void 0,this.codLabel=void 0,this.hideDescriptionInput=!1,this.canShowError=!0,this.errorMessage=void 0,this.mode="regular",this.contextProperties=void 0,this.optionLoader=void 0,this.showOptionValue=!0,this.stopPropagateEnterKeyEvent=!1,this.autoFocus=!1,this.showSelectedValue=!0,this.suppressEmptyOption=!1,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.suppressSearch=!1,this.suppressPreLoad=!0,this.ensureClearButtonVisible=!1,this.descriptionValue="",this.codeValue="",this.isLoadingDescription=!1,this.searchDescriptionIsOpen=!1,this.visibleOptions=void 0,this.showLoading=!0}async observeValue(e,t){var i;if(this._ignoreNextValue)return void(this._ignoreNextValue=!1);const r=this.normalizeValueToCodeValue(e);if(r===this.normalizeValueToCodeValue(t))return;if(void 0===r)return this.codeValue=void 0,this.descriptionValue=void 0,this.cleanFieldsRef(),void this.ezChange.emit(void 0);this.codeValue=r;let s=!0;try{this.descriptionValue=await this.normalizeCodeToDescriptionValue(e),null==this.descriptionValue&&console.error(`Valor de descrição não encontrado! ${this.label}: ${this.codeValue}`)}catch(e){await n.info(e.message);const t="string"==typeof this.value?this.value:null===(i=this.value)||void 0===i?void 0:i.value;this.ezEmptySearch.emit(t),this.errorMessage=e.message,s=!1,this._ignoreNextValue=!0,this.clearSearch(),console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",e)}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value),s&&(this.errorMessage=null)}canShowLoadSpinDescription(){return this.isLoadingDescription}async setFocus(e){var t,i;this.disableCodeInput?null===(t=this._textInputDescriptionValue)||void 0===t||t.setFocus(e):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(e):null===(i=this._textInputCodeValue)||void 0===i||i.setFocus(e)}async getValueAsync(){if(!this.isLoadingDescription){const e=this.buildCurrentValue();return new Promise((t=>t(e)))}return new Promise((e=>{let t=setInterval((()=>{if(!this.isLoadingDescription){clearInterval(t);const i=this.buildCurrentValue();e(i)}}),this.INTERVAL_TO_RETRY_ASYNC_VALUE)}))}async clearValue(){this.clearSearch()}async setBlur(){var e,t;null===(e=this._textInputCodeValue)||void 0===e||e.setBlur(),null===(t=this._textInputDescriptionValue)||void 0===t||t.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async componentWillLoad(){this.i18n=await c(),this.value&&a.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){h.applyVarsTextInput(this.el,this._textInputCodeValue),h.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this.value=null,this.codeValue=null,this.descriptionValue=null,!this.hideDescriptionInput&&this._textInputDescriptionValue&&(this._textInputDescriptionValue.value=null)}getCodLabel(){var e;return this.hideDescriptionInput?this.label:null!==(e=this.codLabel)&&void 0!==e?e:this.i18n("ez-search-plus.defaultCodeLabel")}async normalizeCodeToDescriptionValue(e){if(!e)return"";if("string"==typeof e)try{if((null==(e=JSON.parse(e))?void 0:e.value)&&!(null==e?void 0:e.label))return await this.loadDescriptionValueByCode(null==e?void 0:e.value)}catch(t){return await this.loadDescriptionValueByCode(e)}return"object"!=typeof e?await this.loadDescriptionValueByCode(e):null==e?void 0:e.label}normalizeValueToCodeValue(e){if(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){return e}return"object"!=typeof e?"number"==typeof e?String(e):e:null==e?void 0:e.value}}async loadDescriptionValueByCode(e){if(!this.optionLoader)return console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined")),"";try{this.isLoadingDescription=!0;const t={mode:d.LOAD_DESCRIPTION,argument:e},i=await this.optionLoader(t);return i?Array.isArray(i)?i[0].label:i.label:""}finally{this.isLoadingDescription=!1}}handleCodeInputFocusOut(){this.cancelSelection(),this.codeValue!=this._textInputCodeValue.value&&(this.value=this._textInputCodeValue.value)}handleSearchClick(){this.loadAdvancedSearch()}async loadAdvancedSearch(){if(!this.optionLoader)return void console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined"));const e={mode:d.ADVANCED,argument:""};let t;try{t=await this.optionLoader(e,this.contextProperties)}catch(e){}t&&(this.value=t)}buildCurrentValue(){if(!a.isEmpty(this.codeValue))return{value:this.codeValue,label:this.descriptionValue}}async handleTextInputChangeHandler(e){this.searchDescriptionIsOpen||this._popover.showUnder(this.el);const t=e.target.value;await this.debounceLoaderOptions(t)}async debounceLoaderOptions(e){return this._debounceSearch&&clearTimeout(this._debounceSearch),new Promise((t=>{this._debounceSearch=setTimeout((async()=>{await this.processOptionsLoader(e),t()}),this.SEARCH_DESCRIPTION_TIMEOUT)}))}updateKeyOption(e){return Object.assign(Object.assign({},e),{presentationValue:e.value,presentationLabel:e.label})}parseSearchOptions(e=[]){if(Array.isArray(e)){const t=e[0];return t?"label"in t||"value"in t?e.map((e=>this.updateKeyOption(e))):e:[]}return("label"in e||"value"in e)&&this.updateKeyOption(e),[e]}async processOptionsLoader(e){try{this.showLoading=!0;const t={mode:d.PREDICTIVE,argument:e},i=await this.optionLoader(t);this.visibleOptions=this.parseSearchOptions(i)}finally{this.showLoading=!1}}handleSelectItem(e){this.value=e.detail,this._popover.hide(),window.requestAnimationFrame((()=>{var e;null===(e=this._textInputDescriptionValue)||void 0===e||e.setFocus({selectText:!0})}))}async handleArrowUp(){this.isOptionsVisible()&&await this._searchList.previousOption()}async handleArrowDown(){this.isOptionsVisible()&&await this._searchList.nextOption()}async selectCurrentItem(){var e;await(null===(e=this._searchList)||void 0===e?void 0:e.selectCurrentItem())}async cancelSelection(){var e,t,i;const r="object"==typeof this.value?null===(e=this.value)||void 0===e?void 0:e.label:"";this._textInputDescriptionValue&&r&&this._textInputDescriptionValue.value!=r&&(this._textInputDescriptionValue.value=r),await(null===(t=this._searchList)||void 0===t?void 0:t.cancelSelection()),null===(i=this._popover)||void 0===i||i.hide()}async handleInputTab(){await this.cancelSelection()}async handleInputEsc(){var e;await this.cancelSelection(),await(null===(e=this._latestFocusedInputElement)||void 0===e?void 0:e.setFocus({selectText:!0}))}async initKeyboardManager(){this._keyboardManager=new o;const e={element:this.el,propagate:!0};this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),Object.assign(Object.assign({},e),{propagate:!1})).bind("ArrowDown",(()=>this.handleArrowDown()),Object.assign(Object.assign({},e),{propagate:!1})).bind("Enter",(()=>this.selectCurrentItem()),Object.assign(Object.assign({},e),{propagate:!this.stopPropagateEnterKeyEvent})).bind("Tab",(()=>this.handleInputTab()),e).bind("Escape",(()=>this.handleInputEsc()),e)}disconnectedCallback(){this._keyboardManager.unbind("ArrowUp").unbind("ArrowDown").unbind("Enter").unbind("Tab").unbind("Escape")}isOptionsVisible(){return this._popover.opened}setLatestFocusedInputElement(e){this._latestFocusedInputElement=e}handleCodeInputFocus(){this.setLatestFocusedInputElement(this._textInputCodeValue)}handleDescriptionInputFocus(){this.setLatestFocusedInputElement(this._textInputDescriptionValue)}cleanFieldsRef(){this._textInputCodeValue&&(this._textInputCodeValue.value=null),this._textInputDescriptionValue&&(this._textInputDescriptionValue.value=null)}getRightIconElement(){var e,t;return this.ensureClearButtonVisible||this.value||(null===(e=this._textInputCodeValue)||void 0===e?void 0:e.value)||(null===(t=this._textInputDescriptionValue)||void 0===t?void 0:t.value)?i("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):null}getLeftIconElement(){return i("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handleSearchClick()},this.canShowLoadSpinDescription()?i("div",{class:"message__loading"}):i("ez-icon",{iconName:"search"}))}handleOnEzVisibilityChange(e){e.stopPropagation(),this.searchDescriptionIsOpen=e.detail}render(){return l.addIDInfoIfNotExists(this.el,"input"),i(r,null,i("div",{class:"ez-search-plus__container"},i("ez-text-input",{ref:e=>this._textInputCodeValue=e,class:{"ez-search-plus__code-input":!this.hideDescriptionInput,"ez-search-plus__code-input-no-border":!this.hideDescriptionInput,"ez-search-plus__code-input-full":this.hideDescriptionInput},"data-element-id":l.getInternalIDInfo("codeInput"),"data-slave-mode":"true",enabled:!this.disableCodeInput&&this.enabled,mode:this.mode,label:this.getCodLabel(),canShowError:this.canShowError,hasInvalid:!a.isEmpty(this.errorMessage),errorMessage:this.hideDescriptionInput?this.errorMessage:"",value:this.codeValue,onFocusout:()=>this.handleCodeInputFocusOut(),onFocus:()=>this.handleCodeInputFocus()},this.getLeftIconElement()),!this.hideDescriptionInput&&i("div",{class:"description-input-container"},i("ez-text-input",{ref:e=>this._textInputDescriptionValue=e,tabIndex:-1,class:"ez-search-plus__text-input","data-element-id":l.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:e=>this.handleTextInputChangeHandler(e),onFocus:()=>this.handleDescriptionInputFocus()},this.getRightIconElement()),i("ez-popover-plus",{ref:e=>this._popover=e,anchorElement:this.el,autoClose:!0,boxWidth:"fit-content",overlayType:"none",useAnchorSize:!0,onEzVisibilityChange:e=>this.handleOnEzVisibilityChange(e),"data-element-id":this.el.getAttribute("data-element-id")},i("ez-search-result-list",{ref:e=>this._searchList=e,showLoading:this.showLoading,visibleOptions:this.visibleOptions,value:this.value,showOptionValue:this.showOptionValue,onChangeValue:e=>this.handleSelectItem(e)})))))}get el(){return s(this)}static get watchers(){return{value:["observeValue"]}}};u.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__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;outline:none}.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{max-width:85px}.ez-search-plus__code-input-full{width:100%}.description-input-container{width:100%;outline:none}";export{u as ez_search_plus}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as s,g as a}from"./p-23a36bb6.js";import{DateUtils as n,TimeFormatter as o,ElementIDUtils as h}from"@sankhyalabs/core";import{C as l}from"./p-ec7db713.js";import{i as r}from"./p-69344c23.js";const c=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular",this.size="default",this.required=!1,this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i){const e=n.validateDate(t,!0),s=n.validateDate(i,!0);if((null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())){const t=this.getTextValue(e)||"";!this.getParsedDateTime(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===e?void 0:e)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}handleKeyDown(t){const i=this._textInput.shadowRoot.querySelector("input");if(t.shiftKey&&"Tab"===t.key){if(i.selectionStart>0){let e=i.value.lastIndexOf(" ",i.selectionStart);-1!==e&&(i.setSelectionRange(0,e),t.preventDefault())}}else if("Tab"===t.key&&i.value.length!==i.selectionEnd){let e=i.value.indexOf(" ",i.selectionEnd);e=-1===e?i.selectionEnd:e+1,i.setSelectionRange(e,i.value.length),t.preventDefault()}}handleFocus(){const t=this._textInput.shadowRoot.querySelector("input");if(t.selectionStart!==t.selectionEnd){let i=t.value.indexOf(" ",t.selectionStart);i=-1===i?t.value.length:i,t.setSelectionRange(0,i)}}handleClick(){const t=this._textInput.shadowRoot.querySelector("input");let i=t.value.lastIndexOf(" ",t.selectionEnd);i=-1===i?0:i+1,i=i>t.selectionEnd?0:i;let e=0===i?t.value.indexOf(" "):t.value.length;t.setSelectionRange(i,e)}changeValue(t){const i=n.validateDate(this.value,!0),e=n.validateDate(t,!0);(null==i?void 0:i.getTime())!==(null==e?void 0:e.getTime())&&(this.value=e)}hideCalendar(){this.changeValue(this._calendar.value),this._popover.hide()}getParsedDateTime(t){var i,e;if(void 0===t&&(t=(null===(e=null===(i=this._textInput)||void 0===i?void 0:i.value)||void 0===e?void 0:e.trim())||""),!t)return;const s=t.split(" "),a=s.length>0?s[0]:t,h=o.prepareValue(s[1]?s[1]:"",this.showSeconds);return n.strToDate(a+(h&&" "+h))}handleBlur(){var t,i;if(this._changePending)try{const e=(null===(i=null===(t=this._textInput)||void 0===t?void 0:t.value)||void 0===i?void 0:i.trim())||"",s=this.getParsedDateTime();if(s||!e){this.errorMessage="";const t=n.validateDate(this.value,!0),i=n.validateDate(s,!0);(null==t?void 0:t.getTime())===(null==i?void 0:i.getTime())?(i&&(this._textInput.value=this.getTextValue(i)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):this.changeValue(i)}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-classic-date-time-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){if(t)return n.formatDateTime(t,this.showSeconds)}handleInput(t){const i=this.getParsedDateTime(),e=n.validateDate(this.value,!0),s=n.validateDate(i,!0);(null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"!==t.data&&"h"!==t.data||this.changeValue(new Date)}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await r()}componentDidLoad(){l.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),e(s,null,e("ez-classic-input",{ref:t=>this._textInput=t,"data-element-id":h.getInternalIDInfo("textInput"),"data-slave-mode":"true",label:this.label,enabled:this.enabled,errorMessage:this.errorMessage,size:this.size,onKeyDown:t=>{this.handleKeyDown(t)},onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleClick(),required:this.required,leftIconName:"calendar",leftIconClickable:this.enabled,onIconClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},onEzChange:t=>t.stopPropagation()}),e("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id")},e("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},time:!0,showSeconds:this.showSeconds})))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};c.style=':host{display:block;width:100%;--ez-classic-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-date-input__input--border-color:var(--ez-classic-date-input__input--background-color);--ez-classic-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-classic-date-input__calendar-image);mask-image:var(--ez-classic-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-classic-input{--text-input__input--background-color:var(--ez-classic-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-classic-date-input__input--border-color, #DCE0E8)}';export{c as ez_classic_date_time_input}
1
+ import{r as t,c as i,h as e,H as s,g as a}from"./p-23a36bb6.js";import{DateUtils as n,TimeFormatter as o,ElementIDUtils as h}from"@sankhyalabs/core";import{C as l}from"./p-ec7db713.js";import{i as r}from"./p-b6579f86.js";const c=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular",this.size="default",this.required=!1,this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i){const e=n.validateDate(t,!0),s=n.validateDate(i,!0);if((null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())){const t=this.getTextValue(e)||"";!this.getParsedDateTime(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===e?void 0:e)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}handleKeyDown(t){const i=this._textInput.shadowRoot.querySelector("input");if(t.shiftKey&&"Tab"===t.key){if(i.selectionStart>0){let e=i.value.lastIndexOf(" ",i.selectionStart);-1!==e&&(i.setSelectionRange(0,e),t.preventDefault())}}else if("Tab"===t.key&&i.value.length!==i.selectionEnd){let e=i.value.indexOf(" ",i.selectionEnd);e=-1===e?i.selectionEnd:e+1,i.setSelectionRange(e,i.value.length),t.preventDefault()}}handleFocus(){const t=this._textInput.shadowRoot.querySelector("input");if(t.selectionStart!==t.selectionEnd){let i=t.value.indexOf(" ",t.selectionStart);i=-1===i?t.value.length:i,t.setSelectionRange(0,i)}}handleClick(){const t=this._textInput.shadowRoot.querySelector("input");let i=t.value.lastIndexOf(" ",t.selectionEnd);i=-1===i?0:i+1,i=i>t.selectionEnd?0:i;let e=0===i?t.value.indexOf(" "):t.value.length;t.setSelectionRange(i,e)}changeValue(t){const i=n.validateDate(this.value,!0),e=n.validateDate(t,!0);(null==i?void 0:i.getTime())!==(null==e?void 0:e.getTime())&&(this.value=e)}hideCalendar(){this.changeValue(this._calendar.value),this._popover.hide()}getParsedDateTime(t){var i,e;if(void 0===t&&(t=(null===(e=null===(i=this._textInput)||void 0===i?void 0:i.value)||void 0===e?void 0:e.trim())||""),!t)return;const s=t.split(" "),a=s.length>0?s[0]:t,h=o.prepareValue(s[1]?s[1]:"",this.showSeconds);return n.strToDate(a+(h&&" "+h))}handleBlur(){var t,i;if(this._changePending)try{const e=(null===(i=null===(t=this._textInput)||void 0===t?void 0:t.value)||void 0===i?void 0:i.trim())||"",s=this.getParsedDateTime();if(s||!e){this.errorMessage="";const t=n.validateDate(this.value,!0),i=n.validateDate(s,!0);(null==t?void 0:t.getTime())===(null==i?void 0:i.getTime())?(i&&(this._textInput.value=this.getTextValue(i)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):this.changeValue(i)}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-classic-date-time-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){if(t)return n.formatDateTime(t,this.showSeconds)}handleInput(t){const i=this.getParsedDateTime(),e=n.validateDate(this.value,!0),s=n.validateDate(i,!0);(null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"!==t.data&&"h"!==t.data||this.changeValue(new Date)}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await r()}componentDidLoad(){l.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),e(s,null,e("ez-classic-input",{ref:t=>this._textInput=t,"data-element-id":h.getInternalIDInfo("textInput"),"data-slave-mode":"true",label:this.label,enabled:this.enabled,errorMessage:this.errorMessage,size:this.size,onKeyDown:t=>{this.handleKeyDown(t)},onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleClick(),required:this.required,leftIconName:"calendar",leftIconClickable:this.enabled,onIconClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},onEzChange:t=>t.stopPropagation()}),e("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id")},e("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},time:!0,showSeconds:this.showSeconds})))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};c.style=':host{display:block;width:100%;--ez-classic-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-date-input__input--border-color:var(--ez-classic-date-input__input--background-color);--ez-classic-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-classic-date-input__calendar-image);mask-image:var(--ez-classic-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-classic-input{--text-input__input--background-color:var(--ez-classic-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-classic-date-input__input--border-color, #DCE0E8)}';export{c as ez_classic_date_time_input}
@@ -121,6 +121,8 @@ export declare class EzClassicSearchPlus {
121
121
  private searchDescriptionIsOpen;
122
122
  private visibleOptions;
123
123
  private showLoading;
124
+ private canShowClearButton;
125
+ private isHoveringDescription;
124
126
  observeValue(newValue: IOption | string, oldValue: IOption | string): Promise<void>;
125
127
  /**
126
128
  * Aplica o foco no campo.
@@ -173,6 +175,7 @@ export declare class EzClassicSearchPlus {
173
175
  private handleCodeInputFocus;
174
176
  private handleDescriptionInputFocus;
175
177
  private handleOnEzVisibilityChange;
178
+ private getClearButtonStatus;
176
179
  render(): any;
177
180
  }
178
181
  export interface IOption {
@@ -178,6 +178,7 @@ export declare class EzSearchPlus {
178
178
  private setLatestFocusedInputElement;
179
179
  private handleCodeInputFocus;
180
180
  private handleDescriptionInputFocus;
181
+ private cleanFieldsRef;
181
182
  private getRightIconElement;
182
183
  private getLeftIconElement;
183
184
  private handleOnEzVisibilityChange;
@@ -283,6 +283,7 @@ declare const _default: {
283
283
  emptyList: string;
284
284
  optionLoaderNotDefined: string;
285
285
  defaultCodeLabel: string;
286
+ clearValue: string;
286
287
  };
287
288
  "ez-sortable-list": {
288
289
  emptyMessage: string;
@@ -283,6 +283,7 @@ declare const _default: {
283
283
  emptyList: string;
284
284
  optionLoaderNotDefined: string;
285
285
  defaultCodeLabel: string;
286
+ clearValue: string;
286
287
  };
287
288
  "ez-sortable-list": {
288
289
  emptyMessage: string;
@@ -283,6 +283,7 @@ declare const _default: {
283
283
  emptyList: string;
284
284
  optionLoaderNotDefined: string;
285
285
  defaultCodeLabel: string;
286
+ clearValue: string;
286
287
  };
287
288
  "ez-sortable-list": {
288
289
  emptyMessage: string;
@@ -284,6 +284,7 @@ declare const _default: {
284
284
  emptyList: string;
285
285
  optionLoaderNotDefined: string;
286
286
  defaultCodeLabel: string;
287
+ clearValue: string;
287
288
  };
288
289
  "ez-sortable-list": {
289
290
  emptyMessage: string;
@@ -617,6 +618,7 @@ declare const _default: {
617
618
  emptyList: string;
618
619
  optionLoaderNotDefined: string;
619
620
  defaultCodeLabel: string;
621
+ clearValue: string;
620
622
  };
621
623
  "ez-sortable-list": {
622
624
  emptyMessage: string;
@@ -950,6 +952,7 @@ declare const _default: {
950
952
  emptyList: string;
951
953
  optionLoaderNotDefined: string;
952
954
  defaultCodeLabel: string;
955
+ clearValue: string;
953
956
  };
954
957
  "ez-sortable-list": {
955
958
  emptyMessage: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "7.2.0-dev.7",
3
+ "version": "7.2.0-dev.8",
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{i}from"./p-69344c23.js";const o=async function(){await i(),console.log("Global initialization ez-ui completed!")};export{o as g}
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i,H as r,g as s}from"./p-23a36bb6.js";import{StringUtils as a,KeyboardManager as o,ElementIDUtils as l}from"@sankhyalabs/core";import{A as n}from"./p-24582dd6.js";import{C as h}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as c}from"./p-69344c23.js";import{S as d}from"./p-5895e687.js";import"./p-47e4a8ce.js";const u=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.ezEmptySearch=t(this,"ezEmptySearch",7),this.SEARCH_DESCRIPTION_TIMEOUT=300,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,this._ignoreNextValue=!1,this.value=void 0,this.enabled=!0,this.disableCodeInput=!1,this.disableDescriptionInput=!1,this.label=void 0,this.codLabel=void 0,this.hideDescriptionInput=!1,this.canShowError=!0,this.errorMessage=void 0,this.mode="regular",this.contextProperties=void 0,this.optionLoader=void 0,this.showOptionValue=!0,this.stopPropagateEnterKeyEvent=!1,this.autoFocus=!1,this.showSelectedValue=!0,this.suppressEmptyOption=!1,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.suppressSearch=!1,this.suppressPreLoad=!0,this.ensureClearButtonVisible=!1,this.descriptionValue="",this.codeValue="",this.isLoadingDescription=!1,this.searchDescriptionIsOpen=!1,this.visibleOptions=void 0,this.showLoading=!0}async observeValue(e,t){var i;if(this._ignoreNextValue)return void(this._ignoreNextValue=!1);const r=this.normalizeValueToCodeValue(e);if(r===this.normalizeValueToCodeValue(t))return;if(void 0===r)return this.codeValue=void 0,this.descriptionValue=void 0,void this.ezChange.emit(void 0);this.codeValue=r;let s=!0;try{this.descriptionValue=await this.normalizeCodeToDescriptionValue(e),null==this.descriptionValue&&console.error(`Valor de descrição não encontrado! ${this.label}: ${this.codeValue}`)}catch(e){await n.info(e.message);const t="string"==typeof this.value?this.value:null===(i=this.value)||void 0===i?void 0:i.value;this.ezEmptySearch.emit(t),this.errorMessage=e.message,s=!1,this._ignoreNextValue=!0,this.clearSearch(),console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",e)}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value),s&&(this.errorMessage=null)}canShowLoadSpinDescription(){return this.isLoadingDescription}async setFocus(e){var t,i;this.disableCodeInput?null===(t=this._textInputDescriptionValue)||void 0===t||t.setFocus(e):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(e):null===(i=this._textInputCodeValue)||void 0===i||i.setFocus(e)}async getValueAsync(){if(!this.isLoadingDescription){const e=this.buildCurrentValue();return new Promise((t=>t(e)))}return new Promise((e=>{let t=setInterval((()=>{if(!this.isLoadingDescription){clearInterval(t);const i=this.buildCurrentValue();e(i)}}),this.INTERVAL_TO_RETRY_ASYNC_VALUE)}))}async clearValue(){this.clearSearch()}async setBlur(){var e,t;null===(e=this._textInputCodeValue)||void 0===e||e.setBlur(),null===(t=this._textInputDescriptionValue)||void 0===t||t.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async componentWillLoad(){this.i18n=await c(),this.value&&a.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){h.applyVarsTextInput(this.el,this._textInputCodeValue),h.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this.value=null,this.codeValue=null,this.descriptionValue=null,!this.hideDescriptionInput&&this._textInputDescriptionValue&&(this._textInputDescriptionValue.value=null)}getCodLabel(){var e;return this.hideDescriptionInput?this.label:null!==(e=this.codLabel)&&void 0!==e?e:this.i18n("ez-search-plus.defaultCodeLabel")}async normalizeCodeToDescriptionValue(e){if(!e)return"";if("string"==typeof e)try{if((null==(e=JSON.parse(e))?void 0:e.value)&&!(null==e?void 0:e.label))return await this.loadDescriptionValueByCode(null==e?void 0:e.value)}catch(t){return await this.loadDescriptionValueByCode(e)}return"object"!=typeof e?await this.loadDescriptionValueByCode(e):null==e?void 0:e.label}normalizeValueToCodeValue(e){if(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){return e}return"object"!=typeof e?"number"==typeof e?String(e):e:null==e?void 0:e.value}}async loadDescriptionValueByCode(e){if(!this.optionLoader)return console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined")),"";try{this.isLoadingDescription=!0;const t={mode:d.LOAD_DESCRIPTION,argument:e},i=await this.optionLoader(t);return i?Array.isArray(i)?i[0].label:i.label:""}finally{this.isLoadingDescription=!1}}handleCodeInputFocusOut(){this.cancelSelection(),this.codeValue!=this._textInputCodeValue.value&&(this.value=this._textInputCodeValue.value)}handleSearchClick(){this.loadAdvancedSearch()}async loadAdvancedSearch(){if(!this.optionLoader)return void console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined"));const e={mode:d.ADVANCED,argument:""};let t;try{t=await this.optionLoader(e,this.contextProperties)}catch(e){}t&&(this.value=t)}buildCurrentValue(){if(!a.isEmpty(this.codeValue))return{value:this.codeValue,label:this.descriptionValue}}async handleTextInputChangeHandler(e){this.searchDescriptionIsOpen||this._popover.showUnder(this.el);const t=e.target.value;await this.debounceLoaderOptions(t)}async debounceLoaderOptions(e){return this._debounceSearch&&clearTimeout(this._debounceSearch),new Promise((t=>{this._debounceSearch=setTimeout((async()=>{await this.processOptionsLoader(e),t()}),this.SEARCH_DESCRIPTION_TIMEOUT)}))}updateKeyOption(e){return Object.assign(Object.assign({},e),{presentationValue:e.value,presentationLabel:e.label})}parseSearchOptions(e=[]){if(Array.isArray(e)){const t=e[0];return t?"label"in t||"value"in t?e.map((e=>this.updateKeyOption(e))):e:[]}return("label"in e||"value"in e)&&this.updateKeyOption(e),[e]}async processOptionsLoader(e){try{this.showLoading=!0;const t={mode:d.PREDICTIVE,argument:e},i=await this.optionLoader(t);this.visibleOptions=this.parseSearchOptions(i)}finally{this.showLoading=!1}}handleSelectItem(e){this.value=e.detail,this._popover.hide(),window.requestAnimationFrame((()=>{var e;null===(e=this._textInputDescriptionValue)||void 0===e||e.setFocus({selectText:!0})}))}async handleArrowUp(){this.isOptionsVisible()&&await this._searchList.previousOption()}async handleArrowDown(){this.isOptionsVisible()&&await this._searchList.nextOption()}async selectCurrentItem(){var e;await(null===(e=this._searchList)||void 0===e?void 0:e.selectCurrentItem())}async cancelSelection(){var e,t,i;const r="object"==typeof this.value?null===(e=this.value)||void 0===e?void 0:e.label:"";this._textInputDescriptionValue&&r&&this._textInputDescriptionValue.value!=r&&(this._textInputDescriptionValue.value=r),await(null===(t=this._searchList)||void 0===t?void 0:t.cancelSelection()),null===(i=this._popover)||void 0===i||i.hide()}async handleInputTab(){await this.cancelSelection()}async handleInputEsc(){var e;await this.cancelSelection(),await(null===(e=this._latestFocusedInputElement)||void 0===e?void 0:e.setFocus({selectText:!0}))}async initKeyboardManager(){this._keyboardManager=new o;const e={element:this.el,propagate:!0};this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),Object.assign(Object.assign({},e),{propagate:!1})).bind("ArrowDown",(()=>this.handleArrowDown()),Object.assign(Object.assign({},e),{propagate:!1})).bind("Enter",(()=>this.selectCurrentItem()),Object.assign(Object.assign({},e),{propagate:!this.stopPropagateEnterKeyEvent})).bind("Tab",(()=>this.handleInputTab()),e).bind("Escape",(()=>this.handleInputEsc()),e)}disconnectedCallback(){this._keyboardManager.unbind("ArrowUp").unbind("ArrowDown").unbind("Enter").unbind("Tab").unbind("Escape")}isOptionsVisible(){return this._popover.opened}setLatestFocusedInputElement(e){this._latestFocusedInputElement=e}handleCodeInputFocus(){this.setLatestFocusedInputElement(this._textInputCodeValue)}handleDescriptionInputFocus(){this.setLatestFocusedInputElement(this._textInputDescriptionValue)}getRightIconElement(){var e,t;return this.ensureClearButtonVisible||this.value||(null===(e=this._textInputCodeValue)||void 0===e?void 0:e.value)||(null===(t=this._textInputDescriptionValue)||void 0===t?void 0:t.value)?i("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):null}getLeftIconElement(){return i("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handleSearchClick()},this.canShowLoadSpinDescription()?i("div",{class:"message__loading"}):i("ez-icon",{iconName:"search"}))}handleOnEzVisibilityChange(e){e.stopPropagation(),this.searchDescriptionIsOpen=e.detail}render(){return l.addIDInfoIfNotExists(this.el,"input"),i(r,null,i("div",{class:"ez-search-plus__container"},i("ez-text-input",{ref:e=>this._textInputCodeValue=e,class:{"ez-search-plus__code-input":!this.hideDescriptionInput,"ez-search-plus__code-input-no-border":!this.hideDescriptionInput,"ez-search-plus__code-input-full":this.hideDescriptionInput},"data-element-id":l.getInternalIDInfo("codeInput"),"data-slave-mode":"true",enabled:!this.disableCodeInput&&this.enabled,mode:this.mode,label:this.getCodLabel(),canShowError:this.canShowError,hasInvalid:!a.isEmpty(this.errorMessage),errorMessage:this.hideDescriptionInput?this.errorMessage:"",value:this.codeValue,onFocusout:()=>this.handleCodeInputFocusOut(),onFocus:()=>this.handleCodeInputFocus()},this.getLeftIconElement()),!this.hideDescriptionInput&&i("div",{class:"description-input-container"},i("ez-text-input",{ref:e=>this._textInputDescriptionValue=e,tabIndex:-1,class:"ez-search-plus__text-input","data-element-id":l.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:e=>this.handleTextInputChangeHandler(e),onFocus:()=>this.handleDescriptionInputFocus()},this.getRightIconElement()),i("ez-popover-plus",{ref:e=>this._popover=e,anchorElement:this.el,autoClose:!0,boxWidth:"fit-content",overlayType:"none",useAnchorSize:!0,onEzVisibilityChange:e=>this.handleOnEzVisibilityChange(e),"data-element-id":this.el.getAttribute("data-element-id")},i("ez-search-result-list",{ref:e=>this._searchList=e,showLoading:this.showLoading,visibleOptions:this.visibleOptions,value:this.value,showOptionValue:this.showOptionValue,onChangeValue:e=>this.handleSelectItem(e)})))))}get el(){return s(this)}static get watchers(){return{value:["observeValue"]}}};u.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__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;outline:none}.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{max-width:85px}.ez-search-plus__code-input-full{width:100%}.description-input-container{width:100%;outline:none}";export{u as ez_search_plus}
@@ -1 +0,0 @@
1
- import{r as s,c as e,h as i,H as t,g as a}from"./p-23a36bb6.js";import{StringUtils as r,KeyboardManager as l,ElementIDUtils as o}from"@sankhyalabs/core";import"./p-24582dd6.js";import{C as c}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as n}from"./p-69344c23.js";import{S as h}from"./p-5895e687.js";import"./p-47e4a8ce.js";const d=class{constructor(i){s(this,i),this.ezChange=e(this,"ezChange",7),this.SEARCH_DESCRIPTION_TIMEOUT=2e3,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,this._ignoreNextValue=!1,this.value=void 0,this.enabled=!0,this.disableCodeInput=!1,this.disableDescriptionInput=!1,this.label=void 0,this.hideDescriptionInput=!1,this.canShowError=!0,this.errorMessage=void 0,this.mode="regular",this.size="default",this.required=!1,this.contextProperties=void 0,this.optionLoader=void 0,this.showOptionValue=!0,this.stopPropagateEnterKeyEvent=!1,this.autoFocus=!1,this.showSelectedValue=!0,this.suppressEmptyOption=!1,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.suppressSearch=!1,this.suppressPreLoad=!0,this.ensureClearButtonVisible=!1,this.descriptionValue="",this.codeValue="",this.isLoadingDescription=!1,this.searchDescriptionIsOpen=!1,this.visibleOptions=void 0,this.showLoading=!0}async observeValue(s,e){var i;if(this._ignoreNextValue)return void(this._ignoreNextValue=!1);const t=this.normalizeValueToCodeValue(s);if(t!==this.normalizeValueToCodeValue(e)){if(void 0===t)return this.codeValue=void 0,this.descriptionValue=void 0,void this.ezChange.emit(void 0);this.codeValue=t;try{if(this.descriptionValue=await this.normalizeCodeToDescriptionValue(s),null==this.descriptionValue)throw new Error("Valor não encontrado!")}catch(s){throw this._ignoreNextValue=!0,this.clearSearch(),console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",s),"WarningException"===(null===(i=null==s?void 0:s.constructor)||void 0===i?void 0:i.name)&&(this.errorMessage=s.message),s}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value),this.errorMessage=null}}async setFocus(s){var e;this.disableCodeInput?null===(e=this._textInputDescriptionValue)||void 0===e||e.setFocus(s):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(s):this._textInputCodeValue.setFocus(s)}async getValueAsync(){if(!this.isLoadingDescription){const s=this.buildCurrentValue();return new Promise((e=>e(s)))}return new Promise((s=>{let e=setInterval((()=>{if(!this.isLoadingDescription){clearInterval(e);const i=this.buildCurrentValue();s(i)}}),this.INTERVAL_TO_RETRY_ASYNC_VALUE)}))}async clearValue(){this.clearSearch()}async setBlur(){var s,e;null===(s=this._textInputCodeValue)||void 0===s||s.setBlur(),null===(e=this._textInputDescriptionValue)||void 0===e||e.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async componentWillLoad(){this.i18n=await n(),this.value&&r.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){c.applyVarsTextInput(this.el,this._textInputCodeValue),c.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this.value=null,this.codeValue=null,this.descriptionValue=null,this.hideDescriptionInput||(this._textInputDescriptionValue.value=null)}async normalizeCodeToDescriptionValue(s){if(!s)return"";if("string"==typeof s)try{if((null==(s=JSON.parse(s))?void 0:s.value)&&!(null==s?void 0:s.label))return await this.loadDescriptionValueByCode(null==s?void 0:s.value)}catch(e){return await this.loadDescriptionValueByCode(s)}return"object"!=typeof s?await this.loadDescriptionValueByCode(s):null==s?void 0:s.label}normalizeValueToCodeValue(s){if(s){if("string"==typeof s)try{s=JSON.parse(s)}catch(e){return s}return"object"!=typeof s?"number"==typeof s?String(s):s:null==s?void 0:s.value}}async loadDescriptionValueByCode(s){if(!this.optionLoader)return console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined")),"";try{this.isLoadingDescription=!0;const e={mode:h.LOAD_DESCRIPTION,argument:s},i=await this.optionLoader(e);return i?Array.isArray(i)?i[0].label:i.label:""}finally{this.isLoadingDescription=!1}}handleCodeInputFocusOut(){this.cancelSelection(),this.codeValue!=this._textInputCodeValue.value&&(this.value=this._textInputCodeValue.value)}handleSearchClick(){this.loadAdvancedSearch()}async loadAdvancedSearch(){if(!this.optionLoader)return void console.warn(this.i18n("ez-search-plus.optionLoaderNotDefined"));const s={mode:h.ADVANCED,argument:""};let e;try{e=await this.optionLoader(s,this.contextProperties)}catch(s){}e&&(this.value=e)}buildCurrentValue(){if(!r.isEmpty(this.codeValue))return{value:this.codeValue,label:this.descriptionValue}}async handleTextInputChangeHandler(s){this.searchDescriptionIsOpen||this._popover.showUnder(this.el);const e=s.target.value;await this.debounceLoaderOptions(e)}async debounceLoaderOptions(s){return this._debounceSearch&&clearTimeout(this._debounceSearch),new Promise((e=>{this._debounceSearch=setTimeout((async()=>{await this.processOptionsLoader(s),e()}),this.SEARCH_DESCRIPTION_TIMEOUT)}))}updateKeyOption(s){return Object.assign(Object.assign({},s),{presentationValue:s.value,presentationLabel:s.label})}parseSearchOptions(s=[]){if(Array.isArray(s)){const e=s[0];return e?"label"in e||"value"in e?s.map((s=>this.updateKeyOption(s))):s:[]}return("label"in s||"value"in s)&&this.updateKeyOption(s),[s]}async processOptionsLoader(s){try{this.showLoading=!0;const e={mode:h.PREDICTIVE,argument:s},i=await this.optionLoader(e);this.visibleOptions=this.parseSearchOptions(i)}finally{this.showLoading=!1}}handleSelectItem(s){this.value=s.detail,this._popover.hide(),window.requestAnimationFrame((()=>{var s;null===(s=this._textInputDescriptionValue)||void 0===s||s.setFocus({selectText:!0})}))}async handleArrowUp(){this.isOptionsVisible()&&await this._classicSearchList.previousOption()}async handleArrowDown(){this.isOptionsVisible()&&await this._classicSearchList.nextOption()}async selectCurrentItem(){var s;await(null===(s=this._classicSearchList)||void 0===s?void 0:s.selectCurrentItem())}async cancelSelection(){var s,e,i;const t="object"==typeof this.value?null===(s=this.value)||void 0===s?void 0:s.label:"";this._textInputDescriptionValue&&t&&this._textInputDescriptionValue.value!=t&&(this._textInputDescriptionValue.value=t),await(null===(e=this._classicSearchList)||void 0===e?void 0:e.cancelSelection()),null===(i=this._popover)||void 0===i||i.hide()}async handleInputTab(){await this.cancelSelection()}async handleInputEsc(){var s;await this.cancelSelection(),await(null===(s=this._latestFocusedInputElement)||void 0===s?void 0:s.setFocus({selectText:!0}))}async initKeyboardManager(){this._keyboardManager=new l;const s={element:this.el,propagate:!0};this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),Object.assign(Object.assign({},s),{propagate:!1})).bind("ArrowDown",(()=>this.handleArrowDown()),Object.assign(Object.assign({},s),{propagate:!1})).bind("Enter",(()=>this.selectCurrentItem()),Object.assign(Object.assign({},s),{propagate:!this.stopPropagateEnterKeyEvent})).bind("Tab",(()=>this.handleInputTab()),s).bind("Escape",(()=>this.handleInputEsc()),s)}disconnectedCallback(){this._keyboardManager.unbind("ArrowUp").unbind("ArrowDown").unbind("Enter").unbind("Tab").unbind("Escape")}isOptionsVisible(){return this._popover.opened}setLatestFocusedInputElement(s){this._latestFocusedInputElement=s}handleCodeInputFocus(){this.setLatestFocusedInputElement(this._textInputCodeValue)}handleDescriptionInputFocus(){this.setLatestFocusedInputElement(this._textInputDescriptionValue)}handleOnEzVisibilityChange(s){s.stopPropagation(),this.searchDescriptionIsOpen=s.detail}render(){var s,e;o.addIDInfoIfNotExists(this.el,"input");const a=!(this.ensureClearButtonVisible||this.value||(null===(s=this._textInputCodeValue)||void 0===s?void 0:s.value)||(null===(e=this._textInputDescriptionValue)||void 0===e?void 0:e.value));return i(t,null,i("div",{class:"ez-classic-search-plus__wrapper"},i("div",{class:"ez-classic-search-plus__label-container"},i("label",{title:this.label},this.label),this.required&&i("span",{class:"required-indicator"},"*")),i("div",{class:"ez-classic-search-plus__container"},i("ez-classic-input",{ref:s=>this._textInputCodeValue=s,class:{"ez-classic-search-plus__code-input":!this.hideDescriptionInput,"ez-classic-search-plus__code-input-no-border":!this.hideDescriptionInput,"ez-classic-search-plus__code-input-full":this.hideDescriptionInput},"data-element-id":o.getInternalIDInfo("codeInput"),"data-slave-mode":"true",enabled:!this.disableCodeInput&&this.enabled,size:this.size,label:null,errorMessage:this.hideDescriptionInput?this.errorMessage:"",value:this.codeValue,onFocusout:()=>this.handleCodeInputFocusOut(),onFocus:()=>this.handleCodeInputFocus(),leftIconName:"search",leftIconClickable:this.enabled,onIconClick:()=>this.handleSearchClick(),onEzChange:s=>s.stopPropagation(),state:this.errorMessage&&this.canShowError?"error":"default"}),!this.hideDescriptionInput&&i("div",{class:"description-input-container"},i("ez-classic-input",{ref:s=>this._textInputDescriptionValue=s,tabIndex:-1,class:{"ez-classic-search-plus__text-input":!0},"data-element-id":o.getInternalIDInfo("textInput"),"data-slave-mode":"true",enabled:!this.disableDescriptionInput&&this.enabled,label:null,size:this.size,value:this.descriptionValue,onInput:s=>this.handleTextInputChangeHandler(s),onFocus:()=>this.handleDescriptionInputFocus(),rightIconName:a?"close":null,rightIconClickable:this.enabled,onIconClick:()=>this.clearSearch(),onEzChange:s=>s.stopPropagation(),state:this.errorMessage&&this.canShowError?"error":"default"}),i("ez-popover-plus",{ref:s=>this._popover=s,anchorElement:this.el,autoClose:!0,boxWidth:"fit-content",overlayType:"none",useAnchorSize:!0,onEzVisibilityChange:s=>this.handleOnEzVisibilityChange(s),"data-element-id":this.el.getAttribute("data-element-id")},i("ez-classic-search-result-list",{ref:s=>this._classicSearchList=s,showLoading:this.showLoading,visibleOptions:this.visibleOptions,value:this.value,showOptionValue:this.showOptionValue,onChangeValue:s=>this.handleSelectItem(s)})))),i("div",{class:"ez-classic-search-plus__error-container"},i("span",null,this.errorMessage))))}get el(){return a(this)}static get watchers(){return{value:["observeValue"]}}};d.style=":host{--ez-classic-search--height:42px;--ez-classic-search--width:100%;--ez-classic-search__icon--width:48px;--ez-classic-search--border-radius:var(--border--radius-medium, 12px);--ez-classic-search--border-radius-small:var(--border--radius-small, 6px);--ez-classic-search--font-size:var(--text--medium, 14px);--ez-classic-search--font-family:var(--font-pattern, Arial);--ez-classic-search--font-weight--large:var(--text-weight--large, 500);--ez-classic-search--font-weight--medium:var(--text-weight--medium, 400);--ez-classic-search--background-color--xlight:var(--background--xlight, #fff);--ez-classic-search--background-medium:var(--background--medium, #f0f3f7);--ez-classic-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-classic-search__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-search__input--border:var(--border--medium, 2px solid);--ez-classic-search__input--border-color:var(--ez-classic-search__input--background-color);--ez-classic-search__input--focus--border-color:var(--color--primary, #008561);--ez-classic-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-classic-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-classic-search__input--error--border-color:#CC2936;--ez-classic-search__btn--color:var(--title--primary, #2B3A54);--ez-classic-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-classic-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-classic-search__label--color:var(--title--primary, #2B3A54);--ez-classic-search__list-title--primary:var(--title--primary, #2B3A54);--ez-classic-search__list-text--primary:var(--text--primary, #626e82);--ez-classic-search__list-height:calc(var(--ez-classic-search--font-size) + var(--ez-classic-search--space--medium) + 4px);--ez-classic-search__list-min-width:64px;--ez-classic-search--space--medium:var(--space--medium, 12px);--ez-classic-search--space--small:var(--space--small, 6px);--ez-classic-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-classic-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-classic-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-classic-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-classic-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-classic-search__scrollbar--width:var(--space--medium, 12px);--ez-classic-input--helptext-color:var(--color--ocean-green-1000, #00281D);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-classic-search--width);font-family:var(--font--pattern, Arial, sans-serif)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-classic-input__input--border-color:var(--color--strokes, #dce0e8);--ez-classic-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-classic-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-classic-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-classic-search--background-color--xlight);border-radius:var(--ez-classic-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-classic-search__scrollbar--color-clicked) var(--ez-classic-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-classic-search__scrollbar--color-background);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-classic-search__scrollbar--color-default);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-classic-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-classic-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-classic-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-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size);line-height:var(--ez-classic-search--line-height)}.item__label{font-weight:var(--ez-classic-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-classic-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-classic-search__list-text--primary);font-weight:var(--ez-classic-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-classic-search__list-height)}.message__no-result{color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-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-classic-search__list-title--primary);border-top:3px solid transparent}.item__list>li:hover{background-color:var(--ez-classic-search--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-classic-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-classic-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-classic-search__btn-disabled--color)}.btn:hover{color:var(--ez-classic-search__btn-hover--color)}.btn__close{visibility:hidden}ez-classic-input:hover .btn__close,ez-c-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-classic-search-plus__container{display:flex;flex-grow:1;gap:3px}.ez-classic-search-plus__wrapper{display:flex;flex-direction:column;flex-grow:1;overflow:hidden}.ez-classic-search-plus__label-container{display:flex;flex-grow:1;gap:3px;overflow:hidden}.ez-classic-search-plus__label-container label{overflow:hidden;text-overflow:ellipsis;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);white-space:nowrap}.ez-classic-search-plus__text-input{--ez-classic-input--border-top-left-radius:0px;--ez-classic-input--border-bottom-left-radius:0px;outline:none}.ez-classic-search-plus__code-input-no-border{--ez-classic-input--border-top-right-radius:0px;--ez-classic-input--border-bottom-right-radius:0px}.ez-classic-search-plus__code-input{max-width:85px;--ez-classic-input--padding-inline:6px;--ez-classic-input--gap:6px}.ez-classic-search-plus__code-input-full{width:100%}.description-input-container{width:100%;outline:none}.required-indicator{font-size:var(--font--size--default, 14px);font-family:var(--font--pattern, 'Roboto');color:var(--color--red-600, #BD0025);margin-left:var(--space--4, 4px);vertical-align:top}.ez-classic-search-plus__error-container{display:flex;flex-grow:1;gap:3px;overflow:hidden}.ez-classic-search-plus__error-container span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-classic-input--helptext-color)}";export{d as ez_classic_search_plus}