@sankhyalabs/ezui 7.1.0-dev.10 → 7.1.0-dev.11
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-avatar.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.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-classic-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +2 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- 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.cjs.entry.js +1 -1
- package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
- 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 +2 -2
- package/dist/cjs/ez-grid-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +2 -2
- 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-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list-item.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 +16 -8
- 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-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-plus_3.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-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-plus.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-result-list.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-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-spinner.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-tag-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tag.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-tile-medium.cjs.entry.js +1 -1
- package/dist/cjs/ez-tile.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-underface.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/cjs/{search-column-8bfee733.js → search-column-540f3925.js} +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +1 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +32 -6
- package/dist/custom-elements/index.js +16 -8
- 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-avatar.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.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-classic-combo-box.entry.js +1 -1
- package/dist/esm/ez-classic-input.entry.js +1 -1
- package/dist/esm/ez-classic-text-area.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_4.entry.js +2 -2
- package/dist/esm/ez-combo-box.entry.js +1 -1
- 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.entry.js +1 -1
- package/dist/esm/ez-empty-card.entry.js +1 -1
- 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 +2 -2
- package/dist/esm/ez-grid-view.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +2 -2
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list-item.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 +16 -8
- 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-pagination.entry.js +1 -1
- package/dist/esm/ez-popover-core.entry.js +1 -1
- package/dist/esm/ez-popover-plus_3.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-progress-bar.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-rich-toolbar-item.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search-plus.entry.js +1 -1
- package/dist/esm/ez-search-result-list.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-skeleton.entry.js +1 -1
- package/dist/esm/ez-sortable-list.entry.js +1 -1
- package/dist/esm/ez-spinner.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-tag-input.entry.js +1 -1
- package/dist/esm/ez-tag.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-tile-medium.entry.js +1 -1
- package/dist/esm/ez-tile.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-underface.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/esm/{search-column-c00119ae.js → search-column-4e827a95.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e75c7a23.entry.js → p-000159dc.entry.js} +1 -1
- package/dist/ezui/{p-7f8c1fce.entry.js → p-0391f255.entry.js} +1 -1
- package/dist/ezui/{p-93e1c917.entry.js → p-05e68ab3.entry.js} +1 -1
- package/dist/ezui/{p-1730ee24.entry.js → p-06ca9d9a.entry.js} +1 -1
- package/dist/ezui/{p-288631d1.entry.js → p-06f1b8e4.entry.js} +1 -1
- package/dist/ezui/{p-6d596a5a.entry.js → p-0b531233.entry.js} +1 -1
- package/dist/ezui/{p-5ab08b60.entry.js → p-129fea99.entry.js} +1 -1
- package/dist/ezui/{p-1bfef8e5.entry.js → p-13949839.entry.js} +1 -1
- package/dist/ezui/p-14d6aeb8.entry.js +1 -0
- package/dist/ezui/{p-2528e988.entry.js → p-169d460d.entry.js} +1 -1
- package/dist/ezui/{p-6f77a359.entry.js → p-1723f728.entry.js} +1 -1
- package/dist/ezui/{p-0c0eb410.entry.js → p-1d846a77.entry.js} +1 -1
- package/dist/ezui/{p-8bb3aeb0.entry.js → p-1d8ea7d2.entry.js} +1 -1
- package/dist/ezui/{p-ff4bde07.entry.js → p-231cf227.entry.js} +1 -1
- package/dist/ezui/{p-1266fe78.entry.js → p-26077a43.entry.js} +1 -1
- package/dist/ezui/{p-3fe05d6b.entry.js → p-2d803ee6.entry.js} +1 -1
- package/dist/ezui/{p-6f119d5f.entry.js → p-30513f10.entry.js} +1 -1
- package/dist/ezui/{p-2a70f094.entry.js → p-3136f418.entry.js} +1 -1
- package/dist/ezui/{p-ef8bd3e8.entry.js → p-35e3715c.entry.js} +1 -1
- package/dist/ezui/{p-1adf7139.entry.js → p-3b5bafe4.entry.js} +1 -1
- package/dist/ezui/p-3be7d8d8.entry.js +1 -0
- package/dist/ezui/{p-4f0632b4.js → p-4296e9f9.js} +1 -1
- package/dist/ezui/{p-a7eab406.entry.js → p-43106b79.entry.js} +1 -1
- package/dist/ezui/{p-fa6732f2.entry.js → p-44b39e81.entry.js} +1 -1
- package/dist/ezui/{p-e46a4d06.entry.js → p-4815ddbf.entry.js} +1 -1
- package/dist/ezui/{p-d0e6911e.entry.js → p-4a530109.entry.js} +1 -1
- package/dist/ezui/{p-4d30b703.entry.js → p-4a876b8b.entry.js} +1 -1
- package/dist/ezui/{p-1cde96f9.entry.js → p-4cc79a52.entry.js} +1 -1
- package/dist/ezui/{p-e882635e.entry.js → p-4dc07e01.entry.js} +1 -1
- package/dist/ezui/{p-6369a0cd.entry.js → p-51e34317.entry.js} +1 -1
- package/dist/ezui/{p-eee3c7ff.entry.js → p-53412766.entry.js} +1 -1
- package/dist/ezui/{p-8dc267ff.entry.js → p-53e773a4.entry.js} +1 -1
- package/dist/ezui/{p-48effc69.entry.js → p-570cf58a.entry.js} +1 -1
- package/dist/ezui/p-580f5fb8.entry.js +1 -0
- package/dist/ezui/{p-0b333f09.entry.js → p-5d1adf13.entry.js} +1 -1
- package/dist/ezui/{p-dee18824.entry.js → p-5f4a66ec.entry.js} +1 -1
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.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-e27d7dc2.entry.js → p-74f08ec9.entry.js} +1 -1
- package/dist/ezui/{p-d6f50207.entry.js → p-770cf2b8.entry.js} +1 -1
- package/dist/ezui/{p-124699e0.entry.js → p-77e738d5.entry.js} +1 -1
- package/dist/ezui/{p-91c9d50e.entry.js → p-78e975b4.entry.js} +1 -1
- package/dist/ezui/{p-59a98e31.entry.js → p-78f18973.entry.js} +1 -1
- package/dist/ezui/{p-957d08cd.entry.js → p-7fdf1f2b.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-59092a66.entry.js → p-8aa7d60b.entry.js} +1 -1
- package/dist/ezui/{p-a3075f52.entry.js → p-9bcfa689.entry.js} +1 -1
- package/dist/ezui/{p-ba7e908a.entry.js → p-a48979a8.entry.js} +1 -1
- package/dist/ezui/{p-e8c6c973.entry.js → p-a859ea2e.entry.js} +1 -1
- package/dist/ezui/{p-d6742c1e.entry.js → p-a9432878.entry.js} +1 -1
- package/dist/ezui/{p-e8c57463.entry.js → p-b21efe83.entry.js} +1 -1
- package/dist/ezui/{p-6a9a20a0.entry.js → p-b3530711.entry.js} +1 -1
- package/dist/ezui/{p-4e1df756.entry.js → p-b5b33be8.entry.js} +1 -1
- package/dist/ezui/{p-2ba2d792.entry.js → p-b77a0ce4.entry.js} +1 -1
- package/dist/ezui/{p-7fe97ef5.entry.js → p-b7c6ce20.entry.js} +1 -1
- package/dist/ezui/{p-c82acfc6.entry.js → p-b81d19c7.entry.js} +1 -1
- package/dist/ezui/{p-294f54fe.entry.js → p-bb7cf512.entry.js} +1 -1
- package/dist/ezui/{p-a0bf1fc7.entry.js → p-bc693db6.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-a401041c.entry.js → p-c73964f8.entry.js} +1 -1
- package/dist/ezui/{p-6020f3d5.entry.js → p-c754774e.entry.js} +1 -1
- package/dist/ezui/{p-d2645bdf.entry.js → p-c96e536d.entry.js} +1 -1
- package/dist/ezui/{p-8c57ffa4.entry.js → p-cb4f1ee9.entry.js} +1 -1
- package/dist/ezui/{p-20c024f7.entry.js → p-cf33bc48.entry.js} +1 -1
- package/dist/ezui/{p-0e49c0ff.entry.js → p-cf4e2a35.entry.js} +1 -1
- package/dist/ezui/{p-ae5f64cd.entry.js → p-cff2434d.entry.js} +1 -1
- package/dist/ezui/{p-9b2e6438.entry.js → p-d3779449.entry.js} +1 -1
- package/dist/ezui/{p-a80b1287.entry.js → p-dfca5946.entry.js} +1 -1
- package/dist/ezui/{p-7f792043.entry.js → p-e195eaad.entry.js} +1 -1
- package/dist/ezui/{p-79277e43.entry.js → p-e2eb894a.entry.js} +1 -1
- package/dist/ezui/{p-23a36bb6.js → p-e4c7eb39.js} +2 -2
- package/dist/ezui/{p-e7a7c594.entry.js → p-e9b409c1.entry.js} +1 -1
- package/dist/ezui/{p-e99cbb51.entry.js → p-f17e7182.entry.js} +1 -1
- package/dist/ezui/{p-a3ada561.entry.js → p-f26b97e9.entry.js} +1 -1
- package/dist/ezui/{p-411c0222.entry.js → p-f7ca8634.entry.js} +1 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +6 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-d8cc640d.entry.js +0 -1
- package/dist/ezui/p-e03b2f19.entry.js +0 -1
- package/dist/ezui/p-e77610ef.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,H as o,g as e}from"./p-23a36bb6.js";import{ElementIDUtils as h,KeyboardManager as a}from"@sankhyalabs/core";const l=class{constructor(s){i(this,s),this.ezChange=t(this,"ezChange",7),this.ezBlur=t(this,"ezBlur",7),this.iconClick=t(this,"iconClick",7),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.ezType=t(this,"ezType",7),this._keyboardManager=void 0,this._boundHandleDocumentClick=this.handleDocumentClick.bind(this),this.popoverVisible=!1,this.hasSlotContent=!1,this.highlightedIndex=0,this.filteredOptions=[],this.inputValue="",this.value=null,this.label=void 0,this.placeholder=void 0,this.enabled=!0,this.readonly=!1,this.name=void 0,this.state="default",this.helpText=void 0,this.iconName=void 0,this.titleIcon=void 0,this.iconClickable=!1,this.suppressSearch=!1,this.options=void 0,this.textEmptyOption=void 0,this.suppressEmptyOption=!1}async setFocus(i){var t;await(null===(t=this._inputElem)||void 0===t?void 0:t.setFocus(i))}async setBlur(){var i;await(null===(i=this._inputElem)||void 0===i?void 0:i.setBlur()),await this.hidePopover()}async showPopover(){var i,t,s;if(!this._popoverElem||!this._inputElem||this.popoverVisible)return;this.popoverVisible=!0;const o=null===(t=null===(i=this._inputElem)||void 0===i?void 0:i.shadowRoot)||void 0===t?void 0:t.querySelector(".input-container");await(null===(s=this._popoverElem)||void 0===s?void 0:s.showUnder(null!=o?o:this._inputElem))}async hidePopover(){var i;this.popoverVisible=!1,await(null===(i=this._popoverElem)||void 0===i?void 0:i.hide())}compareOptionValues(i,t){var s,o;return JSON.stringify(null!==(s=null==i?void 0:i.value)&&void 0!==s?s:null)===JSON.stringify(null!==(o=null==t?void 0:t.value)&&void 0!==o?o:null)}setEmptyValue(){this.value=null,this.inputValue=""}async setValue(i){if(!i||!this.options)return this.setEmptyValue(),void await this.hidePopover();this.compareOptionValues(this.value,i)||(i.value?(this.value=i,this.inputValue=i.label):this.setEmptyValue(),this.ezChange.emit(this.value)),await this.hidePopover()}async optionsChanged(){this.filterOptions("")}async valueChanged(i){i?(this.inputValue=i.label,this.setHighlightedIndexToValue()):(this.inputValue="",this.highlightedIndex=0)}async handleIconClick(i){i.stopPropagation(),i.preventDefault(),"right"===i.detail.icon?this.popoverVisible?await this.hidePopover():await this.showPopover():this.iconClick.emit()}async handleEzChange(i){i.stopPropagation(),this.inputValue=i.detail,!this.popoverVisible&&this.inputValue.length>0&&await this.showPopover(),this.ezType.emit(this.inputValue),this.highlightedIndex=0,this.filterOptions(this.inputValue)}async handleEzBlur(i){var t,s;i.stopPropagation(),(null===(t=this.value)||void 0===t?void 0:t.label)!==this.inputValue&&(this.inputValue=(null===(s=this.value)||void 0===s?void 0:s.label)||""),this.ezBlur.emit(this.value)}filterOptions(i){if(!this.options)return void(this.filteredOptions=[]);let t=[];if(i&&""!==i.trim()){const s=i.toLowerCase().trim();t=t.concat(this.options.filter((i=>i.label.toLowerCase().includes(s)||i.value.toLowerCase().includes(s))))}else t=t.concat([...this.options]);!this.suppressEmptyOption&&t.length>0&&(t=[{value:null,label:this.textEmptyOption||"Selecione um item"},...t]),this.filteredOptions=t,this.setHighlightedIndexToValue(),this.scrollToHighlightedOption()}scrollToHighlightedOption(){if(this.highlightedIndex<0||!this._listElem)return;const i=this._listElem.children[this.highlightedIndex];i&&i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}async selectOption(i){i&&!this.readonly&&this.enabled&&await this.setValue(i)}async handleArrowUp(){var i;this.popoverVisible?((null===(i=this.filteredOptions)||void 0===i?void 0:i.length)||0)<=0||this.highlightedIndex<=0||(this.highlightedIndex=Math.max(0,this.highlightedIndex-1),this.scrollToHighlightedOption()):await this.showPopover()}handleArrowDown(){var i;if(!this.popoverVisible)return void this.showPopover();const t=(null===(i=this.filteredOptions)||void 0===i?void 0:i.length)||0;t<=0||(this.highlightedIndex=Math.min(t-1,this.highlightedIndex+1),this.scrollToHighlightedOption())}async selectCurrentItem(){!this.popoverVisible||this.highlightedIndex<0||(this.hasSlotContent||0===this.filteredOptions.length||this.readonly||!this.enabled?await this.hidePopover():this.filteredOptions&&this.filteredOptions[this.highlightedIndex]&&this.selectOption(this.filteredOptions[this.highlightedIndex]))}handleVisibilityChange(i){this.popoverVisible=i.detail,this.ezVisibilityChange.emit(this.popoverVisible)}checkSlotContent(){const i=this._element.querySelector("slot")||this._element;this.hasSlotContent=i instanceof HTMLSlotElement?i.assignedNodes().length>0:i.children.length>0}setHighlightedIndexToValue(){if(this.value&&this.filteredOptions){const i=this.filteredOptions.findIndex((i=>i.value===this.value.value));if(i>=0)return void(this.highlightedIndex=i);this.highlightedIndex=0}}async handleDocumentClick(i){const t=i.target;this._element.contains(t)||this._popoverElem.contains(t)||await this.hidePopover()}addInfoId(){const i={id:"embedded"};this._element&&h.addIDInfo(this._element),this._inputElem&&h.addIDInfo(this._inputElem,"classic-combo-box-input",i),this._popoverElem&&h.addIDInfo(this._popoverElem,"classic-combo-box-popover",i)}async initKeyboardManager(){this._keyboardManager=new a({element:this._element,propagate:!0}),this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),{propagate:!1}).bind("ArrowDown",(()=>this.handleArrowDown()),{propagate:!1}).bind("Enter",(()=>this.selectCurrentItem()),{propagate:!1}).bind("Tab",(()=>this.selectCurrentItem())).bind("shift+Tab",(()=>this.selectCurrentItem())).bind("Escape",(()=>this.hidePopover()))}async connectedCallback(){await this.initKeyboardManager(),document.addEventListener("mouseup",this._boundHandleDocumentClick)}disconnectedCallback(){this._keyboardManager.unbindAllShortcutKeys(),document.removeEventListener("mouseup",this._boundHandleDocumentClick)}componentWillLoad(){this.filterOptions("")}componentDidLoad(){this.addInfoId(),this.checkSlotContent(),this.value&&(this.inputValue=this.value.label,this.setHighlightedIndexToValue())}render(){var i;return s(o,null,s("ez-classic-input",{ref:i=>this._inputElem=i,name:this.name,label:this.label,placeholder:this.placeholder,value:this.inputValue,state:this.state,enabled:this.enabled,readonly:this.readonly||this.suppressSearch,leftIconName:this.iconName,leftIconTooltip:this.titleIcon,leftIconClickable:this.iconClickable,rightIconClickable:!0,helpText:this.helpText,rightIconName:this.popoverVisible?"chevron-up":"chevron-down",onIconClick:this.handleIconClick.bind(this),onEzChange:this.handleEzChange.bind(this),onEzFocus:this.showPopover.bind(this),onEzBlur:this.handleEzBlur.bind(this)}),s("ez-popover-core",{ref:i=>this._popoverElem=i,useAnchorSize:!0,onEzVisibilityChange:this.handleVisibilityChange.bind(this),overlayType:"none",options:{verticalGap:2,horizontalGap:0},autoClose:!1},s("slot",{onSlotchange:this.checkSlotContent.bind(this)}),!this.hasSlotContent&&((null===(i=this.filteredOptions)||void 0===i?void 0:i.length)>0?s("ul",{ref:i=>this._listElem=i,tabIndex:-1},this.filteredOptions.map(((i,t)=>{var o,e;return s("li",{key:null!==(o=i.value)&&void 0!==o?o:"__empty__",value:i.value,class:{highlighted:this.highlightedIndex===t,selected:(null===(e=this.value)||void 0===e?void 0:e.value)===i.value},onMouseDown:()=>this.selectOption(i)},i.label)}))):s("span",{class:"no-results"},"Nenhum resultado encontrado"))))}get _element(){return e(this)}static get watchers(){return{options:["optionsChanged"],value:["valueChanged"]}}};l.style=":host{display:block;box-sizing:border-box;font-family:var(--font--pattern, 'Roboto', Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--gray-500, #494A4E);--ez-classic-combo-box-highlighted-bg-color:var(--color--gray-90, #EAEAEA);--ez-classic-combo-box-max-height:180px;--ez-classic-combo-box-list-bg-color:var(--color--gray-70, #FFFFFF);--ez-classic-combo-box-item-hover-bg-color:var(--color--gray-100, #DEDEDE);--ez-classic-combo-box-selected-bg-color:var(--color--ocean-green-90, #E6F3EF);--ez-classic-combo-box-selected-text-color:var(--color--ocean-green-600, #008561);--ez-classic-combo-box-selected-font-weight:var(--font-weight--medium, 500);--ez-classic-combo-box-item-padding:var(--space--8, 8px) var(--space--4, 4px);--ez-classic-combo-box-item-border-radius:var(--border--radius-8, 8px);--ez-classic-combo-box-list-margin:var(--space--6, 6px);--ez-classic-combo-box-transition-duration:150ms;--ez-classic-combo-box-scrollbar-color:var(--color--gray-300, #C4C4C4);--ez-classic-combo-box-no-results-margin:var(--space--52, 52px) 0;--ez-classic-combo-box-item-text-color:inherit;--ez-classic-combo-box-item-min-height:auto}ul{list-style:none;padding:0;margin:var(--ez-classic-combo-box-list-margin);display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--ez-classic-combo-box-scrollbar-color) transparent;max-height:var(--ez-classic-combo-box-max-height);scroll-behavior:smooth;background-color:var(--ez-classic-combo-box-list-bg-color)}li{cursor:pointer;border-radius:var(--ez-classic-combo-box-item-border-radius);padding:var(--ez-classic-combo-box-item-padding);transition:var(--ez-classic-combo-box-transition-duration) background-color linear;color:var(--ez-classic-combo-box-item-text-color);min-height:var(--ez-classic-combo-box-item-min-height)}li:hover{background-color:var(--ez-classic-combo-box-item-hover-bg-color)}li.highlighted{background-color:var(--ez-classic-combo-box-highlighted-bg-color)}li.selected{background-color:var(--ez-classic-combo-box-selected-bg-color);color:var(--ez-classic-combo-box-selected-text-color);font-weight:var(--ez-classic-combo-box-selected-font-weight)}span.no-results{margin:var(--ez-classic-combo-box-no-results-margin);cursor:default;text-align:center;display:flex;align-items:center;justify-content:center}";export{l as ez_classic_combo_box}
|
|
1
|
+
import{r as i,c as t,h as s,H as o,g as e}from"./p-e4c7eb39.js";import{ElementIDUtils as h,KeyboardManager as a}from"@sankhyalabs/core";const l=class{constructor(s){i(this,s),this.ezChange=t(this,"ezChange",7),this.ezBlur=t(this,"ezBlur",7),this.iconClick=t(this,"iconClick",7),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.ezType=t(this,"ezType",7),this._keyboardManager=void 0,this._boundHandleDocumentClick=this.handleDocumentClick.bind(this),this.popoverVisible=!1,this.hasSlotContent=!1,this.highlightedIndex=0,this.filteredOptions=[],this.inputValue="",this.value=null,this.label=void 0,this.placeholder=void 0,this.enabled=!0,this.readonly=!1,this.name=void 0,this.state="default",this.helpText=void 0,this.iconName=void 0,this.titleIcon=void 0,this.iconClickable=!1,this.suppressSearch=!1,this.options=void 0,this.textEmptyOption=void 0,this.suppressEmptyOption=!1}async setFocus(i){var t;await(null===(t=this._inputElem)||void 0===t?void 0:t.setFocus(i))}async setBlur(){var i;await(null===(i=this._inputElem)||void 0===i?void 0:i.setBlur()),await this.hidePopover()}async showPopover(){var i,t,s;if(!this._popoverElem||!this._inputElem||this.popoverVisible)return;this.popoverVisible=!0;const o=null===(t=null===(i=this._inputElem)||void 0===i?void 0:i.shadowRoot)||void 0===t?void 0:t.querySelector(".input-container");await(null===(s=this._popoverElem)||void 0===s?void 0:s.showUnder(null!=o?o:this._inputElem))}async hidePopover(){var i;this.popoverVisible=!1,await(null===(i=this._popoverElem)||void 0===i?void 0:i.hide())}compareOptionValues(i,t){var s,o;return JSON.stringify(null!==(s=null==i?void 0:i.value)&&void 0!==s?s:null)===JSON.stringify(null!==(o=null==t?void 0:t.value)&&void 0!==o?o:null)}setEmptyValue(){this.value=null,this.inputValue=""}async setValue(i){if(!i||!this.options)return this.setEmptyValue(),void await this.hidePopover();this.compareOptionValues(this.value,i)||(i.value?(this.value=i,this.inputValue=i.label):this.setEmptyValue(),this.ezChange.emit(this.value)),await this.hidePopover()}async optionsChanged(){this.filterOptions("")}async valueChanged(i){i?(this.inputValue=i.label,this.setHighlightedIndexToValue()):(this.inputValue="",this.highlightedIndex=0)}async handleIconClick(i){i.stopPropagation(),i.preventDefault(),"right"===i.detail.icon?this.popoverVisible?await this.hidePopover():await this.showPopover():this.iconClick.emit()}async handleEzChange(i){i.stopPropagation(),this.inputValue=i.detail,!this.popoverVisible&&this.inputValue.length>0&&await this.showPopover(),this.ezType.emit(this.inputValue),this.highlightedIndex=0,this.filterOptions(this.inputValue)}async handleEzBlur(i){var t,s;i.stopPropagation(),(null===(t=this.value)||void 0===t?void 0:t.label)!==this.inputValue&&(this.inputValue=(null===(s=this.value)||void 0===s?void 0:s.label)||""),this.ezBlur.emit(this.value)}filterOptions(i){if(!this.options)return void(this.filteredOptions=[]);let t=[];if(i&&""!==i.trim()){const s=i.toLowerCase().trim();t=t.concat(this.options.filter((i=>i.label.toLowerCase().includes(s)||i.value.toLowerCase().includes(s))))}else t=t.concat([...this.options]);!this.suppressEmptyOption&&t.length>0&&(t=[{value:null,label:this.textEmptyOption||"Selecione um item"},...t]),this.filteredOptions=t,this.setHighlightedIndexToValue(),this.scrollToHighlightedOption()}scrollToHighlightedOption(){if(this.highlightedIndex<0||!this._listElem)return;const i=this._listElem.children[this.highlightedIndex];i&&i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}async selectOption(i){i&&!this.readonly&&this.enabled&&await this.setValue(i)}async handleArrowUp(){var i;this.popoverVisible?((null===(i=this.filteredOptions)||void 0===i?void 0:i.length)||0)<=0||this.highlightedIndex<=0||(this.highlightedIndex=Math.max(0,this.highlightedIndex-1),this.scrollToHighlightedOption()):await this.showPopover()}handleArrowDown(){var i;if(!this.popoverVisible)return void this.showPopover();const t=(null===(i=this.filteredOptions)||void 0===i?void 0:i.length)||0;t<=0||(this.highlightedIndex=Math.min(t-1,this.highlightedIndex+1),this.scrollToHighlightedOption())}async selectCurrentItem(){!this.popoverVisible||this.highlightedIndex<0||(this.hasSlotContent||0===this.filteredOptions.length||this.readonly||!this.enabled?await this.hidePopover():this.filteredOptions&&this.filteredOptions[this.highlightedIndex]&&this.selectOption(this.filteredOptions[this.highlightedIndex]))}handleVisibilityChange(i){this.popoverVisible=i.detail,this.ezVisibilityChange.emit(this.popoverVisible)}checkSlotContent(){const i=this._element.querySelector("slot")||this._element;this.hasSlotContent=i instanceof HTMLSlotElement?i.assignedNodes().length>0:i.children.length>0}setHighlightedIndexToValue(){if(this.value&&this.filteredOptions){const i=this.filteredOptions.findIndex((i=>i.value===this.value.value));if(i>=0)return void(this.highlightedIndex=i);this.highlightedIndex=0}}async handleDocumentClick(i){const t=i.target;this._element.contains(t)||this._popoverElem.contains(t)||await this.hidePopover()}addInfoId(){const i={id:"embedded"};this._element&&h.addIDInfo(this._element),this._inputElem&&h.addIDInfo(this._inputElem,"classic-combo-box-input",i),this._popoverElem&&h.addIDInfo(this._popoverElem,"classic-combo-box-popover",i)}async initKeyboardManager(){this._keyboardManager=new a({element:this._element,propagate:!0}),this._keyboardManager.bind("ArrowUp",(()=>this.handleArrowUp()),{propagate:!1}).bind("ArrowDown",(()=>this.handleArrowDown()),{propagate:!1}).bind("Enter",(()=>this.selectCurrentItem()),{propagate:!1}).bind("Tab",(()=>this.selectCurrentItem())).bind("shift+Tab",(()=>this.selectCurrentItem())).bind("Escape",(()=>this.hidePopover()))}async connectedCallback(){await this.initKeyboardManager(),document.addEventListener("mouseup",this._boundHandleDocumentClick)}disconnectedCallback(){this._keyboardManager.unbindAllShortcutKeys(),document.removeEventListener("mouseup",this._boundHandleDocumentClick)}componentWillLoad(){this.filterOptions("")}componentDidLoad(){this.addInfoId(),this.checkSlotContent(),this.value&&(this.inputValue=this.value.label,this.setHighlightedIndexToValue())}render(){var i;return s(o,null,s("ez-classic-input",{ref:i=>this._inputElem=i,name:this.name,label:this.label,placeholder:this.placeholder,value:this.inputValue,state:this.state,enabled:this.enabled,readonly:this.readonly||this.suppressSearch,leftIconName:this.iconName,leftIconTooltip:this.titleIcon,leftIconClickable:this.iconClickable,rightIconClickable:!0,helpText:this.helpText,rightIconName:this.popoverVisible?"chevron-up":"chevron-down",onIconClick:this.handleIconClick.bind(this),onEzChange:this.handleEzChange.bind(this),onEzFocus:this.showPopover.bind(this),onEzBlur:this.handleEzBlur.bind(this)}),s("ez-popover-core",{ref:i=>this._popoverElem=i,useAnchorSize:!0,onEzVisibilityChange:this.handleVisibilityChange.bind(this),overlayType:"none",options:{verticalGap:2,horizontalGap:0},autoClose:!1},s("slot",{onSlotchange:this.checkSlotContent.bind(this)}),!this.hasSlotContent&&((null===(i=this.filteredOptions)||void 0===i?void 0:i.length)>0?s("ul",{ref:i=>this._listElem=i,tabIndex:-1},this.filteredOptions.map(((i,t)=>{var o,e;return s("li",{key:null!==(o=i.value)&&void 0!==o?o:"__empty__",value:i.value,class:{highlighted:this.highlightedIndex===t,selected:(null===(e=this.value)||void 0===e?void 0:e.value)===i.value},onMouseDown:()=>this.selectOption(i)},i.label)}))):s("span",{class:"no-results"},"Nenhum resultado encontrado"))))}get _element(){return e(this)}static get watchers(){return{options:["optionsChanged"],value:["valueChanged"]}}};l.style=":host{display:block;box-sizing:border-box;font-family:var(--font--pattern, 'Roboto', Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--gray-500, #494A4E);--ez-classic-combo-box-highlighted-bg-color:var(--color--gray-90, #EAEAEA);--ez-classic-combo-box-max-height:180px;--ez-classic-combo-box-list-bg-color:var(--color--gray-70, #FFFFFF);--ez-classic-combo-box-item-hover-bg-color:var(--color--gray-100, #DEDEDE);--ez-classic-combo-box-selected-bg-color:var(--color--ocean-green-90, #E6F3EF);--ez-classic-combo-box-selected-text-color:var(--color--ocean-green-600, #008561);--ez-classic-combo-box-selected-font-weight:var(--font-weight--medium, 500);--ez-classic-combo-box-item-padding:var(--space--8, 8px) var(--space--4, 4px);--ez-classic-combo-box-item-border-radius:var(--border--radius-8, 8px);--ez-classic-combo-box-list-margin:var(--space--6, 6px);--ez-classic-combo-box-transition-duration:150ms;--ez-classic-combo-box-scrollbar-color:var(--color--gray-300, #C4C4C4);--ez-classic-combo-box-no-results-margin:var(--space--52, 52px) 0;--ez-classic-combo-box-item-text-color:inherit;--ez-classic-combo-box-item-min-height:auto}ul{list-style:none;padding:0;margin:var(--ez-classic-combo-box-list-margin);display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--ez-classic-combo-box-scrollbar-color) transparent;max-height:var(--ez-classic-combo-box-max-height);scroll-behavior:smooth;background-color:var(--ez-classic-combo-box-list-bg-color)}li{cursor:pointer;border-radius:var(--ez-classic-combo-box-item-border-radius);padding:var(--ez-classic-combo-box-item-padding);transition:var(--ez-classic-combo-box-transition-duration) background-color linear;color:var(--ez-classic-combo-box-item-text-color);min-height:var(--ez-classic-combo-box-item-min-height)}li:hover{background-color:var(--ez-classic-combo-box-item-hover-bg-color)}li.highlighted{background-color:var(--ez-classic-combo-box-highlighted-bg-color)}li.selected{background-color:var(--ez-classic-combo-box-selected-bg-color);color:var(--ez-classic-combo-box-selected-text-color);font-weight:var(--ez-classic-combo-box-selected-font-weight)}span.no-results{margin:var(--ez-classic-combo-box-no-results-margin);cursor:default;text-align:center;display:flex;align-items:center;justify-content:center}";export{l as ez_classic_combo_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-23a36bb6.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as u,KeyboardManager as h,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as m,f as p,c as b,D as y}from"./p-4f0632b4.js";import{g as w,i as g}from"./p-641ee538.js";import{F as _}from"./p-30ffb9ed.js";import"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class E{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[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((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),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 j=(t,i)=>{var e;if(i)return null===(e=i.tabs)||void 0===e?void 0:e.find((i=>i.label===t))},F=(t,i,e)=>{if("string"!=typeof t)return t;if(e){const i=j(t,e);if(i)return i}return Array.from(i.keys()).find((i=>i.label===t))||{label:t,visible:!0}};function z(t,i){var e,n;return"__main"===t[0].label&&"__main"!==i[0].label?-1:"__main"!==t[0].label&&"__main"===i[0].label?1:(null!==(e=t[0].order)&&void 0!==e?e:Number.MAX_VALUE)-(null!==(n=i[0].order)&&void 0!==n?n:Number.MAX_VALUE)}const x=t=>`child[${t.name}]`,A=t=>({name:x(t),label:t.label,fields:[]});function N(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 S="function"==typeof Symbol&&Symbol.observable||"@@observable",D=function(){return Math.random().toString(36).substring(7).split("").join(".")},M={INIT:"@@redux/INIT"+D(),REPLACE:"@@redux/REPLACE"+D(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+D()}};function R(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function T(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(N(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(N(1));return e(T)(t,i)}if("function"!=typeof t)throw new Error(N(2));var s=t,r=i,o=[],l=o,a=!1;function u(){l===o&&(l=o.slice())}function h(){if(a)throw new Error(N(3));return r}function c(t){if("function"!=typeof t)throw new Error(N(4));if(a)throw new Error(N(5));var i=!0;return u(),l.push(t),function(){if(i){if(a)throw new Error(N(6));i=!1,u();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!R(t))throw new Error(N(7));if(void 0===t.type)throw new Error(N(8));if(a)throw new Error(N(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(N(10));s=t,d({type:M.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(N(11));function e(){t.next&&t.next(h())}return e(),{unsubscribe:i(e)}}})[S]=function(){return this},t}return d({type:M.INIT}),(n={dispatch:d,subscribe:c,getState:h,replaceReducer:f})[S]=v,n}const P={};function I(t=P,i){switch(i.type){case K.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case K.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function L(t){return t.formMetadata}function V(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var K;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(K||(K={}));const $=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=L(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=V(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:K.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${u.replaceAccentuatedChars(u.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:u.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new h({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(m,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await p(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1,n)=>{var s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],u={};(null!==(s=null==t?void 0:t.tabs)&&void 0!==s?s:[]).forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),function(t,i,e,n,s,r,o){var l;null===(l=null==t?void 0:t.fields)||void 0===l||l.forEach((l=>{var a,u,h;if(!1!==l.visible){const c=F(l.tab||"__main",i,t);if(e.has(c.label))return;const d=n.getField(l.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&c.visible){i.has(c)||i.set(c,[]);const t=f(d,l);i.get(c).push(t),t.required&&s.push(l.name),((null==l.cleanOnCopy?null===(a=d.properties)||void 0===a?void 0:a.cleanOnCopy:l.cleanOnCopy)||(null===(u=d.properties)||void 0===u?void 0:u.cleanOnCopy))&&r.push(l.name);let e=null==l.defaultValue?null===(h=d.properties)||void 0===h?void 0:h.defaultValue:l.defaultValue;if(e&&null!=e.value){const{type:t,value:i}=e;if(t)if("V"===t)e=i;else try{const t=JSON.parse(i);e=t&&"value"in t?t:i}catch(t){}o[l.name]=e}}}}))}(t,r,o,i,l,a,u);const h=new E;return h.setDefaultVars(t.defaultVars),e&&function(t,i,e){const n=t.metadata;void 0!==n&&void 0!==n.children&&n.children.forEach((t=>{const n=j(t.label,i);if(n)return void e.set(Object.assign(n,{name:x(t),isDetail:!0}),[]);const{label:s,name:r,fields:o}=A(t);e.set({name:r,label:s,isDetail:!0},o)}))}(i,t,r),n&&function(t,i,e){t.forEach((t=>{const n=j(t.label,i),s={};Object.entries(t).forEach((([t,i])=>{(function(t){return["id","label"].includes(t)})(t)||(s[t]=i)})),e.set(n?Object.assign(n,{name:t.id,isCustom:!0,ctxProps:s}):{label:t.label,name:t.id,isCustom:!0,visible:!0,ctxProps:s},[])}))}(n,t,r),Array.from(r.entries()).sort(z).forEach((([t,i])=>{o.has(t.label)||h.addSheet(function(t,i){const e=w();return{label:"__main"===t.label?e("ez-form.mainTab"):t.label,name:t.name||t.label,isCustom:t.isCustom,isDetail:t.isDetail,ctxProps:t.ctxProps,fields:i}}(t,i))})),h.addRequiredFields(l),h.addCleanOnCopyFields(a),h.addDefaultValues(u),h})(this.config,this.dataUnit);this._store.dispatch({type:K.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}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=T(I),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===_.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===_.CASCADE}))}componentDidRender(){const t=L(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,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=V(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=u.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};$.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{$ as ez_form}
|
|
1
|
+
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-e4c7eb39.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as u,KeyboardManager as h,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as m,f as p,c as b,D as y}from"./p-4296e9f9.js";import{g as w,i as g}from"./p-641ee538.js";import{F as _}from"./p-30ffb9ed.js";import"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class E{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[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((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),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 j=(t,i)=>{var e;if(i)return null===(e=i.tabs)||void 0===e?void 0:e.find((i=>i.label===t))},F=(t,i,e)=>{if("string"!=typeof t)return t;if(e){const i=j(t,e);if(i)return i}return Array.from(i.keys()).find((i=>i.label===t))||{label:t,visible:!0}};function z(t,i){var e,n;return"__main"===t[0].label&&"__main"!==i[0].label?-1:"__main"!==t[0].label&&"__main"===i[0].label?1:(null!==(e=t[0].order)&&void 0!==e?e:Number.MAX_VALUE)-(null!==(n=i[0].order)&&void 0!==n?n:Number.MAX_VALUE)}const x=t=>`child[${t.name}]`,A=t=>({name:x(t),label:t.label,fields:[]});function N(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 S="function"==typeof Symbol&&Symbol.observable||"@@observable",D=function(){return Math.random().toString(36).substring(7).split("").join(".")},M={INIT:"@@redux/INIT"+D(),REPLACE:"@@redux/REPLACE"+D(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+D()}};function R(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function T(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(N(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(N(1));return e(T)(t,i)}if("function"!=typeof t)throw new Error(N(2));var s=t,r=i,o=[],l=o,a=!1;function u(){l===o&&(l=o.slice())}function h(){if(a)throw new Error(N(3));return r}function c(t){if("function"!=typeof t)throw new Error(N(4));if(a)throw new Error(N(5));var i=!0;return u(),l.push(t),function(){if(i){if(a)throw new Error(N(6));i=!1,u();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!R(t))throw new Error(N(7));if(void 0===t.type)throw new Error(N(8));if(a)throw new Error(N(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(N(10));s=t,d({type:M.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(N(11));function e(){t.next&&t.next(h())}return e(),{unsubscribe:i(e)}}})[S]=function(){return this},t}return d({type:M.INIT}),(n={dispatch:d,subscribe:c,getState:h,replaceReducer:f})[S]=v,n}const P={};function I(t=P,i){switch(i.type){case K.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case K.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function L(t){return t.formMetadata}function V(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var K;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(K||(K={}));const $=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=L(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=V(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:K.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${u.replaceAccentuatedChars(u.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:u.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new h({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(m,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await p(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1,n)=>{var s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],u={};(null!==(s=null==t?void 0:t.tabs)&&void 0!==s?s:[]).forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),function(t,i,e,n,s,r,o){var l;null===(l=null==t?void 0:t.fields)||void 0===l||l.forEach((l=>{var a,u,h;if(!1!==l.visible){const c=F(l.tab||"__main",i,t);if(e.has(c.label))return;const d=n.getField(l.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&c.visible){i.has(c)||i.set(c,[]);const t=f(d,l);i.get(c).push(t),t.required&&s.push(l.name),((null==l.cleanOnCopy?null===(a=d.properties)||void 0===a?void 0:a.cleanOnCopy:l.cleanOnCopy)||(null===(u=d.properties)||void 0===u?void 0:u.cleanOnCopy))&&r.push(l.name);let e=null==l.defaultValue?null===(h=d.properties)||void 0===h?void 0:h.defaultValue:l.defaultValue;if(e&&null!=e.value){const{type:t,value:i}=e;if(t)if("V"===t)e=i;else try{const t=JSON.parse(i);e=t&&"value"in t?t:i}catch(t){}o[l.name]=e}}}}))}(t,r,o,i,l,a,u);const h=new E;return h.setDefaultVars(t.defaultVars),e&&function(t,i,e){const n=t.metadata;void 0!==n&&void 0!==n.children&&n.children.forEach((t=>{const n=j(t.label,i);if(n)return void e.set(Object.assign(n,{name:x(t),isDetail:!0}),[]);const{label:s,name:r,fields:o}=A(t);e.set({name:r,label:s,isDetail:!0},o)}))}(i,t,r),n&&function(t,i,e){t.forEach((t=>{const n=j(t.label,i),s={};Object.entries(t).forEach((([t,i])=>{(function(t){return["id","label"].includes(t)})(t)||(s[t]=i)})),e.set(n?Object.assign(n,{name:t.id,isCustom:!0,ctxProps:s}):{label:t.label,name:t.id,isCustom:!0,visible:!0,ctxProps:s},[])}))}(n,t,r),Array.from(r.entries()).sort(z).forEach((([t,i])=>{o.has(t.label)||h.addSheet(function(t,i){const e=w();return{label:"__main"===t.label?e("ez-form.mainTab"):t.label,name:t.name||t.label,isCustom:t.isCustom,isDetail:t.isDetail,ctxProps:t.ctxProps,fields:i}}(t,i))})),h.addRequiredFields(l),h.addCleanOnCopyFields(a),h.addDefaultValues(u),h})(this.config,this.dataUnit);this._store.dispatch({type:K.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}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=T(I),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===_.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===_.CASCADE}))}componentDidRender(){const t=L(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,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=V(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=u.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};$.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{$ as ez_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,f as r,H as s,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as n,StringUtils as l,ObjectUtils as a}from"@sankhyalabs/core";import{i as h}from"./p-641ee538.js";const c=(e,t)=>t?e.iconExpanded||"chevron-down":e.iconContracted||"chevron-right",d=e=>e.tooltip||e.label,u=t=>{const{node:i,selectedId:r,itemClick:s,iconClick:o,iconResolver:l,tooltipResolver:a,itemsList:h,itemDoubleClick:c}=t;if(!i.visible)return;const d=i.item,v=t.level||1,m=i.isDisabled(),b=!m&&d.expanded,g=i.isExpandable(),f=!m&&!i.isPlaceHolder;return f&&h.push(d),e("ul",{class:1===v?"first-level":void 0},e("li",Object.assign({title:a(d,!m,v),class:"tree-item "+(d.id!==r?"tree-item-error":""),onClick:()=>f&&s(d),onDblClick:()=>f&&c(d)},{disabled:m,selected:d.id===r,[n.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:n.getInternalIDInfo(`ezTreeItem_${d.id}`)}),e("div",{class:"item-label-container"},e("div",{class:"item-icon-box"},g&&e("ez-icon",{id:d.id,class:"item-icon",size:"small",iconName:l(d,b,v),onClick:e=>function(e){e.stopPropagation(),f&&o(d)}(e),onDblClick:e=>function(e){e.stopPropagation()}(e)})),e("label",{class:"item-label "+(d.bold?"item-label--bold":"")},d.label)),function(t,i,r){if(null!=i)return"string"==typeof i?e("div",{class:`tree-item-badge ${r?null:i}`},"error"===i&&e("ez-icon",{id:`${t}-badge-error`,class:"tree-item-badge-error-icon",size:"x-small",style:{color:"white"},iconName:"alert-circle"})):"text"===i.type?e("div",{id:`${t}-badge-text`,class:"tree-item-badge-text"},i.text):e("div",null,e("ez-icon",{id:`${t}-badge-icon`,class:"tree-item-badge-icon",style:{"--ez-icon--color":`var(--ez-tree__badge--icon-color--${i.iconColor||"default"})`},iconName:i.iconName}))}(d.id,d.badge,d.id===r)),b&&i.getChildren().map((t=>e(u,{selectedId:r,node:t,itemClick:s,iconClick:o,level:v+1,iconResolver:l,tooltipResolver:a,itemsList:h,itemDoubleClick:c}))))};class v{constructor(e,t,i,r=!1){this.children=new Map,this.visible=!0,this.item=t,this.parent=i,this._tree=e,this.isPlaceHolder=r,t&&!r?(this._isLazyLoad="function"==typeof t.children||t.childrenCount>0,Array.isArray(t.children)&&(Array.from(t.children).forEach((e=>this.addChild(this._tree,e))),this._childrenLoaded=!0)):(this._isLazyLoad=!1,this._childrenLoaded=!0)}refresh(e){if(this.isPlaceHolder)return;this.item=Object.assign({},e),this._isLazyLoad="function"==typeof this.item.children||this.item.childrenCount>0;const t=this.children;this.children=new Map,Array.isArray(this.item.children)?(void 0===this.item.expanded&&(this.item.expanded=!0),Array.from(this.item.children).forEach((e=>{const i=t.get(e.id);i?(void 0===e.expanded&&(e.expanded=i.item.expanded),i.refresh(e),this.children.set(e.id,i)):(void 0===e.expanded&&(e.expanded=!0),this.addChild(this._tree,Object.assign({},e)))})),this._childrenLoaded=!0):this._childrenLoaded=!1}isDisabled(){return!this.isPlaceHolder&&this._tree.isNodeDisabled(this.item.id,this.item.disabled)}updateChildren(e){this.isPlaceHolder||this.refresh(Object.assign(Object.assign({},this.item),{children:e}))}addChild(e,t){this.children.has(t.id)||this.children.set(t.id,new v(e,t,this))}removeChild(e){return!!this.children.has(e)&&(this.children.delete(e),!0)}addPlaceHolder(){this.children.clear();const e=this.item.id;this.children.set(e,new v(void 0,{id:`placeholder_${e}`,label:"Carregando..."},this,!0))}getNode(e){if(this.children.has(e))return this.children.get(e);const t=Array.from(this.children.values());for(const i of t){const t=i.getNode(e);if(t)return t}}needLoad(){return this._isLazyLoad&&!this._childrenLoaded}isExpandable(){return!!this._isLazyLoad||this.children.size>0}getChildren(){return this.isPlaceHolder?[]:(this.needLoad()&&this._tree.loadChildren(this),Array.from(this.children.values()))}}class m extends v{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,t){const i=this.getNode(e);if(null==i)return this.addChild(this,t),void this._changeCallback();i.addChild(this,t),this._changeCallback()}setDisabled(e,t){this._disabledValues.set(e,t),this._changeCallback()}isNodeDisabled(e,t){return this._disabledValues.has(e)?this._disabledValues.get(e):t}load(e){if(e===this._currentItems)return;this._currentItems=e;const t=this.children;this.children=new Map,this._disabledValues.clear(),e.forEach((e=>{const i=t.get(e.id);i?(i.refresh(e),this.children.set(e.id,i)):this.addChild(this,Object.assign({},e))}))}async setFilterPattern(e,t=!0){if(e&&t&&e.includes(".")){const t=e.split(".").map((e=>l.replaceAccentuatedCharsKeepSymbols(e.trim())));await this.applyLayeredFilter(this,t,0)}else this._filterPattern=l.replaceAccentuatedCharsKeepSymbols(e),this.setAllChildrenExpanded(this,!1),this.applyFilter(this);this._changeCallback()}updateItem(e){if(null==e)return;const t=this.getNode(e.id);null!=t&&(Object.keys(e).forEach((i=>t.item[i]=e[i])),null==e.children?t.children.clear():Array.isArray(e.children)&&t.updateChildren(e.children),this._changeCallback())}removeItem(e){if(!e)return;const t=this.getNode(e);t&&(t.parent?t.parent.removeChild(e):this.children.delete(e),this._disabledValues.delete(e),this._changeCallback())}async open(e){return new Promise((async t=>{await this.walkPath(this,e,(e=>e.item.expanded=!0)),t()}))}setAllChildrenVisible(e){e.children.forEach((e=>{e.visible=!0,this.setAllChildrenVisible(e)}))}applyFilter(e){if(!this._filterPattern)return e.visible=!0,void this.setAllChildrenVisible(e);if(e.children.forEach((e=>{this.applyFilter(e)})),null==e.item)return;let t=!1;if(l.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(this._filterPattern))t=!0,e.item.expanded=!0,this.setAllChildrenVisible(e);else{const i=Array.from(e.children.values());for(let r=0;r<i.length;r++)if(i[r].visible){t=!0,e.item.expanded=!0;break}}e.visible=t}async applyLayeredFilter(e,t,i){if(!e.item){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return e.visible=r,r}if(!l.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(t[i])){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}if(i===t.length-1)return e.visible=!0,this.setAllChildrenVisible(e),!0;const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i+1))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}async walkPath(e,t,i,r=0){return new Promise((async s=>{const o=t.split(">>").map((e=>e.trim()));if(o.length>r){const s=e.getNode(o[r]);s&&(s.needLoad()&&await this.loadLevel(s),i(s),await this.walkPath(s,t,i,r+1))}s()}))}async loadChildren(e){return new Promise((t=>{this.loadLevel(e).then((()=>{t(),this._changeCallback()}))}))}expandAll(){this.setAllChildrenExpanded(this,!0),this._changeCallback()}collapseAll(){this.setAllChildrenExpanded(this,!1),this._changeCallback()}setAllChildrenExpanded(e,t){e.item&&!e.isPlaceHolder&&(e.item.expanded=t),e.children.forEach((e=>{this.setAllChildrenExpanded(e,t)}))}async loadLevel(e){return new Promise((t=>{e.addPlaceHolder(),(0,e.item.children)(e.item).then((i=>{e.updateChildren(i),t()}))}))}}const b=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezOpenItem=i(this,"ezOpenItem",7),this.ezDbClickItem=i(this,"ezDbClickItem",7),this.ezRemoveItem=i(this,"ezRemoveItem",7),this._onItemClick=e=>{this.selectable?this.value=this.value&&this.value.id===e.id?void 0:e:this.openClose(e)},this._onIconClick=e=>{this.openClose(e)},this._tree=new m((()=>r(this))),this._waintingForLoad=void 0,this.items=[],this.value=void 0,this.selectedId=void 0,this.iconResolver=c,this.tooltipResolver=void 0,this.enableHierarchicalFilter=!0,this.selectable=!0}async selectItem(e){const t=this._tree.getNode(e);this.value=t?t.item:void 0}async openItem(e){this._waintingForLoad=!0,await this._tree.open(e),this._waintingForLoad=!1}async disableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!0)))}async enableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!1)))}async addChild(e,t){var i;null==t&&(t=null===(i=this.value)||void 0===i?void 0:i.id),this._tree.addChildAt(t,e),this.addItemInIndexedList(t,e);const r=this._tree.getNode(t);r?r.item.expanded=!0:this.collapseAll()}async applyFilter(e){await this._tree.setFilterPattern(e,this.enableHierarchicalFilter)}async expandAll(){this._tree.expandAll()}async collapseAll(){this._tree.collapseAll()}async updateItem(e,t){var i,r,s;if(Array.isArray(e))return void e.forEach((e=>this.updateItem(e,t)));if((null==t?void 0:t.updatedBySelectedId)&&Object.assign(e,{id:this.selectedId}),this._tree.updateItem((null==t?void 0:t.forceDefaultValues)?this.applyDefaultValues(e):e),this.updateItemInIndexedList(e,null==t?void 0:t.forceDefaultValues),null==(null===(i=this._tree)||void 0===i?void 0:i.getNode(this.selectedId))&&(this.value=this._visibleItems?this._visibleItems[0]:void 0,this._tree.collapseAll()),(null===(r=this.value)||void 0===r?void 0:r.id)===e.id)return this.value=e,void this.ezChange.emit(this.value);const o=this.getItemById(null===(s=this.value)||void 0===s?void 0:s.id,[e]);o&&(this.value=o,this.ezChange.emit(this.value))}async removeItem(e){var t;(e=null!=e?e:this.selectedId)&&(this._tree.removeItem(e),this.removeItemFromIndexedList(e),this.ezRemoveItem.emit(e),(null===(t=this.value)||void 0===t?void 0:t.id)===e&&(this.value=void 0))}async getItem(e){return new Promise((t=>{const i=this._tree.getNode(e);t(null==i?void 0:i.item)}))}async getCurrentPath(){var e,t,i;const r=null===(e=this._tree)||void 0===e?void 0:e.getNode(this.selectedId);if(null==r)return;const s=[];let o,n=null===(t=r.parent)||void 0===t?void 0:t.item;for(s.push(this.getItemPathAttrs(r.item));null!=n;)s.unshift(this.getItemPathAttrs(n)),o=this._tree.getNode(n.id),n=null===(i=null==o?void 0:o.parent)||void 0===i?void 0:i.item;return s}async getParent(e){return new Promise((t=>{var i;const r=this._tree.getNode(e);r&&t(null===(i=r.parent)||void 0===i?void 0:i.item),t(void 0)}))}observeItems(e,t){a.objectToString(e)!==a.objectToString(t)&&this._tree.load(this.items||[])}observeValue(){var e;this.ezChange.emit(this.value),this.selectedId=null===(e=this.value)||void 0===e?void 0:e.id}onKeyDownListener(e){if(!this.value)return;let t=!1;switch(e.key){case"ArrowUp":this.previousItem(),t=!0;break;case"ArrowDown":this.nextItem(),t=!0;break;case"ArrowLeft":this.previousLevel(),t=!0;break;case"ArrowRight":this.nextLevel(),t=!0;break;case" ":this.openClose(this.value),t=!0}t&&(e.stopPropagation(),e.preventDefault())}getItemById(e,t){for(const i of t){if(i.id===e)return i;if(i.children&&Array.isArray(i.children)){const t=this.getItemById(e,i.children);if(t)return t}}}addItemInIndexedList(e,t,i){var r,s;i=null!==(r=null!=i?i:this.items)&&void 0!==r?r:[],e||i.push(t);const o=this.getItemById(e,i);o.children=null!==(s=o.children)&&void 0!==s?s:[],o.children.push(t),o.childrenCount=o.children.length}applyDefaultValues(e){return void 0===e.disabled&&(e.disabled=!1),void 0===e.expanded&&(e.expanded=!1),e}updateItemInIndexedList(e,t=!1){if(!e||!this.items)return;const i=this.getItemById(e.id,this.items);i&&Object.assign(i,t?this.applyDefaultValues(e):e)}removeItemFromIndexedList(e,t){var i;if(t=null!==(i=null!=t?t:this.items)&&void 0!==i?i:[],!e)return!1;const r=t.findIndex((t=>t.id===e));if(-1!==r)return t.splice(r,1),!0;for(const i of t)if(i.children&&Array.isArray(i.children)){const t=i.children.findIndex((t=>t.id===e));if(-1!==t)return i.children.splice(t,1),i.childrenCount=i.children.length,!0;if(this.removeItemFromIndexedList(e,i.children))return!0}return!1}getItemPathAttrs({id:e,label:t}){return{id:e,label:t}}openClose(e){if(null==e)return;const t=!e.expanded;e.expanded=t,t&&this.ezOpenItem.emit(e),this._tree.updateItem(e)}previousLevel(){var e;if(this.value)if(this.value.expanded)this.value.expanded=!1,this._tree.updateItem(this.value);else{const t=null===(e=this._tree.getNode(this.value.id).parent)||void 0===e?void 0:e.item;t&&(this.value=t)}}nextLevel(){this.value&&this._tree.getNode(this.value.id).isExpandable()&&(this.value.expanded?this.nextItem():(this.value.expanded=!0,this._tree.updateItem(this.value)))}indexOf(e){if(null==e)return-1;for(let t=0;t<this._visibleItems.length;t++)if(this._visibleItems[t].id===e)return t;return-1}selectNextItem(e){var t;const i=this.indexOf(null===(t=this.value)||void 0===t?void 0:t.id)+e;i>-1&&i<this._visibleItems.length&&(this.value=this._visibleItems[i])}nextItem(){this.selectNextItem(1)}previousItem(){this.selectNextItem(-1)}connectedCallback(){this.items&&this._tree.load(this.items)}async componentWillLoad(){this.i18n=await h()}componentWillRender(){var e;if(!this.selectedId||(null===(e=this.value)||void 0===e?void 0:e.id)===this.selectedId)return;const t=this._tree.getNode(this.selectedId);t&&(this.value=t.item)}render(){if(n.addIDInfoIfNotExists(this._element,"ezTree"),null!=this.items)return this._visibleItems=[],e(s,{tabindex:"-1"},this._waintingForLoad?e("label",null,this.i18n("app.loading"),"..."):this._tree.getChildren().map((t=>{var i;return e(u,{selectedId:null===(i=this.value)||void 0===i?void 0:i.id,node:t,itemClick:this._onItemClick,iconClick:this._onIconClick,iconResolver:this.iconResolver,tooltipResolver:this.tooltipResolver||d,itemsList:this._visibleItems,itemDoubleClick:e=>this.ezDbClickItem.emit(e)})})))}get _element(){return o(this)}static get watchers(){return{items:["observeItems"],value:["observeValue"]}}};b.style=":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:0px;--ez-tree--user-select:auto;--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree--font-weight--bold:var(--text-weight--large, 600);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;cursor:default;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center;overflow:hidden}.tree-item{display:flex;align-items:center;cursor:pointer;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;user-select:var(--ez-tree--user-select);font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";export{b as ez_tree}
|
|
1
|
+
import{h as e,r as t,c as i,f as r,H as s,g as o}from"./p-e4c7eb39.js";import{ElementIDUtils as n,StringUtils as l,ObjectUtils as a}from"@sankhyalabs/core";import{i as h}from"./p-641ee538.js";const c=(e,t)=>t?e.iconExpanded||"chevron-down":e.iconContracted||"chevron-right",d=e=>e.tooltip||e.label,u=t=>{const{node:i,selectedId:r,itemClick:s,iconClick:o,iconResolver:l,tooltipResolver:a,itemsList:h,itemDoubleClick:c}=t;if(!i.visible)return;const d=i.item,v=t.level||1,m=i.isDisabled(),b=!m&&d.expanded,g=i.isExpandable(),f=!m&&!i.isPlaceHolder;return f&&h.push(d),e("ul",{class:1===v?"first-level":void 0},e("li",Object.assign({title:a(d,!m,v),class:"tree-item "+(d.id!==r?"tree-item-error":""),onClick:()=>f&&s(d),onDblClick:()=>f&&c(d)},{disabled:m,selected:d.id===r,[n.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:n.getInternalIDInfo(`ezTreeItem_${d.id}`)}),e("div",{class:"item-label-container"},e("div",{class:"item-icon-box"},g&&e("ez-icon",{id:d.id,class:"item-icon",size:"small",iconName:l(d,b,v),onClick:e=>function(e){e.stopPropagation(),f&&o(d)}(e),onDblClick:e=>function(e){e.stopPropagation()}(e)})),e("label",{class:"item-label "+(d.bold?"item-label--bold":"")},d.label)),function(t,i,r){if(null!=i)return"string"==typeof i?e("div",{class:`tree-item-badge ${r?null:i}`},"error"===i&&e("ez-icon",{id:`${t}-badge-error`,class:"tree-item-badge-error-icon",size:"x-small",style:{color:"white"},iconName:"alert-circle"})):"text"===i.type?e("div",{id:`${t}-badge-text`,class:"tree-item-badge-text"},i.text):e("div",null,e("ez-icon",{id:`${t}-badge-icon`,class:"tree-item-badge-icon",style:{"--ez-icon--color":`var(--ez-tree__badge--icon-color--${i.iconColor||"default"})`},iconName:i.iconName}))}(d.id,d.badge,d.id===r)),b&&i.getChildren().map((t=>e(u,{selectedId:r,node:t,itemClick:s,iconClick:o,level:v+1,iconResolver:l,tooltipResolver:a,itemsList:h,itemDoubleClick:c}))))};class v{constructor(e,t,i,r=!1){this.children=new Map,this.visible=!0,this.item=t,this.parent=i,this._tree=e,this.isPlaceHolder=r,t&&!r?(this._isLazyLoad="function"==typeof t.children||t.childrenCount>0,Array.isArray(t.children)&&(Array.from(t.children).forEach((e=>this.addChild(this._tree,e))),this._childrenLoaded=!0)):(this._isLazyLoad=!1,this._childrenLoaded=!0)}refresh(e){if(this.isPlaceHolder)return;this.item=Object.assign({},e),this._isLazyLoad="function"==typeof this.item.children||this.item.childrenCount>0;const t=this.children;this.children=new Map,Array.isArray(this.item.children)?(void 0===this.item.expanded&&(this.item.expanded=!0),Array.from(this.item.children).forEach((e=>{const i=t.get(e.id);i?(void 0===e.expanded&&(e.expanded=i.item.expanded),i.refresh(e),this.children.set(e.id,i)):(void 0===e.expanded&&(e.expanded=!0),this.addChild(this._tree,Object.assign({},e)))})),this._childrenLoaded=!0):this._childrenLoaded=!1}isDisabled(){return!this.isPlaceHolder&&this._tree.isNodeDisabled(this.item.id,this.item.disabled)}updateChildren(e){this.isPlaceHolder||this.refresh(Object.assign(Object.assign({},this.item),{children:e}))}addChild(e,t){this.children.has(t.id)||this.children.set(t.id,new v(e,t,this))}removeChild(e){return!!this.children.has(e)&&(this.children.delete(e),!0)}addPlaceHolder(){this.children.clear();const e=this.item.id;this.children.set(e,new v(void 0,{id:`placeholder_${e}`,label:"Carregando..."},this,!0))}getNode(e){if(this.children.has(e))return this.children.get(e);const t=Array.from(this.children.values());for(const i of t){const t=i.getNode(e);if(t)return t}}needLoad(){return this._isLazyLoad&&!this._childrenLoaded}isExpandable(){return!!this._isLazyLoad||this.children.size>0}getChildren(){return this.isPlaceHolder?[]:(this.needLoad()&&this._tree.loadChildren(this),Array.from(this.children.values()))}}class m extends v{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,t){const i=this.getNode(e);if(null==i)return this.addChild(this,t),void this._changeCallback();i.addChild(this,t),this._changeCallback()}setDisabled(e,t){this._disabledValues.set(e,t),this._changeCallback()}isNodeDisabled(e,t){return this._disabledValues.has(e)?this._disabledValues.get(e):t}load(e){if(e===this._currentItems)return;this._currentItems=e;const t=this.children;this.children=new Map,this._disabledValues.clear(),e.forEach((e=>{const i=t.get(e.id);i?(i.refresh(e),this.children.set(e.id,i)):this.addChild(this,Object.assign({},e))}))}async setFilterPattern(e,t=!0){if(e&&t&&e.includes(".")){const t=e.split(".").map((e=>l.replaceAccentuatedCharsKeepSymbols(e.trim())));await this.applyLayeredFilter(this,t,0)}else this._filterPattern=l.replaceAccentuatedCharsKeepSymbols(e),this.setAllChildrenExpanded(this,!1),this.applyFilter(this);this._changeCallback()}updateItem(e){if(null==e)return;const t=this.getNode(e.id);null!=t&&(Object.keys(e).forEach((i=>t.item[i]=e[i])),null==e.children?t.children.clear():Array.isArray(e.children)&&t.updateChildren(e.children),this._changeCallback())}removeItem(e){if(!e)return;const t=this.getNode(e);t&&(t.parent?t.parent.removeChild(e):this.children.delete(e),this._disabledValues.delete(e),this._changeCallback())}async open(e){return new Promise((async t=>{await this.walkPath(this,e,(e=>e.item.expanded=!0)),t()}))}setAllChildrenVisible(e){e.children.forEach((e=>{e.visible=!0,this.setAllChildrenVisible(e)}))}applyFilter(e){if(!this._filterPattern)return e.visible=!0,void this.setAllChildrenVisible(e);if(e.children.forEach((e=>{this.applyFilter(e)})),null==e.item)return;let t=!1;if(l.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(this._filterPattern))t=!0,e.item.expanded=!0,this.setAllChildrenVisible(e);else{const i=Array.from(e.children.values());for(let r=0;r<i.length;r++)if(i[r].visible){t=!0,e.item.expanded=!0;break}}e.visible=t}async applyLayeredFilter(e,t,i){if(!e.item){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return e.visible=r,r}if(!l.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(t[i])){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}if(i===t.length-1)return e.visible=!0,this.setAllChildrenVisible(e),!0;const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i+1))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}async walkPath(e,t,i,r=0){return new Promise((async s=>{const o=t.split(">>").map((e=>e.trim()));if(o.length>r){const s=e.getNode(o[r]);s&&(s.needLoad()&&await this.loadLevel(s),i(s),await this.walkPath(s,t,i,r+1))}s()}))}async loadChildren(e){return new Promise((t=>{this.loadLevel(e).then((()=>{t(),this._changeCallback()}))}))}expandAll(){this.setAllChildrenExpanded(this,!0),this._changeCallback()}collapseAll(){this.setAllChildrenExpanded(this,!1),this._changeCallback()}setAllChildrenExpanded(e,t){e.item&&!e.isPlaceHolder&&(e.item.expanded=t),e.children.forEach((e=>{this.setAllChildrenExpanded(e,t)}))}async loadLevel(e){return new Promise((t=>{e.addPlaceHolder(),(0,e.item.children)(e.item).then((i=>{e.updateChildren(i),t()}))}))}}const b=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezOpenItem=i(this,"ezOpenItem",7),this.ezDbClickItem=i(this,"ezDbClickItem",7),this.ezRemoveItem=i(this,"ezRemoveItem",7),this._onItemClick=e=>{this.selectable?this.value=this.value&&this.value.id===e.id?void 0:e:this.openClose(e)},this._onIconClick=e=>{this.openClose(e)},this._tree=new m((()=>r(this))),this._waintingForLoad=void 0,this.items=[],this.value=void 0,this.selectedId=void 0,this.iconResolver=c,this.tooltipResolver=void 0,this.enableHierarchicalFilter=!0,this.selectable=!0}async selectItem(e){const t=this._tree.getNode(e);this.value=t?t.item:void 0}async openItem(e){this._waintingForLoad=!0,await this._tree.open(e),this._waintingForLoad=!1}async disableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!0)))}async enableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!1)))}async addChild(e,t){var i;null==t&&(t=null===(i=this.value)||void 0===i?void 0:i.id),this._tree.addChildAt(t,e),this.addItemInIndexedList(t,e);const r=this._tree.getNode(t);r?r.item.expanded=!0:this.collapseAll()}async applyFilter(e){await this._tree.setFilterPattern(e,this.enableHierarchicalFilter)}async expandAll(){this._tree.expandAll()}async collapseAll(){this._tree.collapseAll()}async updateItem(e,t){var i,r,s;if(Array.isArray(e))return void e.forEach((e=>this.updateItem(e,t)));if((null==t?void 0:t.updatedBySelectedId)&&Object.assign(e,{id:this.selectedId}),this._tree.updateItem((null==t?void 0:t.forceDefaultValues)?this.applyDefaultValues(e):e),this.updateItemInIndexedList(e,null==t?void 0:t.forceDefaultValues),null==(null===(i=this._tree)||void 0===i?void 0:i.getNode(this.selectedId))&&(this.value=this._visibleItems?this._visibleItems[0]:void 0,this._tree.collapseAll()),(null===(r=this.value)||void 0===r?void 0:r.id)===e.id)return this.value=e,void this.ezChange.emit(this.value);const o=this.getItemById(null===(s=this.value)||void 0===s?void 0:s.id,[e]);o&&(this.value=o,this.ezChange.emit(this.value))}async removeItem(e){var t;(e=null!=e?e:this.selectedId)&&(this._tree.removeItem(e),this.removeItemFromIndexedList(e),this.ezRemoveItem.emit(e),(null===(t=this.value)||void 0===t?void 0:t.id)===e&&(this.value=void 0))}async getItem(e){return new Promise((t=>{const i=this._tree.getNode(e);t(null==i?void 0:i.item)}))}async getCurrentPath(){var e,t,i;const r=null===(e=this._tree)||void 0===e?void 0:e.getNode(this.selectedId);if(null==r)return;const s=[];let o,n=null===(t=r.parent)||void 0===t?void 0:t.item;for(s.push(this.getItemPathAttrs(r.item));null!=n;)s.unshift(this.getItemPathAttrs(n)),o=this._tree.getNode(n.id),n=null===(i=null==o?void 0:o.parent)||void 0===i?void 0:i.item;return s}async getParent(e){return new Promise((t=>{var i;const r=this._tree.getNode(e);r&&t(null===(i=r.parent)||void 0===i?void 0:i.item),t(void 0)}))}observeItems(e,t){a.objectToString(e)!==a.objectToString(t)&&this._tree.load(this.items||[])}observeValue(){var e;this.ezChange.emit(this.value),this.selectedId=null===(e=this.value)||void 0===e?void 0:e.id}onKeyDownListener(e){if(!this.value)return;let t=!1;switch(e.key){case"ArrowUp":this.previousItem(),t=!0;break;case"ArrowDown":this.nextItem(),t=!0;break;case"ArrowLeft":this.previousLevel(),t=!0;break;case"ArrowRight":this.nextLevel(),t=!0;break;case" ":this.openClose(this.value),t=!0}t&&(e.stopPropagation(),e.preventDefault())}getItemById(e,t){for(const i of t){if(i.id===e)return i;if(i.children&&Array.isArray(i.children)){const t=this.getItemById(e,i.children);if(t)return t}}}addItemInIndexedList(e,t,i){var r,s;i=null!==(r=null!=i?i:this.items)&&void 0!==r?r:[],e||i.push(t);const o=this.getItemById(e,i);o.children=null!==(s=o.children)&&void 0!==s?s:[],o.children.push(t),o.childrenCount=o.children.length}applyDefaultValues(e){return void 0===e.disabled&&(e.disabled=!1),void 0===e.expanded&&(e.expanded=!1),e}updateItemInIndexedList(e,t=!1){if(!e||!this.items)return;const i=this.getItemById(e.id,this.items);i&&Object.assign(i,t?this.applyDefaultValues(e):e)}removeItemFromIndexedList(e,t){var i;if(t=null!==(i=null!=t?t:this.items)&&void 0!==i?i:[],!e)return!1;const r=t.findIndex((t=>t.id===e));if(-1!==r)return t.splice(r,1),!0;for(const i of t)if(i.children&&Array.isArray(i.children)){const t=i.children.findIndex((t=>t.id===e));if(-1!==t)return i.children.splice(t,1),i.childrenCount=i.children.length,!0;if(this.removeItemFromIndexedList(e,i.children))return!0}return!1}getItemPathAttrs({id:e,label:t}){return{id:e,label:t}}openClose(e){if(null==e)return;const t=!e.expanded;e.expanded=t,t&&this.ezOpenItem.emit(e),this._tree.updateItem(e)}previousLevel(){var e;if(this.value)if(this.value.expanded)this.value.expanded=!1,this._tree.updateItem(this.value);else{const t=null===(e=this._tree.getNode(this.value.id).parent)||void 0===e?void 0:e.item;t&&(this.value=t)}}nextLevel(){this.value&&this._tree.getNode(this.value.id).isExpandable()&&(this.value.expanded?this.nextItem():(this.value.expanded=!0,this._tree.updateItem(this.value)))}indexOf(e){if(null==e)return-1;for(let t=0;t<this._visibleItems.length;t++)if(this._visibleItems[t].id===e)return t;return-1}selectNextItem(e){var t;const i=this.indexOf(null===(t=this.value)||void 0===t?void 0:t.id)+e;i>-1&&i<this._visibleItems.length&&(this.value=this._visibleItems[i])}nextItem(){this.selectNextItem(1)}previousItem(){this.selectNextItem(-1)}connectedCallback(){this.items&&this._tree.load(this.items)}async componentWillLoad(){this.i18n=await h()}componentWillRender(){var e;if(!this.selectedId||(null===(e=this.value)||void 0===e?void 0:e.id)===this.selectedId)return;const t=this._tree.getNode(this.selectedId);t&&(this.value=t.item)}render(){if(n.addIDInfoIfNotExists(this._element,"ezTree"),null!=this.items)return this._visibleItems=[],e(s,{tabindex:"-1"},this._waintingForLoad?e("label",null,this.i18n("app.loading"),"..."):this._tree.getChildren().map((t=>{var i;return e(u,{selectedId:null===(i=this.value)||void 0===i?void 0:i.id,node:t,itemClick:this._onItemClick,iconClick:this._onIconClick,iconResolver:this.iconResolver,tooltipResolver:this.tooltipResolver||d,itemsList:this._visibleItems,itemDoubleClick:e=>this.ezDbClickItem.emit(e)})})))}get _element(){return o(this)}static get watchers(){return{items:["observeItems"],value:["observeValue"]}}};b.style=":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:0px;--ez-tree--user-select:auto;--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree--font-weight--bold:var(--text-weight--large, 600);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;cursor:default;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center;overflow:hidden}.tree-item{display:flex;align-items:center;cursor:pointer;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;user-select:var(--ez-tree--user-select);font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";export{b as ez_tree}
|
|
@@ -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 a,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as s,KeyboardManager as o}from"@sankhyalabs/core";const n=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezTagAdded=i(this,"ezTagAdded",7),this.ezTagRemoved=i(this,"ezTagRemoved",7),this.ezFocus=i(this,"ezFocus",7),this.ezBlur=i(this,"ezBlur",7),this.ezValidationError=i(this,"ezValidationError",7),this.ezType=i(this,"ezType",7),this.handleInputChange=t=>{this._inputElement.value=t.target.value,this.ezType.emit(this._inputElement.value)},this.handleInputKeyDown=t=>{"Backspace"===t.key&&""===this._inputElement.value&&this.tags.length>0&&!this.suppressBackspaceToRemove&&this.handleRemoveTag(this.tags[this.tags.length-1])},this.handleInputFocus=()=>{this.ezFocus.emit(this.tags)},this.handleInputBlur=()=>{this.ezBlur.emit(this.tags)},this.handleTagClick=(t,i)=>{this.enabled&&!this.readonly&&(this.handleRemoveTag(t),this.updateTagFocus(i))},this.handleClearInput=()=>{this._inputElement.value=""},this.label="",this.placeholder="",this.helpText=void 0,this.enabled=!0,this.readonly=!1,this.name=void 0,this.tags=[],this.maxTagLength=void 0,this.maxTags=void 0,this.allowDuplicates=!1,this.state="default",this.validator=void 0,this.suppressTagsKeyboardNavigation=!1,this.suppressBackspaceToRemove=!1}async setFocus(t){(null==t?void 0:t.selectText)&&this._inputElement.select(),(null==t?void 0:t.preventScroll)||this._inputElement.scrollIntoView({behavior:"smooth",block:"center"}),this._inputElement.focus({preventScroll:!0})}async setBlur(){this._inputElement.blur()}async addTag(t){return this.handleAddTag(t)}async removeTag(t){return this.handleRemoveTag(t)}async clearTags(){this.tags=[],this.ezChange.emit([...this.tags])}addInfoId(){this._element&&s.addIDInfo(this._element),this._inputElement&&s.addIDInfo(this._inputElement,"tag-input",{id:"embedded"})}initializeKeyboardManager(){this._keyboardManager=new o({propagate:!0,element:this._element}).bind("Enter",(()=>this.handleAddCurrentTag())).bind("Tab",(()=>this.handleAddCurrentTag())).bind("Escape",(()=>this.handleClearInput())).bind("ArrowLeft",(()=>this.handlePreviousTagFocus())).bind("ArrowRight",(()=>this.handleNextTagFocus()))}handleAddCurrentTag(){if(this._inputElement.value.trim()){const t=this.handleAddTag(this._inputElement.value);return t&&(this._inputElement.value=""),t}return!1}handleAddTag(t){const i=t.trim();if(!this.enabled||this.readonly)return!1;if(!i||0===i.length)return!1;if(this.maxTagLength&&i.length>this.maxTagLength)return!1;if(this.maxTags&&this.tags.length>=this.maxTags)return!1;if(!this.allowDuplicates&&this.tags.includes(i))return!1;if(this.validator){const t=this.validator(i,[...this.tags]);if(!1===t)return this.ezValidationError.emit({tag:i,error:void 0}),!1;if("string"==typeof t)return this.ezValidationError.emit({tag:i,error:t}),!1}return this.tags=[...this.tags,i],this.ezChange.emit([...this.tags]),this.ezTagAdded.emit(i),!0}async updateTagFocus(t){var i;if(!(null===(i=this.tags)||void 0===i?void 0:i.length)||this.suppressTagsKeyboardNavigation)return void await this.setFocus();if(!t)return;const e=this._element.shadowRoot.querySelector("#tag-"+(t-1));e&&await e.setFocus()}getCurrentActiveTagIndex(){var t;const i=this._element.shadowRoot.activeElement;if(!(null===(t=this.tags)||void 0===t?void 0:t.length)||"ez-chip"!==i.tagName.toLowerCase())return null;const e=parseInt(i.id.split("-")[1],10);return Number.isNaN(e)||e<0||e>=this.tags.length?null:e}async setTagFocus(t){const i=this._element.shadowRoot.querySelector(`#tag-${t}`);i&&await i.setFocus()}async handlePreviousTagFocus(){if(this.suppressTagsKeyboardNavigation||!this.enabled||this.readonly)return;if(this._element.shadowRoot.activeElement===this._inputElement)return void await this.setTagFocus(this.tags.length-1);const t=this.getCurrentActiveTagIndex();null!==t?0!==t&&await this.setTagFocus(t-1):await this.setFocus()}async handleNextTagFocus(){if(this.suppressTagsKeyboardNavigation||!this.enabled||this.readonly)return;const t=this.getCurrentActiveTagIndex();null===t||t>=this.tags.length-1?await this.setFocus():await this.setTagFocus(t+1)}handleRemoveTag(t){return!(!this.enabled||this.readonly)&&(-1!==this.tags.indexOf(t)&&(this.tags=this.tags.filter((i=>i!==t)),this.ezChange.emit([...this.tags]),this.ezTagRemoved.emit(t),!0))}async componentWillLoad(){this.tags||(this.tags=[])}componentDidLoad(){this.addInfoId(),this.initializeKeyboardManager()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}render(){return e(a,null,e("label",{htmlFor:this.name},this.label),e("div",{class:"tag-input__container","data-state":this.state,"data-disabled":(!this.enabled).toString(),onClick:()=>this.setFocus({preventScroll:!0})},this.tags.map(((t,i)=>e("ez-chip",{key:`tag-${i}`,id:`tag-${i}`,label:t,enabled:this.enabled&&!this.readonly,removePosition:this.enabled&&!this.readonly?"right":void 0,mode:"label",onRemoveChip:()=>this.handleTagClick(t,i),tabIndex:this.suppressTagsKeyboardNavigation||!this.enabled||this.readonly?-1:0,disableAutoUpdateValue:!0,removeWithKeyboard:!0}))),e("input",{ref:t=>this._inputElement=t,id:this.name,type:"text",placeholder:this.placeholder,disabled:!this.enabled,readonly:this.readonly,maxlength:this.maxTagLength,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur})),this.helpText&&e("span",{title:this.helpText},this.helpText))}get _element(){return r(this)}};n.style=':host{--ez-tag-input--background-color:var(--color--gray-70, #FFFFFF);--ez-tag-input--border-color-default:var(--color--gray-200, #D2D2D3);--ez-tag-input--border-color-focused:var(--color--gray-300, #A4A5A7);--ez-tag-input--border-color-error:var(--color--red-600, #BD0025);--ez-tag-input--border-color-success:var(--color--green-600, #157A00);--ez-tag-input--border-color-warning:var(--color--yellow-600, #EFB103);--ez-tag-input--border-radius:var(--border--radius-8, 8px);--ez-tag-input--padding:var(--space--12, 12px);--ez-tag-input--gap:var(--space--8, 8px);--ez-tag-input--label-color:var(--color--petroleum-900, #141B27);--ez-tag-input--label-font-weight:var(--font-weight--regular, 400);--ez-tag-input--input-color:var(--color--petroleum-900, #141B27);--ez-tag-input--input-font-size:var(--font-size--default, 14px);--ez-tag-input--placeholder-color:var(--color--gray-400, #77777A);--ez-tag-input--background-color-disabled:var(--color--gray-90, #EAEAEA);--ez-tag-input--helptext-color:var(--color--ocean-green-1000, #00281D);display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;font-family:var(--font--pattern, \'Roboto\', Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);width:100%;border:none;padding:0}label{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--line-height--20, 20px);color:var(--ez-tag-input--label-color);font-weight:var(--ez-tag-input--label-font-weight)}.tag-input__container{display:flex;flex-wrap:wrap;align-items:center;width:100%;box-sizing:border-box;gap:var(--ez-tag-input--gap);padding:var(--ez-tag-input--padding);margin:var(--space--4, 4px) 0;background-color:var(--ez-tag-input--background-color);border-radius:var(--ez-tag-input--border-radius);transition:box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1)}.tag-input__container,.tag-input__container[data-state="default"]{box-shadow:0 0 0 1px var(--ez-tag-input--border-color-default)}.tag-input__container[data-state="error"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-error)}.tag-input__container[data-state="success"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-success)}.tag-input__container[data-state="warning"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-warning)}.tag-input__container:focus-within{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-focused)}input{flex:1;height:var(--space--24, 24px);background:transparent;border:none;outline:none;color:var(--ez-tag-input--input-color);font-family:var(--font--pattern, \'Roboto\');font-size:var(--ez-tag-input--input-font-size);font-weight:var(--font-weight--regular, 400);line-height:var(--line-height--20, 20px)}input::placeholder{color:var(--ez-tag-input--placeholder-color)}.tag-input__container[data-disabled="true"]{cursor:not-allowed;background:var(--ez-tag-input--background-color-disabled);box-shadow:0 0 0 1px var(--ez-tag-input--border-color-default)}.tag-input__container[data-disabled="true"]>*{cursor:not-allowed}input:read-only .tag-input__container>*{cursor:default}@keyframes ez-helptext-fadein{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-tag-input--helptext-color)}';export{n as ez_tag_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as r,h as a,H as e,g as i}from"./p-
|
|
1
|
+
import{r as o,c as r,h as a,H as e,g as i}from"./p-e4c7eb39.js";import{ElementIDUtils as t}from"@sankhyalabs/core";const d=class{constructor(a){o(this,a),this.ezChange=r(this,"ezChange",7),this.value=void 0,this.options=[],this.enabled=!0,this.label=void 0,this.direction="vertical"}componentDidLoad(){this.hostElement&&t.addIDInfo(this.hostElement,"input")}componentWillRender(){this._options=[...this.options];const o=this.hostElement.querySelectorAll("ez-radio-button-option");o&&o.forEach((o=>{let r=o.getAttribute("label"),a=o.getAttribute("value");this._options.push({label:r,value:a})}))}handleInputChange(o){this.value=o.target.value,this.ezChange.emit(this.value)}render(){return a(e,null,this.label&&a("label",{class:"label"},this.label),a("div",{class:"form form--"+this.direction},this._options.map(((o,r)=>a("div",{class:"form__group"},a("input",{id:"rad"+r,class:"form__radio",name:"theradio",type:"radio",value:o.value,onChange:o=>{this.handleInputChange(o)},disabled:!this.enabled,checked:o.value===this.value,"data-element-id":t.getInternalIDInfo(`input_${o.value}`)}),a("label",{htmlFor:"rad"+r,class:"form__label"},o.label))))))}get hostElement(){return i(this)}};d.style=":host{--ez-radio-button--font-family:var(--font-pattern, Arial);--ez-radio-button--font-size:var(--text--medium, 14px);--ez-radio-button--font-weight:var(--text-weight--large);--ez-radio-button--font-color:var(--title--primary, #2B3A54);--ez-radio-button--padding-vertical:var(--space--medium, 12px);--ez-radio-button--padding-horizontal:var(--space--small, 6px);--ez-radio-button__form-label--font-family:var(--font-pattern, Arial);--ez-radio-button__form-label--font-weight:var(--text-weight--medium, 400);--ez-radio-button__form-label--title-primary:var(--title--primary, #2B3A54);--ez-radio-button__form-label--font-size:var(--text--medium, 14px);--ez-radio-button__form-label--padding-horizontal:var(--space--medium, 12px);--ez-radio-button__form-radio--border-color:var(--title--primary, #2B3A54);--ez-radio-button__form-radio--checked--color:var(--color--primary, #008561);--ez-radio-button__form-radio--disabled--border-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--disabled--background-color:var(--background--medium, #f0f3f7);--ez-radio-button__form-radio--disabled--color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--disabled--before--background-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--focus--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--box-shadow-color:var(--background--strong, #e4eaf1);--ez-radio-button__form-radio--checked--focus--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--focus--box-shadow-color:var(--color--primary-300, #e2f4ef);--ez-radio-button__form-radio--checked--hover--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--hover--box-shadow-color:#daece7;--ez-radio-button__form-radio--hover--box-shadow-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--checked--disabled--hover--background-color:var(--background--medium, #f0f3f7);display:flex;width:100%;flex-direction:column;align-items:flex-start;box-sizing:border-box}.form{padding:var(--ez-radio-button--padding-vertical) var(--ez-radio-button--padding-horizontal);gap:var(--ez-radio-button__form-label--padding-horizontal)}.form--vertical{display:flex;flex-direction:column}.form--horizontal{display:flex;flex-direction:row}.form__group{display:grid;grid-template-columns:20px auto;align-items:center}.label{font-family:var(--ez-radio-button--font-family);font-size:var(--ez-radio-button--font-size);font-weight:var(--ez-radio-button--font-weight);color:var(--ez-radio-button--font-color)}.form__label{cursor:pointer;font-weight:var(--ez-radio-button__form-label--font-weight);color:var(--ez-radio-button__form-label--title-primary);font-family:var(--ez-radio-button__form-label--font-family);font-size:var(--ez-radio-button__form-label--font-size);padding-left:var(--ez-radio-button__form-label--padding-horizontal);padding-right:var(--ez-radio-button__form-label--padding-horizontal)}.form__radio{cursor:pointer;appearance:none;outline:none;position:relative;display:flex;align-items:center;justify-content:center;margin:0;padding:0;width:20px;height:20px;border-radius:50%;border:2px solid var(--ez-radio-button__form-radio--border-color)}.form__radio::before{content:'';display:block;position:absolute;opacity:0;transition:all 300ms ease-in-out;height:100%;width:100%;border-radius:50%;transform:scale(0.5);background:var(--ez-radio-button__form-radio--checked--color)}.form__radio:checked:before{opacity:1}.form__radio:checked{border:2px solid var(--ez-radio-button__form-radio--checked--color)}.form__radio:disabled{cursor:default;border:2px solid var(--ez-radio-button__form-radio--disabled--border-color);background-color:var(--ez-radio-button__form-radio--disabled--background-color)}.form__radio:disabled:hover{box-shadow:inherit}input[type=radio]:disabled~label{cursor:default;color:var(--ez-radio-button__form-radio--disabled--color)}.form__radio:disabled:before{background:var(--ez-radio-button__form-radio--disabled--before--background-color)}.form__radio:focus{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--focus--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--box-shadow-color)}.form__radio:checked:focus{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--checked--focus--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--focus--box-shadow-color)}.form__radio:checked:hover{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--checked--hover--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--hover--box-shadow-color)}.form__radio:hover{transition:0.25s linear;box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--hover--box-shadow-color)}.form__radio:checked:disabled:hover{box-shadow:none;background-color:var(--ez-radio-button__form-radio--checked--disabled--hover--background-color)}";export{d as ez_radio_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as a,F as s}from"./p-23a36bb6.js";import{a as o,b as r,R as l}from"./p-3e767a74.js";import{i as n}from"./p-641ee538.js";import"@sankhyalabs/core";const c=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.textToShow=void 0,this.link=void 0,this.openInNewGuide=!1}async show(e){this._popupElement.opened=!0,e&&(this.textToShow=e)}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.clearValues(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}clearValues(){this.link="",this.textToShow="",this.openInNewGuide=!1}async handleCreateLink(){this.executeToolbarCommand.emit({command:o.FORMAT,value:`<a href="${this.link}" ${this.openInNewGuide?'target="_blank" rel="noopener noreferrer"':""}>${this.textToShow?this.textToShow:this.link}</a>`}),this.clearValues(),await this.hide()}async handleActionPopup(e){"OK"!==e.detail?"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel():await this.handleCreateLink()}getOkButtonStatus(){var e;return(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{heightMode:"auto",size:"small",useHeader:!1,ref:e=>this._popupElement=e,onEzClosePopup:()=>this.clearValues()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-link-builder.addLinkTitle"),modalSubTitle:this.i18n("ez-link-builder.addLinkSubtitle"),okButtonLabel:this.i18n("ez-link-builder.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"link-builder-container"},i("ez-text-input",{id:"link_url_input",label:this.i18n("ez-link-builder.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail}),i("ez-text-input",{id:"link_text_input",label:this.i18n("ez-link-builder.textInputLabel"),value:this.textToShow,onEzChange:e=>this.textToShow=e.detail}),i("ez-check",{label:this.i18n("ez-link-builder.openInNewPage"),value:this.openInNewGuide,onEzChange:e=>this.openInNewGuide=e.detail})))))}};c.style=".link-builder-container.sc-ez-link-builder{font-family:'Roboto';color:#2b3a54;display:flex;flex-direction:column;gap:10px;justify-content:space-between}.header.sc-ez-link-builder{display:flex;font-weight:500;font-size:16px}.actions.sc-ez-link-builder{display:flex;justify-content:flex-end;gap:12px;margin-top:12px;width:100%}";const h=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.showPreview=!0,this.isPreviewMode=!1,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}async componentWillLoad(){this.i18n=await n()}handleActionTriggered(e){this.executeToolbarCommand.emit({command:e.detail.command,value:e.detail.value})}handleClickPreview(){this.executeToolbarCommand.emit({command:o.PREVIEW})}renderArrows(){if(this.showUndoRedo)return i("div",{id:"rich-toolbar-undo-redo",class:"taskbar-group"},i("ez-rich-toolbar-arrows",null))}renderLetters(){if(this.showTextFormat)return i("div",{id:"rich-toolbar-text-format",class:"taskbar-group"},i("ez-rich-toolbar-letters",null))}renderConfigs(){if(this.showConfigs)return i("div",{id:"rich-toolbar-options-configs",class:"taskbar-group"},i("ez-rich-toolbar-configs",null))}renderPreview(){if(this.showPreview)return i("div",{class:"taskbar-group"},i("span",{id:"rich-text-preview-btn",class:"preview-btn",title:this.getPreviewTitle(),onClick:this.handleClickPreview.bind(this)},this.i18n(this.isPreviewMode?"ez-rich-text.edit":"ez-rich-text.preview")))}getPreviewTitle(){return this.i18n(this.isPreviewMode?"ez-rich-text.title.edit":"ez-rich-text.title.preview")}render(){return i(a,null,i("div",{class:"taskbar"},this.renderPreview(),this.renderArrows(),this.renderLetters(),this.renderConfigs()))}};h.style=".sc-ez-rich-toolbar-h{display:block;width:100%}.taskbar.sc-ez-rich-toolbar{display:flex;padding:8px;border-radius:4px 4px 0 0}.taskbar-group.sc-ez-rich-toolbar{display:flex;margin-right:15px;padding-right:15px;border-right:1px solid #ddd}.taskbar-group.sc-ez-rich-toolbar:last-child{border-right:none}.preview-btn.sc-ez-rich-toolbar{font-family:Roboto;font-size:14px;background:none;display:flex;align-items:center;padding:0 8px;border-radius:4px;cursor:pointer;color:var(--color--secondary, #383c45);transition:0.3s all ease-in-out;width:110px;justify-content:center}.preview-btn.sc-ez-rich-toolbar:hover{background-color:#f5f5f5}";const d=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.UNDO,command:o.UNDO,title:this.i18n("ez-rich-text.title.undo")}),i("ez-rich-toolbar-item",{icon:r.REDO,command:o.REDO,title:this.i18n("ez-rich-text.title.redo")}))}};d.style=".sc-ez-rich-toolbar-arrows-h{display:flex;gap:5px}";const p=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.LIST,command:o.FORMAT,value:l.LIST,title:this.i18n("ez-rich-text.title.list")}),i("ez-rich-toolbar-item",{icon:r.IMAGE,command:o.IMAGE,title:this.i18n("ez-rich-text.title.image")}),i("ez-rich-toolbar-item",{icon:r.LINK,command:o.LINK,title:this.i18n("ez-rich-text.title.link")}))}};p.style=".sc-ez-rich-toolbar-configs-h{display:flex;gap:5px}";const u=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.BOLD,command:o.FORMAT,value:l.BOLD,title:this.i18n("ez-rich-text.title.bold")}),i("ez-rich-toolbar-item",{icon:r.ITALIC,command:o.FORMAT,value:l.ITALIC,title:this.i18n("ez-rich-text.title.italic")}),i("ez-rich-toolbar-item",{icon:r.UNDERLINE,command:o.FORMAT,value:l.UNDERLINE,title:this.i18n("ez-rich-text.title.underline")}))}};function m(e,t=1){if(0===e)return"0 Bytes";const i=t<0?0:t,a=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,a)).toFixed(i))+" "+["Bytes","Kilobytes","Megabytes","Gigabytes","Terabytes","Petabytes","Exabytes","Zettabytes","Yottabytes"][a]}u.style=".sc-ez-rich-toolbar-letters-h{display:flex;gap:5px}";const b=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.link=void 0,this.base64=void 0,this.messageError=void 0,this.selectedFile=void 0,this.maxSize=500}async show(){this._popupElement.opened=!0}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.removeSelectedFile(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}removeSelectedFile(e){null==e||e.stopPropagation(),this.link=void 0,this.base64=void 0,this.selectedFile=void 0,this.messageError=void 0}triggerFileSelect(){this.selectedFile||this._fileInput.click()}async handleImage(e){const t=e&&e[0];t&&(t.size<1e3*this.maxSize?(this.selectedFile=t,this.base64=await function(e){return new Promise(((t,i)=>{try{const i=new FileReader;i.onload=()=>{t(i.result)},i.readAsDataURL(e)}catch(e){i(e)}}))}(t)):this.messageError=this.i18n("ez-simple-image-uploader.imageTooLarge",{maxSize:m(this.maxSize)}))}getFileList(e){return e instanceof DragEvent?Array.from(e.dataTransfer.files):e.target.files}handleFileChange(e){e.preventDefault(),this.messageError=void 0,this._dropZone.classList.remove("dragging");const t=this.getFileList(e);this.handleImage(t),e.target.value=""}handleDragOver(e){e.stopPropagation(),e.preventDefault()}handleDragEnter(e){e.preventDefault(),this._dropZone.classList.add("dragging")}handleDragLeave(e){e.preventDefault(),this._dropZone.contains(e.relatedTarget)||this._dropZone.classList.remove("dragging")}async handleActionPopup(e){"OK"===e.detail?await this.handleCreateImgTag():"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel()}async handleCreateImgTag(){var e;const t=`<img src="${null!==(e=this.base64)&&void 0!==e?e:this.link}" alt="${this.i18n("ez-simple-image-uploader.imageAlt")}" />`;this.executeToolbarCommand.emit({command:o.FORMAT,value:t}),this.removeSelectedFile(),await this.hide()}getOkButtonStatus(){var e;return this.base64||(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{ref:e=>this._popupElement=e,heightMode:"auto",size:"small",useHeader:!1,onEzClosePopup:()=>this.handleCancel()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-simple-image-uploader.uploadTitle"),modalSubTitle:this.i18n("ez-simple-image-uploader.uploadSubtitle"),okButtonLabel:this.i18n("ez-simple-image-uploader.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"image-uploader-container"},i("ez-tooltip",{message:this.i18n("ez-simple-image-uploader.tooltipMessage"),active:!!this.selectedFile},i("ez-text-input",{label:this.i18n("ez-simple-image-uploader.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail,enabled:!this.selectedFile})),i("span",null,this.i18n("ez-simple-image-uploader.orText")),i("section",{class:"drop-zone-section"},i("div",{ref:e=>this._dropZone=e,class:"drop-zone",onDrop:e=>this.handleFileChange(e),onDragOver:e=>this.handleDragOver(e),onDragEnter:e=>this.handleDragEnter(e),onDragLeave:e=>this.handleDragLeave(e)},i("div",{class:{"drop-zone-container":!0,clickable:!this.selectedFile},onClick:()=>this.triggerFileSelect()},this.selectedFile?i(s,null,i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.selectedFile.name," (",m(this.selectedFile.size),")"),i("button",{class:"button-close",onClick:e=>this.removeSelectedFile(e),title:this.i18n("ez-simple-image-uploader.removeFile")},i("ez-icon",{iconName:"close"}))):i(s,null,i("ez-icon",{iconName:"anexo"}),i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.i18n("ez-simple-image-uploader.dragDropText")))),i("input",{ref:e=>this._fileInput=e,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>this.handleFileChange(e)})),!!this.messageError&&i("span",{class:"text-error"},this.messageError))))))}};b.style='.image-uploader-container.sc-ez-simple-image-uploader{font-family:"Roboto";color:#2b3a54;display:flex;flex-direction:column;gap:var(--space--10, 10px);justify-content:space-between;align-items:center;padding-bottom:var(--space--8, 8px)}.header.sc-ez-simple-image-uploader{display:flex;font-weight:500;font-size:var(--font-size--medium, 16px)}.actions.sc-ez-simple-image-uploader{display:flex;justify-content:flex-end;gap:var(--space--12, 12px);margin-top:var(--space--12, 12px);width:100%}.drop-zone-section.sc-ez-simple-image-uploader{width:100%}.drop-zone.sc-ez-simple-image-uploader{display:flex;flex-wrap:wrap;background-color:var(--color--petroleum-70, #F4F6F9);padding:var(--space--6, 6px);width:100%;border-radius:var(--space--12, 12px);box-sizing:border-box;min-height:100px}.clickable.sc-ez-simple-image-uploader{cursor:pointer}.dragging.sc-ez-simple-image-uploader{background-color:var(--color--petroleum-100, #C8CCD3)}.drop-zone-container.sc-ez-simple-image-uploader{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:6px;box-sizing:border-box}.text-error.sc-ez-simple-image-uploader{font-family:var(--font--pattern, "Roboto");color:var(--color--red-600, #BD0025);font-size:var(--font-size--small, 12px)}.button-close.sc-ez-simple-image-uploader{border:none;background:none;cursor:pointer}';export{c as ez_link_builder,h as ez_rich_toolbar,d as ez_rich_toolbar_arrows,p as ez_rich_toolbar_configs,u as ez_rich_toolbar_letters,b as ez_simple_image_uploader}
|
|
1
|
+
import{r as e,c as t,h as i,H as a,F as s}from"./p-e4c7eb39.js";import{a as o,b as r,R as l}from"./p-3e767a74.js";import{i as n}from"./p-641ee538.js";import"@sankhyalabs/core";const c=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.textToShow=void 0,this.link=void 0,this.openInNewGuide=!1}async show(e){this._popupElement.opened=!0,e&&(this.textToShow=e)}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.clearValues(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}clearValues(){this.link="",this.textToShow="",this.openInNewGuide=!1}async handleCreateLink(){this.executeToolbarCommand.emit({command:o.FORMAT,value:`<a href="${this.link}" ${this.openInNewGuide?'target="_blank" rel="noopener noreferrer"':""}>${this.textToShow?this.textToShow:this.link}</a>`}),this.clearValues(),await this.hide()}async handleActionPopup(e){"OK"!==e.detail?"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel():await this.handleCreateLink()}getOkButtonStatus(){var e;return(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{heightMode:"auto",size:"small",useHeader:!1,ref:e=>this._popupElement=e,onEzClosePopup:()=>this.clearValues()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-link-builder.addLinkTitle"),modalSubTitle:this.i18n("ez-link-builder.addLinkSubtitle"),okButtonLabel:this.i18n("ez-link-builder.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"link-builder-container"},i("ez-text-input",{id:"link_url_input",label:this.i18n("ez-link-builder.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail}),i("ez-text-input",{id:"link_text_input",label:this.i18n("ez-link-builder.textInputLabel"),value:this.textToShow,onEzChange:e=>this.textToShow=e.detail}),i("ez-check",{label:this.i18n("ez-link-builder.openInNewPage"),value:this.openInNewGuide,onEzChange:e=>this.openInNewGuide=e.detail})))))}};c.style=".link-builder-container.sc-ez-link-builder{font-family:'Roboto';color:#2b3a54;display:flex;flex-direction:column;gap:10px;justify-content:space-between}.header.sc-ez-link-builder{display:flex;font-weight:500;font-size:16px}.actions.sc-ez-link-builder{display:flex;justify-content:flex-end;gap:12px;margin-top:12px;width:100%}";const h=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.showPreview=!0,this.isPreviewMode=!1,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}async componentWillLoad(){this.i18n=await n()}handleActionTriggered(e){this.executeToolbarCommand.emit({command:e.detail.command,value:e.detail.value})}handleClickPreview(){this.executeToolbarCommand.emit({command:o.PREVIEW})}renderArrows(){if(this.showUndoRedo)return i("div",{id:"rich-toolbar-undo-redo",class:"taskbar-group"},i("ez-rich-toolbar-arrows",null))}renderLetters(){if(this.showTextFormat)return i("div",{id:"rich-toolbar-text-format",class:"taskbar-group"},i("ez-rich-toolbar-letters",null))}renderConfigs(){if(this.showConfigs)return i("div",{id:"rich-toolbar-options-configs",class:"taskbar-group"},i("ez-rich-toolbar-configs",null))}renderPreview(){if(this.showPreview)return i("div",{class:"taskbar-group"},i("span",{id:"rich-text-preview-btn",class:"preview-btn",title:this.getPreviewTitle(),onClick:this.handleClickPreview.bind(this)},this.i18n(this.isPreviewMode?"ez-rich-text.edit":"ez-rich-text.preview")))}getPreviewTitle(){return this.i18n(this.isPreviewMode?"ez-rich-text.title.edit":"ez-rich-text.title.preview")}render(){return i(a,null,i("div",{class:"taskbar"},this.renderPreview(),this.renderArrows(),this.renderLetters(),this.renderConfigs()))}};h.style=".sc-ez-rich-toolbar-h{display:block;width:100%}.taskbar.sc-ez-rich-toolbar{display:flex;padding:8px;border-radius:4px 4px 0 0}.taskbar-group.sc-ez-rich-toolbar{display:flex;margin-right:15px;padding-right:15px;border-right:1px solid #ddd}.taskbar-group.sc-ez-rich-toolbar:last-child{border-right:none}.preview-btn.sc-ez-rich-toolbar{font-family:Roboto;font-size:14px;background:none;display:flex;align-items:center;padding:0 8px;border-radius:4px;cursor:pointer;color:var(--color--secondary, #383c45);transition:0.3s all ease-in-out;width:110px;justify-content:center}.preview-btn.sc-ez-rich-toolbar:hover{background-color:#f5f5f5}";const d=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.UNDO,command:o.UNDO,title:this.i18n("ez-rich-text.title.undo")}),i("ez-rich-toolbar-item",{icon:r.REDO,command:o.REDO,title:this.i18n("ez-rich-text.title.redo")}))}};d.style=".sc-ez-rich-toolbar-arrows-h{display:flex;gap:5px}";const p=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.LIST,command:o.FORMAT,value:l.LIST,title:this.i18n("ez-rich-text.title.list")}),i("ez-rich-toolbar-item",{icon:r.IMAGE,command:o.IMAGE,title:this.i18n("ez-rich-text.title.image")}),i("ez-rich-toolbar-item",{icon:r.LINK,command:o.LINK,title:this.i18n("ez-rich-text.title.link")}))}};p.style=".sc-ez-rich-toolbar-configs-h{display:flex;gap:5px}";const u=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.BOLD,command:o.FORMAT,value:l.BOLD,title:this.i18n("ez-rich-text.title.bold")}),i("ez-rich-toolbar-item",{icon:r.ITALIC,command:o.FORMAT,value:l.ITALIC,title:this.i18n("ez-rich-text.title.italic")}),i("ez-rich-toolbar-item",{icon:r.UNDERLINE,command:o.FORMAT,value:l.UNDERLINE,title:this.i18n("ez-rich-text.title.underline")}))}};function m(e,t=1){if(0===e)return"0 Bytes";const i=t<0?0:t,a=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,a)).toFixed(i))+" "+["Bytes","Kilobytes","Megabytes","Gigabytes","Terabytes","Petabytes","Exabytes","Zettabytes","Yottabytes"][a]}u.style=".sc-ez-rich-toolbar-letters-h{display:flex;gap:5px}";const b=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.link=void 0,this.base64=void 0,this.messageError=void 0,this.selectedFile=void 0,this.maxSize=500}async show(){this._popupElement.opened=!0}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.removeSelectedFile(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}removeSelectedFile(e){null==e||e.stopPropagation(),this.link=void 0,this.base64=void 0,this.selectedFile=void 0,this.messageError=void 0}triggerFileSelect(){this.selectedFile||this._fileInput.click()}async handleImage(e){const t=e&&e[0];t&&(t.size<1e3*this.maxSize?(this.selectedFile=t,this.base64=await function(e){return new Promise(((t,i)=>{try{const i=new FileReader;i.onload=()=>{t(i.result)},i.readAsDataURL(e)}catch(e){i(e)}}))}(t)):this.messageError=this.i18n("ez-simple-image-uploader.imageTooLarge",{maxSize:m(this.maxSize)}))}getFileList(e){return e instanceof DragEvent?Array.from(e.dataTransfer.files):e.target.files}handleFileChange(e){e.preventDefault(),this.messageError=void 0,this._dropZone.classList.remove("dragging");const t=this.getFileList(e);this.handleImage(t),e.target.value=""}handleDragOver(e){e.stopPropagation(),e.preventDefault()}handleDragEnter(e){e.preventDefault(),this._dropZone.classList.add("dragging")}handleDragLeave(e){e.preventDefault(),this._dropZone.contains(e.relatedTarget)||this._dropZone.classList.remove("dragging")}async handleActionPopup(e){"OK"===e.detail?await this.handleCreateImgTag():"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel()}async handleCreateImgTag(){var e;const t=`<img src="${null!==(e=this.base64)&&void 0!==e?e:this.link}" alt="${this.i18n("ez-simple-image-uploader.imageAlt")}" />`;this.executeToolbarCommand.emit({command:o.FORMAT,value:t}),this.removeSelectedFile(),await this.hide()}getOkButtonStatus(){var e;return this.base64||(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{ref:e=>this._popupElement=e,heightMode:"auto",size:"small",useHeader:!1,onEzClosePopup:()=>this.handleCancel()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-simple-image-uploader.uploadTitle"),modalSubTitle:this.i18n("ez-simple-image-uploader.uploadSubtitle"),okButtonLabel:this.i18n("ez-simple-image-uploader.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"image-uploader-container"},i("ez-tooltip",{message:this.i18n("ez-simple-image-uploader.tooltipMessage"),active:!!this.selectedFile},i("ez-text-input",{label:this.i18n("ez-simple-image-uploader.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail,enabled:!this.selectedFile})),i("span",null,this.i18n("ez-simple-image-uploader.orText")),i("section",{class:"drop-zone-section"},i("div",{ref:e=>this._dropZone=e,class:"drop-zone",onDrop:e=>this.handleFileChange(e),onDragOver:e=>this.handleDragOver(e),onDragEnter:e=>this.handleDragEnter(e),onDragLeave:e=>this.handleDragLeave(e)},i("div",{class:{"drop-zone-container":!0,clickable:!this.selectedFile},onClick:()=>this.triggerFileSelect()},this.selectedFile?i(s,null,i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.selectedFile.name," (",m(this.selectedFile.size),")"),i("button",{class:"button-close",onClick:e=>this.removeSelectedFile(e),title:this.i18n("ez-simple-image-uploader.removeFile")},i("ez-icon",{iconName:"close"}))):i(s,null,i("ez-icon",{iconName:"anexo"}),i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.i18n("ez-simple-image-uploader.dragDropText")))),i("input",{ref:e=>this._fileInput=e,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>this.handleFileChange(e)})),!!this.messageError&&i("span",{class:"text-error"},this.messageError))))))}};b.style='.image-uploader-container.sc-ez-simple-image-uploader{font-family:"Roboto";color:#2b3a54;display:flex;flex-direction:column;gap:var(--space--10, 10px);justify-content:space-between;align-items:center;padding-bottom:var(--space--8, 8px)}.header.sc-ez-simple-image-uploader{display:flex;font-weight:500;font-size:var(--font-size--medium, 16px)}.actions.sc-ez-simple-image-uploader{display:flex;justify-content:flex-end;gap:var(--space--12, 12px);margin-top:var(--space--12, 12px);width:100%}.drop-zone-section.sc-ez-simple-image-uploader{width:100%}.drop-zone.sc-ez-simple-image-uploader{display:flex;flex-wrap:wrap;background-color:var(--color--petroleum-70, #F4F6F9);padding:var(--space--6, 6px);width:100%;border-radius:var(--space--12, 12px);box-sizing:border-box;min-height:100px}.clickable.sc-ez-simple-image-uploader{cursor:pointer}.dragging.sc-ez-simple-image-uploader{background-color:var(--color--petroleum-100, #C8CCD3)}.drop-zone-container.sc-ez-simple-image-uploader{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:6px;box-sizing:border-box}.text-error.sc-ez-simple-image-uploader{font-family:var(--font--pattern, "Roboto");color:var(--color--red-600, #BD0025);font-size:var(--font-size--small, 12px)}.button-close.sc-ez-simple-image-uploader{border:none;background:none;cursor:pointer}';export{c as ez_link_builder,h as ez_rich_toolbar,d as ez_rich_toolbar_arrows,p as ez_rich_toolbar_configs,u as ez_rich_toolbar_letters,b as ez_simple_image_uploader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as a}from"./p-e4c7eb39.js";import{ElementIDUtils as o,StringUtils as r}from"@sankhyalabs/core";const n=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.setFocusedParam=t=>{if("Enter"===t.key){const i=this._processedTabs[this._focusedIndex];this.handleTabClick(i),t.preventDefault(),this.setFocusedTab(i.index)}else if("ArrowLeft"===t.key||"ArrowRight"===t.key){let i;if("ArrowLeft"===t.key)i=!1;else{if("ArrowRight"!==t.key)return;i=!0}this._focusedIndex=void 0===this._focusedIndex?!1===i?void 0!==this.selectedIndex?this.selectedIndex-1:void 0:void 0!==this.selectedIndex?this.selectedIndex+1:void 0:!1===i?this._focusedIndex-1:this._focusedIndex+1,this._focusedIndex<0?this._focusedIndex=0:this._focusedIndex>this._processedTabs.length-1&&(this._focusedIndex=this._processedTabs.length-1),this.setFocusedBtn(!0,this._focusedIndex),this.setFocusedTab(this._focusedIndex)}else if("Tab"===t.key||"Escape"===t.key){const i=this._processedTabs[this.selectedIndex];this._focusedIndex=void 0,this.handleTabClick(i),t.preventDefault(),this.setFocusedTab(this.selectedIndex)}},this._processedTabs=void 0,this.selectedIndex=void 0,this.selectedTab=void 0,this.tabs=void 0}observeTabs(t,i){t&&"string"!=typeof t?this._processedTabs=t:t!==i&&this.processesTabs()}async goToTab(t,i=!1){const s=this._processedTabs.find((i=>i.index===t));this.handleTabClick(s,!i)}handleTabClick(t,i=!0){this.selectedIndex=t.index,this._focusedIndex=void 0,this.selectedTab=t.tabKey,i&&this.ezChange.emit(t),this.setFocusedBtn(!1,t.index)}componentWillLoad(){this.processesTabs()}processesTabs(){this.tabs&&(Array.isArray(this.tabs)?this._processedTabs=[...this.tabs]:(this._processedTabs=[],this.tabs.split(",").forEach((t=>{t=t.trim(),this._processedTabs.push({label:t,tabKey:t,index:this._processedTabs.length}),this.buildElementIdTab(this._processedTabs)})))),this._hostElem.querySelectorAll("ez-tab").forEach((t=>{const i=t.getAttribute("tabKey"),s={label:t.getAttribute("label"),tabKey:i,leftIcon:t.getAttribute("leftIcon"),rightIcon:t.getAttribute("rightIcon"),index:this._processedTabs.length},e=t.firstChild;e&&(e.setAttribute("slot","tab"+s.index),this._hostElem.appendChild(e)),this._processedTabs.push(s),this.buildElementIdTab(this._processedTabs)}))}componentDidRender(){this.updateScroll()}componentDidLoad(){o.addIDInfo(this._hostElem,"itemsSelector"),this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((t=>{var i;const s=null===(i=t.querySelector("span.tab-label"))||void 0===i?void 0:i.innerText,e={id:`${r.toCamelCase(s)}`};o.addIDInfo(t,"itemSelector",e)}))}handleSlotChange(t){const i=t.target.assignedElements()[0];i&&(i.style.marginLeft="6px")}scrollBackward(){const t=this._scrollContainer;t&&(t.scrollLeft-=t.clientWidth)}scrollFoward(){const t=this._scrollContainer;if(t){let i=null;t.querySelectorAll(".tab").forEach((s=>{s.getBoundingClientRect().right<t.clientWidth&&(i=s)})),t.scrollLeft=i.offsetLeft+i.offsetWidth}}updateScroll(){const t=this._scrollContainer;if(t){const{scrollWidth:i,clientWidth:s,scrollLeft:e}=t,a=i-s-Math.ceil(e);this._startHidden=t.scrollLeft>0,this._endHidden=a>0,this._startHidden?this._backwardButton.classList.remove("hidden"):this._backwardButton.classList.add("hidden"),this._endHidden?this._forwardButton.classList.remove("hidden"):this._forwardButton.classList.add("hidden");const o=["","startHidden","endHidden","middle"],r=o[Number(this._startHidden)|Number(this._endHidden)<<1];o.forEach((i=>{i!==r&&t.classList.contains(i)&&t.classList.remove(i)})),r&&!t.classList.contains(r)&&t.classList.add(r)}}domScrollHandler(){window.clearTimeout(this._scrollCallBack),this._scrollCallBack=window.setTimeout((()=>{this.updateScroll()}),200)}setFocusedTab(t){window.clearTimeout(this._scrollCallBackTest),this._scrollCallBackTest=window.setTimeout((()=>{this._scrollContainer.querySelector(`#tab${t}`).scrollIntoView()}),200)}setFocusedBtn(t,i){this._scrollContainer.querySelectorAll(".tab").forEach((s=>{s.classList.remove("is-focused"),s.id==="tab"+i&&t&&s.classList.add("is-focused")}))}buildElementIdTab(t){t.forEach((t=>{if(!t.hasOwnProperty(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME)){const i=`${this._hostElem.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_${r.toCamelCase(t.tabKey)}`;t[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=i}}))}render(){return s(e,null,s("button",{class:"backward-button",ref:t=>this._backwardButton=t,onClick:()=>this.scrollBackward()}),s("div",{class:"scroll",ref:t=>this._scrollContainer=t,onScroll:()=>this.domScrollHandler(),onKeyDown:t=>this.setFocusedParam(t)},this._processedTabs.map(((t,i)=>{const e="tab"+i,a=i===this.selectedIndex||this.selectedTab&&t.tabKey===this.selectedTab;return a&&(this.selectedTab=t.tabKey,this.selectedIndex=i),s("button",{id:e,name:"tab-button",class:"tab"+(a?" is-active":""),onClick:()=>this.handleTabClick(t)},t.leftIcon&&s("ez-icon",{iconName:t.leftIcon,class:"left-icon"}),s("span",{class:"tab-label",title:t.label},t.label),t.rightIcon&&s("ez-icon",{iconName:t.rightIcon,class:"right-icon"}),s("slot",{name:e,onSlotchange:t=>{this.handleSlotChange(t)}}))}))),s("button",{class:"forward-button",ref:t=>this._forwardButton=t,onClick:()=>this.scrollFoward()}))}get _hostElem(){return a(this)}static get watchers(){return{tabs:["observeTabs"]}}};n.style='@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--tabselector--forward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.middle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;background-color:unset;min-width:100px;max-width:260px;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, "Roboto");font-size:var(--title--small, 14px);flex-shrink:0;margin-bottom:var(--space--extra-small, 3px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active ez-icon{--ez-icon--color:var(--color--primary, #008561)}.is-active::after{content:"";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}.left-icon{padding-right:var(--space--small)}.right-icon{padding-left:var(--space--small)}';export{n as ez_tabselector}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as e,H as o,g as t}from"./p-
|
|
1
|
+
import{r,h as e,H as o,g as t}from"./p-e4c7eb39.js";import{ElementIDUtils as a}from"@sankhyalabs/core";const d=class{constructor(e){r(this,e),this.color="default",this.height=void 0,this.width=void 0}componentDidRender(){this._element&&a.addIDInfo(this._element),this._container&&a.addIDInfo(this._container,"empty-card",{id:"container"})}render(){const r=Object.assign(Object.assign({},this.height?{"--ez-empty-card--custom-height":`${this.height}px`}:{}),this.width?{"--ez-empty-card--custom-width":`${this.width}px`}:{});return e(o,{style:r},e("div",{ref:r=>this._container=r,class:`card_container ${this.color}`},e("slot",null)))}get _element(){return t(this)}};d.style=":host{--ez-empty-card--width:335px;--ez-empty-card--height:155px;--ez-empty-card--padding:var(--space--24, 24px);--ez-empty-card--border-radius:var(--border--radius-24, 24px);--ez-empty-card--background-color:var(--color--gray-70, #ffffff)}div{width:var(--ez-empty-card--custom-width, var(--ez-empty-card--width));height:var(--ez-empty-card--custom-height, var(--ez-empty-card--height));border-radius:var(--ez-empty-card--border-radius);background-color:var(--ez-empty-card--background-color);padding:var(--ez-empty-card--padding);display:block;overflow:hidden;outline:none;box-shadow:none;border:none;box-sizing:border-box}.gray{--ez-empty-card--background-color:var(--color--gray-80)}.green{--ez-empty-card--background-color:var(--color--ocean-green-90)}.yellow{--ez-empty-card--background-color:var(--color--yellow-100)}.red{--ez-empty-card--background-color:var(--color--red-100)}.petroleum{--ez-empty-card--background-color:var(--color--petroleum-90)}";export{d as ez_empty_card}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t,r as i,c as n,H as e,g as r}from"./p-
|
|
1
|
+
import{h as t,r as i,c as n,H as e,g as r}from"./p-e4c7eb39.js";import{Action as o,DataUnit as s,ObjectUtils as u,UserInterface as h,HTMLBuilder as c,ApplicationContext as a,StringUtils as l,LockManager as f,LockManagerOperation as d,DataType as v,NumberUtils as p,MaskFormatter as g,SortMode as m,ElementIDUtils as b,ColumnFilterManager as w,DateUtils as y,ArrayUtils as C,FieldComparator as S,JSUtils as R,OverflowWatcher as O,OVERFLOWED_CLASS_NAME as A,KeyboardManager as j}from"@sankhyalabs/core";import{SelectionMode as _}from"@sankhyalabs/core/dist/dataunit/DataUnit";import{A as G}from"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{g as x,i as M}from"./p-641ee538.js";import{C as F,a as k}from"./p-30ffb9ed.js";import{b as P,R as D,D as I,S as E,f as T,c as z,a as N}from"./p-4296e9f9.js";import{D as L,E as B,P as H,a as W}from"./p-b1e45320.js";import{F as V}from"./p-dc628ed3.js";import{p as U}from"./p-bb409cba.js";import"./p-112455b1.js";
|
|
2
2
|
/**
|
|
3
3
|
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
|
|
4
4
|
* @version v28.2.1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as t,h as i,g as e}from"./p-
|
|
1
|
+
import{r as s,c as t,h as i,g as e}from"./p-e4c7eb39.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{C as r}from"./p-ec7db713.js";const a=class{constructor(i){s(this,i),this.ezChange=t(this,"ezChange",7),this.ezSearching=t(this,"ezSearching",7),this.ezFocusIn=t(this,"ezFocusIn",7),this._searchingText="",this.handleFocus=()=>{this._textInput.value=""===this._searchingText?"":this._searchingText,this.ezFocusIn.emit()},this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.restrict=void 0,this.mode="regular",this.asyncSearch=!1,this.canShowError=!0,this.autoFocus=!1}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(s,t){this._textInput&&s!=t&&(this._textInput.value=s,this.ezChange.emit(s))}async setFocus(s){this._textInput.setFocus(s)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async setValue(s){this.asyncSearch&&null!=this._textInput&&(s!==this.value?(this.value=s,this._searchingText=""):this._textInput.value=s)}async endSearch(){this.asyncSearch&&null!=this._textInput&&this._textInput.value!==this.value&&(this._textInput.value=this.value)}handleChange(s){const t=s.detail;this.errorMessage="",this.asyncSearch?(this._searchingText=t,this.ezSearching.emit(t)):t!==this.value&&(this.value=t)}componentDidLoad(){r.applyVarsTextInput(this._elem,this._textInput),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),i("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:s=>this._textInput=s,label:this.label,onEzChange:s=>this.handleChange(s),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode,onFocusin:this.handleFocus,canShowError:this.canShowError},i("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return e(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};a.style=":host{display:block;width:100%}";export{a as ez_filter_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as r,g as o}from"./p-23a36bb6.js";import{MaskFormatter as n,ElementIDUtils as s}from"@sankhyalabs/core";const a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this._isOverflowing=!1,this.label=void 0,this.alternativePlaceholder=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.hasInvalid=!1,this.mask=void 0,this.cleanValueMask=!1,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1,this.password=!1,this.autoFocus=!1,this.hasRightSlotContent=!1,this.forceLabelFloat=!1}observeHasInvalid(t,i){t!==i&&this.validateErrors()}observeMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}observeValue(t,i){this._inputElem&&t!=i&&(this._inputElem.value=this.value||"",this.handleChange(),this.adjustFloatingLabel(),this.checkIsOverflowing(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}observeAlternativePlaceholder(t){this.forceLabelFloat=!!t}validateErrors(){const t=this.handleValidateErrorMessage(this.errorMessage);this.updateClassError(this.canShowError&&(t||this.hasInvalid))}handleValidateErrorMessage(t=this.errorMessage){return"string"==typeof t&&""!==t.trim()}updateClassError(t){this._inputElem&&(t?this._inputElem.classList.add("hasError"):this._inputElem.classList.remove("hasError"))}adjustFloatingLabel(){if(this.label&&this._labelElem){if(this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label"),this.forceLabelFloat)return;const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}isSlaveMode(){var t,i;return"true"===(null===(i=null===(t=this._hostElement)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.slaveMode)}adjustColorContentSlot(t=""){this._contentLeftSlot&&(this._contentLeftSlot.style.color=t)}adjustBorderInput(){this.noBorder&&this._inputElem.classList.add("input__slim--noborder")}async setFocus(t){const{selectText:i}=t||{};if(i&&this._inputElem.select(),this._inputElem.disabled)return this._inputElem.classList.add("focused"),void this._inputElem.scrollIntoView({behavior:"smooth",block:"start"});requestAnimationFrame((()=>this._inputElem.focus()))}async setBlur(){this._inputElem.blur()}async isInvalid(){return this.handleValidateErrorMessage()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this.cleanValueMask?this.applyMask(t):this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.controlChangeValue(),this.adjustFloatingLabel(),this.adjustColorContentSlot()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}controlChangeValue(){this._inputElem&&(this.value||"")!==this._inputElem.value&&(this.value=this.cleanValueMask&&this._maskFormatter?this._maskFormatter.removeMask(this._inputElem.value):this._inputElem.value)}applyMask(t){if(!t||""===t)return t;if(this._maskFormatter)try{const i=this._maskFormatter.applyMask(this._maskFormatter.removeMask(t));return this._inputElem?(this._inputElem.value=i,this._inputElem.value):(this.value=i,this.value)}catch(t){this.errorMessage=t.message}return t}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=null==this._lastValidValue?"":this._lastValidValue,this.controlChangeValue()}handleSlotChange(t){var i;const e=t.target,r=e.assignedElements()[0];this.hasRightSlotContent=!1,r&&(r.style.position="absolute",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.overflow="hidden",r.style.top="0px",r.style.width="var(--ez-text-input__icon--width)",r.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==e.name?(r.style.left="0px",r.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left"),this._contentLeftSlot=r):"rightIcon"==e.name&&(r.style.right="0px",r.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"),this._tooltipIconElem&&this._tooltipIconElem.classList.add("rightIconSlot"),this.hasRightSlotContent=(null===(i=r.children)||void 0===i?void 0:i.length)>0),e.name&&s.addIDInfo(r,e.name)),this.validateErrors()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated"),this.adjustColorContentSlot("var(--ez-text-input__input--focus--icon-color)")}getValue(){return this.mask&&this.cleanValueMask?this.applyMask(this.value):this.value}buildLabelClass(){let t=this.enabled?"input__label":"input__label input__label--disabled";return this.errorMessage&&(t+=" hasError"),this.forceLabelFloat&&(t+=" input__label--floated"),t}buildPlaceholder(){return this.alternativePlaceholder?this.alternativePlaceholder:"slim"===this.mode&&this.label?this.label:""}checkIsOverflowing(){this._isOverflowing=!!this._inputElem&&this._inputElem.offsetWidth<this._inputElem.scrollWidth}componentWillLoad(){if(this.observeMask(),this.forceLabelFloat=!!this.alternativePlaceholder,this.value){if(this._maskFormatter)try{this.cleanValueMask?this.applyMask(this.value):this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}componentDidLoad(){var t;this.validateErrors(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput(),this.checkIsOverflowing(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})})),null===(t=this._inputElem)||void 0===t||t.addEventListener("focus",(()=>{var t;this._inputElem.setSelectionRange(0,null===(t=this._inputElem)||void 0===t?void 0:t.value.length)})),this.onClickOutside=t=>{this._inputElem.contains(t.target)||this._inputElem.classList.remove("focused")},document.addEventListener("click",this.onClickOutside)}disconnectedCallback(){document.removeEventListener("click",this.onClickOutside)}componentDidRender(){this.adjustFloatingLabel()}render(){return s.addIDInfoIfNotExists(this._hostElement,"input"),e(r,{style:this._hostElement.classList.contains("grid_editor")?{height:"100%"}:null},e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.buildLabelClass(),onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{"data-element-id":s.getInternalIDInfo("input"),onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:this.password?"password":"text",class:"slim"===this.mode?"input--slim":"",placeholder:this.buildPlaceholder(),value:this.getValue(),disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("ez-tooltip",{anchoringElement:this._hostElement,message:this.getValue(),active:this._isOverflowing,useAnchorSize:!0}),this.canShowError&&"slim"!=this.mode&&this.errorMessage&&e("ez-tooltip",{type:"error",message:this.errorMessage},e("ez-icon",{class:`tooltip-icon ${this.errorMessage?"hasError":""} ${this.hasRightSlotContent?"rightIconSlot":""}`,"data-element-id":s.getInternalIDInfo("tooltip-icon"),ref:t=>this._tooltipIconElem=t,iconName:"alert-circle"})),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}," "))}get _hostElement(){return o(this)}static get watchers(){return{hasInvalid:["observeHasInvalid"],errorMessage:["observeHasInvalid"],canShowError:["observeHasInvalid"],mask:["observeMask"],value:["observeValue"],alternativePlaceholder:["observeAlternativePlaceholder"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:30px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--border-top-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-top-right-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-right-radius:var(--ez-text-input--border-radius);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:var(--ez-text-input--height);border-top-left-radius:var(--ez-text-input--border-top-left-radius);border-bottom-left-radius:var(--ez-text-input--border-bottom-left-radius);border-top-right-radius:var(--ez-text-input--border-top-right-radius);border-bottom-right-radius:var(--ez-text-input--border-bottom-right-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.focused{border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";export{a as ez_text_input}
|
|
1
|
+
import{r as t,c as i,h as e,H as r,g as o}from"./p-e4c7eb39.js";import{MaskFormatter as n,ElementIDUtils as s}from"@sankhyalabs/core";const a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this._isOverflowing=!1,this.label=void 0,this.alternativePlaceholder=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.hasInvalid=!1,this.mask=void 0,this.cleanValueMask=!1,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1,this.password=!1,this.autoFocus=!1,this.hasRightSlotContent=!1,this.forceLabelFloat=!1}observeHasInvalid(t,i){t!==i&&this.validateErrors()}observeMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}observeValue(t,i){this._inputElem&&t!=i&&(this._inputElem.value=this.value||"",this.handleChange(),this.adjustFloatingLabel(),this.checkIsOverflowing(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}observeAlternativePlaceholder(t){this.forceLabelFloat=!!t}validateErrors(){const t=this.handleValidateErrorMessage(this.errorMessage);this.updateClassError(this.canShowError&&(t||this.hasInvalid))}handleValidateErrorMessage(t=this.errorMessage){return"string"==typeof t&&""!==t.trim()}updateClassError(t){this._inputElem&&(t?this._inputElem.classList.add("hasError"):this._inputElem.classList.remove("hasError"))}adjustFloatingLabel(){if(this.label&&this._labelElem){if(this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label"),this.forceLabelFloat)return;const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}isSlaveMode(){var t,i;return"true"===(null===(i=null===(t=this._hostElement)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.slaveMode)}adjustColorContentSlot(t=""){this._contentLeftSlot&&(this._contentLeftSlot.style.color=t)}adjustBorderInput(){this.noBorder&&this._inputElem.classList.add("input__slim--noborder")}async setFocus(t){const{selectText:i}=t||{};if(i&&this._inputElem.select(),this._inputElem.disabled)return this._inputElem.classList.add("focused"),void this._inputElem.scrollIntoView({behavior:"smooth",block:"start"});requestAnimationFrame((()=>this._inputElem.focus()))}async setBlur(){this._inputElem.blur()}async isInvalid(){return this.handleValidateErrorMessage()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this.cleanValueMask?this.applyMask(t):this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.controlChangeValue(),this.adjustFloatingLabel(),this.adjustColorContentSlot()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}controlChangeValue(){this._inputElem&&(this.value||"")!==this._inputElem.value&&(this.value=this.cleanValueMask&&this._maskFormatter?this._maskFormatter.removeMask(this._inputElem.value):this._inputElem.value)}applyMask(t){if(!t||""===t)return t;if(this._maskFormatter)try{const i=this._maskFormatter.applyMask(this._maskFormatter.removeMask(t));return this._inputElem?(this._inputElem.value=i,this._inputElem.value):(this.value=i,this.value)}catch(t){this.errorMessage=t.message}return t}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=null==this._lastValidValue?"":this._lastValidValue,this.controlChangeValue()}handleSlotChange(t){var i;const e=t.target,r=e.assignedElements()[0];this.hasRightSlotContent=!1,r&&(r.style.position="absolute",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.overflow="hidden",r.style.top="0px",r.style.width="var(--ez-text-input__icon--width)",r.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==e.name?(r.style.left="0px",r.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left"),this._contentLeftSlot=r):"rightIcon"==e.name&&(r.style.right="0px",r.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"),this._tooltipIconElem&&this._tooltipIconElem.classList.add("rightIconSlot"),this.hasRightSlotContent=(null===(i=r.children)||void 0===i?void 0:i.length)>0),e.name&&s.addIDInfo(r,e.name)),this.validateErrors()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated"),this.adjustColorContentSlot("var(--ez-text-input__input--focus--icon-color)")}getValue(){return this.mask&&this.cleanValueMask?this.applyMask(this.value):this.value}buildLabelClass(){let t=this.enabled?"input__label":"input__label input__label--disabled";return this.errorMessage&&(t+=" hasError"),this.forceLabelFloat&&(t+=" input__label--floated"),t}buildPlaceholder(){return this.alternativePlaceholder?this.alternativePlaceholder:"slim"===this.mode&&this.label?this.label:""}checkIsOverflowing(){this._isOverflowing=!!this._inputElem&&this._inputElem.offsetWidth<this._inputElem.scrollWidth}componentWillLoad(){if(this.observeMask(),this.forceLabelFloat=!!this.alternativePlaceholder,this.value){if(this._maskFormatter)try{this.cleanValueMask?this.applyMask(this.value):this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}componentDidLoad(){var t;this.validateErrors(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput(),this.checkIsOverflowing(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})})),null===(t=this._inputElem)||void 0===t||t.addEventListener("focus",(()=>{var t;this._inputElem.setSelectionRange(0,null===(t=this._inputElem)||void 0===t?void 0:t.value.length)})),this.onClickOutside=t=>{this._inputElem.contains(t.target)||this._inputElem.classList.remove("focused")},document.addEventListener("click",this.onClickOutside)}disconnectedCallback(){document.removeEventListener("click",this.onClickOutside)}componentDidRender(){this.adjustFloatingLabel()}render(){return s.addIDInfoIfNotExists(this._hostElement,"input"),e(r,{style:this._hostElement.classList.contains("grid_editor")?{height:"100%"}:null},e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.buildLabelClass(),onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{"data-element-id":s.getInternalIDInfo("input"),onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:this.password?"password":"text",class:"slim"===this.mode?"input--slim":"",placeholder:this.buildPlaceholder(),value:this.getValue(),disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("ez-tooltip",{anchoringElement:this._hostElement,message:this.getValue(),active:this._isOverflowing,useAnchorSize:!0}),this.canShowError&&"slim"!=this.mode&&this.errorMessage&&e("ez-tooltip",{type:"error",message:this.errorMessage},e("ez-icon",{class:`tooltip-icon ${this.errorMessage?"hasError":""} ${this.hasRightSlotContent?"rightIconSlot":""}`,"data-element-id":s.getInternalIDInfo("tooltip-icon"),ref:t=>this._tooltipIconElem=t,iconName:"alert-circle"})),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}," "))}get _hostElement(){return o(this)}static get watchers(){return{hasInvalid:["observeHasInvalid"],errorMessage:["observeHasInvalid"],canShowError:["observeHasInvalid"],mask:["observeMask"],value:["observeValue"],alternativePlaceholder:["observeAlternativePlaceholder"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:30px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--border-top-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-top-right-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-right-radius:var(--ez-text-input--border-radius);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:var(--ez-text-input--height);border-top-left-radius:var(--ez-text-input--border-top-left-radius);border-bottom-left-radius:var(--ez-text-input--border-bottom-left-radius);border-top-right-radius:var(--ez-text-input--border-top-right-radius);border-bottom-right-radius:var(--ez-text-input--border-bottom-right-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.focused{border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";export{a as ez_text_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as l}from"./p-
|
|
1
|
+
import{r as t,c as i,h as o,H as e,g as l}from"./p-e4c7eb39.js";import{KeyboardManager as s,FloatingManager as n}from"@sankhyalabs/core";import{i as d}from"./p-641ee538.js";const a=class{constructor(o){t(this,o),this.ezClosePopup=i(this,"ezClosePopup",7),this.ezPopupAction=i(this,"ezPopupAction",7),this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0,this.enabledScroll=!0,this.autoClose=!0,this.footerButtons=[]}observeConfig(){this.manageOverflow()}async componentWillLoad(){this.i18n=await d()}componentDidLoad(){this.popUpFocus(),this._keyboardManager=new s({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezPopupAction.emit.bind("OK")).bind("Escape",(()=>this.closePopup())).bind("Esc",(()=>this.closePopup()))}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}closePopup(){this.opened=!1,this.manageOverflow(),this.ezClosePopup.emit()}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=n.subscribeOverlayControl(this._popupRef):n.unsubscribeOverlayControl(this._popupRef||this._overlayId)}popUpFocus(){this.opened&&this._popupRef&&this._popupRef.focus()}getGridSize(){const t={"x-small":"col--sd-3 ez-popup__size-limit--x-small",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11",default:"ez-popup__size-limit--x-small",auto:""};return this.size&&t.hasOwnProperty(this.size)&&t[this.size]||t.medium}getDialogClass(){let t="popup__container";return"auto"===this.heightMode&&(t+=" popup__container--auto"),t+=` ${this.getGridSize()}`,t}componentDidRender(){this.manageOverlay(),this.popUpFocus()}handleAutoClose(t){if(!this.opened||!this._popupRef||!this.autoClose)return;if(this._popupRef.contains(t.target))return;const i=this._popupRef.querySelector("slot");if(i&&i.assignedElements().length>0){const o=i.assignedElements();for(const i of o)if(i.contains(t.target))return}this._popupRef.shadowRoot&&this._popupRef.shadowRoot.contains(t.target)||this.closePopup()}handleDefaultPropsButtonsByIndex(t){switch(t){case 0:return{label:this.i18n?this.i18n("app.confirm"):"Confirmar",variant:"primary",size:"small",onClick:()=>{this.closePopup(),this.ezPopupAction.emit("OK")}};case 1:return{label:this.i18n?this.i18n("app.cancel"):"Cancelar",variant:"secondary",size:"small",onClick:()=>{this.closePopup()}};case 2:return{label:this.i18n?this.i18n("app.close"):"Fechar",variant:"tertiary",size:"small",onClick:()=>{this.closePopup()}}}}renderFooterButtons(){return this.footerButtons.slice(0,3).map(((t,i)=>o("ez-button",Object.assign({key:i},this.handleDefaultPropsButtonsByIndex(i),t))))}render(){return o(e,null,this.opened&&o("div",{class:"overlay",tabIndex:-1,onClick:this.handleAutoClose.bind(this)},o("dialog",{ref:t=>this._popupRef=t,class:this.getDialogClass()},this.useHeader&&o("header",{class:"popup__header"},!!this.ezTitle&&o("h1",{class:"popup__title"},this.ezTitle),o("ez-button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",variant:"tertiary",mode:"icon",iconName:"close",size:"small",onClick:this.closePopup.bind(this)})),o("main",{class:{"popup__expandable-content":!0,"popup__overflow-y--auto":this.enabledScroll}},o("slot",null)),o("footer",{class:"popup__footer"},this.footerButtons.length>0&&this.renderFooterButtons(),o("slot",{name:"footer"})))))}get _element(){return l(this)}static get watchers(){return{opened:["observeConfig"]}}};a.style=':host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, "Roboto");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{flex-grow:1;box-sizing:border-box;width:100%;font-family:var(--font--pattern, "Roboto");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400)}.popup__header{flex-shrink:0;width:100%;display:flex;align-items:center}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{flex-shrink:0;display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{a as ez_popup}
|