@sankhyalabs/ezui 5.22.0-dev.72 → 5.22.0-dev.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown_2.cjs.entry.js +2 -2
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +61 -34
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-a7b0c73d.js → index-9e5554cb.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +11 -6
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +44 -26
- package/dist/collection/components/ez-grid/ez-grid.js +43 -21
- package/dist/collection/components/ez-skeleton/ez-skeleton.css +54 -34
- package/dist/custom-elements/index.js +62 -35
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item_2.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-custom-form-input_2.entry.js +2 -2
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-dropdown_2.entry.js +2 -2
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +61 -34
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-baa5e267.js → index-5a720e56.js} +3 -1
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-44caad9a.entry.js → p-0378416a.entry.js} +1 -1
- package/dist/ezui/{p-65f471bc.entry.js → p-03b0ed5a.entry.js} +1 -1
- package/dist/ezui/{p-5b205c80.entry.js → p-044d46d5.entry.js} +1 -1
- package/dist/ezui/{p-77a4bd35.entry.js → p-11bfeca3.entry.js} +1 -1
- package/dist/ezui/{p-d0ca26fe.entry.js → p-16e21a40.entry.js} +1 -1
- package/dist/ezui/{p-b6a4e6de.entry.js → p-18a2a28a.entry.js} +1 -1
- package/dist/ezui/{p-8888d9ed.entry.js → p-1b08bf3c.entry.js} +1 -1
- package/dist/ezui/{p-7e677b7b.entry.js → p-2069c78a.entry.js} +1 -1
- package/dist/ezui/{p-17eabf46.entry.js → p-24b42f3d.entry.js} +1 -1
- package/dist/ezui/{p-7409eeaa.entry.js → p-2f53435e.entry.js} +1 -1
- package/dist/ezui/{p-181b5ae8.entry.js → p-319d36b7.entry.js} +1 -1
- package/dist/ezui/{p-e3e3fd7a.entry.js → p-35d0b2fb.entry.js} +1 -1
- package/dist/ezui/{p-7ed30844.entry.js → p-397e3026.entry.js} +1 -1
- package/dist/ezui/p-3af64edd.entry.js +1 -0
- package/dist/ezui/{p-fa6732f2.entry.js → p-44b39e81.entry.js} +1 -1
- package/dist/ezui/{p-6d79930d.entry.js → p-554522db.entry.js} +1 -1
- package/dist/ezui/{p-16e612fc.entry.js → p-5548c9ab.entry.js} +1 -1
- package/dist/ezui/{p-3f2dd525.entry.js → p-5d01d189.entry.js} +1 -1
- package/dist/ezui/{p-66924de6.entry.js → p-5d2124a8.entry.js} +1 -1
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/{p-fec696ab.entry.js → p-6bda82d1.entry.js} +1 -1
- package/dist/ezui/{p-2bb2a0c4.entry.js → p-6d31c43c.entry.js} +1 -1
- package/dist/ezui/{p-6cdd3e0a.entry.js → p-6d8b3298.entry.js} +1 -1
- package/dist/ezui/p-6ec40dec.entry.js +1 -0
- package/dist/ezui/{p-5ed81457.entry.js → p-6fc26622.entry.js} +1 -1
- package/dist/ezui/{p-555c9018.entry.js → p-7567ccdd.entry.js} +1 -1
- package/dist/ezui/{p-2475fd6e.entry.js → p-7d3c9486.entry.js} +1 -1
- package/dist/ezui/{p-1e7a8633.entry.js → p-81461d2f.entry.js} +1 -1
- package/dist/ezui/{p-8df1ca33.entry.js → p-82fa4b09.entry.js} +1 -1
- package/dist/ezui/{p-09de35a2.entry.js → p-91ccae0c.entry.js} +1 -1
- package/dist/ezui/{p-c0d9c4f8.entry.js → p-92748142.entry.js} +1 -1
- package/dist/ezui/{p-990b4318.entry.js → p-a921e3e7.entry.js} +1 -1
- package/dist/ezui/{p-50d83a46.entry.js → p-aa543378.entry.js} +1 -1
- package/dist/ezui/{p-654b3f99.entry.js → p-aee8d615.entry.js} +1 -1
- package/dist/ezui/{p-17be134a.entry.js → p-b2f6bc0a.entry.js} +1 -1
- package/dist/ezui/{p-a6fe527a.entry.js → p-b6241ea3.entry.js} +1 -1
- package/dist/ezui/{p-c3045972.entry.js → p-b858fc6e.entry.js} +1 -1
- package/dist/ezui/{p-e347df9c.entry.js → p-bef7daac.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-14b769d7.entry.js → p-c7d1333c.entry.js} +1 -1
- package/dist/ezui/p-ca8936df.entry.js +1 -0
- package/dist/ezui/{p-d520839d.entry.js → p-cce6c015.entry.js} +1 -1
- package/dist/ezui/{p-6f22a385.entry.js → p-def75121.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/{p-a62caecc.entry.js → p-e0decc2b.entry.js} +2 -2
- package/dist/ezui/{p-7fdd479f.entry.js → p-e18d9e6a.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-0306dff7.entry.js → p-e6b38ade.entry.js} +1 -1
- package/dist/ezui/{p-ca6340a9.entry.js → p-ec5f987d.entry.js} +1 -1
- package/dist/ezui/{p-3175fe8c.entry.js → p-efbe0b73.entry.js} +1 -1
- package/dist/ezui/{p-650e4b6d.entry.js → p-f1c2c19e.entry.js} +1 -1
- package/dist/ezui/{p-35d467a8.entry.js → p-fad4f1dd.entry.js} +1 -1
- package/dist/ezui/{p-6e429cff.entry.js → p-fc194825.entry.js} +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +8 -1
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +11 -7
- package/dist/types/components.d.ts +12 -4
- package/package.json +1 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-c4320a39.entry.js +0 -1
- package/dist/ezui/p-dc8b36c3.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as o,r as e,c as r,H as n,g as i}from"./p-e4c7eb39.js";import{ElementIDUtils as t,ObjectUtils as d}from"@sankhyalabs/core";const l=({item:e,hasIcon:r,hasChildren:n,isLockedLevels:i,onSubActionClick:t})=>o("div",{class:"ez-dropdown__item-wrapper",title:e.label},a(e,r),o("span",{class:"ez-dropdown__item-label"},e.label),s(e,n,i,t)),a=(e,r)=>{if(null!=e&&r)return o("ez-icon",e.iconName?Object.assign({class:"ez-dropdown__icon-left",iconName:e.iconName,size:"medium"},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${e.id}_ezDropdownItemIcon`}):{class:"ez-dropdown__icon-left ez-dropdown__hidden",size:"medium"})},s=(e,r,n,i)=>{var d,l;if(null!=e){if(!(null===(d=e.children)||void 0===d?void 0:d.length)&&null!=e.subAction&&Object.keys(e.subAction).length>0)return o("span",Object.assign({onClick:()=>i(e),title:e.subAction.label,class:`ez-dropdown__link ez-dropdown__link--${e.subAction.type||"primary"}`},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${e.subAction.id}_ezDropdownItemSubAction`}),e.subAction.label);if(!n&&r)return(null===(l=e.children)||void 0===l?void 0:l.length)>0?o("ez-icon",Object.assign({class:"ez-dropdown__icon-right",iconName:"chevron-right",size:"medium"},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${e.id}_ezDropdownIconOpenChildren`})):o("ez-icon",{class:"ez-dropdown__icon-right ez-dropdown__hidden",size:"medium"})}};class p{constructor(){}show(o){const e=null==o?void 0:o.querySelector(".ez-dropdown__submenu");null!=o&&null!=e&&(e.classList.remove("ez-dropdown__submenu--hide"),this.setPosition(o),this.setScrollContainer(o),this.setMaxHeight(e))}hide(o){if(null==o)return;const e=o.querySelector(".ez-dropdown__submenu:not(.ez-dropdown__submenu--hide)");this.reset(e),this.hideChild(e)}hideChild(o){null!=o&&o.querySelectorAll(".ez-dropdown__submenu").forEach((o=>{this.reset(o)}))}setPosition(o){const e=null==o?void 0:o.querySelector(".ez-dropdown__submenu"),r=null==o?void 0:o.closest(".ez-dropdown");if(null==e||null==r)return;e.style.top=this.getPositionTop(o),e.style.left=this.getPositionRight(r);const n=null==e?void 0:e.getBoundingClientRect(),i=document.body.clientWidth;(null==n?void 0:n.right)>i&&this.updatePosition(r,e)}setMaxHeight(o){var e;const r=(null==o?void 0:o.shadowRoot)||o,n=null==r?void 0:r.querySelector(".ez-dropdown"),i=document.body.clientHeight;let t,d;if(null!=(null==r?void 0:r.tagName)?(t=r,d=null==t?void 0:t.getBoundingClientRect()):d=null==n?void 0:n.getBoundingClientRect(),null!=n&&null!=d){if(d.y+d.height>i)if(null!=t){const o=t.closest(".ez-dropdown"),r=null==o?void 0:o.getBoundingClientRect(),l=parseFloat((null===(e=getComputedStyle(t))||void 0===e?void 0:e.marginTop)||"0");if(null==o||null==r)return;r.y+d.height>i?(t.style.top=r.y-l+"px",n.style.maxHeight=i-r.y+"px"):t.style.top=i-d.height-l+"px"}else{let o=i-d.y;o<0&&(o=d.height-i),n.style.maxHeight=o+"px"}this.setSpacerContainer(n)}}setSpacerContainer(o){const e=null==o?void 0:o.querySelector(".ez-dropdown__container");null!=e&&(e.scrollHeight>e.clientHeight?e.classList.add("ez-dropdown__container--spacer"):e.classList.remove("ez-dropdown__container--spacer"))}reset(o){if(null==o)return;o.classList.add("ez-dropdown__submenu--hide"),o.style.left="",o.style.top="";const e=o.querySelector(".ez-dropdown");this.resetDropdown(e)}resetDropdown(o){null!=o&&(o.style.maxHeight="",this.setSpacerContainer(o))}setScrollContainer(o){const e=null==o?void 0:o.closest(".ez-dropdown__container");null!=e&&(e.onscroll=this.onScrollContainer.bind(this))}onScrollContainer(o){this.hideChild(null==o?void 0:o.target)}getPositionTop(o){const e=null==o?void 0:o.getBoundingClientRect();if(null!=e)return e.y+"px"}getPositionRight(o){const e=null==o?void 0:o.getBoundingClientRect();if(null!=e)return e.x+e.width+"px"}getPositionLeft(o,e){const r=null==o?void 0:o.getBoundingClientRect(),n=null==e?void 0:e.getBoundingClientRect();if(null!=r&&null!=n)return r.x-n.width+"px"}updatePosition(o,e){const r=null==o?void 0:o.getBoundingClientRect(),n=null==e?void 0:e.getBoundingClientRect();null!=r&&null!=n&&r.x<n.right&&(e.style.left=this.getPositionLeft(o,e),this.updatePosition(o,e))}}const c=class{constructor(o){e(this,o),this.ezClick=r(this,"ezClick",7),this.ezSubActionClick=r(this,"ezSubActionClick",7),this.ezOutsideClick=r(this,"ezOutsideClick",7),this.ezHover=r(this,"ezHover",7),this._itemList={},this._submenuList=[],this._openedMenuList={},this._levelLimits=3,this.items=[],this.value=void 0,this.itemBuilder=void 0}handleClickOutside(o){this._element.contains(o.target)||this.ezOutsideClick.emit()}defaultItemBuilder(e,r,n,i){return o(l,{item:e,hasIcon:n,hasChildren:i,isLockedLevels:r,onSubActionClick:this.onSubActionClick.bind(this)})}getMaxOrder(o){return null==o||0===o.length?-1:Math.max(...o.map((o=>{var e;const r=null===(e=o.group)||void 0===e?void 0:e.order;return null!=r&&r>=0?r:-1})))}hasIcon(o){return null==o?void 0:o.some((o=>""!==(o.iconName||"")))}hasGroup(o){return null==o?void 0:o.some((o=>""!==(o.group||"")))}hasChildren(o){return null==o?void 0:o.some((o=>(o.children||[]).length>0))}isLockedLevels(o){return!!this._levelLimits&&o===this._levelLimits+1}getItemsByGroup(o,e){let r={};const n=this.getMaxOrder(o);return o.forEach((o=>{const i=o.group&&null!=o.group.label?o.group.label||"noGroup":o.group||"noGroup";let t=r[i];null==t&&(t={items:[],order:o.group&&null!=o.group.order?o.group.order:o.group?n+1:n+2}),this.validateItem(o,e),t.items.push(o),r[i]=t})),d.sortByProperty(r,"order")}validateItem(o,e){if(null==this._itemList&&(this._itemList={}),null==o.type&&(o.type="item"),null==o.id){const r=`level_${e}_${o.type}`,n=Object.keys(this._itemList).filter((o=>o.includes(r))).length;o.id=`${r}_${n+1}`}null==o.label&&(o.label=""),null!=o.subAction&&(null==o.subAction.id&&(o.subAction.id=`subAction_${o.id}`),null==o.subAction.label&&(o.subAction.label="")),null==this._itemList[o.id]&&(this._itemList[o.id]={})}getContainerItemBuilder(e,r,n,i,t){if(null==this.itemBuilder)return;const d=this.itemBuilder(e,r);return null==d?this.defaultItemBuilder(e,n,i,t):"string"!=typeof d?o("div",{class:"ez-dropdown__item-builder"},d):o("div",{class:"ez-dropdown__item-builder",innerHTML:d})}getItemsRender(e,r,n,i){if(null==e)return;let d=r,l=!1;return i&&(d++,l=this.isLockedLevels(d)),e.map((e=>{var a;switch(e.type){case"loading":return o("div",{class:"ez-dropdown__item"},o("ez-skeleton",{width:"200px"}));case"divider":return o("hr",Object.assign({class:"ez-dropdown__divider"},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:t.getInternalIDInfo(`${e.id}_ezDropdownDivider`)}));case"item":return o("div",Object.assign({ref:o=>this._itemList[e.id]=o,class:"ez-dropdown__item","data-level":r},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:t.getInternalIDInfo(`${e.id}_ezDropdownItem`)}),o("div",{class:"ez-dropdown__item-content",onClick:o=>this.onItemClick(o,e),onMouseOver:o=>this.onShowSubmenu(o,e),onMouseEnter:()=>this.ezHover.emit(e)},this.itemBuilder?this.getContainerItemBuilder(e,r,l,n,i):this.defaultItemBuilder(e,l,n,i)),(null===(a=e.children)||void 0===a?void 0:a.length)>0&&!l&&i&&o("div",{ref:o=>this._submenuList.push(o),class:"ez-dropdown__submenu ez-dropdown__submenu--hide"},this.renderDropdown(e.children,d)))}}))}renderDropdown(e=this.items,r=1){if(null==e||this.isLockedLevels(r))return;const n=this.getItemsByGroup(e,r),i=this.hasGroup(e),d=this.hasIcon(e),l=this.hasChildren(e);return o("div",{class:"ez-dropdown ez-dropdown__max-height","data-level":r},o("div",{class:"ez-dropdown__container"},Object.keys(n).map((e=>o("div",Object.assign({class:"ez-dropdown__group"},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:t.getInternalIDInfo(`${e}_ezDropdownGroup`)}),"noGroup"!==e&&o("label",{class:"ez-dropdown__group-label",title:e},e),i&&"noGroup"===e&&o("hr",Object.assign({class:"ez-dropdown__divider"},{[t.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:t.getInternalIDInfo(`${e}_ezDropdownDivider`)})),this.getItemsRender(n[e].items,r,d,l))))))}hasOpenedSubmenu(o){const e=Object.keys(this._openedMenuList);return e.includes(o.toString())||e.some((e=>Number(e)>o))}hasSubmenuOpened(){var o;return null===(o=this._submenuList)||void 0===o?void 0:o.some((o=>!o.classList.contains("ez-dropdown__submenu--hide")))}setEvents(){document.removeEventListener("click",this.onHideAllSubmenu.bind(this)),document.addEventListener("click",this.onHideAllSubmenu.bind(this)),document.removeEventListener("scroll",this.onSubmenuReposition.bind(this)),document.addEventListener("scroll",this.onSubmenuReposition.bind(this))}onShowSubmenu(o,e){var r;if(null==o)return;const n=this._itemList[e.id];if(!(null==n?void 0:n.classList.contains("ez-dropdown__item")))return;const i=Number(n.dataset.level||"0");this.hasOpenedSubmenu(i)&&(this._submenuControl.hide(this._openedMenuList[i]),delete this._openedMenuList[i]),(null===(r=e.children)||void 0===r?void 0:r.length)&&(this._openedMenuList[n.dataset.level]=n,this._submenuControl.show(n))}onItemClick(o,e){const r=null==o?void 0:o.target;(null==r?void 0:r.classList.contains("ez-dropdown__link"))||(this.value=e,this.ezClick.emit(e))}onSubActionClick(o){this.ezSubActionClick.emit(o.subAction)}onHideAllSubmenu(o){const e=null==o?void 0:o.target;this.hasSubmenuOpened()&&(null==e||!e.closest(".ez-dropdown")&&"EZ-DROPDOWN"!==e.tagName)&&(this._openedMenuList={},this._submenuList.forEach(this._submenuControl.reset.bind(this._submenuControl)))}onSubmenuReposition(){null!=this._openedMenuList&&Object.keys(this._openedMenuList).forEach((o=>{this._submenuControl.setPosition(this._openedMenuList[o])}))}componentDidLoad(){t.addIDInfo(this._element),this._submenuControl=new p,this._submenuControl.setMaxHeight(this._element)}componentDidUpdate(){this._submenuControl.setMaxHeight(this._element)}componentDidRender(){this.setEvents()}render(){return o(n,null,this.renderDropdown())}get _element(){return i(this)}};c.style=":host{--ez-dropdown--z-index:var(--more-visible, 2);--ez-dropdown--padding:var(--space--small, 6px);--ez-dropdown--box-shadow:var(--shadow--medium, 0px 8px 24px rgba(0, 38, 111, 0.1));--ez-dropdown--border-radius:var(--border--radius-medium, 12px);--ez-dropdown--background-color:var(--background--xlight, #fff);--ez-dropdown--font-family:var(--font-pattern, 'Roboto');--ez-dropdown--max-height:415px;--ez-dropdown__item--padding:var(--space--small, 6px);--ez-dropdown__item--gap:var(--space--small, 6px);--ez-dropdown__item--border-radius:var(--border--radius-small, 6px);--ez-dropdown__item--color:var(--title--primary, #2b3a54);--ez-dropdown__item--font-weight:var(--text-weight--medium, 400);--ez-dropdown__item--font-size:var(--text--medium, 14px);--ez-dropdown__item--line-height:calc(var(--ez-dropdown__item--font-size) + 4px);--ez-dropdown__item--background-color:var(--background--medium, #f0f3f7);--ez-dropdown__item--transition:var(--transition, .2s linear);--ez-dropdown__item-label--margin-right:var(--space--medium, 12px);--ez-dropdown__icon--size:var(--icon--medium, 18px);--ez-dropdown__divider--background-color:var(--color--disable-secondary, #f2f5f8);--ez-dropdown__divider--margin:var(--space--extra-small, 3px) 0;--ez-dropdown__group-label--color:var(--text--secondary, #A2ABB9);--ez-dropdown__group-label--font-weight:var(--text-weight--large, 600);--ez-dropdown__group-label--font-size:var(--text--small, 12px);--ez-dropdown__group-label--line-height:var(--text--medium, 14px);--ez-dropdown__group-label--padding:var(--space--small, 6px);--ez-dropdown__submenu--z-index:var(--most-visible, 3);--ez-dropdown__link--font-weight:var(--text-weight--large, 600);--ez-dropdown__link--primary--color:var(--color--primary, #008561);--ez-dropdown__link--critical--color:var(--color-alert--error-800, #BD0025);--ez-dropdown__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-dropdown__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-dropdown__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-dropdown__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-dropdown__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-dropdown__scrollbar--width:var(--space--small, 6px);--ez-dropdown__scrollbar--padding-right:var(--space--extra-small, 3px);display:flex;flex-direction:column;height:fit-content;user-select:none;box-sizing:border-box;position:fixed;z-index:var(--ez-dropdown--z-index)}:host *{box-sizing:border-box}.ez-dropdown{display:flex;padding:var(--ez-dropdown--padding);box-shadow:var(--ez-dropdown--box-shadow);border-radius:var(--ez-dropdown--border-radius);background-color:var(--ez-dropdown--background-color);max-width:var(--ez-dropdown--max-width)}.ez-dropdown__max-height{max-height:var(--ez-dropdown--max-height)}.ez-dropdown *{font-family:var(--ez-dropdown--font-family)}.ez-dropdown__container{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;flex:auto;scrollbar-color:var(--ez-dropdown__scrollbar--color-clicked) var(--ez-dropdown__scrollbar--color-background)}.ez-dropdown__container::-webkit-scrollbar{background-color:var(--ez-dropdown__scrollbar--color-background);width:var(--ez-dropdown__scrollbar--width);max-width:var(--ez-dropdown__scrollbar--width);min-width:var(--ez-dropdown__scrollbar--width)}.ez-dropdown__container::-webkit-scrollbar-track{background-color:var(--ez-dropdown__scrollbar--color-background);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb{background-color:var(--ez-dropdown__scrollbar--color-default);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:hover,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-dropdown__scrollbar--color-hover)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:active,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-dropdown__scrollbar--color-clicked)}.ez-dropdown__container--spacer{padding-right:var(--ez-dropdown__scrollbar--padding-right)}.ez-dropdown__item{display:flex;align-items:center;background-color:transparent;border-radius:var(--ez-dropdown__item--border-radius);transition:var(--ez-dropdown__item--transition)}.ez-dropdown__item:hover{background-color:var(--ez-dropdown__item--background-color)}.ez-dropdown__item-wrapper{display:flex;align-items:center;position:relative;cursor:pointer;width:100%;margin:0;white-space:nowrap;gap:var(--ez-dropdown__item--gap);color:var(--ez-dropdown__item--color);font-weight:var(--ez-dropdown__item--font-weight);font-size:var(--ez-dropdown__item--font-size);line-height:var(--ez-dropdown__item--line-height);padding:var(--ez-dropdown__item--padding)}.ez-dropdown__item-wrapper ez-icon{display:flex;justify-content:center;align-items:center;width:var(--ez-dropdown__icon--size);height:var(--ez-dropdown__icon--size);min-width:var(--ez-dropdown__icon--size);min-height:var(--ez-dropdown__icon--size)}.ez-dropdown__item-content{display:flex;align-items:center;flex:auto;overflow:hidden;gap:var(--ez-dropdown__item--gap)}.ez-dropdown__item-label{text-align:left;text-overflow:ellipsis;overflow:hidden;flex:auto}.ez-dropdown__item-label:not(:last-child){margin-right:var(--ez-dropdown__item-label--margin-right)}.ez-dropdown__item-content+.ez-dropdown__link{margin-left:var(--ez-dropdown__item-label--margin-right);margin-right:var(--ez-dropdown__item--padding)}.ez-dropdown__item-builder{flex:auto}.ez-dropdown__divider{width:100%;height:2px;border-radius:1px;border:none;display:block;background-color:var(--ez-dropdown__divider--background-color);margin:var(--ez-dropdown__divider--margin)}.ez-dropdown__hidden{visibility:hidden}.ez-dropdown__group{display:flex;flex-direction:column}.ez-dropdown__group-label{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ez-dropdown__group-label--color);font-weight:var(--ez-dropdown__group-label--font-weight);font-size:var(--ez-dropdown__group-label--font-size);line-height:var(--ez-dropdown__group-label--line-height);padding:var(--ez-dropdown__group-label--padding)}.ez-dropdown__icon-right{margin-left:auto}.ez-dropdown__submenu{position:fixed;z-index:var(--ez-dropdown__submenu--z-index);margin-top:calc(var(--ez-dropdown__item--padding) * -1)}.ez-dropdown__submenu--hide{display:none}.ez-dropdown__link{display:block;margin-left:auto;cursor:pointer;text-overflow:ellipsis;overflow:hidden;font-weight:var(--ez-dropdown__link--font-weight);max-width:calc(var(--ez-dropdown--max-width) * 0.43)}.ez-dropdown__link--primary{color:var(--ez-dropdown__link--primary--color)}.ez-dropdown__link--critical{color:var(--ez-dropdown__link--critical--color)}.ez-dropdown__link:hover{text-decoration:underline}";const u=["progress","progress-dark","pulse","false"],_=class{constructor(o){e(this,o),this.items=[],this.count=1,this.variant="text",this.width=null,this.height=null,this.marginBottom=null,this.animation="progress"}componentWillLoad(){this.init()}componentWillUpdate(){this.init()}init(){this.items.length=this.count,this.items.fill(1),u.includes(this.animation)||(this.animation="progress")}get style(){let o={width:null,height:null,marginBottom:null};return this.width&&(o.width=this.width),this.height&&(o.height=this.height),this.marginBottom&&(o.marginBottom=this.marginBottom),o}render(){return this.items.map(((e,r)=>o("span",{key:r,class:{circle:"circle"===this.variant,rect:"rect"===this.variant,progress:"progress"===this.animation,"progress-dark":"progress-dark"===this.animation,pulse:"pulse"===this.animation,skeleton:!0},"data-busy":"true","data-valuemin":"0","data-valuemax":"100","data-valuetext":"Loading...",role:"progressbar",tabindex:"0",style:this.style})))}};_.style=".skeleton {\n\tbackground: var(--skeleton-background, #eff1f6) no-repeat;\n\n\tborder-radius: var(--skeleton-border-radius, 4px);\n\twidth: var(--skeleton-width, 100%);\n\theight: var(--skeleton-height, 20px);\n\tdisplay: inline-block;\n\tmargin-bottom: var(--skeleton-margin-bottom, 0px);\t\n\tbox-sizing: border-box;\n\toutline: none;\n\toverflow: hidden;\n\tposition: relative;\n\t-webkit-will-change: transform;\n -moz-will-change: transform;\n\twill-change: transform;\n\n\t&:after,\n\t&:before {\n\t\tbox-sizing: border-box;\n\t}\n\n\t&.circle {\n\t\twidth: var(--skeleton-width, 40px);\n\t\theight: var(--skeleton-height, 40px);\n\t\tmargin-bottom: var(--skeleton-margin-bottom, 5px);\n\t\tborder-radius: var(--skeleton-border-radius, 50%);\n\t}\n\n\t&.rect {\n\t\tborder-radius: var(--skeleton-border-radius, 0px);\n\t}\n\n\t&.progress,\n\t&.progress-dark {\n\t\t-webkit-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -moz-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -ms-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tbackground-size: 200px 100%;\n\t}\n\n\t&.progress {\n\t\tbackground-image: -webkit-linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n background-image: -moz-linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n background-image: -ms-linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));\n\t}\n\n\t&.progress-dark {\n\t\tbackground-image: -webkit-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n background-image: -moz-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n background-image: -ms-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent); \n\t\tbackground-image: linear-gradient(90deg,transparent,rgba(0, 0, 0, 0.2),transparent);\n\t}\n\n\t&.pulse {\n\t\t-webkit-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -moz-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -ms-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n\t\tanimation-delay: 0.5s;\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t&.pulse,\n\t\t&.progress-dark,\n\t\t&.progress {\n\t\t\tanimation: none;\n\t\t}\n\n\t\t&.progress,\n\t\t&.progress-dark {\n\t\t\tbackground-image: none;\n\t\t}\n\t}\n}\n\n@-webkit-keyframes progress {\n 0% { background-position: -200px 0; }\n 100% { background-position: calc(200px + 100%) 0; }\n}\n@-moz-keyframes progress {\n 0% { background-position: -200px 0; }\n 100% { background-position: calc(200px + 100%) 0; }\n}\n@-ms-keyframes progress {\n 0% { background-position: -200px 0; }\n 100% { background-position: calc(200px + 100%) 0; }\n}\n@keyframes progress {\n\t0% { background-position: -200px 0; }\n\t100% { background-position: calc(200px + 100%) 0; }\n}\n\n@-webkit-keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@-moz-keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@-ms-keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.4; }\n 100% { opacity: 1; }\n}\n@keyframes pulse {\n\t0% { opacity: 1; }\n\t50% { opacity: 0.4; }\n\t100% { opacity: 1; }\n}";export{c as ez_dropdown,_ as ez_skeleton}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,f as n,H as r,g as s}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,f as n,H as r,g as s}from"./p-e4c7eb39.js";import{DateUtils as o,Action as l,StringUtils as a,DataUnit as h,ElementIDUtils as c}from"@sankhyalabs/core";import{b as u,D as d}from"./p-ceadecd9.js";import"./p-2187f86c.js";import"./p-ab574d59.js";const f=/child\[([^\]]+)\]/,p=/\$\{.+\}/;class v{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const e=f.exec(t);return e?e[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([e,i])=>{if("string"==typeof i){const t=p.exec(i);t&&(i=this.getDefaultVar(t[0]))}t[e]=i})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const m=(t,e)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(e[0].order||1e4);function b(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var y="function"==typeof Symbol&&Symbol.observable||"@@observable",w=function(){return Math.random().toString(36).substring(7).split("").join(".")},g={INIT:"@@redux/INIT"+w(),REPLACE:"@@redux/REPLACE"+w(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+w()}};function E(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function O(t,e,i){var n;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(b(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(b(1));return i(O)(t,e)}if("function"!=typeof t)throw new Error(b(2));var r=t,s=e,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function c(){if(a)throw new Error(b(3));return s}function u(t){if("function"!=typeof t)throw new Error(b(4));if(a)throw new Error(b(5));var e=!0;return h(),l.push(t),function(){if(e){if(a)throw new Error(b(6));e=!1,h();var i=l.indexOf(t);l.splice(i,1),o=null}}}function d(t){if(!E(t))throw new Error(b(7));if(void 0===t.type)throw new Error(b(8));if(a)throw new Error(b(9));try{a=!0,s=r(s,t)}finally{a=!1}for(var e=o=l,i=0;i<e.length;i++)(0,e[i])();return t}function f(t){if("function"!=typeof t)throw new Error(b(10));r=t,d({type:g.REPLACE})}function p(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(b(11));function i(){t.next&&t.next(c())}return i(),{unsubscribe:e(i)}}})[y]=function(){return this},t}return d({type:g.INIT}),(n={dispatch:d,subscribe:u,getState:c,replaceReducer:f})[y]=p,n}const C={};function j(t=C,e){switch(e.type){case F.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:e.payload,currentSheet:void 0});case F.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:e.payload});default:return t}}function _(t){return t.formMetadata}function A(t){const e=function(t){return t.currentSheet}(t);return e?t.formMetadata.getSheet(e):Array.from(t.formMetadata.getAllSheets().values())[0]}var F;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(F||(F={}));const z=class{constructor(i){t(this,i),this.ezFormRequestClearFieldToFocus=e(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=e(this,"ezFormSetFields",7),this.ezReady=e(this,"ezReady",7),this.formItemsReady=e(this,"formItemsReady",7),this._customEditors=new Map,this.onDataUnitAction=t=>{t.type===l.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1}validate(){return this._dataBinder.validate()}async addCustomEditor(t,e,i){if(this._formView)return void this._formView.addCustomEditor(t,e,i);const n=new Map(this._customEditors);n.set(t,{customEditor:e,detailContext:i}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,e,i){const n=new Map(this._fieldsProps),r=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},r),{[e]:i})),this._fieldsProps=n}getDynamicContent(){var t;const e=_(this._store.getState());if(!e)return null;const n=Array.from(e.getAllSheets().values()),r=A(null===(t=this._store)||void 0===t?void 0:t.getState());let s=[];if(n.length>1){const t=n.map(((t,e)=>({tabKey:t.name,label:t.label,index:e}))),e="selector";s.push(i("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:F.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:r.name,"data-element-id":e}))}return s=s.concat(this.buildFormContent(r)),s}buildFormContent(t){const e=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(e);const n=`${a.replaceAccentuatedChars(a.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return i("div",{class:"dynamic-content","data-element-id":n},i("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:e,selectedRecord:this.dataUnit.getSelectedRecord()}))}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,e,i=!1)=>{var n,r;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const e=t.metadata;let i;return e&&(i=e.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:i}})(e));const s=new Map,o=new Map,l=[],a=[],h={};null===(n=null==t?void 0:t.tabs)||void 0===n||n.forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),null===(r=null==t?void 0:t.fields)||void 0===r||r.forEach((t=>{var i,n,r;if(!1!==t.visible){const c=((t,e)=>("string"==typeof t?Array.from(e.keys()).find((e=>e.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",s);if(o.has(c.label))return;const d=e.getField(t.name);if(d&&(null==d.visible||!0===d.visible)&&c.visible){s.has(c)||s.set(c,[]);const e=u(d,t);s.get(c).push(e),e.required&&l.push(t.name),((null==t.cleanOnCopy?null===(i=d.properties)||void 0===i?void 0:i.cleanOnCopy:t.cleanOnCopy)||(null===(n=d.properties)||void 0===n?void 0:n.cleanOnCopy))&&a.push(t.name);let o=null==t.defaultValue?null===(r=d.properties)||void 0===r?void 0:r.defaultValue:t.defaultValue;if(o&&null!=o.value){const{type:e,value:i}=o;if(e)if("V"===e)o=i;else try{const t=JSON.parse(i);o=t&&"value"in t?t:i}catch(t){}h[t.name]=o}}}}));const c=new v;if(c.setDefaultVars(t.defaultVars),i){const t=e.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:e,name:i,fields:n}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);s.set({name:i,label:e},n)}))}return Array.from(s.entries()).sort(m).forEach((([t,e])=>{c.addSheet({label:"__main"===t.label?"Principal":t.label,name:t.name||t.label,fields:e})})),c.addRequiredFields(l),c.addCleanOnCopyFields(a),c.addDefaultValues(h),c})(this.config,this.dataUnit);this._store.dispatch({type:F.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new h("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new d(this.dataUnit),this._store=O(j),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),c.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){const t=_(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,e]of this._customEditors)this._formView.addCustomEditor(t,e.customEditor,e.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const e=A(null===(t=this._store)||void 0===t?void 0:t.getState());(null==e?void 0:e.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit()}))}setFieldsProps(){if(this._formView)for(const[t,e]of this._fieldsProps){for(const i in e)this._formView.setFieldProp(t,i,e[i]);this._fieldsProps.delete(t)}}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback()}buildIdTabSelector(t){return t&&t.forEach((t=>t[c.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=a.toCamelCase(t.label))),t}render(){return i(r,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return s(this)}static get watchers(){return{config:["observeConfig"]}}};z.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{z as ez_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as a}from"./p-e4c7eb39.js";import{DateUtils as n,ElementIDUtils as h}from"@sankhyalabs/core";import{C as r}from"./p-9e11fc7b.js";const o=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mode="regular",this.canShowError=!0,this.autoFocus=!1,this.noMargin=!1}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i){const e=n.validateDate(t),s=n.validateDate(i);if((null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())){const t=this.getTextValue(e)||"";!n.strToDate(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===e?void 0:e)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}changeValue(t){const i=n.validateDate(this.value),e=n.validateDate(t);(null==i?void 0:i.getTime())!==(null==e?void 0:e.getTime())?this.value=e:this._changePending=!1}showCalendar(){let t;this.handleBlur(),this._calendar.value=this.value,this.isFixed()?(t=29,this._calendar.fitHorizontal(0)):t=this.errorMessage||"slim"===this.mode?6:-13,this._calendar.fitVertical(t,this._elem.clientHeight)}hideCalendar(){this.changeValue(this._calendar.value),this._calendar.hide()}handleBlur(){if(this._changePending)try{const t=this._textInput.value,i=n.strToDate(t);if(i||!t){this.errorMessage="";const t=n.validateDate(this.value),e=n.validateDate(i);(null==t?void 0:t.getTime())===(null==e?void 0:e.getTime())?(e&&(this._textInput.value=this.getTextValue(e)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):(this._focused=!1,this.changeValue(e))}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage="O valor digitado não é uma data válida"}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){return t?n.formatDate(t):void 0}handleInput(t){const i=n.strToDate(this._textInput.value),e=n.validateDate(this.value),s=n.validateDate(i);(null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"!==t.data&&"h"!==t.data||this.changeValue(new Date)}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}isFixed(){return"true"===this._elem.dataset.isFixed}componentDidLoad(){r.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),e(s,null,e("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),restrict:"0123456789/",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError,noMargin:this.noMargin},e("button",{disabled:!this.enabled,tabindex:-1,class:"btn-open-cal",onClick:()=>this.showCalendar(),slot:"leftIcon"})),e("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},floating:!0,"data-is-fixed":this._elem.dataset.isFixed}))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};o.style=':host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}';export{o as ez_date_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as o,h as i,H as e,g as s}from"./p-
|
|
1
|
+
import{r as t,c as o,h as i,H as e,g as s}from"./p-e4c7eb39.js";import{FloatingManager as r}from"@sankhyalabs/core";const n=class{constructor(i){t(this,i),this.ezVisibilityChange=o(this,"ezVisibilityChange",7),this._firstRender=!0,this.innerClickTest=(t,o,i)=>{const e=[t];this.innerElement&&("string"==typeof this.innerElement?e.push(document.querySelector(`#${this.innerElement}`)):this.innerElement.forEach((t=>{e.push(document.querySelector(`#${t}`))})));const s=(null==i?void 0:i.composedPath())||[];for(var r=0;r<e.length;r++){let t=e[r];if(null!=t){if(s.includes(t))return!0;if(t.contains(o))return!0;if(i&&"nodeType"in(null==i?void 0:i.target)&&t.contains(i.target))return!0;if(t.shadowRoot&&t.shadowRoot.contains(o))return!0;if(t=this._host,t.lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(o):t.contains(o))return!0}}return!1},this.backClickListener=()=>{this.ezVisibilityChange.emit(!1)},this.autoClose=!0,this.boxWidth="fit-content",this.opened=void 0,this.innerElement=void 0,this.overlayType="light"}observeOpened(t,o){t!=o&&(o?this.hide():this.show(),this.ezVisibilityChange.emit(t))}async updatePosition(t,o){r.updateFloatPosition(this._box,this._container,{autoClose:this.autoClose,top:t,left:o,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener})}async show(t,o){this.float({top:t,left:o})}async showUnder(t,o){t&&this._host?this.float(this.calculatePosition(t,Object.assign({verticalGap:0,horizontalGap:0,fromRight:!1},o))):this.show((null==o?void 0:o.verticalGap)?`${o.verticalGap}px`:void 0,(null==o?void 0:o.horizontalGap)?`${o.horizontalGap}px`:void 0)}calculatePosition(t,o){const i=this._host.getBoundingClientRect(),e=t.getBoundingClientRect(),s=`${(o.fromRight?i.right-e.right:e.x-i.x)+o.horizontalGap}px`;return{top:`${e.bottom-i.y+o.verticalGap}px`,left:o.fromRight?"":s,right:o.fromRight?s:""}}float(t){this._box.style.top="",this._box.style.left="",this._box.style.right="";const o="none"!==this.overlayType,i=`ez-scrim ez-scrim--${this.overlayType}`;let e=Object.assign(Object.assign({},t),{autoClose:this.autoClose,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener});o&&(e=Object.assign(Object.assign({},e),{autoClose:!0,useOverlay:o,overlayClassName:i})),this._floatingID=r.float(this._box,this._container,e),this.opened=!0}async hide(){void 0!==this._floatingID&&(r.close(this._floatingID),this._floatingID=void 0,this.opened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return i(e,null,i("section",{ref:t=>this._container=t},i("div",{class:"popover__box "+("fit-content"===this.boxWidth?"popover__box--fit-content":"popover__box--full-width"),ref:t=>this._box=t},i("slot",null))))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};n.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--most-visible, 3);position:relative;display:flex;user-select:none}.popover__box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";export{n as ez_popover}
|