@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-79210.0 → 0.0.0-bugfix-dev-KB-75065.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.
- package/dist/cjs/ez-badge.cjs.entry.js +14 -2
- package/dist/cjs/ez-grid.cjs.entry.js +1 -4
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list_2.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-badge/ez-badge.css +12 -1
- package/dist/collection/components/ez-badge/ez-badge.js +31 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +0 -3
- package/dist/collection/components/ez-grid/ez-grid.css +6 -0
- package/dist/collection/components/ez-icon/ez-icon.css +1 -4
- package/dist/custom-elements/index.js +19 -9
- package/dist/esm/ez-badge.entry.js +14 -2
- package/dist/esm/ez-grid.entry.js +1 -4
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list_2.entry.js +2 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0ca05a2f.entry.js +1 -0
- package/dist/ezui/{p-e80d3452.entry.js → p-a5950a0d.entry.js} +1 -1
- package/dist/ezui/p-cdac80f1.entry.js +1 -0
- package/dist/ezui/p-e75c7a23.entry.js +1 -0
- package/dist/types/components/ez-badge/ez-badge.d.ts +5 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/ezui/p-56fe5341.entry.js +0 -1
- package/dist/ezui/p-650e4b6d.entry.js +0 -1
- package/dist/ezui/p-b555cb24.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,F as n,H as o,g as s}from"./p-23a36bb6.js";import{ArrayUtils as r}from"@sankhyalabs/core";var l;!function(t){t.DATASOURCE_RESULTS="DATASOURCE_RESULTS",t.DATASOURCE_RESULTS_EMPTY="DATASOURCE_RESULTS_EMPTY",t.DATASOURCE_INIT="DATASOURCE_INIT",t.OPTIONS_EMPTY="OPTIONS_EMPTY",t.OPTIONS="OPTIONS"}(l||(l={}));const a=class{constructor(i){t(this,i),this.changeFilteredOptions=e(this,"changeFilteredOptions",7),this.columnName=void 0,this.dataSource=void 0,this.useOptions=!1,this.options=void 0,this.isTextSearch=!1,this.filteredOptions=void 0,this.displayOptions=void 0,this.viewScenario=void 0,this.displayOptionToCheckAllItems=!0}async clearFilteredOptions(){this.setInitialScenario(),this.filteredOptions=[],this.searchInput&&(this.searchInput.value=""),this.filterInput&&(this.filterInput.value="")}onChangeUseOptions(){this.setInitialScenario()}onChangeOptions(){this.options&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.options)),this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.setInitialScenario()}onChangeFilteredOptions(t){this.displayOptions=this.filteredOptions,this.displayOptionToCheckAllItems=this.filteredOptions.length>1,this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.changeFilteredOptions.emit(t)}componentDidRender(){this.changeCheckAllValeuFromFilteredOptions()}ordenationByCheckStateAndAlphabetically(t){const e=[],i=[];let n;return t.forEach((t=>{null==t.value||""===t.label?n=Object.assign(Object.assign({},t),{label:"(Vazio)"}):t.check?e.push(t):i.push(t)})),(null==n?[]:[n]).concat(null==this.dataSource?r.sortAlphabetically(e):this.dataSource.sortItems(this.columnName,e)).concat(null==this.dataSource?r.sortAlphabetically(i):this.dataSource.sortItems(this.columnName,i))}changeCheckAllValeuFromFilteredOptions(){var t,e,i,n;const o=null===(t=this.filteredOptions)||void 0===t?void 0:t.every((t=>!0===t.check)),s=null===(e=this.filteredOptions)||void 0===e?void 0:e.every((t=>!1===t.check)),r=(null===(i=this.filteredOptions)||void 0===i?void 0:i.some((t=>!1===t.check)))&&(null===(n=this.filteredOptions)||void 0===n?void 0:n.some((t=>!0===t.check)))&&(!o||!s);return this.checkInput&&o?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!0)):this.checkInput&&r?(this.checkInput.indeterminate=!0,void(this.checkInput.value=!1)):this.checkInput&&s?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!1)):void 0}setInitialScenario(){if(this.useOptions)return this.viewScenario=l.OPTIONS,void this.changeCheckAllValeuFromFilteredOptions();this.viewScenario=this.options&&this.options.length>0?l.DATASOURCE_RESULTS:l.DATASOURCE_INIT}async searchWithDataSource(t,e){const{argument:i,mode:n}=t;if("PRELOAD"!==n&&e)return this.dataSource.fetchData(i,e)}handleSearchOnDataSource(t){var e;const i=null!==(e=this.filteredOptions)&&void 0!==e?e:[];t.detail&&!i.some((e=>e.value==t.detail.value))&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...i,t.detail])),this.viewScenario=l.DATASOURCE_RESULTS,this.searchInput.value=""}handleRemoveItemFromOptions(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.filteredOptions.filter((e=>e.value!==t.value))),0===this.filteredOptions.length&&(this.viewScenario=l.DATASOURCE_INIT),this.searchInput&&(this.searchInput.value="")}handleSearchOnOption(t){if(t.detail)return this.displayOptions=r.applyStringFilter(t.detail,this.filteredOptions,!0),void(this.viewScenario=0===this.displayOptions.length?l.OPTIONS_EMPTY:l.OPTIONS);this.displayOptions=this.filteredOptions,this.viewScenario=l.OPTIONS}handleChangeSelectAllItems(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...this.filteredOptions.map((e=>(e.check=!!t.detail,e)))])}handleChangeSelectedItem(t){const{detail:e}=t;this.filteredOptions.find((t=>t.label===e.label)).check=e.check}buildViewList(t){return i(n,null,this.displayOptionToCheckAllItems&&i("ez-check",{ref:t=>this.checkInput=t,label:"Selecionar todos",class:"multi-selection__select-all",onEzChange:this.handleChangeSelectAllItems.bind(this)}),i("ez-list",{class:"multi-selection__list",dataSource:this.displayOptions,listMode:"check",hoverFeedback:!0,onEzCheckChange:this.handleChangeSelectedItem.bind(this),itemSlotBuilder:t?this.buildDeleteIconSlot.bind(this):null}))}buildDeleteIconSlot(t){return i("ez-icon",{style:{cursor:"pointer"},iconName:"delete",onClick:()=>this.handleRemoveItemFromOptions(t)})}buildInitViewWithDataSource(){return i("multi-selection-box-message",{message:"Selecione os valores a serem filtrados através do campo de busca."})}buildViewEmptyResults(){return i("multi-selection-box-message",{message:"Nenhum resultado encontrado."})}scenarioToDisplay(t){const e={[l.DATASOURCE_INIT]:()=>this.buildInitViewWithDataSource(),[l.DATASOURCE_RESULTS]:()=>this.buildViewList(!0),[l.DATASOURCE_RESULTS_EMPTY]:()=>this.buildViewEmptyResults(),[l.OPTIONS_EMPTY]:()=>this.buildViewEmptyResults(),[l.OPTIONS]:()=>this.buildViewList(!1)}[t];return e?e():void 0}render(){return i(o,null,i("div",{class:"multi-selection"},this.useOptions?i("ez-filter-input",{ref:t=>this.filterInput=t,label:"Buscar..",onEzChange:this.handleSearchOnOption.bind(this)}):i("ez-search",{class:"multi-selection__input",label:"Buscar...",ref:t=>this.searchInput=t,suppressEmptyOption:!0,showOptionValue:!1,showSelectedValue:!1,optionLoader:t=>this.searchWithDataSource(t,this.columnName),onEzChange:this.handleSearchOnDataSource.bind(this),isTextSearch:this.isTextSearch}),i("ez-scroll",{class:"multi-selection__content-options"},this.scenarioToDisplay(this.viewScenario))))}static get watchers(){return{useOptions:["onChangeUseOptions"],options:["onChangeOptions"],filteredOptions:["onChangeFilteredOptions"]}}};a.style=".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;--ez-multi-selection-default-height:322px;display:block;width:304px;height:var(--ez-multi-selection-default-height);min-height:fit-content;max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";const c=Math.min,h=Math.max,u=Math.round,d=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"},p={start:"end",end:"start"};function m(t,e,i){return h(t,c(e,i))}function v(t,e){return"function"==typeof t?t(e):t}function b(t){return t.split("-")[0]}function g(t){return t.split("-")[1]}function y(t){return"x"===t?"y":"x"}function x(t){return"y"===t?"height":"width"}function w(t){return["top","bottom"].includes(b(t))?"y":"x"}function _(t){return y(w(t))}function z(t){return t.replace(/start|end/g,(t=>p[t]))}function O(t){return t.replace(/left|right|bottom|top/g,(t=>f[t]))}function S(t){const{x:e,y:i,width:n,height:o}=t;return{width:n,height:o,top:i,left:e,right:e+n,bottom:i+o,x:e,y:i}}function k(t,e,i){let{reference:n,floating:o}=t;const s=w(e),r=_(e),l=x(r),a=b(e),c="y"===s,h=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,d=n[l]/2-o[l]/2;let f;switch(a){case"top":f={x:h,y:n.y-o.height};break;case"bottom":f={x:h,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(g(e)){case"start":f[r]-=d*(i&&c?-1:1);break;case"end":f[r]+=d*(i&&c?-1:1)}return f}async function C(t,e){var i;void 0===e&&(e={});const{x:n,y:o,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:f=0}=v(e,t),p=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}}(f),m=l[d?"floating"===u?"reference":"floating":u],b=S(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(m)))||i?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:h,strategy:a})),g="floating"===u?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},w=S(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:a}):g);return{top:(b.top-w.top+p.top)/x.y,bottom:(w.bottom-b.bottom+p.bottom)/x.y,left:(b.left-w.left+p.left)/x.x,right:(w.right-b.right+p.right)/x.x}}function A(){return"undefined"!=typeof window}function P(t){return E(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function T(t){var e;return null==(e=(E(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function E(t){return!!A()&&(t instanceof Node||t instanceof R(t).Node)}function D(t){return!!A()&&(t instanceof Element||t instanceof R(t).Element)}function F(t){return!!A()&&(t instanceof HTMLElement||t instanceof R(t).HTMLElement)}function L(t){return!(!A()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof R(t).ShadowRoot)}function I(t){const{overflow:e,overflowX:i,overflowY:n,display:o}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&!["inline","contents"].includes(o)}function B(t){return["table","td","th"].includes(P(t))}function N(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function V(t){const e=j(),i=D(t)?U(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!i[t]&&"none"!==i[t]))||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function j(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function M(t){return["html","body","#document"].includes(P(t))}function U(t){return R(t).getComputedStyle(t)}function $(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if("html"===P(t))return t;const e=t.assignedSlot||t.parentNode||L(t)&&t.host||T(t);return L(e)?e.host:e}function W(t){const e=G(t);return M(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&I(e)?e:W(e)}function Y(t,e,i){var n;void 0===e&&(e=[]),void 0===i&&(i=!0);const o=W(t),s=o===(null==(n=t.ownerDocument)?void 0:n.body),r=R(o);if(s){const t=H(r);return e.concat(r,r.visualViewport||[],I(o)?o:[],t&&i?Y(t):[])}return e.concat(o,Y(o,[],i))}function H(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function X(t){const e=U(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=F(t),s=o?t.offsetWidth:i,r=o?t.offsetHeight:n,l=u(i)!==s||u(n)!==r;return l&&(i=s,n=r),{width:i,height:n,$:l}}function q(t){return D(t)?t:t.contextElement}function J(t){const e=q(t);if(!F(e))return d(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:s}=X(e);let r=(s?u(i.width):i.width)/n,l=(s?u(i.height):i.height)/o;return r&&Number.isFinite(r)||(r=1),l&&Number.isFinite(l)||(l=1),{x:r,y:l}}const K=d(0);function Q(t){const e=R(t);return j()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:K}function Z(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1);const o=t.getBoundingClientRect(),s=q(t);let r=d(1);e&&(n?D(n)&&(r=J(n)):r=J(t));const l=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==R(t))&&e}(s,i,n)?Q(s):d(0);let a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,h=o.width/r.x,u=o.height/r.y;if(s){const t=R(s),e=n&&D(n)?R(n):n;let i=t,o=H(i);for(;o&&n&&e!==i;){const t=J(o),e=o.getBoundingClientRect(),n=U(o),s=e.left+(o.clientLeft+parseFloat(n.paddingLeft))*t.x,r=e.top+(o.clientTop+parseFloat(n.paddingTop))*t.y;a*=t.x,c*=t.y,h*=t.x,u*=t.y,a+=s,c+=r,i=R(o),o=H(i)}}return S({width:h,height:u,x:a,y:c})}function tt(t,e){const i=$(t).scrollLeft;return e?e.left+i:Z(T(t)).left+i}function et(t,e,i){void 0===i&&(i=!1);const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-(i?0:tt(t,n)),y:n.top+e.scrollTop}}function it(t,e,i){let n;if("viewport"===e)n=function(t,e){const i=R(t),n=T(t),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;const t=j();(!t||t&&"fixed"===e)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}(t,i);else if("document"===e)n=function(t){const e=T(t),i=$(t),n=t.ownerDocument.body,o=h(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=h(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+tt(t);const l=-i.scrollTop;return"rtl"===U(n).direction&&(r+=h(e.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}(T(t));else if(D(e))n=function(t,e){const i=Z(t,!0,"fixed"===e),n=i.top+t.clientTop,o=i.left+t.clientLeft,s=F(t)?J(t):d(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:o*s.x,y:n*s.y}}(e,i);else{const i=Q(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return S(n)}function nt(t,e){const i=G(t);return!(i===e||!D(i)||M(i))&&("fixed"===U(i).position||nt(i,e))}function ot(t,e,i){const n=F(e),o=T(e),s="fixed"===i,r=Z(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const a=d(0);if(n||!n&&!s)if(("body"!==P(e)||I(o))&&(l=$(e)),n){const t=Z(e,!0,s,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else o&&(a.x=tt(o));const c=!o||n||s?d(0):et(o,l);return{x:r.left+l.scrollLeft-a.x-c.x,y:r.top+l.scrollTop-a.y-c.y,width:r.width,height:r.height}}function st(t){return"static"===U(t).position}function rt(t,e){if(!F(t)||"fixed"===U(t).position)return null;if(e)return e(t);let i=t.offsetParent;return T(t)===i&&(i=i.ownerDocument.body),i}function lt(t,e){const i=R(t);if(N(t))return i;if(!F(t)){let e=G(t);for(;e&&!M(e);){if(D(e)&&!st(e))return e;e=G(e)}return i}let n=rt(t,e);for(;n&&B(n)&&st(n);)n=rt(n,e);return n&&M(n)&&st(n)&&!V(n)?i:n||function(t){let e=G(t);for(;F(e)&&!M(e);){if(V(e))return e;if(N(e))return null;e=G(e)}return null}(t)||i}const at={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const s="fixed"===o,r=T(n),l=!!e&&N(e.floating);if(n===r||l&&s)return i;let a={scrollLeft:0,scrollTop:0},c=d(1);const h=d(0),u=F(n);if((u||!u&&!s)&&(("body"!==P(n)||I(r))&&(a=$(n)),F(n))){const t=Z(n);c=J(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}const f=!r||u||s?d(0):et(r,a,!0);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-a.scrollLeft*c.x+h.x+f.x,y:i.y*c.y-a.scrollTop*c.y+h.y+f.y}},getDocumentElement:T,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const s=[..."clippingAncestors"===i?N(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let n=Y(t,[],!1).filter((t=>D(t)&&"body"!==P(t))),o=null;const s="fixed"===U(t).position;let r=s?G(t):t;for(;D(r)&&!M(r);){const e=U(r),i=V(r);i||"fixed"!==e.position||(o=null),(s?!i&&!o:!i&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||I(r)&&!i&&nt(t,r))?n=n.filter((t=>t!==r)):o=e,r=G(r)}return e.set(t,n),n}(e,this._c):[].concat(i),n],r=s.reduce(((t,i)=>{const n=it(e,i,o);return t.top=h(n.top,t.top),t.right=c(n.right,t.right),t.bottom=c(n.bottom,t.bottom),t.left=h(n.left,t.left),t}),it(e,s[0],o));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:lt,getElementRects:async function(t){const e=this.getOffsetParent||lt,i=this.getDimensions,n=await i(t.floating);return{reference:ot(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=X(t);return{width:e,height:i}},getScale:J,isElement:D,isRTL:function(t){return"rtl"===U(t).direction}},ct=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:n,placement:o}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...a}=v(t,e),c={x:i,y:n},h=await C(e,a),u=w(b(o)),d=y(u);let f=c[d],p=c[u];s&&(f=m(f+h["y"===d?"top":"left"],f,f-h["y"===d?"bottom":"right"])),r&&(p=m(p+h["y"===u?"top":"left"],p,p-h["y"===u?"bottom":"right"]));const g=l.fn({...e,[d]:f,[u]:p});return{...g,data:{x:g.x-i,y:g.y-n,enabled:{[d]:s,[u]:r}}}}}},ht=class{constructor(i){t(this,i),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){if(t!==e)return t?this.openPopover():this.hidePopover(),void 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,i)=>{const n=new Map,o={platform:at,...i},s={...o.platform,_c:n};return(async(t,e,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=s.filter(Boolean),a=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:h,y:u}=k(c,n,a),d=n,f={},p=0;for(let i=0;i<l.length;i++){const{name:s,fn:m}=l[i],{x:v,y:b,data:g,reset:y}=await m({x:h,y:u,initialPlacement:n,placement:d,strategy:o,middlewareData:f,rects:c,platform:r,elements:{reference:t,floating:e}});h=null!=v?v:h,u=null!=b?b:u,f={...f,[s]:{...f[s],...g}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:o}):y.rects),({x:h,y:u}=k(c,d,a))),i=-1)}return{x:h,y:u,placement:d,strategy:o,middlewareData:f}})(t,e,{...o,platform:s})})(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 i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=v(t,e);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};const S=b(o),k=w(l),A=b(l)===l,P=await(null==a.isRTL?void 0:a.isRTL(c.floating)),R=d||(A||!m?[O(l)]:function(t){const e=O(t);return[z(t),e,z(e)]}(l)),T="none"!==p;!d&&T&&R.push(...function(t,e,i,n){const o=g(t);let s=function(t,e,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return i?e?o:n:e?n:o;case"left":case"right":return e?s:r;default:return[]}}(b(t),"start"===i,n);return o&&(s=s.map((t=>t+"-"+o)),e&&(s=s.concat(s.map(z)))),s}(l,m,p,P));const E=[l,...R],D=await C(e,y),F=[];let L=(null==(n=s.flip)?void 0:n.overflows)||[];if(h&&F.push(D[S]),u){const t=function(t,e,i){void 0===i&&(i=!1);const n=g(t),o=_(t),s=x(o);let r="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=O(r)),[r,O(r)]}(o,r,P);F.push(D[t[0]],D[t[1]])}if(L=[...L,{placement:o,overflows:F}],!F.every((t=>t<=0))){var I,B;const t=((null==(I=s.flip)?void 0:I.index)||0)+1,e=E[t];if(e)return{data:{index:t,overflows:L},reset:{placement:e}};let i=null==(B=L.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:B.placement;if(!i)switch(f){case"bestFit":{var N;const t=null==(N=L.filter((t=>{if(T){const e=w(t.placement);return e===k||"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:N[0];t&&(i=t);break}case"initialPlacement":i=l}if(o!==i)return{reset:{placement:i}}}return{}}}),ct({padding:5})],strategy:"fixed"}).then((({x:t,y:e,placement:i})=>{const n=i.includes("bottom")?e+this.options.verticalGap:e-this.options.verticalGap,o=i.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${n}px`,left:`${o}px`})})))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){this._box&&(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)}disconnectedCallback(){window.removeEventListener("scroll",this.updatePositionDebounce.bind(this),!0),window.removeEventListener("resize",this.updatePositionDebounce.bind(this),!0),this._resizeObserver.disconnect()}render(){return i(o,null,i("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),i("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}},i("slot",null)))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};ht.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)}";export{a as ez_multi_selection_list,ht as ez_popover_plus}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a,H as t,g as i}from"./p-23a36bb6.js";import{ElementIDUtils as d}from"@sankhyalabs/core";var s;!function(e){e.EXTRA_LARGE="extra-large",e.LARGE="large",e.MEDIUM="medium",e.SMALL_MEDIUM="small-medium",e.SMALL="small",e.EXTRA_SMALL="extra-small"}(s||(s={}));const n=class{constructor(a){e(this,a),this._sizes={[s.EXTRA_LARGE]:{sufix:"xl"},[s.LARGE]:{sufix:"lg"},[s.MEDIUM]:{sufix:"md"},[s.SMALL_MEDIUM]:{sufix:"sm"},[s.SMALL]:{sufix:"xs"},[s.EXTRA_SMALL]:{sufix:"2xs"}},this.hasSlot=!1,this.size="small",this.label=void 0,this.iconLeft=void 0,this.iconRight=void 0,this.position={horizontal:"right",vertical:"top"},this.alignItems="center"}getIconSize(){switch(this.size){case"large":return"large";case"medium":case"small-medium":return"small";case"small":return"x-small";default:return null}}getAlignItemsClass(){switch(this.alignItems){case"flex-end":return"end";case"flex-start":return"start";default:return"center"}}componentDidLoad(){this._element&&d.addIDInfo(this._element),this._badge&&d.addIDInfo(this._badge,"ezBadge",{id:"embedded"})}handleSlotChange(){this.hasSlot=!0}validateIconLeft(){return this.iconLeft&&""!==this.iconLeft.trim()}validateIconRight(){return this.iconRight&&""!==this.iconRight.trim()}validateLabel(){return this.label&&""!==this.label.trim()}createContainerClassName(){let e=this._sizes[this.size].sufix,a=["badge__content","badge__content--icon-align-"+this.getAlignItemsClass()];return this.hasSlot&&(a.push("badge__content--fill-"+e),"bottom"==this.position.vertical&&"right"==this.position.horizontal&&a.push("badge__content--fill-bottom-right"),"bottom"==this.position.vertical&&"left"==this.position.horizontal&&a.push("badge__content--fill-bottom-left"),"top"==this.position.vertical&&"right"==this.position.horizontal&&a.push("badge__content--fill-top-right"),"top"==this.position.vertical&&"left"==this.position.horizontal&&a.push("badge__content--fill-top-left")),a.push(this.label?"badge__content--text-"+e:this.iconLeft||this.iconRight?"badge__content--icon-"+e:"badge__content--fill-"+e),a.join(" ")}render(){return a(t,null,a("div",{class:"badge"},a("div",null,a("slot",{name:"child-badge",onSlotchange:()=>{this.handleSlotChange()}})),a("div",{class:this.createContainerClassName(),ref:e=>this._badge=e},this.validateIconLeft()&&a("ez-icon",{class:"icon",iconName:this.iconLeft,size:this.getIconSize()}),this.validateLabel()&&a("label",{title:this.label},this.label),this.validateIconRight()&&a("ez-icon",{class:"icon",iconName:this.iconRight,size:this.getIconSize()}))))}get _element(){return i(this)}};n.style=":host{--ez-badge--size-2xs:var(--space--2xs, 8px);--ez-badge--size-xs:var(--space--xs, 12px);--ez-badge--size-sm:var(--space--sm, 16px);--ez-badge--size-md:var(--space--md, 20px);--ez-badge--size-lg:var(--space--lg, 24px);--ez-badge--size-xl:var(--space--xl, 32px);--ez-badge--padding-2xs:0;--ez-badge--padding-xs:var(--space--nano, 2px);--ez-badge--padding-sm:calc(var(--space--nano, 2px) + 1px);--ez-badge--padding-md:var(--space--3xs, 4px);--ez-badge--padding-lg:calc(var(--space--3xs, 4px) + 2px);--ez-badge--padding-xl:var(--space--2xs);--ez-badge--border-radius:calc(var(--border--radius-medium, 12px) + 8px);--ez-badge--font-family:var(--font-pattern, Roboto);--ez-badge--font-weight-medium:var(--text-weight--medium, 400);--ez-badge--background-color:var(--color--primary, #008561);--ez-badge--border-none:0;--ez-badge--color:var(--text--inverted, #ffffff);--ez-badge--gap:calc(var(--ez-badge--padding-xs) + 1px);--ez-badge--font-size-md:var(--text--medium);--ez-badge--font-size-sm:var(--text--medium);--ez-badge--font-size-xs:var(--text--small)}ez-icon{--ez-icon--color:inherit}.badge{display:flex;justify-content:center;align-items:center;position:relative}.badge__content{font-family:var(--ez-badge--font-family, Roboto);font-weight:var(--ez-badge--font-weight-medium, 400);background-color:var(--ez-badge--background-color, #008561);border:var(--ez-badge--border-none, 0);color:var(--ez-badge--color, #ffffff);border-radius:var(--ez-badge--border-radius, 20px);gap:var(--ez-badge--gap, 3px);display:flex;justify-content:center}.badge__content--fill-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px)}.badge__content--fill-2xs{height:var(--ez-badge--size-2xs, 8px);min-width:var(--ez-badge--size-2xs, 8px)}.badge__content--text-md{height:calc(var(--ez-badge--size-md, 20px) - 2px);min-width:var(--ez-badge--size-sm, 20px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-md)}.badge__content--text-sm{height:calc(var(--ez-badge--size-sm, 16px) - 2px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-sm)}.badge__content--text-xs{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-2xs);padding-bottom:var(--ez-badge--padding-2xs);padding-right:var(--ez-badge--padding-lg);padding-left:var(--ez-badge--padding-lg);font-size:var(--ez-badge--font-size-xs)}.badge__content--icon-lg{height:var(--ez-badge--size-lg, 24px);min-width:var(--ez-badge--size-lg, 24px);padding:var(--ez-badge--padding-md)}.badge__content--icon-md{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-md)}.badge__content--icon-sm{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-xs)}.badge__content--icon-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px);padding:var(--ez-badge--padding-xs)}.badge__content--icon-align-center{align-items:center}.badge__content--icon-align-start{align-items:flex-start}.badge__content--icon-align-end{align-items:flex-end}.badge__content--fill{position:absolute;top:0;inset-inline-end:0;z-index:var(--most-visible, 2)}.badge__content--fill-top-right{transform:translate(50%, -50%);position:absolute;top:0;right:0}.badge__content--fill-top-left{transform:translate(-50%, -50%);position:absolute;top:0;left:0}.badge__content--fill-bottom-left{transform:translate(-50%, 50%);position:absolute;bottom:0;left:0}.badge__content--fill-bottom-right{transform:translate(50%, 50%);position:absolute;bottom:0;right:0}";export{n as ez_badge}
|
|
@@ -24,7 +24,12 @@ export declare class EzBadge {
|
|
|
24
24
|
* Define a posição do ícone em relação ao elemento filho.
|
|
25
25
|
*/
|
|
26
26
|
position: IPosition;
|
|
27
|
+
/**
|
|
28
|
+
* Define a posição do ícone em relação ao elemento.
|
|
29
|
+
*/
|
|
30
|
+
alignItems: "center" | "flex-end" | "flex-start";
|
|
27
31
|
private getIconSize;
|
|
32
|
+
private getAlignItemsClass;
|
|
28
33
|
componentDidLoad(): void;
|
|
29
34
|
private handleSlotChange;
|
|
30
35
|
private validateIconLeft;
|
|
@@ -132,6 +132,10 @@ export namespace Components {
|
|
|
132
132
|
interface EzApplication {
|
|
133
133
|
}
|
|
134
134
|
interface EzBadge {
|
|
135
|
+
/**
|
|
136
|
+
* Define a posição do ícone em relação ao elemento.
|
|
137
|
+
*/
|
|
138
|
+
"alignItems": "center" | "flex-end" | "flex-start";
|
|
135
139
|
/**
|
|
136
140
|
* Define o ícone a ser usado no lado esquerdo do badge: [ez-icons](https://sankhyalabs-storybook.herokuapp.com/themes/default/icons/fonts/index.html)
|
|
137
141
|
*/
|
|
@@ -2742,6 +2746,10 @@ declare namespace LocalJSX {
|
|
|
2742
2746
|
"onApplicationLoaded"?: (event: EzApplicationCustomEvent<boolean>) => void;
|
|
2743
2747
|
}
|
|
2744
2748
|
interface EzBadge {
|
|
2749
|
+
/**
|
|
2750
|
+
* Define a posição do ícone em relação ao elemento.
|
|
2751
|
+
*/
|
|
2752
|
+
"alignItems"?: "center" | "flex-end" | "flex-start";
|
|
2745
2753
|
/**
|
|
2746
2754
|
* Define o ícone a ser usado no lado esquerdo do badge: [ez-icons](https://sankhyalabs-storybook.herokuapp.com/themes/default/icons/fonts/index.html)
|
|
2747
2755
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as o,H as n,g as t}from"./p-23a36bb6.js";import{StringUtils as c,ElementIDUtils as i}from"@sankhyalabs/core";const a=class{constructor(o){e(this,o),this.size="medium",this.href=void 0,this.iconName=void 0}isSprite(){return this.href&&this.href.indexOf("#")>-1}getIconClassName(){return`ez-icon-${this.iconName}`}getIconContent(){return this.isSprite()?o("svg",{class:this.size,role:"img"},o("use",{xlinkHref:this.href})):c.isEmpty(this.iconName)?o("img",{class:this.size,src:this.href}):o("span",{class:`icon-content ${this.getIconClassName()} ${this.size}--font`})}componentDidLoad(){i.addIDInfo(this._hostElement,"icon")}render(){return o(n,null,this.getIconContent())}get _hostElement(){return t(this)}};a.style=':host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^="ez-icon-"],[class*=" ez-icon-"]{color:var(--ez-icon--color)}[class^="ez-icon-"],[class*=" ez-icon-"]{font-family:\'ez-icons\' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:"\\ea01"}.ez-icon-2chevron-up:before{content:"\\ea02"}.ez-icon-acao:before{content:"\\ea03"}.ez-icon-account-outline:before{content:"\\ea04"}.ez-icon-account:before{content:"\\ea05"}.ez-icon-add-to-cart:before{content:"\\ea06"}.ez-icon-alert-circle-inverted:before{content:"\\ea07"}.ez-icon-alert-circle:before{content:"\\ea08"}.ez-icon-alert-mail:before{content:"\\ea09"}.ez-icon-alert-popup:before{content:"\\ea0a"}.ez-icon-anexo:before{content:"\\ea0b"}.ez-icon-antecipação:before{content:"\\ea0c"}.ez-icon-apps:before{content:"\\ea0d"}.ez-icon-arrow-forward:before{content:"\\ea0e"}.ez-icon-arrow-upward:before{content:"\\ea0f"}.ez-icon-arrow_back:before{content:"\\ea10"}.ez-icon-arrow_downward:before{content:"\\ea11"}.ez-icon-baixa:before{content:"\\ea12"}.ez-icon-balance:before{content:"\\ea13"}.ez-icon-bell-inverted:before{content:"\\ea14"}.ez-icon-bell:before{content:"\\ea15"}.ez-icon-boleto:before{content:"\\ea16"}.ez-icon-boolean:before{content:"\\ea17"}.ez-icon-business-center:before{content:"\\ea18"}.ez-icon-calendar-clock:before{content:"\\ea19"}.ez-icon-calendar:before{content:"\\ea1a"}.ez-icon-cart-history:before{content:"\\ea1b"}.ez-icon-cash-remove:before{content:"\\ea1c"}.ez-icon-check-circle-inverted:before{content:"\\ea1d"}.ez-icon-check-circle:before{content:"\\ea1e"}.ez-icon-check:before{content:"\\ea1f"}.ez-icon-chevron-down:before{content:"\\ea20"}.ez-icon-chevron-left:before{content:"\\ea21"}.ez-icon-chevron-right:before{content:"\\ea22"}.ez-icon-chevron-up:before{content:"\\ea23"}.ez-icon-circle--medium:before{content:"\\ea24"}.ez-icon-circle:before{content:"\\ea25"}.ez-icon-clean-cart:before{content:"\\ea26"}.ez-icon-cleaning:before{content:"\\ea27"}.ez-icon-clipboard:before{content:"\\ea28"}.ez-icon-clock-rotate-left:before{content:"\\ea29"}.ez-icon-close:before{content:"\\ea2a"}.ez-icon-cobrar:before{content:"\\ea2b"}.ez-icon-code:before{content:"\\ea2c"}.ez-icon-configuration:before{content:"\\ea2d"}.ez-icon-content-cut:before{content:"\\ea2e"}.ez-icon-copy:before{content:"\\ea2f"}.ez-icon-credit_card:before{content:"\\ea30"}.ez-icon-crop:before{content:"\\ea31"}.ez-icon-custom:before{content:"\\ea32"}.ez-icon-delete-file:before{content:"\\ea33"}.ez-icon-delete:before{content:"\\ea34"}.ez-icon-description:before{content:"\\ea35"}.ez-icon-dividir:before{content:"\\ea36"}.ez-icon-docx:before{content:"\\ea37"}.ez-icon-dot-notification:before{content:"\\ea38"}.ez-icon-dots-horizontal:before{content:"\\ea39"}.ez-icon-dots-vertical:before{content:"\\ea3a"}.ez-icon-drag-indicator:before{content:"\\ea3b"}.ez-icon-dual-chevron-down:before{content:"\\ea3c"}.ez-icon-dual-chevron-left:before{content:"\\ea3d"}.ez-icon-dual-chevron-right:before{content:"\\ea3e"}.ez-icon-dual-chevron-up:before{content:"\\ea3f"}.ez-icon-edit-file:before{content:"\\ea40"}.ez-icon-edit-table:before{content:"\\ea41"}.ez-icon-edit-time:before{content:"\\ea42"}.ez-icon-edit-value:before{content:"\\ea43"}.ez-icon-edit:before{content:"\\ea44"}.ez-icon-email:before{content:"\\ea45"}.ez-icon-estorno:before{content:"\\ea46"}.ez-icon-exe:before{content:"\\ea47"}.ez-icon-expand:before{content:"\\ea48"}.ez-icon-expandir_card:before{content:"\\ea49"}.ez-icon-extrato:before{content:"\\ea4a"}.ez-icon-eye-off:before{content:"\\ea4b"}.ez-icon-eye:before{content:"\\ea4c"}.ez-icon-favorite:before{content:"\\ea4d"}.ez-icon-figma:before{content:"\\ea4e"}.ez-icon-file-download:before{content:"\\ea4f"}.ez-icon-file-upload:before{content:"\\ea50"}.ez-icon-filter:before{content:"\\ea51"}.ez-icon-find-file:before{content:"\\ea52"}.ez-icon-find-page:before{content:"\\ea53"}.ez-icon-format-color-fill:before{content:"\\ea54"}.ez-icon-generic:before{content:"\\ea55"}.ez-icon-gif:before{content:"\\ea56"}.ez-icon-graph_bar:before{content:"\\ea57"}.ez-icon-handshake:before{content:"\\ea58"}.ez-icon-help-inverted:before{content:"\\ea59"}.ez-icon-help:before{content:"\\ea5a"}.ez-icon-hide-list:before{content:"\\ea5b"}.ez-icon-hide_menu:before{content:"\\ea5c"}.ez-icon-hierarchical-tree:before{content:"\\ea5d"}.ez-icon-home:before{content:"\\ea5e"}.ez-icon-icons104:before{content:"\\ea5f"}.ez-icon-language:before{content:"\\ea60"}.ez-icon-launch:before{content:"\\ea61"}.ez-icon-lightbulb:before{content:"\\ea62"}.ez-icon-list:before{content:"\\ea63"}.ez-icon-location:before{content:"\\ea64"}.ez-icon-lock-outline:before{content:"\\ea65"}.ez-icon-lock:before{content:"\\ea66"}.ez-icon-menu:before{content:"\\ea67"}.ez-icon-mid:before{content:"\\ea68"}.ez-icon-minus:before{content:"\\ea69"}.ez-icon-money-off:before{content:"\\ea6a"}.ez-icon-money:before{content:"\\ea6b"}.ez-icon-more:before{content:"\\ea6c"}.ez-icon-mp3:before{content:"\\ea6d"}.ez-icon-mp4:before{content:"\\ea6e"}.ez-icon-multiple-files:before{content:"\\ea6f"}.ez-icon-north-west:before{content:"\\ea70"}.ez-icon-number:before{content:"\\ea71"}.ez-icon-ordem-ascendente:before{content:"\\ea72"}.ez-icon-ordem-descendente:before{content:"\\ea73"}.ez-icon-parcelar:before{content:"\\ea74"}.ez-icon-pause:before{content:"\\ea75"}.ez-icon-payments:before{content:"\\ea76"}.ez-icon-pdf:before{content:"\\ea77"}.ez-icon-play:before{content:"\\ea78"}.ez-icon-plus:before{content:"\\ea79"}.ez-icon-png:before{content:"\\ea7a"}.ez-icon-power:before{content:"\\ea7b"}.ez-icon-pptx:before{content:"\\ea7c"}.ez-icon-preview:before{content:"\\ea7d"}.ez-icon-print:before{content:"\\ea7e"}.ez-icon-push-pin:before{content:"\\ea7f"}.ez-icon-rateio:before{content:"\\ea80"}.ez-icon-receipt:before{content:"\\ea81"}.ez-icon-recolher_card:before{content:"\\ea82"}.ez-icon-remove-from-cart:before{content:"\\ea83"}.ez-icon-restore:before{content:"\\ea84"}.ez-icon-return:before{content:"\\ea85"}.ez-icon-sankhya-place:before{content:"\\ea86"}.ez-icon-save:before{content:"\\ea87"}.ez-icon-search:before{content:"\\ea88"}.ez-icon-settings-inverted:before{content:"\\ea89"}.ez-icon-settings:before{content:"\\ea8a"}.ez-icon-share:before{content:"\\ea8b"}.ez-icon-shield:before{content:"\\ea8c"}.ez-icon-show-list:before{content:"\\ea8d"}.ez-icon-show_menu:before{content:"\\ea8e"}.ez-icon-south-east:before{content:"\\ea8f"}.ez-icon-sync:before{content:"\\ea90"}.ez-icon-table:before{content:"\\ea91"}.ez-icon-tag_code:before{content:"\\ea92"}.ez-icon-text:before{content:"\\ea93"}.ez-icon-timeline:before{content:"\\ea94"}.ez-icon-timer-outline:before{content:"\\ea95"}.ez-icon-trending-up:before{content:"\\ea96"}.ez-icon-tune:before{content:"\\ea97"}.ez-icon-txt:before{content:"\\ea98"}.ez-icon-un-pin:before{content:"\\ea99"}.ez-icon-unfold_less:before{content:"\\ea9a"}.ez-icon-unfold_more:before{content:"\\ea9b"}.ez-icon-user-circle:before{content:"\\ea9c"}.ez-icon-warning-outline:before{content:"\\ea9d"}.ez-icon-warning_triangle:before{content:"\\ea9e"}.ez-icon-whatshot:before{content:"\\ea9f"}.ez-icon-xlsx:before{content:"\\eaa0"}.ez-icon-zip:before{content:"\\eaa1"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}';export{a as ez_icon}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as a,H as t,g as i}from"./p-23a36bb6.js";import{ElementIDUtils as d}from"@sankhyalabs/core";var s;!function(e){e.EXTRA_LARGE="extra-large",e.LARGE="large",e.MEDIUM="medium",e.SMALL_MEDIUM="small-medium",e.SMALL="small",e.EXTRA_SMALL="extra-small"}(s||(s={}));const n=class{constructor(a){e(this,a),this._sizes={[s.EXTRA_LARGE]:{sufix:"xl"},[s.LARGE]:{sufix:"lg"},[s.MEDIUM]:{sufix:"md"},[s.SMALL_MEDIUM]:{sufix:"sm"},[s.SMALL]:{sufix:"xs"},[s.EXTRA_SMALL]:{sufix:"2xs"}},this.hasSlot=!1,this.size="small",this.label=void 0,this.iconLeft=void 0,this.iconRight=void 0,this.position={horizontal:"right",vertical:"top"}}getIconSize(){switch(this.size){case"large":return"large";case"medium":case"small-medium":return"small";case"small":return"x-small";default:return null}}componentDidLoad(){this._element&&d.addIDInfo(this._element),this._badge&&d.addIDInfo(this._badge,"ezBadge",{id:"embedded"})}handleSlotChange(){this.hasSlot=!0}validateIconLeft(){return this.iconLeft&&""!==this.iconLeft.trim()}validateIconRight(){return this.iconRight&&""!==this.iconRight.trim()}validateLabel(){return this.label&&""!==this.label.trim()}createContainerClassName(){let e=this._sizes[this.size].sufix,a=["badge__content"];return this.hasSlot&&(a.push("badge__content--fill-"+e),"bottom"==this.position.vertical&&"right"==this.position.horizontal&&a.push("badge__content--fill-bottom-right"),"bottom"==this.position.vertical&&"left"==this.position.horizontal&&a.push("badge__content--fill-bottom-left"),"top"==this.position.vertical&&"right"==this.position.horizontal&&a.push("badge__content--fill-top-right"),"top"==this.position.vertical&&"left"==this.position.horizontal&&a.push("badge__content--fill-top-left")),a.push(this.label?"badge__content--text-"+e:this.iconLeft||this.iconRight?"badge__content--icon-"+e:"badge__content--fill-"+e),a.join(" ")}render(){return a(t,null,a("div",{class:"badge"},a("div",null,a("slot",{name:"child-badge",onSlotchange:()=>{this.handleSlotChange()}})),a("div",{class:this.createContainerClassName(),ref:e=>this._badge=e},this.validateIconLeft()&&a("ez-icon",{class:"icon",iconName:this.iconLeft,size:this.getIconSize()}),this.validateLabel()&&a("label",{title:this.label},this.label),this.validateIconRight()&&a("ez-icon",{class:"icon",iconName:this.iconRight,size:this.getIconSize()}))))}get _element(){return i(this)}};n.style=":host{--ez-badge--size-2xs:var(--space--2xs, 8px);--ez-badge--size-xs:var(--space--xs, 12px);--ez-badge--size-sm:var(--space--sm, 16px);--ez-badge--size-md:var(--space--md, 20px);--ez-badge--size-lg:var(--space--lg, 24px);--ez-badge--size-xl:var(--space--xl, 32px);--ez-badge--padding-2xs:0;--ez-badge--padding-xs:var(--space--nano, 2px);--ez-badge--padding-sm:calc(var(--space--nano, 2px) + 1px);--ez-badge--padding-md:var(--space--3xs, 4px);--ez-badge--padding-lg:calc(var(--space--3xs, 4px) + 2px);--ez-badge--padding-xl:var(--space--2xs);--ez-badge--border-radius:calc(var(--border--radius-medium, 12px) + 8px);--ez-badge--font-family:var(--font-pattern, Roboto);--ez-badge--font-weight-medium:var(--text-weight--medium, 400);--ez-badge--background-color:var(--color--primary, #008561);--ez-badge--border-none:0;--ez-badge--color:var(--text--inverted, #ffffff);--ez-badge--gap:calc(var(--ez-badge--padding-xs) + 1px);--ez-badge--font-size-md:var(--text--medium);--ez-badge--font-size-sm:var(--text--medium);--ez-badge--font-size-xs:var(--text--small)}ez-icon{--ez-icon--color:inherit}.badge{display:flex;justify-content:center;align-items:center;position:relative}.badge__content{font-family:var(--ez-badge--font-family, Roboto);font-weight:var(--ez-badge--font-weight-medium, 400);background-color:var(--ez-badge--background-color, #008561);border:var(--ez-badge--border-none, 0);color:var(--ez-badge--color, #ffffff);border-radius:var(--ez-badge--border-radius, 20px);gap:var(--ez-badge--gap, 3px);display:flex;justify-content:center;align-items:center}.badge__content--fill-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px)}.badge__content--fill-2xs{height:var(--ez-badge--size-2xs, 8px);min-width:var(--ez-badge--size-2xs, 8px)}.badge__content--text-md{height:calc(var(--ez-badge--size-md, 20px) - 2px);min-width:var(--ez-badge--size-sm, 20px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-md)}.badge__content--text-sm{height:calc(var(--ez-badge--size-sm, 16px) - 2px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-sm)}.badge__content--text-xs{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-2xs);padding-bottom:var(--ez-badge--padding-2xs);padding-right:var(--ez-badge--padding-lg);padding-left:var(--ez-badge--padding-lg);font-size:var(--ez-badge--font-size-xs)}.badge__content--icon-lg{height:var(--ez-badge--size-lg, 24px);min-width:var(--ez-badge--size-lg, 24px);padding:var(--ez-badge--padding-md)}.badge__content--icon-md{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-md)}.badge__content--icon-sm{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-xs)}.badge__content--icon-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px);padding:var(--ez-badge--padding-xs)}.badge__content--fill{position:absolute;top:0;inset-inline-end:0;z-index:var(--most-visible, 2)}.badge__content--fill-top-right{transform:translate(50%, -50%);position:absolute;top:0;right:0}.badge__content--fill-top-left{transform:translate(-50%, -50%);position:absolute;top:0;left:0}.badge__content--fill-bottom-left{transform:translate(-50%, 50%);position:absolute;bottom:0;left:0}.badge__content--fill-bottom-right{transform:translate(50%, 50%);position:absolute;bottom:0;right:0}";export{n as ez_badge}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,F as n,H as o,g as s}from"./p-23a36bb6.js";import{ArrayUtils as r}from"@sankhyalabs/core";var l;!function(t){t.DATASOURCE_RESULTS="DATASOURCE_RESULTS",t.DATASOURCE_RESULTS_EMPTY="DATASOURCE_RESULTS_EMPTY",t.DATASOURCE_INIT="DATASOURCE_INIT",t.OPTIONS_EMPTY="OPTIONS_EMPTY",t.OPTIONS="OPTIONS"}(l||(l={}));const a=class{constructor(i){t(this,i),this.changeFilteredOptions=e(this,"changeFilteredOptions",7),this.columnName=void 0,this.dataSource=void 0,this.useOptions=!1,this.options=void 0,this.isTextSearch=!1,this.filteredOptions=void 0,this.displayOptions=void 0,this.viewScenario=void 0,this.displayOptionToCheckAllItems=!0}async clearFilteredOptions(){this.setInitialScenario(),this.filteredOptions=[],this.searchInput&&(this.searchInput.value=""),this.filterInput&&(this.filterInput.value="")}onChangeUseOptions(){this.setInitialScenario()}onChangeOptions(){this.options&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.options)),this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.setInitialScenario()}onChangeFilteredOptions(t){this.displayOptions=this.filteredOptions,this.displayOptionToCheckAllItems=this.filteredOptions.length>1,this.checkInput&&this.changeCheckAllValeuFromFilteredOptions(),this.changeFilteredOptions.emit(t)}componentDidRender(){this.changeCheckAllValeuFromFilteredOptions()}ordenationByCheckStateAndAlphabetically(t){const e=[],i=[];let n;return t.forEach((t=>{null==t.value||""===t.label?n=Object.assign(Object.assign({},t),{label:"(Vazio)"}):t.check?e.push(t):i.push(t)})),(null==n?[]:[n]).concat(null==this.dataSource?r.sortAlphabetically(e):this.dataSource.sortItems(this.columnName,e)).concat(null==this.dataSource?r.sortAlphabetically(i):this.dataSource.sortItems(this.columnName,i))}changeCheckAllValeuFromFilteredOptions(){var t,e,i,n;const o=null===(t=this.filteredOptions)||void 0===t?void 0:t.every((t=>!0===t.check)),s=null===(e=this.filteredOptions)||void 0===e?void 0:e.every((t=>!1===t.check)),r=(null===(i=this.filteredOptions)||void 0===i?void 0:i.some((t=>!1===t.check)))&&(null===(n=this.filteredOptions)||void 0===n?void 0:n.some((t=>!0===t.check)))&&(!o||!s);return this.checkInput&&o?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!0)):this.checkInput&&r?(this.checkInput.indeterminate=!0,void(this.checkInput.value=!1)):this.checkInput&&s?(this.checkInput.indeterminate=!1,void(this.checkInput.value=!1)):void 0}setInitialScenario(){if(this.useOptions)return this.viewScenario=l.OPTIONS,void this.changeCheckAllValeuFromFilteredOptions();this.viewScenario=this.options&&this.options.length>0?l.DATASOURCE_RESULTS:l.DATASOURCE_INIT}async searchWithDataSource(t,e){const{argument:i,mode:n}=t;if("PRELOAD"!==n&&e)return this.dataSource.fetchData(i,e)}handleSearchOnDataSource(t){var e;const i=null!==(e=this.filteredOptions)&&void 0!==e?e:[];t.detail&&!i.some((e=>e.value==t.detail.value))&&(this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...i,t.detail])),this.viewScenario=l.DATASOURCE_RESULTS,this.searchInput.value=""}handleRemoveItemFromOptions(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically(this.filteredOptions.filter((e=>e.value!==t.value))),0===this.filteredOptions.length&&(this.viewScenario=l.DATASOURCE_INIT),this.searchInput&&(this.searchInput.value="")}handleSearchOnOption(t){if(t.detail)return this.displayOptions=r.applyStringFilter(t.detail,this.filteredOptions,!0),void(this.viewScenario=0===this.displayOptions.length?l.OPTIONS_EMPTY:l.OPTIONS);this.displayOptions=this.filteredOptions,this.viewScenario=l.OPTIONS}handleChangeSelectAllItems(t){this.filteredOptions=this.ordenationByCheckStateAndAlphabetically([...this.filteredOptions.map((e=>(e.check=!!t.detail,e)))])}handleChangeSelectedItem(t){const{detail:e}=t;this.filteredOptions.find((t=>t.label===e.label)).check=e.check}buildViewList(t){return i(n,null,this.displayOptionToCheckAllItems&&i("ez-check",{ref:t=>this.checkInput=t,label:"Selecionar todos",class:"multi-selection__select-all",onEzChange:this.handleChangeSelectAllItems.bind(this)}),i("ez-list",{class:"multi-selection__list",dataSource:this.displayOptions,listMode:"check",hoverFeedback:!0,onEzCheckChange:this.handleChangeSelectedItem.bind(this),itemSlotBuilder:t?this.buildDeleteIconSlot.bind(this):null}))}buildDeleteIconSlot(t){return i("ez-icon",{style:{cursor:"pointer"},iconName:"delete",onClick:()=>this.handleRemoveItemFromOptions(t)})}buildInitViewWithDataSource(){return i("multi-selection-box-message",{message:"Selecione os valores a serem filtrados através do campo de busca."})}buildViewEmptyResults(){return i("multi-selection-box-message",{message:"Nenhum resultado encontrado."})}scenarioToDisplay(t){const e={[l.DATASOURCE_INIT]:()=>this.buildInitViewWithDataSource(),[l.DATASOURCE_RESULTS]:()=>this.buildViewList(!0),[l.DATASOURCE_RESULTS_EMPTY]:()=>this.buildViewEmptyResults(),[l.OPTIONS_EMPTY]:()=>this.buildViewEmptyResults(),[l.OPTIONS]:()=>this.buildViewList(!1)}[t];return e?e():void 0}render(){return i(o,null,i("div",{class:"multi-selection"},this.useOptions?i("ez-filter-input",{ref:t=>this.filterInput=t,label:"Buscar..",onEzChange:this.handleSearchOnOption.bind(this)}):i("ez-search",{class:"multi-selection__input",label:"Buscar...",ref:t=>this.searchInput=t,suppressEmptyOption:!0,showOptionValue:!1,showSelectedValue:!1,optionLoader:t=>this.searchWithDataSource(t,this.columnName),onEzChange:this.handleSearchOnDataSource.bind(this),isTextSearch:this.isTextSearch}),i("ez-scroll",{class:"multi-selection__content-options"},this.scenarioToDisplay(this.viewScenario))))}static get watchers(){return{useOptions:["onChangeUseOptions"],options:["onChangeOptions"],filteredOptions:["onChangeFilteredOptions"]}}};a.style=".sc-ez-multi-selection-list-h{--ez-check--outter-gap:0px;--ez-multi-selection-default-height:322px;display:block;width:304px;height:var(--ez-multi-selection-default-height);min-height:fit-content;max-height:calc(100vh - 350px)}.multi-selection__input.sc-ez-multi-selection-list{margin-bottom:var(--space--2xs, 8px)}.multi-selection__content-options.sc-ez-multi-selection-list{position:relative;left:-4px}.multi-selection__select-all.sc-ez-multi-selection-list{height:var(--space--xl);margin:0 var(--space--small, 6px)}.multi-selection__list.sc-ez-multi-selection-list{max-height:calc(100vh - 435px);overflow-y:auto;overflow-x:clip}.multi-selection__list.sc-ez-multi-selection-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";const c=Math.min,h=Math.max,u=Math.round,d=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"},p={start:"end",end:"start"};function m(t,e,i){return h(t,c(e,i))}function v(t,e){return"function"==typeof t?t(e):t}function b(t){return t.split("-")[0]}function g(t){return t.split("-")[1]}function y(t){return"x"===t?"y":"x"}function x(t){return"y"===t?"height":"width"}function w(t){return["top","bottom"].includes(b(t))?"y":"x"}function _(t){return y(w(t))}function z(t){return t.replace(/start|end/g,(t=>p[t]))}function O(t){return t.replace(/left|right|bottom|top/g,(t=>f[t]))}function S(t){const{x:e,y:i,width:n,height:o}=t;return{width:n,height:o,top:i,left:e,right:e+n,bottom:i+o,x:e,y:i}}function k(t,e,i){let{reference:n,floating:o}=t;const s=w(e),r=_(e),l=x(r),a=b(e),c="y"===s,h=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,d=n[l]/2-o[l]/2;let f;switch(a){case"top":f={x:h,y:n.y-o.height};break;case"bottom":f={x:h,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(g(e)){case"start":f[r]-=d*(i&&c?-1:1);break;case"end":f[r]+=d*(i&&c?-1:1)}return f}async function C(t,e){var i;void 0===e&&(e={});const{x:n,y:o,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:f=0}=v(e,t),p=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}}(f),m=l[d?"floating"===u?"reference":"floating":u],b=S(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(m)))||i?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:h,strategy:a})),g="floating"===u?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,y=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),x=await(null==s.isElement?void 0:s.isElement(y))&&await(null==s.getScale?void 0:s.getScale(y))||{x:1,y:1},w=S(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:a}):g);return{top:(b.top-w.top+p.top)/x.y,bottom:(w.bottom-b.bottom+p.bottom)/x.y,left:(b.left-w.left+p.left)/x.x,right:(w.right-b.right+p.right)/x.x}}function A(){return"undefined"!=typeof window}function P(t){return E(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function T(t){var e;return null==(e=(E(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function E(t){return!!A()&&(t instanceof Node||t instanceof R(t).Node)}function D(t){return!!A()&&(t instanceof Element||t instanceof R(t).Element)}function F(t){return!!A()&&(t instanceof HTMLElement||t instanceof R(t).HTMLElement)}function L(t){return!(!A()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof R(t).ShadowRoot)}function I(t){const{overflow:e,overflowX:i,overflowY:n,display:o}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&!["inline","contents"].includes(o)}function B(t){return["table","td","th"].includes(P(t))}function N(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function V(t){const e=j(),i=D(t)?U(t):t;return"none"!==i.transform||"none"!==i.perspective||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function j(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function M(t){return["html","body","#document"].includes(P(t))}function U(t){return R(t).getComputedStyle(t)}function $(t){return D(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if("html"===P(t))return t;const e=t.assignedSlot||t.parentNode||L(t)&&t.host||T(t);return L(e)?e.host:e}function W(t){const e=G(t);return M(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&I(e)?e:W(e)}function Y(t,e,i){var n;void 0===e&&(e=[]),void 0===i&&(i=!0);const o=W(t),s=o===(null==(n=t.ownerDocument)?void 0:n.body),r=R(o);if(s){const t=H(r);return e.concat(r,r.visualViewport||[],I(o)?o:[],t&&i?Y(t):[])}return e.concat(o,Y(o,[],i))}function H(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function X(t){const e=U(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=F(t),s=o?t.offsetWidth:i,r=o?t.offsetHeight:n,l=u(i)!==s||u(n)!==r;return l&&(i=s,n=r),{width:i,height:n,$:l}}function q(t){return D(t)?t:t.contextElement}function J(t){const e=q(t);if(!F(e))return d(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:s}=X(e);let r=(s?u(i.width):i.width)/n,l=(s?u(i.height):i.height)/o;return r&&Number.isFinite(r)||(r=1),l&&Number.isFinite(l)||(l=1),{x:r,y:l}}const K=d(0);function Q(t){const e=R(t);return j()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:K}function Z(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1);const o=t.getBoundingClientRect(),s=q(t);let r=d(1);e&&(n?D(n)&&(r=J(n)):r=J(t));const l=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==R(t))&&e}(s,i,n)?Q(s):d(0);let a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,h=o.width/r.x,u=o.height/r.y;if(s){const t=R(s),e=n&&D(n)?R(n):n;let i=t,o=H(i);for(;o&&n&&e!==i;){const t=J(o),e=o.getBoundingClientRect(),n=U(o),s=e.left+(o.clientLeft+parseFloat(n.paddingLeft))*t.x,r=e.top+(o.clientTop+parseFloat(n.paddingTop))*t.y;a*=t.x,c*=t.y,h*=t.x,u*=t.y,a+=s,c+=r,i=R(o),o=H(i)}}return S({width:h,height:u,x:a,y:c})}function tt(t,e){const i=$(t).scrollLeft;return e?e.left+i:Z(T(t)).left+i}function et(t,e,i){void 0===i&&(i=!1);const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-(i?0:tt(t,n)),y:n.top+e.scrollTop}}function it(t,e,i){let n;if("viewport"===e)n=function(t,e){const i=R(t),n=T(t),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;const t=j();(!t||t&&"fixed"===e)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}(t,i);else if("document"===e)n=function(t){const e=T(t),i=$(t),n=t.ownerDocument.body,o=h(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=h(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+tt(t);const l=-i.scrollTop;return"rtl"===U(n).direction&&(r+=h(e.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}(T(t));else if(D(e))n=function(t,e){const i=Z(t,!0,"fixed"===e),n=i.top+t.clientTop,o=i.left+t.clientLeft,s=F(t)?J(t):d(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:o*s.x,y:n*s.y}}(e,i);else{const i=Q(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return S(n)}function nt(t,e){const i=G(t);return!(i===e||!D(i)||M(i))&&("fixed"===U(i).position||nt(i,e))}function ot(t,e,i){const n=F(e),o=T(e),s="fixed"===i,r=Z(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const a=d(0);if(n||!n&&!s)if(("body"!==P(e)||I(o))&&(l=$(e)),n){const t=Z(e,!0,s,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else o&&(a.x=tt(o));const c=!o||n||s?d(0):et(o,l);return{x:r.left+l.scrollLeft-a.x-c.x,y:r.top+l.scrollTop-a.y-c.y,width:r.width,height:r.height}}function st(t){return"static"===U(t).position}function rt(t,e){if(!F(t)||"fixed"===U(t).position)return null;if(e)return e(t);let i=t.offsetParent;return T(t)===i&&(i=i.ownerDocument.body),i}function lt(t,e){const i=R(t);if(N(t))return i;if(!F(t)){let e=G(t);for(;e&&!M(e);){if(D(e)&&!st(e))return e;e=G(e)}return i}let n=rt(t,e);for(;n&&B(n)&&st(n);)n=rt(n,e);return n&&M(n)&&st(n)&&!V(n)?i:n||function(t){let e=G(t);for(;F(e)&&!M(e);){if(V(e))return e;if(N(e))return null;e=G(e)}return null}(t)||i}const at={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const s="fixed"===o,r=T(n),l=!!e&&N(e.floating);if(n===r||l&&s)return i;let a={scrollLeft:0,scrollTop:0},c=d(1);const h=d(0),u=F(n);if((u||!u&&!s)&&(("body"!==P(n)||I(r))&&(a=$(n)),F(n))){const t=Z(n);c=J(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}const f=!r||u||s?d(0):et(r,a,!0);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-a.scrollLeft*c.x+h.x+f.x,y:i.y*c.y-a.scrollTop*c.y+h.y+f.y}},getDocumentElement:T,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const s=[..."clippingAncestors"===i?N(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let n=Y(t,[],!1).filter((t=>D(t)&&"body"!==P(t))),o=null;const s="fixed"===U(t).position;let r=s?G(t):t;for(;D(r)&&!M(r);){const e=U(r),i=V(r);i||"fixed"!==e.position||(o=null),(s?!i&&!o:!i&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||I(r)&&!i&&nt(t,r))?n=n.filter((t=>t!==r)):o=e,r=G(r)}return e.set(t,n),n}(e,this._c):[].concat(i),n],r=s.reduce(((t,i)=>{const n=it(e,i,o);return t.top=h(n.top,t.top),t.right=c(n.right,t.right),t.bottom=c(n.bottom,t.bottom),t.left=h(n.left,t.left),t}),it(e,s[0],o));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:lt,getElementRects:async function(t){const e=this.getOffsetParent||lt,i=this.getDimensions,n=await i(t.floating);return{reference:ot(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=X(t);return{width:e,height:i}},getScale:J,isElement:D,isRTL:function(t){return"rtl"===U(t).direction}},ct=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:n,placement:o}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...a}=v(t,e),c={x:i,y:n},h=await C(e,a),u=w(b(o)),d=y(u);let f=c[d],p=c[u];s&&(f=m(f+h["y"===d?"top":"left"],f,f-h["y"===d?"bottom":"right"])),r&&(p=m(p+h["y"===u?"top":"left"],p,p-h["y"===u?"bottom":"right"]));const g=l.fn({...e,[d]:f,[u]:p});return{...g,data:{x:g.x-i,y:g.y-n,enabled:{[d]:s,[u]:r}}}}}},ht=class{constructor(i){t(this,i),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){if(t!==e)return t?this.openPopover():this.hidePopover(),void 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,i)=>{const n=new Map,o={platform:at,...i},s={...o.platform,_c:n};return(async(t,e,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=s.filter(Boolean),a=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:h,y:u}=k(c,n,a),d=n,f={},p=0;for(let i=0;i<l.length;i++){const{name:s,fn:m}=l[i],{x:v,y:b,data:g,reset:y}=await m({x:h,y:u,initialPlacement:n,placement:d,strategy:o,middlewareData:f,rects:c,platform:r,elements:{reference:t,floating:e}});h=null!=v?v:h,u=null!=b?b:u,f={...f,[s]:{...f[s],...g}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:o}):y.rects),({x:h,y:u}=k(c,d,a))),i=-1)}return{x:h,y:u,placement:d,strategy:o,middlewareData:f}})(t,e,{...o,platform:s})})(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 i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=v(t,e);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};const S=b(o),k=w(l),A=b(l)===l,P=await(null==a.isRTL?void 0:a.isRTL(c.floating)),R=d||(A||!m?[O(l)]:function(t){const e=O(t);return[z(t),e,z(e)]}(l)),T="none"!==p;!d&&T&&R.push(...function(t,e,i,n){const o=g(t);let s=function(t,e,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return i?e?o:n:e?n:o;case"left":case"right":return e?s:r;default:return[]}}(b(t),"start"===i,n);return o&&(s=s.map((t=>t+"-"+o)),e&&(s=s.concat(s.map(z)))),s}(l,m,p,P));const E=[l,...R],D=await C(e,y),F=[];let L=(null==(n=s.flip)?void 0:n.overflows)||[];if(h&&F.push(D[S]),u){const t=function(t,e,i){void 0===i&&(i=!1);const n=g(t),o=_(t),s=x(o);let r="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=O(r)),[r,O(r)]}(o,r,P);F.push(D[t[0]],D[t[1]])}if(L=[...L,{placement:o,overflows:F}],!F.every((t=>t<=0))){var I,B;const t=((null==(I=s.flip)?void 0:I.index)||0)+1,e=E[t];if(e)return{data:{index:t,overflows:L},reset:{placement:e}};let i=null==(B=L.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:B.placement;if(!i)switch(f){case"bestFit":{var N;const t=null==(N=L.filter((t=>{if(T){const e=w(t.placement);return e===k||"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:N[0];t&&(i=t);break}case"initialPlacement":i=l}if(o!==i)return{reset:{placement:i}}}return{}}}),ct({padding:5})],strategy:"fixed"}).then((({x:t,y:e,placement:i})=>{const n=i.includes("bottom")?e+this.options.verticalGap:e-this.options.verticalGap,o=i.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${n}px`,left:`${o}px`})})))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){this._box&&(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)}disconnectedCallback(){window.removeEventListener("scroll",this.updatePositionDebounce.bind(this),!0),window.removeEventListener("resize",this.updatePositionDebounce.bind(this),!0),this._resizeObserver.disconnect()}render(){return i(o,null,i("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),i("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}},i("slot",null)))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};ht.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)}";export{a as ez_multi_selection_list,ht as ez_popover_plus}
|