@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 t,h as i}from"./p-
|
|
1
|
+
import{r as t,h as i}from"./p-e4c7eb39.js";import{RECORD_DATE_FORMAT as a,DataUnitInMemoryLoader as e}from"@sankhyalabs/core";const s=class{constructor(i){t(this,i),this.inMemoryLoader=void 0,this.metadata=void 0,this.records=void 0,this.columnsConfig=void 0,this.pageSize=150,this.recordDateFormat=a.DD_MM_YYYY,this.multipleSelection=!1,this.autoFocus=!0,this.paginationCounterMode="auto",this.suppressCheckboxColumn=!1,this.suppressFilterColumn=!1,this.outlineMode=!1,this.enableRowTableStriped=!0,this.compact=!1,this.useSearchColumn=!0,this.suppressHorizontalScroll=!1}async getDataUnit(){if(this.hasValidDependencies())return this.ensureInMemoryLoaderExists(),this.inMemoryLoader.dataUnit}async refresh(){await this.inMemoryLoader.dataUnit.loadData()}async getSelection(){var t;return null===(t=this._gridRef)||void 0===t?void 0:t.getSelection()}async quickFilter(t){var i;await(null===(i=this._gridRef)||void 0===i?void 0:i.quickFilter(t))}async locateColumn(t){var i;await(null===(i=this._gridRef)||void 0===i?void 0:i.locateColumn(t))}async filterColumns(t){var i;return null===(i=this._gridRef)||void 0===i?void 0:i.filterColumns(t)}async addColumnMenuItem(t,i,a,e){await this._gridRef.addColumnMenuItem(t,i,a,e)}async addCustomValueFormatter(t,i){var a;await(null===(a=this._gridRef)||void 0===a?void 0:a.addCustomValueFormatter(t,i))}async removeCustomValueFormatter(t){var i;await(null===(i=this._gridRef)||void 0===i?void 0:i.removeCustomValueFormatter(t))}async addGridCustomRender(t,i,a){var e;await(null===(e=this._gridRef)||void 0===e?void 0:e.addGridCustomRender(t,i,a))}async setFocus(){var t;await(null===(t=this._gridRef)||void 0===t?void 0:t.setFocus())}async handleMetadataChanged(){await this.configGrid()}async handleRecordsChanged(){await this.configGrid()}async handlePageSizeChanged(){await this.configGrid(!0)}async handleRecordDateFormatChanged(){await this.configGrid(!0)}async configGrid(t=!1){this.hasValidDependencies()&&(this.ensureInMemoryLoaderExists(t),this.updateDURecords(),this.refreshFilterColumnDataSource())}updateDURecords(){requestAnimationFrame((()=>{this.inMemoryLoader.records=this.records}))}refreshFilterColumnDataSource(){requestAnimationFrame((async()=>{var t;await(null===(t=this._gridRef)||void 0===t?void 0:t.refreshColumnFilterDataSource())}))}hasValidDependencies(){return this.metadata&&this.records}buildGridConfig(){if(this.columnsConfig)return{columns:this.columnsConfig.map(this.parseColumnConfig.bind(this))}}parseColumnConfig(t,i){return Object.assign(Object.assign({},t),{orderIndex:i})}ensureInMemoryLoaderExists(t=!1){t&&this.clearInMemoryLoader(),this.buildInMemoryLoader()}buildInMemoryLoader(){requestAnimationFrame((()=>{this.inMemoryLoader||(this.inMemoryLoader=new e(this.metadata,this.records,this.buildInMemoryLoaderConfig()))}))}clearInMemoryLoader(){this.inMemoryLoader=void 0}buildInMemoryLoaderConfig(){return{pageSize:this.pageSize,recordDateFormat:this.recordDateFormat}}async componentDidLoad(){await this.configGrid()}render(){var t;if((null===(t=this.inMemoryLoader)||void 0===t?void 0:t.dataUnit)&&this.records)return i("ez-grid",{ref:t=>this._gridRef=t,canEdit:!1,dataUnit:this.inMemoryLoader.dataUnit,config:this.buildGridConfig(),multipleSelection:this.multipleSelection,autoFocus:this.autoFocus,paginationCounterMode:this.paginationCounterMode,suppressCheckboxColumn:this.suppressCheckboxColumn,suppressFilterColumn:this.suppressFilterColumn,suppressHorizontalScroll:this.suppressHorizontalScroll,outlineMode:this.outlineMode,enableRowTableStriped:this.enableRowTableStriped,useSearchColumn:this.useSearchColumn,compact:this.compact,onEzPageChangedChanged:()=>this.refreshFilterColumnDataSource()},i("slot",{name:"leftButtons"}),i("slot",{name:"footer"}))}static get watchers(){return{metadata:["handleMetadataChanged"],records:["handleRecordsChanged"],pageSize:["handlePageSizeChanged"],recordDateFormat:["handleRecordDateFormatChanged"]}}};s.style="";export{s as ez_grid_view}
|
|
@@ -38,6 +38,10 @@ export declare class EzModalContainer {
|
|
|
38
38
|
* Define a visibilidade do botão de fechar.
|
|
39
39
|
*/
|
|
40
40
|
showCloseButton?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Se true o modal container receberá o foco ao ser renderizado.
|
|
43
|
+
*/
|
|
44
|
+
autoFocus?: boolean;
|
|
41
45
|
/**
|
|
42
46
|
* Representa a interação com o usuário.
|
|
43
47
|
* OK - Quando o botão é acionado
|
|
@@ -49,11 +53,11 @@ export declare class EzModalContainer {
|
|
|
49
53
|
handleEzModalAction(event: CustomEvent<string>): Promise<void>;
|
|
50
54
|
private cancelIsVisible;
|
|
51
55
|
private okIsVisible;
|
|
56
|
+
private emitOkAction;
|
|
52
57
|
componentWillLoad(): Promise<void>;
|
|
58
|
+
connectedCallback(): void;
|
|
53
59
|
componentDidLoad(): void;
|
|
54
60
|
disconnectedCallback(): void;
|
|
55
61
|
private closeModal;
|
|
56
|
-
focusLast(): void;
|
|
57
|
-
focusFirst(): void;
|
|
58
62
|
render(): any;
|
|
59
63
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { ITreeItem } from './interfaces/ITreeItem';
|
|
3
|
+
import { UpdateItemConfig } from './types/UpdateItemConfig';
|
|
3
4
|
export declare class EzTree {
|
|
4
5
|
private i18n;
|
|
5
6
|
private _element;
|
|
@@ -32,6 +33,10 @@ export declare class EzTree {
|
|
|
32
33
|
* Define se a árvore deve permitir a filtragem hierárquica.
|
|
33
34
|
*/
|
|
34
35
|
enableHierarchicalFilter: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Define se os itens da árvore são selecionáveis.
|
|
38
|
+
*/
|
|
39
|
+
selectable: boolean;
|
|
35
40
|
/**
|
|
36
41
|
* Emitido quando um item é selecionado na árvore.
|
|
37
42
|
*/
|
|
@@ -44,6 +49,10 @@ export declare class EzTree {
|
|
|
44
49
|
* Emitido ao dar clique duplo em um item da árvore.
|
|
45
50
|
*/
|
|
46
51
|
ezDbClickItem: EventEmitter<ITreeItem>;
|
|
52
|
+
/**
|
|
53
|
+
* Emitido ao remover um item da árvore.
|
|
54
|
+
*/
|
|
55
|
+
ezRemoveItem: EventEmitter<string>;
|
|
47
56
|
/**
|
|
48
57
|
* Efetua a seleção de um item.
|
|
49
58
|
*/
|
|
@@ -87,7 +96,12 @@ export declare class EzTree {
|
|
|
87
96
|
/**
|
|
88
97
|
* Atualiza um item
|
|
89
98
|
*/
|
|
90
|
-
updateItem(item: ITreeItem): Promise<void>;
|
|
99
|
+
updateItem(item: ITreeItem | ITreeItem[], config?: Partial<UpdateItemConfig>): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Remove um item da árvore pelo seu ID.
|
|
102
|
+
* Se o item removido estiver selecionado, a seleção será limpa.
|
|
103
|
+
*/
|
|
104
|
+
removeItem(id?: string): Promise<void>;
|
|
91
105
|
/**
|
|
92
106
|
* Obtem um item pelo id
|
|
93
107
|
*/
|
|
@@ -104,6 +118,11 @@ export declare class EzTree {
|
|
|
104
118
|
observeItems(newValue: Array<ITreeItem>, oldValue: Array<ITreeItem>): void;
|
|
105
119
|
observeValue(): void;
|
|
106
120
|
onKeyDownListener(event: KeyboardEvent): void;
|
|
121
|
+
private getItemById;
|
|
122
|
+
private addItemInIndexedList;
|
|
123
|
+
private applyDefaultValues;
|
|
124
|
+
private updateItemInIndexedList;
|
|
125
|
+
private removeItemFromIndexedList;
|
|
107
126
|
private getItemPathAttrs;
|
|
108
127
|
private openClose;
|
|
109
128
|
private previousLevel;
|
|
@@ -14,6 +14,7 @@ export declare class Node {
|
|
|
14
14
|
isDisabled(): boolean;
|
|
15
15
|
updateChildren(children: Array<ITreeItem>): void;
|
|
16
16
|
addChild(tree: ITree, item: ITreeItem): void;
|
|
17
|
+
removeChild(id: string): boolean;
|
|
17
18
|
addPlaceHolder(): void;
|
|
18
19
|
getNode(id: string): Node;
|
|
19
20
|
needLoad(): boolean;
|
|
@@ -13,6 +13,7 @@ export declare class Tree extends Node implements ITree {
|
|
|
13
13
|
load(items: Array<ITreeItem>): void;
|
|
14
14
|
setFilterPattern(pattern: string, enableHierarchicalFilter?: boolean): Promise<void>;
|
|
15
15
|
updateItem(item: ITreeItem): void;
|
|
16
|
+
removeItem(id: string): void;
|
|
16
17
|
open(path: string): Promise<void>;
|
|
17
18
|
private setAllChildrenVisible;
|
|
18
19
|
private applyFilter;
|
|
@@ -59,6 +59,7 @@ import { IStyled } from "./components/ez-text-edit/ez-text-edit";
|
|
|
59
59
|
import { TFocusOptions as TFocusOptions1 } from "./components/ez-text-input/ez-text-input";
|
|
60
60
|
import { Placement } from "@floating-ui/dom";
|
|
61
61
|
import { ITreeItem } from "./components/ez-tree/interfaces/ITreeItem";
|
|
62
|
+
import { UpdateItemConfig } from "./components/ez-tree/types/UpdateItemConfig";
|
|
62
63
|
import { Node } from "./components/ez-tree/types/Node";
|
|
63
64
|
import { EzFile } from "./components/ez-upload/ez-upload";
|
|
64
65
|
import { IAppliedFilterColumnOptions, IFilterColumnConfigs } from "./components/ez-grid/subcomponents/filter-column";
|
|
@@ -1800,6 +1801,10 @@ export namespace Components {
|
|
|
1800
1801
|
"scrim": "medium" | "light" | "none";
|
|
1801
1802
|
}
|
|
1802
1803
|
interface EzModalContainer {
|
|
1804
|
+
/**
|
|
1805
|
+
* Se true o modal container receberá o foco ao ser renderizado.
|
|
1806
|
+
*/
|
|
1807
|
+
"autoFocus"?: boolean;
|
|
1803
1808
|
/**
|
|
1804
1809
|
* Define o texto do botão de cancelamento.
|
|
1805
1810
|
*/
|
|
@@ -3395,10 +3400,18 @@ export namespace Components {
|
|
|
3395
3400
|
* Realiza a abertura de um item, incluindo a hieraquia acima. Observação para carga dinâmica (Lazyload): O item solicitado já deve estar carregado na lista. Nos casos onde o item ainda não esteja carregado o id pode ser uma string no formato "id1>>id2>>id3", tornando possível a carga a partir de um ponto já carregado.
|
|
3396
3401
|
*/
|
|
3397
3402
|
"openItem": (id: string) => Promise<void>;
|
|
3403
|
+
/**
|
|
3404
|
+
* Remove um item da árvore pelo seu ID. Se o item removido estiver selecionado, a seleção será limpa.
|
|
3405
|
+
*/
|
|
3406
|
+
"removeItem": (id?: string) => Promise<void>;
|
|
3398
3407
|
/**
|
|
3399
3408
|
* Efetua a seleção de um item.
|
|
3400
3409
|
*/
|
|
3401
3410
|
"selectItem": (id: string) => Promise<void>;
|
|
3411
|
+
/**
|
|
3412
|
+
* Define se os itens da árvore são selecionáveis.
|
|
3413
|
+
*/
|
|
3414
|
+
"selectable": boolean;
|
|
3402
3415
|
/**
|
|
3403
3416
|
* Forma alternativa para atribuir o item selecionado por seu ID.
|
|
3404
3417
|
*/
|
|
@@ -3410,7 +3423,7 @@ export namespace Components {
|
|
|
3410
3423
|
/**
|
|
3411
3424
|
* Atualiza um item
|
|
3412
3425
|
*/
|
|
3413
|
-
"updateItem": (item: ITreeItem) => Promise<void>;
|
|
3426
|
+
"updateItem": (item: ITreeItem | ITreeItem[], config?: Partial<UpdateItemConfig>) => Promise<void>;
|
|
3414
3427
|
/**
|
|
3415
3428
|
* Define o item selecionado na árvore.
|
|
3416
3429
|
*/
|
|
@@ -6008,6 +6021,10 @@ declare namespace LocalJSX {
|
|
|
6008
6021
|
"scrim"?: "medium" | "light" | "none";
|
|
6009
6022
|
}
|
|
6010
6023
|
interface EzModalContainer {
|
|
6024
|
+
/**
|
|
6025
|
+
* Se true o modal container receberá o foco ao ser renderizado.
|
|
6026
|
+
*/
|
|
6027
|
+
"autoFocus"?: boolean;
|
|
6011
6028
|
/**
|
|
6012
6029
|
* Define o texto do botão de cancelamento.
|
|
6013
6030
|
*/
|
|
@@ -7477,6 +7494,14 @@ declare namespace LocalJSX {
|
|
|
7477
7494
|
* Emitido quando um item é aberto na árvore.
|
|
7478
7495
|
*/
|
|
7479
7496
|
"onEzOpenItem"?: (event: EzTreeCustomEvent<ITreeItem>) => void;
|
|
7497
|
+
/**
|
|
7498
|
+
* Emitido ao remover um item da árvore.
|
|
7499
|
+
*/
|
|
7500
|
+
"onEzRemoveItem"?: (event: EzTreeCustomEvent<string>) => void;
|
|
7501
|
+
/**
|
|
7502
|
+
* Define se os itens da árvore são selecionáveis.
|
|
7503
|
+
*/
|
|
7504
|
+
"selectable"?: boolean;
|
|
7480
7505
|
/**
|
|
7481
7506
|
* Forma alternativa para atribuir o item selecionado por seu ID.
|
|
7482
7507
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DataUnit } from "@sankhyalabs/core";
|
|
2
2
|
import { IFormConfig, IFormSheetMetadata } from "./interfaces";
|
|
3
|
+
import { IGuideItem } from "../../components/ez-guide-navigator/interfaces";
|
|
3
4
|
export declare class FormMetadata {
|
|
4
5
|
private _sheets;
|
|
5
6
|
private _requiredFields;
|
|
@@ -20,4 +21,4 @@ export declare class FormMetadata {
|
|
|
20
21
|
setDefaultVars(vars: Map<string, any>): void;
|
|
21
22
|
}
|
|
22
23
|
export declare const buildFormConfigFromDataUnit: (dataUnit: DataUnit) => IFormConfig;
|
|
23
|
-
export declare const buildFormMetadata: (config: IFormConfig, dataUnit: DataUnit, includeDetails?: boolean) => FormMetadata;
|
|
24
|
+
export declare const buildFormMetadata: (config: IFormConfig, dataUnit: DataUnit, includeDetails?: boolean, customGuides?: IGuideItem[]) => FormMetadata;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,f as r,H as s,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as a,StringUtils as n,ObjectUtils as l}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,m=t=>{const{node:i,selectedId:r,itemClick:s,iconClick:o,iconResolver:n,tooltipResolver:l,itemsList:h,itemDoubleClick:c}=t;if(!i.visible)return;const d=i.item,v=t.level||1,u=i.isDisabled(),b=!u&&d.expanded,g=i.isExpandable(),f=!u&&!i.isPlaceHolder;return f&&h.push(d),e("ul",{class:1===v?"first-level":void 0},e("li",Object.assign({title:l(d,!u,v),class:"tree-item "+(d.id!==r?"tree-item-error":""),onClick:()=>f&&s(d),onDblClick:()=>f&&c(d)},{disabled:u,selected:d.id===r,[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.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:n(d,b,v),onClick:e=>function(e){e.stopPropagation(),f&&o(d)}(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(m,{selectedId:r,node:t,itemClick:s,iconClick:o,level:v+1,iconResolver:n,tooltipResolver:l,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))}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 u extends v{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,t){const i=this.getNode(e);null!=i&&(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=>n.replaceAccentuatedCharsKeepSymbols(e.trim())));await this.applyLayeredFilter(this,t,0)}else this._filterPattern=n.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())}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(n.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(!n.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._onItemClick=e=>{this._onIconClick(e)},this._onIconClick=e=>{this.openClose(e),this.value=e},this._tree=new u((()=>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}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);const r=this._tree.getNode(t);r&&(r.item.expanded=!0)}async applyFilter(e){await this._tree.setFilterPattern(e,this.enableHierarchicalFilter)}async expandAll(){this._tree.expandAll()}async collapseAll(){this._tree.collapseAll()}async updateItem(e){var t;this._tree.updateItem(e),null==(null===(t=this._tree)||void 0===t?void 0:t.getNode(this.selectedId))&&(this.value=this._visibleItems?this._visibleItems[0]: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,a=null===(t=r.parent)||void 0===t?void 0:t.item;for(s.push(this.getItemPathAttrs(r.item));null!=a;)s.unshift(this.getItemPathAttrs(a)),o=this._tree.getNode(a.id),a=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){l.objectToString(e)!==l.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())}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(a.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(m,{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--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;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 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,H as a,g as i}from"./p-23a36bb6.js";import{KeyboardManager as n}from"@sankhyalabs/core";import{i as s}from"./p-641ee538.js";var l;!function(e){e.CLOSE="CLOSE",e.OK="OK",e.CANCEL="CANCEL",e.LOAD="LOAD"}(l||(l={}));const r=l;var c;!function(e){e.ENABLED="ENABLED",e.DISABLED="DISABLED",e.HIDDEN="HIDDEN"}(c||(c={}));const d=c,h=class{constructor(o){e(this,o),this.ezModalAction=t(this,"ezModalAction",7),this.modalTitle=void 0,this.modalSubTitle=void 0,this.showTitleBar=!0,this.cancelButtonLabel=void 0,this.okButtonLabel=void 0,this.cancelButtonStatus=void 0,this.okButtonStatus=void 0,this.showCloseButton=!0}async handleEzModalAction(e){var t;(null==e?void 0:e.target)&&(null==e?void 0:e.target)===(null===(t=this._element)||void 0===t?void 0:t.parentElement)&&this.closeModal()}cancelIsVisible(){return this.cancelButtonStatus!==d.HIDDEN&&null!=this.cancelButtonLabel}okIsVisible(){return this.okButtonStatus!==d.HIDDEN&&null!=this.okButtonLabel}async componentWillLoad(){this.i18n=await s()}componentDidLoad(){window.requestAnimationFrame((()=>{this.ezModalAction.emit(r.LOAD),this._modalRef.focus()})),this._keyboardManager=new n({propagate:!1,element:this._element}).bind("Enter",this.ezModalAction.emit.bind(r.OK)).bind("Escape",(()=>this.closeModal())).bind("Esc",(()=>this.closeModal()))}disconnectedCallback(){var e;null===(e=this._keyboardManager)||void 0===e||e.unbindAllShortcutKeys()}closeModal(){this.ezModalAction.emit("CLOSE")}focusLast(){null!=this._okButton&&this._okButton.setFocus()}focusFirst(){this._closeButton.focus()}render(){return o(a,null,o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusLast()}),o("div",{ref:e=>this._modalRef=e,tabIndex:-1,class:"ez-modal-container__header-container"},this.showTitleBar&&o("div",{class:"ez-modal-container__header ez-margin-bottom--medium"},o("div",{class:"ez-col ez-align--middle ez-modal-container__title"},o("h2",{class:"ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small"},this.modalTitle),this.modalSubTitle&&o("div",{class:"ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small"},this.modalSubTitle)),this.showCloseButton&&o("button",{ref:e=>this._closeButton=e,class:"ez-modal-container__close-button",onClick:()=>this.ezModalAction.emit(r.CLOSE),"aria-label":this.i18n("app.close")},o("ez-icon",{class:"ez-modal-container__close-icon",size:"medium",iconName:"close"})))),o("div",{tabIndex:-1,class:"ez-modal-container__content"},o("slot",null)),o("div",{tabIndex:-1,class:"ez-modal-container__footer"},this.cancelIsVisible()&&o("ez-button",{label:this.cancelButtonLabel||this.i18n("app.cancel"),enabled:this.cancelButtonStatus!==d.DISABLED,onClick:()=>this.ezModalAction.emit(r.CANCEL)}),this.okIsVisible()&&o("ez-button",{ref:e=>this._okButton=e,class:"ez-button--primary",label:this.okButtonLabel||this.i18n("app.ok"),enabled:this.okButtonStatus!==d.DISABLED,onClick:()=>this.ezModalAction.emit(r.OK)})),o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusFirst()}))}get _element(){return i(this)}};h.style=".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:hidden;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between;align-items:start}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x);outline:none}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none;outline:none;padding:var(--space--6, 6px) 0px}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";export{h as ez_modal_container}
|
package/dist/ezui/p-228a4d2f.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as t,a as e}from"./p-112455b1.js";var n=t((function(t){
|
|
2
|
-
/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */
|
|
3
|
-
t.exports=function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:r,seal:a,create:l}=Object,{apply:s,construct:c}="undefined"!=typeof Reflect&&Reflect;r||(r=function(t){return t}),a||(a=function(t){return t}),s||(s=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return t.apply(e,o)}),c||(c=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});const u=k(Array.prototype.forEach),f=k(Array.prototype.lastIndexOf),p=k(Array.prototype.pop),m=k(Array.prototype.push),d=k(Array.prototype.splice),h=k(String.prototype.toLowerCase),g=k(String.prototype.toString),y=k(String.prototype.match),b=k(String.prototype.replace),w=k(String.prototype.indexOf),x=k(String.prototype.trim),v=k(Object.prototype.hasOwnProperty),T=k(RegExp.prototype.test),S=(A=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return c(A,e)});var A;function k(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return s(t,e,o)}}function E(t,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;e&&e(t,null);let r=o.length;for(;r--;){let e=o[r];if("string"==typeof e){const t=i(e);t!==e&&(n(o)||(o[r]=t),e=t)}t[e]=!0}return t}function R(t){for(let e=0;e<t.length;e++)v(t,e)||(t[e]=null);return t}function _(e){const n=l(null);for(const[o,i]of t(e))v(e,o)&&(n[o]=Array.isArray(i)?R(i):i&&"object"==typeof i&&i.constructor===Object?_(i):i);return n}function z(t,e){for(;null!==t;){const n=i(t,e);if(n){if(n.get)return k(n.get);if("function"==typeof n.value)return k(n.value)}t=o(t)}return function(){return null}}const D=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"]),O=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","slot","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"]),I=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"]),F=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","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,tt=7,et=8,nt=9,ot=function(){return"undefined"==typeof window?null:window},it=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};var rt=function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot();const o=t=>e(t);if(o.version="3.2.7",o.removed=[],!n||!n.document||n.document.nodeType!==nt||!n.Element)return o.isSupported=!1,o;let{document:i}=n;const a=i,s=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:A,Node:k,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"),rt=z($,"nextSibling"),at=z($,"childNodes"),lt=z($,"parentNode");if("function"==typeof A){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let st,ct="";const{implementation:ut,createNodeIterator:ft,createDocumentFragment:pt,getElementsByTagName:mt}=i,{importNode:dt}=a;let ht={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof t&&"function"==typeof lt&&ut&&void 0!==ut.createHTMLDocument;const{MUSTACHE_EXPR:gt,ERB_EXPR:yt,TMPLIT_EXPR:bt,DATA_ATTR:wt,ARIA_ATTR:xt,IS_SCRIPT_OR_DATA:vt,ATTR_WHITESPACE:Tt,CUSTOM_ELEMENT:St}=J;let{IS_ALLOWED_URI:At}=J,kt=null;const Et=E({},[...D,...O,...L,...I,...P]);let Rt=null;const _t=E({},[...N,...C,...j,...U]);let zt=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}})),Dt=null,Ot=null,Lt=!0,Mt=!0,It=!1,Ft=!0,Pt=!1,Nt=!0,Ct=!1,jt=!1,Ut=!1,Bt=!1,Wt=!1,Ht=!1,qt=!0,Yt=!1;const Xt="user-content-";let $t=!0,Gt=!1,Kt={},Vt=null;const Jt=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 Qt=null;const Zt=E({},["audio","video","img","source","image","track"]);let te=null;const ee=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",ie="http://www.w3.org/1999/xhtml";let re=ie,ae=!1,le=null;const se=E({},[ne,oe,ie],g);let ce=E({},["mi","mo","mn","ms","mtext"]),ue=E({},["annotation-xml"]);const fe=E({},["title","style","font","a","script"]);let pe=null;const me=["application/xhtml+xml","text/html"],de="text/html";let he=null,ge=null;const ye=i.createElement("form"),be=function(t){return t instanceof RegExp||t instanceof Function},we=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ge||ge!==t){if(t&&"object"==typeof t||(t={}),t=_(t),pe=-1===me.indexOf(t.PARSER_MEDIA_TYPE)?de:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===pe?g:h,kt=v(t,"ALLOWED_TAGS")?E({},t.ALLOWED_TAGS,he):Et,Rt=v(t,"ALLOWED_ATTR")?E({},t.ALLOWED_ATTR,he):_t,le=v(t,"ALLOWED_NAMESPACES")?E({},t.ALLOWED_NAMESPACES,g):se,te=v(t,"ADD_URI_SAFE_ATTR")?E(_(ee),t.ADD_URI_SAFE_ATTR,he):ee,Qt=v(t,"ADD_DATA_URI_TAGS")?E(_(Zt),t.ADD_DATA_URI_TAGS,he):Zt,Vt=v(t,"FORBID_CONTENTS")?E({},t.FORBID_CONTENTS,he):Jt,Dt=v(t,"FORBID_TAGS")?E({},t.FORBID_TAGS,he):_({}),Ot=v(t,"FORBID_ATTR")?E({},t.FORBID_ATTR,he):_({}),Kt=!!v(t,"USE_PROFILES")&&t.USE_PROFILES,Lt=!1!==t.ALLOW_ARIA_ATTR,Mt=!1!==t.ALLOW_DATA_ATTR,It=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Pt=t.SAFE_FOR_TEMPLATES||!1,Nt=!1!==t.SAFE_FOR_XML,Ct=t.WHOLE_DOCUMENT||!1,Bt=t.RETURN_DOM||!1,Wt=t.RETURN_DOM_FRAGMENT||!1,Ht=t.RETURN_TRUSTED_TYPE||!1,Ut=t.FORCE_BODY||!1,qt=!1!==t.SANITIZE_DOM,Yt=t.SANITIZE_NAMED_PROPS||!1,$t=!1!==t.KEEP_CONTENT,Gt=t.IN_PLACE||!1,At=t.ALLOWED_URI_REGEXP||X,re=t.NAMESPACE||ie,ce=t.MATHML_TEXT_INTEGRATION_POINTS||ce,ue=t.HTML_INTEGRATION_POINTS||ue,zt=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(zt.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(zt.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(zt.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(Mt=!1),Wt&&(Bt=!0),Kt&&(kt=E({},P),Rt=[],!0===Kt.html&&(E(kt,D),E(Rt,N)),!0===Kt.svg&&(E(kt,O),E(Rt,C),E(Rt,U)),!0===Kt.svgFilters&&(E(kt,L),E(Rt,C),E(Rt,U)),!0===Kt.mathMl&&(E(kt,I),E(Rt,j),E(Rt,U))),t.ADD_TAGS&&(kt===Et&&(kt=_(kt)),E(kt,t.ADD_TAGS,he)),t.ADD_ATTR&&(Rt===_t&&(Rt=_(Rt)),E(Rt,t.ADD_ATTR,he)),t.ADD_URI_SAFE_ATTR&&E(te,t.ADD_URI_SAFE_ATTR,he),t.FORBID_CONTENTS&&(Vt===Jt&&(Vt=_(Vt)),E(Vt,t.FORBID_CONTENTS,he)),$t&&(kt["#text"]=!0),Ct&&E(kt,["html","head","body"]),kt.table&&(E(kt,["tbody"]),delete Dt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');st=t.TRUSTED_TYPES_POLICY,ct=st.createHTML("")}else void 0===st&&(st=it(Y,s)),null!==st&&"string"==typeof ct&&(ct=st.createHTML(""));r&&r(t),ge=t}},xe=E({},[...O,...L,...M]),ve=E({},[...I,...F]),Te=function(t){let e=lt(t);e&&e.tagName||(e={namespaceURI:re,tagName:"template"});const n=h(t.tagName),o=h(e.tagName);return!!le[t.namespaceURI]&&(t.namespaceURI===oe?e.namespaceURI===ie?"svg"===n:e.namespaceURI===ne?"svg"===n&&("annotation-xml"===o||ce[o]):Boolean(xe[n]):t.namespaceURI===ne?e.namespaceURI===ie?"math"===n:e.namespaceURI===oe?"math"===n&&ue[o]:Boolean(ve[n]):t.namespaceURI===ie?!(e.namespaceURI===oe&&!ue[o])&&!(e.namespaceURI===ne&&!ce[o])&&!ve[n]&&(fe[n]||!xe[n]):!("application/xhtml+xml"!==pe||!le[t.namespaceURI]))},Se=function(t){m(o.removed,{element:t});try{lt(t).removeChild(t)}catch(e){V(t)}},Ae=function(t,e){try{m(o.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){m(o.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Bt||Wt)try{Se(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ke=function(t){let e=null,n=null;if(Ut)t="<remove></remove>"+t;else{const e=y(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===pe&&re===ie&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=st?st.createHTML(t):t;if(re===ie)try{e=(new q).parseFromString(o,pe)}catch(t){}if(!e||!e.documentElement){e=ut.createDocument(re,"template",null);try{e.documentElement.innerHTML=ae?ct:o}catch(t){}}const r=e.body||e.documentElement;return t&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),re===ie?mt.call(e,Ct?"html":"body")[0]:Ct?e.documentElement:r},Ee=function(t){return ft.call(t.ownerDocument||t,t,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},Re=function(t){return t instanceof H&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof W)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},_e=function(t){return"function"==typeof k&&t instanceof k};function ze(t,e,n){u(t,(t=>{t.call(o,e,n,ge)}))}const De=function(t){let e=null;if(ze(ht.beforeSanitizeElements,t,null),Re(t))return Se(t),!0;const n=he(t.nodeName);if(ze(ht.uponSanitizeElement,t,{tagName:n,allowedTags:kt}),Nt&&t.hasChildNodes()&&!_e(t.firstElementChild)&&T(/<[/\w!]/g,t.innerHTML)&&T(/<[/\w!]/g,t.textContent))return Se(t),!0;if(t.nodeType===tt)return Se(t),!0;if(Nt&&t.nodeType===et&&T(/<[/\w]/g,t.data))return Se(t),!0;if(!kt[n]||Dt[n]){if(!Dt[n]&&Le(n)){if(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,n))return!1;if(zt.tagNameCheck instanceof Function&&zt.tagNameCheck(n))return!1}if($t&&!Vt[n]){const e=lt(t)||t.parentNode,n=at(t)||t.childNodes;if(n&&e)for(let o=n.length-1;o>=0;--o){const i=G(n[o],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,rt(t))}}return Se(t),!0}return t instanceof R&&!Te(t)?(Se(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!T(/<\/no(script|embed|frames)/i,t.innerHTML)?(Pt&&t.nodeType===Z&&(e=t.textContent,u([gt,yt,bt],(t=>{e=b(e,t," ")})),t.textContent!==e&&(m(o.removed,{element:t.cloneNode()}),t.textContent=e)),ze(ht.afterSanitizeElements,t,null),!1):(Se(t),!0)},Oe=function(t,e,n){if(qt&&("id"===e||"name"===e)&&(n in i||n in ye))return!1;if(Mt&&!Ot[e]&&T(wt,e));else if(Lt&&T(xt,e));else if(!Rt[e]||Ot[e]){if(!(Le(t)&&(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,t)||zt.tagNameCheck instanceof Function&&zt.tagNameCheck(t))&&(zt.attributeNameCheck instanceof RegExp&&T(zt.attributeNameCheck,e)||zt.attributeNameCheck instanceof Function&&zt.attributeNameCheck(e,t))||"is"===e&&zt.allowCustomizedBuiltInElements&&(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,n)||zt.tagNameCheck instanceof Function&&zt.tagNameCheck(n))))return!1}else if(te[e]);else if(T(At,b(n,Tt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==w(n,"data:")||!Qt[t])if(It&&!T(vt,b(n,Tt,"")));else if(n)return!1;return!0},Le=function(t){return"annotation-xml"!==t&&y(t,St)},Me=function(t){ze(ht.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||Re(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Rt,forceKeepAttr:void 0};let i=e.length;for(;i--;){const r=e[i],{name:a,namespaceURI:l,value:s}=r,c=he(a),f=s;let m="value"===a?f:x(f);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,ze(ht.uponSanitizeAttribute,t,n),m=n.attrValue,!Yt||"id"!==c&&"name"!==c||(Ae(a,t),m=Xt+m),Nt&&T(/((--!?|])>)|<\/(style|title|textarea)/i,m)){Ae(a,t);continue}if("attributename"===c&&y(m,"href")){Ae(a,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Ae(a,t);continue}if(!Ft&&T(/\/>/i,m)){Ae(a,t);continue}Pt&&u([gt,yt,bt],(t=>{m=b(m,t," ")}));const d=he(t.nodeName);if(Oe(d,c,m)){if(st&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(l);else switch(Y.getAttributeType(d,c)){case"TrustedHTML":m=st.createHTML(m);break;case"TrustedScriptURL":m=st.createScriptURL(m)}if(m!==f)try{l?t.setAttributeNS(l,a,m):t.setAttribute(a,m),Re(t)?Se(t):p(o.removed)}catch(e){Ae(a,t)}}else Ae(a,t)}ze(ht.afterSanitizeAttributes,t,null)},Ie=function t(e){let n=null;const o=Ee(e);for(ze(ht.beforeSanitizeShadowDOM,e,null);n=o.nextNode();)ze(ht.uponSanitizeShadowNode,n,null),De(n),Me(n),n.content instanceof c&&t(n.content);ze(ht.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,r=null,l=null;if(ae=!t,ae&&(t="\x3c!--\x3e"),"string"!=typeof t&&!_e(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!o.isSupported)return t;if(jt||we(e),o.removed=[],"string"==typeof t&&(Gt=!1),Gt){if(t.nodeName){const e=he(t.nodeName);if(!kt[e]||Dt[e])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof k)n=ke("\x3c!----\x3e"),i=n.ownerDocument.importNode(t,!0),i.nodeType===Q&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Bt&&!Pt&&!Ct&&-1===t.indexOf("<"))return st&&Ht?st.createHTML(t):t;if(n=ke(t),!n)return Bt?null:Ht?ct:""}n&&Ut&&Se(n.firstChild);const s=Ee(Gt?t:n);for(;r=s.nextNode();)De(r),Me(r),r.content instanceof c&&Ie(r.content);if(Gt)return t;if(Bt){if(Wt)for(l=pt.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Rt.shadowroot||Rt.shadowrootmode)&&(l=dt.call(a,l,!0)),l}let f=Ct?n.outerHTML:n.innerHTML;return Ct&&kt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&T(K,n.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+f),Pt&&u([gt,yt,bt],(t=>{f=b(f,t," ")})),st&&Ht?st.createHTML(f):f},o.setConfig=function(){we(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),jt=!0},o.clearConfig=function(){ge=null,jt=!1},o.isValidAttribute=function(t,e,n){ge||we({});const o=he(t),i=he(e);return Oe(o,i,n)},o.addHook=function(t,e){"function"==typeof e&&m(ht[t],e)},o.removeHook=function(t,e){if(void 0!==e){const n=f(ht[t],e);return-1===n?void 0:d(ht[t],n,1)[0]}return p(ht[t])},o.removeHooks=function(t){ht[t]=[]},o.removeAllHooks=function(){ht={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return rt}()}));export{n as p}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as l}from"./p-23a36bb6.js";import{KeyboardManager as s,FloatingManager as n}from"@sankhyalabs/core";import{i as a}from"./p-641ee538.js";const d=class{constructor(o){t(this,o),this.ezClosePopup=i(this,"ezClosePopup",7),this.ezPopupAction=i(this,"ezPopupAction",7),this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0,this.enabledScroll=!1,this.autoClose=!0,this.footerButtons=[]}observeConfig(){this.manageOverflow()}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){this.popUpFocus(),this._keyboardManager=new s({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezPopupAction.emit.bind("OK")).bind("Escape",(()=>this.closePopup())).bind("Esc",(()=>this.closePopup()))}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}closePopup(){this.opened=!1,this.manageOverflow(),this.ezClosePopup.emit()}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=n.subscribeOverlayControl(this._popupRef):n.unsubscribeOverlayControl(this._popupRef||this._overlayId)}popUpFocus(){this.opened&&this._popupRef&&this._popupRef.focus()}getGridSize(){const t={"x-small":"col--sd-3 ez-popup__size-limit--x-small",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11",default:"ez-popup__size-limit--x-small",auto:""};return this.size&&t.hasOwnProperty(this.size)&&t[this.size]||t.medium}getDialogClass(){let t="popup__container";return"auto"===this.heightMode&&(t+=" popup__container--auto"),this.enabledScroll&&(t+=" popup__overflow-y--auto"),t+=` ${this.getGridSize()}`,t}componentDidRender(){this.manageOverlay(),this.popUpFocus()}handleAutoClose(t){if(!this.opened||!this._popupRef||!this.autoClose)return;if(this._popupRef.contains(t.target))return;const i=this._popupRef.querySelector("slot");if(i&&i.assignedElements().length>0){const o=i.assignedElements();for(const i of o)if(i.contains(t.target))return}this._popupRef.shadowRoot&&this._popupRef.shadowRoot.contains(t.target)||this.closePopup()}handleDefaultPropsButtonsByIndex(t){switch(t){case 0:return{label:this.i18n?this.i18n("app.confirm"):"Confirmar",variant:"primary",size:"small",onClick:()=>{this.closePopup(),this.ezPopupAction.emit("OK")}};case 1:return{label:this.i18n?this.i18n("app.cancel"):"Cancelar",variant:"secondary",size:"small",onClick:()=>{this.closePopup()}};case 2:return{label:this.i18n?this.i18n("app.close"):"Fechar",variant:"tertiary",size:"small",onClick:()=>{this.closePopup()}}}}render(){return o(e,null,this.opened&&o("div",{class:"overlay",tabIndex:-1,onClick:this.handleAutoClose.bind(this)},o("dialog",{ref:t=>this._popupRef=t,class:this.getDialogClass()},this.useHeader&&o("header",{class:"popup__header"},!!this.ezTitle&&o("h1",{class:"popup__title"},this.ezTitle),o("ez-button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",variant:"tertiary",mode:"icon",iconName:"close",size:"small",onClick:this.closePopup.bind(this)})),o("main",{class:"popup__expandable-content"},o("slot",null)),this.footerButtons.length>0&&o("footer",{class:"popup__footer"},this.footerButtons.slice(0,3).map(((t,i)=>o("ez-button",Object.assign({key:i},this.handleDefaultPropsButtonsByIndex(i),t))))))))}get _element(){return l(this)}static get watchers(){return{opened:["observeConfig"]}}};d.style=':host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, "Roboto");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;flex:1;font-family:var(--font--pattern, "Roboto");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400);line-height:var(--line-height--24, 24px)}.popup__header{width:100%;display:flex;align-items:center}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{d as ez_popup}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-23a36bb6.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as h,KeyboardManager as u,DataUnit as d,ElementIDUtils as c}from"@sankhyalabs/core";import{b as f,a as v,S as p,f as m,c as b,D as y}from"./p-623161e2.js";import{g as w,i as g}from"./p-641ee538.js";import{F as E}from"./p-30ffb9ed.js";import"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class F{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 _=(t,i)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(i[0].order||1e4);function j(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 z="function"==typeof Symbol&&Symbol.observable||"@@observable",A=function(){return Math.random().toString(36).substring(7).split("").join(".")},S={INIT:"@@redux/INIT"+A(),REPLACE:"@@redux/REPLACE"+A(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+A()}};function x(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 N(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(j(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(j(1));return e(N)(t,i)}if("function"!=typeof t)throw new Error(j(2));var s=t,r=i,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function u(){if(a)throw new Error(j(3));return r}function d(t){if("function"!=typeof t)throw new Error(j(4));if(a)throw new Error(j(5));var i=!0;return h(),l.push(t),function(){if(i){if(a)throw new Error(j(6));i=!1,h();var e=l.indexOf(t);l.splice(e,1),o=null}}}function c(t){if(!x(t))throw new Error(j(7));if(void 0===t.type)throw new Error(j(8));if(a)throw new Error(j(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(j(10));s=t,c({type:S.REPLACE})}function v(){var t,i=d;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(j(11));function e(){t.next&&t.next(u())}return e(),{unsubscribe:i(e)}}})[z]=function(){return this},t}return c({type:S.INIT}),(n={dispatch:c,subscribe:d,getState:u,replaceReducer:f})[z]=v,n}const M={};function R(t=M,i){switch(i.type){case I.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case I.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function T(t){return t.formMetadata}function D(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var I;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(I||(I={}));const P=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=T(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=D(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:I.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=`${h.replaceAccentuatedChars(h.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:h.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 u({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(p,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await m(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)=>{var n,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=[],h={};null===(n=null==t?void 0:t.tabs)||void 0===n||n.forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),null===(s=null==t?void 0:t.fields)||void 0===s||s.forEach((t=>{var e,n,s;if(!1!==t.visible){const u=((t,i)=>("string"==typeof t?Array.from(i.keys()).find((i=>i.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",r);if(o.has(u.label))return;const d=i.getField(t.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&u.visible){r.has(u)||r.set(u,[]);const i=f(d,t);r.get(u).push(i),i.required&&l.push(t.name),((null==t.cleanOnCopy?null===(e=d.properties)||void 0===e?void 0:e.cleanOnCopy:t.cleanOnCopy)||(null===(n=d.properties)||void 0===n?void 0:n.cleanOnCopy))&&a.push(t.name);let o=null==t.defaultValue?null===(s=d.properties)||void 0===s?void 0:s.defaultValue:t.defaultValue;if(o&&null!=o.value){const{type:i,value:e}=o;if(i)if("V"===i)o=e;else try{const t=JSON.parse(e);o=t&&"value"in t?t:e}catch(t){}h[t.name]=o}}}}));const u=new F;if(u.setDefaultVars(t.defaultVars),e){const t=i.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:i,name:e,fields:n}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);r.set({name:e,label:i},n)}))}const d=w();return Array.from(r.entries()).sort(_).forEach((([t,i])=>{u.addSheet({label:"__main"===t.label?d("ez-form.mainTab"):t.label,name:t.name||t.label,fields:i})})),u.addRequiredFields(l),u.addCleanOnCopyFields(a),u.addDefaultValues(h),u})(this.config,this.dataUnit);this._store.dispatch({type:I.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 d("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=N(R),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),c.addIDInfo(this._element,null,{dataUnit:this.dataUnit});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)===E.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===E.CASCADE}))}componentDidRender(){const t=T(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,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=D(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[c.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=h.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"]}}};P.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{P as ez_form}
|
package/dist/ezui/p-623161e2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{UserInterface as t,Action as s,StringUtils as i,ApplicationContext as e,ObjectUtils as n,WaitingChangeException as a,DataUnitAction as h}from"@sankhyalabs/core";import{A as r}from"./p-5a11cf56.js";import{g as o}from"./p-641ee538.js";import{h as l}from"./p-23a36bb6.js";const c=(s,i)=>{var e,n;let a,h,{name:r,label:o,group:l}=Object.assign({},i),{readOnly:c,required:d}=Object.assign({},i);return s&&(o=o||s.label,r=r||s.name,d=null!==(e=s.required)&&void 0!==e?e:null==i?void 0:i.required,c=null!==(n=s.readOnly)&&void 0!==n?n:null==i?void 0:i.readOnly,a=s.properties,h=s.userInterface),{name:r,label:o,group:l,readOnly:c,required:d,props:a,userInterface:h||t.SHORTTEXT}};class d{constructor(t,s,i){this._dataUnit=t,this._validationSource=s,this._validator=i,this._i18n=o()}validate(t=!0){return new Promise(((s,i)=>{const e=this._dataUnit.getModifiedRecords();for(let s=0;s<e.length;s++){const n=e[s],a=[];let h=this.validateRequired(n);if(h&&!h.isValid&&a.push(h),this._validator&&(h=this._validator.validateRecord(n),h&&!h.isValid&&a.push(h)),a.length>0){if(!t&&a[0].invalidFields.length>0){this._validationSource.markAsInvalid(a[0].invalidFields[0],n.__record__id__),i();break}this.processValidationResult(a,n.__record__id__),i();break}}return s()}))}validateRequired(t){const s=this._validationSource.getRequiredFields(),i=[];if(new Set(s).forEach((s=>{const e=t[s];if(null==e||""===e){const e=this._validationSource.getMessageForField(s,t.__record__id__);i.push(e?{name:s,message:e}:{name:s,message:this._i18n("utils.requiredField")})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:this._i18n("utils.requiredFieldMessage")}}processValidationResult(t,s){t.forEach((t=>{const i=t.invalidFields;if(this._dataUnit.savingCanceled(i,s),i&&i.forEach((t=>{this.markAsInvalid(t,s)})),t.infoMessage&&r.info(t.infoMessage),t.errorMessage){const{errorTitle:s,errorMessage:i}=t;r.error(s,i)}}))}markAsInvalid(t,s){this._dataUnit.setInvalidField(t.name,t.message,s),this._validationSource.markAsInvalid(t,s)}}class u{constructor(t){this.onDataUnitEvent=t=>{var i;switch(t.type){case s.MULTIPLE_EDITION_CHANGED:this.clearInvalid(),this.updateAllFieldsValues();break;case s.DATA_LOADED:case s.DATA_SAVED:case s.RECORDS_REMOVED:case s.RECORDS_ADDED:case s.RECORDS_COPIED:case s.EDITION_CANCELED:case s.SELECTION_CHANGED:case s.NEXT_SELECTED:case s.PREVIOUS_SELECTED:this.clearInvalid();case s.DATA_CHANGED:case s.CHANGE_UNDONE:case s.CHANGE_REDONE:case s.RECORD_LOADED:this.updateAllFieldsValues(),this.clearFieldError(Object.keys(t.payload)[0]);break;case s.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._uuid=i.generateUUID(),this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this),this.setContextDataBinder(t)}get dataBinderId(){return this._uuid}setContextDataBinder(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,i=[...s.get(t.dataUnitId)||[],this];s.set(t.dataUnitId,i),e.setContextValue("__DATABINDER_BY_DATAUNIT__",s)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const s=this.getDefaultValues();s&&Object.keys(s).forEach((i=>{this._dataUnit.setFieldValue(i,s[i],t)}))}}bind(t,s,i,e){t.forEach((t=>{const{fieldName:i,contextName:e}=t.dataset;null!=e&&e!==s||this.updateBind(i,t)})),this._formMetadata=i,this._recordValidatorProcessor=new d(this._dataUnit,{getRequiredFields:()=>this.getFormRequiredFields(),markAsInvalid:t=>this.markInvalid(t),getMessageForField:t=>this.getErrorMessage(t)},e)}getFormRequiredFields(){return this._formMetadata.getRequiredFields()}disconnectDataUnit(){const t=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,s=t.get(this._dataUnit.dataUnitId).filter((t=>t.dataBinderId!==this.dataBinderId));t.set(this._dataUnit.dataUnitId,s),e.setContextValue("__DATABINDER_BY_DATAUNIT__",t)}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this),this.disconnectDataUnit()}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._fields.has(t.name)){const s=this._fields.get(t.name).field;this.updateErrorMessage(t.name,s,t.message)}}setFocus(t){if(!this._fields.has(t))return;const s=this._fields.get(t).field;"function"==typeof s.setFocus&&s.setFocus()}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}clearFieldError(t){var s;const i=null===(s=this._fields.get(t))||void 0===s?void 0:s.field;i.errorMessage&&(i.errorMessage="",this._dataUnit.clearInvalid(this.getCurrentRecordId(),t))}updateFieldValue(t,s){const i=this._fields.get(t);try{i&&(i.listen=!1),this._dataUnit.isMultipleEdition&&this.hasMultipleValuesBetweenRecords(t)?(s.value=void 0,s.alternativePlaceholder="Múltiplos Valores"):(s.value=this._dataUnit.getFieldValue(t),s.alternativePlaceholder=void 0),this.updateErrorMessage(t,s)}finally{i&&(i.listen=!0)}}hasMultipleValuesBetweenRecords(t){var s,i;const e=null!==(i=null===(s=this._dataUnit.getSelectionInfo())||void 0===s?void 0:s.records)&&void 0!==i?i:[];if(e.length<=1)return!1;const a=e[0][t];return!e.every((s=>n.equals(s[t],a)))}validate(){return this._recordValidatorProcessor.validate()}static async validateByDataunit(t){try{const s=this.getDataBindersByDataUnit(t);return await Promise.all(s.map((t=>t.validate()))),!0}catch(t){return!1}}static getDataBindersByDataUnit(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__");return(null==s?void 0:s.get(t.dataUnitId))||[]}updateErrorMessage(t,s,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),s.errorMessage||(s.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,s){const i=this._fields.get(t);i&&i.destroy(),this.bindSearchOptionsLoader(t,s),this.updateFieldValue(t,s),this.updateErrorMessage(t,s),this._fields.set(t,_.create(t,s,((t,s)=>this.changeStarted(t,s)),(t=>this.cancelWaitingChange(t)),((t,s)=>this.setFieldValue(t,s)))),this.applyEzUploadContext(t,s)}changeStarted(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!s.blocking&&null==s.promise){const i=this._fields.get(t);i&&(s.promise=new Promise(((t,s)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=s})))}this._dataUnit.startChange(t,s)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const s=this._fields.get(t);s&&s.rejectWaitingChange(new a("Change canceled",t))}}setFieldValue(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.isMultipleEdition){const i=this._dataUnit.getSelectionInfo();this._dataUnit.setFieldValue(t,s,i.recordIds)}else{const i=this._dataUnit.getSelectedRecord();this._dataUnit.setFieldValue(t,s,i?[i.__record__id__]:void 0)}if(this._dataUnit.waitingForChange(t)){const s=this._fields.get(t);s&&s.acceptWaitingChange()}}bindSearchOptionsLoader(t,s){if(("EZ-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName?"__EZUI__SEARCH__PLUS__OPTION__LOADER__":"__EZUI__SEARCH__OPTION__LOADER__");i&&(s.optionLoader=(s,e)=>i(s,t,this._dataUnit,e))}}applyEzUploadContext(t,s){var i,n;if("EZ-UPLOAD"===s.nodeName){s.urlUpload=e.getContextValue("__EZUI__UPLOAD__ADD__URL__"),s.urlDelete=e.getContextValue("__EZUI__UPLOAD__DEL__URL__");const a=this._dataUnit.getField(t),h=null===(i=a.properties)||void 0===i?void 0:i.DESTINATION;h&&(s.requestHeaders={XTRAINF:`{"destination": "${h}"}`}),s.maxFiles=(null===(n=a.properties)||void 0===n?void 0:n.MAX_FILES)||0}}updateAllFieldsValues(){var t;null===(t=this._fields)||void 0===t||t.forEach((t=>{this.updateFieldValue(t.fieldName,t.field)}))}interceptAction(t){if(t.type===s.RECORDS_COPIED){const i=this._formMetadata.getCleanOnCopyFields();if(i)return new h(s.RECORDS_COPIED,t.payload.map((t=>{const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s})))}if(t.type===s.SAVING_DATA)return new Promise((s=>{this.validate().then((()=>s(t))).catch((()=>{}))}));if(t.type===s.RECORDS_ADDED){const i=this.getDefaultValues();if(i)return new h(s.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),i))))}return t}getDefaultValues(){var t;const s=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(s){const t={};for(const i in s)t[i]=this._dataUnit.valueFromString(i,s[i]);return t}}}class _{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,s,i,e,n){const a=new _;return a.field=s,a.fieldName=t,a.startChangeListener=s=>{a.listen&&i(t,s.detail)},a.field.addEventListener(a.startChangeEventName,a.startChangeListener),a.cancelWaitingChangeListener=()=>{a.listen&&e(t)},a.field.addEventListener(a.cancelWaitingChangeEventName,a.cancelWaitingChangeListener),a.changeListener=s=>{a.listen&&n(t,s.detail)},a.field.addEventListener(a.changeEventName,a.changeListener),a}}const v="ctrl+f",f=240,p=String(210)+"px",A=(t,s,i)=>l("ez-search",{class:"ez-padding--small ez-margin--none",style:{"--ez-text-input__margin-bottom":"0px","--ez-search--width":p},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:t=>i(t.detail),ignoreLimitCharsToSearch:!0}),g=async t=>{requestAnimationFrame((async()=>{if(t){const s=t.t;if(!s)return;s.value=null,await s.setFocus()}}))};export{u as D,d as R,v as S,A as a,c as b,f as c,g as f}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as a}from"./p-23a36bb6.js";const i=class{constructor(a){o(this,a),this.applicationLoaded=t(this,"applicationLoaded",7)}componentWillLoad(){}componentDidLoad(){this.applicationLoaded.emit(!0)}render(){return a("div",null)}};i.style="";export{i as ez_application}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,f as o,h as a,g as e}from"./p-23a36bb6.js";import{D as n}from"./p-ab574d59.js";import{FloatingManager as l,ElementIDUtils as r,KeyboardManager as d}from"@sankhyalabs/core";import{F as c}from"./p-dc628ed3.js";import{i as s}from"./p-641ee538.js";class h{constructor(t,i,o,a,e,n,l,r,d,c){this.title=t,this.message=i,this.dialogType=o,this.confirm=a,this.icon=e,this.labelCancel=n,this.labelConfirm=l,this.btnConfirmDanger=r,this.callBack=d,this.beforeClose=c}}const g=class{constructor(o){t(this,o),this.ezCancel=i(this,"ezCancel",7),this.ezAccept=i(this,"ezAccept",7),this.PRIMARY_BUTTON_ID="EZ_DIALOG_PRIMARY_BUTTON",this.btnConfirmDanger=!1,this._messageQueue=[],this._canFocusOnPrimaryBtn=!1,this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(t,i){this.manageOverflow(),t&&!i&&(this._canFocusOnPrimaryBtn=!0)}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=l.subscribeOverlayControl(this._overlayRef):l.unsubscribeOverlayControl(this._overlayRef||this._overlayId)}handleButtonClick(t){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(t)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(t),t?this.ezAccept.emit(t):this.ezCancel.emit(t),this._currentMessage=this._messageQueue.shift(),o(this))}async show(t,i,o,a,e,n,l,r,d){return this.opened=!0,new Promise((c=>{this._messageQueue.push(new h(t,i,o,a,e,n,l,r,c,d))}))}isCritical(t){return t===n.CRITICAL}getIconElement(t){if(t.dialogType===n.DEFAULT)return;const i=this.getIconClass(t.dialogType);return a("div",{class:`changeable__icon__container ${i}`},a("ez-icon",{class:"changeable__icon",size:"small",iconName:this.getIconName(t)}))}getIconClass(t){return this.isCritical(t)?"title-icon--critical":t===n.SUCCESS?"title-icon--success":t===n.WARN?"title-icon--warn":""}getIconName(t){return t.icon?t.icon:this.isCritical(t.dialogType)?"alert-circle-inverted":t.dialogType===n.WARN?"warning-outline":t.dialogType===n.SUCCESS?"check":void 0}getTypeIndicatorElement(t){if(t.dialogType!==n.DEFAULT)return a("div",{class:this.getClassIconIndicator(t.dialogType)})}getClassIconIndicator(t){return this.isCritical(t)?"dialog__critical--indicator":t==n.SUCCESS?"dialog__success--indicator":t==n.WARN?"dialog__warning--indicator":""}getClassContainer(t){return(t.dialogType||n.DEFAULT)===n.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(t){return null==this.getIconElement(t)?"title title__label title__label--no-icon":"title title__label"}async componentWillLoad(){this.i18n=await s()}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new h(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.i18n("app.no"),this.i18n("app.yes"),this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){r.addIDInfo(this._element),this._keyboardManager=new d({propagate:!1,element:this._element}).bind("Enter",(()=>this.handleButtonClick(!0)),{description:this.i18n("ez-dialog.confirmButton"),element:this._element}).bind("Escape",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element}).bind("Esc",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element})}componentDidRender(){this.manageOverlay(),this.focusOnDialog(),this.handleFocusOnPrimaryButton()}focusOnDialog(){const t=this._element.shadowRoot.querySelector(".overlay .dialog");t instanceof HTMLDivElement&&(t.style.outline="none",this._lastActiveElement=document.activeElement,t.focus())}handleFocusOnPrimaryButton(){this._canFocusOnPrimaryBtn&&(this.focusOnPrimaryButton(),this._canFocusOnPrimaryBtn=!1)}focusOnPrimaryButton(){const t=this._element.shadowRoot.querySelector(`#${this.PRIMARY_BUTTON_ID}`),i=null==t?void 0:t.shadowRoot.querySelector("button");requestAnimationFrame((()=>{null==i||i.focus()}))}disconnectedCallback(){var t;c.resolveFocus(this._lastActiveElement),this._lastActiveElement=void 0,null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay",ref:t=>this._overlayRef=t},a("div",{tabindex:"-1",class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":r.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":r.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":r.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":r.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{id:this.PRIMARY_BUTTON_ID,class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":r.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{id:this.PRIMARY_BUTTON_ID,label:"Ok","data-element-id":r.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return e(this)}static get watchers(){return{opened:["observeConfig"]}}};g.style=':host{--dialog__container-padding:var(--space--md, 20px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--medium, 12px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--elevation--100, 100);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:var(--space--medium);overflow-y:auto}.changeable__icon__container{background:var(--dialog__warning--background-color);display:flex;justify-content:center;align-items:center;min-width:26px;min-height:26px;border-radius:50%}.changeable__icon{--ez-icon--color:var(--dialog__icon--color)}.changeable__icon__container.title-icon--critical{background-color:var(--dialog__critical--background-color)}.changeable__icon__container.title-icon--success{background-color:var(--dialog__success--background-color)}.changeable__icon__container.title-icon--warn{background-color:var(--dialog__warning--background-color)}.changeable__icon__container.title-icon--warn ez-icon{transform:translateY(-1px)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);color:var(--title--primary)}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{g as ez_dialog}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as e,c as s,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as a,ObjectUtils as r,HTMLBuilder as h,StringUtils as l,KeyboardManager as n}from"@sankhyalabs/core";import{i as c}from"./p-641ee538.js";import{C as d}from"./p-30ffb9ed.js";import{R as b,a as m}from"./p-3e767a74.js";import{p as u}from"./p-228a4d2f.js";import{A as v}from"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-112455b1.js";const p=class{constructor(i){t(this,i),this.showLoading=void 0,this.visibleOptions=void 0,this.textEmptyList=void 0,this.showOptionValue=void 0,this.preSelection=void 0,this.maxWidth=void 0,this.width=void 0,this.onOptionSelect=void 0,this.onOptionHover=void 0}async nextOption(){var t,i;(null===(t=this.visibleOptions)||void 0===t?void 0:t.length)&&(void 0!==this.preSelection&&this.preSelection>=this.visibleOptions.length-1||(this.preSelection=void 0===this.preSelection?0:this.preSelection+1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(i=this.onOptionHover)||void 0===i||i.call(this,this.preSelection)))}async previousOption(){var t,i;(null===(t=this.visibleOptions)||void 0===t?void 0:t.length)&&(void 0!==this.preSelection&&this.preSelection<=0||(this.preSelection=void 0===this.preSelection?this.visibleOptions.length-1:this.preSelection-1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(i=this.onOptionHover)||void 0===i||i.call(this,this.preSelection)))}async selectCurrentOption(){void 0!==this.preSelection&&(this.onOptionSelect(this.visibleOptions[this.preSelection]),this.preSelection=void 0)}observeWidth(t,i){t!==i&&this._listWrapper&&(this._listWrapper.style.width=`${this.width}px`)}observeMaxWidth(t,i){t!==i&&this._listWrapper&&(this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:"")}handleKeyDown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.nextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.preSelection=void 0}}buildItem(t,e){const s=this.showOptionValue&&this.maxWidth>0?`${this.maxWidth}px`:"";return t.label=t.label||t.value,i("li",{tabIndex:1,class:e===this.preSelection?"item preselected":"item",id:`item_${t.value}_${e}`,key:`item_${t.value}_${e}`,onMouseDown:()=>this.onOptionSelect(t),onMouseOver:()=>this.preSelection=e},this.showOptionValue?i("span",{class:"item__value",title:t.value,style:{width:s,minWidth:s,maxWidth:s}},t.value):void 0,i("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:t.label},t.label))}scrollToOption(t){if(!(null==t?void 0:t.value)||!this._optionsList)return;const i=this.visibleOptions.indexOf(t);if(-1===i)return;const e=this._optionsList.querySelector(`li#item_${CSS.escape(t.value)}_${CSS.escape(String(i))}`);e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})}async componentWillLoad(){this.i18n=await c()}componentDidLoad(){this._listWrapper.style.width=`${this.width}px`,this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:""}componentDidRender(){var t;null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{a.addIDInfoIfNotExists(t,"itemComboBox")}))}render(){return i("section",{class:"list-container"},i("div",{class:"list-wrapper",ref:t=>this._listWrapper=t},i("ul",{class:"list-options",ref:t=>this._optionsList=t},!this.showLoading&&0===this.visibleOptions.length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList||this.i18n("ez-combo-box.noResults"))),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.showOptionValue&&i("span",{class:"item__value item__value--hidden"}),!this.showLoading&&this.visibleOptions.length>0&&this.visibleOptions.map(((t,i)=>this.buildItem(t,i))))))}static get watchers(){return{width:["observeWidth"],maxWidth:["observeMaxWidth"]}}};p.style=":host{--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);--ez-combo-box__list-container--padding:var(--space--extra-small, 3px)}.list-container{padding-top:var(--ez-combo-box__list-container--padding)}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow--medium, 0 8px 24px 0 rgba(43, 58, 84, 0.10));padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;margin:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const x=class{constructor(i){t(this,i),this.gui=void 0,this.customEditor=void 0,this.formViewField=void 0,this.value=void 0,this.detailContext=void 0,this.builderFallback=void 0,this.selectedRecord=void 0}async setFocus(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t)}async setBlur(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setBlur)||void 0===i||i.call(t)}async isInvalid(){var t,i;return(null===(i=null===(t=this.gui)||void 0===t?void 0:t.isInvalid)||void 0===i?void 0:i.call(t))||!1}watchValue(){this.handleValue(this.gui)}watchCustomEditor(){this.getContent()}watchFormViewField(t,i){r.equals(t,i)||this.getContent()}watchDetailContext(){this.getContent()}watchBuilderFallback(){this.getContent()}watchSelectedRecord(t,i){(null==t?void 0:t.__record__id__)!==(null==i?void 0:i.__record__id__)&&this.getContent()}getContent(){var t,e,s,o,a;const r=new Map;for(const t in this.formViewField.props)r.set(t,this.formViewField.props[t]);const n={value:this.value,name:this.formViewField.name,currentEditor:this.builderFallback(this.formViewField),setValue:t=>this.setValue(t),getValue:this.getValue,record:this.selectedRecord,editorMetadata:{label:this.formViewField.label,hidden:!1===(null===(t=this.formViewField.props)||void 0===t?void 0:t.visible),userInterface:this.formViewField.userInterface,options:null===(e=this.formViewField.props)||void 0===e?void 0:e.options,props:this.formViewField.props?r:void 0,optionLoader:this.formViewField.optionLoader},source:d.FORM,detailContext:this.detailContext};let c=this.customEditor.getEditorElement(n);if(!c)return c=this.builderFallback(this.formViewField),this.handleValue(c),void(this.gui=c);if(!(c instanceof HTMLElement)&&"string"!=typeof c)return this.handleValue(c),void(this.gui=c);"string"==typeof c&&(c=h.parseElement(c));const b=null!==(a=null!==(o=null===(s=this.value)||void 0===s?void 0:s.value)&&void 0!==o?o:this.value)&&void 0!==a?a:"";c.setAttribute("value",b),this.gui=i("div",{key:l.generateUUID(),ref:t=>t&&t.appendChild(c)})}setValue(t){this.value=t}getValue(){return this.value}handleValue(t){var i;null===(i=t.t)||void 0===i||i.forEach((t=>{t.i.value=this.value}))}componentWillLoad(){this.getContent()}render(){return i(e,null,this.gui)}static get watchers(){return{value:["watchValue"],customEditor:["watchCustomEditor"],formViewField:["watchFormViewField"],detailContext:["watchDetailContext"],builderFallback:["watchBuilderFallback"],selectedRecord:["watchSelectedRecord"]}}},w=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.historyStack=[],this.historyIndex=-1,this.previewMode=!1,this.showPreview=!0,this.value="",this.label=void 0,this.mode="regular",this.enabled=!0,this.rows=6,this.errorMessage=void 0,this.canShowError=!0,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}observeValue(t,i){r.equals(t,i)||this.ezChange.emit(t)}observeErrorMessage(t){t&&this.previewMode&&(this.previewMode=!1)}async handleExecuteToolbarCommand(t){const{command:i,value:e}=t.detail;await this.executeCommand(i,e)}async setFocus(){this.handleFocus()}async setBlur(){var t;await(null===(t=this.textAreaRef)||void 0===t?void 0:t.setBlur())}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}bindPreview(){this._keyboardManager&&this.showPreview&&this._keyboardManager.bind("ctrl + p",(async()=>{await this.togglePreview()}),{description:"Entra em modo de pré visualização.",element:this.element})}bindConfigs(){this._keyboardManager&&this.showConfigs&&this._keyboardManager.bind("ctrl + l",(async()=>{await this.handleFormatSelection(b.LIST)}),{description:this.i18n("ez-rich-text.listShortcut"),element:this.element}).bind("ctrl + k",(async()=>{await this.handleLink()}),{description:this.i18n("ez-rich-text.linkShortcut"),element:this.element}).bind("ctrl + o",(async()=>{await this.handleImage()}),{description:this.i18n("ez-rich-text.imageShortcut"),element:this.element})}bindTextFormat(){this._keyboardManager&&this.showTextFormat&&this._keyboardManager.bind("ctrl + b",(async()=>{await this.handleFormatSelection(b.BOLD)}),{description:this.i18n("ez-rich-text.boldShortcut"),element:this.element}).bind("ctrl + i",(async()=>{await this.handleFormatSelection(b.ITALIC)}),{description:this.i18n("ez-rich-text.italicShortcut"),element:this.element}).bind("ctrl + u",(async()=>{await this.handleFormatSelection(b.UNDERLINE)}),{description:this.i18n("ez-rich-text.underlineShortcut"),element:this.element})}initKeyboardManager(){this._keyboardManager=new n({propagate:!1,element:this.element}),this._keyboardManager.bind("ctrl + Enter",(async()=>{await this.handleFormatSelection(b.BREAK_LINE)}),{description:this.i18n("ez-rich-text.breakLineShortcut"),element:this.element}).bind("ctrl + z",(async()=>{await this.handleUndo()}),{description:this.i18n("ez-rich-text.undoShortcut"),element:this.element}).bind("ctrl + x",(async()=>{await this.handleRedo()}),{description:this.i18n("ez-rich-text.redoShortcut"),element:this.element}),this.bindPreview(),this.bindConfigs(),this.bindTextFormat()}async executeCommand(t,i){switch(t){case m.FOCUS:this.handleFocus();break;case m.PREVIEW:await this.togglePreview();break;case m.FORMAT:await this.handleFormatSelection(i);break;case m.UNDO:await this.handleUndo();break;case m.REDO:await this.handleRedo();break;case m.LINK:await this.handleLink();break;case m.IMAGE:await this.handleImage()}}handleFocus(){this.previewMode=!1,requestAnimationFrame((async()=>{await this.textAreaRef.setFocus()}))}async handleLink(){this.previewMode=!1,requestAnimationFrame((async()=>{await this.linkBuilderRef.show(this.getSelectedText())}))}async handleImage(){this.previewMode=!1,await this.imageUploaderRef.show()}async handleRedo(){this.previewMode=!1,requestAnimationFrame((async()=>{this.redo(),await this.textAreaRef.setFocus()}))}async handleUndo(){this.previewMode=!1,requestAnimationFrame((async()=>{this.undo(),await this.textAreaRef.setFocus()}))}async handleFormatSelection(t){t&&(this.previewMode=!1,requestAnimationFrame((async()=>{await this.formatSelection(t),await this.textAreaRef.setFocus()})))}async togglePreview(){this.previewMode=!this.previewMode,this.previewMode&&await this.textAreaRef.setFocus()}getSelectedText(){const t=this.getTextAreaElement();if(t)return(this.textAreaRef.value||"").substring(t.selectionStart,t.selectionEnd)}getTextAreaElement(){return this.element.querySelector("ez-text-area").shadowRoot.querySelector("textarea")}async formatSelection(t){if(!this.textAreaRef)return;const i=t.replace("$selection",this.getSelectedText()||"");await this.textAreaRef.appendTextToSelection(i),this.value=this.textAreaRef.value,this.addToHistory(this.value)}addToHistory(t){this.historyIndex>=0&&t===this.historyStack[this.historyIndex]||(this.historyStack.length>=50&&this.historyStack.splice(0,this.historyStack.length-49),this.historyStack.push(t),this.historyIndex=this.historyStack.length-1)}undo(){if(!this.canExecuteUndo())return;this.historyIndex--;const t=this.historyStack[this.historyIndex];this.value=t,this.textAreaRef.value=t}canExecuteUndo(){return this.historyIndex>0}redo(){this.canExecuteRedo()&&(this.historyIndex++,this.getValueFromHistory())}canExecuteRedo(){return this.historyIndex<this.historyStack.length-1}getValueFromHistory(){const t=this.historyStack[this.historyIndex];this.value=t,this.textAreaRef.value=t}handleTextAreaChanged(t){this.value=t.detail,this.addToHistory(this.value)}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async componentWillLoad(){this.i18n=await c()}componentDidLoad(){this.initKeyboardManager(),this.addToHistory(this.value)}async disconnectedCallback(){await this.removeShortcuts()}getSanitizedValue(){return u.sanitize(this.value,{ADD_ATTR:["target","rel"]})}renderContent(){return this.previewMode?i("div",{id:"rich-text-preview-container",class:"preview",innerHTML:this.getSanitizedValue()}):i("ez-text-area",{ref:t=>this.textAreaRef=t,label:this.label,value:this.value,enabled:this.enabled,rows:this.rows,mode:this.mode,canShowError:this.canShowError,errorMessage:this.errorMessage,onEzChange:this.handleTextAreaChanged.bind(this)})}render(){return i(e,null,i("div",{class:"editor-container bordered"},i("ez-rich-toolbar",{isPreviewMode:this.previewMode,showPreview:this.showPreview,showConfigs:this.showConfigs&&this.enabled,showTextFormat:this.showTextFormat&&this.enabled,showUndoRedo:this.showUndoRedo&&this.enabled}),this.renderContent()),i("ez-link-builder",{ref:t=>this.linkBuilderRef=t}),i("ez-simple-image-uploader",{ref:t=>this.imageUploaderRef=t}))}get element(){return o(this)}static get watchers(){return{value:["observeValue"],errorMessage:["observeErrorMessage"]}}};w.style=".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.sc-ez-rich-text{width:100%;overflow:hidden;border-radius:12px;border:1px solid #DCE0E8}ez-text-area.sc-ez-rich-text{--text-area__input--border:1px solid}.preview.sc-ez-rich-text{min-height:20px;padding:12px;resize:both;overflow:auto;max-width:100%;border-top:1px solid #DCE0E8}";const _=class{constructor(i){t(this,i),this.saveEdition=s(this,"saveEdition",7),this.cancelEdition=s(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var e,s;const o=null===(s=null===(e=this._inputElement)||void 0===e?void 0:e.shadowRoot)||void 0===s?void 0:s.querySelector("input");if(null!=o){const e=this.getWidthValue(t);o.style.width=e+"px",i&&setTimeout((()=>o.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const e=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+e:e}i.innerHTML=""}return 0}setStyledInput(){var t,i;let e="",s="",o="";null!=this.styled&&(e=this.styled.fontSize,s=this.styled.fontWeight,o=this.styled.fontFamily);const a=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=a&&(a.style.fontSize=e,a.style.fontWeight=s,a.style.fontFamily=o);const r=this._valueBasis;null!=r&&(r.style.fontSize=e,r.style.fontWeight=s,r.style.fontFamily=o)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):v.alert(this.i18n("app.warning"),this.i18n("ez-text-edit.emptyFieldWarning")).then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}async componentWillLoad(){this.i18n=await c()}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return a.addIDInfoIfNotExists(this._element,"input"),i(e,null,i("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),i("ez-text-input",{"data-element-id":a.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),i("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),i("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return o(this)}};_.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{p as ez_combo_box_list,x as ez_custom_form_input,w as ez_rich_text,_ as ez_text_edit}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,h as e,H as o,g as a}from"./p-23a36bb6.js";import{ElementIDUtils as c}from"@sankhyalabs/core";const n=class{constructor(e){r(this,e),this.color="default",this.customColor=void 0,this.height=void 0,this.width=void 0}componentDidRender(){this._element&&c.addIDInfo(this._element),this._container&&c.addIDInfo(this._container,"underface",{id:"container"})}render(){const r=Object.assign({},this.customColor&&{"--ez-underface--custom-background-color":`var(${this.customColor})`},this.height&&{"--ez-underface--custom-height":`${this.height}px`},this.width&&{"--ez-underface--custom-width":`${this.width}px`});return e(o,{style:r},e("div",{ref:r=>this._container=r,class:`underface_container ${this.color}`},e("slot",null)))}get _element(){return a(this)}};n.style=":host{--ez-underface--width:693px;--ez-underface--height:247px;--ez-underface--padding:var(--space--24, 24px);--ez-underface--border-radius:var(--border--radius-26, 26px)}div{width:var(--ez-underface--custom-width, var(--ez-underface--width));height:var(--ez-underface--custom-height, var(--ez-underface--height));border-radius:var(--ez-underface--border-radius);padding:var(--ez-underface--padding);display:block;overflow:hidden;outline:none;box-shadow:none;border:none;box-sizing:border-box;background-color:var(--ez-underface--custom-background-color, var(--color--petroleum-700, #222D42))}.light-green{background-color:var(--ez-underface--custom-background-color, var(--color--ocean-green-90))}.green{background-color:var(--ez-underface--custom-background-color, var(--color--green-600))}.light-gray{background-color:var(--ez-underface--custom-background-color, var(--color--gray-80))}.dark-petroleum{background-color:var(--ez-underface--custom-background-color, var(--color--petroleum-900))}.ocean-green{background-color:var(--ez-underface--custom-background-color, var(--color--ocean-green-600))}";export{n as ez_underface}
|