@sankhyalabs/ezui 6.3.0-dev.1 → 6.3.0-dev.2

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 (219) hide show
  1. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-card-item_2.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-classic-input.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +2 -2
  18. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-form.cjs.entry.js +2 -2
  29. package/dist/cjs/ez-grid.cjs.entry.js +2 -2
  30. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-list-item.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  42. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-search-plus.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  49. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  50. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  51. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  52. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  53. package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
  54. package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
  55. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  56. package/dist/cjs/ez-tag.cjs.entry.js +1 -1
  57. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  58. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  59. package/dist/cjs/ez-tile-medium.cjs.entry.js +1 -1
  60. package/dist/cjs/ez-tile.cjs.entry.js +1 -1
  61. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  62. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  63. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  64. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  65. package/dist/cjs/ez-underface.cjs.entry.js +1 -1
  66. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  67. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  68. package/dist/cjs/ezui.cjs.js +1 -1
  69. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  70. package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +0 -3
  71. package/dist/cjs/loader.cjs.js +1 -1
  72. package/dist/cjs/{search-column-bc96c0cc.js → search-column-78dd20d5.js} +1 -1
  73. package/dist/esm/ez-actions-button.entry.js +1 -1
  74. package/dist/esm/ez-alert-list.entry.js +1 -1
  75. package/dist/esm/ez-alert.entry.js +1 -1
  76. package/dist/esm/ez-application.entry.js +1 -1
  77. package/dist/esm/ez-avatar.entry.js +1 -1
  78. package/dist/esm/ez-badge.entry.js +1 -1
  79. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  80. package/dist/esm/ez-button.entry.js +1 -1
  81. package/dist/esm/ez-calendar.entry.js +1 -1
  82. package/dist/esm/ez-card-item_2.entry.js +1 -1
  83. package/dist/esm/ez-chart.entry.js +1 -1
  84. package/dist/esm/ez-check.entry.js +1 -1
  85. package/dist/esm/ez-chip.entry.js +1 -1
  86. package/dist/esm/ez-classic-input.entry.js +1 -1
  87. package/dist/esm/ez-classic-text-area.entry.js +1 -1
  88. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  89. package/dist/esm/ez-combo-box-list_4.entry.js +2 -2
  90. package/dist/esm/ez-combo-box.entry.js +1 -1
  91. package/dist/esm/ez-date-input.entry.js +1 -1
  92. package/dist/esm/ez-date-time-input.entry.js +1 -1
  93. package/dist/esm/ez-dialog.entry.js +1 -1
  94. package/dist/esm/ez-double-list.entry.js +1 -1
  95. package/dist/esm/ez-dropdown.entry.js +1 -1
  96. package/dist/esm/ez-empty-card.entry.js +1 -1
  97. package/dist/esm/ez-file-item.entry.js +1 -1
  98. package/dist/esm/ez-filter-input.entry.js +1 -1
  99. package/dist/esm/ez-form-view.entry.js +1 -1
  100. package/dist/esm/ez-form.entry.js +2 -2
  101. package/dist/esm/ez-grid.entry.js +2 -2
  102. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  103. package/dist/esm/ez-icon.entry.js +1 -1
  104. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  105. package/dist/esm/ez-list-item.entry.js +1 -1
  106. package/dist/esm/ez-list.entry.js +1 -1
  107. package/dist/esm/ez-loading-bar.entry.js +1 -1
  108. package/dist/esm/ez-modal-container.entry.js +1 -1
  109. package/dist/esm/ez-modal.entry.js +1 -1
  110. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  111. package/dist/esm/ez-number-input.entry.js +1 -1
  112. package/dist/esm/ez-popover-plus_3.entry.js +1 -1
  113. package/dist/esm/ez-popover.entry.js +1 -1
  114. package/dist/esm/ez-popup.entry.js +1 -1
  115. package/dist/esm/ez-radio-button.entry.js +1 -1
  116. package/dist/esm/ez-rich-toolbar-item.entry.js +1 -1
  117. package/dist/esm/ez-scroller_2.entry.js +1 -1
  118. package/dist/esm/ez-search-plus.entry.js +1 -1
  119. package/dist/esm/ez-search-result-list.entry.js +1 -1
  120. package/dist/esm/ez-search.entry.js +1 -1
  121. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  122. package/dist/esm/ez-skeleton.entry.js +1 -1
  123. package/dist/esm/ez-sortable-list.entry.js +1 -1
  124. package/dist/esm/ez-split-button.entry.js +1 -1
  125. package/dist/esm/ez-split-item.entry.js +1 -1
  126. package/dist/esm/ez-split-panel.entry.js +1 -1
  127. package/dist/esm/ez-tabselector.entry.js +1 -1
  128. package/dist/esm/ez-tag.entry.js +1 -1
  129. package/dist/esm/ez-text-area.entry.js +1 -1
  130. package/dist/esm/ez-text-input.entry.js +1 -1
  131. package/dist/esm/ez-tile-medium.entry.js +1 -1
  132. package/dist/esm/ez-tile.entry.js +1 -1
  133. package/dist/esm/ez-time-input.entry.js +1 -1
  134. package/dist/esm/ez-toast.entry.js +1 -1
  135. package/dist/esm/ez-tooltip.entry.js +1 -1
  136. package/dist/esm/ez-tree.entry.js +1 -1
  137. package/dist/esm/ez-underface.entry.js +1 -1
  138. package/dist/esm/ez-upload.entry.js +1 -1
  139. package/dist/esm/ez-view-stack.entry.js +1 -1
  140. package/dist/esm/ezui.js +2 -2
  141. package/dist/esm/filter-column.entry.js +1 -1
  142. package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +1 -3
  143. package/dist/esm/loader.js +2 -2
  144. package/dist/esm/{search-column-1fae59c6.js → search-column-729f3655.js} +1 -1
  145. package/dist/ezui/ezui.esm.js +1 -1
  146. package/dist/ezui/{p-d0e32d5d.entry.js → p-02e1efa8.entry.js} +1 -1
  147. package/dist/ezui/{p-0302e76e.entry.js → p-0c1a288c.entry.js} +1 -1
  148. package/dist/ezui/{p-87f5a060.entry.js → p-1bcfd88c.entry.js} +1 -1
  149. package/dist/ezui/{p-4cf2fd7b.entry.js → p-1e21d31b.entry.js} +1 -1
  150. package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
  151. package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
  152. package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
  153. package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
  154. package/dist/ezui/{p-dad08031.entry.js → p-24732fea.entry.js} +1 -1
  155. package/dist/ezui/{p-8cdb60dd.entry.js → p-2879c45f.entry.js} +1 -1
  156. package/dist/ezui/{p-06f1b8e4.entry.js → p-288631d1.entry.js} +1 -1
  157. package/dist/ezui/{p-db85939f.entry.js → p-2d080bdc.entry.js} +1 -1
  158. package/dist/ezui/{p-eee5f5cf.entry.js → p-31450a28.entry.js} +1 -1
  159. package/dist/ezui/{p-e564b143.entry.js → p-39b16566.entry.js} +1 -1
  160. package/dist/ezui/{p-54b9c2d4.entry.js → p-3cecb4cb.entry.js} +1 -1
  161. package/dist/ezui/{p-0378416a.entry.js → p-44caad9a.entry.js} +1 -1
  162. package/dist/ezui/{p-f01444ef.entry.js → p-451a17ad.entry.js} +1 -1
  163. package/dist/ezui/{p-570cf58a.entry.js → p-48effc69.entry.js} +1 -1
  164. package/dist/ezui/{p-85a5f05f.entry.js → p-49321ac6.entry.js} +1 -1
  165. package/dist/ezui/{p-8672846a.entry.js → p-4c5cb0da.entry.js} +1 -1
  166. package/dist/ezui/{p-4a876b8b.entry.js → p-4d30b703.entry.js} +1 -1
  167. package/dist/ezui/{p-dc3e6906.entry.js → p-4e6e0740.entry.js} +1 -1
  168. package/dist/ezui/{p-298284d2.entry.js → p-5172793a.entry.js} +1 -1
  169. package/dist/ezui/{p-31dc91b6.entry.js → p-52d9b604.entry.js} +1 -1
  170. package/dist/ezui/{p-7077d357.entry.js → p-53bc30a1.entry.js} +1 -1
  171. package/dist/ezui/{p-e2d8bf5f.entry.js → p-559b915a.entry.js} +1 -1
  172. package/dist/ezui/{p-db1fa372.entry.js → p-5ac7c4b3.entry.js} +1 -1
  173. package/dist/ezui/{p-268f56ba.entry.js → p-5b9060ad.entry.js} +1 -1
  174. package/dist/ezui/{p-5a6cc555.entry.js → p-5dd12c80.entry.js} +1 -1
  175. package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
  176. package/dist/ezui/{p-3234f883.entry.js → p-603ef267.entry.js} +1 -1
  177. package/dist/ezui/{p-92f59952.entry.js → p-60f5483c.entry.js} +1 -1
  178. package/dist/ezui/{p-51e34317.entry.js → p-6369a0cd.entry.js} +1 -1
  179. package/dist/ezui/{p-991105d5.entry.js → p-66b00dec.entry.js} +1 -1
  180. package/dist/ezui/{p-0b531233.entry.js → p-6d596a5a.entry.js} +1 -1
  181. package/dist/ezui/{p-47e0e534.entry.js → p-762a1033.entry.js} +1 -1
  182. package/dist/ezui/{p-ea053063.entry.js → p-79044c3e.entry.js} +1 -1
  183. package/dist/ezui/{p-7f9a2d15.entry.js → p-7aed8d32.entry.js} +1 -1
  184. package/dist/ezui/{p-e195eaad.entry.js → p-7f792043.entry.js} +1 -1
  185. package/dist/ezui/{p-9d73f961.entry.js → p-82fa431b.entry.js} +1 -1
  186. package/dist/ezui/p-86b065e6.entry.js +1 -0
  187. package/dist/ezui/{p-be94d15a.entry.js → p-8afb6e8a.entry.js} +1 -1
  188. package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
  189. package/dist/ezui/{p-78e975b4.entry.js → p-91c9d50e.entry.js} +1 -1
  190. package/dist/ezui/{p-05e68ab3.entry.js → p-93e1c917.entry.js} +1 -1
  191. package/dist/ezui/{p-01970859.entry.js → p-94630d41.entry.js} +1 -1
  192. package/dist/ezui/{p-18e71523.entry.js → p-9c5cd3b2.entry.js} +1 -1
  193. package/dist/ezui/{p-8b717571.js → p-9dc31fc6.js} +1 -1
  194. package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
  195. package/dist/ezui/{p-f26b97e9.entry.js → p-a3ada561.entry.js} +1 -1
  196. package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
  197. package/dist/ezui/{p-49d13416.entry.js → p-b2b1a1a7.entry.js} +1 -1
  198. package/dist/ezui/{p-c5d5b872.entry.js → p-bc22f56d.entry.js} +1 -1
  199. package/dist/ezui/p-bc2f844e.entry.js +1 -0
  200. package/dist/ezui/{p-92748142.entry.js → p-c0d9c4f8.entry.js} +1 -1
  201. package/dist/ezui/{p-a9d366c6.entry.js → p-c2d38fbf.entry.js} +1 -1
  202. package/dist/ezui/{p-c96e536d.entry.js → p-d2645bdf.entry.js} +1 -1
  203. package/dist/ezui/{p-aeef7e9c.entry.js → p-d512cb84.entry.js} +1 -1
  204. package/dist/ezui/{p-a9432878.entry.js → p-d6742c1e.entry.js} +1 -1
  205. package/dist/ezui/{p-2ca29b0f.entry.js → p-d845fa56.entry.js} +1 -1
  206. package/dist/ezui/p-d8cc640d.entry.js +1 -0
  207. package/dist/ezui/{p-73d20de7.entry.js → p-da4419a6.entry.js} +1 -1
  208. package/dist/ezui/{p-934c75e7.entry.js → p-e20ad35d.entry.js} +1 -1
  209. package/dist/ezui/{p-da33812f.entry.js → p-e5e623d9.entry.js} +1 -1
  210. package/dist/ezui/{p-000159dc.entry.js → p-e75c7a23.entry.js} +1 -1
  211. package/dist/ezui/{p-a9dd1606.entry.js → p-e78e87f5.entry.js} +1 -1
  212. package/dist/ezui/{p-e9b409c1.entry.js → p-e7a7c594.entry.js} +1 -1
  213. package/dist/ezui/{p-60f6fa4c.entry.js → p-ec04285e.entry.js} +1 -1
  214. package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
  215. package/dist/ezui/{p-1cebeb65.entry.js → p-fcdc7d0b.entry.js} +1 -1
  216. package/package.json +1 -1
  217. package/dist/ezui/p-14d6aeb8.entry.js +0 -1
  218. package/dist/ezui/p-32f9df45.entry.js +0 -1
  219. package/dist/ezui/p-6ec40dec.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as r,g as s}from"./p-e4c7eb39.js";import{StringUtils as a,KeyboardManager as o,ElementIDUtils as l}from"@sankhyalabs/core";import"./p-7e5c7b4c.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as h}from"./p-af47458b.js";import{S as c}from"./p-30ffb9ed.js";const d=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.SEARCH_DESCRIPTION_TIMEOUT=300,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,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){const i=this.normalizeValueToCodeValue(e);if(i!==this.normalizeValueToCodeValue(t)){if(void 0===i)return this.codeValue=void 0,this.descriptionValue=void 0,void this.ezChange.emit(void 0);this.codeValue=i;try{if(this.descriptionValue=await this.normalizeCodeToDescriptionValue(e),null==this.descriptionValue)throw new Error("Valor não encontrado!")}catch(e){throw this.value=void 0,console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",e),e}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value)}}canShowLoadSpinDescription(){return this.isLoadingDescription}async setFocus(e){var t;this.disableCodeInput?null===(t=this._textInputDescriptionValue)||void 0===t||t.setFocus(e):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(e):this._textInputCodeValue.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 h(),this.value&&a.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInputCodeValue),n.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this.value=null,this.descriptionValue=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?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:c.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:c.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:c.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"]}}};d.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{d as ez_search_plus}
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"./p-7e5c7b4c.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as h}from"./p-af47458b.js";import{S as c}from"./p-30ffb9ed.js";const d=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.SEARCH_DESCRIPTION_TIMEOUT=300,this.INTERVAL_TO_RETRY_ASYNC_VALUE=100,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){const i=this.normalizeValueToCodeValue(e);if(i!==this.normalizeValueToCodeValue(t)){if(void 0===i)return this.codeValue=void 0,this.descriptionValue=void 0,void this.ezChange.emit(void 0);this.codeValue=i;try{if(this.descriptionValue=await this.normalizeCodeToDescriptionValue(e),null==this.descriptionValue)throw new Error("Valor não encontrado!")}catch(e){throw this.value=void 0,console.warn("[EzSearchPlus] Erro ao obter descrição do registro.",e),e}this.value=this.buildCurrentValue(),this.ezChange.emit(this.value)}}canShowLoadSpinDescription(){return this.isLoadingDescription}async setFocus(e){var t;this.disableCodeInput?null===(t=this._textInputDescriptionValue)||void 0===t||t.setFocus(e):this._latestFocusedInputElement?this._latestFocusedInputElement.setFocus(e):this._textInputCodeValue.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 h(),this.value&&a.isEmpty(this.codeValue)&&await this.observeValue(this.value,void 0)}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInputCodeValue),n.applyVarsTextInput(this.el,this._textInputDescriptionValue)}connectedCallback(){this.initKeyboardManager(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}clearSearch(){this.value=null,this.descriptionValue=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?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:c.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:c.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:c.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"]}}};d.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{d as ez_search_plus}
@@ -1 +1 @@
1
- import{r as e,c as o,h as i,H as r,g as t}from"./p-e4c7eb39.js";import{ElementIDUtils as l}from"@sankhyalabs/core";const c=class{constructor(i){e(this,i),this.tileClick=o(this,"tileClick",7),this.text=void 0,this.size="small",this.height=void 0,this.width=void 0,this.color="default",this.iconName="home",this.maximumLines=void 0,this.isInteractive=!1}async setFocus(){this._container.focus()}async setBlur(){this._container.blur()}clickListener(e){this.isInteractive||e.stopImmediatePropagation()}handleClick(){this.isInteractive&&this.tileClick.emit()}componentDidRender(){this._element&&l.addIDInfo(this._element),this._container&&l.addIDInfo(this._container,"tile-button",{id:"embedded"})}render(){const e=Object.assign(Object.assign(Object.assign({},this.height?{"--ez-tile--custom-height":`${this.height}px`}:{}),this.width?{"--ez-tile--custom-width":`${this.width}px`}:{}),this.maximumLines?{"--ez-tile--custom-maximum-lines":`${this.maximumLines}`}:{});return i(r,{style:e},i("button",{ref:e=>this._container=e,class:`${this.color} ${this.size} ${this.isInteractive?"isInteractive":""}`,onClick:()=>this.handleClick()},i("ez-icon",{class:"icon",iconName:this.iconName,size:"large"}),i("span",{title:this.text},this.text)))}get _element(){return t(this)}};c.style=":host{--ez-tile--width:120px;--ez-tile--height:80px;--ez-tile--padding:var(--space--12, 12px);--ez-tile--icon--margin-bottom:var(--space--8);--ez-tile--border-radius:var(--border--radius-16, 16px);--ez-tile--background-color:var(--color--gray-70, #ffffff);--ez-tile--color:var(--color--ocean-green-900, #003D2D);--ez-tile--icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile--hover-background-color:var(--color--gray-80, #F9F9F9);--ez-tile--hover-color:var(--color--ocean-green-900, #003D2D);--ez-tile--hover-icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile--focus-visible-border:2px solid var(--color--petroleum-400, #626D80);--ez-tile--font-family:var(--font-pattern, Arial);--ez-tile--font-weight:var(--font-weight--regular, 400);--ez-tile--font-size:var(--font-size--default, 14px);--ez-tile--title-line-height:var(--line-height--20, 20px);--ez-tile--icon-line-height:var(--line-height--24, 24px)}button{display:flex;flex-wrap:wrap;align-content:space-between;overflow:hidden;outline:none;box-shadow:none;width:var(--ez-tile--custom-width, var(--ez-tile--width));height:var(--ez-tile--custom-height, var(--ez-tile--height));border-radius:var(--ez-tile--border-radius);background-color:var(--ez-tile--background-color);color:var(--ez-tile--color);box-sizing:border-box;padding:var(--ez-tile--padding);border:2px solid var(--ez-tile--background-color)}button:focus-visible{border:var(--ez-tile--focus-visible-border)}.medium{--ez-tile--width:var(--ez-tile--custom-width, 120px);--ez-tile--height:var(--ez-tile--custom-height, 170px)}.isInteractive:hover,.isInteractive:focus{--ez-icon--color:var(--ez-tile--hover-icon-color);--ez-tile--background-color:var(--ez-tile--hover-background-color);--ez-tile--color:var(--ez-tile--hover-color);cursor:pointer}span{-webkit-line-clamp:var(--ez-tile--custom-maximum-lines, 1);line-clamp:var(--ez-tile--custom-maximum-lines,1);font-family:var(--ez-tile--font-family);font-weight:var(--ez-tile--font-weight);font-size:var(--ez-tile--font-size);line-height:var(--ez-tile--title-line-height);display:-webkit-box;-webkit-box-orient:vertical;width:100%;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:pre-wrap}ez-icon{--ez-icon--color:var(--ez-tile--icon-color);margin-bottom:var(--ez-tile--icon--margin-bottom);line-height:var(--ez-tile--icon-line-height)}.isInteractive:hover,.isInteractive:focus{outline:none}.green{--ez-tile--background-color:var(--color--ocean-green-90);--ez-tile--icon-color:var(--color--ocean-green-500)}.isInteractive.green:hover,.isInteractive.green:focus{--ez-tile--hover-background-color:var(--color--ocean-green-100);--ez-tile--icon-color:var(--color--ocean-green-500);outline:none}.gray{--ez-tile--background-color:var(--color--gray-80);--ez-tile--icon-color:var(--color--ocean-green-400)}.isInteractive.gray:hover,.isInteractive.gray:focus{--ez-tile--hover-background-color:var(--color--gray-90);--ez-tile--hover-icon-color:var(--color--ocean-green-400)}.red{--ez-tile--background-color:var(--color--red-100);--ez-tile--icon-color:var(--color--red-300)}.isInteractive.red:hover,.isInteractive.red:focus{--ez-tile--hover-background-color:var(--color--red-200);--ez-tile--hover-icon-color:var(--color--red-300)}.yellow{--ez-tile--background-color:var(--color--yellow-100);--ez-tile--icon-color:var(--color--yellow-400)}.isInteractive.yellow:hover,.isInteractive.yellow:focus{--ez-tile--hover-background-color:var(--color--yellow-200);--ez-tile--hover-icon-color:var(--color--yellow-400)}";export{c as ez_tile}
1
+ import{r as e,c as o,h as i,H as r,g as t}from"./p-23a36bb6.js";import{ElementIDUtils as l}from"@sankhyalabs/core";const c=class{constructor(i){e(this,i),this.tileClick=o(this,"tileClick",7),this.text=void 0,this.size="small",this.height=void 0,this.width=void 0,this.color="default",this.iconName="home",this.maximumLines=void 0,this.isInteractive=!1}async setFocus(){this._container.focus()}async setBlur(){this._container.blur()}clickListener(e){this.isInteractive||e.stopImmediatePropagation()}handleClick(){this.isInteractive&&this.tileClick.emit()}componentDidRender(){this._element&&l.addIDInfo(this._element),this._container&&l.addIDInfo(this._container,"tile-button",{id:"embedded"})}render(){const e=Object.assign(Object.assign(Object.assign({},this.height?{"--ez-tile--custom-height":`${this.height}px`}:{}),this.width?{"--ez-tile--custom-width":`${this.width}px`}:{}),this.maximumLines?{"--ez-tile--custom-maximum-lines":`${this.maximumLines}`}:{});return i(r,{style:e},i("button",{ref:e=>this._container=e,class:`${this.color} ${this.size} ${this.isInteractive?"isInteractive":""}`,onClick:()=>this.handleClick()},i("ez-icon",{class:"icon",iconName:this.iconName,size:"large"}),i("span",{title:this.text},this.text)))}get _element(){return t(this)}};c.style=":host{--ez-tile--width:120px;--ez-tile--height:80px;--ez-tile--padding:var(--space--12, 12px);--ez-tile--icon--margin-bottom:var(--space--8);--ez-tile--border-radius:var(--border--radius-16, 16px);--ez-tile--background-color:var(--color--gray-70, #ffffff);--ez-tile--color:var(--color--ocean-green-900, #003D2D);--ez-tile--icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile--hover-background-color:var(--color--gray-80, #F9F9F9);--ez-tile--hover-color:var(--color--ocean-green-900, #003D2D);--ez-tile--hover-icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile--focus-visible-border:2px solid var(--color--petroleum-400, #626D80);--ez-tile--font-family:var(--font-pattern, Arial);--ez-tile--font-weight:var(--font-weight--regular, 400);--ez-tile--font-size:var(--font-size--default, 14px);--ez-tile--title-line-height:var(--line-height--20, 20px);--ez-tile--icon-line-height:var(--line-height--24, 24px)}button{display:flex;flex-wrap:wrap;align-content:space-between;overflow:hidden;outline:none;box-shadow:none;width:var(--ez-tile--custom-width, var(--ez-tile--width));height:var(--ez-tile--custom-height, var(--ez-tile--height));border-radius:var(--ez-tile--border-radius);background-color:var(--ez-tile--background-color);color:var(--ez-tile--color);box-sizing:border-box;padding:var(--ez-tile--padding);border:2px solid var(--ez-tile--background-color)}button:focus-visible{border:var(--ez-tile--focus-visible-border)}.medium{--ez-tile--width:var(--ez-tile--custom-width, 120px);--ez-tile--height:var(--ez-tile--custom-height, 170px)}.isInteractive:hover,.isInteractive:focus{--ez-icon--color:var(--ez-tile--hover-icon-color);--ez-tile--background-color:var(--ez-tile--hover-background-color);--ez-tile--color:var(--ez-tile--hover-color);cursor:pointer}span{-webkit-line-clamp:var(--ez-tile--custom-maximum-lines, 1);line-clamp:var(--ez-tile--custom-maximum-lines,1);font-family:var(--ez-tile--font-family);font-weight:var(--ez-tile--font-weight);font-size:var(--ez-tile--font-size);line-height:var(--ez-tile--title-line-height);display:-webkit-box;-webkit-box-orient:vertical;width:100%;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:pre-wrap}ez-icon{--ez-icon--color:var(--ez-tile--icon-color);margin-bottom:var(--ez-tile--icon--margin-bottom);line-height:var(--ez-tile--icon-line-height)}.isInteractive:hover,.isInteractive:focus{outline:none}.green{--ez-tile--background-color:var(--color--ocean-green-90);--ez-tile--icon-color:var(--color--ocean-green-500)}.isInteractive.green:hover,.isInteractive.green:focus{--ez-tile--hover-background-color:var(--color--ocean-green-100);--ez-tile--icon-color:var(--color--ocean-green-500);outline:none}.gray{--ez-tile--background-color:var(--color--gray-80);--ez-tile--icon-color:var(--color--ocean-green-400)}.isInteractive.gray:hover,.isInteractive.gray:focus{--ez-tile--hover-background-color:var(--color--gray-90);--ez-tile--hover-icon-color:var(--color--ocean-green-400)}.red{--ez-tile--background-color:var(--color--red-100);--ez-tile--icon-color:var(--color--red-300)}.isInteractive.red:hover,.isInteractive.red:focus{--ez-tile--hover-background-color:var(--color--red-200);--ez-tile--hover-icon-color:var(--color--red-300)}.yellow{--ez-tile--background-color:var(--color--yellow-100);--ez-tile--icon-color:var(--color--yellow-400)}.isInteractive.yellow:hover,.isInteractive.yellow:focus{--ez-tile--hover-background-color:var(--color--yellow-200);--ez-tile--hover-icon-color:var(--color--yellow-400)}";export{c as ez_tile}
@@ -1 +1 @@
1
- import{r as e,c as i,h as a,H as t,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as s}from"@sankhyalabs/core";import{E as n}from"./p-98bb8b16.js";import{i as o}from"./p-af47458b.js";const d=class{constructor(a){e(this,a),this.ezSelectionChange=i(this,"ezSelectionChange",7),this.open=!0,this.selectedId=void 0,this.items=[],this.tooltipResolver=void 0,this.filterText=""}async disableItem(e){[].concat(e).forEach((e=>this._tree.disableItem(e)))}async openGuideNavidator(){this.open=!0}async enableItem(e){[].concat(e).forEach((e=>this._tree.enableItem(e)))}async updateItem(e){[].concat(e).forEach((e=>this._tree.updateItem(e)))}async getItem(e){return this._tree.getItem(e)}async getCurrentPath(){var e;return null===(e=this._tree)||void 0===e?void 0:e.getCurrentPath()}async selectGuide(e){null!=this._tree&&null!=e&&(this._tree.selectItem(e),this.getCurrentPath().then((e=>{null==e||e.forEach((e=>{this._tree.openItem(e.id)}))})))}async getParent(e){return this._tree.getParent(e)}async componentWillLoad(){this.i18n=await o()}async handleToggleSidebar(){this.open=!this.open}handleFilterTree(e){"Enter"===e.key&&this._tree.applyFilter(this.filterText)}onFilterChanged(e){this.filterText=e.detail,e.stopPropagation()}render(){return s.addIDInfoIfNotExists(this._element),a(t,null,a("ez-sidebar-button",{class:this.open?"hidden":"",onEzClick:this.handleToggleSidebar.bind(this),"aria-controls":"navigator","aria-expanded":this.open,"data-element-id":s.getInternalIDInfo("openButton")}),a("aside",{tabIndex:-1,id:"navigator",class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-guide-navigator "+(this.open?"":"hidden"),"data-element-id":s.getInternalIDInfo("sidebar")},a("div",{role:"search",class:"ez-guide-navigator__actions"},a("ez-filter-input",{mode:"slim",value:this.filterText,onEzChange:e=>this.onFilterChanged(e),label:this.i18n("ez-guide-navigator.searchGuide"),"aria-placeholder":this.i18n("ez-guide-navigator.searchGuide"),onKeyUp:this.handleFilterTree.bind(this),"data-element-id":s.getInternalIDInfo("textinput")}),a("ez-button",{onClick:this.handleToggleSidebar.bind(this),class:"inverted",mode:"icon",size:"small",iconName:"show_menu",title:this.i18n("ez-guide-navigator.hideMenu"),"aria-label":this.i18n("ez-guide-navigator.hideMenu"),"aria-controls":"navigator","data-element-id":s.getInternalIDInfo("closeButton")})),a("ez-scroller",{direction:n.VERTICAL,activeShadow:!0},a("ez-tree",{ref:e=>this._tree=e,items:this.items,"data-element-id":s.getInternalIDInfo("tree"),tooltipResolver:this.tooltipResolver,onEzChange:e=>this.ezSelectionChange.emit(e.detail),selectedId:this.selectedId}))))}get _element(){return r(this)}};d.style=":host{--ez-guide-navigator--padding-left:var(--space--large);--ez-guide-navigator--padding-right:var(--space--small);--ez-guide-navigator--box-shadow:var(--shadow, 0px 0px 24px 0px #000);--ez-guide-navigator--background-color:var(--color--inverted);--ez-guide-navigator--border-radius:0px var(--border--radius-medium) var(--border--radius-medium) 0px;--ez-guide-navigator--actions-gap:var(--space--medium);--ez-guide-navigator--actions-margin:var(--space--large) 0 var(--space--medium);--ez-guide-navigator--actions-padding-right:calc(var(--space--medium, 12px) + var(--space--small, 6px))}.inverted{transform:rotate(180deg)}.ez-guide-navigator{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;padding-left:var(--ez-guide-navigator--padding-left);padding-right:var(--ez-guide-navigator--padding-right);background-color:var(--ez-guide-navigator--background-color);-webkit-box-shadow:var(--ez-guide-navigator--box-shadow);box-shadow:var(--ez-guide-navigator--box-shadow);border-radius:var(--ez-guide-navigator--border-radius)}.ez-guide-navigator__actions{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--ez-guide-navigator--actions-gap);margin:var(--ez-guide-navigator--actions-margin);padding-right:var(--ez-guide-navigator--actions-padding-right)}.hidden{display:none}";export{d as ez_guide_navigator}
1
+ import{r as e,c as i,h as a,H as t,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as s}from"@sankhyalabs/core";import{E as n}from"./p-98bb8b16.js";import{i as o}from"./p-af47458b.js";const d=class{constructor(a){e(this,a),this.ezSelectionChange=i(this,"ezSelectionChange",7),this.open=!0,this.selectedId=void 0,this.items=[],this.tooltipResolver=void 0,this.filterText=""}async disableItem(e){[].concat(e).forEach((e=>this._tree.disableItem(e)))}async openGuideNavidator(){this.open=!0}async enableItem(e){[].concat(e).forEach((e=>this._tree.enableItem(e)))}async updateItem(e){[].concat(e).forEach((e=>this._tree.updateItem(e)))}async getItem(e){return this._tree.getItem(e)}async getCurrentPath(){var e;return null===(e=this._tree)||void 0===e?void 0:e.getCurrentPath()}async selectGuide(e){null!=this._tree&&null!=e&&(this._tree.selectItem(e),this.getCurrentPath().then((e=>{null==e||e.forEach((e=>{this._tree.openItem(e.id)}))})))}async getParent(e){return this._tree.getParent(e)}async componentWillLoad(){this.i18n=await o()}async handleToggleSidebar(){this.open=!this.open}handleFilterTree(e){"Enter"===e.key&&this._tree.applyFilter(this.filterText)}onFilterChanged(e){this.filterText=e.detail,e.stopPropagation()}render(){return s.addIDInfoIfNotExists(this._element),a(t,null,a("ez-sidebar-button",{class:this.open?"hidden":"",onEzClick:this.handleToggleSidebar.bind(this),"aria-controls":"navigator","aria-expanded":this.open,"data-element-id":s.getInternalIDInfo("openButton")}),a("aside",{tabIndex:-1,id:"navigator",class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-guide-navigator "+(this.open?"":"hidden"),"data-element-id":s.getInternalIDInfo("sidebar")},a("div",{role:"search",class:"ez-guide-navigator__actions"},a("ez-filter-input",{mode:"slim",value:this.filterText,onEzChange:e=>this.onFilterChanged(e),label:this.i18n("ez-guide-navigator.searchGuide"),"aria-placeholder":this.i18n("ez-guide-navigator.searchGuide"),onKeyUp:this.handleFilterTree.bind(this),"data-element-id":s.getInternalIDInfo("textinput")}),a("ez-button",{onClick:this.handleToggleSidebar.bind(this),class:"inverted",mode:"icon",size:"small",iconName:"show_menu",title:this.i18n("ez-guide-navigator.hideMenu"),"aria-label":this.i18n("ez-guide-navigator.hideMenu"),"aria-controls":"navigator","data-element-id":s.getInternalIDInfo("closeButton")})),a("ez-scroller",{direction:n.VERTICAL,activeShadow:!0},a("ez-tree",{ref:e=>this._tree=e,items:this.items,"data-element-id":s.getInternalIDInfo("tree"),tooltipResolver:this.tooltipResolver,onEzChange:e=>this.ezSelectionChange.emit(e.detail),selectedId:this.selectedId}))))}get _element(){return r(this)}};d.style=":host{--ez-guide-navigator--padding-left:var(--space--large);--ez-guide-navigator--padding-right:var(--space--small);--ez-guide-navigator--box-shadow:var(--shadow, 0px 0px 24px 0px #000);--ez-guide-navigator--background-color:var(--color--inverted);--ez-guide-navigator--border-radius:0px var(--border--radius-medium) var(--border--radius-medium) 0px;--ez-guide-navigator--actions-gap:var(--space--medium);--ez-guide-navigator--actions-margin:var(--space--large) 0 var(--space--medium);--ez-guide-navigator--actions-padding-right:calc(var(--space--medium, 12px) + var(--space--small, 6px))}.inverted{transform:rotate(180deg)}.ez-guide-navigator{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;padding-left:var(--ez-guide-navigator--padding-left);padding-right:var(--ez-guide-navigator--padding-right);background-color:var(--ez-guide-navigator--background-color);-webkit-box-shadow:var(--ez-guide-navigator--box-shadow);box-shadow:var(--ez-guide-navigator--box-shadow);border-radius:var(--ez-guide-navigator--border-radius)}.ez-guide-navigator__actions{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--ez-guide-navigator--actions-gap);margin:var(--ez-guide-navigator--actions-margin);padding-right:var(--ez-guide-navigator--actions-padding-right)}.hidden{display:none}";export{d as ez_guide_navigator}
@@ -1 +1 @@
1
- import{r as t,h as o,H as s,g as i}from"./p-e4c7eb39.js";import{c as e,o as r,f as a,s as l,a as n}from"./p-e07e4671.js";import{ElementIDUtils as h}from"@sankhyalabs/core";const c=class{constructor(o){t(this,o),this._opened=!1,this.message=void 0,this.anchoringElement=void 0,this.placement="bottom",this.gapOptions={horizontalGap:0,verticalGap:0},this.type="default",this.debouncingTime=500,this.active=!0,this.maxWidth=200,this.useAnchorSize=!1}watchAnchoringElement(t,o){t&&(this.setEvents(t),this.removeEvents(o))}watchMessage(t){t?this.updatePosition():this.closeTooltip()}openTooltip(){this.message&&this.active&&(this._debouncingTimeout&&clearTimeout(this._debouncingTimeout),this._debouncingTimeout=setTimeout((()=>{this._opened=!0,this._tooltipElement.style.display="block",this.updatePosition()}),this.debouncingTime))}closeTooltip(){clearTimeout(this._debouncingTimeout),this._tooltipElement.style.display="none",this._opened=!1}async updatePosition(t=this.anchoringElement){if(t&&this._opened){if(this.useAnchorSize){const o=t.getBoundingClientRect().width;this._tooltipElement.style.width=`${o}px`}await e(t,this._tooltipElement,{placement:this.placement,middleware:[r(5),a(),l(),n({element:this._arrowElement})]}).then((({x:t,y:o,placement:s,middlewareData:i})=>{const e=s.includes("bottom")?o+this.gapOptions.verticalGap:o-this.gapOptions.verticalGap,r=s.includes("start")?t+this.gapOptions.horizontalGap:t-this.gapOptions.horizontalGap;if(Object.assign(this._tooltipElement.style,{top:`${e}px`,left:`${r}px`}),i.arrow){const{x:t}=i.arrow,o=s.includes("bottom");Object.assign(this._arrowElement.style,{left:`${t}px`,top:o?-this._arrowElement.offsetHeight/2+"px":"",bottom:o?"":-this._arrowElement.offsetHeight/2+"px"})}}))}}handleSlotChange(t){const o=t.target.assignedElements()[0];this.anchoringElement=o}setEvents(t=this.anchoringElement){t&&(t.addEventListener("mouseenter",(()=>{this.openTooltip()})),t.addEventListener("mouseleave",(()=>{this.closeTooltip()})))}removeEvents(t=this.anchoringElement){t&&(t.removeEventListener("mouseenter",(()=>{this.openTooltip()})),t.removeEventListener("mouseleave",(()=>{this.closeTooltip()})))}componentDidLoad(){this.setEvents()}render(){return o(s,null,o("div",Object.assign({ref:t=>this._tooltipElement=t},{inert:!0},{class:{tooltip:!0,[`${this.type}-tooltip`]:!0},style:{maxWidth:this.maxWidth&&!this.useAnchorSize?`${this.maxWidth}px`:void 0},role:"tooltip","data-element-id":h.getInternalIDInfo("tooltip")}),this.message,o("div",{ref:t=>this._arrowElement=t,class:"arrow"})),o("slot",{onSlotchange:t=>{this.handleSlotChange(t)}}))}get _element(){return i(this)}static get watchers(){return{anchoringElement:["watchAnchoringElement"],message:["watchMessage"]}}};c.style=":host{--triangle-size:8px;width:100%}.tooltip{position:absolute;z-index:var(--elevation--24);padding:var(--space--extra-small, 3px) var(--space--small, 6px);border-radius:var(--border--radius-small);box-sizing:border-box;font-family:var(--font-pattern\t, 'Roboto', sans-serif);font-size:var(--text--small, 12px);font-weight:var(--text-weight--medium, 400);text-align:center;width:max-content;display:none}.arrow{position:absolute;width:var(--triangle-size);height:var(--triangle-size);transform:rotate(45deg)}.default-tooltip{background:var(--title--primary, #2b3a54);color:var(--color--inverted)}.default-tooltip .arrow{background:var(--title--primary, #2b3a54)}.error-tooltip{background:var(--color-alert--error-800, #BD0025);color:var(--color--error-200, #F7E0E5)}.error-tooltip .arrow{background:var(--color-alert--error-800, #BD0025)}.success-tooltip{background:var(--color--success, #00cb94);color:var(--color--success-200, #EBFFFA)}.success-tooltip .arrow{background:var(--color--success, #00cb94)}.warning-tooltip{background:var(--color--warning, #f2d410);color:var(--color--warning-200, #FDF8D8)}.warning-tooltip .arrow{background:var(--color--warning, #f2d410)}";export{c as ez_tooltip}
1
+ import{r as t,h as o,H as s,g as i}from"./p-23a36bb6.js";import{c as r,o as e,f as a,s as l,a as n}from"./p-e07e4671.js";import{ElementIDUtils as h}from"@sankhyalabs/core";const c=class{constructor(o){t(this,o),this._opened=!1,this.message=void 0,this.anchoringElement=void 0,this.placement="bottom",this.gapOptions={horizontalGap:0,verticalGap:0},this.type="default",this.debouncingTime=500,this.active=!0,this.maxWidth=200,this.useAnchorSize=!1}watchAnchoringElement(t,o){t&&(this.setEvents(t),this.removeEvents(o))}watchMessage(t){t?this.updatePosition():this.closeTooltip()}openTooltip(){this.message&&this.active&&(this._debouncingTimeout&&clearTimeout(this._debouncingTimeout),this._debouncingTimeout=setTimeout((()=>{this._opened=!0,this._tooltipElement.style.display="block",this.updatePosition()}),this.debouncingTime))}closeTooltip(){clearTimeout(this._debouncingTimeout),this._tooltipElement.style.display="none",this._opened=!1}async updatePosition(t=this.anchoringElement){if(t&&this._opened){if(this.useAnchorSize){const o=t.getBoundingClientRect().width;this._tooltipElement.style.width=`${o}px`}await r(t,this._tooltipElement,{placement:this.placement,middleware:[e(5),a(),l(),n({element:this._arrowElement})]}).then((({x:t,y:o,placement:s,middlewareData:i})=>{const r=s.includes("bottom")?o+this.gapOptions.verticalGap:o-this.gapOptions.verticalGap,e=s.includes("start")?t+this.gapOptions.horizontalGap:t-this.gapOptions.horizontalGap;if(Object.assign(this._tooltipElement.style,{top:`${r}px`,left:`${e}px`}),i.arrow){const{x:t}=i.arrow,o=s.includes("bottom");Object.assign(this._arrowElement.style,{left:`${t}px`,top:o?-this._arrowElement.offsetHeight/2+"px":"",bottom:o?"":-this._arrowElement.offsetHeight/2+"px"})}}))}}handleSlotChange(t){const o=t.target.assignedElements()[0];this.anchoringElement=o}setEvents(t=this.anchoringElement){t&&(t.addEventListener("mouseenter",(()=>{this.openTooltip()})),t.addEventListener("mouseleave",(()=>{this.closeTooltip()})))}removeEvents(t=this.anchoringElement){t&&(t.removeEventListener("mouseenter",(()=>{this.openTooltip()})),t.removeEventListener("mouseleave",(()=>{this.closeTooltip()})))}componentDidLoad(){this.setEvents()}render(){return o(s,null,o("div",Object.assign({ref:t=>this._tooltipElement=t},{inert:!0},{class:{tooltip:!0,[`${this.type}-tooltip`]:!0},style:{maxWidth:this.maxWidth&&!this.useAnchorSize?`${this.maxWidth}px`:void 0},role:"tooltip","data-element-id":h.getInternalIDInfo("tooltip")}),this.message,o("div",{ref:t=>this._arrowElement=t,class:"arrow"})),o("slot",{onSlotchange:t=>{this.handleSlotChange(t)}}))}get _element(){return i(this)}static get watchers(){return{anchoringElement:["watchAnchoringElement"],message:["watchMessage"]}}};c.style=":host{--triangle-size:8px;width:100%}.tooltip{position:absolute;z-index:var(--elevation--24);padding:var(--space--extra-small, 3px) var(--space--small, 6px);border-radius:var(--border--radius-small);box-sizing:border-box;font-family:var(--font-pattern\t, 'Roboto', sans-serif);font-size:var(--text--small, 12px);font-weight:var(--text-weight--medium, 400);text-align:center;width:max-content;display:none}.arrow{position:absolute;width:var(--triangle-size);height:var(--triangle-size);transform:rotate(45deg)}.default-tooltip{background:var(--title--primary, #2b3a54);color:var(--color--inverted)}.default-tooltip .arrow{background:var(--title--primary, #2b3a54)}.error-tooltip{background:var(--color-alert--error-800, #BD0025);color:var(--color--error-200, #F7E0E5)}.error-tooltip .arrow{background:var(--color-alert--error-800, #BD0025)}.success-tooltip{background:var(--color--success, #00cb94);color:var(--color--success-200, #EBFFFA)}.success-tooltip .arrow{background:var(--color--success, #00cb94)}.warning-tooltip{background:var(--color--warning, #f2d410);color:var(--color--warning-200, #FDF8D8)}.warning-tooltip .arrow{background:var(--color--warning, #f2d410)}";export{c as ez_tooltip}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,g as e}from"./p-e4c7eb39.js";import{NumberUtils as h,StringUtils as r,ElementIDUtils as n}from"@sankhyalabs/core";import{C as a}from"./p-ec7db713.js";import{i as o}from"./p-af47458b.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._focused=!1,this._changePending=!1,this._valuePromiseCallbacks=[],this._value=void 0,this.label=void 0,this.value=void 0,this.enabled=!0,this.canShowError=!0,this.errorMessage=void 0,this.allowNegative=!0,this.precision=void 0,this.prettyPrecision=void 0,this.mode="regular",this.autoFocus=!1,this.alternativePlaceholder=void 0}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)}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){this._textInput&&t!=i&&this.handleNewValue(t,i),this._changePending=!1}observePrecision(){this._textInput&&this.setInputValue()}handleNewValue(t,i){const s=this.validateValue(t),e=this.validateValue(i);if(null===s&&(this._value=""),s===e)return;const h=this.getTextValue(s)||"",r=this.getParsedNumber(h);(this._value||"")===h||void 0===r&&this._focused||(this._value=h,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===s?void 0:s)}validateValue(t){return isNaN(t)||void 0===t?null:t}getTextValue(t){if(null==t)return;let i=this.precision>=0?h.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString();return 0===this.precision?r.replaceAll(i,".",""):i}changeValue(t){this.errorMessage="",this.value!=t?this.value=void 0===t?null:t:(this.setInputValue(),this.ezCancelWaitingChange.emit())}setError(t){this.value=null,this.errorMessage=t,this.ezCancelWaitingChange.emit()}handleBlur(){if(this._changePending)try{const t=this.getParsedNumber();if(void 0!==t&&isNaN(t))this.setError(this.i18n("ez-number-input.invalidNumber"));else try{this.changeValue(t)}catch(t){return void this.setError(t.message)}}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}handleInput(){this.getParsedNumber()!==this.value&&(this._focused=!0,this._changePending=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1}))}getParsedNumber(t=this._textInput.value){return(null==t?void 0:t.trim())?h.stringToNumber(t):void 0}setInputValue(){const t=this.getTextValue(this.value)||"";(this._value||"")!==t&&(this._value=t,this._textInput.value=this._value)}async componentWillLoad(){this.i18n=await o()}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){n.addIDInfoIfNotExists(this._elem,"input");let t=this.precision>0?"0123456789,.":"0123456789";return this.allowNegative&&(t+="-"),s("ez-text-input",{class:"number__input","data-element-id":n.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),restrict:t,enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError,value:this._value,alternativePlaceholder:this.alternativePlaceholder})}get _elem(){return e(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"],precision:["observePrecision"],prettyPrecision:["observePrecision"]}}};l.style=":host{--ez-number-input__min-width:0px;--ez-number-input__max-width:100%;display:block;width:100%}.number__input{height:100%;min-width:var(--ez-number-input__min-width);max-width:var(--ez-number-input__max-width)}";export{l as ez_number_input}
1
+ import{r as t,c as i,h as s,g as e}from"./p-23a36bb6.js";import{NumberUtils as h,StringUtils as r,ElementIDUtils as n}from"@sankhyalabs/core";import{C as a}from"./p-ec7db713.js";import{i as o}from"./p-af47458b.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._focused=!1,this._changePending=!1,this._valuePromiseCallbacks=[],this._value=void 0,this.label=void 0,this.value=void 0,this.enabled=!0,this.canShowError=!0,this.errorMessage=void 0,this.allowNegative=!0,this.precision=void 0,this.prettyPrecision=void 0,this.mode="regular",this.autoFocus=!1,this.alternativePlaceholder=void 0}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)}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){this._textInput&&t!=i&&this.handleNewValue(t,i),this._changePending=!1}observePrecision(){this._textInput&&this.setInputValue()}handleNewValue(t,i){const s=this.validateValue(t),e=this.validateValue(i);if(null===s&&(this._value=""),s===e)return;const h=this.getTextValue(s)||"",r=this.getParsedNumber(h);(this._value||"")===h||void 0===r&&this._focused||(this._value=h,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===s?void 0:s)}validateValue(t){return isNaN(t)||void 0===t?null:t}getTextValue(t){if(null==t)return;let i=this.precision>=0?h.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString();return 0===this.precision?r.replaceAll(i,".",""):i}changeValue(t){this.errorMessage="",this.value!=t?this.value=void 0===t?null:t:(this.setInputValue(),this.ezCancelWaitingChange.emit())}setError(t){this.value=null,this.errorMessage=t,this.ezCancelWaitingChange.emit()}handleBlur(){if(this._changePending)try{const t=this.getParsedNumber();if(void 0!==t&&isNaN(t))this.setError(this.i18n("ez-number-input.invalidNumber"));else try{this.changeValue(t)}catch(t){return void this.setError(t.message)}}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}handleInput(){this.getParsedNumber()!==this.value&&(this._focused=!0,this._changePending=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1}))}getParsedNumber(t=this._textInput.value){return(null==t?void 0:t.trim())?h.stringToNumber(t):void 0}setInputValue(){const t=this.getTextValue(this.value)||"";(this._value||"")!==t&&(this._value=t,this._textInput.value=this._value)}async componentWillLoad(){this.i18n=await o()}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){n.addIDInfoIfNotExists(this._elem,"input");let t=this.precision>0?"0123456789,.":"0123456789";return this.allowNegative&&(t+="-"),s("ez-text-input",{class:"number__input","data-element-id":n.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),restrict:t,enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError,value:this._value,alternativePlaceholder:this.alternativePlaceholder})}get _elem(){return e(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"],precision:["observePrecision"],prettyPrecision:["observePrecision"]}}};l.style=":host{--ez-number-input__min-width:0px;--ez-number-input__max-width:100%;display:block;width:100%}.number__input{height:100%;min-width:var(--ez-number-input__min-width);max-width:var(--ez-number-input__max-width)}";export{l as ez_number_input}
@@ -1 +1 @@
1
- import{r as e,c as r,h as o,H as c,g as a}from"./p-e4c7eb39.js";import{ElementIDUtils as i}from"@sankhyalabs/core";import{C as t}from"./p-b853763b.js";const d=class{constructor(o){e(this,o),this.ezChange=r(this,"ezChange",7),this.label=void 0,this.alternativePlaceholder=void 0,this.value=void 0,this.enabled=!0,this.indeterminate=void 0,this.mode=t.REGULAR,this.compact=!1}observeValue(e,r){this._inputElem&&(e!=r&&(this._inputElem.checked=e),this._inputElem.indeterminate!=this.indeterminate&&(this._inputElem.indeterminate=this.indeterminate))}observeIndeterminate(e,r){this._inputElem&&e!=r&&(this._inputElem.indeterminate=e)}async getMode(){return t[this.mode]}async setFocus(){this._inputElem.focus()}componentDidLoad(){this._element&&i.addIDInfo(this._element,"input")}changeValue(){this.enabled&&(this.value=!this.value,this.ezChange.emit(this.value))}getLabelClasses(){const e=["label"];return this.enabled||e.push("label--disabled"),this.compact||e.push("label--padding"),e.join(" ")}getInputClasses(){var e;const r=[""];return r.push((null===(e=this.mode)||void 0===e?void 0:e.toUpperCase())===t.SWITCH?"switch-mode":"regular-mode"),this.compact&&r.push("compact"),r.join(" ")}render(){return o(c,null,o("input",{type:"checkbox",ref:e=>this._inputElem=e,class:this.getInputClasses(),checked:!0===this.value,onChange:()=>{this.changeValue()},indeterminate:this.indeterminate,disabled:!this.enabled,"data-element-id":i.getInternalIDInfo("input")}),this.renderLabel())}renderLabel(){if(this.label)return o("label",{class:this.getLabelClasses(),onClick:()=>this.changeValue(),title:this.label},this.label," ",this.alternativePlaceholder?o("span",{class:"label-alternative"},this.alternativePlaceholder):void 0)}get _element(){return a(this)}static get watchers(){return{value:["observeValue"],indeterminate:["observeIndeterminate"]}}};d.style=':host{--ez-check--box--width:20px;--ez-check--box--height:20px;--ez-check--width:calc(var(--ez-check--box--width) + var(--ez-check--outter-gap, 14px));--ez-check--height:calc(var(--ez-check--box--width) + var(--ez-check--outter-gap, 14px));--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--ez-check--indeterminate--image:url(\'data:image/svg+xml;utf8,<svg width="10" height="2" viewBox="0 0 10 2" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m 1,0 h 8 c 0.554,0 1,0.446 1,1 0,0.554 -0.446,1 -1,1 H 1 C 0.446,2 0,1.554 0,1 0,0.446 0.446,0 1,0 Z" /></svg>\');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:19px;--ez-switch--pin--height:19px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;align-items:center;margin:0;max-width:100%}input.regular-mode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative}input.compact{margin-right:0px}input.regular-mode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regular-mode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regular-mode:disabled{cursor:auto;background:none}input.regular-mode::before{box-sizing:border-box;content:"";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regular-mode:disabled::before{border:var(--ez-check--disabled--border)}input.regular-mode:checked:enabled:hover,input.regular-mode:indeterminate:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regular-mode:checked:enabled:focus,input.regular-mode:indeterminate:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regular-mode:checked::before,input.regular-mode:indeterminate::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regular-mode:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regular-mode:checked::after,input.regular-mode:indeterminate:after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regular-mode:indeterminate:after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:10px;height:2px;-webkit-mask-image:var(--ez-check--indeterminate--image);mask-image:var(--ez-check--indeterminate--image)}input.regular-mode:checked:disabled::after,input.regular-mode:indeterminate:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switch-mode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switch-mode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switch-mode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switch-mode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switch-mode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switch-mode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px))}input.switch-mode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;width:inherit;display:block;align-content:center;gap:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}.label--padding{padding-left:var(--space--extra-small)}.label-alternative{font-size:var(--text--small);color:var(--text--secondary);padding-top:2px}';export{d as ez_check}
1
+ import{r as e,c as r,h as o,H as c,g as a}from"./p-23a36bb6.js";import{ElementIDUtils as i}from"@sankhyalabs/core";import{C as t}from"./p-b853763b.js";const d=class{constructor(o){e(this,o),this.ezChange=r(this,"ezChange",7),this.label=void 0,this.alternativePlaceholder=void 0,this.value=void 0,this.enabled=!0,this.indeterminate=void 0,this.mode=t.REGULAR,this.compact=!1}observeValue(e,r){this._inputElem&&(e!=r&&(this._inputElem.checked=e),this._inputElem.indeterminate!=this.indeterminate&&(this._inputElem.indeterminate=this.indeterminate))}observeIndeterminate(e,r){this._inputElem&&e!=r&&(this._inputElem.indeterminate=e)}async getMode(){return t[this.mode]}async setFocus(){this._inputElem.focus()}componentDidLoad(){this._element&&i.addIDInfo(this._element,"input")}changeValue(){this.enabled&&(this.value=!this.value,this.ezChange.emit(this.value))}getLabelClasses(){const e=["label"];return this.enabled||e.push("label--disabled"),this.compact||e.push("label--padding"),e.join(" ")}getInputClasses(){var e;const r=[""];return r.push((null===(e=this.mode)||void 0===e?void 0:e.toUpperCase())===t.SWITCH?"switch-mode":"regular-mode"),this.compact&&r.push("compact"),r.join(" ")}render(){return o(c,null,o("input",{type:"checkbox",ref:e=>this._inputElem=e,class:this.getInputClasses(),checked:!0===this.value,onChange:()=>{this.changeValue()},indeterminate:this.indeterminate,disabled:!this.enabled,"data-element-id":i.getInternalIDInfo("input")}),this.renderLabel())}renderLabel(){if(this.label)return o("label",{class:this.getLabelClasses(),onClick:()=>this.changeValue(),title:this.label},this.label," ",this.alternativePlaceholder?o("span",{class:"label-alternative"},this.alternativePlaceholder):void 0)}get _element(){return a(this)}static get watchers(){return{value:["observeValue"],indeterminate:["observeIndeterminate"]}}};d.style=':host{--ez-check--box--width:20px;--ez-check--box--height:20px;--ez-check--width:calc(var(--ez-check--box--width) + var(--ez-check--outter-gap, 14px));--ez-check--height:calc(var(--ez-check--box--width) + var(--ez-check--outter-gap, 14px));--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--ez-check--indeterminate--image:url(\'data:image/svg+xml;utf8,<svg width="10" height="2" viewBox="0 0 10 2" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m 1,0 h 8 c 0.554,0 1,0.446 1,1 0,0.554 -0.446,1 -1,1 H 1 C 0.446,2 0,1.554 0,1 0,0.446 0.446,0 1,0 Z" /></svg>\');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:19px;--ez-switch--pin--height:19px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;align-items:center;margin:0;max-width:100%}input.regular-mode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative}input.compact{margin-right:0px}input.regular-mode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regular-mode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regular-mode:disabled{cursor:auto;background:none}input.regular-mode::before{box-sizing:border-box;content:"";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regular-mode:disabled::before{border:var(--ez-check--disabled--border)}input.regular-mode:checked:enabled:hover,input.regular-mode:indeterminate:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regular-mode:checked:enabled:focus,input.regular-mode:indeterminate:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regular-mode:checked::before,input.regular-mode:indeterminate::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regular-mode:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regular-mode:checked::after,input.regular-mode:indeterminate:after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regular-mode:indeterminate:after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:10px;height:2px;-webkit-mask-image:var(--ez-check--indeterminate--image);mask-image:var(--ez-check--indeterminate--image)}input.regular-mode:checked:disabled::after,input.regular-mode:indeterminate:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switch-mode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switch-mode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switch-mode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switch-mode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switch-mode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switch-mode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px))}input.switch-mode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;width:inherit;display:block;align-content:center;gap:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}.label--padding{padding-left:var(--space--extra-small)}.label-alternative{font-size:var(--text--small);color:var(--text--secondary);padding-top:2px}';export{d as ez_check}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-e4c7eb39.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as h,KeyboardManager as u,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as p,f as m,c as b,D as y}from"./p-8b717571.js";import{g as w,i as g}from"./p-af47458b.js";import{F as E}from"./p-30ffb9ed.js";import"./p-7e5c7b4c.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class F{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const _=(t,i)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(i[0].order||1e4);function j(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var z="function"==typeof Symbol&&Symbol.observable||"@@observable",A=function(){return Math.random().toString(36).substring(7).split("").join(".")},S={INIT:"@@redux/INIT"+A(),REPLACE:"@@redux/REPLACE"+A(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+A()}};function x(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function N(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(j(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(j(1));return e(N)(t,i)}if("function"!=typeof t)throw new Error(j(2));var s=t,r=i,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function u(){if(a)throw new Error(j(3));return r}function c(t){if("function"!=typeof t)throw new Error(j(4));if(a)throw new Error(j(5));var i=!0;return h(),l.push(t),function(){if(i){if(a)throw new Error(j(6));i=!1,h();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!x(t))throw new Error(j(7));if(void 0===t.type)throw new Error(j(8));if(a)throw new Error(j(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(j(10));s=t,d({type:S.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(j(11));function e(){t.next&&t.next(u())}return e(),{unsubscribe:i(e)}}})[z]=function(){return this},t}return d({type:S.INIT}),(n={dispatch:d,subscribe:c,getState:u,replaceReducer:f})[z]=v,n}const M={};function R(t=M,i){switch(i.type){case I.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case I.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function T(t){return t.formMetadata}function D(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var I;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(I||(I={}));const P=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=T(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=D(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:I.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${h.replaceAccentuatedChars(h.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:h.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new u({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(p,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await m(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1)=>{var n,s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],h={};null===(n=null==t?void 0:t.tabs)||void 0===n||n.forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),null===(s=null==t?void 0:t.fields)||void 0===s||s.forEach((t=>{var e,n,s;if(!1!==t.visible){const u=((t,i)=>("string"==typeof t?Array.from(i.keys()).find((i=>i.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",r);if(o.has(u.label))return;const c=i.getField(t.name);if(c&&(null==(null==c?void 0:c.visible)||!0===(null==c?void 0:c.visible))&&u.visible){r.has(u)||r.set(u,[]);const i=f(c,t);r.get(u).push(i),i.required&&l.push(t.name),((null==t.cleanOnCopy?null===(e=c.properties)||void 0===e?void 0:e.cleanOnCopy:t.cleanOnCopy)||(null===(n=c.properties)||void 0===n?void 0:n.cleanOnCopy))&&a.push(t.name);let o=null==t.defaultValue?null===(s=c.properties)||void 0===s?void 0:s.defaultValue:t.defaultValue;if(o&&null!=o.value){const{type:i,value:e}=o;if(i)if("V"===i)o=e;else try{const t=JSON.parse(e);o=t&&"value"in t?t:e}catch(t){}h[t.name]=o}}}}));const u=new F;if(u.setDefaultVars(t.defaultVars),e){const t=i.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:i,name:e,fields:n}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);r.set({name:e,label:i},n)}))}const c=w();return Array.from(r.entries()).sort(_).forEach((([t,i])=>{u.addSheet({label:"__main"===t.label?c("ez-form.mainTab"):t.label,name:t.name||t.label,fields:i})})),u.addRequiredFields(l),u.addCleanOnCopyFields(a),u.addDefaultValues(h),u})(this.config,this.dataUnit);this._store.dispatch({type:I.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=N(R),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=!(null==t?void 0:t.config)||t.config===E.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===E.CASCADE}))}componentDidRender(){const t=T(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=D(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=h.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};P.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{P as ez_form}
1
+ import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-23a36bb6.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as h,KeyboardManager as u,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as p,f as m,c as b,D as y}from"./p-9dc31fc6.js";import{g as w,i as g}from"./p-af47458b.js";import{F as E}from"./p-30ffb9ed.js";import"./p-7e5c7b4c.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class F{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const _=(t,i)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(i[0].order||1e4);function j(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var z="function"==typeof Symbol&&Symbol.observable||"@@observable",A=function(){return Math.random().toString(36).substring(7).split("").join(".")},S={INIT:"@@redux/INIT"+A(),REPLACE:"@@redux/REPLACE"+A(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+A()}};function x(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function N(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(j(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(j(1));return e(N)(t,i)}if("function"!=typeof t)throw new Error(j(2));var s=t,r=i,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function u(){if(a)throw new Error(j(3));return r}function c(t){if("function"!=typeof t)throw new Error(j(4));if(a)throw new Error(j(5));var i=!0;return h(),l.push(t),function(){if(i){if(a)throw new Error(j(6));i=!1,h();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!x(t))throw new Error(j(7));if(void 0===t.type)throw new Error(j(8));if(a)throw new Error(j(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(j(10));s=t,d({type:S.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(j(11));function e(){t.next&&t.next(u())}return e(),{unsubscribe:i(e)}}})[z]=function(){return this},t}return d({type:S.INIT}),(n={dispatch:d,subscribe:c,getState:u,replaceReducer:f})[z]=v,n}const M={};function R(t=M,i){switch(i.type){case I.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case I.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function T(t){return t.formMetadata}function D(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var I;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(I||(I={}));const P=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=T(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=D(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:I.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${h.replaceAccentuatedChars(h.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:h.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new u({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(p,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await m(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1)=>{var n,s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],h={};null===(n=null==t?void 0:t.tabs)||void 0===n||n.forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),null===(s=null==t?void 0:t.fields)||void 0===s||s.forEach((t=>{var e,n,s;if(!1!==t.visible){const u=((t,i)=>("string"==typeof t?Array.from(i.keys()).find((i=>i.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",r);if(o.has(u.label))return;const c=i.getField(t.name);if(c&&(null==(null==c?void 0:c.visible)||!0===(null==c?void 0:c.visible))&&u.visible){r.has(u)||r.set(u,[]);const i=f(c,t);r.get(u).push(i),i.required&&l.push(t.name),((null==t.cleanOnCopy?null===(e=c.properties)||void 0===e?void 0:e.cleanOnCopy:t.cleanOnCopy)||(null===(n=c.properties)||void 0===n?void 0:n.cleanOnCopy))&&a.push(t.name);let o=null==t.defaultValue?null===(s=c.properties)||void 0===s?void 0:s.defaultValue:t.defaultValue;if(o&&null!=o.value){const{type:i,value:e}=o;if(i)if("V"===i)o=e;else try{const t=JSON.parse(e);o=t&&"value"in t?t:e}catch(t){}h[t.name]=o}}}}));const u=new F;if(u.setDefaultVars(t.defaultVars),e){const t=i.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:i,name:e,fields:n}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);r.set({name:e,label:i},n)}))}const c=w();return Array.from(r.entries()).sort(_).forEach((([t,i])=>{u.addSheet({label:"__main"===t.label?c("ez-form.mainTab"):t.label,name:t.name||t.label,fields:i})})),u.addRequiredFields(l),u.addCleanOnCopyFields(a),u.addDefaultValues(h),u})(this.config,this.dataUnit);this._store.dispatch({type:I.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=N(R),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=!(null==t?void 0:t.config)||t.config===E.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===E.CASCADE}))}componentDidRender(){const t=T(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=D(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=h.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};P.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{P as ez_form}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e,c as s,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as a,ObjectUtils as r,HTMLBuilder as h,StringUtils as l,KeyboardManager as n}from"@sankhyalabs/core";import{i as c}from"./p-af47458b.js";import{C as d}from"./p-30ffb9ed.js";import{R as b,a as m}from"./p-3e767a74.js";import{p as u}from"./p-d2364956.js";import{A as v}from"./p-7e5c7b4c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-112455b1.js";const p=class{constructor(i){t(this,i),this.showLoading=void 0,this.visibleOptions=void 0,this.textEmptyList=void 0,this.showOptionValue=void 0,this.preSelection=void 0,this.maxWidth=void 0,this.width=void 0,this.onOptionSelect=void 0,this.onOptionHover=void 0}async nextOption(){var t,i;(null===(t=this.visibleOptions)||void 0===t?void 0:t.length)&&(void 0!==this.preSelection&&this.preSelection>=this.visibleOptions.length-1||(this.preSelection=void 0===this.preSelection?0:this.preSelection+1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(i=this.onOptionHover)||void 0===i||i.call(this,this.preSelection)))}async previousOption(){var t,i;(null===(t=this.visibleOptions)||void 0===t?void 0:t.length)&&(void 0!==this.preSelection&&this.preSelection<=0||(this.preSelection=void 0===this.preSelection?this.visibleOptions.length-1:this.preSelection-1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(i=this.onOptionHover)||void 0===i||i.call(this,this.preSelection)))}async selectCurrentOption(){void 0!==this.preSelection&&(this.onOptionSelect(this.visibleOptions[this.preSelection]),this.preSelection=void 0)}observeWidth(t,i){t!==i&&this._listWrapper&&(this._listWrapper.style.width=`${this.width}px`)}observeMaxWidth(t,i){t!==i&&this._listWrapper&&(this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:"")}handleKeyDown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.nextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.preSelection=void 0}}buildItem(t,e){const s=this.showOptionValue&&this.maxWidth>0?`${this.maxWidth}px`:"";return t.label=t.label||t.value,i("li",{tabIndex:1,class:e===this.preSelection?"item preselected":"item",id:`item_${t.value}_${e}`,key:`item_${t.value}_${e}`,onMouseDown:()=>this.onOptionSelect(t),onMouseOver:()=>this.preSelection=e},this.showOptionValue?i("span",{class:"item__value",title:t.value,style:{width:s,minWidth:s,maxWidth:s}},t.value):void 0,i("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:t.label},t.label))}scrollToOption(t){if(!(null==t?void 0:t.value)||!this._optionsList)return;const i=this.visibleOptions.indexOf(t);if(-1===i)return;const e=this._optionsList.querySelector(`li#item_${CSS.escape(t.value)}_${CSS.escape(String(i))}`);e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})}async componentWillLoad(){this.i18n=await c()}componentDidLoad(){this._listWrapper.style.width=`${this.width}px`,this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:""}componentDidRender(){var t;null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{a.addIDInfoIfNotExists(t,"itemComboBox")}))}render(){return i("section",{class:"list-container"},i("div",{class:"list-wrapper",ref:t=>this._listWrapper=t},i("ul",{class:"list-options",ref:t=>this._optionsList=t},!this.showLoading&&0===this.visibleOptions.length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList||this.i18n("ez-combo-box.noResults"))),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.showOptionValue&&i("span",{class:"item__value item__value--hidden"}),!this.showLoading&&this.visibleOptions.length>0&&this.visibleOptions.map(((t,i)=>this.buildItem(t,i))))))}static get watchers(){return{width:["observeWidth"],maxWidth:["observeMaxWidth"]}}};p.style=":host{--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);--ez-combo-box__list-container--padding:var(--space--extra-small, 3px)}.list-container{padding-top:var(--ez-combo-box__list-container--padding)}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow--medium, 0 8px 24px 0 rgba(43, 58, 84, 0.10));padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;margin:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const x=class{constructor(i){t(this,i),this.gui=void 0,this.customEditor=void 0,this.formViewField=void 0,this.value=void 0,this.detailContext=void 0,this.builderFallback=void 0,this.selectedRecord=void 0}async setFocus(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t)}async setBlur(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setBlur)||void 0===i||i.call(t)}async isInvalid(){var t,i;return(null===(i=null===(t=this.gui)||void 0===t?void 0:t.isInvalid)||void 0===i?void 0:i.call(t))||!1}watchValue(){this.handleValue(this.gui)}watchCustomEditor(){this.getContent()}watchFormViewField(t,i){r.equals(t,i)||this.getContent()}watchDetailContext(){this.getContent()}watchBuilderFallback(){this.getContent()}watchSelectedRecord(t,i){(null==t?void 0:t.__record__id__)!==(null==i?void 0:i.__record__id__)&&this.getContent()}getContent(){var t,e,s,o,a;const r=new Map;for(const t in this.formViewField.props)r.set(t,this.formViewField.props[t]);const n={value:this.value,name:this.formViewField.name,currentEditor:this.builderFallback(this.formViewField),setValue:t=>this.setValue(t),getValue:this.getValue,record:this.selectedRecord,editorMetadata:{label:this.formViewField.label,hidden:!1===(null===(t=this.formViewField.props)||void 0===t?void 0:t.visible),userInterface:this.formViewField.userInterface,options:null===(e=this.formViewField.props)||void 0===e?void 0:e.options,props:this.formViewField.props?r:void 0,optionLoader:this.formViewField.optionLoader},source:d.FORM,detailContext:this.detailContext};let c=this.customEditor.getEditorElement(n);if(!c)return c=this.builderFallback(this.formViewField),this.handleValue(c),void(this.gui=c);if(!(c instanceof HTMLElement)&&"string"!=typeof c)return this.handleValue(c),void(this.gui=c);"string"==typeof c&&(c=h.parseElement(c));const b=null!==(a=null!==(o=null===(s=this.value)||void 0===s?void 0:s.value)&&void 0!==o?o:this.value)&&void 0!==a?a:"";c.setAttribute("value",b),this.gui=i("div",{key:l.generateUUID(),ref:t=>t&&t.appendChild(c)})}setValue(t){this.value=t}getValue(){return this.value}handleValue(t){var i;null===(i=t.t)||void 0===i||i.forEach((t=>{t.i.value=this.value}))}componentWillLoad(){this.getContent()}render(){return i(e,null,this.gui)}static get watchers(){return{value:["watchValue"],customEditor:["watchCustomEditor"],formViewField:["watchFormViewField"],detailContext:["watchDetailContext"],builderFallback:["watchBuilderFallback"],selectedRecord:["watchSelectedRecord"]}}},w=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.historyStack=[],this.historyIndex=-1,this.previewMode=!1,this.showPreview=!0,this.value="",this.label=void 0,this.mode="regular",this.enabled=!0,this.rows=6,this.errorMessage=void 0,this.canShowError=!0,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}observeValue(t,i){r.equals(t,i)||this.ezChange.emit(t)}observeErrorMessage(t){t&&this.previewMode&&(this.previewMode=!1)}async handleExecuteToolbarCommand(t){const{command:i,value:e}=t.detail;await this.executeCommand(i,e)}async setFocus(){this.handleFocus()}async setBlur(){var t;await(null===(t=this.textAreaRef)||void 0===t?void 0:t.setBlur())}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}bindPreview(){this._keyboardManager&&this.showPreview&&this._keyboardManager.bind("ctrl + p",(async()=>{await this.togglePreview()}),{description:"Entra em modo de pré visualização.",element:this.element})}bindConfigs(){this._keyboardManager&&this.showConfigs&&this._keyboardManager.bind("ctrl + l",(async()=>{await this.handleFormatSelection(b.LIST)}),{description:this.i18n("ez-rich-text.listShortcut"),element:this.element}).bind("ctrl + k",(async()=>{await this.handleLink()}),{description:this.i18n("ez-rich-text.linkShortcut"),element:this.element}).bind("ctrl + o",(async()=>{await this.handleImage()}),{description:this.i18n("ez-rich-text.imageShortcut"),element:this.element})}bindTextFormat(){this._keyboardManager&&this.showTextFormat&&this._keyboardManager.bind("ctrl + b",(async()=>{await this.handleFormatSelection(b.BOLD)}),{description:this.i18n("ez-rich-text.boldShortcut"),element:this.element}).bind("ctrl + i",(async()=>{await this.handleFormatSelection(b.ITALIC)}),{description:this.i18n("ez-rich-text.italicShortcut"),element:this.element}).bind("ctrl + u",(async()=>{await this.handleFormatSelection(b.UNDERLINE)}),{description:this.i18n("ez-rich-text.underlineShortcut"),element:this.element})}initKeyboardManager(){this._keyboardManager=new n({propagate:!1,element:this.element}),this._keyboardManager.bind("ctrl + Enter",(async()=>{await this.handleFormatSelection(b.BREAK_LINE)}),{description:this.i18n("ez-rich-text.breakLineShortcut"),element:this.element}).bind("ctrl + z",(async()=>{await this.handleUndo()}),{description:this.i18n("ez-rich-text.undoShortcut"),element:this.element}).bind("ctrl + x",(async()=>{await this.handleRedo()}),{description:this.i18n("ez-rich-text.redoShortcut"),element:this.element}),this.bindPreview(),this.bindConfigs(),this.bindTextFormat()}async executeCommand(t,i){switch(t){case m.FOCUS:this.handleFocus();break;case m.PREVIEW:await this.togglePreview();break;case m.FORMAT:await this.handleFormatSelection(i);break;case m.UNDO:await this.handleUndo();break;case m.REDO:await this.handleRedo();break;case m.LINK:await this.handleLink();break;case m.IMAGE:await this.handleImage()}}handleFocus(){this.previewMode=!1,requestAnimationFrame((async()=>{await this.textAreaRef.setFocus()}))}async handleLink(){this.previewMode=!1,requestAnimationFrame((async()=>{await this.linkBuilderRef.show(this.getSelectedText())}))}async handleImage(){this.previewMode=!1,await this.imageUploaderRef.show()}async handleRedo(){this.previewMode=!1,requestAnimationFrame((async()=>{this.redo(),await this.textAreaRef.setFocus()}))}async handleUndo(){this.previewMode=!1,requestAnimationFrame((async()=>{this.undo(),await this.textAreaRef.setFocus()}))}async handleFormatSelection(t){t&&(this.previewMode=!1,requestAnimationFrame((async()=>{await this.formatSelection(t),await this.textAreaRef.setFocus()})))}async togglePreview(){this.previewMode=!this.previewMode,this.previewMode&&await this.textAreaRef.setFocus()}getSelectedText(){const t=this.getTextAreaElement();if(t)return(this.textAreaRef.value||"").substring(t.selectionStart,t.selectionEnd)}getTextAreaElement(){return this.element.querySelector("ez-text-area").shadowRoot.querySelector("textarea")}async formatSelection(t){if(!this.textAreaRef)return;const i=t.replace("$selection",this.getSelectedText()||"");await this.textAreaRef.appendTextToSelection(i),this.value=this.textAreaRef.value,this.addToHistory(this.value)}addToHistory(t){this.historyIndex>=0&&t===this.historyStack[this.historyIndex]||(this.historyStack.length>=50&&this.historyStack.splice(0,this.historyStack.length-49),this.historyStack.push(t),this.historyIndex=this.historyStack.length-1)}undo(){if(!this.canExecuteUndo())return;this.historyIndex--;const t=this.historyStack[this.historyIndex];this.value=t,this.textAreaRef.value=t}canExecuteUndo(){return this.historyIndex>0}redo(){this.canExecuteRedo()&&(this.historyIndex++,this.getValueFromHistory())}canExecuteRedo(){return this.historyIndex<this.historyStack.length-1}getValueFromHistory(){const t=this.historyStack[this.historyIndex];this.value=t,this.textAreaRef.value=t}handleTextAreaChanged(t){this.value=t.detail,this.addToHistory(this.value)}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async componentWillLoad(){this.i18n=await c()}componentDidLoad(){this.initKeyboardManager(),this.addToHistory(this.value)}async disconnectedCallback(){await this.removeShortcuts()}getSanitizedValue(){return u.sanitize(this.value,{ADD_ATTR:["target","rel"]})}renderContent(){return this.previewMode?i("div",{id:"rich-text-preview-container",class:"preview",innerHTML:this.getSanitizedValue()}):i("ez-text-area",{ref:t=>this.textAreaRef=t,label:this.label,value:this.value,enabled:this.enabled,rows:this.rows,mode:this.mode,canShowError:this.canShowError,errorMessage:this.errorMessage,onEzChange:this.handleTextAreaChanged.bind(this)})}render(){return i(e,null,i("div",{class:"editor-container bordered"},i("ez-rich-toolbar",{isPreviewMode:this.previewMode,showPreview:this.showPreview,showConfigs:this.showConfigs&&this.enabled,showTextFormat:this.showTextFormat&&this.enabled,showUndoRedo:this.showUndoRedo&&this.enabled}),this.renderContent()),i("ez-link-builder",{ref:t=>this.linkBuilderRef=t}),i("ez-simple-image-uploader",{ref:t=>this.imageUploaderRef=t}))}get element(){return o(this)}static get watchers(){return{value:["observeValue"],errorMessage:["observeErrorMessage"]}}};w.style=".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.sc-ez-rich-text{width:100%;overflow:hidden;border-radius:12px;border:1px solid #DCE0E8}ez-text-area.sc-ez-rich-text{--text-area__input--border:1px solid}.preview.sc-ez-rich-text{min-height:20px;padding:12px;resize:both;overflow:auto;max-width:100%;border-top:1px solid #DCE0E8}";const _=class{constructor(i){t(this,i),this.saveEdition=s(this,"saveEdition",7),this.cancelEdition=s(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var e,s;const o=null===(s=null===(e=this._inputElement)||void 0===e?void 0:e.shadowRoot)||void 0===s?void 0:s.querySelector("input");if(null!=o){const e=this.getWidthValue(t);o.style.width=e+"px",i&&setTimeout((()=>o.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const e=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+e:e}i.innerHTML=""}return 0}setStyledInput(){var t,i;let e="",s="",o="";null!=this.styled&&(e=this.styled.fontSize,s=this.styled.fontWeight,o=this.styled.fontFamily);const a=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=a&&(a.style.fontSize=e,a.style.fontWeight=s,a.style.fontFamily=o);const r=this._valueBasis;null!=r&&(r.style.fontSize=e,r.style.fontWeight=s,r.style.fontFamily=o)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):v.alert(this.i18n("app.warning"),this.i18n("ez-text-edit.emptyFieldWarning")).then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}async componentWillLoad(){this.i18n=await c()}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return a.addIDInfoIfNotExists(this._element,"input"),i(e,null,i("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),i("ez-text-input",{"data-element-id":a.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),i("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),i("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return o(this)}};_.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{p as ez_combo_box_list,x as ez_custom_form_input,w as ez_rich_text,_ as ez_text_edit}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as n,g as o}from"./p-e4c7eb39.js";import{StringUtils as a,ElementIDUtils as r}from"@sankhyalabs/core";import{c as d,f as s,s as l}from"./p-e07e4671.js";const c=class{constructor(i){e(this,i),this.ezClick=t(this,"ezClick",7),this.item=void 0,this.enableKey=!0,this.compacted=!1}componentWillRender(){this.createDetailList()}componentDidLoad(){var e,t;const i={id:a.toCamelCase((null===(e=this.item)||void 0===e?void 0:e.key)||(null===(t=this.item)||void 0===t?void 0:t.title)||"")};r.addIDInfo(this._element,null,i)}createDetailList(){var e,t,i;this._details={detailsLeft:[],detailsRight:[]};let n=0;if(null===(e=this.item)||void 0===e?void 0:e.details)for(const e in this.item.details)n<3?this._details.detailsLeft.push({label:e,value:null===(t=this.item.details[e])||void 0===t?void 0:t.toString()}):this._details.detailsRight.push({label:e,value:null===(i=this.item.details[e])||void 0===i?void 0:i.toString()}),n++}buildDetailContentTitle(e){var t,i;if(null!=(null==e?void 0:e.label)||null!=(null==e?void 0:e.value))return`${null===(t=a.replaceAccentuatedCharsHtmlEntities(null==e?void 0:e.label))||void 0===t?void 0:t.replace(/<[^>]*>/g,"")}: ${null===(i=a.replaceAccentuatedCharsHtmlEntities(null==e?void 0:e.value))||void 0===i?void 0:i.replace(/<[^>]*>/g,"")}`}buildDetailContent(e){return i("div",{class:"card-item__detail "+(this.compacted?"":"card-item__detail-default"),title:this.buildDetailContentTitle(e)},i("label",{class:"card-item__detail-label "+(this.compacted?"card-item__detail-label-compacted":"")},`${e.label}: `)," ",i("label",{class:"card-item__detail-value "+(this.compacted?"card-item__detail-value-compacted":""),innerHTML:e.value}))}render(){return i(n,null,this.item&&i("div",{class:`card-item ${this.compacted?"card-item__compacted":"card-item__expanded"} `,onClick:()=>{this.ezClick.emit(this.item)}},i("div",{class:"ez-row card-item__content"},i("div",{class:"ez-col ez-col--sd-11 card-item__details"},i("label",{class:"card-item__title "+(this.compacted?"card-item__title-compacted":"")},this.enableKey&&i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:this.compacted?"card-item__details-container_compacted":"card-item__details-container_default"},i("div",{class:"card-item__details-container__left "+(this.compacted?"card-item__details-container__left-compacted":"")},this._details.detailsLeft.map((e=>this.buildDetailContent(e)))),i("div",{class:"card-item__details-container__right "+(this.compacted?"card-item__details-container__right-compacted":"")},this._details.detailsRight.map((e=>this.buildDetailContent(e)))))),i("div",{class:"ez-col ez-col--sd-1 card-item__details-slot"},i("slot",{name:"rightSlot"})))))}get _element(){return o(this)}};c.style=":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs) var(--space--small);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";const h=class{constructor(i){e(this,i),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(e,t){e!==t&&(e?this.openPopover():this.hidePopover())}async updatePosition(e,t){this.updateOptionPosition(e,t),await this.updatePositionPopover()}async show(e,t){this.updateOptionPosition(e,t),this.opened=!0}async showUnder(e,t){t&&(this.options=t),this.anchorElement=e,this.opened=!0}async hide(){this.opened=!1}async setOptions(e){Object.assign(this.options,e)}async setAnchorElement(e){this.anchorElement=e}parseSizePixel(e,t){return e?"string"==typeof e?Number(e.replace("px","")):null!=e?e:0:null!=t?t:0}updateOptionPosition(e,t){Object.assign(this.options,{horizontalGap:this.parseSizePixel(t,this.options.horizontalGap),verticalGap:this.parseSizePixel(e,this.options.verticalGap)})}getElement(e){return"string"==typeof e?document.getElementById(e):e}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const e of this.anchorElement){const t=this.getElement(e);if(t)return t}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const e=this.getAnchorElement();await d(e,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[s(),l({padding:5})],strategy:"fixed"}).then((({x:e,y:t,placement:i})=>{const n=i.includes("bottom")?t+this.options.verticalGap:t-this.options.verticalGap,o=i.includes("start")?e+this.options.horizontalGap:e-this.options.horizontalGap;Object.assign(this._box.style,{top:`${n}px`,left:`${o}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){if(this._box&&this.opened){if(this._box.style.display="flex",this._box.style.visibility="hidden",this.useAnchorSize){const e=this.getAnchorElement().getBoundingClientRect().width;this._box.style.width=`${e<this.minWidth?this.minWidth:e}px`}await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible"}}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}handlePositionUpdate(){this.opened&&this.updatePositionPopover()}componentWillLoad(){window.addEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.addEventListener("resize",this.handlePositionUpdate.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.removeEventListener("resize",this.handlePositionUpdate.bind(this),!0),this._resizeObserver.disconnect()}render(){return i(n,null,i("div",{ref:e=>this._overlay=e,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),i("section",{ref:e=>this._box=e,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},i("slot",null)))}get _host(){return o(this)}static get watchers(){return{opened:["observeOpened"]}}};h.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);--ez-popover__box--overlay-z-index:var(--elevation--24, 24);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--ez-popover__box--overlay-z-index)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{c as ez_card_item,h as ez_popover_core}
1
+ import{r as e,c as t,h as i,H as n,g as o}from"./p-23a36bb6.js";import{StringUtils as a,ElementIDUtils as r}from"@sankhyalabs/core";import{c as d,f as s,s as l}from"./p-e07e4671.js";const c=class{constructor(i){e(this,i),this.ezClick=t(this,"ezClick",7),this.item=void 0,this.enableKey=!0,this.compacted=!1}componentWillRender(){this.createDetailList()}componentDidLoad(){var e,t;const i={id:a.toCamelCase((null===(e=this.item)||void 0===e?void 0:e.key)||(null===(t=this.item)||void 0===t?void 0:t.title)||"")};r.addIDInfo(this._element,null,i)}createDetailList(){var e,t,i;this._details={detailsLeft:[],detailsRight:[]};let n=0;if(null===(e=this.item)||void 0===e?void 0:e.details)for(const e in this.item.details)n<3?this._details.detailsLeft.push({label:e,value:null===(t=this.item.details[e])||void 0===t?void 0:t.toString()}):this._details.detailsRight.push({label:e,value:null===(i=this.item.details[e])||void 0===i?void 0:i.toString()}),n++}buildDetailContentTitle(e){var t,i;if(null!=(null==e?void 0:e.label)||null!=(null==e?void 0:e.value))return`${null===(t=a.replaceAccentuatedCharsHtmlEntities(null==e?void 0:e.label))||void 0===t?void 0:t.replace(/<[^>]*>/g,"")}: ${null===(i=a.replaceAccentuatedCharsHtmlEntities(null==e?void 0:e.value))||void 0===i?void 0:i.replace(/<[^>]*>/g,"")}`}buildDetailContent(e){return i("div",{class:"card-item__detail "+(this.compacted?"":"card-item__detail-default"),title:this.buildDetailContentTitle(e)},i("label",{class:"card-item__detail-label "+(this.compacted?"card-item__detail-label-compacted":"")},`${e.label}: `)," ",i("label",{class:"card-item__detail-value "+(this.compacted?"card-item__detail-value-compacted":""),innerHTML:e.value}))}render(){return i(n,null,this.item&&i("div",{class:`card-item ${this.compacted?"card-item__compacted":"card-item__expanded"} `,onClick:()=>{this.ezClick.emit(this.item)}},i("div",{class:"ez-row card-item__content"},i("div",{class:"ez-col ez-col--sd-11 card-item__details"},i("label",{class:"card-item__title "+(this.compacted?"card-item__title-compacted":"")},this.enableKey&&i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:this.compacted?"card-item__details-container_compacted":"card-item__details-container_default"},i("div",{class:"card-item__details-container__left "+(this.compacted?"card-item__details-container__left-compacted":"")},this._details.detailsLeft.map((e=>this.buildDetailContent(e)))),i("div",{class:"card-item__details-container__right "+(this.compacted?"card-item__details-container__right-compacted":"")},this._details.detailsRight.map((e=>this.buildDetailContent(e)))))),i("div",{class:"ez-col ez-col--sd-1 card-item__details-slot"},i("slot",{name:"rightSlot"})))))}get _element(){return o(this)}};c.style=":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs) var(--space--small);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";const h=class{constructor(i){e(this,i),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(e,t){e!==t&&(e?this.openPopover():this.hidePopover())}async updatePosition(e,t){this.updateOptionPosition(e,t),await this.updatePositionPopover()}async show(e,t){this.updateOptionPosition(e,t),this.opened=!0}async showUnder(e,t){t&&(this.options=t),this.anchorElement=e,this.opened=!0}async hide(){this.opened=!1}async setOptions(e){Object.assign(this.options,e)}async setAnchorElement(e){this.anchorElement=e}parseSizePixel(e,t){return e?"string"==typeof e?Number(e.replace("px","")):null!=e?e:0:null!=t?t:0}updateOptionPosition(e,t){Object.assign(this.options,{horizontalGap:this.parseSizePixel(t,this.options.horizontalGap),verticalGap:this.parseSizePixel(e,this.options.verticalGap)})}getElement(e){return"string"==typeof e?document.getElementById(e):e}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const e of this.anchorElement){const t=this.getElement(e);if(t)return t}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const e=this.getAnchorElement();await d(e,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[s(),l({padding:5})],strategy:"fixed"}).then((({x:e,y:t,placement:i})=>{const n=i.includes("bottom")?t+this.options.verticalGap:t-this.options.verticalGap,o=i.includes("start")?e+this.options.horizontalGap:e-this.options.horizontalGap;Object.assign(this._box.style,{top:`${n}px`,left:`${o}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){if(this._box&&this.opened){if(this._box.style.display="flex",this._box.style.visibility="hidden",this.useAnchorSize){const e=this.getAnchorElement().getBoundingClientRect().width;this._box.style.width=`${e<this.minWidth?this.minWidth:e}px`}await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible"}}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}handlePositionUpdate(){this.opened&&this.updatePositionPopover()}componentWillLoad(){window.addEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.addEventListener("resize",this.handlePositionUpdate.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.removeEventListener("resize",this.handlePositionUpdate.bind(this),!0),this._resizeObserver.disconnect()}render(){return i(n,null,i("div",{ref:e=>this._overlay=e,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),i("section",{ref:e=>this._box=e,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},i("slot",null)))}get _host(){return o(this)}static get watchers(){return{opened:["observeOpened"]}}};h.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);--ez-popover__box--overlay-z-index:var(--elevation--24, 24);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--ez-popover__box--overlay-z-index)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{c as ez_card_item,h as ez_popover_core}
@@ -1 +1 @@
1
- import{r as t,f as e,h as i,H as o,g as s}from"./p-e4c7eb39.js";import{ElementIDUtils as a}from"@sankhyalabs/core";const n=class{constructor(e){t(this,e),this._nextMessages=[],this._currentMessageInfo={message:"",fadeTime:void 0,useIcon:void 0},this._toastOpenedClass="toast__container--opened",this._lastTimeOut=void 0,this._lang="pt",this.message=void 0,this.fadeTime=5e3,this.useIcon=!1,this.canClose=!0}async show(t,i,o,s){const a=void 0!==s?s:this.canClose;return new Promise((s=>{var n;if(null===(n=this.container)||void 0===n?void 0:n.classList.contains(this._toastOpenedClass)){if(this.isRepeatedMessage(t))return;this._nextMessages.push({message:t,fadeTime:i,useIcon:o,canClose:a,callBack:s})}else this._currentMessageInfo.message=t||this.message,this._currentMessageInfo.fadeTime=i||this.fadeTime,this._currentMessageInfo.useIcon=o||this.useIcon,this._currentMessageInfo.callBack=s,a&&(this._currentMessageInfo.canClose=a),e(this),this.displayToast(),this._lastTimeOut=setTimeout((()=>{this.hideToast()}),this._currentMessageInfo.fadeTime+400)}))}hideToast(){this.makeToastInvisible(),this._nextMessages.length>0&&(this._currentMessageInfo.callBack&&this._currentMessageInfo.callBack(!0),setTimeout((()=>{let t=this._nextMessages.shift();this.show(t.message,t.fadeTime,t.useIcon)}))),this._currentMessageInfo.callBack&&this._currentMessageInfo.callBack(!0)}isRepeatedMessage(t){var e,i;return(null===(e=this._nextMessages)||void 0===e?void 0:e.some((e=>e.message===t)))||(null===(i=this._currentMessageInfo)||void 0===i?void 0:i.message)===t}makeToastInvisible(){this.container.classList.remove(this._toastOpenedClass),this.container.style.animation="none",this._lastTimeOut&&clearTimeout(this._lastTimeOut)}displayToast(){this.container.classList.add(this._toastOpenedClass),this.container.style.animation=`fadein 0.5s, fadeout 0.5s ${this.fadeTime/1e3}s`}buildDataElementId(){var t,e;const i=a.addIDInfo(this._element),o=a.DATA_ELEMENT_ID_ATTRIBUTE_NAME;null===(t=this._elemBtnClose)||void 0===t||t.setAttribute(o,`${i}_buttonClose`),null===(e=this._elemText)||void 0===e||e.setAttribute(o,`${i}_title`)}componentDidLoad(){this.buildDataElementId()}render(){return i(o,null,i("div",{ref:t=>this.container=t,class:"toast__container"},this._currentMessageInfo.useIcon&&i("slot",{name:"icon"}),i("div",{lang:this._lang,ref:t=>this._elemText=t,class:this._currentMessageInfo.useIcon?"message__container message__container--icon":"message__container",title:this._currentMessageInfo.message,innerHTML:this._currentMessageInfo.message}),this._currentMessageInfo.canClose&&i("button",{class:"btn-close",onClick:()=>{this.hideToast()},ref:t=>this._elemBtnClose=t})))}get _element(){return s(this)}};n.style=':host{--ez-toast__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--ez-toast__container--z-index:var(--elevation--100, 100);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__container--left:var(--space--large, 24px);--ez-toast__container--bottom:var(--space--large, 24px);--ez-toast__container--width:400px;--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;box-sizing:border-box;border-radius:6px;align-items:center;padding:12px;visibility:hidden;width:var(--ez-toast__container--width);left:var(--ez-toast__container--left);bottom:var(--ez-toast__container--bottom);z-index:var(--ez-toast__container--z-index);background-color:var(--ez-toast__container--background-color)}.message__container{text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;text-overflow:ellipsis;font-family:var(--font-pattern, "Roboto")}.message__container--icon{width:80%;padding-left:var(--ez-toast__icon--padding-left)}.btn-close{margin-top:3px;display:flex;justify-content:flex-end;align-self:flex-start;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--ez-toast__btn__close__image);mask-image:var(--ez-toast__btn__close__image)}.toast__container--opened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@-webkit-keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}@keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}';export{n as ez_toast}
1
+ import{r as t,f as e,h as i,H as o,g as s}from"./p-23a36bb6.js";import{ElementIDUtils as a}from"@sankhyalabs/core";const n=class{constructor(e){t(this,e),this._nextMessages=[],this._currentMessageInfo={message:"",fadeTime:void 0,useIcon:void 0},this._toastOpenedClass="toast__container--opened",this._lastTimeOut=void 0,this._lang="pt",this.message=void 0,this.fadeTime=5e3,this.useIcon=!1,this.canClose=!0}async show(t,i,o,s){const a=void 0!==s?s:this.canClose;return new Promise((s=>{var n;if(null===(n=this.container)||void 0===n?void 0:n.classList.contains(this._toastOpenedClass)){if(this.isRepeatedMessage(t))return;this._nextMessages.push({message:t,fadeTime:i,useIcon:o,canClose:a,callBack:s})}else this._currentMessageInfo.message=t||this.message,this._currentMessageInfo.fadeTime=i||this.fadeTime,this._currentMessageInfo.useIcon=o||this.useIcon,this._currentMessageInfo.callBack=s,a&&(this._currentMessageInfo.canClose=a),e(this),this.displayToast(),this._lastTimeOut=setTimeout((()=>{this.hideToast()}),this._currentMessageInfo.fadeTime+400)}))}hideToast(){this.makeToastInvisible(),this._nextMessages.length>0&&(this._currentMessageInfo.callBack&&this._currentMessageInfo.callBack(!0),setTimeout((()=>{let t=this._nextMessages.shift();this.show(t.message,t.fadeTime,t.useIcon)}))),this._currentMessageInfo.callBack&&this._currentMessageInfo.callBack(!0)}isRepeatedMessage(t){var e,i;return(null===(e=this._nextMessages)||void 0===e?void 0:e.some((e=>e.message===t)))||(null===(i=this._currentMessageInfo)||void 0===i?void 0:i.message)===t}makeToastInvisible(){this.container.classList.remove(this._toastOpenedClass),this.container.style.animation="none",this._lastTimeOut&&clearTimeout(this._lastTimeOut)}displayToast(){this.container.classList.add(this._toastOpenedClass),this.container.style.animation=`fadein 0.5s, fadeout 0.5s ${this.fadeTime/1e3}s`}buildDataElementId(){var t,e;const i=a.addIDInfo(this._element),o=a.DATA_ELEMENT_ID_ATTRIBUTE_NAME;null===(t=this._elemBtnClose)||void 0===t||t.setAttribute(o,`${i}_buttonClose`),null===(e=this._elemText)||void 0===e||e.setAttribute(o,`${i}_title`)}componentDidLoad(){this.buildDataElementId()}render(){return i(o,null,i("div",{ref:t=>this.container=t,class:"toast__container"},this._currentMessageInfo.useIcon&&i("slot",{name:"icon"}),i("div",{lang:this._lang,ref:t=>this._elemText=t,class:this._currentMessageInfo.useIcon?"message__container message__container--icon":"message__container",title:this._currentMessageInfo.message,innerHTML:this._currentMessageInfo.message}),this._currentMessageInfo.canClose&&i("button",{class:"btn-close",onClick:()=>{this.hideToast()},ref:t=>this._elemBtnClose=t})))}get _element(){return s(this)}};n.style=':host{--ez-toast__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--ez-toast__container--z-index:var(--elevation--100, 100);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__container--left:var(--space--large, 24px);--ez-toast__container--bottom:var(--space--large, 24px);--ez-toast__container--width:400px;--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;box-sizing:border-box;border-radius:6px;align-items:center;padding:12px;visibility:hidden;width:var(--ez-toast__container--width);left:var(--ez-toast__container--left);bottom:var(--ez-toast__container--bottom);z-index:var(--ez-toast__container--z-index);background-color:var(--ez-toast__container--background-color)}.message__container{text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;text-overflow:ellipsis;font-family:var(--font-pattern, "Roboto")}.message__container--icon{width:80%;padding-left:var(--ez-toast__icon--padding-left)}.btn-close{margin-top:3px;display:flex;justify-content:flex-end;align-self:flex-start;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--ez-toast__btn__close__image);mask-image:var(--ez-toast__btn__close__image)}.toast__container--opened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@keyframes fadein{from{opacity:0;left:calc(var(--ez-toast__container--left) * -1)}to{opacity:1;left:var(--ez-toast__container--left)}}@-webkit-keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}@keyframes fadeout{from{opacity:1;left:var(--ez-toast__container--left)}to{bottom:0;opacity:0}}';export{n as ez_toast}
@@ -1 +1 @@
1
- import{r as i,c as t,h as o}from"./p-e4c7eb39.js";const r=class{constructor(o){i(this,o),this.actionTriggered=t(this,"actionTriggered",7),this.icon=void 0,this.command=void 0,this.title=void 0,this.value=void 0}async triggerAction(){this.actionTriggered.emit({command:this.command,value:this.value})}render(){return o("div",{id:`rich-toolbar-item-${this.icon}`,class:"rich-toolbar-item",title:this.title,onClick:this.triggerAction.bind(this)},o("ez-icon",{class:"toolbar-item",iconName:this.icon}))}};r.style="ez-icon.sc-ez-rich-toolbar-item{--ez-icon--color:var(--color--secondary, #383c45)}.rich-toolbar-item.sc-ez-rich-toolbar-item{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;border-radius:4px;cursor:pointer;transition:0.3s all ease-in-out}.rich-toolbar-item.sc-ez-rich-toolbar-item:hover{background-color:#f5f5f5}";export{r as ez_rich_toolbar_item}
1
+ import{r as i,c as t,h as o}from"./p-23a36bb6.js";const r=class{constructor(o){i(this,o),this.actionTriggered=t(this,"actionTriggered",7),this.icon=void 0,this.command=void 0,this.title=void 0,this.value=void 0}async triggerAction(){this.actionTriggered.emit({command:this.command,value:this.value})}render(){return o("div",{id:`rich-toolbar-item-${this.icon}`,class:"rich-toolbar-item",title:this.title,onClick:this.triggerAction.bind(this)},o("ez-icon",{class:"toolbar-item",iconName:this.icon}))}};r.style="ez-icon.sc-ez-rich-toolbar-item{--ez-icon--color:var(--color--secondary, #383c45)}.rich-toolbar-item.sc-ez-rich-toolbar-item{display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;border-radius:4px;cursor:pointer;transition:0.3s all ease-in-out}.rich-toolbar-item.sc-ez-rich-toolbar-item:hover{background-color:#f5f5f5}";export{r as ez_rich_toolbar_item}
@@ -1 +1 @@
1
- import{r as e,h as i,H as t,g as o}from"./p-e4c7eb39.js";import{ElementIDUtils as l}from"@sankhyalabs/core";const r=class{constructor(i){e(this,i),this.color="default",this.iconName=void 0,this.iconColor=void 0,this.smallTitleText=void 0,this.smallTitleMaximumLines=void 0,this.titleText=void 0,this.titleMaximumLines=void 0,this.descriptionText=void 0,this.descriptionMaximumLines=void 0,this.height=void 0,this.width=void 0,this.avatarProps=void 0,this.buttonProps=void 0,this.tags=void 0}async setButtonFocus(){var e;this._button&&(null===(e=this._button)||void 0===e||e.setFocus())}async setButtonBlur(){var e;this._button&&(null===(e=this._button)||void 0===e||e.setBlur())}renderBadges(){return this.tags&&0!==this.tags.length?this.tags.slice(0,3).map(((e,t)=>i("ez-badge",{id:`tag-${e.label}`,key:`tag-${t}`,label:e.label,size:"medium",style:{"--ez-badge--background-color":`var(${e.color}, #008561)`}}))):null}setCustomCSSProperties(){var e,i;const t=null!==(i=null===(e=this.buttonProps)||void 0===e?void 0:e.colors)&&void 0!==i?i:{},{background:o,backgroundHover:l,backgroundActive:r,text:a,textHover:m,textActive:n}=t;return Object.assign({},this.height&&{"--ez-tile-medium--custom-height":`${this.height}`},this.width&&{"--ez-tile-medium--custom-width":`${this.width}`},this.smallTitleMaximumLines&&{"--ez-tile-medium--small-title--maximum-lines":`${this.smallTitleMaximumLines}`},this.titleMaximumLines&&{"--ez-tile-medium--title--maximum-lines":`${this.titleMaximumLines}`},this.descriptionMaximumLines&&{"--ez-tile-medium--description--maximum-lines":`${this.descriptionMaximumLines}`},this.iconColor&&{"--ez-tile-medium--custom-icon-color":`var(${this.iconColor})`},o&&{"--ez-tile-medium_button--background-color":`var(${o}, #008561)`},l&&{"--ez-tile-medium_button--hover--background-color":`var(${l}, #00684C)`},r&&{"--ez-tile-medium_button--active--background-color":`var(${r}, #1A9171)`},a&&{"--ez-tile-medium_button--color":`var(${a}, #ffffff)`},m&&{"--ez-tile-medium_button--hover-color":`var(${m}, #ffffff)`},n&&{"--ez-tile-medium_button--active-color":`var(${n}, #ffffff)`})}componentDidLoad(){this.setCustomCSSProperties(),this._element&&l.addIDInfo(this._element),this._button&&l.addIDInfo(this._button,"tile-medium_button",{id:"embedded"})}render(){var e,o,l,r,a,m,n,d,c,u;return i(t,{style:this.setCustomCSSProperties()},i("div",{class:`tile-medium_container ${this.color}`},i("div",{class:"tile-medium_header"},i("div",{class:"tile-medium_header-image"},this.avatarProps?i("ez-avatar",{size:"60",name:null===(e=this.avatarProps)||void 0===e?void 0:e.name,imageSrc:null===(o=this.avatarProps)||void 0===o?void 0:o.imageSrc,shape:(null===(l=this.avatarProps)||void 0===l?void 0:l.shape)||"square"}):this.iconName&&i("ez-icon",{size:"x-large",class:"icon",iconName:this.iconName})),i("div",{class:"tag_group"},this.renderBadges())),i("div",{class:"tile-medium_content"},i("div",null,this.smallTitleText&&i("span",{class:"small_title",title:this.smallTitleText},this.smallTitleText),this.titleText&&i("span",{class:"main_title",title:this.titleText},this.titleText),this.descriptionText&&i("span",{class:"description",title:this.descriptionText},this.descriptionText)),this.buttonProps&&i("ez-button",{ref:e=>this._button=e,class:"tile-medium_button",label:(null===(r=this.buttonProps)||void 0===r?void 0:r.label)||void 0,enabled:null===(m=null===(a=this.buttonProps)||void 0===a?void 0:a.enabled)||void 0===m||m,mode:null===(n=this.buttonProps)||void 0===n?void 0:n.mode,iconName:null===(d=this.buttonProps)||void 0===d?void 0:d.iconName,size:null===(c=this.buttonProps)||void 0===c?void 0:c.size,onClick:null===(u=this.buttonProps)||void 0===u?void 0:u.onClick}))))}get _element(){return o(this)}};r.style=":host{--ez-tile-medium--width:446px;--ez-tile-medium--height:257px;--ez-tile-medium--padding:var(--space--24, 24px);--ez-tile-medium--border-radius:var(--border--radius-16, 16px);--ez-tile-medium--background-color:var(--color--ocean-gray-70, #ffffff);--ez-tile-medium--color:var(--color--ocean-green-900, #003D2D);--ez-tile-medium--icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile-medium--font-family:var(--font-pattern, Arial);--ez-tile-medium--header-gap:var(--space--16, 16px);--ez-tile-medium--icon-line-height:var(--line-height--30, 30px);--ez-tile-medium--tag-group-gap:var(--space--4, 4px);--ez-tile-medium_button--background-color:var(--color--ocean-green-600, #1A9171);--ez-tile-medium_button--color:var(--color--gray-70, #ffffff);--ez-tile-medium_button--hover--background-color:var(--color--ocean-green-700, #00684C);--ez-tile-medium_button--hover-color:var(--color--gray-70, #ffffff);--ez-tile-medium_button--active--background-color:var(--color--ocean-green-500, #1A9171);--ez-tile-medium_button--active-color:var(--color--gray-70, #ffffff)}.tile-medium_container{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;overflow:hidden;outline:none;box-shadow:none;width:var(--ez-tile-medium--custom-width, var(--ez-tile-medium--width));height:var(--ez-tile-medium--custom-height, var(--ez-tile-medium--height));border-radius:var(--ez-tile-medium--border-radius);background-color:var(--ez-tile-medium--background-color);color:var(--ez-tile-medium--color);box-sizing:border-box;padding:var(--ez-tile-medium--padding)}.tile-medium_header{display:flex;flex-direction:row;align-items:flex-start;align-self:stretch;width:100%;gap:var(--ez-tile-medium--header-gap)}.tile-medium_header-image{display:flex;align-items:flex-start;gap:var(--space--10, 10px);flex:1 0 0}.tag_group{display:flex;flex-direction:row;gap:var(--ez-tile-medium--tag-group-gap);flex-wrap:wrap;justify-content:flex-end}.tile-medium_content{display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:var(--space--14, 14px);align-self:stretch}span{font-family:var(--ez-tile-medium--font-family);display:-webkit-box;-webkit-box-orient:vertical;width:100%;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:pre-wrap;align-self:stretch;font-style:normal}.small_title{color:var(--color--gray-400, #77777A);font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--regular);line-height:var(--line-height--20, 20px);-webkit-line-clamp:var(--ez-tile-medium--small-title--maximum-lines, 1);line-clamp:var(--ez-tile-medium--small-title--maximum-lines,1)}.main_title{color:var(--color--ocean-green-900, #003D2D);font-size:var(--font-size--xxlarge, 22px);font-weight:var(--font-weight--bold);line-height:var(--line-height--32, 32px);-webkit-line-clamp:var(--ez-tile-medium--title--maximum-lines, 1);line-clamp:var(--ez-tile-medium--title--maximum-lines,1)}.description{color:var(--color--ocean-green-900, #003D2D);font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--regular);line-height:var(--line-height--24, 24px);-webkit-line-clamp:var(--ez-tile-medium--description--maximum-lines, 3);line-clamp:var(--ez-tile-medium--description--maximum-lines, 3)}.tile-medium_button{--ez-button--background-color:var(--ez-tile-medium_button--background-color);--ez-button--color:var(--ez-tile-medium_button--color);--ez-button--hover--background-color:var(--ez-tile-medium_button--hover--background-color);--ez-button--hover-color:var(--ez-tile-medium_button--hover-color);--ez-button--active--background-color:var(--ez-tile-medium_button--active--background-color);--ez-button--active-color:var(--ez-tile-medium_button--active-color)}ez-icon{--ez-icon--color:var(--ez-tile-medium--custom-icon-color, var(--ez-tile-medium--icon-color));line-height:var(--ez-tile-medium--icon-line-height)}.green{--ez-tile-medium--background-color:var(--color--ocean-green-90);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--ocean-green-500))}.gray{--ez-tile-medium--background-color:var(--color--gray-80);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--ocean-green-400))}.red{--ez-tile-medium--background-color:var(--color--red-100);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--red-300))}.yellow{--ez-tile-medium--background-color:var(--color--yellow-100);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--yellow-400))}";export{r as ez_tile_medium}
1
+ import{r as e,h as i,H as t,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as l}from"@sankhyalabs/core";const r=class{constructor(i){e(this,i),this.color="default",this.iconName=void 0,this.iconColor=void 0,this.smallTitleText=void 0,this.smallTitleMaximumLines=void 0,this.titleText=void 0,this.titleMaximumLines=void 0,this.descriptionText=void 0,this.descriptionMaximumLines=void 0,this.height=void 0,this.width=void 0,this.avatarProps=void 0,this.buttonProps=void 0,this.tags=void 0}async setButtonFocus(){var e;this._button&&(null===(e=this._button)||void 0===e||e.setFocus())}async setButtonBlur(){var e;this._button&&(null===(e=this._button)||void 0===e||e.setBlur())}renderBadges(){return this.tags&&0!==this.tags.length?this.tags.slice(0,3).map(((e,t)=>i("ez-badge",{id:`tag-${e.label}`,key:`tag-${t}`,label:e.label,size:"medium",style:{"--ez-badge--background-color":`var(${e.color}, #008561)`}}))):null}setCustomCSSProperties(){var e,i;const t=null!==(i=null===(e=this.buttonProps)||void 0===e?void 0:e.colors)&&void 0!==i?i:{},{background:o,backgroundHover:l,backgroundActive:r,text:a,textHover:m,textActive:n}=t;return Object.assign({},this.height&&{"--ez-tile-medium--custom-height":`${this.height}`},this.width&&{"--ez-tile-medium--custom-width":`${this.width}`},this.smallTitleMaximumLines&&{"--ez-tile-medium--small-title--maximum-lines":`${this.smallTitleMaximumLines}`},this.titleMaximumLines&&{"--ez-tile-medium--title--maximum-lines":`${this.titleMaximumLines}`},this.descriptionMaximumLines&&{"--ez-tile-medium--description--maximum-lines":`${this.descriptionMaximumLines}`},this.iconColor&&{"--ez-tile-medium--custom-icon-color":`var(${this.iconColor})`},o&&{"--ez-tile-medium_button--background-color":`var(${o}, #008561)`},l&&{"--ez-tile-medium_button--hover--background-color":`var(${l}, #00684C)`},r&&{"--ez-tile-medium_button--active--background-color":`var(${r}, #1A9171)`},a&&{"--ez-tile-medium_button--color":`var(${a}, #ffffff)`},m&&{"--ez-tile-medium_button--hover-color":`var(${m}, #ffffff)`},n&&{"--ez-tile-medium_button--active-color":`var(${n}, #ffffff)`})}componentDidLoad(){this.setCustomCSSProperties(),this._element&&l.addIDInfo(this._element),this._button&&l.addIDInfo(this._button,"tile-medium_button",{id:"embedded"})}render(){var e,o,l,r,a,m,n,d,c,u;return i(t,{style:this.setCustomCSSProperties()},i("div",{class:`tile-medium_container ${this.color}`},i("div",{class:"tile-medium_header"},i("div",{class:"tile-medium_header-image"},this.avatarProps?i("ez-avatar",{size:"60",name:null===(e=this.avatarProps)||void 0===e?void 0:e.name,imageSrc:null===(o=this.avatarProps)||void 0===o?void 0:o.imageSrc,shape:(null===(l=this.avatarProps)||void 0===l?void 0:l.shape)||"square"}):this.iconName&&i("ez-icon",{size:"x-large",class:"icon",iconName:this.iconName})),i("div",{class:"tag_group"},this.renderBadges())),i("div",{class:"tile-medium_content"},i("div",null,this.smallTitleText&&i("span",{class:"small_title",title:this.smallTitleText},this.smallTitleText),this.titleText&&i("span",{class:"main_title",title:this.titleText},this.titleText),this.descriptionText&&i("span",{class:"description",title:this.descriptionText},this.descriptionText)),this.buttonProps&&i("ez-button",{ref:e=>this._button=e,class:"tile-medium_button",label:(null===(r=this.buttonProps)||void 0===r?void 0:r.label)||void 0,enabled:null===(m=null===(a=this.buttonProps)||void 0===a?void 0:a.enabled)||void 0===m||m,mode:null===(n=this.buttonProps)||void 0===n?void 0:n.mode,iconName:null===(d=this.buttonProps)||void 0===d?void 0:d.iconName,size:null===(c=this.buttonProps)||void 0===c?void 0:c.size,onClick:null===(u=this.buttonProps)||void 0===u?void 0:u.onClick}))))}get _element(){return o(this)}};r.style=":host{--ez-tile-medium--width:446px;--ez-tile-medium--height:257px;--ez-tile-medium--padding:var(--space--24, 24px);--ez-tile-medium--border-radius:var(--border--radius-16, 16px);--ez-tile-medium--background-color:var(--color--ocean-gray-70, #ffffff);--ez-tile-medium--color:var(--color--ocean-green-900, #003D2D);--ez-tile-medium--icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile-medium--font-family:var(--font-pattern, Arial);--ez-tile-medium--header-gap:var(--space--16, 16px);--ez-tile-medium--icon-line-height:var(--line-height--30, 30px);--ez-tile-medium--tag-group-gap:var(--space--4, 4px);--ez-tile-medium_button--background-color:var(--color--ocean-green-600, #1A9171);--ez-tile-medium_button--color:var(--color--gray-70, #ffffff);--ez-tile-medium_button--hover--background-color:var(--color--ocean-green-700, #00684C);--ez-tile-medium_button--hover-color:var(--color--gray-70, #ffffff);--ez-tile-medium_button--active--background-color:var(--color--ocean-green-500, #1A9171);--ez-tile-medium_button--active-color:var(--color--gray-70, #ffffff)}.tile-medium_container{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;overflow:hidden;outline:none;box-shadow:none;width:var(--ez-tile-medium--custom-width, var(--ez-tile-medium--width));height:var(--ez-tile-medium--custom-height, var(--ez-tile-medium--height));border-radius:var(--ez-tile-medium--border-radius);background-color:var(--ez-tile-medium--background-color);color:var(--ez-tile-medium--color);box-sizing:border-box;padding:var(--ez-tile-medium--padding)}.tile-medium_header{display:flex;flex-direction:row;align-items:flex-start;align-self:stretch;width:100%;gap:var(--ez-tile-medium--header-gap)}.tile-medium_header-image{display:flex;align-items:flex-start;gap:var(--space--10, 10px);flex:1 0 0}.tag_group{display:flex;flex-direction:row;gap:var(--ez-tile-medium--tag-group-gap);flex-wrap:wrap;justify-content:flex-end}.tile-medium_content{display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:var(--space--14, 14px);align-self:stretch}span{font-family:var(--ez-tile-medium--font-family);display:-webkit-box;-webkit-box-orient:vertical;width:100%;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:pre-wrap;align-self:stretch;font-style:normal}.small_title{color:var(--color--gray-400, #77777A);font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--regular);line-height:var(--line-height--20, 20px);-webkit-line-clamp:var(--ez-tile-medium--small-title--maximum-lines, 1);line-clamp:var(--ez-tile-medium--small-title--maximum-lines,1)}.main_title{color:var(--color--ocean-green-900, #003D2D);font-size:var(--font-size--xxlarge, 22px);font-weight:var(--font-weight--bold);line-height:var(--line-height--32, 32px);-webkit-line-clamp:var(--ez-tile-medium--title--maximum-lines, 1);line-clamp:var(--ez-tile-medium--title--maximum-lines,1)}.description{color:var(--color--ocean-green-900, #003D2D);font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--regular);line-height:var(--line-height--24, 24px);-webkit-line-clamp:var(--ez-tile-medium--description--maximum-lines, 3);line-clamp:var(--ez-tile-medium--description--maximum-lines, 3)}.tile-medium_button{--ez-button--background-color:var(--ez-tile-medium_button--background-color);--ez-button--color:var(--ez-tile-medium_button--color);--ez-button--hover--background-color:var(--ez-tile-medium_button--hover--background-color);--ez-button--hover-color:var(--ez-tile-medium_button--hover-color);--ez-button--active--background-color:var(--ez-tile-medium_button--active--background-color);--ez-button--active-color:var(--ez-tile-medium_button--active-color)}ez-icon{--ez-icon--color:var(--ez-tile-medium--custom-icon-color, var(--ez-tile-medium--icon-color));line-height:var(--ez-tile-medium--icon-line-height)}.green{--ez-tile-medium--background-color:var(--color--ocean-green-90);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--ocean-green-500))}.gray{--ez-tile-medium--background-color:var(--color--gray-80);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--ocean-green-400))}.red{--ez-tile-medium--background-color:var(--color--red-100);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--red-300))}.yellow{--ez-tile-medium--background-color:var(--color--yellow-100);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--yellow-400))}";export{r as ez_tile_medium}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as o,g as e}from"./p-e4c7eb39.js";import{ObjectUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import"./p-7e5c7b4c.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as a}from"./p-af47458b.js";import"./p-30ffb9ed.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._lookupMode=!1,this.isOpen=!1,this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.limitCharsToSearch=3,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!0,this.canShowError=!0,this.mode="regular",this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.autoFocus=!1,this.preventAutoFocus=!1,this.alternativePlaceholder=void 0,this.textEmptyOption=void 0}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)try{if("string"==typeof t)return void this.setInputValue();const s=this.getSelectedOption(t),o=this.getSelectedOption(i),e=this.getSelectedOption(this.value);this.isDifferentValues(e,s)&&(this.value=s),this.isDifferentValues(s,o)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===s?void 0:s)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(t,i){h.equals(t,i)||this.loadOptions(d.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.sanitizeValue(this.value)))}),100)}:t=>t(this.sanitizeValue(this.value)))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}isDifferentValues(t,i){return h.objectToString(t||{})!==h.objectToString(i||{})}getFormattedText(t){if(null!=t)return this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label}getText(){const t=this.getSelectedOption(this.sanitizeValue(this.value)),i=this.getFormattedText(t);if(null!=i)return String(i).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t}updateVisibleOptions(){let t=this._source||[];if(this._criteria){const i=this._criteria.toUpperCase();t=t.filter((t=>t.label.toLocaleUpperCase().indexOf(i)>-1))}this.hasToAddEmptyoption(t)&&(t=[{value:void 0,label:this.textEmptyOption||this.i18n("ez-combo-box.placeholder")}].concat(t)),this._visibleOptions=t,this._maxWidthValue=this.getMaxWidthValue()}hasToAddEmptyoption(t){return!this.suppressEmptyOption&&!t.filter((t=>!t.value)).length}getMaxWidthValue(){var t;if(this.showOptionValue){const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}async showOptions(){var t,i;if(!this.enabled)return;await this.openPopover();const s=null!==(i=null===(t=this.value)||void 0===t?void 0:t.value)&&void 0!==i?i:this.value,o=this._visibleOptions.findIndex((t=>t.value===s));this._preSelection=-1===o?0:o,this._resizeObserver&&this._resizeObserver.observe(this._textInput),this.preventAutoFocus||await this.setFocus()}hideOptions(){var t;null===(t=this._popover)||void 0===t||t.hide(),this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,t.then((t=>{this._showLoading=!1,this.updateSource(t)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1)):this.selectOption(t))}selectOption(t,i=!0){var s,o,e;const h=this.getSelectedOption(this.value);(null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(o=null==t?void 0:t.value)||void 0===o?void 0:o.toString())||null==h&&null!=t&&"value"in t?(this.value=(null==t?void 0:t.value)?t:void 0,null===(e=this._popover)||void 0===e||e.hide()):this.resetOptions(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.sanitizeValue(this.value)?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue(!1)}),this._deboucingTime)}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}sanitizeValue(t){if("undefined"!==t&&"null"!==t)return t}async componentWillLoad(){if(this.i18n=await a(),void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value");s||(s=i),this.options.push({label:i,value:s}),t.hidden=!0}))}this.loadOptions(d.PRELOAD)}setResizeObserver(){this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&this._textInput&&this._comboBoxList&&(this._comboBoxList.width=this._textInput.clientWidth)}))}))}connectedCallback(){this._resizeObserver||this.setResizeObserver()}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this.setResizeObserver(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._popover)||void 0===t||t.remove(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}handlerIconClick(){this.showOptions()}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim();this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this.updateVisibleOptions(),this.showOptions()):(this._preSelection=void 0,this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.showOptions()}keyDownHandler(t){var i,s,o,e,h,r;if(t.ctrlKey&&("f"===t.key||"F"===t.key))return this.loadOptions(d.ADVANCED),t.preventDefault(),void t.stopPropagation();switch(t.key){case"ArrowDown":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(i=this._comboBoxList)||void 0===i||i.nextOption());break;case"ArrowUp":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(s=this._comboBoxList)||void 0===s||s.previousOption());break;case"Enter":this.isOpen&&(t.preventDefault(),null===(o=this._comboBoxList)||void 0===o||o.selectCurrentOption());break;case"Escape":this.isOpen&&(t.preventDefault(),null===(e=this._popover)||void 0===e||e.hide());break;case"Tab":this._tabPressed=!0,this.isOpen&&(null===(h=this._comboBoxList)||void 0===h||h.selectCurrentOption(),null===(r=this._popover)||void 0===r||r.hide())}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}async openPopover(){var t;this.isOpen=!0,await(null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput))}render(){var t;return r.addIDInfoIfNotExists(this.el,"input"),s(o,null,s("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),class:"text-input-slot-container "+(this.suppressSearch?"suppressed-search-input":""),ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder||this.i18n("ez-combo-box.placeholder")},s("button",{class:"btn",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},s("ez-icon",{iconName:"chevron-down"}))),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none",onEzVisibilityChange:t=>this.isOpen=t.detail,"data-element-id":this.el.getAttribute("data-element-id")},s("ez-combo-box-list",{ref:t=>this._comboBoxList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this.i18n("ez-combo-box.noResults"),showOptionValue:this.showOptionValue,preSelection:this._preSelection,maxWidth:this._maxWidthValue,width:null===(t=this._textInput)||void 0===t?void 0:t.clientWidth,onOptionSelect:t=>this.selectOption(t),onOptionHover:t=>this._preSelection=t})))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var d;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(d||(d={})),l.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.btn{outline:none;border:none;background:none;cursor:pointer;padding:0px;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}.text-input-slot-container{--ez-text-input__icon--width:32px;--ez-text-input__min-width:var(--ez-combo-box__min-width);--ez-text-input__max-width:var(--ez-combo-box__max-width)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{l as ez_combo_box}
1
+ import{r as t,c as i,h as s,H as o,g as e}from"./p-23a36bb6.js";import{ObjectUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import"./p-7e5c7b4c.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as a}from"./p-af47458b.js";import"./p-30ffb9ed.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._lookupMode=!1,this.isOpen=!1,this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.limitCharsToSearch=3,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!0,this.canShowError=!0,this.mode="regular",this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.autoFocus=!1,this.preventAutoFocus=!1,this.alternativePlaceholder=void 0,this.textEmptyOption=void 0}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)try{if("string"==typeof t)return void this.setInputValue();const s=this.getSelectedOption(t),o=this.getSelectedOption(i),e=this.getSelectedOption(this.value);this.isDifferentValues(e,s)&&(this.value=s),this.isDifferentValues(s,o)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===s?void 0:s)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(t,i){h.equals(t,i)||this.loadOptions(d.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.sanitizeValue(this.value)))}),100)}:t=>t(this.sanitizeValue(this.value)))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}isDifferentValues(t,i){return h.objectToString(t||{})!==h.objectToString(i||{})}getFormattedText(t){if(null!=t)return this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label}getText(){const t=this.getSelectedOption(this.sanitizeValue(this.value)),i=this.getFormattedText(t);if(null!=i)return String(i).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t}updateVisibleOptions(){let t=this._source||[];if(this._criteria){const i=this._criteria.toUpperCase();t=t.filter((t=>t.label.toLocaleUpperCase().indexOf(i)>-1))}this.hasToAddEmptyoption(t)&&(t=[{value:void 0,label:this.textEmptyOption||this.i18n("ez-combo-box.placeholder")}].concat(t)),this._visibleOptions=t,this._maxWidthValue=this.getMaxWidthValue()}hasToAddEmptyoption(t){return!this.suppressEmptyOption&&!t.filter((t=>!t.value)).length}getMaxWidthValue(){var t;if(this.showOptionValue){const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}async showOptions(){var t,i;if(!this.enabled)return;await this.openPopover();const s=null!==(i=null===(t=this.value)||void 0===t?void 0:t.value)&&void 0!==i?i:this.value,o=this._visibleOptions.findIndex((t=>t.value===s));this._preSelection=-1===o?0:o,this._resizeObserver&&this._resizeObserver.observe(this._textInput),this.preventAutoFocus||await this.setFocus()}hideOptions(){var t;null===(t=this._popover)||void 0===t||t.hide(),this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,t.then((t=>{this._showLoading=!1,this.updateSource(t)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1)):this.selectOption(t))}selectOption(t,i=!0){var s,o,e;const h=this.getSelectedOption(this.value);(null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(o=null==t?void 0:t.value)||void 0===o?void 0:o.toString())||null==h&&null!=t&&"value"in t?(this.value=(null==t?void 0:t.value)?t:void 0,null===(e=this._popover)||void 0===e||e.hide()):this.resetOptions(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.sanitizeValue(this.value)?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue(!1)}),this._deboucingTime)}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}sanitizeValue(t){if("undefined"!==t&&"null"!==t)return t}async componentWillLoad(){if(this.i18n=await a(),void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value");s||(s=i),this.options.push({label:i,value:s}),t.hidden=!0}))}this.loadOptions(d.PRELOAD)}setResizeObserver(){this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&this._textInput&&this._comboBoxList&&(this._comboBoxList.width=this._textInput.clientWidth)}))}))}connectedCallback(){this._resizeObserver||this.setResizeObserver()}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this.setResizeObserver(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._popover)||void 0===t||t.remove(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}handlerIconClick(){this.showOptions()}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim();this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this.updateVisibleOptions(),this.showOptions()):(this._preSelection=void 0,this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.showOptions()}keyDownHandler(t){var i,s,o,e,h,r;if(t.ctrlKey&&("f"===t.key||"F"===t.key))return this.loadOptions(d.ADVANCED),t.preventDefault(),void t.stopPropagation();switch(t.key){case"ArrowDown":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(i=this._comboBoxList)||void 0===i||i.nextOption());break;case"ArrowUp":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(s=this._comboBoxList)||void 0===s||s.previousOption());break;case"Enter":this.isOpen&&(t.preventDefault(),null===(o=this._comboBoxList)||void 0===o||o.selectCurrentOption());break;case"Escape":this.isOpen&&(t.preventDefault(),null===(e=this._popover)||void 0===e||e.hide());break;case"Tab":this._tabPressed=!0,this.isOpen&&(null===(h=this._comboBoxList)||void 0===h||h.selectCurrentOption(),null===(r=this._popover)||void 0===r||r.hide())}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}async openPopover(){var t;this.isOpen=!0,await(null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput))}render(){var t;return r.addIDInfoIfNotExists(this.el,"input"),s(o,null,s("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),class:"text-input-slot-container "+(this.suppressSearch?"suppressed-search-input":""),ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder||this.i18n("ez-combo-box.placeholder")},s("button",{class:"btn",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},s("ez-icon",{iconName:"chevron-down"}))),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none",onEzVisibilityChange:t=>this.isOpen=t.detail,"data-element-id":this.el.getAttribute("data-element-id")},s("ez-combo-box-list",{ref:t=>this._comboBoxList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this.i18n("ez-combo-box.noResults"),showOptionValue:this.showOptionValue,preSelection:this._preSelection,maxWidth:this._maxWidthValue,width:null===(t=this._textInput)||void 0===t?void 0:t.clientWidth,onOptionSelect:t=>this.selectOption(t),onOptionHover:t=>this._preSelection=t})))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var d;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(d||(d={})),l.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.btn{outline:none;border:none;background:none;cursor:pointer;padding:0px;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}.text-input-slot-container{--ez-text-input__icon--width:32px;--ez-text-input__min-width:var(--ez-combo-box__min-width);--ez-text-input__max-width:var(--ez-combo-box__max-width)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{l as ez_combo_box}