@sankhyalabs/ezui 0.0.0-bugfix-dev-kb-74998.4 → 0.0.0-bugfix-dev-KB-75210.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/cjs/{ez-card-item_3.cjs.entry.js → ez-card-item_2.cjs.entry.js} +0 -123
  2. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-double-list.cjs.entry.js +287 -0
  4. package/dist/cjs/ez-filter-input.cjs.entry.js +130 -0
  5. package/dist/cjs/ez-form-view.cjs.entry.js +8 -2
  6. package/dist/cjs/ez-grid.cjs.entry.js +777 -109
  7. package/dist/cjs/ez-list.cjs.entry.js +253 -205
  8. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-popup.cjs.entry.js +4 -1
  10. package/dist/cjs/ez-split-item.cjs.entry.js +3 -2
  11. package/dist/cjs/ez-split-panel.cjs.entry.js +54 -2
  12. package/dist/cjs/ezListHelper-0d3970b4.js +90 -0
  13. package/dist/cjs/ezui.cjs.js +1 -1
  14. package/dist/cjs/filter-column.cjs.entry.js +2 -2
  15. package/dist/cjs/index-a7b0c73d.js +10 -2
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +1 -0
  18. package/dist/collection/components/ez-double-list/doubleListHelper.js +82 -0
  19. package/dist/collection/components/ez-double-list/ez-double-list.css +62 -0
  20. package/dist/collection/components/ez-double-list/ez-double-list.js +440 -0
  21. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
  22. package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +6 -2
  23. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -1
  24. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +4 -0
  25. package/dist/collection/components/ez-grid/ez-grid.css +24 -6
  26. package/dist/collection/components/ez-grid/ez-grid.js +25 -5
  27. package/dist/collection/components/ez-grid/subcomponents/filter-column.css +4 -0
  28. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +1 -1
  29. package/dist/collection/components/ez-list/ez-list.js +296 -206
  30. package/dist/collection/components/ez-list/ezListHelper.js +85 -0
  31. package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css +2 -2
  32. package/dist/collection/components/ez-popup/ez-popup.css +1 -0
  33. package/dist/collection/components/ez-popup/ez-popup.js +5 -2
  34. package/dist/collection/components/ez-split-panel/ez-split-panel.css +15 -0
  35. package/dist/collection/components/ez-split-panel/ez-split-panel.js +71 -1
  36. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +13 -2
  37. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +20 -1
  38. package/dist/custom-elements/index.d.ts +6 -0
  39. package/dist/custom-elements/index.js +1481 -338
  40. package/dist/esm/{ez-card-item_3.entry.js → ez-card-item_2.entry.js} +1 -123
  41. package/dist/esm/ez-chart.entry.js +1 -1
  42. package/dist/esm/ez-double-list.entry.js +283 -0
  43. package/dist/esm/ez-filter-input.entry.js +126 -0
  44. package/dist/esm/ez-form-view.entry.js +8 -2
  45. package/dist/esm/ez-grid.entry.js +778 -110
  46. package/dist/esm/ez-list.entry.js +253 -205
  47. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  48. package/dist/esm/ez-popup.entry.js +4 -1
  49. package/dist/esm/ez-split-item.entry.js +3 -2
  50. package/dist/esm/ez-split-panel.entry.js +54 -2
  51. package/dist/esm/ezListHelper-00fb9b8d.js +87 -0
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/filter-column.entry.js +2 -2
  54. package/dist/esm/index-baa5e267.js +10 -2
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/ezui/ezui.esm.js +1 -1
  57. package/dist/ezui/p-16e612fc.entry.js +1 -0
  58. package/dist/ezui/p-17eabf46.entry.js +1 -0
  59. package/dist/ezui/p-2475fd6e.entry.js +1 -0
  60. package/dist/ezui/{p-baf80b13.entry.js → p-35d467a8.entry.js} +1 -1
  61. package/dist/ezui/p-5b205c80.entry.js +1 -0
  62. package/dist/ezui/p-65f471bc.entry.js +1 -0
  63. package/dist/ezui/p-66924de6.entry.js +1 -0
  64. package/dist/ezui/p-7e677b7b.entry.js +1 -0
  65. package/dist/ezui/p-80dfc50b.js +1 -0
  66. package/dist/ezui/{p-b36542d8.entry.js → p-a6fe527a.entry.js} +1 -1
  67. package/dist/ezui/p-b46e9f59.entry.js +309 -0
  68. package/dist/ezui/p-e3e3fd7a.entry.js +1 -0
  69. package/dist/ezui/{p-2b46b37b.entry.js → p-fa6732f2.entry.js} +1 -1
  70. package/dist/types/components/ez-double-list/doubleListHelper.d.ts +10 -0
  71. package/dist/types/components/ez-double-list/ez-double-list.d.ts +87 -0
  72. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +2 -1
  73. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
  74. package/dist/types/components/ez-grid/ez-grid.d.ts +5 -1
  75. package/dist/types/components/ez-list/ez-list.d.ts +23 -2
  76. package/dist/types/components/ez-list/ezListHelper.d.ts +20 -0
  77. package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
  78. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +7 -0
  79. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +4 -0
  80. package/dist/types/components.d.ts +133 -13
  81. package/package.json +1 -1
  82. package/react/components.d.ts +1 -0
  83. package/react/components.js +1 -0
  84. package/react/components.js.map +1 -1
  85. package/dist/ezui/p-4575d511.entry.js +0 -1
  86. package/dist/ezui/p-90bcd2ba.entry.js +0 -1
  87. package/dist/ezui/p-bfad39eb.entry.js +0 -1
  88. package/dist/ezui/p-c806f32f.entry.js +0 -1
  89. package/dist/ezui/p-ca1ce49f.entry.js +0 -309
  90. package/dist/ezui/p-cd2e78f0.entry.js +0 -1
  91. package/dist/ezui/p-e78e0843.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{h as e,r as a,c as t,g as r,H as n}from"./p-23a36bb6.js";import{ObjectUtils as o,UserInterface as l,ElementIDUtils as i}from"@sankhyalabs/core";import{R as s}from"./p-05e1f4e7.js";import{C as d}from"./p-b853763b.js";function c(a,t,r,n,o){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-bottom--large"},e("ez-check",{enabled:!r,label:t,mode:o?d.SWITCH:d.REGULAR,"data-field-name":a,"data-context-name":n,key:a,noMargin:!0}))}function m(a,t,r,n,o,l,i){return e("div",{class:"ez-col ez-col--sd-12 "},e("ez-number-input",{enabled:!r,label:t,precision:n,prettyPrecision:o,"data-field-name":a,"data-context-name":l,key:a,canShowError:i,noMargin:!0}))}const h=({name:a,label:t,readOnly:r,contextName:n,canShowError:o,props:l})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-text-input",{label:t,"data-field-name":a,"data-context-name":n,key:a,enabled:!r,canShowError:o,mask:null==l?void 0:l.mask,"clean-value-mask":null==l?void 0:l.cleanValueMask,noMargin:!0})),u=new Map;u.set(l.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),u.set(l.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),u.set(l.OPTIONSELECTOR,(({name:a,label:t,readOnly:r,required:n,props:o,contextName:l,canShowError:i})=>{const s=null==o?void 0:o.options;let d;if("string"==typeof s){const e=JSON.parse(s);d=Object.keys(e).map((a=>({value:a,label:e[a]})))}else d=s;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-combo-box",{enabled:!r,suppressEmptyOption:n,label:t,"data-field-name":a,"data-context-name":l,key:a,options:d,canShowError:i,noMargin:!0}))})),u.set(l.DATE,(({name:a,label:t,readOnly:r,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-input",{enabled:!r,label:t,"data-field-name":a,key:a,canShowError:n,noMargin:!0})))),u.set(l.TIME,(({name:a,label:t,readOnly:r,canShowError:n,props:o})=>{var l;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{enabled:!r,label:t,"data-field-name":a,key:a,canShowError:n,noMargin:!0,"show-seconds":null!==(l=null==o?void 0:o.showSeconds)&&void 0!==l&&l}))})),u.set(l.ELAPSEDTIME,(({name:a,label:t,readOnly:r,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{enabled:!r,label:t,"data-field-name":a,key:a,canShowError:n,noMargin:!0,showSeconds:!0})))),u.set(l.DATETIME,(({name:a,label:t,readOnly:r,contextName:n,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-time-input",{enabled:!r,label:t,"data-field-name":a,"data-context-name":n,key:a,canShowError:o,noMargin:!0})))),u.set(l.FILE,(({name:a,label:t,readOnly:r,contextName:n,props:l})=>{const i=o.removeEmptyValues({subTitle:l.subTitle,requestHeaders:Object.assign(Object.assign({},l.STORAGESTRATEGY&&{STORAGESTRATEGY:l.STORAGESTRATEGY}),l.INTERNAL_FILENAME&&{INTERNAL_FILENAME:l.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12"},e("ez-upload",Object.assign({enabled:!r,label:t,"data-field-name":a,"data-context-name":n,key:a},i)))})),u.set(l.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:r,contextName:n,canShowError:o})=>{var l,i;const s=Number(null!==(l=null==r?void 0:r.precision)&&void 0!==l?l:2);return m(e,a,t,s,Number(null!==(i=null==r?void 0:r.prettyPrecision)&&void 0!==i?i:s),n,o)})),u.set(l.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:r,canShowError:n})=>m(e,a,t,0,0,r,n))),u.set(l.SEARCH,(({name:a,label:t,readOnly:r,required:n,contextName:o,canShowError:l,optionLoader:i,props:s})=>{var d;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-search",{enabled:!r,suppressEmptyOption:n,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:l,optionLoader:i,ignoreLimitCharsToSearch:null!==(d=s.ignoreLimitCharsToSearch)&&void 0!==d&&d,noMargin:!0}))})),u.set(l.LONGTEXT,(({name:a,label:t,readOnly:r,contextName:n,rows:o,canShowError:l})=>e("div",{class:"ez-col ez-col--sd-12",key:a},e("ez-text-area",{enabled:!r,label:t,"data-field-name":a,"data-context-name":n,rows:o,canShowError:l}))));const p=e=>{const a=u.get(e.userInterface)||h,t=e.required?`${e.label}${s}`:e.label,r=a(Object.assign(Object.assign({},e),{label:t}));return r.t["data-form-item"]=e.name,r};class b{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class w{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new b(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const v=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this.fields=void 0,this.selectedRecord=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(e,a,t){const r=new Map(this._customEditors);r.set(e,{customEditor:a,detailContext:t}),this._customEditors=r}async setFieldProp(e,a,t){const r=this.fields.map((r=>(r.name!==e||!t&&0!==t||(r.props=r.props||{},r.props[a]=t),r)));this.fields=[...r]}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let r=a.get(t);null==r&&(r=[],a.set(t,r)),r.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this._formElements=Array.from(this._element.querySelectorAll("[data-field-name]")),this.ezContentReady.emit(this._formElements);const e=new w(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[l.FILE,l.LONGTEXT].includes(e)}buildFormItemElement(a,t=""){var r;if(this.isItemFullWidth(a.userInterface)&&(t+=" input-full_width"),this._customEditors.has(a.name)){const n=null===(r=this._formElements.map((e=>({name:e.dataset.fieldName,value:e.value}))).find((e=>e.name===a.name)))||void 0===r?void 0:r.value,o=this._customEditors.get(a.name).customEditor;return e("div",{class:t},e("ez-custom-form-input",{"data-field-name":a.name,customEditor:o,formViewField:a,builderFallback:p,value:n,selectedRecord:this.selectedRecord}))}return e("div",{class:t},p(a))}render(){if(i.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],t=Array.from(this.groupFields(this.fields).entries()).map((([t,r])=>{if(Array.isArray(r))return e("ez-collapsible-box",{id:`group-${t}`,label:t,"header-size":"large",key:t},e("div",{class:"form-view__content"},r.map((e=>this.buildFormItemElement(e)))));a.push(r)})),r=a.map((e=>this.buildFormItemElement(e))),o=e("div",{class:"form-view__content"},r);return e(n,null,o,t)}get _element(){return r(this)}};v.style=".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:220px;--ez-form-view__item--width:var(--space--small);--ez-form-view__item--padding:var(--space--small)}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--width);padding-inline:var(--ez-form-view__item--padding);width:100%}.input-full_width.sc-ez-form-view{grid-column:1 / -1;width:100%}";export{v as ez_form_view}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as h,g as n}from"./p-23a36bb6.js";import{StringUtils as r}from"@sankhyalabs/core";var e=function(t,i){return Number(t.slice(0,-1*i.length))},o=function(t){return t.endsWith("px")?{value:t,type:"px",numeric:e(t,"px")}:t.endsWith("fr")?{value:t,type:"fr",numeric:e(t,"fr")}:t.endsWith("%")?{value:t,type:"%",numeric:e(t,"%")}:"auto"===t?{value:t,type:"auto"}:null},u=function(t){return t.split(" ").map(o)},c=function(t,i,s){return i.concat(s).map((function(i){return i.style[t]})).filter((function(t){return void 0!==t&&""!==t}))},a=function(t){for(var i=0;i<t.length;i++)if(t[i].numeric>0)return i;return null},l=function(){return!1},f=function(t,i,s){t.style[i]=s},d=function(t,i,s){var h=t[i];return void 0!==h?h:s};function w(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=d(s,"columnCursor",d(s,"cursor","col-resize")),this.snapOffset=d(s,"columnSnapOffset",d(s,"snapOffset",30)),this.dragInterval=d(s,"columnDragInterval",d(s,"dragInterval",1)),this.clientAxis="clientX",this.optionStyle=d(s,"gridTemplateColumns")):"row"===t&&(this.gridTemplateProp="grid-template-rows",this.gridGapProp="grid-row-gap",this.cursor=d(s,"rowCursor",d(s,"cursor","row-resize")),this.snapOffset=d(s,"rowSnapOffset",d(s,"snapOffset",30)),this.dragInterval=d(s,"rowDragInterval",d(s,"dragInterval",1)),this.clientAxis="clientY",this.optionStyle=d(s,"gridTemplateRows")),this.onDragStart=d(s,"onDragStart",l),this.onDragEnd=d(s,"onDragEnd",l),this.onDrag=d(s,"onDrag",l),this.writeStyle=d(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=c(this.gridTemplateProp,[this.grid],w(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=c(this.gridGapProp,[this.grid],w(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=u(t)},m.prototype.setComputedTracks=function(t){this.computedTracks=t.split(" "),this.computedPixels=u(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=a(s);null!==h&&(this.frToPixels=this.computedPixels[h].numeric/s[h].numeric)}if(i.length){var n=a(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",l),this.grid.addEventListener("dragstart",l),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",l),this.grid.removeEventListener("dragstart",l),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 v=function(t,i,s){return i in t?t[i]:s},p=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:v(h,s.track-1,d(i,n,d(i,"minSize",0))),minSizeEnd:v(h,s.track+1,d(i,n,d(i,"minSize",0)))},s),i)}},g=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]=p("column",i.options)(t)})),this.options.rowGutters.forEach((function(t){i.rowGutters[t.track]=p("row",i.options)(t)}))};g.prototype.addColumnGutter=function(t,i){this.columnGutters[i]&&this.columnGutters[i].destroy(),this.columnGutters[i]=p("column",this.options)({element:t,track:i})},g.prototype.addRowGutter=function(t,i){this.rowGutters[i]&&this.rowGutters[i].destroy(),this.rowGutters[i]=p("row",this.options)({element:t,track:i})},g.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]}))},g.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]}))},g.prototype.handleDragStart=function(t,i,s){"column"===i?(this.columnGutters[s]&&this.columnGutters[s].destroy(),this.columnGutters[s]=p("column",this.options)({track:s}),this.columnGutters[s].startDragging(t)):"row"===i&&(this.rowGutters[s]&&this.rowGutters[s].destroy(),this.rowGutters[s]=p("row",this.options)({track:s}),this.rowGutters[s].startDragging(t))},g.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 b=class{constructor(s){t(this,s),this.resizeEnd=i(this,"resizeEnd",7),this._items=[],this._buildInProgress=!1,this.direction="column",this.anchorToExpand=!1}rebuildLayout(){Array.from(this._element.querySelectorAll(".ez-split-gutter")).reverse().forEach((t=>{t.remove()})),Array.from(this._element.getElementsByTagName("EzSplitPanel")).reverse().forEach((t=>{t.rebuildLayout()})),this.buildItems(),this.initSplit()}buildItems(){this._panelID=r.generateUUID(),this._element.dataset.panelId=this._panelID,this._element.dataset.uniqueId="EzSplitPanel";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}))}componentDidLoad(){this.buildItems(),this.initSplit(),this._mutationObserver=new MutationObserver((t=>{for(const i of t)if("childList"===i.type&&!this._buildInProgress){this._buildInProgress=!0,window.requestAnimationFrame((()=>{this.rebuildLayout()})),window.requestAnimationFrame((()=>this._buildInProgress=!1));break}})),this._mutationObserver.observe(this._element,{childList:!0,subtree:!1})}disconnectedCallback(){null!=this._mutationObserver&&this._mutationObserver.disconnect()}initSplit(){var t;this._items.length&&(this._element.style["row"===this.direction?"grid-template-rows":"grid-template-columns"]=this.getGridTemplate(),t=this.getGutters(),new g(t))}handlePanelDragEnd(){const t=this._items.map((t=>({id:t.id,height:t.clientHeight,width:t.clientWidth})));this.resizeEnd.emit({panelId:this._element.id,items:t})}getGutters(){const t={columnGutters:[],rowGutters:[],onDragEnd:()=>this.handlePanelDragEnd()};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%",position:this.anchorToExpand?"relative":"unset"}}calcFreeSpacePercentage(){const t=this._items.reduce(((t,i)=>{var s;return t+((null===(s=i.size)||void 0===s?void 0:s.includes("%"))?Number(i.size.replace("%","")):0)}),0),i=this._items.filter((t=>void 0===t.size)).length;return i&&t?(100-t)/i:null}getGridTemplate(){let t="";const i=this.calcFreeSpacePercentage();return this._items.forEach(((s,h)=>{let n=s.size||"1fr";!s.size&&i&&(n=`${i}%`),t+=h!==this._items.length-1?0!==h?` ${n} 5px`:`${n} 5px`:` ${n}`})),t}render(){return s(h,{style:this.getElementStyle()})}get _element(){return n(this)}};b.style=".ez-split-gutter{cursor:grab;background-color:transparent;max-width:100%}";export{b as ez_split_panel}
1
+ import{r as t,c as i,h as s,H as h,g as n}from"./p-23a36bb6.js";import{StringUtils as r}from"@sankhyalabs/core";var e=function(t,i){return Number(t.slice(0,-1*i.length))},o=function(t){return t.endsWith("px")?{value:t,type:"px",numeric:e(t,"px")}:t.endsWith("fr")?{value:t,type:"fr",numeric:e(t,"fr")}:t.endsWith("%")?{value:t,type:"%",numeric:e(t,"%")}:"auto"===t?{value:t,type:"auto"}:null},u=function(t){return t.split(" ").map(o)},c=function(t,i,s){return i.concat(s).map((function(i){return i.style[t]})).filter((function(t){return void 0!==t&&""!==t}))},a=function(t){for(var i=0;i<t.length;i++)if(t[i].numeric>0)return i;return null},l=function(){return!1},d=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 w=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",l),this.onDragEnd=f(s,"onDragEnd",l),this.onDrag=f(s,"onDrag",l),this.writeStyle=f(s,"writeStyle",d),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))};w.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)},w.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)},w.prototype.getSizeOfTrack=function(t){return this.computedPixels[t].numeric},w.prototype.getRawTracks=function(){var t=c(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]},w.prototype.getGap=function(){var t=c(this.gridGapProp,[this.grid],m(this.grid));return t.length?t[0]:null},w.prototype.getRawComputedTracks=function(){return window.getComputedStyle(this.grid)[this.gridTemplateProp]},w.prototype.getRawComputedGap=function(){return window.getComputedStyle(this.grid)[this.gridGapProp]},w.prototype.setTracks=function(t){this.tracks=t.split(" "),this.trackValues=u(t)},w.prototype.setComputedTracks=function(t){this.computedTracks=t.split(" "),this.computedPixels=u(t)},w.prototype.setGap=function(t){this.gap=t},w.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},w.prototype.getMousePosition=function(t){return"touches"in t?t.touches[0][this.clientAxis]:t[this.clientAxis]},w.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=a(s);null!==h&&(this.frToPixels=this.computedPixels[h].numeric/s[h].numeric)}if(i.length){var n=a(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",l),this.grid.addEventListener("dragstart",l),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)}},w.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)},w.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)},w.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",l),this.grid.removeEventListener("dragstart",l),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=""},w.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 v=function(t,i,s){return i in t?t[i]:s},p=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 w(t,Object.assign({},{minSizeStart:v(h,s.track-1,f(i,n,f(i,"minSize",0))),minSizeEnd:v(h,s.track+1,f(i,n,f(i,"minSize",0)))},s),i)}},g=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]=p("column",i.options)(t)})),this.options.rowGutters.forEach((function(t){i.rowGutters[t.track]=p("row",i.options)(t)}))};g.prototype.addColumnGutter=function(t,i){this.columnGutters[i]&&this.columnGutters[i].destroy(),this.columnGutters[i]=p("column",this.options)({element:t,track:i})},g.prototype.addRowGutter=function(t,i){this.rowGutters[i]&&this.rowGutters[i].destroy(),this.rowGutters[i]=p("row",this.options)({element:t,track:i})},g.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]}))},g.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]}))},g.prototype.handleDragStart=function(t,i,s){"column"===i?(this.columnGutters[s]&&this.columnGutters[s].destroy(),this.columnGutters[s]=p("column",this.options)({track:s}),this.columnGutters[s].startDragging(t)):"row"===i&&(this.rowGutters[s]&&this.rowGutters[s].destroy(),this.rowGutters[s]=p("row",this.options)({track:s}),this.rowGutters[s].startDragging(t))},g.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 b=class{constructor(s){t(this,s),this.resizeEnd=i(this,"resizeEnd",7),this._items=[],this._buildInProgress=!1,this.direction="column",this.anchorToExpand=!1,this.structural=!1}rebuildLayout(){Array.from(this._element.querySelectorAll(".ez-split-gutter")).reverse().forEach((t=>{t.remove()})),Array.from(this._element.getElementsByTagName("EzSplitPanel")).reverse().forEach((t=>{t.rebuildLayout()})),this.buildItems(),this.initSplit()}buildItems(){this._panelID=r.generateUUID(),this._element.dataset.panelId=this._panelID,this._element.dataset.uniqueId="EzSplitPanel";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}))}componentDidLoad(){this.buildItems(),this.initSplit(),this._mutationObserver=new MutationObserver((t=>{for(const i of t)if("childList"===i.type&&!this._buildInProgress){this._buildInProgress=!0,window.requestAnimationFrame((()=>{this.rebuildLayout()})),window.requestAnimationFrame((()=>this._buildInProgress=!1));break}})),this._mutationObserver.observe(this._element,{childList:!0,subtree:!1})}disconnectedCallback(){null!=this._mutationObserver&&this._mutationObserver.disconnect()}initSplit(){var t;this._items.length&&(this._element.style["row"===this.direction?"grid-template-rows":"grid-template-columns"]=this.getGridTemplate(),this.removeGuttersMargin(),t=this.getGutters(),new g(t))}handlePanelDragEnd(){const t=this._items.map((t=>({id:t.id,height:t.clientHeight,width:t.clientWidth})));this.resizeEnd.emit({panelId:this._element.id,items:t})}getGutters(){const t={columnGutters:[],rowGutters:[],onDragEnd:()=>this.handlePanelDragEnd()};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.classList.add("row"===this.direction?"ez-split-gutter__row":"ez-split-gutter__column"),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%",position:this.anchorToExpand?"relative":"unset"}}calcFreeSpacePercentage(){const t=this._items.reduce(((t,i)=>{var s;return t+((null===(s=i.size)||void 0===s?void 0:s.includes("%"))?Number(i.size.replace("%","")):0)}),0),i=this._items.filter((t=>void 0===t.size)).length;return i&&t?(100-t)/i:null}getGridTemplate(){let t="";const i=this.calcFreeSpacePercentage();return this._items.forEach(((s,h)=>{let n=s.size||"1fr";!s.size&&i&&(n=`${i}%`),t+=h!==this._items.length-1?0!==h?` ${n} 5px`:`${n} 5px`:` ${n}`})),t}removeGuttersMargin(){this._items.length<=1||("column"!=this.direction?"row"!=this.direction||this.removeGuttersMarginRow():this.removeGuttersMarginColumn())}removeGuttersMarginColumn(){this._items.forEach(((t,i)=>{0!=i?i!==this._items.length-1?(t.style.marginRight="0",t.style.marginLeft="0"):t.style.marginLeft="0":t.style.marginRight="0"}))}removeGuttersMarginRow(){this._items.length<=1||this._items.forEach(((t,i)=>{0!=i?i!==this._items.length-1?(t.style.marginBottom="0",t.style.marginTop="0"):t.style.marginTop="0":t.style.marginBottom="0"}))}render(){return s(h,{class:this.structural?"structural__panel":"content__panel",style:this.getElementStyle()})}get _element(){return n(this)}};b.style=".ez-split-gutter{cursor:grab;background-color:transparent;max-width:100%}.ez-split-gutter__row{cursor:ns-resize}.ez-split-gutter__column{cursor:ew-resize}.structural__panel{background:none;box-shadow:none;outline:none;padding:0;margin:0;border:0}";export{b as ez_split_panel}
@@ -0,0 +1,10 @@
1
+ import { ListItem } from '../ez-list/ez-list';
2
+ export declare function moveItems(selectedItemsList: string[], itemsList: ListItem[], foward: boolean): ListItem[];
3
+ export declare function transferAll({ from, to, selectedFrom, selectedTo }: TransferConfig): TransferConfig;
4
+ export declare function transferItems({ from, to, selectedFrom, selectedTo }: TransferConfig): TransferConfig;
5
+ export interface TransferConfig {
6
+ from: ListItem[];
7
+ to: ListItem[];
8
+ selectedFrom: string[];
9
+ selectedTo: string[];
10
+ }
@@ -0,0 +1,87 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { ListItem } from '../ez-list/ez-list';
3
+ export declare class EzDoubleList {
4
+ readonly LEFT_LIST_ID = "LEFT-LIST-ID";
5
+ readonly RIGHT_LIST_ID = "RIGHT-LIST-ID";
6
+ readonly LEFT_FILTER_ID = "LEFT-FILTER-ID";
7
+ readonly RIGHT_FILTER_ID = "RIGHT-FILTER-ID";
8
+ /**
9
+ * Define a lista origem.
10
+ */
11
+ leftList: ListItem[];
12
+ /**
13
+ * Define o título da lista origem.
14
+ */
15
+ leftTitle: string;
16
+ /**
17
+ * Define a lista destino.
18
+ */
19
+ rightList: ListItem[];
20
+ /**
21
+ * Nome da entidade listada.
22
+ * Exemplo: "Campo", "Item", "Empresa".
23
+ */
24
+ entityLabel: string;
25
+ /**
26
+ * Variação plura do nome da entidade listada.
27
+ * Exemplo: "Campos", "Itens", "Empresas".
28
+ */
29
+ entityLabelPlural: string;
30
+ /**
31
+ * Rótulo da lista esquerda.
32
+ */
33
+ leftListLabel: string;
34
+ /**
35
+ * Rótulo da lista direita.
36
+ */
37
+ rightListLabel: string;
38
+ /**
39
+ * Define o título da lista destino.
40
+ */
41
+ rightTitle: string;
42
+ leftFilteredList: ListItem[];
43
+ rightFilteredList: ListItem[];
44
+ selectedLeftList: string[];
45
+ selectedRightList: string[];
46
+ isFilteringLeft: boolean;
47
+ isFilteringRight: boolean;
48
+ ezLeftListChanged: EventEmitter<Array<ListItem>>;
49
+ ezRightListChanged: EventEmitter<Array<ListItem>>;
50
+ resetSelectedLists(): Promise<void>;
51
+ observeLeftList(newValue: any, oldValue: any): void;
52
+ observeRightList(newValue: any, oldValue: any): void;
53
+ private leftEzListInstance;
54
+ private rightEzListInstance;
55
+ private leftEzFilterInput;
56
+ private rightEzFilterInput;
57
+ private handleFilterChangeLeft;
58
+ private handleFilterChangeRight;
59
+ private handleChangeLeft;
60
+ private handleChangeRight;
61
+ private enableTransferAllToRight;
62
+ private enableTransferAllToLeft;
63
+ private enableTransferToRight;
64
+ private enableTransferToLeft;
65
+ private enableMoveUp;
66
+ private enableMoveDown;
67
+ private getRightSelectedItemsIndex;
68
+ private transferToRight;
69
+ private transferToLeft;
70
+ private handleTransferAllToRight;
71
+ private handleTransferAllToLeft;
72
+ private buildTransferToRightConfig;
73
+ private buildTransferToLeftConfig;
74
+ private handleMoveUp;
75
+ private handleMoveDown;
76
+ private handleMoveToTop;
77
+ private handleMoveToBottom;
78
+ private handleSelectLeftItem;
79
+ private handleSelectRightItem;
80
+ private getItemsToKeepAndToMove;
81
+ private handleTransferToRight;
82
+ private handleTransferToLeft;
83
+ private buildTotalizer;
84
+ private renderLeftList;
85
+ private renderRightList;
86
+ render(): any;
87
+ }
@@ -1,4 +1,5 @@
1
1
  import { IFormViewField } from "../../interfaces/IFormViewField";
2
2
  export declare const buildDate: ({ name, label, readOnly, canShowError }: IFormViewField) => HTMLElement;
3
- export declare const buildTime: ({ name, label, readOnly, canShowError }: IFormViewField) => HTMLElement;
3
+ export declare const buildTime: ({ name, label, readOnly, canShowError, props }: IFormViewField) => HTMLElement;
4
+ export declare const buildTimeSeconds: ({ name, label, readOnly, canShowError }: IFormViewField) => HTMLElement;
4
5
  export declare const buildDateTime: ({ name, label, readOnly, contextName, canShowError }: IFormViewField) => HTMLElement;
@@ -258,6 +258,10 @@ export interface EzGridOptions {
258
258
  */
259
259
  enableContinuousInsert?: boolean;
260
260
  enableLockManger?: boolean;
261
+ /**
262
+ * Ativa/desativa modo de linhas com cores alternadas.
263
+ */
264
+ enableRowTableStriped?: boolean;
261
265
  }
262
266
  /**
263
267
  * Representa cada coluna da grade.
@@ -115,7 +115,11 @@ export declare class EzGrid {
115
115
  * Quando true, aplica o padrão de sombras ao componente (Utilizar quando for o elemento principal do layout)
116
116
  * Quando false, aplica o padrão de outline ao componente (Utilizar quando estiver contido em outro elemento como um painel ou pop-up)
117
117
  */
118
- boxShadow?: boolean;
118
+ outlineMode?: boolean;
119
+ /**
120
+ * Ativa modo de linhas com cores alternadas.
121
+ */
122
+ enableRowTableStriped?: boolean;
119
123
  /**
120
124
  * Aplica a definição de colunas.
121
125
  */
@@ -29,7 +29,6 @@ export declare class EzList {
29
29
  private _groupContainer;
30
30
  private _element;
31
31
  private _itemContainer;
32
- private _draggingElement;
33
32
  private _changeDeboucingTimeout;
34
33
  /**
35
34
  * Define a lista inicial do componente.
@@ -65,6 +64,10 @@ export declare class EzList {
65
64
  * Quando verdadeiro, ativa o feedback visual ao efetuar houver nos itens da lista.
66
65
  */
67
66
  hoverFeedback: boolean;
67
+ /**
68
+ * Habilita seleção de múltiplos items.
69
+ */
70
+ enableMultipleSelection: boolean;
68
71
  /**
69
72
  * Emitido quando acontece a alteração de estado da lista.
70
73
  */
@@ -73,6 +76,10 @@ export declare class EzList {
73
76
  * Emitido sempre que um item da lista for selecionado.
74
77
  */
75
78
  ezSelectItem: EventEmitter<ListItem>;
79
+ /**
80
+ * Emitido sempre que um ou vários item da lista for selecionado.
81
+ */
82
+ ezSelectMultipleItems: EventEmitter<ListItem[]>;
76
83
  /**
77
84
  * Emitido quando acontece a alteração de um item do checkbox.
78
85
  */
@@ -92,7 +99,12 @@ export declare class EzList {
92
99
  /**
93
100
  * Aplica seleção nas linhas da lista.
94
101
  */
95
- setSelection(selectedItem: ListItem, scrollToOption?: boolean): Promise<void>;
102
+ setSelection(selectedItem: ListItem, scrollToOption?: boolean, shitkey?: boolean, ctrlKey?: boolean): Promise<void>;
103
+ private emitSelectedItems;
104
+ private setSelectionRange;
105
+ private setSelectionMultiple;
106
+ private setSelectionSingleItem;
107
+ private setSelectionWithGroups;
96
108
  /**
97
109
  * Obtém o item selecionado.
98
110
  */
@@ -113,7 +125,10 @@ export declare class EzList {
113
125
  componentWillRender(): void;
114
126
  componentDidLoad(): void;
115
127
  onDrop(ev: any, dragEndItem: ListItemGroup): void;
128
+ private buildDragHandlerConfig;
129
+ private onDropWithGroups;
116
130
  onDropLastIndex(ev: any, groupDropped?: any): void;
131
+ private onDropLastItemWithGroups;
117
132
  onDropGroup(groupSelected: any): void;
118
133
  onDragEnd(): void;
119
134
  addOverClass(element: any): void;
@@ -121,9 +136,12 @@ export declare class EzList {
121
136
  removeOverClass(): void;
122
137
  removeOverGroupClass(ev: any, group: any): void;
123
138
  onDragStart(item: any, group?: any, index?: any): void;
139
+ private onDragStartWithGroups;
124
140
  selectFirstItem(): void;
125
141
  nextOption(selectedItem: ListItem): void;
142
+ private nextOptionWithGroups;
126
143
  previousOption(selectedItem: ListItem): void;
144
+ private previousOptionWithGroups;
127
145
  private keyDownHandler;
128
146
  getDivGroupId(groupName: String): string;
129
147
  getGroupOverlayId(groupName: string): string;
@@ -134,5 +152,8 @@ export declare class EzList {
134
152
  hideOverlays(): void;
135
153
  getContainerItemBuilder(slotPosition: 'left' | 'right', item: ListItem, group?: ListGroup, className?: string): HTMLElement;
136
154
  doubleClickItem(item: ListItem): void;
155
+ private buildItem;
156
+ private renderListWithGroups;
157
+ private renderList;
137
158
  render(): any;
138
159
  }
@@ -0,0 +1,20 @@
1
+ import { ListItem, ListItemGroup } from './ez-list';
2
+ /**
3
+ * O dragElement é posicionado ANTERIORMENTE ao targetIndex.
4
+ * Ex: no array: ["A", "B", "C", "D", "E"]
5
+ * se o dragItem for "B" e o targetIndex 3 (referente à "D"),
6
+ * "B" será posicionado logo antes de "D".
7
+ * O resultado será: ["A", "C", "B", "D", "E"]
8
+ *
9
+ * @param configs
10
+ */
11
+ export declare function processListOnDrop(configs: DragHandlerConfig): ListItem[];
12
+ export declare function isContinuousSequence(numbers: number[]): boolean;
13
+ export interface DragHandlerConfig {
14
+ listItems: ListItem[];
15
+ dragItem: ListItemGroup;
16
+ enableMultipleSelection: boolean;
17
+ targetIndex: number;
18
+ moveToFinal: boolean;
19
+ clearSelection: Function;
20
+ }
@@ -7,7 +7,7 @@ export declare class EzPopup {
7
7
  /**
8
8
  * Define a largura do ez-popup.
9
9
  */
10
- size: "x-small" | "small" | "medium" | "large" | "x-large";
10
+ size: "x-small" | "small" | "medium" | "large" | "x-large" | "auto";
11
11
  /**
12
12
  * Define se o ez-popover está aberto.
13
13
  */
@@ -7,6 +7,10 @@ export declare class SplitPanel {
7
7
  * Responsável por definir o painel que limita o tamanho do item expandido.
8
8
  */
9
9
  anchorToExpand: boolean;
10
+ /**
11
+ * Define se o painel está sendo utilizado como estrutura para apresentação de outro item
12
+ */
13
+ structural: boolean;
10
14
  _element: HTMLElement;
11
15
  _items: HTMLEzSplitItemElement[];
12
16
  _panelID: string;
@@ -29,5 +33,8 @@ export declare class SplitPanel {
29
33
  };
30
34
  calcFreeSpacePercentage(): number;
31
35
  getGridTemplate(): string;
36
+ removeGuttersMargin(): void;
37
+ removeGuttersMarginColumn(): void;
38
+ removeGuttersMarginRow(): void;
32
39
  render(): any;
33
40
  }
@@ -21,6 +21,10 @@ export declare class SplitItem {
21
21
  * @values '%', 'fr'
22
22
  */
23
23
  size?: string;
24
+ /**
25
+ * Define se o painel está sendo utilizado como estrutura para apresentação de outro item
26
+ */
27
+ structural: boolean;
24
28
  /**
25
29
  * Referência ao elemento que contém o slot.
26
30
  **/