@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-76625.0 → 0.0.0-bugfix-dev-KB-83282.0

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 (68) hide show
  1. package/dist/cjs/ez-card-item_2.cjs.entry.js +7 -1415
  2. package/dist/cjs/ez-combo-box-list_3.cjs.entry.js +387 -0
  3. package/dist/cjs/ez-combo-box.cjs.entry.js +58 -184
  4. package/dist/cjs/ez-grid.cjs.entry.js +58 -0
  5. package/dist/cjs/ez-popover-core_2.cjs.entry.js +1504 -0
  6. package/dist/cjs/ez-search.cjs.entry.js +158 -28
  7. package/dist/cjs/ezui.cjs.js +1 -1
  8. package/dist/cjs/index-a7b0c73d.js +6 -6
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +2 -2
  11. package/dist/collection/components/ez-card-item/ez-card-item.css +3 -1
  12. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css +205 -0
  13. package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js +426 -0
  14. package/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -250
  15. package/dist/collection/components/ez-combo-box/ez-combo-box.js +61 -194
  16. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
  17. package/dist/collection/components/ez-grid/ez-grid.js +56 -1
  18. package/dist/collection/components/ez-popover-plus/ez-popover-plus.js +27 -33
  19. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css +2 -2
  20. package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js +18 -77
  21. package/dist/collection/components/ez-search/ez-search.css +219 -0
  22. package/dist/collection/components/ez-search/ez-search.js +167 -28
  23. package/dist/custom-elements/index.d.ts +6 -6
  24. package/dist/custom-elements/index.js +468 -359
  25. package/dist/esm/ez-card-item_2.entry.js +7 -1415
  26. package/dist/esm/ez-combo-box-list_3.entry.js +381 -0
  27. package/dist/esm/ez-combo-box.entry.js +59 -185
  28. package/dist/esm/ez-grid.entry.js +59 -1
  29. package/dist/esm/ez-popover-core_2.entry.js +1499 -0
  30. package/dist/esm/ez-search.entry.js +159 -29
  31. package/dist/esm/ezui.js +1 -1
  32. package/dist/esm/index-baa5e267.js +6 -6
  33. package/dist/esm/loader.js +1 -1
  34. package/dist/ezui/ezui.esm.js +1 -1
  35. package/dist/ezui/p-3a009184.entry.js +1 -0
  36. package/dist/ezui/{p-a5950a0d.entry.js → p-53116373.entry.js} +46 -46
  37. package/dist/ezui/p-58783dcf.entry.js +1 -0
  38. package/dist/ezui/p-65f471bc.entry.js +1 -0
  39. package/dist/ezui/p-7bd15498.entry.js +1 -0
  40. package/dist/ezui/p-f5931caa.entry.js +1 -0
  41. package/dist/types/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.d.ts +104 -0
  42. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +7 -16
  43. package/dist/types/components/ez-grid/ez-grid.d.ts +5 -0
  44. package/dist/types/components/ez-popover-plus/ez-popover-plus.d.ts +4 -5
  45. package/dist/types/components/ez-popover-plus/subcomponent/ez-popover-core.d.ts +2 -12
  46. package/dist/types/components/ez-search/ez-search.d.ts +13 -3
  47. package/dist/types/components.d.ts +127 -66
  48. package/package.json +1 -1
  49. package/react/components.d.ts +1 -1
  50. package/react/components.js +1 -1
  51. package/react/components.js.map +1 -1
  52. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +0 -236
  53. package/dist/cjs/ez-popover-plus_3.cjs.entry.js +0 -184
  54. package/dist/cjs/searchFormatters-b7e1ed1e.js +0 -23
  55. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css +0 -227
  56. package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js +0 -289
  57. package/dist/collection/components/ez-search/utils/searchFormatters.js +0 -18
  58. package/dist/esm/ez-custom-form-input_2.entry.js +0 -231
  59. package/dist/esm/ez-popover-plus_3.entry.js +0 -178
  60. package/dist/esm/searchFormatters-8229207e.js +0 -20
  61. package/dist/ezui/p-31da1b57.entry.js +0 -1
  62. package/dist/ezui/p-37201156.entry.js +0 -1
  63. package/dist/ezui/p-40a60148.js +0 -1
  64. package/dist/ezui/p-64b461b3.entry.js +0 -1
  65. package/dist/ezui/p-b7706b43.entry.js +0 -1
  66. package/dist/ezui/p-dc8b36c3.entry.js +0 -1
  67. package/dist/types/components/ez-search/subcomponent/search-list/search-list.d.ts +0 -23
  68. package/dist/types/components/ez-search/utils/searchFormatters.d.ts +0 -2
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,H as e,g as r}from"./p-23a36bb6.js";import{C as o}from"./p-ec7db713.js";import{ObjectUtils as a,StringUtils as h,FloatingManager as l,ElementIDUtils as n}from"@sankhyalabs/core";import{A as c}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-4607fb89.js";import{R as d}from"./p-05e1f4e7.js";const u=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._showLoadingDescription=!1,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.contextProperties=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1,this.ensureClearButtonVisible=!1,this.suppressPreLoad=!0,this.autoFocus=!1}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,!(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())&&this.errorMessage&&this.setInputValue())}getValue(t){return"object"==typeof t?null==t?void 0:t.value:t}validateNewValue(t,i){const s=this.getValue(t),e=this.getValue(i);return!("[object Object]"===s||s===e)}async observeValue(t,i){if(this._textInput&&this.validateNewValue(t,i)){if("string"==typeof t)return void await this.handleValueAsString(t);const i=this.getSelectedOption(t),s=this.getSelectedOption(this._currentValue);this.isDifferentValues(s,i)&&(this._currentValue=i,this.setInputValue(),this.ezChange.emit(null!=i?i:void 0)),this.resetOptions()}}observeOptions(t,i){!t.length&&this.suppressPreLoad||(null==t?void 0:t.join(""))!==(null==i?void 0:i.join(""))&&this.loadOptions(v.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.value))}),100)}:t=>t(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()}scrollListener(){var t;null!=this._floatingID&&((null===(t=this.listOptionsPosition)||void 0===t?void 0:t.hardPosition)?this.hideOptions():window.requestAnimationFrame((()=>{this.updateListPosition()})))}async handleValueAsString(t){this.getSelectedOption(t)?this.setInputValue():(await this.loadDescriptionValue(t),this._currentValue&&(this.setInputValue(),this.ezChange.emit(this.value),this._currentValue=this.value))}updateListPosition(){let{verticalPosition:t,horizontalPosition:i,fromBottom:s,fromRight:e,bottomLimit:r,hardPosition:o}=this.getListPosition();const a=this._listWrapper.getBoundingClientRect(),h=this._listContainer.getBoundingClientRect(),l=this._textInput.getBoundingClientRect(),n=r||window.innerHeight;!s&&(a.top<0||h.bottom+a.height>n)&&(s=!0),o||(t=t||0,i=i||0,s?t=window.innerHeight-l.top+t:t+=h.top,e?i=window.innerWidth-l.right+i:i+=h.left),null!=t&&(this._listWrapper.style[s?"bottom":"top"]=`${t}px`,this._listWrapper.style[s?"top":"bottom"]=""),null!=i&&(this._listWrapper.style[e?"right":"left"]=`${i}px`,this._listWrapper.style[e?"left":"right"]="")}getListPosition(){return this.listOptionsPosition?this.listOptionsPosition:{verticalPosition:6}}isDifferentValues(t,i){return a.objectToString(t||{})!==a.objectToString(i||{})}getFormattedText(t){if(null==t)return;let i=this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label;return i=null==i?void 0:i.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),i}getText(){const t=this.getSelectedOption(this._currentValue),i=this.getFormattedText(t);return this.replaceQuotes(i)}replaceQuotes(t){if(null!=t)return String(t).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?Object.assign(Object.assign({},t),{value:this.replaceHighlight(null==t?void 0:t.value),label:this.replaceHighlight(null==t?void 0:t.label)}):t}updateVisibleOptions(){let t=this._source||[];this._visibleOptions=this.suppressEmptyOption?t:[{value:void 0,label:""}].concat(t),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var t;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}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}createOption(t){let{key:i,title:s}=t;const e=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");s=h.decodeHtmlEntities(s);const o={value:null==i?void 0:i.replace(e,"").replace(r,""),label:null==s?void 0:s.replace(e,"").replace(r,"")};this.selectOption(o)}buildItem(t,i){t.label=t.label||t.value;const e={key:t.value,title:t.label,details:t.details};return s("div",{style:{height:"100%"},class:i===this._preSelection?"item preselected":"item",id:`item_${t.value}`,onMouseDown:()=>this.createOption(e),onMouseOver:()=>this._preSelection=i},s("ez-card-item",{item:e,compacted:!0,enableKey:this.showOptionValue}))}showOptions(){this.enabled&&(this.isOptionsVisible()||(this._resizeObserver&&this._resizeObserver.observe(this._textInput),this._floatingID=l.float(this._listWrapper,this._listContainer,{autoClose:!1,isFixed:!0,backClickListener:()=>this.hideOptions()}),this.setFocus(),window.requestAnimationFrame((()=>{this.updateListPosition(),this.listOptionsPosition||this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))))}hideOptions(){void 0!==this._floatingID&&l.close(this._floatingID),this._floatingID=void 0,this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}isOptionsVisible(){return void 0!==this._floatingID&&l.isFloating(this._floatingID)}nextOption(){this.isOptionsVisible()&&(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection]))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection])}scrollToOption(t){window.requestAnimationFrame((()=>{const i=(null==t?void 0:t.value)?this._optionsList.querySelector(`div#item_${t.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;i&&i.scrollIntoView({behavior:"smooth",block:"nearest"})}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,this._showLoadingDescription=!0,t.then((t=>{this.updateSource(t)})).finally((()=>{this._showLoading=!1,this._showLoadingDescription=!1})),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch(!1))):this.selectOption(t))}clearSource(){this._source=[],this.updateVisibleOptions()}replaceHighlight(t){const i=new RegExp(this._startHighlightTag,"g"),s=new RegExp(this._endHighlightTag,"g"),e=String(null!=t?t:"").replace(i,"").replace(s,"");return this.replaceQuotes(e)}selectOption(t,i=!0){var s,e;const r=this.getSelectedOption(this.value),o=Object.assign(Object.assign({},t),{value:this.replaceHighlight(null==t?void 0:t.value),label:this.replaceHighlight(null==t?void 0:t.label)}),a=Object.assign(Object.assign({},o),{value:this.replaceQuotes(null==o?void 0:o.value),label:this.replaceQuotes(null==o?void 0:o.label)});if((null===(s=null==r?void 0:r.value)||void 0===s?void 0:s.toString())!==(null===(e=null==a?void 0:a.value)||void 0===e?void 0:e.toString())||null==r&&null!=a&&"value"in a){const t=(null==a?void 0:a.value)?a:void 0;this.value=t,this._currentValue=t}else this.setInputValue(),this.resetOptions();this._visibleOptions=[],this.clearSource(),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.contextProperties):this.options)}cancelPreselection(){!this._textInput.value&&this._currentValue?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null,this._currentValue=null}controlListWithOnlyOne(t=!0){var i,s;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((t=>""!==t.label&&null!=t.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");let o=h.decodeHtmlEntities(e[0].label);const a={value:null===(s=e[0].value)||void 0===s?void 0:s.replace(i,"").replace(r,""),label:null==o?void 0:o.replace(i,"").replace(r,"")};this.selectOption(a,t)}}controlEmptySearch(t=!0){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne(t):(this.clearSearch(),c.info(this._textEmptyList))}async loadDescriptionValue(t){var i,s;if(null==t)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(t);const e={mode:v.PREDICTIVE,argument:t},r=await(null===(s=this.optionLoader)||void 0===s?void 0:s.call(this,e,this.contextProperties));null!=r&&(r instanceof Promise?r.then((t=>{this.setDescriptionValue(t)})):this.setDescriptionValue(r))}setDescriptionValue(t){const i=(null==t?void 0:t[0])||t;null!=i&&Object.keys(i).length?(this._currentValue=i?Object.assign(Object.assign({},i),{value:this.replaceHighlight(i.value),label:this.replaceHighlight(i.label)}):i,this.value=this._currentValue,this.setTextInputValue()):this.showNoResultMessage()}setTextInputValue(){if(this._textInput&&null==this._textInput.value){if(null==this.value)return;const t="string"==typeof this.value?this.value:this.getFormattedText(this.value);this._textInput.value=this.replaceQuotes(t)}}loadOptionValue(t){var i;const s=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===t));null!=s?this.selectOption(s):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),c.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var t;return null===(t=this.label)||void 0===t?void 0:t.replace(d,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}async handleInitialValue(){if(!this.getValue(this.value))return;if("string"==typeof this.value)return void await this.handleValueAsString(this.value);let t=this.getFormattedText(this.value);t=this.replaceQuotes(t),this._textInput.value=t}componentWillLoad(){if(void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value"),e=t.getAttribute("details");s||(s=i),this.options.push({label:i,value:s,details:e}),t.hidden=!0}))}this.updateSource([])}componentDidRender(){var t;void 0===this._floatingID&&this._listWrapper.remove(),null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{n.addIDInfoIfNotExists(t,"itemSearch")}))}async componentDidLoad(){this._currentValue=this.value,o.applyVarsTextInput(this.el,this._textInput),this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{if(!Array.isArray(t)||!t.length)return;const{clientWidth:i}=this._listContainer;i>0&&this._listWrapper&&(this._listWrapper.style.width=`${i}px`)}))})),await this.handleInitialValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._resizeObserver)||void 0===t||t.disconnect()}handlerIconClick(){this.loadOptions(v.ADVANCED)}buildNumberArgument(t){return this.isTextSearch?NaN:Number(t||void 0)}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(),e=this.buildNumberArgument(s);this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this._showLoading=!1,this.clearSource(),this.ignoreLimitCharsToSearch||!isNaN(e)||s.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(v.PREDICTIVE,isNaN(e)?s:e.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}keyDownHandler(t){switch(this._tabPressed=!1,t.ctrlKey&&("f"!==t.key&&"F"!==t.key||(this.loadOptions(v.ADVANCED),t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault())),t.key){case"ArrowDown":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),this.nextOption();break;case"ArrowUp":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),this.previousOption();break;case"Enter":this.handleEventPropagation(t),this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne(!1)}}handleEventPropagation(t){this._listContainer.hasChildNodes()&&this.stopPropagateEnterKeyEvent&&t.stopPropagation()}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}canShowLoadSpinDescription(){return this._showLoadingDescription&&null==this._floatingID}render(){var t;return n.addIDInfoIfNotExists(this.el,"input"),s(e,null,s("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},s("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},this.canShowLoadSpinDescription()?s("div",{class:"message__loading"}):s("ez-icon",{iconName:"search"})),(null===(t=this._textInput)||void 0===t?void 0:t.value)&&(this._criteria||this.value)||this.ensureClearButtonVisible?s("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},s("ez-icon",{iconName:"close"})):void 0),s("section",{class:"list-container",ref:t=>this._listContainer=t},s("div",{class:"list-wrapper",ref:t=>this._listWrapper=t},s("ul",{class:"list-options",ref:t=>this._optionsList=t},!this._showLoading&&0===this._visibleOptions.length&&s("div",{class:"message"},s("span",{class:"message__no-result"},this._textEmptyList)),this._showLoading&&s("div",{class:"message"},s("div",{class:"message__loading"})),s("span",{class:"item__value item__value--hidden",ref:t=>this._itemValueBasis=t}),this.canShowListOptions()&&this._visibleOptions.map(((t,i)=>this.buildItem(t,i)))))))}get el(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var v;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(v||(v={})),u.style=":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.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}}";export{u as ez_search}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as n,H as i,g as a}from"./p-23a36bb6.js";import{StringUtils as o,ElementIDUtils as d}from"@sankhyalabs/core";const r=class{constructor(n){e(this,n),this.ezClick=t(this,"ezClick",7),this.item=void 0,this.enableKey=!0,this.compacted=!1}componentWillRender(){this.createDetailList()}componentDidLoad(){var e,t;const n={id:o.toCamelCase((null===(e=this.item)||void 0===e?void 0:e.key)||(null===(t=this.item)||void 0===t?void 0:t.title)||"")};d.addIDInfo(this._element,null,n)}createDetailList(){var e,t,n;this._details={detailsLeft:[],detailsRight:[]};let i=0;if(null===(e=this.item)||void 0===e?void 0:e.details)for(const e in this.item.details)i<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===(n=this.item.details[e])||void 0===n?void 0:n.toString()}),i++}buildDetailContentTitle(e){var t,n;if(null!=(null==e?void 0:e.label)||null!=(null==e?void 0:e.value))return`${null===(t=o.replaceAccentuatedCharsHtmlEntities(null==e?void 0:e.label))||void 0===t?void 0:t.replace(/<[^>]*>/g,"")}: ${null===(n=o.replaceAccentuatedCharsHtmlEntities(null==e?void 0:e.value))||void 0===n?void 0:n.replace(/<[^>]*>/g,"")}`}buildDetailContent(e){return n("div",{class:"card-item__detail "+(this.compacted?"":"card-item__detail-default"),title:this.buildDetailContentTitle(e)},n("label",{class:"card-item__detail-label "+(this.compacted?"card-item__detail-label-compacted":"")},`${e.label}: `)," ",n("label",{class:"card-item__detail-value "+(this.compacted?"card-item__detail-value-compacted":""),innerHTML:e.value}))}render(){return n(i,null,this.item&&n("div",{class:`card-item ${this.compacted?"card-item__compacted":"card-item__expanded"} `,onClick:()=>{this.ezClick.emit(this.item)}},n("div",{class:"ez-row card-item__content"},n("div",{class:"ez-col ez-col--sd-11 card-item__details"},n("label",{class:"card-item__title "+(this.compacted?"card-item__title-compacted":"")},this.enableKey&&n("span",{class:"card-item__key",innerHTML:this.item.key}),n("span",{innerHTML:this.item.title})),n("div",{class:this.compacted?"card-item__details-container_compacted":"card-item__details-container_default"},n("div",{class:"card-item__details-container__left "+(this.compacted?"card-item__details-container__left-compacted":"")},this._details.detailsLeft.map((e=>this.buildDetailContent(e)))),n("div",{class:"card-item__details-container__right "+(this.compacted?"card-item__details-container__right-compacted":"")},this._details.detailsRight.map((e=>this.buildDetailContent(e)))))),n("div",{class:"ez-col ez-col--sd-1 card-item__details-slot"},n("slot",{name:"rightSlot"})))))}get _element(){return a(this)}};r.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--medium);\n padding-bottom: 0px;\n padding-right: 0px;\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 l=class{constructor(t){e(this,t),this.message=void 0}render(){return n("div",{class:"multi-selection__message"},n("span",{class:"multi-selection__text-message"},this.message))}};l.style=".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";export{r as ez_card_item,l as multi_selection_box_message}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as n,H as o,g as i}from"./p-23a36bb6.js";const r=Math.min,s=Math.max,a=Math.round,c=t=>({x:t,y:t}),l={left:"right",right:"left",bottom:"top",top:"bottom"},u={start:"end",end:"start"};function h(t,e,n){return s(t,r(e,n))}function f(t,e){return"function"==typeof t?t(e):t}function d(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function v(t){return"x"===t?"y":"x"}function y(t){return"y"===t?"height":"width"}function b(t){return["top","bottom"].includes(d(t))?"y":"x"}function m(t){return v(b(t))}function x(t){return t.replace(/start|end/g,(t=>u[t]))}function g(t){return t.replace(/left|right|bottom|top/g,(t=>l[t]))}function w(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function _(t,e,n){let{reference:o,floating:i}=t;const r=b(e),s=m(e),a=y(s),c=d(e),l="y"===r,u=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,f=o[a]/2-i[a]/2;let v;switch(c){case"top":v={x:u,y:o.y-i.height};break;case"bottom":v={x:u,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-i.width,y:h};break;default:v={x:o.x,y:o.y}}switch(p(e)){case"start":v[s]-=f*(n&&l?-1:1);break;case"end":v[s]+=f*(n&&l?-1:1)}return v}async function z(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:p=0}=f(e,t),v=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),y=a[d?"floating"===h?"reference":"floating":h],b=w(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),m="floating"===h?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),g=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},_=w(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:x,strategy:c}):m);return{top:(b.top-_.top+v.top)/g.y,bottom:(_.bottom-b.bottom+v.bottom)/g.y,left:(b.left-_.left+v.left)/g.x,right:(_.right-b.right+v.right)/g.x}}function k(){return"undefined"!=typeof window}function O(t){return S(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function R(t){var e;return null==(e=(S(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function S(t){return!!k()&&(t instanceof Node||t instanceof P(t).Node)}function A(t){return!!k()&&(t instanceof Element||t instanceof P(t).Element)}function C(t){return!!k()&&(t instanceof HTMLElement||t instanceof P(t).HTMLElement)}function T(t){return!(!k()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof P(t).ShadowRoot)}function D(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=B(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function E(t){return["table","td","th"].includes(O(t))}function L(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function j(t){const e=F(),n=A(t)?B(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function F(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function G(t){return["html","body","#document"].includes(O(t))}function B(t){return P(t).getComputedStyle(t)}function M(t){return A(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if("html"===O(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||R(t);return T(e)?e.host:e}function N(t){const e=$(t);return G(e)?t.ownerDocument?t.ownerDocument.body:t.body:C(e)&&D(e)?e:N(e)}function V(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=N(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=P(i);if(r){const t=H(s);return e.concat(s,s.visualViewport||[],D(i)?i:[],t&&n?V(t):[])}return e.concat(i,V(i,[],n))}function H(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function U(t){const e=B(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=C(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=a(n)!==r||a(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function W(t){return A(t)?t:t.contextElement}function X(t){const e=W(t);if(!C(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=U(e);let s=(r?a(n.width):n.width)/o,l=(r?a(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const Y=c(0);function q(t){const e=P(t);return F()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Y}function I(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=W(t);let s=c(1);e&&(o?A(o)&&(s=X(o)):s=X(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==P(t))&&e}(r,n,o)?q(r):c(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,h=i.width/s.x,f=i.height/s.y;if(r){const t=P(r),e=o&&A(o)?P(o):o;let n=t,i=H(n);for(;i&&o&&e!==n;){const t=X(i),e=i.getBoundingClientRect(),o=B(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,u*=t.y,h*=t.x,f*=t.y,l+=r,u+=s,n=P(i),i=H(n)}}return w({width:h,height:f,x:l,y:u})}function J(t,e){const n=M(t).scrollLeft;return e?e.left+n:I(R(t)).left+n}function K(t,e,n){void 0===n&&(n=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(n?0:J(t,o)),y:o.top+e.scrollTop}}function Q(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=P(t),o=R(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,c=0;if(i){r=i.width,s=i.height;const t=F();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:a,y:c}}(t,n);else if("document"===e)o=function(t){const e=R(t),n=M(t),o=t.ownerDocument.body,i=s(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=s(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+J(t);const c=-n.scrollTop;return"rtl"===B(o).direction&&(a+=s(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}(R(t));else if(A(e))o=function(t,e){const n=I(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=C(t)?X(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=q(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return w(o)}function Z(t,e){const n=$(t);return!(n===e||!A(n)||G(n))&&("fixed"===B(n).position||Z(n,e))}function tt(t,e,n){const o=C(e),i=R(e),r="fixed"===n,s=I(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=c(0);if(o||!o&&!r)if(("body"!==O(e)||D(i))&&(a=M(e)),o){const t=I(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=J(i));const u=!i||o||r?c(0):K(i,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}function et(t){return"static"===B(t).position}function nt(t,e){if(!C(t)||"fixed"===B(t).position)return null;if(e)return e(t);let n=t.offsetParent;return R(t)===n&&(n=n.ownerDocument.body),n}function ot(t,e){const n=P(t);if(L(t))return n;if(!C(t)){let e=$(t);for(;e&&!G(e);){if(A(e)&&!et(e))return e;e=$(e)}return n}let o=nt(t,e);for(;o&&E(o)&&et(o);)o=nt(o,e);return o&&G(o)&&et(o)&&!j(o)?n:o||function(t){let e=$(t);for(;C(e)&&!G(e);){if(j(e))return e;if(L(e))return null;e=$(e)}return null}(t)||n}const it={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=R(o),a=!!e&&L(e.floating);if(o===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},u=c(1);const h=c(0),f=C(o);if((f||!f&&!r)&&(("body"!==O(o)||D(s))&&(l=M(o)),C(o))){const t=I(o);u=X(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop}const d=!s||f||r?c(0):K(s,l,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+h.x+d.x,y:n.y*u.y-l.scrollTop*u.y+h.y+d.y}},getDocumentElement:R,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const a=[..."clippingAncestors"===n?L(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=V(t,[],!1).filter((t=>A(t)&&"body"!==O(t))),i=null;const r="fixed"===B(t).position;let s=r?$(t):t;for(;A(s)&&!G(s);){const e=B(s),n=j(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||D(s)&&!n&&Z(t,s))?o=o.filter((t=>t!==s)):i=e,s=$(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=a.reduce(((t,n)=>{const o=Q(e,n,i);return t.top=s(o.top,t.top),t.right=r(o.right,t.right),t.bottom=r(o.bottom,t.bottom),t.left=s(o.left,t.left),t}),Q(e,a[0],i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:ot,getElementRects:async function(t){const e=this.getOffsetParent||ot,n=this.getDimensions,o=await n(t.floating);return{reference:tt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=U(t);return{width:e,height:n}},getScale:X,isElement:A,isRTL:function(t){return"rtl"===B(t).direction}},rt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=f(t,e),l={x:n,y:o},u=await z(e,c),p=b(d(i)),y=v(p);let m=l[y],x=l[p];r&&(m=h(m+u["y"===y?"top":"left"],m,m-u["y"===y?"bottom":"right"])),s&&(x=h(x+u["y"===p?"top":"left"],x,x-u["y"===p?"bottom":"right"]));const g=a.fn({...e,[y]:m,[p]:x});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[y]:r,[p]:s}}}}}},st=class{constructor(n){t(this,n),this.ezVisibilityChange=e(this,"ezVisibilityChange",7),this.TIME_DEBOUNCE=500,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}}async observeOpened(t,e){t!==e&&(t?this.openPopover():this.hidePopover(),this.ezVisibilityChange.emit(t))}async updatePosition(t,e){this.updateOptionPosition(t,e),await this.updatePositionPopover()}async show(t,e){this.updateOptionPosition(t,e),this.opened=!0}async showUnder(t,e){e&&(this.options=e),this.anchorElement=t,this.opened=!0}async hide(){this.opened=!1}async setOptions(t){Object.assign(this.options,t)}async setAnchorElement(t){this.anchorElement=t}parseSizePixel(t,e){return t?"string"==typeof t?Number(t.replace("px","")):null!=t?t:0:null!=e?e:0}updateOptionPosition(t,e){Object.assign(this.options,{horizontalGap:this.parseSizePixel(e,this.options.horizontalGap),verticalGap:this.parseSizePixel(t,this.options.verticalGap)})}async updatePositionPopover(){var t;this._box&&this.opened&&(this.anchorElement||(this.anchorElement=this._host),"string"==typeof this.anchorElement&&(this.anchorElement=document.getElementById(this.anchorElement)),await((t,e,n)=>{const o=new Map,i={platform:it,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),c=await(null==s.isRTL?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:h}=_(l,o,c),f=o,d={},p=0;for(let n=0;n<a.length;n++){const{name:r,fn:v}=a[n],{x:y,y:b,data:m,reset:x}=await v({x:u,y:h,initialPlacement:o,placement:f,strategy:i,middlewareData:d,rects:l,platform:s,elements:{reference:t,floating:e}});u=null!=y?y:u,h=null!=b?b:h,d={...d,[r]:{...d[r],...m}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(l=!0===x.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),({x:u,y:h}=_(l,f,c))),n=-1)}return{x:u,y:h,placement:f,strategy:i,middlewareData:d}})(t,e,{...i,platform:r})})(this.anchorElement,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[(void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:k=!0,...O}=f(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const P=d(i),R=b(a),S=d(a)===a,A=await(null==c.isRTL?void 0:c.isRTL(l.floating)),C=v||(S||!k?[g(a)]:function(t){const e=g(t);return[x(t),e,x(e)]}(a)),T="none"!==_;!v&&T&&C.push(...function(t,e,n,o){const i=p(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}(d(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(x)))),r}(a,k,_,A));const D=[a,...C],E=await z(e,O),L=[];let j=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&L.push(E[P]),h){const t=function(t,e,n){void 0===n&&(n=!1);const o=p(t),i=m(t),r=y(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=g(s)),[s,g(s)]}(i,s,A);L.push(E[t[0]],E[t[1]])}if(j=[...j,{placement:i,overflows:L}],!L.every((t=>t<=0))){var F,G;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=D[t];if(e)return{data:{index:t,overflows:j},reset:{placement:e}};let n=null==(G=j.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:G.placement;if(!n)switch(w){case"bestFit":{var B;const t=null==(B=j.filter((t=>{if(T){const e=b(t.placement);return e===R||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=a}if(i!==n)return{reset:{placement:n}}}return{}}}),rt({padding:5})],strategy:"fixed"}).then((({x:t,y:e,placement:n})=>{const o=n.includes("bottom")?e+this.options.verticalGap:e-this.options.verticalGap,i=n.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${o}px`,left:`${i}px`})})))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){this._box&&this.opened&&(this._box.style.display="flex",this._box.style.visibility="hidden",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)}updatePositionDebounce(){this.opened&&(clearTimeout(this._timeoutDebounce),this._timeoutDebounce=setTimeout((()=>{this.updatePositionPopover()}),this.TIME_DEBOUNCE))}componentWillLoad(){window.addEventListener("scroll",this.updatePositionDebounce.bind(this),!0),window.addEventListener("resize",this.updatePositionDebounce.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.updatePositionDebounce.bind(this),!0),window.removeEventListener("resize",this.updatePositionDebounce.bind(this),!0),this._resizeObserver.disconnect()}render(){return n(o,null,n("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),n("section",{ref:t=>this._box=t,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},n("slot",null)))}get _host(){return i(this)}static get watchers(){return{opened:["observeOpened"]}}};st.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(--most-visible, 4);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(--more-visible--2x, 3)}.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)}";const at=class{constructor(n){t(this,n),this.ezVisibilityChange=e(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}}listenerEzVisibilityChange({detail:t}){this.ezVisibilityChange.emit(t)}async observeOpened(t){t&&!this._popOverCore&&this.renderPopoverCore(),this._popOverCore.opened=t}async updatePosition(t,e){var n;await(null===(n=this._popOverCore)||void 0===n?void 0:n.updatePosition(t,e))}async show(t,e){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.show(t,e)}async showUnder(t,e){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.showUnder(t,e)}async hide(){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.hide())}async setOptions(t){var e;await(null===(e=this._popOverCore)||void 0===e?void 0:e.setOptions(t))}async setAnchorElement(t){var e;await(null===(e=this._popOverCore)||void 0===e?void 0:e.setAnchorElement(t))}renderPopoverCore(){this._popOverCore=document.createElement("ez-popover-core"),this._popOverCore.opened=this.opened,this._popOverCore.anchorElement=this.anchorElement,this._popOverCore.autoClose=this.autoClose,this._popOverCore.boxWidth=this.boxWidth,this._popOverCore.overlayType=this.overlayType,this._popOverCore.options=this.options;const t=this._host.children.item(0);t?this._popOverCore.appendChild(t):console.warn("O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta."),document.body.appendChild(this._popOverCore)}render(){return n(o,null,n("slot",null))}get _host(){return i(this)}static get watchers(){return{opened:["observeOpened"]}}};at.style=":host{display:none}";export{st as ez_popover_core,at as ez_popover_plus}
@@ -0,0 +1 @@
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-2187f86c.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-4607fb89.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._textEmptyList="Nenhum resultado encontrado",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._textInputReady=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}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(a.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.value))}),100)}:t=>t(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.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:""}].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}showOptions(){var t,i;if(!this.enabled)return;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.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.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()}componentDidRender(){this._textInput&&(this._textInputReady=!0)}componentWillLoad(){if(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(a.PRELOAD)}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&this._textInput&&this._comboBoxList&&(this._comboBoxList.width=this._textInput.clientWidth)}))})),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._popover)||void 0===t||t.remove(),this._resizeObserver&&this._resizeObserver.disconnect()}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(a.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}openPopover(){var t;this.isOpen=!0,null===(t=this._popover)||void 0===t||t.show()}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},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},s("ez-combo-box-list",{ref:t=>this._comboBoxList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this._textEmptyList,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 a;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(a||(a={})),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}
@@ -0,0 +1,104 @@
1
+ import { IOption } from "../ez-combo-box";
2
+ export declare class EzComboBoxList {
3
+ private _optionsList;
4
+ private _listWrapper;
5
+ /**
6
+ * Indica se o indicador de carregamento deve ser exibido.
7
+ *
8
+ * @tipo {boolean}
9
+ */
10
+ showLoading: boolean;
11
+ /**
12
+ * Lista de opções visíveis que serão exibidas no componente.
13
+ *
14
+ * @tipo {Array<IOption>}
15
+ */
16
+ visibleOptions: Array<IOption>;
17
+ /**
18
+ * Mensagem exibida quando a lista de opções está vazia.
19
+ *
20
+ * @padrão "Nenhum resultado encontrado"
21
+ * @tipo {string}
22
+ */
23
+ textEmptyList: string;
24
+ /**
25
+ * Indica se o valor de cada opção deve ser exibido junto com o rótulo.
26
+ *
27
+ * @tipo {boolean}
28
+ */
29
+ showOptionValue: boolean;
30
+ /**
31
+ * Índice da opção pré-selecionada na lista.
32
+ *
33
+ * @tipo {number}
34
+ */
35
+ preSelection: number;
36
+ /**
37
+ * Largura máxima da lista, em pixels.
38
+ *
39
+ * @tipo {number}
40
+ */
41
+ maxWidth: number;
42
+ /**
43
+ * Largura fixa da lista, em pixels.
44
+ *
45
+ * @tipo {number}
46
+ */
47
+ width: number;
48
+ /**
49
+ * Callback chamado quando uma opção é selecionada.
50
+ *
51
+ * @param option A opção selecionada.
52
+ * @tipo {(option: IOption) => void}
53
+ */
54
+ onOptionSelect: (option: IOption) => void;
55
+ /**
56
+ * Callback chamado quando o mouse passa sobre uma opção.
57
+ *
58
+ * @param index O índice da opção em foco.
59
+ * @tipo {(index: number) => void}
60
+ */
61
+ onOptionHover: (index: number) => void;
62
+ /**
63
+ * Move a seleção para a próxima opção na lista.
64
+ */
65
+ nextOption(): Promise<void>;
66
+ /**
67
+ * Move a seleção para a opção anterior na lista, sem ultrapassar o início.
68
+ */
69
+ previousOption(): Promise<void>;
70
+ /**
71
+ * Seleciona a opção atualmente pré-selecionada.
72
+ */
73
+ selectCurrentOption(): Promise<void>;
74
+ /**
75
+ * Observa mudanças na propriedade `width` e ajusta a largura da lista.
76
+ *
77
+ * @param newValue O novo valor da largura.
78
+ * @param oldValue O valor anterior da largura.
79
+ */
80
+ observeWidth(newValue: number, oldValue: number): void;
81
+ /**
82
+ * Observa mudanças na propriedade `maxWidth` e ajusta a largura máxima da lista.
83
+ *
84
+ * @param newValue O novo valor da largura máxima.
85
+ * @param oldValue O valor anterior da largura máxima.
86
+ */
87
+ observeMaxWidth(newValue: number, oldValue: number): void;
88
+ /**
89
+ * Gerencia a navegação por teclado na lista do combo box.
90
+ *
91
+ * - `ArrowDown`: Move para a próxima opção.
92
+ * - `ArrowUp`: Move para a opção anterior.
93
+ * - `Enter`: Seleciona a opção atual.
94
+ * - `Escape`: Limpa a pré-seleção.
95
+ *
96
+ * @param event O evento de teclado.
97
+ */
98
+ handleKeyDown(event: KeyboardEvent): void;
99
+ private buildItem;
100
+ private scrollToOption;
101
+ componentDidLoad(): void;
102
+ componentDidRender(): void;
103
+ render(): any;
104
+ }
@@ -2,11 +2,9 @@ import { EventEmitter } from "../../stencil-public-runtime";
2
2
  import { TFocusOptions } from "../ez-text-input/ez-text-input";
3
3
  export declare class EzComboBox {
4
4
  private _textInput;
5
- private _optionsList;
6
- private _listContainer;
7
- private _listWrapper;
5
+ private _comboBoxList;
6
+ private _popover;
8
7
  private _itemValueBasis;
9
- private _floatingID;
10
8
  private _source;
11
9
  private _changeDeboucingTimeout;
12
10
  private _deboucingTime;
@@ -15,12 +13,14 @@ export declare class EzComboBox {
15
13
  private _textEmptyList;
16
14
  private _lookupMode;
17
15
  private _resizeObserver;
16
+ isOpen: boolean;
18
17
  private el;
19
18
  private _preSelection;
20
19
  private _visibleOptions;
21
20
  private _startLoading;
22
21
  private _showLoading;
23
22
  private _criteria;
23
+ private _textInputReady;
24
24
  /**
25
25
  * Define o limite de caracteres mínimo para realizar uma pesquisa
26
26
  */
@@ -118,9 +118,6 @@ export declare class EzComboBox {
118
118
  * Limpa o valor do campo de pesquisa
119
119
  */
120
120
  clearValue(): Promise<void>;
121
- scrollListener(): void;
122
- private updateListPosition;
123
- private getListPosition;
124
121
  private isDifferentValues;
125
122
  private getFormattedText;
126
123
  private getText;
@@ -129,15 +126,8 @@ export declare class EzComboBox {
129
126
  private hasToAddEmptyoption;
130
127
  private getMaxWidthValue;
131
128
  private getWidthValue;
132
- private buildItem;
133
129
  private showOptions;
134
130
  private hideOptions;
135
- private isOptionsVisible;
136
- private nextOption;
137
- private previousOption;
138
- private scrollToOption;
139
- private selectCurrentOption;
140
- private controlListWithOnlyOne;
141
131
  private updateSource;
142
132
  private selectOption;
143
133
  private loadOptions;
@@ -145,17 +135,18 @@ export declare class EzComboBox {
145
135
  private setInputValue;
146
136
  private clearSearch;
147
137
  private resetOptions;
148
- componentWillLoad(): void;
149
138
  componentDidRender(): void;
139
+ componentWillLoad(): void;
150
140
  componentDidLoad(): void;
141
+ disconnectedCallback(): void;
151
142
  private handlerIconClick;
152
143
  private onTextInputChangeHandler;
153
144
  private clearDeboucingTimeout;
154
145
  private onTextInputClickHandler;
155
146
  private keyDownHandler;
156
- private handleEventPropagation;
157
147
  private onTextInputFocusOutHandler;
158
148
  private canShowListOptions;
149
+ private openPopover;
159
150
  render(): any;
160
151
  }
161
152
  export interface IOption {
@@ -20,6 +20,7 @@ export declare class EzGrid {
20
20
  private _headerOverflowWatcher;
21
21
  private _customEditor;
22
22
  private _customRenders;
23
+ private _keyboardManager;
23
24
  _element: HTMLElement;
24
25
  private _paginationInfo;
25
26
  private _paginationChangedByKeyboard;
@@ -225,6 +226,8 @@ export declare class EzGrid {
225
226
  private buildDataElementId;
226
227
  private previousPage;
227
228
  private nextPage;
229
+ private nextRecord;
230
+ private previousRecord;
228
231
  private resetPaginationState;
229
232
  private resolvePaginationClassMode;
230
233
  private handleCancelPagination;
@@ -251,5 +254,7 @@ export declare class EzGrid {
251
254
  private getDataSource;
252
255
  private hideHeader;
253
256
  private resolveLeftHeaderClass;
257
+ private initKeyboardManager;
258
+ private removeShortcuts;
254
259
  render(): any;
255
260
  }
@@ -21,19 +21,18 @@ export declare class EzPopoverPlus {
21
21
  /**
22
22
  * Define o elemento de ancoragem.
23
23
  */
24
- anchorElement: Array<HTMLElement | string> | HTMLElement | string;
24
+ anchorElement: HTMLElement | string;
25
25
  /**
26
26
  * Define as opções do elemento.
27
27
  */
28
28
  options: IEzPopoverAnchorOptions;
29
- /**
30
- * Define se o elemento manterá o mesmo tamanho do componente de ancora.
31
- */
32
- useAnchorSize: boolean;
33
29
  /**
34
30
  * Emitido quando acontece a alteração de estado do componente.
35
31
  */
36
32
  ezVisibilityChange: EventEmitter<boolean>;
33
+ listenerEzVisibilityChange({ detail }: {
34
+ detail: any;
35
+ }): void;
37
36
  observeOpened(newValue: boolean): Promise<void>;
38
37
  /**
39
38
  * Atualiza a posição do popover.
@@ -26,24 +26,16 @@ export declare class EzPopoverCore {
26
26
  /**
27
27
  * Define o elemento de ancoragem.
28
28
  */
29
- anchorElement: Array<HTMLElement | string> | HTMLElement | string;
29
+ anchorElement: HTMLElement | string;
30
30
  /**
31
31
  * Define as opções do elemento.
32
32
  */
33
33
  options: IEzPopoverAnchorOptions;
34
- /**
35
- * Define se o elemento manterá o mesmo tamanho do componente de ancora.
36
- */
37
- useAnchorSize: boolean;
38
- /**
39
- * Define a largura mínima do elemento (apenas será considerada caso a propriedade useAnchorSize seja verdadeira).
40
- */
41
- minWidth: number;
42
34
  /**
43
35
  * Emitido quando acontece a alteração de estado do componente.
44
36
  */
45
37
  ezVisibilityChange: EventEmitter<boolean>;
46
- observeOpened(newValue: boolean, oldValue: boolean): void;
38
+ observeOpened(newValue: boolean, oldValue: boolean): Promise<void>;
47
39
  /**
48
40
  * Atualiza a posição do popover.
49
41
  */
@@ -70,8 +62,6 @@ export declare class EzPopoverCore {
70
62
  setAnchorElement(anchor: HTMLElement | string): Promise<void>;
71
63
  private parseSizePixel;
72
64
  private updateOptionPosition;
73
- private getElement;
74
- private getAnchorElement;
75
65
  private updatePositionPopover;
76
66
  private hidePopover;
77
67
  private openPopover;
@@ -3,10 +3,11 @@ import { IEzCheckBoxListPosition } from '../ez-combo-box/ez-combo-box';
3
3
  import { TFocusOptions } from "../ez-text-input/ez-text-input";
4
4
  export declare class EzSearch {
5
5
  private _textInput;
6
- private _searchList;
7
6
  private _optionsList;
8
- private _ezPopOverPlusElement;
7
+ private _listContainer;
8
+ private _listWrapper;
9
9
  private _itemValueBasis;
10
+ private _floatingID;
10
11
  private _source;
11
12
  private _changeDeboucingTimeout;
12
13
  private _limitCharsToSearch;
@@ -137,20 +138,30 @@ export declare class EzSearch {
137
138
  * Limpa o valor do campo de pesquisa
138
139
  */
139
140
  clearValue(): Promise<void>;
141
+ scrollListener(): void;
140
142
  private handleValueAsString;
143
+ private updateListPosition;
144
+ private getListPosition;
141
145
  private isDifferentValues;
142
146
  private getFormattedText;
143
147
  private getText;
148
+ private replaceQuotes;
144
149
  private getSelectedOption;
145
150
  private updateVisibleOptions;
146
151
  private getMaxWidthValue;
147
152
  private getWidthValue;
153
+ private createOption;
154
+ private buildItem;
148
155
  private showOptions;
149
156
  private hideOptions;
150
157
  private isOptionsVisible;
158
+ private nextOption;
159
+ private previousOption;
160
+ private scrollToOption;
151
161
  private selectCurrentOption;
152
162
  private updateSource;
153
163
  private clearSource;
164
+ private replaceHighlight;
154
165
  private selectOption;
155
166
  private loadOptions;
156
167
  private cancelPreselection;
@@ -179,7 +190,6 @@ export declare class EzSearch {
179
190
  private onTextInputFocusOutHandler;
180
191
  private canShowListOptions;
181
192
  private canShowLoadSpinDescription;
182
- private onChangePreSelection;
183
193
  render(): any;
184
194
  }
185
195
  export interface IOption {