@sankhyalabs/ezui 5.20.0-dev.3 → 5.20.0-dev.5
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/README.md +4 -5
- package/dist/cjs/ez-alert-list.cjs.entry.js +33 -28
- package/dist/cjs/ez-card-item_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +4 -2
- package/dist/cjs/ez-grid.cjs.entry.js +3 -3
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +3 -3
- package/dist/cjs/ez-split-panel.cjs.entry.js +3 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +33 -28
- package/dist/collection/components/ez-card-item/ez-card-item.css +20 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
- package/dist/collection/components/ez-grid/ez-grid.css +1 -0
- package/dist/collection/components/ez-grid/ez-grid.js +2 -2
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-search/ez-search.css +2 -1
- package/dist/collection/components/ez-search/ez-search.js +2 -2
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +7 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +19 -1
- package/dist/custom-elements/index.js +49 -41
- package/dist/esm/ez-alert-list.entry.js +33 -28
- package/dist/esm/ez-card-item_3.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +4 -2
- package/dist/esm/ez-grid.entry.js +3 -3
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +3 -3
- package/dist/esm/ez-split-panel.entry.js +3 -2
- 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-13dbad96.entry.js +1 -0
- package/dist/ezui/p-428a05fe.entry.js +1 -0
- package/dist/ezui/p-60848ef6.entry.js +1 -0
- package/dist/ezui/{p-6e2f8e6b.entry.js → p-844ee673.entry.js} +1 -1
- package/dist/ezui/{p-f56dd1da.entry.js → p-93c3df4f.entry.js} +1 -1
- package/dist/ezui/p-940ed30b.entry.js +1 -0
- package/dist/ezui/p-e52cbcc7.entry.js +1 -0
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +1 -1
- package/dist/types/components.d.ts +8 -0
- package/package.json +16 -8
- package/dist/ezui/p-43b03119.entry.js +0 -1
- package/dist/ezui/p-4a7f113d.entry.js +0 -1
- package/dist/ezui/p-76ba9d67.entry.js +0 -1
- package/dist/ezui/p-796c1a88.entry.js +0 -1
- package/dist/ezui/p-ba875f37.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as h}from"./p-23a36bb6.js";import{StringUtils as n}from"@sankhyalabs/core";var r=function(t,i){return Number(t.slice(0,-1*i.length))},e=function(t){return t.endsWith("px")?{value:t,type:"px",numeric:r(t,"px")}:t.endsWith("fr")?{value:t,type:"fr",numeric:r(t,"fr")}:t.endsWith("%")?{value:t,type:"%",numeric:r(t,"%")}:"auto"===t?{value:t,type:"auto"}:null},o=function(t){return t.split(" ").map(e)},u=function(t,i,s){return i.concat(s).map((function(i){return i.style[t]})).filter((function(t){return void 0!==t&&""!==t}))},c=function(t){for(var i=0;i<t.length;i++)if(t[i].numeric>0)return i;return null},a=function(){return!1},f=function(t,i,s){t.style[i]=s},l=function(t,i,s){var h=t[i];return void 0!==h?h:s};function d(t){var i;return(i=[]).concat.apply(i,Array.from(t.ownerDocument.styleSheets).map((function(t){var i=[];try{i=Array.from(t.cssRules||[])}catch(t){}return i}))).filter((function(i){var s=!1;try{s=t.matches(i.selectorText)}catch(t){}return s}))}var m=function(t,i,s){this.direction=t,this.element=i.element,this.track=i.track,"column"===t?(this.gridTemplateProp="grid-template-columns",this.gridGapProp="grid-column-gap",this.cursor=l(s,"columnCursor",l(s,"cursor","col-resize")),this.snapOffset=l(s,"columnSnapOffset",l(s,"snapOffset",30)),this.dragInterval=l(s,"columnDragInterval",l(s,"dragInterval",1)),this.clientAxis="clientX",this.optionStyle=l(s,"gridTemplateColumns")):"row"===t&&(this.gridTemplateProp="grid-template-rows",this.gridGapProp="grid-row-gap",this.cursor=l(s,"rowCursor",l(s,"cursor","row-resize")),this.snapOffset=l(s,"rowSnapOffset",l(s,"snapOffset",30)),this.dragInterval=l(s,"rowDragInterval",l(s,"dragInterval",1)),this.clientAxis="clientY",this.optionStyle=l(s,"gridTemplateRows")),this.onDragStart=l(s,"onDragStart",a),this.onDragEnd=l(s,"onDragEnd",a),this.onDrag=l(s,"onDrag",a),this.writeStyle=l(s,"writeStyle",f),this.startDragging=this.startDragging.bind(this),this.stopDragging=this.stopDragging.bind(this),this.drag=this.drag.bind(this),this.minSizeStart=i.minSizeStart,this.minSizeEnd=i.minSizeEnd,i.element&&(this.element.addEventListener("mousedown",this.startDragging),this.element.addEventListener("touchstart",this.startDragging))};m.prototype.getDimensions=function(){var t=this.grid.getBoundingClientRect(),i=t.width,s=t.height,h=t.bottom,n=t.left,r=t.right;"column"===this.direction?(this.start=t.top,this.end=h,this.size=s):"row"===this.direction&&(this.start=n,this.end=r,this.size=i)},m.prototype.getSizeAtTrack=function(t,i){return function(t,i,s,h){return void 0===s&&(s=0),void 0===h&&(h=!1),i.slice(0,h?t+1:t).reduce((function(t,i){return t+i.numeric}),0)+(s?t*s:0)}(t,this.computedPixels,this.computedGapPixels,i)},m.prototype.getSizeOfTrack=function(t){return this.computedPixels[t].numeric},m.prototype.getRawTracks=function(){var t=u(this.gridTemplateProp,[this.grid],d(this.grid));if(!t.length){if(this.optionStyle)return this.optionStyle;throw Error("Unable to determine grid template tracks from styles.")}return t[0]},m.prototype.getGap=function(){var t=u(this.gridGapProp,[this.grid],d(this.grid));return t.length?t[0]:null},m.prototype.getRawComputedTracks=function(){return window.getComputedStyle(this.grid)[this.gridTemplateProp]},m.prototype.getRawComputedGap=function(){return window.getComputedStyle(this.grid)[this.gridGapProp]},m.prototype.setTracks=function(t){this.tracks=t.split(" "),this.trackValues=o(t)},m.prototype.setComputedTracks=function(t){this.computedTracks=t.split(" "),this.computedPixels=o(t)},m.prototype.setGap=function(t){this.gap=t},m.prototype.setComputedGap=function(t){var i;this.computedGap=t,this.computedGapPixels=((i=this.computedGap).endsWith("px")?Number(i.slice(0,-1*"px".length)):null)||0},m.prototype.getMousePosition=function(t){return"touches"in t?t.touches[0][this.clientAxis]:t[this.clientAxis]},m.prototype.startDragging=function(t){if(!("button"in t)||0===t.button){t.preventDefault(),this.grid=this.element?this.element.parentNode:t.target.parentNode,this.getDimensions(),this.setTracks(this.getRawTracks()),this.setComputedTracks(this.getRawComputedTracks()),this.setGap(this.getGap()),this.setComputedGap(this.getRawComputedGap());var i=this.trackValues.filter((function(t){return"%"===t.type})),s=this.trackValues.filter((function(t){return"fr"===t.type}));if(this.totalFrs=s.length,this.totalFrs){var h=c(s);null!==h&&(this.frToPixels=this.computedPixels[h].numeric/s[h].numeric)}if(i.length){var n=c(i);null!==n&&(this.percentageToPixels=this.computedPixels[n].numeric/i[n].numeric)}var r=this.getSizeAtTrack(this.track,!1)+this.start;if(this.dragStartOffset=this.getMousePosition(t)-r,this.aTrack=this.track-1,!(this.track<this.tracks.length-1))throw Error("Invalid track index: "+this.track+". Track must be between two other tracks and only "+this.tracks.length+" tracks were found.");this.bTrack=this.track+1,this.aTrackStart=this.getSizeAtTrack(this.aTrack,!1)+this.start,this.bTrackEnd=this.getSizeAtTrack(this.bTrack,!0)+this.start,this.dragging=!0,window.addEventListener("mouseup",this.stopDragging),window.addEventListener("touchend",this.stopDragging),window.addEventListener("touchcancel",this.stopDragging),window.addEventListener("mousemove",this.drag),window.addEventListener("touchmove",this.drag),this.grid.addEventListener("selectstart",a),this.grid.addEventListener("dragstart",a),this.grid.style.userSelect="none",this.grid.style.webkitUserSelect="none",this.grid.style.MozUserSelect="none",this.grid.style.pointerEvents="none",this.grid.style.cursor=this.cursor,window.document.body.style.cursor=this.cursor,this.onDragStart(this.direction,this.track)}},m.prototype.stopDragging=function(){this.dragging=!1,this.cleanup(),this.onDragEnd(this.direction,this.track),this.needsDestroy&&(this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),this.destroyCb(),this.needsDestroy=!1,this.destroyCb=null)},m.prototype.drag=function(t){var i=this.getMousePosition(t),s=this.getSizeOfTrack(this.track),h=this.aTrackStart+this.minSizeStart+this.dragStartOffset+this.computedGapPixels,n=this.bTrackEnd-this.minSizeEnd-this.computedGapPixels-(s-this.dragStartOffset);i<h+this.snapOffset&&(i=h),i>n-this.snapOffset&&(i=n),i<h?i=h:i>n&&(i=n);var r=i-this.aTrackStart-this.dragStartOffset-this.computedGapPixels,e=this.bTrackEnd-i+this.dragStartOffset-s-this.computedGapPixels;if(this.dragInterval>1){var o=Math.round(r/this.dragInterval)*this.dragInterval;e-=o-r,r=o}r<this.minSizeStart&&(r=this.minSizeStart),e<this.minSizeEnd&&(e=this.minSizeEnd),"px"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=r+"px":"fr"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=1===this.totalFrs?"1fr":r/this.frToPixels+"fr":"%"===this.trackValues[this.aTrack].type&&(this.tracks[this.aTrack]=r/this.percentageToPixels+"%"),"px"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=e+"px":"fr"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=1===this.totalFrs?"1fr":e/this.frToPixels+"fr":"%"===this.trackValues[this.bTrack].type&&(this.tracks[this.bTrack]=e/this.percentageToPixels+"%");var u=this.tracks.join(" ");this.writeStyle(this.grid,this.gridTemplateProp,u),this.onDrag(this.direction,this.track,u)},m.prototype.cleanup=function(){window.removeEventListener("mouseup",this.stopDragging),window.removeEventListener("touchend",this.stopDragging),window.removeEventListener("touchcancel",this.stopDragging),window.removeEventListener("mousemove",this.drag),window.removeEventListener("touchmove",this.drag),this.grid&&(this.grid.removeEventListener("selectstart",a),this.grid.removeEventListener("dragstart",a),this.grid.style.userSelect="",this.grid.style.webkitUserSelect="",this.grid.style.MozUserSelect="",this.grid.style.pointerEvents="",this.grid.style.cursor=""),window.document.body.style.cursor=""},m.prototype.destroy=function(t,i){void 0===t&&(t=!0),t||!1===this.dragging?(this.cleanup(),this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),i&&i()):(this.needsDestroy=!0,i&&(this.destroyCb=i))};var w=function(t,i,s){return i in t?t[i]:s},v=function(t,i){return function(s){if(s.track<1)throw Error("Invalid track index: "+s.track+". Track must be between two other tracks.");var h="column"===t?i.columnMinSizes||{}:i.rowMinSizes||{},n="column"===t?"columnMinSize":"rowMinSize";return new m(t,Object.assign({},{minSizeStart:w(h,s.track-1,l(i,n,l(i,"minSize",0))),minSizeEnd:w(h,s.track+1,l(i,n,l(i,"minSize",0)))},s),i)}},p=function(t){var i=this;this.columnGutters={},this.rowGutters={},this.options=Object.assign({},{columnGutters:t.columnGutters||[],rowGutters:t.rowGutters||[],columnMinSizes:t.columnMinSizes||{},rowMinSizes:t.rowMinSizes||{}},t),this.options.columnGutters.forEach((function(t){i.columnGutters[t.track]=v("column",i.options)(t)})),this.options.rowGutters.forEach((function(t){i.rowGutters[t.track]=v("row",i.options)(t)}))};p.prototype.addColumnGutter=function(t,i){this.columnGutters[i]&&this.columnGutters[i].destroy(),this.columnGutters[i]=v("column",this.options)({element:t,track:i})},p.prototype.addRowGutter=function(t,i){this.rowGutters[i]&&this.rowGutters[i].destroy(),this.rowGutters[i]=v("row",this.options)({element:t,track:i})},p.prototype.removeColumnGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.columnGutters[t]&&this.columnGutters[t].destroy(i,(function(){delete s.columnGutters[t]}))},p.prototype.removeRowGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.rowGutters[t]&&this.rowGutters[t].destroy(i,(function(){delete s.rowGutters[t]}))},p.prototype.handleDragStart=function(t,i,s){"column"===i?(this.columnGutters[s]&&this.columnGutters[s].destroy(),this.columnGutters[s]=v("column",this.options)({track:s}),this.columnGutters[s].startDragging(t)):"row"===i&&(this.rowGutters[s]&&this.rowGutters[s].destroy(),this.rowGutters[s]=v("row",this.options)({track:s}),this.rowGutters[s].startDragging(t))},p.prototype.destroy=function(t){var i=this;void 0===t&&(t=!0),Object.keys(this.columnGutters).forEach((function(s){return i.columnGutters[s].destroy(t,(function(){delete i.columnGutters[s]}))})),Object.keys(this.rowGutters).forEach((function(s){return i.rowGutters[s].destroy(t,(function(){delete i.rowGutters[s]}))}))};const g=class{constructor(i){t(this,i),this._items=[],this.direction="column"}componentDidLoad(){this._panelID=n.generateUUID(),this._element.dataset.panelId=this._panelID;let t=Array.from(this._element.children);this._items=t.filter((t=>{var i;return"EZ-SPLIT-ITEM"===(null===(i=t.tagName)||void 0===i?void 0:i.toUpperCase())}));let i=1;this._items.forEach(((t,s)=>{t.dataset.trackNumber=i.toString(),this._items.length>1&&s!=this._items.length-1&&this.addItemGutter(t),i+=2})),this.initSplit()}initSplit(){var t;this._items.length&&(this._element.style["row"==this.direction?"grid-template-rows":"grid-template-columns"]=this.getGridTemplate(),t=this.getGutters(),new p(t))}getGutters(){const t={columnGutters:[],rowGutters:[]};if(!this._items.length)return t;const i="row"==this.direction?"rowGutters":"columnGutters";return this._items.forEach(((s,h)=>{if(h==this._items.length-1)return;let n=s.dataset.trackNumber;h===this._items.length-1&&(n=this._items.length.toString()),t[i].push({track:Number(n),element:this._element.querySelector(`ez-split-panel[data-panel-id="${this._panelID}"] > [data-item-track="${s.dataset.trackNumber}"]`)})})),t}addItemGutter(t){const i=document.createElement("div");i.classList.add("ez-split-gutter"),i.classList.add(this.direction),i.dataset.itemTrack=`${t.dataset.trackNumber}`,i.dataset.trackNumber=(Number(t.dataset.trackNumber)+1).toString(),t.parentNode.insertBefore(i,t.nextSibling)}getElementStyle(){return{display:"grid",height:"100%",width:"100%"}}getGridTemplate(){let t="";return this._items.forEach(((i,s)=>{t+=s!==this._items.length-1?0!==s?" 1fr 5px":"1fr 5px":" 1fr"})),t}render(){return i(s,{style:this.getElementStyle()})}get _element(){return h(this)}};g.style=".ez-split-gutter{cursor:grab;background-color:transparent}";export{g as ez_split_panel}
|
|
1
|
+
import{r as t,h as i,H as s,g as h}from"./p-23a36bb6.js";import{StringUtils as n}from"@sankhyalabs/core";var r=function(t,i){return Number(t.slice(0,-1*i.length))},e=function(t){return t.endsWith("px")?{value:t,type:"px",numeric:r(t,"px")}:t.endsWith("fr")?{value:t,type:"fr",numeric:r(t,"fr")}:t.endsWith("%")?{value:t,type:"%",numeric:r(t,"%")}:"auto"===t?{value:t,type:"auto"}:null},o=function(t){return t.split(" ").map(e)},u=function(t,i,s){return i.concat(s).map((function(i){return i.style[t]})).filter((function(t){return void 0!==t&&""!==t}))},c=function(t){for(var i=0;i<t.length;i++)if(t[i].numeric>0)return i;return null},a=function(){return!1},l=function(t,i,s){t.style[i]=s},f=function(t,i,s){var h=t[i];return void 0!==h?h:s};function m(t){var i;return(i=[]).concat.apply(i,Array.from(t.ownerDocument.styleSheets).map((function(t){var i=[];try{i=Array.from(t.cssRules||[])}catch(t){}return i}))).filter((function(i){var s=!1;try{s=t.matches(i.selectorText)}catch(t){}return s}))}var d=function(t,i,s){this.direction=t,this.element=i.element,this.track=i.track,"column"===t?(this.gridTemplateProp="grid-template-columns",this.gridGapProp="grid-column-gap",this.cursor=f(s,"columnCursor",f(s,"cursor","col-resize")),this.snapOffset=f(s,"columnSnapOffset",f(s,"snapOffset",30)),this.dragInterval=f(s,"columnDragInterval",f(s,"dragInterval",1)),this.clientAxis="clientX",this.optionStyle=f(s,"gridTemplateColumns")):"row"===t&&(this.gridTemplateProp="grid-template-rows",this.gridGapProp="grid-row-gap",this.cursor=f(s,"rowCursor",f(s,"cursor","row-resize")),this.snapOffset=f(s,"rowSnapOffset",f(s,"snapOffset",30)),this.dragInterval=f(s,"rowDragInterval",f(s,"dragInterval",1)),this.clientAxis="clientY",this.optionStyle=f(s,"gridTemplateRows")),this.onDragStart=f(s,"onDragStart",a),this.onDragEnd=f(s,"onDragEnd",a),this.onDrag=f(s,"onDrag",a),this.writeStyle=f(s,"writeStyle",l),this.startDragging=this.startDragging.bind(this),this.stopDragging=this.stopDragging.bind(this),this.drag=this.drag.bind(this),this.minSizeStart=i.minSizeStart,this.minSizeEnd=i.minSizeEnd,i.element&&(this.element.addEventListener("mousedown",this.startDragging),this.element.addEventListener("touchstart",this.startDragging))};d.prototype.getDimensions=function(){var t=this.grid.getBoundingClientRect(),i=t.width,s=t.height,h=t.bottom,n=t.left,r=t.right;"column"===this.direction?(this.start=t.top,this.end=h,this.size=s):"row"===this.direction&&(this.start=n,this.end=r,this.size=i)},d.prototype.getSizeAtTrack=function(t,i){return function(t,i,s,h){return void 0===s&&(s=0),void 0===h&&(h=!1),i.slice(0,h?t+1:t).reduce((function(t,i){return t+i.numeric}),0)+(s?t*s:0)}(t,this.computedPixels,this.computedGapPixels,i)},d.prototype.getSizeOfTrack=function(t){return this.computedPixels[t].numeric},d.prototype.getRawTracks=function(){var t=u(this.gridTemplateProp,[this.grid],m(this.grid));if(!t.length){if(this.optionStyle)return this.optionStyle;throw Error("Unable to determine grid template tracks from styles.")}return t[0]},d.prototype.getGap=function(){var t=u(this.gridGapProp,[this.grid],m(this.grid));return t.length?t[0]:null},d.prototype.getRawComputedTracks=function(){return window.getComputedStyle(this.grid)[this.gridTemplateProp]},d.prototype.getRawComputedGap=function(){return window.getComputedStyle(this.grid)[this.gridGapProp]},d.prototype.setTracks=function(t){this.tracks=t.split(" "),this.trackValues=o(t)},d.prototype.setComputedTracks=function(t){this.computedTracks=t.split(" "),this.computedPixels=o(t)},d.prototype.setGap=function(t){this.gap=t},d.prototype.setComputedGap=function(t){var i;this.computedGap=t,this.computedGapPixels=((i=this.computedGap).endsWith("px")?Number(i.slice(0,-1*"px".length)):null)||0},d.prototype.getMousePosition=function(t){return"touches"in t?t.touches[0][this.clientAxis]:t[this.clientAxis]},d.prototype.startDragging=function(t){if(!("button"in t)||0===t.button){t.preventDefault(),this.grid=this.element?this.element.parentNode:t.target.parentNode,this.getDimensions(),this.setTracks(this.getRawTracks()),this.setComputedTracks(this.getRawComputedTracks()),this.setGap(this.getGap()),this.setComputedGap(this.getRawComputedGap());var i=this.trackValues.filter((function(t){return"%"===t.type})),s=this.trackValues.filter((function(t){return"fr"===t.type}));if(this.totalFrs=s.length,this.totalFrs){var h=c(s);null!==h&&(this.frToPixels=this.computedPixels[h].numeric/s[h].numeric)}if(i.length){var n=c(i);null!==n&&(this.percentageToPixels=this.computedPixels[n].numeric/i[n].numeric)}var r=this.getSizeAtTrack(this.track,!1)+this.start;if(this.dragStartOffset=this.getMousePosition(t)-r,this.aTrack=this.track-1,!(this.track<this.tracks.length-1))throw Error("Invalid track index: "+this.track+". Track must be between two other tracks and only "+this.tracks.length+" tracks were found.");this.bTrack=this.track+1,this.aTrackStart=this.getSizeAtTrack(this.aTrack,!1)+this.start,this.bTrackEnd=this.getSizeAtTrack(this.bTrack,!0)+this.start,this.dragging=!0,window.addEventListener("mouseup",this.stopDragging),window.addEventListener("touchend",this.stopDragging),window.addEventListener("touchcancel",this.stopDragging),window.addEventListener("mousemove",this.drag),window.addEventListener("touchmove",this.drag),this.grid.addEventListener("selectstart",a),this.grid.addEventListener("dragstart",a),this.grid.style.userSelect="none",this.grid.style.webkitUserSelect="none",this.grid.style.MozUserSelect="none",this.grid.style.pointerEvents="none",this.grid.style.cursor=this.cursor,window.document.body.style.cursor=this.cursor,this.onDragStart(this.direction,this.track)}},d.prototype.stopDragging=function(){this.dragging=!1,this.cleanup(),this.onDragEnd(this.direction,this.track),this.needsDestroy&&(this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),this.destroyCb(),this.needsDestroy=!1,this.destroyCb=null)},d.prototype.drag=function(t){var i=this.getMousePosition(t),s=this.getSizeOfTrack(this.track),h=this.aTrackStart+this.minSizeStart+this.dragStartOffset+this.computedGapPixels,n=this.bTrackEnd-this.minSizeEnd-this.computedGapPixels-(s-this.dragStartOffset);i<h+this.snapOffset&&(i=h),i>n-this.snapOffset&&(i=n),i<h?i=h:i>n&&(i=n);var r=i-this.aTrackStart-this.dragStartOffset-this.computedGapPixels,e=this.bTrackEnd-i+this.dragStartOffset-s-this.computedGapPixels;if(this.dragInterval>1){var o=Math.round(r/this.dragInterval)*this.dragInterval;e-=o-r,r=o}r<this.minSizeStart&&(r=this.minSizeStart),e<this.minSizeEnd&&(e=this.minSizeEnd),"px"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=r+"px":"fr"===this.trackValues[this.aTrack].type?this.tracks[this.aTrack]=1===this.totalFrs?"1fr":r/this.frToPixels+"fr":"%"===this.trackValues[this.aTrack].type&&(this.tracks[this.aTrack]=r/this.percentageToPixels+"%"),"px"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=e+"px":"fr"===this.trackValues[this.bTrack].type?this.tracks[this.bTrack]=1===this.totalFrs?"1fr":e/this.frToPixels+"fr":"%"===this.trackValues[this.bTrack].type&&(this.tracks[this.bTrack]=e/this.percentageToPixels+"%");var u=this.tracks.join(" ");this.writeStyle(this.grid,this.gridTemplateProp,u),this.onDrag(this.direction,this.track,u)},d.prototype.cleanup=function(){window.removeEventListener("mouseup",this.stopDragging),window.removeEventListener("touchend",this.stopDragging),window.removeEventListener("touchcancel",this.stopDragging),window.removeEventListener("mousemove",this.drag),window.removeEventListener("touchmove",this.drag),this.grid&&(this.grid.removeEventListener("selectstart",a),this.grid.removeEventListener("dragstart",a),this.grid.style.userSelect="",this.grid.style.webkitUserSelect="",this.grid.style.MozUserSelect="",this.grid.style.pointerEvents="",this.grid.style.cursor=""),window.document.body.style.cursor=""},d.prototype.destroy=function(t,i){void 0===t&&(t=!0),t||!1===this.dragging?(this.cleanup(),this.element&&(this.element.removeEventListener("mousedown",this.startDragging),this.element.removeEventListener("touchstart",this.startDragging)),i&&i()):(this.needsDestroy=!0,i&&(this.destroyCb=i))};var w=function(t,i,s){return i in t?t[i]:s},v=function(t,i){return function(s){if(s.track<1)throw Error("Invalid track index: "+s.track+". Track must be between two other tracks.");var h="column"===t?i.columnMinSizes||{}:i.rowMinSizes||{},n="column"===t?"columnMinSize":"rowMinSize";return new d(t,Object.assign({},{minSizeStart:w(h,s.track-1,f(i,n,f(i,"minSize",0))),minSizeEnd:w(h,s.track+1,f(i,n,f(i,"minSize",0)))},s),i)}},p=function(t){var i=this;this.columnGutters={},this.rowGutters={},this.options=Object.assign({},{columnGutters:t.columnGutters||[],rowGutters:t.rowGutters||[],columnMinSizes:t.columnMinSizes||{},rowMinSizes:t.rowMinSizes||{}},t),this.options.columnGutters.forEach((function(t){i.columnGutters[t.track]=v("column",i.options)(t)})),this.options.rowGutters.forEach((function(t){i.rowGutters[t.track]=v("row",i.options)(t)}))};p.prototype.addColumnGutter=function(t,i){this.columnGutters[i]&&this.columnGutters[i].destroy(),this.columnGutters[i]=v("column",this.options)({element:t,track:i})},p.prototype.addRowGutter=function(t,i){this.rowGutters[i]&&this.rowGutters[i].destroy(),this.rowGutters[i]=v("row",this.options)({element:t,track:i})},p.prototype.removeColumnGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.columnGutters[t]&&this.columnGutters[t].destroy(i,(function(){delete s.columnGutters[t]}))},p.prototype.removeRowGutter=function(t,i){var s=this;void 0===i&&(i=!0),this.rowGutters[t]&&this.rowGutters[t].destroy(i,(function(){delete s.rowGutters[t]}))},p.prototype.handleDragStart=function(t,i,s){"column"===i?(this.columnGutters[s]&&this.columnGutters[s].destroy(),this.columnGutters[s]=v("column",this.options)({track:s}),this.columnGutters[s].startDragging(t)):"row"===i&&(this.rowGutters[s]&&this.rowGutters[s].destroy(),this.rowGutters[s]=v("row",this.options)({track:s}),this.rowGutters[s].startDragging(t))},p.prototype.destroy=function(t){var i=this;void 0===t&&(t=!0),Object.keys(this.columnGutters).forEach((function(s){return i.columnGutters[s].destroy(t,(function(){delete i.columnGutters[s]}))})),Object.keys(this.rowGutters).forEach((function(s){return i.rowGutters[s].destroy(t,(function(){delete i.rowGutters[s]}))}))};const g=class{constructor(i){t(this,i),this._items=[],this.direction="column",this.label=void 0}componentDidLoad(){this._panelID=n.generateUUID(),this._element.dataset.panelId=this._panelID;let t=Array.from(this._element.children);this._items=t.filter((t=>{var i;return"EZ-SPLIT-ITEM"===(null===(i=t.tagName)||void 0===i?void 0:i.toUpperCase())}));let i=1;this._items.forEach(((t,s)=>{t.dataset.trackNumber=i.toString(),this._items.length>1&&s!=this._items.length-1&&this.addItemGutter(t),i+=2})),this.initSplit()}initSplit(){var t;this._items.length&&(this._element.style["row"==this.direction?"grid-template-rows":"grid-template-columns"]=this.getGridTemplate(),t=this.getGutters(),new p(t))}getGutters(){const t={columnGutters:[],rowGutters:[]};if(!this._items.length)return t;const i="row"==this.direction?"rowGutters":"columnGutters";return this._items.forEach(((s,h)=>{if(h==this._items.length-1)return;let n=s.dataset.trackNumber;h===this._items.length-1&&(n=this._items.length.toString()),t[i].push({track:Number(n),element:this._element.querySelector(`ez-split-panel[data-panel-id="${this._panelID}"] > [data-item-track="${s.dataset.trackNumber}"]`)})})),t}addItemGutter(t){const i=document.createElement("div");i.classList.add("ez-split-gutter"),i.classList.add(this.direction),i.dataset.itemTrack=`${t.dataset.trackNumber}`,i.dataset.trackNumber=(Number(t.dataset.trackNumber)+1).toString(),t.parentNode.insertBefore(i,t.nextSibling)}getElementStyle(){return{display:"grid",height:"100%",width:"100%"}}getGridTemplate(){let t="";return this._items.forEach(((i,s)=>{t+=s!==this._items.length-1?0!==s?" 1fr 5px":"1fr 5px":" 1fr"})),t}render(){return i(s,{style:this.getElementStyle()},i("div",{class:"ez-split-panel--header ez-margin-top--small ez-margin-bottom--small"},i("div",{class:"ez-margin-left--small"},this.label),i("div",{class:"ez-margin-right--small"},i("slot",{name:"rightButtons"}))),i("slot",null))}get _element(){return h(this)}};g.style=".ez-split-gutter{cursor:grab;background-color:transparent}.ez-split-panel--header{display:flex;align-items:center;justify-content:space-between;height:30px}";export{g as ez_split_panel}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as i,g as n}from"./p-23a36bb6.js";import{FloatingManager as a,ElementIDUtils as o}from"@sankhyalabs/core";const r=class{constructor(e){t(this,e),this.alerts=[],this.enableDragAndDrop=void 0,this.enableExpand=!0,this.itemRightSlotBuilder=void 0,this.opened=!0,this.expanded=!1}observeOpened(){this.manageOverlay()}alertId(t,e){return`alert-${e}-${(t=>{var e;return null!==(e=null==t?void 0:t.split(" ").join("-"))&&void 0!==e?e:""})(t)}`}getAlertTitle(t){var e;return null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t)))||void 0===e?void 0:e.title}getTitleText(t){var e;const i=null!==(e=this.getAlertTitle(t.id))&&void 0!==e?e:"";return`${i}${i&&t.label?":":""}`}toggleExpandContainer(){this.enableExpand&&(this.expanded=!this.expanded,this._container.classList.toggle("expanded",this.expanded),this.expanded?this.updatePosition(this.getBoundingRight(),this.getBoundingBottom()):this.updatePosition("10px","10px"))}manageOverlay(){if(this.opened&&this._container)this._overlayId=a.float(this._container,this._overlayRef,this.getFloatOptions());else{if(void 0===this._overlayId)return;a.close(this._overlayId),this._overlayId=void 0}}updatePosition(t,e){this.opened&&a.updateFloatPosition(this._container,this._overlayRef,Object.assign(Object.assign({},this.getFloatOptions()),{right:t,bottom:e}))}getFloatOptions(){return{autoClose:!1,isFixed:!0,bottom:"10px",right:"10px"}}getBoundingRight(){return(document.body.clientWidth-this._container.getBoundingClientRect().width)/2+"px"}getBoundingBottom(){return(document.body.clientHeight-this._container.getBoundingClientRect().height)/2+"px"}componentDidLoad(){this.manageOverlay(),this.opened&&this._container&&this._container.focus()}componentWillLoad(){this.dataElementId=o.addIDInfo(this._element,"EzAlertList")}render(){return e(i,Object.assign({},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:this.dataElementId}),this.opened?e("div",{ref:t=>this._overlayRef=t},e("div",{class:"alert-list__container "+(this.expanded?"expanded":""),ref:t=>this._container=t},e("div",{class:"alert-list__content"},e("div",{class:"alert-list__header"},e("div",{class:"alert-list__title"},`Avisos (${this.alerts.length})`),e("div",{class:"alert-list__header__buttons"},this.enableExpand&&e("ez-button",{mode:"icon",size:"small",iconName:"expand",onClick:()=>this.toggleExpandContainer(),"data-element-id":o.getInternalIDInfo("expandButton"),title:this.expanded?"Resumir":"Expandir"}),e("ez-button",{mode:"icon",size:"small",iconName:"close","data-element-id":o.getInternalIDInfo("closeButton"),onClick:()=>{this.opened=!1},title:"Fechar"}))),e("div",{class:"alert-list__expandable-content"},e("ez-list",{itemSlotBuilder:this.itemRightSlotBuilder,hoverFeedback:!0,itemLeftSlotBuilder:t=>e("a",{href:"#",style:{fontFamily:"var(--font-pattern, 'Roboto')",fontSize:"var(--text--medium, 14px)",fontWeight:"var(--text-weight--medium, 400)",color:"var(--color--primary, #008561)",marginRight:"4px",cursor:"pointer",display:"flex",width:"max-content",textDecoration:"none"}},this.getTitleText(t)),dataSource:this.alerts.map(((t,e)=>{var i;return{id:this.alertId(t.title,e),label:null!==(i=t.detail)&&void 0!==i?i:""}}))}))))):null)}get _element(){return n(this)}static get watchers(){return{opened:["observeOpened"]}}};r.style=':host {\n display: flex;\n\n /* Alert List */\n \n /*@doc Define a largura da lista minimizado */\n --ez-alert-list__container--width: 680px;\n /*@doc Define a altura da lista minimizado */\n --ez-alert-list__container--height: 220px;\n \n /*@doc Define a largura da lista maximizada */\n --ez-alert-list__container--width--expanded: 920px;\n /*@doc Define a altura da lista maximizada */\n --ez-alert-list__container--height--expanded: 540px;\n\n /* Title */\n /*@doc Define a fonte do título do componente */\n --ez-alert-list__title--font-family: var(--font-pattern, "Roboto");\n /*@doc Define o tamanho da fonte do título do popup.*/\n --ez-alert-list__title--font-size: var(--title--large, 20px);\n /*@doc Define a cor da fonte do título do popup.*/\n --ez-alert-list__title--color: var(--title--primary, #2b3a54);\n /*@doc Define o peso da fonte do título do popup.*/\n --ez-alert-list__title--font-weight: var(--text-weight--extra-large, 700);\n\n /* @doc Define a borda inferior do item da lista. */\n --ez-list__item--border-bottom: var(--border--small, 1px solid);\n\n /* @doc Define a cor da borda inferior do item da lista. */\n --ez-list__item--border-bottom-color: var(--color--strokes, #DCE0E8);\n\n /* @doc Define o tipo da quebra de linha do item da lista. */\n --ez-list__item--white-space: break-space;\n}\n\n.alert-list__content {\n display: flex;\n flex-direction: column;\n \n gap: var(--space--xs);\n margin: var(--space--large, 24px);\n width: 100%;\n}\n\n.alert-list__container {\n z-index: var(--more-visible--2x, 3);\n display: flex;\n height: var(--ez-alert-list__container--height);\n width: var(--ez-alert-list__container--width);\n border-radius: var(--border--radius-medium);\n background-color: var(--background--xlight);\n box-shadow: var(--shadow--medium);\n\n &.expanded {\n height: var(--ez-alert-list__container--height--expanded);\n width: var(--ez-alert-list__container--width--expanded);\n }\n\n @media (max-height: 640px) {\n max-height: calc(100vh - var(--space--3xl));\n } \n}\n\n.alert-list__header {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.alert-list__title {\n font-family: var(--ez-alert-list__title--font-family);\n font-size: var(--ez-alert-list__title--font-size);\n font-weight: var(--ez-alert-list__title--font-weight);\n color: var(--ez-alert-list__title--color);\n}\n\n.alert-list__header__buttons {\n display: flex;\n gap: var(--space--xs);\n}\n\n.alert-list__expandable-content {\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n';export{r as ez_alert_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i,H as n,g as a}from"./p-23a36bb6.js";import{StringUtils as o,ElementIDUtils as r}from"@sankhyalabs/core";import{C as s}from"./p-7eb3e1a5.js";const l=class{constructor(i){e(this,i),this.ezClick=t(this,"ezClick",7),this.item=void 0}componentWillRender(){this.createDetailList()}componentDidLoad(){var e,t;const i={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)||"")};r.addIDInfo(this._element,null,i)}createDetailList(){var e,t,i;this._details={detailsLeft:[],detailsRight:[]};let n=0;if(null===(e=this.item)||void 0===e?void 0:e.details)for(const e in this.item.details)n<3?this._details.detailsLeft.push({label:e,value:null===(t=this.item.details[e])||void 0===t?void 0:t.toString()}):this._details.detailsRight.push({label:e,value:null===(i=this.item.details[e])||void 0===i?void 0:i.toString()}),n++}buildDetailContent(e){return i("div",{class:"card-item__detail"},i("label",{class:"card-item__detail-label"},e.label),": ",i("label",{class:"card-item__detail-value",innerHTML:e.value}))}render(){return i(n,null,this.item&&i("div",{class:"card-item",onClick:()=>{this.ezClick.emit(this.item)}},i("label",{class:"card-item__title"},i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:"card-item__details"},i("div",{class:"card-item__details-left"},this._details.detailsLeft.map((e=>this.buildDetailContent(e)))),i("div",{class:"card-item__details-right"},this._details.detailsRight.map((e=>this.buildDetailContent(e)))))))}get _element(){return a(this)}};l.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 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(--title--primary, #2B3A54);\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 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 padding: 12px;\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: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 cursor: pointer;\n justify-content: space-between;\n gap: var(--space--small, 6px);\n}\n\n.card-item__details-left {\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-right {\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail:not(:last-child) {\n cursor: pointer;\n white-space: pre-line;\n\n /*public*/\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--font-weight);\n color: var(--ez-card-item__detail-label--color);\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 color: var(--ez-card-item--color);\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@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-left {\n width: 100%;\n }\n \n .card-item__details-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 d=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.ezSearching=t(this,"ezSearching",7),this.ezFocusIn=t(this,"ezFocusIn",7),this._searchingText="",this.handleFocus=()=>{this._textInput.value=""===this._searchingText?"":this._searchingText,this.ezFocusIn.emit()},this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.restrict=void 0,this.mode="regular",this.asyncSearch=!1,this.canShowError=!0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(e,t){this._textInput&&e!=t&&(this._textInput.value=e,this.ezChange.emit(e))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async setValue(e){this.asyncSearch&&null!=this._textInput&&(e!==this.value?(this.value=e,this._searchingText=""):this._textInput.value=e)}async endSearch(){this.asyncSearch&&null!=this._textInput&&this._textInput.value!==this.value&&(this._textInput.value=this.value)}handleChange(e){const t=e.detail;this.errorMessage="",this.asyncSearch?(this._searchingText=t,this.ezSearching.emit(t)):t!==this.value&&(this.value=t)}componentDidLoad(){s.applyVarsTextInput(this._elem,this._textInput)}render(){return r.addIDInfoIfNotExists(this._elem,"input"),i("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),ref:e=>this._textInput=e,label:this.label,onEzChange:e=>this.handleChange(e),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode,onFocusin:this.handleFocus,canShowError:this.canShowError},i("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};d.style=":host{display:block;width:100%}";const c=class{constructor(t){e(this,t),this.message=void 0}render(){return i("div",{class:"multi-selection__message"},i("span",{class:"multi-selection__text-message"},this.message))}};c.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{l as ez_card_item,d as ez_filter_input,c as multi_selection_box_message}
|
|
@@ -1246,6 +1246,10 @@ export namespace Components {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
interface EzSplitPanel {
|
|
1248
1248
|
"direction": 'row' | 'column';
|
|
1249
|
+
/**
|
|
1250
|
+
* Define um título para o painel.
|
|
1251
|
+
*/
|
|
1252
|
+
"label": string;
|
|
1249
1253
|
}
|
|
1250
1254
|
interface EzTabselector {
|
|
1251
1255
|
/**
|
|
@@ -3243,6 +3247,10 @@ declare namespace LocalJSX {
|
|
|
3243
3247
|
}
|
|
3244
3248
|
interface EzSplitPanel {
|
|
3245
3249
|
"direction"?: 'row' | 'column';
|
|
3250
|
+
/**
|
|
3251
|
+
* Define um título para o painel.
|
|
3252
|
+
*/
|
|
3253
|
+
"label"?: string;
|
|
3246
3254
|
}
|
|
3247
3255
|
interface EzTabselector {
|
|
3248
3256
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/ezui",
|
|
3
|
-
"version": "5.20.0-dev.
|
|
3
|
+
"version": "5.20.0-dev.5",
|
|
4
4
|
"description": "Biblioteca de componentes Sankhya.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/custom-elements/index.js",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"build.prod": "stencil build --docs --prod",
|
|
22
22
|
"build.with.peerdeps": "stencil build --docs --prod --force-peer-deps",
|
|
23
23
|
"start": "stencil build --dev --watch --serve --force-peer-deps",
|
|
24
|
-
"test": "stencil test --spec --e2e --logHeapUsage --runInBand",
|
|
25
|
-
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
24
|
+
"test": "stencil test --spec --e2e --logHeapUsage --runInBand --coverage --silent --testResultsProcessor jest-sonar-reporter",
|
|
26
25
|
"generate": "stencil generate",
|
|
27
26
|
"storybook": "npm run start.storybook",
|
|
28
27
|
"build.watch": "stencil build --dev --watch --force-peer-deps",
|
|
@@ -31,7 +30,8 @@
|
|
|
31
30
|
"link": "node scripts/link.js",
|
|
32
31
|
"dev": "run-p storybook build.watch gulp",
|
|
33
32
|
"link-dev": "gulp watch-dev",
|
|
34
|
-
"prepare": "husky install"
|
|
33
|
+
"prepare": "husky install",
|
|
34
|
+
"update-ds": "npm i -D @sankhyalabs/core@latest @sankhyalabs/docscss@latest @sankhyalabs/ez-design@latest @sankhyalabs/skippeerdeps@latest"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
|
@@ -49,11 +49,10 @@
|
|
|
49
49
|
"@babel/preset-env": "^7.16.11",
|
|
50
50
|
"@commitlint/cli": "^18.4.3",
|
|
51
51
|
"@commitlint/config-conventional": "^18.4.3",
|
|
52
|
-
"@sankhyalabs/core": "^5.
|
|
52
|
+
"@sankhyalabs/core": "^5.15.1",
|
|
53
53
|
"@sankhyalabs/docscss": "^1.0.4",
|
|
54
|
-
"@sankhyalabs/ez-design": "^
|
|
54
|
+
"@sankhyalabs/ez-design": "^5.7.6",
|
|
55
55
|
"@sankhyalabs/skippeerdeps": "^1.0.2",
|
|
56
|
-
"split-grid": "^1.0.11",
|
|
57
56
|
"@shopify/draggable": "^1.0.0-beta.8",
|
|
58
57
|
"@stencil/core": "^2.13.0",
|
|
59
58
|
"@stencil/react-output-target": "0.0.9",
|
|
@@ -72,18 +71,27 @@
|
|
|
72
71
|
"husky": "^8.0.3",
|
|
73
72
|
"jest": "^26.6.3",
|
|
74
73
|
"jest-cli": "^26.6.3",
|
|
74
|
+
"jest-sonar-reporter": "^2.0.0",
|
|
75
75
|
"npm-run-all": "^4.1.5",
|
|
76
76
|
"puppeteer": "^5.5.0",
|
|
77
77
|
"redux": "^4.1.2",
|
|
78
78
|
"redux-thunk": "^2.4.1",
|
|
79
79
|
"redux-undo": "^1.0.1",
|
|
80
80
|
"run-p": "0.0.0",
|
|
81
|
+
"split-grid": "^1.0.11",
|
|
81
82
|
"storybook-addon-preview": "^2.2.0",
|
|
82
83
|
"uuid": "^9.0.0",
|
|
83
84
|
"ws": "^7.5.6"
|
|
84
85
|
},
|
|
85
86
|
"jest": {
|
|
86
|
-
"verbose": true
|
|
87
|
+
"verbose": true,
|
|
88
|
+
"testResultsProcessor": "jest-sonar-reporter"
|
|
89
|
+
},
|
|
90
|
+
"jestSonar": {
|
|
91
|
+
"sonar56x": true,
|
|
92
|
+
"reportPath": "reports",
|
|
93
|
+
"reportFile": "test-report.xml",
|
|
94
|
+
"indent": 4
|
|
87
95
|
},
|
|
88
96
|
"peerDependencies": {
|
|
89
97
|
"@sankhyalabs/core": "^5.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as n,g as a}from"./p-23a36bb6.js";import{StringUtils as o,ElementIDUtils as r}from"@sankhyalabs/core";import{C as s}from"./p-7eb3e1a5.js";const l=class{constructor(i){e(this,i),this.ezClick=t(this,"ezClick",7),this.item=void 0}componentWillRender(){this.createDetailList()}componentDidLoad(){var e,t;const i={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)||"")};r.addIDInfo(this._element,null,i)}createDetailList(){var e,t,i;this._details={detailsLeft:[],detailsRight:[]};let n=0;if(null===(e=this.item)||void 0===e?void 0:e.details)for(const e in this.item.details)n<3?this._details.detailsLeft.push({label:e,value:null===(t=this.item.details[e])||void 0===t?void 0:t.toString()}):this._details.detailsRight.push({label:e,value:null===(i=this.item.details[e])||void 0===i?void 0:i.toString()}),n++}buildDetailContent(e){return i("div",{class:"card-item__detail"},i("label",{class:"card-item__detail-label"},e.label),": ",i("label",{class:"card-item__detail-value",innerHTML:e.value}))}render(){return i(n,null,this.item&&i("div",{class:"card-item",onClick:()=>{this.ezClick.emit(this.item)}},i("label",{class:"card-item__title"},i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:"card-item__details"},i("div",{class:"card-item__details-left"},this._details.detailsLeft.map((e=>this.buildDetailContent(e)))),i("div",{class:"card-item__details-right"},this._details.detailsRight.map((e=>this.buildDetailContent(e)))))))}get _element(){return a(this)}};l.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 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(--title--primary, #2B3A54);\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 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 padding: 12px;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\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 cursor: pointer;\n justify-content: space-between;\n gap: var(--space--small, 6px);\n}\n\n.card-item__details-left {\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-right {\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail:not(:last-child) {\n cursor: pointer;\n\n /*public*/\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--font-weight);\n color: var(--ez-card-item__detail-label--color);\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 color: var(--ez-card-item--color);\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@container box (max-width: 500px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-left {\n width: 100%;\n }\n \n .card-item__details-right {\n width: 100%;\n }\n}";const d=class{constructor(i){e(this,i),this.ezChange=t(this,"ezChange",7),this.ezSearching=t(this,"ezSearching",7),this.ezFocusIn=t(this,"ezFocusIn",7),this._searchingText="",this.handleFocus=()=>{this._textInput.value=""===this._searchingText?"":this._searchingText,this.ezFocusIn.emit()},this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.restrict=void 0,this.mode="regular",this.asyncSearch=!1,this.canShowError=!0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(e,t){this._textInput&&e!=t&&(this._textInput.value=e,this.ezChange.emit(e))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async setValue(e){this.asyncSearch&&null!=this._textInput&&(e!==this.value?(this.value=e,this._searchingText=""):this._textInput.value=e)}async endSearch(){this.asyncSearch&&null!=this._textInput&&this._textInput.value!==this.value&&(this._textInput.value=this.value)}handleChange(e){const t=e.detail;this.errorMessage="",this.asyncSearch?(this._searchingText=t,this.ezSearching.emit(t)):t!==this.value&&(this.value=t)}componentDidLoad(){s.applyVarsTextInput(this._elem,this._textInput)}render(){return r.addIDInfoIfNotExists(this._elem,"input"),i("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),ref:e=>this._textInput=e,label:this.label,onEzChange:e=>this.handleChange(e),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode,onFocusin:this.handleFocus,canShowError:this.canShowError},i("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};d.style=":host{display:block;width:100%}";const c=class{constructor(t){e(this,t),this.message=void 0}render(){return i("div",{class:"multi-selection__message"},i("span",{class:"multi-selection__text-message"},this.message))}};c.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{l as ez_card_item,d as ez_filter_input,c as multi_selection_box_message}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as a,c as t,H as l,g as o}from"./p-23a36bb6.js";import{ObjectUtils as n,UserInterface as r,ElementIDUtils as s}from"@sankhyalabs/core";import{R as d}from"./p-05e1f4e7.js";import{C as i}from"./p-b853763b.js";function c(a,t,l,o,n){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},e("ez-check",{enabled:!l,label:t,mode:n?i.SWITCH:i.REGULAR,"data-field-name":a,"data-context-name":o,key:a}))}function m(a,t,l,o,n,r,s){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!l,label:t,precision:o,prettyPrecision:n,"data-field-name":a,"data-context-name":r,key:a,canShowError:s}))}const z=({name:a,label:t,readOnly:l,contextName:o,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:t,"data-field-name":a,"data-context-name":o,key:a,enabled:!l,canShowError:n})),h=new Map;h.set(r.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),h.set(r.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),h.set(r.OPTIONSELECTOR,(({name:a,label:t,readOnly:l,required:o,props:n,contextName:r,canShowError:s})=>{const d=null==n?void 0:n.options;let i;if("string"==typeof d){const e=JSON.parse(d);i=Object.keys(e).map((a=>({value:a,label:e[a]})))}else i=d;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!l,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":r,key:a,options:i,canShowError:s}))})),h.set(r.DATE,(({name:a,label:t,readOnly:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:o})))),h.set(r.TIME,(({name:a,label:t,readOnly:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:o})))),h.set(r.DATETIME,(({name:a,label:t,readOnly:l,contextName:o,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!l,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:n})))),h.set(r.FILE,(({name:a,label:t,readOnly:l,contextName:o,props:r})=>{const s=n.removeEmptyValues({subTitle:r.subTitle,requestHeaders:r.STORAGESTRATEGY?{STORAGESTRATEGY:r.STORAGESTRATEGY}:null});return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",Object.assign({enabled:!l,label:t,"data-field-name":a,"data-context-name":o,key:a},s)))})),h.set(r.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:l,contextName:o,canShowError:n})=>{const r=Number((null==l?void 0:l.precision)||2);return m(e,a,t,r,Number((null==l?void 0:l.prettyPrecision)||r),o,n)})),h.set(r.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:l,canShowError:o})=>m(e,a,t,0,0,l,o))),h.set(r.SEARCH,(({name:a,label:t,readOnly:l,required:o,contextName:n,canShowError:r,optionLoader:s})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!l,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":n,key:a,canShowError:r,optionLoader:s})))),h.set(r.LONGTEXT,(({name:a,label:t,readOnly:l,contextName:o,rows:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:a},e("ez-text-area",{enabled:!l,label:t,"data-field-name":a,"data-context-name":o,rows:n,canShowError:r}))));const b=e=>{const a=h.get(e.userInterface)||z,t=e.required?`${e.label}${d}`:e.label,l=a(Object.assign(Object.assign({},e),{label:t}));return l.t["data-form-item"]=e.name,l};class p{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class u{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new p(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const y=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this.fields=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let l=a.get(t);null==l&&(l=[],a.set(t,l)),l.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));const e=new u(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null!=this.fields)return e(l,null,Array.from(this.groupFields(this.fields).entries()).map((([a,t])=>Array.isArray(t)?e("ez-collapsible-box",{id:`group-${a}`,label:a,"header-size":"large",key:a},t.map((e=>b(e)))):b(t))))}get _element(){return o(this)}};y.style=".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";export{y as ez_form_view}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as n}from"./p-23a36bb6.js";import{FloatingManager as a,ElementIDUtils as o}from"@sankhyalabs/core";const r=class{constructor(e){t(this,e),this.alerts=[],this.enableDragAndDrop=void 0,this.enableExpand=!0,this.itemRightSlotBuilder=void 0,this.opened=!0,this.expanded=!1}observeOpened(){this.manageOverlay()}alertId(t,e){return`alert-${e}-${(t=>{var e;return null!==(e=null==t?void 0:t.split(" ").join("-"))&&void 0!==e?e:""})(t)}`}getAlertTitle(t){var e;return null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t)))||void 0===e?void 0:e.title}getTitleText(t){var e;const i=null!==(e=this.getAlertTitle(t.id))&&void 0!==e?e:"";return`${i}${i&&t.label?":":""}`}toggleExpandContainer(){this.enableExpand&&(this.expanded=!this.expanded,this._container.classList.toggle("expanded",this.expanded),this.expanded?this.updatePosition(this.getBoundingRight(),this.getBoundingBottom()):this.updatePosition("10px","10px"))}async manageOverlay(){this.opened?this._overlayId=a.float(this._container,this._overlayRef,this.getFloatOptions()):(a.close(this._overlayId),this._overlayId=void 0)}updatePosition(t,e){a.updateFloatPosition(this._container,this._overlayRef,Object.assign(Object.assign({},this.getFloatOptions()),{right:t,bottom:e}))}getFloatOptions(){return{autoClose:!1,isFixed:!1,bottom:"10px",right:"10px"}}getBoundingRight(){return(document.body.clientWidth-this._container.getBoundingClientRect().width)/2+"px"}getBoundingBottom(){return(document.body.clientHeight-this._container.getBoundingClientRect().height)/2+"px"}componentDidRender(){this.manageOverlay(),this.opened&&this._container.focus()}componentWillLoad(){this.dataElementId=o.addIDInfo(this._element,"EzAlertList")}render(){return e(i,Object.assign({},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:this.dataElementId}),e("div",{ref:t=>this._overlayRef=t},e("div",{class:"alert-list__container "+(this.expanded?"expanded":""),ref:t=>this._container=t},e("div",{class:"alert-list__content"},e("div",{class:"alert-list__header"},e("div",{class:"alert-list__title"},`Avisos (${this.alerts.length})`),e("div",{class:"alert-list__header__buttons"},this.enableExpand&&e("ez-button",{mode:"icon",size:"small",iconName:"expand",onClick:()=>this.toggleExpandContainer(),"data-element-id":o.getInternalIDInfo("expandButton"),title:this.expanded?"Resumir":"Expandir"}),e("ez-button",{mode:"icon",size:"small",iconName:"close","data-element-id":o.getInternalIDInfo("closeButton"),onClick:()=>{this.opened=!1},title:"Fechar"}))),e("div",{class:"alert-list__expandable-content"},e("ez-list",{hoverFeedback:!0,itemLeftSlotBuilder:t=>e("a",{href:"#",style:{fontFamily:"var(--font-pattern, 'Roboto')",fontSize:"var(--text--medium, 14px)",fontWeight:"var(--text-weight--medium, 400)",color:"var(--color--primary, #008561)",marginRight:"4px",cursor:"pointer",display:"flex",width:"max-content",textDecoration:"none"}},this.getTitleText(t)),dataSource:this.alerts.map(((t,e)=>{var i;return{id:this.alertId(t.title,e),label:null!==(i=t.detail)&&void 0!==i?i:""}}))}))))))}get _element(){return n(this)}static get watchers(){return{opened:["observeOpened"]}}};r.style=':host {\n display: flex;\n\n /* Alert List */\n \n /*@doc Define a largura da lista minimizado */\n --ez-alert-list__container--width: 680px;\n /*@doc Define a altura da lista minimizado */\n --ez-alert-list__container--height: 220px;\n \n /*@doc Define a largura da lista maximizada */\n --ez-alert-list__container--width--expanded: 920px;\n /*@doc Define a altura da lista maximizada */\n --ez-alert-list__container--height--expanded: 540px;\n\n /* Title */\n /*@doc Define a fonte do título do componente */\n --ez-alert-list__title--font-family: var(--font-pattern, "Roboto");\n /*@doc Define o tamanho da fonte do título do popup.*/\n --ez-alert-list__title--font-size: var(--title--large, 20px);\n /*@doc Define a cor da fonte do título do popup.*/\n --ez-alert-list__title--color: var(--title--primary, #2b3a54);\n /*@doc Define o peso da fonte do título do popup.*/\n --ez-alert-list__title--font-weight: var(--text-weight--extra-large, 700);\n\n /* @doc Define a borda inferior do item da lista. */\n --ez-list__item--border-bottom: var(--border--small, 1px solid);\n\n /* @doc Define a cor da borda inferior do item da lista. */\n --ez-list__item--border-bottom-color: var(--color--strokes, #DCE0E8);\n\n /* @doc Define o tipo da quebra de linha do item da lista. */\n --ez-list__item--white-space: break-space;\n}\n\n.alert-list__content {\n display: flex;\n flex-direction: column;\n \n gap: var(--space--xs);\n margin: var(--space--large, 24px);\n width: 100%;\n}\n\n.alert-list__container {\n z-index: var(--more-visible--2x, 3);\n display: flex;\n height: var(--ez-alert-list__container--height);\n width: var(--ez-alert-list__container--width);\n border-radius: var(--border--radius-medium);\n background-color: var(--background--xlight);\n box-shadow: var(--shadow--medium);\n\n &.expanded {\n height: var(--ez-alert-list__container--height--expanded);\n width: var(--ez-alert-list__container--width--expanded);\n }\n\n @media (max-height: 640px) {\n max-height: calc(100vh - var(--space--3xl));\n } \n}\n\n.alert-list__header {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.alert-list__title {\n font-family: var(--ez-alert-list__title--font-family);\n font-size: var(--ez-alert-list__title--font-size);\n font-weight: var(--ez-alert-list__title--font-weight);\n color: var(--ez-alert-list__title--color);\n}\n\n.alert-list__header__buttons {\n display: flex;\n gap: var(--space--xs);\n}\n\n.alert-list__expandable-content {\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n';export{r as ez_alert_list}
|
|
@@ -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 r=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)}};r.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-alert-circle-inverted:before{content:"\\ea06"}.ez-icon-alert-circle:before{content:"\\ea07"}.ez-icon-alert-mail:before{content:"\\ea08"}.ez-icon-alert-popup:before{content:"\\ea09"}.ez-icon-anexo:before{content:"\\ea0a"}.ez-icon-antecipação:before{content:"\\ea0b"}.ez-icon-apps:before{content:"\\ea0c"}.ez-icon-arrow-forward:before{content:"\\ea0d"}.ez-icon-arrow-upward:before{content:"\\ea0e"}.ez-icon-arrow_back:before{content:"\\ea0f"}.ez-icon-arrow_downward:before{content:"\\ea10"}.ez-icon-baixa:before{content:"\\ea11"}.ez-icon-balance:before{content:"\\ea12"}.ez-icon-bell-inverted:before{content:"\\ea13"}.ez-icon-bell:before{content:"\\ea14"}.ez-icon-boleto:before{content:"\\ea15"}.ez-icon-boolean:before{content:"\\ea16"}.ez-icon-business-center:before{content:"\\ea17"}.ez-icon-calendar-clock:before{content:"\\ea18"}.ez-icon-calendar:before{content:"\\ea19"}.ez-icon-cash-remove:before{content:"\\ea1a"}.ez-icon-check-circle-inverted:before{content:"\\ea1b"}.ez-icon-check-circle:before{content:"\\ea1c"}.ez-icon-check:before{content:"\\ea1d"}.ez-icon-chevron-down:before{content:"\\ea1e"}.ez-icon-chevron-left:before{content:"\\ea1f"}.ez-icon-chevron-right:before{content:"\\ea20"}.ez-icon-chevron-up:before{content:"\\ea21"}.ez-icon-circle--medium:before{content:"\\ea22"}.ez-icon-circle:before{content:"\\ea23"}.ez-icon-cleaning:before{content:"\\ea24"}.ez-icon-clipboard:before{content:"\\ea25"}.ez-icon-close:before{content:"\\ea26"}.ez-icon-cobrar:before{content:"\\ea27"}.ez-icon-code:before{content:"\\ea28"}.ez-icon-configuration:before{content:"\\ea29"}.ez-icon-content-cut:before{content:"\\ea2a"}.ez-icon-copy:before{content:"\\ea2b"}.ez-icon-credit_card:before{content:"\\ea2c"}.ez-icon-crop:before{content:"\\ea2d"}.ez-icon-custom:before{content:"\\ea2e"}.ez-icon-delete-file:before{content:"\\ea2f"}.ez-icon-delete:before{content:"\\ea30"}.ez-icon-description:before{content:"\\ea31"}.ez-icon-dividir:before{content:"\\ea32"}.ez-icon-docx:before{content:"\\ea33"}.ez-icon-dot-notification:before{content:"\\ea34"}.ez-icon-dots-horizontal:before{content:"\\ea35"}.ez-icon-dots-vertical:before{content:"\\ea36"}.ez-icon-drag-indicator:before{content:"\\ea37"}.ez-icon-dual-chevron-down:before{content:"\\ea38"}.ez-icon-dual-chevron-left:before{content:"\\ea39"}.ez-icon-dual-chevron-right:before{content:"\\ea3a"}.ez-icon-dual-chevron-up:before{content:"\\ea3b"}.ez-icon-edit-file:before{content:"\\ea3c"}.ez-icon-edit-table:before{content:"\\ea3d"}.ez-icon-edit-time:before{content:"\\ea3e"}.ez-icon-edit-value:before{content:"\\ea3f"}.ez-icon-edit:before{content:"\\ea40"}.ez-icon-email:before{content:"\\ea41"}.ez-icon-estorno:before{content:"\\ea42"}.ez-icon-exe:before{content:"\\ea43"}.ez-icon-expand:before{content:"\\ea44"}.ez-icon-expandir_card:before{content:"\\ea45"}.ez-icon-extrato:before{content:"\\ea46"}.ez-icon-eye-off:before{content:"\\ea47"}.ez-icon-eye:before{content:"\\ea48"}.ez-icon-favorite:before{content:"\\ea49"}.ez-icon-figma:before{content:"\\ea4a"}.ez-icon-file-download:before{content:"\\ea4b"}.ez-icon-file-upload:before{content:"\\ea4c"}.ez-icon-filter:before{content:"\\ea4d"}.ez-icon-find-file:before{content:"\\ea4e"}.ez-icon-find-page:before{content:"\\ea4f"}.ez-icon-format-color-fill:before{content:"\\ea50"}.ez-icon-generic:before{content:"\\ea51"}.ez-icon-gif:before{content:"\\ea52"}.ez-icon-graph_bar:before{content:"\\ea53"}.ez-icon-handshake:before{content:"\\ea54"}.ez-icon-help-inverted:before{content:"\\ea55"}.ez-icon-help:before{content:"\\ea56"}.ez-icon-hide_menu:before{content:"\\ea57"}.ez-icon-home:before{content:"\\ea58"}.ez-icon-icons104:before{content:"\\ea59"}.ez-icon-language:before{content:"\\ea5a"}.ez-icon-launch:before{content:"\\ea5b"}.ez-icon-lightbulb:before{content:"\\ea5c"}.ez-icon-list:before{content:"\\ea5d"}.ez-icon-location:before{content:"\\ea5e"}.ez-icon-lock-outline:before{content:"\\ea5f"}.ez-icon-lock:before{content:"\\ea60"}.ez-icon-menu:before{content:"\\ea61"}.ez-icon-mid:before{content:"\\ea62"}.ez-icon-minus:before{content:"\\ea63"}.ez-icon-money-off:before{content:"\\ea64"}.ez-icon-money:before{content:"\\ea65"}.ez-icon-more:before{content:"\\ea66"}.ez-icon-mp3:before{content:"\\ea67"}.ez-icon-mp4:before{content:"\\ea68"}.ez-icon-multiple-files:before{content:"\\ea69"}.ez-icon-north-west:before{content:"\\ea6a"}.ez-icon-number:before{content:"\\ea6b"}.ez-icon-ordem-ascendente:before{content:"\\ea6c"}.ez-icon-ordem-descendente:before{content:"\\ea6d"}.ez-icon-parcelar:before{content:"\\ea6e"}.ez-icon-pause:before{content:"\\ea6f"}.ez-icon-payments:before{content:"\\ea70"}.ez-icon-pdf:before{content:"\\ea71"}.ez-icon-play:before{content:"\\ea72"}.ez-icon-plus:before{content:"\\ea73"}.ez-icon-png:before{content:"\\ea74"}.ez-icon-power:before{content:"\\ea75"}.ez-icon-pptx:before{content:"\\ea76"}.ez-icon-preview:before{content:"\\ea77"}.ez-icon-print:before{content:"\\ea78"}.ez-icon-push-pin:before{content:"\\ea79"}.ez-icon-rateio:before{content:"\\ea7a"}.ez-icon-receipt:before{content:"\\ea7b"}.ez-icon-recolher_card:before{content:"\\ea7c"}.ez-icon-restore:before{content:"\\ea7d"}.ez-icon-return:before{content:"\\ea7e"}.ez-icon-sankhya-place:before{content:"\\ea7f"}.ez-icon-save:before{content:"\\ea80"}.ez-icon-search:before{content:"\\ea81"}.ez-icon-settings-inverted:before{content:"\\ea82"}.ez-icon-settings:before{content:"\\ea83"}.ez-icon-share:before{content:"\\ea84"}.ez-icon-shield:before{content:"\\ea85"}.ez-icon-show_menu:before{content:"\\ea86"}.ez-icon-south-east:before{content:"\\ea87"}.ez-icon-sync:before{content:"\\ea88"}.ez-icon-table:before{content:"\\ea89"}.ez-icon-tag_code:before{content:"\\ea8a"}.ez-icon-text:before{content:"\\ea8b"}.ez-icon-timeline:before{content:"\\ea8c"}.ez-icon-timer-outline:before{content:"\\ea8d"}.ez-icon-trending-up:before{content:"\\ea8e"}.ez-icon-tune:before{content:"\\ea8f"}.ez-icon-txt:before{content:"\\ea90"}.ez-icon-un-pin:before{content:"\\ea91"}.ez-icon-unfold_less:before{content:"\\ea92"}.ez-icon-unfold_more:before{content:"\\ea93"}.ez-icon-user-circle:before{content:"\\ea94"}.ez-icon-warning-outline:before{content:"\\ea95"}.ez-icon-warning_triangle:before{content:"\\ea96"}.ez-icon-whatshot:before{content:"\\ea97"}.ez-icon-xlsx:before{content:"\\ea98"}.ez-icon-zip:before{content:"\\ea99"}.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{r as ez_icon}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,H as e,g as r}from"./p-23a36bb6.js";import{C as o}from"./p-7eb3e1a5.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{R as d}from"./p-05e1f4e7.js";const u=class{constructor(s){i(this,s),this.ezChange=t(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._lookupMode=!1,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._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!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}observeErrorMessage(){var i;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(i=this.errorMessage)||void 0===i?void 0:i.trim())||this.setInputValue())}observeValue(i,t){if(this._textInput&&i!=t)try{if("string"===i)return void this.setInputValue();const s=this.getSelectedOption(i),e=this.getSelectedOption(t),r=this.getSelectedOption(this.value);this.isDifferentValues(r,s)&&(this.value=s),this.isDifferentValues(s,e)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===s?void 0:s)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(i,t){(null==i?void 0:i.join(""))!==(null==t?void 0:t.join(""))&&this.loadOptions(v.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?i=>{let t=setInterval((()=>{this._showLoading||(clearInterval(t),i(this.value))}),100)}:i=>i(this.value))}async setFocus(){this._textInput&&this._textInput.setFocus()}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}scrollListener(){var i;null!=this._floatingID&&((null===(i=this.listOptionsPosition)||void 0===i?void 0:i.hardPosition)?this.hideOptions():window.requestAnimationFrame((()=>{this.updateListPosition()})))}updateListPosition(){let{verticalPosition:i,horizontalPosition:t,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||(i=i||0,t=t||0,s?i=window.innerHeight-l.top+i:i+=h.top,e?t=window.innerWidth-l.right+t:t+=h.left),null!=i&&(this._listWrapper.style[s?"bottom":"top"]=`${i}px`,this._listWrapper.style[s?"top":"bottom"]=""),null!=t&&(this._listWrapper.style[e?"right":"left"]=`${t}px`,this._listWrapper.style[e?"left":"right"]="")}getListPosition(){return this.listOptionsPosition?this.listOptionsPosition:{verticalPosition:this.errorMessage||!this.canShowError||"slim"===this.mode?6:-13}}isDifferentValues(i,t){return a.objectToString(i||{})!==a.objectToString(t||{})}getFormattedText(i){if(null!=i)return this.showSelectedValue&&null!=i.value?i.label?`${i.value} - ${i.label}`:i.value:i.label}getText(){const i=this.getSelectedOption(this.value),t=this.getFormattedText(i);if(null!=t)return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(i){return"string"==typeof i||i instanceof String?this._visibleOptions.find((t=>t.value===i)):i}updateVisibleOptions(){let i=this._source||[];this._visibleOptions=this.suppressEmptyOption?i:[{value:void 0,label:""}].concat(i),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var i;const t=[];return null===(i=this._visibleOptions)||void 0===i||i.forEach((i=>{const s=this.getWidthValue(i.value);t.includes(s)||t.push(s)})),t.length>1?Math.max(...t):0}getWidthValue(i){if(null!=this._itemValueBasis){const t=this._itemValueBasis;if(null!=i)return t.innerHTML=i,t.clientWidth>0?t.clientWidth+2:0;t.innerHTML=""}return 0}createOption(i){let{key:t,title:s}=i;const e=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");s=h.decodeHtmlEntities(s);const o={value:null==t?void 0:t.replace(e,"").replace(r,""),label:null==s?void 0:s.replace(e,"").replace(r,"")};this.selectOption(o)}buildItem(i,t){i.label=i.label||i.value;const e={key:i.value,title:i.label,details:i.details};return s("div",{style:{height:"100%"},onMouseDown:()=>this.createOption(e),onMouseOver:()=>this._preSelection=t},s("ez-card-item",{item:e}))}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(i){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`li#item_${i.value.replace(/[<>\[\]#=]/g,"\\$&").replace(/:/g,"\\:")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(i){this._startLoading=!1,i instanceof Promise?(this._showLoading=!0,i.then((i=>{this._showLoading=!1,this.updateSource(i)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(i)?(this._source=i,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(i))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(i){var t,s;const e=this.getSelectedOption(this.value);(null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.toString())!==(null===(s=null==i?void 0:i.value)||void 0===s?void 0:s.toString())||null==e&&null!=i&&"value"in i?this.value=(null==i?void 0:i.value)?i:void 0:this.resetOptions(),this._visibleOptions=[],this.clearSource()}loadOptions(i,t=""){this._criteria=t,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:i,argument:t}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(i=!0){const t=this.getText();(this._textInput.value||"")!==t&&(this._textInput.value=t,i&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){var i,t;const s=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((i=>""!==i.label&&null!=i.value));if((null==s?void 0:s.length)>0){const i=new RegExp(this._startHighlightTag,"g"),e=new RegExp(this._endHighlightTag,"g");let r=h.decodeHtmlEntities(s[0].label);const o={value:null===(t=s[0].value)||void 0===t?void 0:t.replace(i,"").replace(e,""),label:null==r?void 0:r.replace(i,"").replace(e,"")};this.selectOption(o)}}controlEmptySearch(){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne():(this.clearSearch(),c.info(this._textEmptyList))}validateDescriptionValue(){if(h.isEmpty(this.value))return;let i=this.value;"object"!=typeof i&&(h.isEmpty(i)||this.loadDescriptionValue(i))}async loadDescriptionValue(i){var t,s;if(null==i)return;if((null===(t=this.options)||void 0===t?void 0:t.length)>0)return void this.loadOptionValue(i);const e={mode:v.PREDICTIVE,argument:i},r=await(null===(s=this.optionLoader)||void 0===s?void 0:s.call(this,e));null!=r&&(r instanceof Promise?r.then((i=>{this.setDescriptionValue(i)})):this.setDescriptionValue(r))}setDescriptionValue(i){const t=(null==i?void 0:i[0])||i;null!=t&&Object.keys(t).length?(this._lookupMode=!0,this.value=t):this.showNoResultMessage()}loadOptionValue(i){var t;const s=null===(t=this.options)||void 0===t?void 0:t.find((t=>t.value===i));null!=s?this.selectOption(s):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),c.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var i;return null===(i=this.label)||void 0===i?void 0:i.replace(d,"").toUpperCase()}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}componentWillLoad(){if(void 0===this.options){this.options=[];const i=this.el.querySelectorAll("option");i&&i.forEach((i=>{let t=i.innerText,s=i.getAttribute("value"),e=i.getAttribute("details");s||(s=t),this.options.push({label:t,value:s,details:e}),i.hidden=!0}))}this.updateSource([])}componentDidRender(){var i;void 0===this._floatingID&&this._listWrapper.remove(),null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{n.addIDInfoIfNotExists(i,"itemSearch")})),this.validateDescriptionValue()}componentDidLoad(){o.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this._resizeObserver=new ResizeObserver((i=>{window.requestAnimationFrame((()=>{if(!Array.isArray(i)||!i.length)return;const{clientWidth:t}=this._listContainer;t>0&&this._listWrapper&&(this._listWrapper.style.width=`${t}px`)}))}))}handlerIconClick(){this.loadOptions(v.ADVANCED)}buildNumberArgument(i){return this.isTextSearch?NaN:Number(i||void 0)}onTextInputChangeHandler(i){var t;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(i)}),this._deboucingTime));const s=null===(t=i.target.value)||void 0===t?void 0:t.trim(),e=this.buildNumberArgument(s);this._criteria||(this._textInput.value=i.data||s),this._criteria=s,s?(this._showLoading=!1,this.clearSource(),!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(i){switch(this._tabPressed=!1,i.ctrlKey&&("f"!==i.key&&"F"!==i.key||(this.loadOptions(v.ADVANCED),i.stopPropagation(),i.stopImmediatePropagation(),i.preventDefault())),i.key){case"ArrowDown":this.nextOption(),i.stopPropagation();break;case"ArrowUp":this.previousOption(),i.stopPropagation();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}render(){var i;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:i=>this._textInput=i,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:i=>this.onTextInputChangeHandler(i),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:i=>this.keyDownHandler(i),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()},s("ez-icon",{iconName:"search"})),(null===(i=this._textInput)||void 0===i?void 0:i.value)&&(this._criteria||this.value)?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:i=>this._listContainer=i},s("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},s("ul",{class:"list-options",ref:i=>this._optionsList=i},!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:i=>this._itemValueBasis=i}),this.canShowListOptions()&&this._visibleOptions.map(((i,t)=>this.buildItem(i,t)))))))}get el(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var v;!function(i){i.ADVANCED="ADVANCED",i.PRELOAD="PRELOAD",i.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--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{min-width:var(--ez-search__list-min-width);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;background-color:var(--ez-search--background-color--xlight);border-radius:var(--ez-search--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-search--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-search__scrollbar--color-background);width:var(--ez-search__scrollbar--width);max-width:var(--ez-search__scrollbar--width);min-width:var(--ez-search__scrollbar--width)}.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);padding:var(--ez-search--space--small);min-height:var(--ez-search__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-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:unset;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:unset;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)}}";export{u as ez_search}
|