@sankhyalabs/ezui 5.22.0-dev.92 → 5.22.0-dev.94

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 (175) 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-badge.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-card-item_2.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +2 -2
  15. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-dropdown_2.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
  24. package/dist/cjs/ez-form.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-grid.cjs.entry.js +5 -3
  26. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-popover-core_2.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  42. package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  49. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  50. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  51. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  52. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  53. package/dist/cjs/ezui.cjs.js +1 -1
  54. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  55. package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +0 -3
  56. package/dist/cjs/loader.cjs.js +1 -1
  57. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
  58. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -2
  59. package/dist/custom-elements/index.js +5 -3
  60. package/dist/esm/ez-actions-button.entry.js +1 -1
  61. package/dist/esm/ez-alert-list.entry.js +1 -1
  62. package/dist/esm/ez-alert.entry.js +1 -1
  63. package/dist/esm/ez-application.entry.js +1 -1
  64. package/dist/esm/ez-badge.entry.js +1 -1
  65. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  66. package/dist/esm/ez-button.entry.js +1 -1
  67. package/dist/esm/ez-calendar.entry.js +1 -1
  68. package/dist/esm/ez-card-item_2.entry.js +1 -1
  69. package/dist/esm/ez-chart.entry.js +1 -1
  70. package/dist/esm/ez-check.entry.js +1 -1
  71. package/dist/esm/ez-chip.entry.js +1 -1
  72. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  73. package/dist/esm/ez-combo-box-list_3.entry.js +2 -2
  74. package/dist/esm/ez-combo-box.entry.js +1 -1
  75. package/dist/esm/ez-date-input.entry.js +1 -1
  76. package/dist/esm/ez-date-time-input.entry.js +1 -1
  77. package/dist/esm/ez-dialog.entry.js +1 -1
  78. package/dist/esm/ez-double-list.entry.js +1 -1
  79. package/dist/esm/ez-dropdown_2.entry.js +1 -1
  80. package/dist/esm/ez-file-item.entry.js +1 -1
  81. package/dist/esm/ez-filter-input.entry.js +1 -1
  82. package/dist/esm/ez-form-view.entry.js +2 -2
  83. package/dist/esm/ez-form.entry.js +1 -1
  84. package/dist/esm/ez-grid.entry.js +5 -3
  85. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  86. package/dist/esm/ez-icon.entry.js +1 -1
  87. package/dist/esm/ez-list.entry.js +1 -1
  88. package/dist/esm/ez-loading-bar.entry.js +1 -1
  89. package/dist/esm/ez-modal-container.entry.js +1 -1
  90. package/dist/esm/ez-modal.entry.js +1 -1
  91. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  92. package/dist/esm/ez-number-input.entry.js +1 -1
  93. package/dist/esm/ez-popover-core_2.entry.js +1 -1
  94. package/dist/esm/ez-popover.entry.js +1 -1
  95. package/dist/esm/ez-popup.entry.js +1 -1
  96. package/dist/esm/ez-radio-button.entry.js +1 -1
  97. package/dist/esm/ez-scroller_2.entry.js +1 -1
  98. package/dist/esm/ez-search.entry.js +1 -1
  99. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  100. package/dist/esm/ez-split-button.entry.js +1 -1
  101. package/dist/esm/ez-split-item.entry.js +1 -1
  102. package/dist/esm/ez-split-panel.entry.js +1 -1
  103. package/dist/esm/ez-tabselector.entry.js +1 -1
  104. package/dist/esm/ez-text-area.entry.js +1 -1
  105. package/dist/esm/ez-text-input.entry.js +1 -1
  106. package/dist/esm/ez-time-input.entry.js +1 -1
  107. package/dist/esm/ez-toast.entry.js +1 -1
  108. package/dist/esm/ez-tooltip.entry.js +1 -1
  109. package/dist/esm/ez-tree.entry.js +1 -1
  110. package/dist/esm/ez-upload.entry.js +1 -1
  111. package/dist/esm/ez-view-stack.entry.js +1 -1
  112. package/dist/esm/ezui.js +2 -2
  113. package/dist/esm/filter-column.entry.js +1 -1
  114. package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +1 -3
  115. package/dist/esm/loader.js +2 -2
  116. package/dist/ezui/ezui.esm.js +1 -1
  117. package/dist/ezui/{p-e6b38ade.entry.js → p-0306dff7.entry.js} +1 -1
  118. package/dist/ezui/{p-91ccae0c.entry.js → p-09de35a2.entry.js} +1 -1
  119. package/dist/ezui/{p-88c615f0.entry.js → p-0fa52b0f.entry.js} +1 -1
  120. package/dist/ezui/{p-92fbaf2b.entry.js → p-0faf71c5.entry.js} +1 -1
  121. package/dist/ezui/p-15134d97.entry.js +1 -0
  122. package/dist/ezui/{p-b2f6bc0a.entry.js → p-17be134a.entry.js} +1 -1
  123. package/dist/ezui/{p-c96fbbef.entry.js → p-17de16e5.entry.js} +1 -1
  124. package/dist/ezui/{p-24b42f3d.entry.js → p-17eabf46.entry.js} +1 -1
  125. package/dist/ezui/{p-3885e66e.entry.js → p-1ad6c61b.entry.js} +1 -1
  126. package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
  127. package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
  128. package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
  129. package/dist/ezui/p-20cb13fa.entry.js +1 -0
  130. package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
  131. package/dist/ezui/{p-6d31c43c.entry.js → p-2bb2a0c4.entry.js} +1 -1
  132. package/dist/ezui/{p-ca8936df.entry.js → p-2f45506d.entry.js} +1 -1
  133. package/dist/ezui/{p-9fc250d4.entry.js → p-3195a7a7.entry.js} +1 -1
  134. package/dist/ezui/{p-23dab72f.entry.js → p-31b71e50.entry.js} +1 -1
  135. package/dist/ezui/{p-b22889ea.entry.js → p-3429080c.entry.js} +1 -1
  136. package/dist/ezui/{p-0378416a.entry.js → p-44caad9a.entry.js} +1 -1
  137. package/dist/ezui/{p-7567ccdd.entry.js → p-555c9018.entry.js} +1 -1
  138. package/dist/ezui/{p-3791d9c8.entry.js → p-556468d9.entry.js} +1 -1
  139. package/dist/ezui/{p-9066b0b0.entry.js → p-56fe5341.entry.js} +1 -1
  140. package/dist/ezui/{p-cf3b60fd.entry.js → p-58783dcf.entry.js} +1 -1
  141. package/dist/ezui/{p-044d46d5.entry.js → p-5b205c80.entry.js} +1 -1
  142. package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
  143. package/dist/ezui/{p-f1c2c19e.entry.js → p-650e4b6d.entry.js} +1 -1
  144. package/dist/ezui/{p-03b0ed5a.entry.js → p-65f471bc.entry.js} +1 -1
  145. package/dist/ezui/{p-be72b472.entry.js → p-664b91e8.entry.js} +2 -2
  146. package/dist/ezui/{p-6d8b3298.entry.js → p-6cdd3e0a.entry.js} +1 -1
  147. package/dist/ezui/{p-fc194825.entry.js → p-6e429cff.entry.js} +1 -1
  148. package/dist/ezui/{p-11bfeca3.entry.js → p-77a4bd35.entry.js} +1 -1
  149. package/dist/ezui/{p-fcc999c4.entry.js → p-7bd15498.entry.js} +1 -1
  150. package/dist/ezui/{p-2069c78a.entry.js → p-7e677b7b.entry.js} +1 -1
  151. package/dist/ezui/{p-e18d9e6a.entry.js → p-7fdd479f.entry.js} +1 -1
  152. package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
  153. package/dist/ezui/{p-a921e3e7.entry.js → p-990b4318.entry.js} +1 -1
  154. package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
  155. package/dist/ezui/{p-0cfbbe82.entry.js → p-a4cee65d.entry.js} +1 -1
  156. package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
  157. package/dist/ezui/p-bc2f844e.entry.js +1 -0
  158. package/dist/ezui/{p-92748142.entry.js → p-c0d9c4f8.entry.js} +1 -1
  159. package/dist/ezui/{p-4818b8ce.entry.js → p-c1527804.entry.js} +1 -1
  160. package/dist/ezui/{p-b9282c79.entry.js → p-cb1535f7.entry.js} +1 -1
  161. package/dist/ezui/{p-f4da7e1e.entry.js → p-cf87aacb.entry.js} +1 -1
  162. package/dist/ezui/{p-5010315a.entry.js → p-d9548bdf.entry.js} +1 -1
  163. package/dist/ezui/{p-708b196e.entry.js → p-da1b4a38.entry.js} +1 -1
  164. package/dist/ezui/{p-c7035d65.entry.js → p-dc73e1fe.entry.js} +1 -1
  165. package/dist/ezui/{p-bef7daac.entry.js → p-e347df9c.entry.js} +1 -1
  166. package/dist/ezui/{p-9e95bfeb.entry.js → p-e6a9041d.entry.js} +1 -1
  167. package/dist/ezui/{p-68b2e579.entry.js → p-ea54d056.entry.js} +1 -1
  168. package/dist/ezui/{p-b3b5647e.entry.js → p-f5931caa.entry.js} +1 -1
  169. package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
  170. package/dist/ezui/{p-e3f8660b.entry.js → p-fd0a19d6.entry.js} +1 -1
  171. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
  172. package/package.json +1 -1
  173. package/dist/ezui/p-39f3efcf.entry.js +0 -1
  174. package/dist/ezui/p-6ec40dec.entry.js +0 -1
  175. package/dist/ezui/p-f30e0590.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as o,g as r}from"./p-e4c7eb39.js";import{MaskFormatter as n,ElementIDUtils as s}from"@sankhyalabs/core";const a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mask=void 0,this.cleanValueMask=!1,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1,this.password=!1,this.autoFocus=!1,this.hasRightSlotContent=!1}observeErrorMessage(){this._inputElem&&this.isInvalid().then((t=>{var i;t?(this._inputElem.classList.add("hasError"),null===(i=this._tooltipPositioningObserver)||void 0===i||i.observe(this._inputElem)):(this._inputElem.classList.remove("hasError"),this.removeGlobalTooltip())}))}observeMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}observeValue(t,i){this._inputElem&&t!=i&&(this._inputElem.value=this.value||"",this.handleChange(),this.adjustFloatingLabel(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}isSlaveMode(){var t,i;return"true"===(null===(i=null===(t=this._hostElement)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.slaveMode)}adjustColorContentSlot(t=""){this._contentLeftSlot&&(this._contentLeftSlot.style.color=t)}adjustBorderInput(){this.noBorder&&this._inputElem.classList.add("input__slim--noborder")}async setFocus(t){const{selectText:i}=t||{};i&&this._inputElem.select(),this._inputElem.focus()}async setBlur(){this._inputElem.blur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this.cleanValueMask?this.applyMask(t):this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.controlChangeValue(),this.adjustFloatingLabel(),this.adjustColorContentSlot()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}controlChangeValue(){this._inputElem&&(this.value||"")!==this._inputElem.value&&(this.value=this.cleanValueMask?this._maskFormatter.removeMask(this._inputElem.value):this._inputElem.value)}applyMask(t){if(!t||""===t)return t;if(this._maskFormatter)try{const i=this._maskFormatter.applyMask(this._maskFormatter.removeMask(t));return this._inputElem?(this._inputElem.value=i,this._inputElem.value):(this.value=i,this.value)}catch(t){this.errorMessage=t.message}return t}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=null==this._lastValidValue?"":this._lastValidValue,this.controlChangeValue()}handleSlotChange(t){var i;const e=t.target,o=e.assignedElements()[0];this.hasRightSlotContent=!1,o&&(o.style.position="absolute",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.overflow="hidden",o.style.top="0px",o.style.width="var(--ez-text-input__icon--width)",o.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==e.name?(o.style.left="0px",o.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left"),this._contentLeftSlot=o):"rightIcon"==e.name&&(o.style.right="0px",o.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"),this._tooltipIconElem&&this._tooltipIconElem.classList.add("rightIconSlot"),this.hasRightSlotContent=(null===(i=o.children)||void 0===i?void 0:i.length)>0),e.name&&s.addIDInfo(o,e.name)),this.observeErrorMessage()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated"),this.adjustColorContentSlot("var(--ez-text-input__input--focus--icon-color)")}renderGlobalTooltip(){const t=document.createElement("ez-tooltip");t.errorMessage=this.errorMessage,t.anchoringElement=this._tooltipIconElem,document.body.appendChild(t),this._tooltipElem=t}removeGlobalTooltip(){var t;this._tooltipElem&&(this._tooltipElem.remove(),this._tooltipElem=void 0,null===(t=this._tooltipPositioningObserver)||void 0===t||t.unobserve(this._inputElem))}createTooltipPositioningObserver(){const t=new ResizeObserver((()=>{this._tooltipElem&&this._tooltipIconElem&&(clearTimeout(this._observerDebounceTimeout),this._observerDebounceTimeout=setTimeout((async()=>{this._tooltipElem&&await this._tooltipElem.positionTooltip()}),200))}));this._tooltipPositioningObserver=t}componentWillLoad(){if(this.observeMask(),this.value){if(this._maskFormatter)try{this.cleanValueMask?this.applyMask(this.value):this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}componentDidLoad(){var t,i;this.observeErrorMessage(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})})),null===(t=this._inputElem)||void 0===t||t.addEventListener("focus",(()=>{var t;this._inputElem.setSelectionRange(0,null===(t=this._inputElem)||void 0===t?void 0:t.value.length)})),this.createTooltipPositioningObserver(),this._inputElem&&(null===(i=this._tooltipPositioningObserver)||void 0===i||i.observe(this._inputElem),(t=>{if(!t||!t.style)return void console.error("[applyEllipsisToInput] Referência ao elemento input é inválida.");t.style.textOverflow="ellipsis",t.style.overflow="hidden",t.style.whiteSpace="nowrap";const i=()=>{t.scrollWidth>t.clientWidth?t.setAttribute("title",t.value||""):t.removeAttribute("title")};t.addEventListener("input",i),i()})(this._inputElem))}componentDidRender(){this._tooltipIconElem&&!this._tooltipElem&&this.renderGlobalTooltip()}componentDidUpdate(){this._tooltipIconElem&&this._tooltipElem&&this._tooltipElem.positionTooltip()}disconnectedCallback(){this._tooltipPositioningObserver&&this._tooltipPositioningObserver.disconnect(),this._observerDebounceTimeout&&clearTimeout(this._observerDebounceTimeout),this.removeGlobalTooltip()}render(){return s.addIDInfoIfNotExists(this._hostElement,"input"),e(o,{style:this._hostElement.classList.contains("grid_editor")?{height:"100%"}:null},e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:`${this.enabled?"input__label":"input__label input__label--disabled"} ${this.errorMessage?"hasError":""}`,onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{"data-element-id":s.getInternalIDInfo("input"),onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:this.password?"password":"text",class:"slim"===this.mode?"input--slim":"",placeholder:"slim"===this.mode&&this.label?this.label:"",value:this.mask&&this.cleanValueMask?this.applyMask(this.value):this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),this.canShowError&&"slim"!=this.mode&&this.errorMessage&&e("ez-icon",{class:`tooltip-icon ${this.errorMessage?"hasError":""} ${this.hasRightSlotContent?"rightIconSlot":""}`,"data-element-id":s.getInternalIDInfo("tooltip-icon"),ref:t=>this._tooltipIconElem=t,iconName:"alert-circle"}),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}," "))}get _hostElement(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],mask:["observeMask"],value:["observeValue"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;z-index:var(--elevation--4);border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";export{a as ez_text_input}
1
+ import{r as t,c as i,h as e,H as o,g as r}from"./p-23a36bb6.js";import{MaskFormatter as n,ElementIDUtils as s}from"@sankhyalabs/core";const a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mask=void 0,this.cleanValueMask=!1,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1,this.password=!1,this.autoFocus=!1,this.hasRightSlotContent=!1}observeErrorMessage(){this._inputElem&&this.isInvalid().then((t=>{var i;t?(this._inputElem.classList.add("hasError"),null===(i=this._tooltipPositioningObserver)||void 0===i||i.observe(this._inputElem)):(this._inputElem.classList.remove("hasError"),this.removeGlobalTooltip())}))}observeMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}observeValue(t,i){this._inputElem&&t!=i&&(this._inputElem.value=this.value||"",this.handleChange(),this.adjustFloatingLabel(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}isSlaveMode(){var t,i;return"true"===(null===(i=null===(t=this._hostElement)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.slaveMode)}adjustColorContentSlot(t=""){this._contentLeftSlot&&(this._contentLeftSlot.style.color=t)}adjustBorderInput(){this.noBorder&&this._inputElem.classList.add("input__slim--noborder")}async setFocus(t){const{selectText:i}=t||{};i&&this._inputElem.select(),this._inputElem.focus()}async setBlur(){this._inputElem.blur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this.cleanValueMask?this.applyMask(t):this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.controlChangeValue(),this.adjustFloatingLabel(),this.adjustColorContentSlot()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}controlChangeValue(){this._inputElem&&(this.value||"")!==this._inputElem.value&&(this.value=this.cleanValueMask?this._maskFormatter.removeMask(this._inputElem.value):this._inputElem.value)}applyMask(t){if(!t||""===t)return t;if(this._maskFormatter)try{const i=this._maskFormatter.applyMask(this._maskFormatter.removeMask(t));return this._inputElem?(this._inputElem.value=i,this._inputElem.value):(this.value=i,this.value)}catch(t){this.errorMessage=t.message}return t}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=null==this._lastValidValue?"":this._lastValidValue,this.controlChangeValue()}handleSlotChange(t){var i;const e=t.target,o=e.assignedElements()[0];this.hasRightSlotContent=!1,o&&(o.style.position="absolute",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.overflow="hidden",o.style.top="0px",o.style.width="var(--ez-text-input__icon--width)",o.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==e.name?(o.style.left="0px",o.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left"),this._contentLeftSlot=o):"rightIcon"==e.name&&(o.style.right="0px",o.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"),this._tooltipIconElem&&this._tooltipIconElem.classList.add("rightIconSlot"),this.hasRightSlotContent=(null===(i=o.children)||void 0===i?void 0:i.length)>0),e.name&&s.addIDInfo(o,e.name)),this.observeErrorMessage()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated"),this.adjustColorContentSlot("var(--ez-text-input__input--focus--icon-color)")}renderGlobalTooltip(){const t=document.createElement("ez-tooltip");t.errorMessage=this.errorMessage,t.anchoringElement=this._tooltipIconElem,document.body.appendChild(t),this._tooltipElem=t}removeGlobalTooltip(){var t;this._tooltipElem&&(this._tooltipElem.remove(),this._tooltipElem=void 0,null===(t=this._tooltipPositioningObserver)||void 0===t||t.unobserve(this._inputElem))}createTooltipPositioningObserver(){const t=new ResizeObserver((()=>{this._tooltipElem&&this._tooltipIconElem&&(clearTimeout(this._observerDebounceTimeout),this._observerDebounceTimeout=setTimeout((async()=>{this._tooltipElem&&await this._tooltipElem.positionTooltip()}),200))}));this._tooltipPositioningObserver=t}componentWillLoad(){if(this.observeMask(),this.value){if(this._maskFormatter)try{this.cleanValueMask?this.applyMask(this.value):this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}componentDidLoad(){var t,i;this.observeErrorMessage(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})})),null===(t=this._inputElem)||void 0===t||t.addEventListener("focus",(()=>{var t;this._inputElem.setSelectionRange(0,null===(t=this._inputElem)||void 0===t?void 0:t.value.length)})),this.createTooltipPositioningObserver(),this._inputElem&&(null===(i=this._tooltipPositioningObserver)||void 0===i||i.observe(this._inputElem),(t=>{if(!t||!t.style)return void console.error("[applyEllipsisToInput] Referência ao elemento input é inválida.");t.style.textOverflow="ellipsis",t.style.overflow="hidden",t.style.whiteSpace="nowrap";const i=()=>{t.scrollWidth>t.clientWidth?t.setAttribute("title",t.value||""):t.removeAttribute("title")};t.addEventListener("input",i),i()})(this._inputElem))}componentDidRender(){this._tooltipIconElem&&!this._tooltipElem&&this.renderGlobalTooltip()}componentDidUpdate(){this._tooltipIconElem&&this._tooltipElem&&this._tooltipElem.positionTooltip()}disconnectedCallback(){this._tooltipPositioningObserver&&this._tooltipPositioningObserver.disconnect(),this._observerDebounceTimeout&&clearTimeout(this._observerDebounceTimeout),this.removeGlobalTooltip()}render(){return s.addIDInfoIfNotExists(this._hostElement,"input"),e(o,{style:this._hostElement.classList.contains("grid_editor")?{height:"100%"}:null},e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:`${this.enabled?"input__label":"input__label input__label--disabled"} ${this.errorMessage?"hasError":""}`,onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{"data-element-id":s.getInternalIDInfo("input"),onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:this.password?"password":"text",class:"slim"===this.mode?"input--slim":"",placeholder:"slim"===this.mode&&this.label?this.label:"",value:this.mask&&this.cleanValueMask?this.applyMask(this.value):this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),this.canShowError&&"slim"!=this.mode&&this.errorMessage&&e("ez-icon",{class:`tooltip-icon ${this.errorMessage?"hasError":""} ${this.hasRightSlotContent?"rightIconSlot":""}`,"data-element-id":s.getInternalIDInfo("tooltip-icon"),ref:t=>this._tooltipIconElem=t,iconName:"alert-circle"}),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}," "))}get _hostElement(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],mask:["observeMask"],value:["observeValue"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;z-index:var(--elevation--4);border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";export{a as ez_text_input}
@@ -13,6 +13,7 @@ export default class AgGridController implements EzGridController, SortingProvid
13
13
  private readonly RECORD_ARCHIVE_COL_ID;
14
14
  private readonly BLOCK_LOAD_DEBOUNCE;
15
15
  private readonly DEFAULT_FONT_SIZE;
16
+ private readonly DEFAULT_FONT_SIZE_HTML5;
16
17
  private readonly DEFAULT_ICON_SIZE;
17
18
  private readonly DEFAULT_MAX_SIZE;
18
19
  private readonly DOC_WIDTH;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "5.22.0-dev.92",
3
+ "version": "5.22.0-dev.94",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as o,h as t,a as i,H as e,c as s,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as a,ObjectUtils as l,HTMLBuilder as c,StringUtils as n}from"@sankhyalabs/core";import{C as d}from"./p-4607fb89.js";import{A as h}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";const b=class{constructor(t){o(this,t),this.showLoading=void 0,this.visibleOptions=void 0,this.textEmptyList="Nenhum resultado encontrado",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(){this.preSelection=void 0===this.preSelection?0:Math.min(this.preSelection+1,this.visibleOptions.length-1),this.scrollToOption(this.visibleOptions[this.preSelection])}async previousOption(){this.preSelection=void 0===this.preSelection?0:Math.max(this.preSelection-1,0),this.scrollToOption(this.visibleOptions[this.preSelection])}async selectCurrentOption(){void 0!==this.preSelection&&(this.onOptionSelect(this.visibleOptions[this.preSelection]),this.preSelection=void 0)}observeWidth(o,t){o!==t&&this._listWrapper&&(this._listWrapper.style.width=`${this.width}px`)}observeMaxWidth(o,t){o!==t&&this._listWrapper&&(this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:"")}handleKeyDown(o){switch(o.key){case"ArrowDown":o.preventDefault(),o.stopPropagation(),this.nextOption();break;case"ArrowUp":o.preventDefault(),o.stopPropagation(),this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.preSelection=void 0}}buildItem(o,i){const e=this.showOptionValue&&this.maxWidth>0?`${this.maxWidth}px`:"";return o.label=o.label||o.value,t("li",{class:i===this.preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.onOptionSelect(o),onMouseOver:()=>this.preSelection=i},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:e,minWidth:e,maxWidth:e}},o.value):void 0,t("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:o.label},o.label))}scrollToOption(o){window.requestAnimationFrame((()=>{const t=(null==o?void 0:o.value)?this._optionsList.querySelector(`li#item_${o.value.replace(/[ <>\[\]#=]/g,"\\$&").replace(/:/g,"\\:")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}componentDidLoad(){this._listWrapper.style.width=`${this.width}px`,this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:""}componentDidRender(){var o;null===(o=this._optionsList)||void 0===o||o.querySelectorAll(".item").forEach((o=>{a.addIDInfoIfNotExists(o,"itemComboBox")}))}render(){return t("section",{class:"list-container"},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("ul",{class:"list-options",ref:o=>this._optionsList=o},!this.showLoading&&0===this.visibleOptions.length&&t("div",{class:"message"},t("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&t("div",{class:"message"},t("div",{class:"message__loading"})),this.showOptionValue&&t("span",{class:"item__value item__value--hidden"}),!this.showLoading&&this.visibleOptions.length>0&&this.visibleOptions.map(((o,t)=>this.buildItem(o,t))))))}static get watchers(){return{width:["observeWidth"],maxWidth:["observeMaxWidth"]}}};b.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;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 m=class{constructor(t){o(this,t),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 o,t;null===(t=null===(o=this.gui)||void 0===o?void 0:o.setFocus)||void 0===t||t.call(o)}async setBlur(){var o,t;null===(t=null===(o=this.gui)||void 0===o?void 0:o.setBlur)||void 0===t||t.call(o)}async isInvalid(){var o,t;return(null===(t=null===(o=this.gui)||void 0===o?void 0:o.isInvalid)||void 0===t?void 0:t.call(o))||!1}watchValue(){this.handleValue(this.gui)}watchCustomEditor(){this.getContent()}watchFormViewField(o,t){l.equals(o,t)||this.getContent()}watchDetailContext(){this.getContent()}watchBuilderFallback(){this.getContent()}watchSelectedRecord(o,t){(null==o?void 0:o.__record__id__)!==(null==t?void 0:t.__record__id__)&&this.getContent()}getContent(){var o,e,s,r,a;const l=new Map;for(const o in this.formViewField.props)l.set(o,this.formViewField.props[o]);const h={value:this.value,name:this.formViewField.name,currentEditor:this.builderFallback(this.formViewField),setValue:o=>this.setValue(o),getValue:this.getValue,record:this.selectedRecord,editorMetadata:{label:this.formViewField.label,hidden:!1===(null===(o=this.formViewField.props)||void 0===o?void 0:o.visible),userInterface:this.formViewField.userInterface,options:null===(e=this.formViewField.props)||void 0===e?void 0:e.options,props:this.formViewField.props?l:void 0,optionLoader:this.formViewField.optionLoader},source:d.FORM,detailContext:this.detailContext};let b=this.customEditor.getEditorElement(h);if(!b)return b=this.builderFallback(this.formViewField),this.handleValue(b),void(this.gui=b);if(!(b instanceof i)&&"string"!=typeof b)return this.handleValue(b),void(this.gui=b);"string"==typeof b&&(b=c.parseElement(b));const m=null!==(a=null!==(r=null===(s=this.value)||void 0===s?void 0:s.value)&&void 0!==r?r:this.value)&&void 0!==a?a:"";b.setAttribute("value",m),this.gui=t("div",{key:n.generateUUID(),ref:o=>o&&o.appendChild(b)})}setValue(o){this.value=o}getValue(){return this.value}handleValue(o){var t;null===(t=o.o)||void 0===t||t.forEach((o=>{o.t.value=this.value}))}componentWillLoad(){this.getContent()}render(){return t(e,null,this.gui)}static get watchers(){return{value:["watchValue"],customEditor:["watchCustomEditor"],formViewField:["watchFormViewField"],detailContext:["watchDetailContext"],builderFallback:["watchBuilderFallback"],selectedRecord:["watchSelectedRecord"]}}},v=class{constructor(t){o(this,t),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(o,t=!1){var i,e;const s=null===(e=null===(i=this._inputElement)||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=s){const i=this.getWidthValue(o);s.style.width=i+"px",t&&setTimeout((()=>s.select()),100)}}getWidthValue(o){if(null!=this._valueBasis){const t=this._valueBasis;if(null!=o){const i=2;return t.innerHTML=o,t.clientWidth>0?t.clientWidth+i:i}t.innerHTML=""}return 0}setStyledInput(){var o,t;let i="",e="",s="";null!=this.styled&&(i=this.styled.fontSize,e=this.styled.fontWeight,s=this.styled.fontFamily);const r=null===(t=null===(o=this._inputElement)||void 0===o?void 0:o.shadowRoot)||void 0===t?void 0:t.querySelector("input");null!=r&&(r.style.fontSize=i,r.style.fontWeight=e,r.style.fontFamily=s);const a=this._valueBasis;null!=a&&(a.style.fontSize=i,a.style.fontWeight=e,a.style.fontFamily=s)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):h.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(o,t=!1){this._newValue=o,this.calcSizeInput(this._newValue,t)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return a.addIDInfoIfNotExists(this._element,"input"),t(e,null,t("span",{class:"text-edit__hidden-value",ref:o=>this._valueBasis=o}),t("ez-text-input",{"data-element-id":a.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:o=>this._inputElement=o,mode:"slim",onEzChange:o=>this.setNewValue(null==o?void 0:o.detail),noBorder:!0}),t("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),t("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return r(this)}};v.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{b as ez_combo_box_list,m as ez_custom_form_input,v as ez_text_edit}
@@ -1 +0,0 @@
1
- import{r as o,c as t,h as i}from"./p-e4c7eb39.js";const s=class{constructor(i){o(this,i),this.applicationLoaded=t(this,"applicationLoaded",7)}componentWillLoad(){}componentDidLoad(){this.applicationLoaded.emit(!0)}render(){return i("div",null)}};s.style="";export{s as ez_application}
@@ -1 +0,0 @@
1
- import{h as e,r as a,c as t,g as n,H as r}from"./p-e4c7eb39.js";import{ObjectUtils as l,UserInterface as o,ElementIDUtils as i}from"@sankhyalabs/core";import{R as s}from"./p-05e1f4e7.js";import{C as d}from"./p-b853763b.js";function c(a,t,n,r,l){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-bottom--large"},e("ez-check",{enabled:!n,label:t,mode:l?d.SWITCH:d.REGULAR,"data-field-name":a,"data-context-name":r,key:a}))}function m(a,t,n,r,l,o,i){return e("div",{class:"ez-col ez-col--sd-12"},e("ez-number-input",{class:"ez-input__no-margin",enabled:!n,label:t,precision:r,prettyPrecision:l,"data-field-name":a,"data-context-name":o,key:a,canShowError:i}))}const u=({name:a,label:t,readOnly:n,contextName:r,canShowError:l,props:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-text-input",{class:"ez-input__no-margin",label:t,"data-field-name":a,"data-context-name":r,key:a,enabled:!n,canShowError:l,mask:null==o?void 0:o.mask,"clean-value-mask":null==o?void 0:o.cleanValueMask})),h=new Map;h.set(o.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),h.set(o.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),h.set(o.OPTIONSELECTOR,(({name:a,label:t,readOnly:n,required:r,props:l,contextName:o,canShowError:i})=>{const s=null==l?void 0:l.options;let d;if("string"==typeof s){const e=JSON.parse(s);d=Object.keys(e).map((a=>({value:a,label:e[a]})))}else d=s;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:r,label:t,"data-field-name":a,"data-context-name":o,key:a,options:d,canShowError:i}))})),h.set(o.DATE,(({name:a,label:t,readOnly:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:r})))),h.set(o.TIME,(({name:a,label:t,readOnly:n,canShowError:r,props:l})=>{var o;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:r,"show-seconds":null!==(o=null==l?void 0:l.showSeconds)&&void 0!==o&&o}))})),h.set(o.ELAPSEDTIME,(({name:a,label:t,readOnly:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:r,showSeconds:!0})))),h.set(o.DATETIME,(({name:a,label:t,readOnly:n,contextName:r,canShowError:l})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,"data-context-name":r,key:a,canShowError:l})))),h.set(o.FILE,(({name:a,label:t,readOnly:n,contextName:r,props:o})=>{const i=l.removeEmptyValues({subTitle:o.subTitle,requestHeaders:Object.assign(Object.assign({},o.STORAGESTRATEGY&&{STORAGESTRATEGY:o.STORAGESTRATEGY}),o.INTERNAL_FILENAME&&{INTERNAL_FILENAME:o.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12"},e("ez-upload",Object.assign({enabled:!n,label:t,"data-field-name":a,"data-context-name":r,key:a},i)))})),h.set(o.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:n,contextName:r,canShowError:l})=>{var o,i;const s=Number(null!==(o=null==n?void 0:n.precision)&&void 0!==o?o:2);return m(e,a,t,s,Number(null!==(i=null==n?void 0:n.prettyPrecision)&&void 0!==i?i:s),r,l)})),h.set(o.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:n,canShowError:r})=>m(e,a,t,0,0,n,r))),h.set(o.SEARCH,(({name:a,label:t,readOnly:n,required:r,contextName:l,canShowError:o,optionLoader:i,props:s})=>{var d;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:r,label:t,"data-field-name":a,"data-context-name":l,key:a,canShowError:o,optionLoader:i,ignoreLimitCharsToSearch:null!==(d=s.ignoreLimitCharsToSearch)&&void 0!==d&&d}))})),h.set(o.LONGTEXT,(({name:a,label:t,readOnly:n,contextName:r,rows:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12",key:a},e("ez-text-area",{enabled:!n,label:t,"data-field-name":a,"data-context-name":r,rows:l,canShowError:o}))));const p=e=>{const a=h.get(e.userInterface)||u,t=e.required?`${e.label}${s}`:e.label,n=a(Object.assign(Object.assign({},e),{label:t}));return n.t["data-form-item"]=e.name,n};class b{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class z{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new b(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const w=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this.fields=void 0,this.selectedRecord=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(e,a,t){const n=new Map(this._customEditors);n.set(e,{customEditor:a,detailContext:t}),this._customEditors=n}async setFieldProp(e,a,t){const n=this.fields.map((n=>(n.name!==e||!t&&0!==t||(n.props=n.props||{},n.props[a]=t),n)));this.fields=[...n]}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let n=a.get(t);null==n&&(n=[],a.set(t,n)),n.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this._formElements=Array.from(this._element.querySelectorAll("[data-field-name]")),this.ezContentReady.emit(this._formElements);const e=new z(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[o.FILE,o.LONGTEXT].includes(e)}buildFormItemElement(a,t=""){var n;if(this.isItemFullWidth(a.userInterface)&&(t+=" input-full_width"),this._customEditors.has(a.name)){const r=null===(n=this._formElements.map((e=>({name:e.dataset.fieldName,value:e.value}))).find((e=>e.name===a.name)))||void 0===n?void 0:n.value,l=this._customEditors.get(a.name).customEditor;return e("div",{class:t},e("ez-custom-form-input",{"data-field-name":a.name,customEditor:l,formViewField:a,builderFallback:p,value:r,selectedRecord:this.selectedRecord}))}return e("div",{class:t},p(a))}render(){if(i.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],t=Array.from(this.groupFields(this.fields).entries()).map((([t,n])=>{if(Array.isArray(n))return e("ez-collapsible-box",{id:`group-${t}`,label:t,"header-size":"large",key:t},e("div",{class:"form-view__content"},n.map((e=>this.buildFormItemElement(e)))));a.push(n)})),n=a.map((e=>this.buildFormItemElement(e))),l=e("div",{class:"form-view__content"},n);return e(r,null,l,t)}get _element(){return n(this)}};w.style=".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:220px;--ez-form-view__item--width:var(--space--small);--ez-form-view__item--padding:var(--space--small)}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--width);padding-inline:var(--ez-form-view__item--padding);width:100%}.input-full_width.sc-ez-form-view{grid-column:1 / -1;width:100%}";export{w as ez_form_view}