@sankhyalabs/ezui 7.1.0-dev.1 → 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 +3 -3
- 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 +2 -2
- 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 +111 -39
- package/dist/cjs/ez-grid-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +4 -4
- 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 -17
- 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 +10 -7
- 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 +155 -8
- 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/{purify-47a2f27b.js → purify-453a8028.js} +35 -12
- package/dist/cjs/{search-column-9aa090ec.js → search-column-540f3925.js} +2 -2
- package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +32 -15
- package/dist/collection/components/ez-popup/ez-popup.css +3 -2
- package/dist/collection/components/ez-popup/ez-popup.js +9 -6
- package/dist/collection/components/ez-tree/ez-tree.css +4 -0
- package/dist/collection/components/ez-tree/ez-tree.js +185 -6
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
- package/dist/collection/components/ez-tree/types/Node.js +7 -0
- package/dist/collection/components/ez-tree/types/Tree.js +19 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +1 -1
- package/dist/collection/utils/form/FormMetadata.js +109 -37
- package/dist/custom-elements/index.js +327 -83
- 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 +3 -3
- 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 +2 -2
- 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 +111 -39
- package/dist/esm/ez-grid-view.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +4 -4
- 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 -17
- 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 +10 -7
- 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 +155 -8
- 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/{purify-dc6814bf.js → purify-003c47e2.js} +35 -12
- package/dist/esm/{search-column-83562552.js → search-column-4e827a95.js} +2 -2
- 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-231cf227.entry.js +1 -0
- 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-4296e9f9.js +1 -0
- 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-b81d19c7.entry.js +1 -0
- package/dist/ezui/p-bb409cba.js +3 -0
- package/dist/ezui/p-bb7cf512.entry.js +1 -0
- 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-d66bf34e.entry.js → p-cb4f1ee9.entry.js} +2 -2
- 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-cff2434d.entry.js +1 -0
- 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 -2
- package/dist/types/components/ez-popup/ez-popup.d.ts +1 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +20 -1
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
- package/dist/types/components.d.ts +26 -1
- package/dist/types/utils/form/FormMetadata.d.ts +2 -1
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +3 -0
- package/dist/types/utils/form/interfaces/ITabConfig.d.ts +3 -0
- package/package.json +1 -1
- package/dist/ezui/p-02f6e3b0.entry.js +0 -1
- package/dist/ezui/p-191cfbc8.entry.js +0 -1
- package/dist/ezui/p-228a4d2f.js +0 -3
- package/dist/ezui/p-2df50161.entry.js +0 -1
- package/dist/ezui/p-4c4f0850.entry.js +0 -1
- package/dist/ezui/p-623161e2.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-bd6146c5.entry.js +0 -1
- package/dist/ezui/p-c943f7c4.entry.js +0 -1
- package/dist/ezui/p-d8cc640d.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}
|
|
@@ -0,0 +1 @@
|
|
|
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}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as e,a as t}from"./p-112455b1.js";var n=e((function(e){
|
|
2
|
+
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
3
|
+
e.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object;let{freeze:r,seal:a,create:l}=Object,{apply:s,construct:c}="undefined"!=typeof Reflect&&Reflect;r||(r=function(e){return e}),a||(a=function(e){return e}),s||(s=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return e.apply(t,i)}),c||(c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const u=A(Array.prototype.forEach),f=A(Array.prototype.lastIndexOf),p=A(Array.prototype.pop),m=A(Array.prototype.push),d=A(Array.prototype.splice),g=A(String.prototype.toLowerCase),h=A(String.prototype.toString),y=A(String.prototype.match),b=A(String.prototype.replace),w=A(String.prototype.indexOf),x=A(String.prototype.trim),v=A(Object.prototype.hasOwnProperty),T=A(RegExp.prototype.test),k=(S=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(S,t)});var S;function A(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return s(e,t,i)}}function E(e,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;t&&t(e,null);let r=i.length;for(;r--;){let t=i[r];if("string"==typeof t){const e=o(t);e!==t&&(n(i)||(i[r]=e),t=e)}e[t]=!0}return e}function R(e){for(let t=0;t<e.length;t++)v(e,t)||(e[t]=null);return e}function _(t){const n=l(null);for(const[i,o]of e(t))v(t,i)&&(n[i]=Array.isArray(o)?R(o):o&&"object"==typeof o&&o.constructor===Object?_(o):o);return n}function z(e,t){for(;null!==e;){const n=o(e,t);if(n){if(n.get)return A(n.get);if("function"==typeof n.value)return A(n.value)}e=i(e)}return function(){return null}}const O=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),F=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=r(["#text"]),N=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),C=r(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),H=a(/\$\{[\w\W]*/gm),q=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),Y=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var J=Object.freeze({__proto__:null,ARIA_ATTR:Y,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:V,DATA_ATTR:q,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:$,MUSTACHE_EXPR:B,TMPLIT_EXPR:H});const Q=1,Z=3,ee=7,te=8,ne=9,ie=function(){return"undefined"==typeof window?null:window},oe=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie();const i=e=>t(e);if(i.version="3.3.0",i.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return i.isSupported=!1,i;let{document:o}=n;const a=o,s=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:S,Node:A,Element:R,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:q,trustedTypes:Y}=n,$=R.prototype,G=z($,"cloneNode"),V=z($,"remove"),re=z($,"nextSibling"),ae=z($,"childNodes"),le=z($,"parentNode");if("function"==typeof S){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let se,ce="";const{implementation:ue,createNodeIterator:fe,createDocumentFragment:pe,getElementsByTagName:me}=o,{importNode:de}=a;let ge={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof e&&"function"==typeof le&&ue&&void 0!==ue.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ye,TMPLIT_EXPR:be,DATA_ATTR:we,ARIA_ATTR:xe,IS_SCRIPT_OR_DATA:ve,ATTR_WHITESPACE:Te,CUSTOM_ELEMENT:ke}=J;let{IS_ALLOWED_URI:Se}=J,Ae=null;const Ee=E({},[...O,...D,...L,...F,...P]);let Re=null;const _e=E({},[...N,...C,...j,...U]);let ze=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,De=null;const Le=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Me=!0,Fe=!0,Ie=!1,Pe=!0,Ne=!1,Ce=!0,je=!1,Ue=!1,Be=!1,We=!1,He=!1,qe=!1,Ye=!0,Xe=!1;const $e="user-content-";let Ge=!0,Ke=!1,Ve={},Je=null;const Qe=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ze=null;const et=E({},["audio","video","img","source","image","track"]);let tt=null;const nt=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xhtml";let at=rt,lt=!1,st=null;const ct=E({},[it,ot,rt],h);let ut=E({},["mi","mo","mn","ms","mtext"]),ft=E({},["annotation-xml"]);const pt=E({},["title","style","font","a","script"]);let mt=null;const dt=["application/xhtml+xml","text/html"],gt="text/html";let ht=null,yt=null;const bt=o.createElement("form"),wt=function(e){return e instanceof RegExp||e instanceof Function},xt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!yt||yt!==e){if(e&&"object"==typeof e||(e={}),e=_(e),mt=-1===dt.indexOf(e.PARSER_MEDIA_TYPE)?gt:e.PARSER_MEDIA_TYPE,ht="application/xhtml+xml"===mt?h:g,Ae=v(e,"ALLOWED_TAGS")?E({},e.ALLOWED_TAGS,ht):Ee,Re=v(e,"ALLOWED_ATTR")?E({},e.ALLOWED_ATTR,ht):_e,st=v(e,"ALLOWED_NAMESPACES")?E({},e.ALLOWED_NAMESPACES,h):ct,tt=v(e,"ADD_URI_SAFE_ATTR")?E(_(nt),e.ADD_URI_SAFE_ATTR,ht):nt,Ze=v(e,"ADD_DATA_URI_TAGS")?E(_(et),e.ADD_DATA_URI_TAGS,ht):et,Je=v(e,"FORBID_CONTENTS")?E({},e.FORBID_CONTENTS,ht):Qe,Oe=v(e,"FORBID_TAGS")?E({},e.FORBID_TAGS,ht):_({}),De=v(e,"FORBID_ATTR")?E({},e.FORBID_ATTR,ht):_({}),Ve=!!v(e,"USE_PROFILES")&&e.USE_PROFILES,Me=!1!==e.ALLOW_ARIA_ATTR,Fe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ne=e.SAFE_FOR_TEMPLATES||!1,Ce=!1!==e.SAFE_FOR_XML,je=e.WHOLE_DOCUMENT||!1,We=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,qe=e.RETURN_TRUSTED_TYPE||!1,Be=e.FORCE_BODY||!1,Ye=!1!==e.SANITIZE_DOM,Xe=e.SANITIZE_NAMED_PROPS||!1,Ge=!1!==e.KEEP_CONTENT,Ke=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||X,at=e.NAMESPACE||rt,ut=e.MATHML_TEXT_INTEGRATION_POINTS||ut,ft=e.HTML_INTEGRATION_POINTS||ft,ze=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&wt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ze.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&wt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ze.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ze.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ne&&(Fe=!1),He&&(We=!0),Ve&&(Ae=E({},P),Re=[],!0===Ve.html&&(E(Ae,O),E(Re,N)),!0===Ve.svg&&(E(Ae,D),E(Re,C),E(Re,U)),!0===Ve.svgFilters&&(E(Ae,L),E(Re,C),E(Re,U)),!0===Ve.mathMl&&(E(Ae,F),E(Re,j),E(Re,U))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Le.tagCheck=e.ADD_TAGS:(Ae===Ee&&(Ae=_(Ae)),E(Ae,e.ADD_TAGS,ht))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Le.attributeCheck=e.ADD_ATTR:(Re===_e&&(Re=_(Re)),E(Re,e.ADD_ATTR,ht))),e.ADD_URI_SAFE_ATTR&&E(tt,e.ADD_URI_SAFE_ATTR,ht),e.FORBID_CONTENTS&&(Je===Qe&&(Je=_(Je)),E(Je,e.FORBID_CONTENTS,ht)),Ge&&(Ae["#text"]=!0),je&&E(Ae,["html","head","body"]),Ae.table&&(E(Ae,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');se=e.TRUSTED_TYPES_POLICY,ce=se.createHTML("")}else void 0===se&&(se=oe(Y,s)),null!==se&&"string"==typeof ce&&(ce=se.createHTML(""));r&&r(e),yt=e}},vt=E({},[...D,...L,...M]),Tt=E({},[...F,...I]),kt=function(e){let t=le(e);t&&t.tagName||(t={namespaceURI:at,tagName:"template"});const n=g(e.tagName),i=g(t.tagName);return!!st[e.namespaceURI]&&(e.namespaceURI===ot?t.namespaceURI===rt?"svg"===n:t.namespaceURI===it?"svg"===n&&("annotation-xml"===i||ut[i]):Boolean(vt[n]):e.namespaceURI===it?t.namespaceURI===rt?"math"===n:t.namespaceURI===ot?"math"===n&&ft[i]:Boolean(Tt[n]):e.namespaceURI===rt?!(t.namespaceURI===ot&&!ft[i])&&!(t.namespaceURI===it&&!ut[i])&&!Tt[n]&&(pt[n]||!vt[n]):!("application/xhtml+xml"!==mt||!st[e.namespaceURI]))},St=function(e){m(i.removed,{element:e});try{le(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{m(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){m(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(We||He)try{St(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Et=function(e){let t=null,n=null;if(Be)e="<remove></remove>"+e;else{const t=y(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===mt&&at===rt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=se?se.createHTML(e):e;if(at===rt)try{t=(new q).parseFromString(i,mt)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(at,"template",null);try{t.documentElement.innerHTML=lt?ce:i}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(o.createTextNode(n),r.childNodes[0]||null),at===rt?me.call(t,je?"html":"body")[0]:je?t.documentElement:r},Rt=function(e){return fe.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},_t=function(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},zt=function(e){return"function"==typeof A&&e instanceof A};function Ot(e,t,n){u(e,(e=>{e.call(i,t,n,yt)}))}const Dt=function(e){let t=null;if(Ot(ge.beforeSanitizeElements,e,null),_t(e))return St(e),!0;const n=ht(e.nodeName);if(Ot(ge.uponSanitizeElement,e,{tagName:n,allowedTags:Ae}),Ce&&e.hasChildNodes()&&!zt(e.firstElementChild)&&T(/<[/\w!]/g,e.innerHTML)&&T(/<[/\w!]/g,e.textContent))return St(e),!0;if(e.nodeType===ee)return St(e),!0;if(Ce&&e.nodeType===te&&T(/<[/\w]/g,e.data))return St(e),!0;if(!(Le.tagCheck instanceof Function&&Le.tagCheck(n))&&(!Ae[n]||Oe[n])){if(!Oe[n]&&Mt(n)){if(ze.tagNameCheck instanceof RegExp&&T(ze.tagNameCheck,n))return!1;if(ze.tagNameCheck instanceof Function&&ze.tagNameCheck(n))return!1}if(Ge&&!Je[n]){const t=le(e)||e.parentNode,n=ae(e)||e.childNodes;if(n&&t)for(let i=n.length-1;i>=0;--i){const o=G(n[i],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,re(e))}}return St(e),!0}return e instanceof R&&!kt(e)?(St(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!T(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ne&&e.nodeType===Z&&(t=e.textContent,u([he,ye,be],(e=>{t=b(t,e," ")})),e.textContent!==t&&(m(i.removed,{element:e.cloneNode()}),e.textContent=t)),Ot(ge.afterSanitizeElements,e,null),!1):(St(e),!0)},Lt=function(e,t,n){if(Ye&&("id"===t||"name"===t)&&(n in o||n in bt))return!1;if(Fe&&!De[t]&&T(we,t));else if(Me&&T(xe,t));else if(Le.attributeCheck instanceof Function&&Le.attributeCheck(t,e));else if(!Re[t]||De[t]){if(!(Mt(e)&&(ze.tagNameCheck instanceof RegExp&&T(ze.tagNameCheck,e)||ze.tagNameCheck instanceof Function&&ze.tagNameCheck(e))&&(ze.attributeNameCheck instanceof RegExp&&T(ze.attributeNameCheck,t)||ze.attributeNameCheck instanceof Function&&ze.attributeNameCheck(t,e))||"is"===t&&ze.allowCustomizedBuiltInElements&&(ze.tagNameCheck instanceof RegExp&&T(ze.tagNameCheck,n)||ze.tagNameCheck instanceof Function&&ze.tagNameCheck(n))))return!1}else if(tt[t]);else if(T(Se,b(n,Te,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==w(n,"data:")||!Ze[e])if(Ie&&!T(ve,b(n,Te,"")));else if(n)return!1;return!0},Mt=function(e){return"annotation-xml"!==e&&y(e,ke)},Ft=function(e){Ot(ge.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||_t(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let o=t.length;for(;o--;){const r=t[o],{name:a,namespaceURI:l,value:s}=r,c=ht(a),f=s;let m="value"===a?f:x(f);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Ot(ge.uponSanitizeAttribute,e,n),m=n.attrValue,!Xe||"id"!==c&&"name"!==c||(At(a,e),m=$e+m),Ce&&T(/((--!?|])>)|<\/(style|title|textarea)/i,m)){At(a,e);continue}if("attributename"===c&&y(m,"href")){At(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){At(a,e);continue}if(!Pe&&T(/\/>/i,m)){At(a,e);continue}Ne&&u([he,ye,be],(e=>{m=b(m,e," ")}));const d=ht(e.nodeName);if(Lt(d,c,m)){if(se&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(l);else switch(Y.getAttributeType(d,c)){case"TrustedHTML":m=se.createHTML(m);break;case"TrustedScriptURL":m=se.createScriptURL(m)}if(m!==f)try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),_t(e)?St(e):p(i.removed)}catch(t){At(a,e)}}else At(a,e)}Ot(ge.afterSanitizeAttributes,e,null)},It=function e(t){let n=null;const i=Rt(t);for(Ot(ge.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Ot(ge.uponSanitizeShadowNode,n,null),Dt(n),Ft(n),n.content instanceof c&&e(n.content);Ot(ge.afterSanitizeShadowDOM,t,null)};return i.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,r=null,l=null;if(lt=!e,lt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!zt(e)){if("function"!=typeof e.toString)throw k("toString is not a function");if("string"!=typeof(e=e.toString()))throw k("dirty is not a string, aborting")}if(!i.isSupported)return e;if(Ue||xt(t),i.removed=[],"string"==typeof e&&(Ke=!1),Ke){if(e.nodeName){const t=ht(e.nodeName);if(!Ae[t]||Oe[t])throw k("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof A)n=Et("\x3c!----\x3e"),o=n.ownerDocument.importNode(e,!0),o.nodeType===Q&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!We&&!Ne&&!je&&-1===e.indexOf("<"))return se&&qe?se.createHTML(e):e;if(n=Et(e),!n)return We?null:qe?ce:""}n&&Be&&St(n.firstChild);const s=Rt(Ke?e:n);for(;r=s.nextNode();)Dt(r),Ft(r),r.content instanceof c&&It(r.content);if(Ke)return e;if(We){if(He)for(l=pe.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Re.shadowroot||Re.shadowrootmode)&&(l=de.call(a,l,!0)),l}let f=je?n.outerHTML:n.innerHTML;return je&&Ae["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&T(K,n.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+f),Ne&&u([he,ye,be],(e=>{f=b(f,e," ")})),se&&qe?se.createHTML(f):f},i.setConfig=function(){xt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},i.clearConfig=function(){yt=null,Ue=!1},i.isValidAttribute=function(e,t,n){yt||xt({});const i=ht(e),o=ht(t);return Lt(i,o,n)},i.addHook=function(e,t){"function"==typeof t&&m(ge[e],t)},i.removeHook=function(e,t){if(void 0!==t){const n=f(ge[e],t);return-1===n?void 0:d(ge[e],n,1)[0]}return p(ge[e])},i.removeHooks=function(e){ge[e]=[]},i.removeAllHooks=function(){ge={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}();return re}()}));export{n as p}
|
|
@@ -0,0 +1 @@
|
|
|
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}
|