@sankhyalabs/ezui 7.2.0-dev.12 → 7.2.0-dev.14
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/classic-search-list_7.cjs.entry.js +2 -2
- 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-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-input.cjs.entry.js +3 -2
- package/dist/cjs/ez-classic-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-search-plus.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +2 -2
- package/dist/cjs/ez-grid-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +2 -2
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-record-navigation.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 +23 -19
- package/dist/cjs/ez-tile-medium.cjs.entry.js +1 -1
- package/dist/cjs/ez-tile.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- package/dist/cjs/ez-underface.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- 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 +1 -1
- package/dist/cjs/{search-column-9612bd3a.js → search-column-67b641dc.js} +1 -1
- package/dist/collection/components/ez-classic-input/utils/maskFormatter.js +2 -1
- package/dist/collection/components/ez-text-input/ez-text-input.js +22 -18
- package/dist/custom-elements/index.js +24 -19
- package/dist/esm/classic-search-list_7.entry.js +2 -2
- 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-date-input.entry.js +1 -1
- package/dist/esm/ez-classic-date-time-input.entry.js +1 -1
- package/dist/esm/ez-classic-input.entry.js +3 -2
- package/dist/esm/ez-classic-number-input.entry.js +1 -1
- package/dist/esm/ez-classic-search-plus.entry.js +1 -1
- package/dist/esm/ez-classic-search.entry.js +1 -1
- package/dist/esm/ez-classic-text-area.entry.js +1 -1
- package/dist/esm/ez-classic-time-input.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-empty-card.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +2 -2
- package/dist/esm/ez-grid-pagination.entry.js +1 -1
- package/dist/esm/ez-grid-view.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +2 -2
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list-item.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-pagination.entry.js +1 -1
- package/dist/esm/ez-popover-core.entry.js +1 -1
- package/dist/esm/ez-popover-plus_3.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-progress-bar.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-record-navigation.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 +23 -19
- package/dist/esm/ez-tile-medium.entry.js +1 -1
- package/dist/esm/ez-tile.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- package/dist/esm/ez-underface.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +2 -2
- 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 +2 -2
- package/dist/esm/{search-column-dba4853a.js → search-column-88d17d2f.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e75c7a23.entry.js → p-000159dc.entry.js} +1 -1
- package/dist/ezui/{p-e2b3970c.entry.js → p-03cbd900.entry.js} +1 -1
- package/dist/ezui/{p-93e1c917.entry.js → p-05e68ab3.entry.js} +1 -1
- package/dist/ezui/{p-6d596a5a.entry.js → p-0b531233.entry.js} +1 -1
- package/dist/ezui/{p-3fae7072.entry.js → p-0c8aee78.entry.js} +1 -1
- package/dist/ezui/{p-b06294c9.entry.js → p-0fc00cfe.entry.js} +1 -1
- package/dist/ezui/p-14d6aeb8.entry.js +1 -0
- package/dist/ezui/{p-108503ed.entry.js → p-1516f24d.entry.js} +1 -1
- package/dist/ezui/{p-b8cd501a.entry.js → p-16947cdc.entry.js} +1 -1
- 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-0ac8bd66.entry.js → p-1a4d64f1.entry.js} +1 -1
- package/dist/ezui/{p-fc72aeb8.entry.js → p-1b7d0c1c.entry.js} +1 -1
- package/dist/ezui/{p-fc11f5b9.entry.js → p-1c9eba36.entry.js} +1 -1
- package/dist/ezui/{p-83bddbbb.js → p-27add1a3.js} +1 -1
- package/dist/ezui/p-280f0a4e.entry.js +1 -0
- package/dist/ezui/{p-2ebd7383.entry.js → p-2d429965.entry.js} +1 -1
- package/dist/ezui/{p-b986da95.entry.js → p-37e1b560.entry.js} +1 -1
- package/dist/ezui/{p-7dad8018.entry.js → p-3d3345e5.entry.js} +1 -1
- package/dist/ezui/{p-45245c32.entry.js → p-4019bd3c.entry.js} +1 -1
- package/dist/ezui/{p-cb00863d.entry.js → p-43835ea6.entry.js} +1 -1
- package/dist/ezui/p-449e17f8.entry.js +1 -0
- package/dist/ezui/{p-fa6732f2.entry.js → p-44b39e81.entry.js} +1 -1
- package/dist/ezui/{p-b493757c.entry.js → p-45877fe8.entry.js} +1 -1
- package/dist/ezui/{p-9bd3e28b.entry.js → p-468e30b0.entry.js} +1 -1
- package/dist/ezui/{p-0d80e3ec.entry.js → p-49eb13ea.entry.js} +1 -1
- package/dist/ezui/{p-d70805e4.entry.js → p-4cb3e520.entry.js} +1 -1
- package/dist/ezui/{p-7424d520.entry.js → p-4d11704d.entry.js} +1 -1
- package/dist/ezui/{p-f2e0acf5.entry.js → p-5041efd4.entry.js} +1 -1
- package/dist/ezui/{p-6369a0cd.entry.js → p-51e34317.entry.js} +1 -1
- package/dist/ezui/{p-cf66ace0.entry.js → p-55d2be5c.entry.js} +1 -1
- package/dist/ezui/{p-881abc22.entry.js → p-5c0b784f.entry.js} +1 -1
- package/dist/ezui/{p-9bd78d39.entry.js → p-5ed0d633.entry.js} +1 -1
- package/dist/ezui/{p-1f50fa05.entry.js → p-6b51c9cc.entry.js} +1 -1
- package/dist/ezui/{p-2ae127bc.entry.js → p-6b6f9589.entry.js} +1 -1
- package/dist/ezui/{p-d8b69419.entry.js → p-6df315ac.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-99556756.entry.js → p-7137d19f.entry.js} +1 -1
- package/dist/ezui/{p-d6f50207.entry.js → p-770cf2b8.entry.js} +1 -1
- package/dist/ezui/{p-91c9d50e.entry.js → p-78e975b4.entry.js} +1 -1
- package/dist/ezui/{p-0592535f.entry.js → p-7c02817b.entry.js} +1 -1
- package/dist/ezui/{p-c25a4d30.entry.js → p-7c38cce4.entry.js} +1 -1
- package/dist/ezui/{p-66455069.entry.js → p-7d229c1d.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-a4735a12.entry.js → p-894392ca.entry.js} +1 -1
- package/dist/ezui/{p-fb27b98d.entry.js → p-9002ffd2.entry.js} +1 -1
- package/dist/ezui/{p-7b078125.entry.js → p-95f45fc3.entry.js} +1 -1
- package/dist/ezui/{p-f34ec732.entry.js → p-980f1f18.entry.js} +1 -1
- package/dist/ezui/{p-7a07c50f.entry.js → p-9820e95f.entry.js} +1 -1
- package/dist/ezui/{p-73461028.entry.js → p-99aacd56.entry.js} +1 -1
- package/dist/ezui/{p-a3075f52.entry.js → p-9bcfa689.entry.js} +1 -1
- package/dist/ezui/{p-7df45688.entry.js → p-a6df6cdc.entry.js} +1 -1
- package/dist/ezui/{p-ed790867.entry.js → p-a8379365.entry.js} +1 -1
- package/dist/ezui/{p-d6742c1e.entry.js → p-a9432878.entry.js} +1 -1
- package/dist/ezui/{p-2856c545.entry.js → p-ac004c0c.entry.js} +1 -1
- package/dist/ezui/{p-312bd3c6.entry.js → p-acc2625d.entry.js} +1 -1
- package/dist/ezui/{p-72e77b45.entry.js → p-ad63415f.entry.js} +1 -1
- package/dist/ezui/{p-e3d6b544.entry.js → p-b08ed58c.entry.js} +1 -1
- package/dist/ezui/{p-1166b2d5.entry.js → p-b14959bf.entry.js} +1 -1
- package/dist/ezui/{p-e8c57463.entry.js → p-b21efe83.entry.js} +1 -1
- package/dist/ezui/{p-063bb342.entry.js → p-b457f321.entry.js} +1 -1
- package/dist/ezui/{p-d5684cdc.entry.js → p-b9ebe8b7.entry.js} +1 -1
- package/dist/ezui/{p-a0bf1fc7.entry.js → p-bc693db6.entry.js} +1 -1
- package/dist/ezui/{p-c37fb359.entry.js → p-c06cf215.entry.js} +1 -1
- package/dist/ezui/{p-9f5fa3f9.entry.js → p-c2b20f78.entry.js} +1 -1
- package/dist/ezui/{p-178cb9df.entry.js → p-c6021712.entry.js} +1 -1
- package/dist/ezui/{p-6020f3d5.entry.js → p-c754774e.entry.js} +1 -1
- package/dist/ezui/{p-e8cd003b.entry.js → p-cb951410.entry.js} +1 -1
- package/dist/ezui/p-cf22810f.entry.js +1 -0
- package/dist/ezui/{p-20c024f7.entry.js → p-cf33bc48.entry.js} +1 -1
- package/dist/ezui/{p-d75f583b.entry.js → p-d0021f0f.entry.js} +1 -1
- package/dist/ezui/{p-46b1b2ac.entry.js → p-dc8874b8.entry.js} +1 -1
- package/dist/ezui/{p-54af1af0.entry.js → p-dccb427d.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-e692c2a7.entry.js → p-e25bc610.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-f498f6b5.entry.js → p-eaa54dab.entry.js} +1 -1
- package/dist/ezui/{p-dfced8c7.entry.js → p-f25873c9.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/ezui/{p-160a268d.entry.js → p-f9a7255c.entry.js} +1 -1
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-30c5f48a.entry.js +0 -1
- package/dist/ezui/p-44183c39.entry.js +0 -1
- package/dist/ezui/p-a0f51b99.entry.js +0 -1
- package/dist/ezui/p-bc2f844e.entry.js +0 -1
- package/dist/ezui/p-d8cc640d.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,F as s,H as r}from"./p-23a36bb6.js";import{StringUtils as l,ElementIDUtils as o}from"@sankhyalabs/core";import{p as a}from"./p-80dfc50b.js";import{i as c}from"./p-42e1e733.js";const n=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezSelectItem=i(this,"ezSelectItem",7),this.ezSelectMultipleItems=i(this,"ezSelectMultipleItems",7),this.ezCheckChange=i(this,"ezCheckChange",7),this.ezDoubleClick=i(this,"ezDoubleClick",7),this._listItemsHistory=[],this._listItems=[],this._listGroupItems=[],this.dataSource=[],this.listMode="regular",this.useGroups=!1,this.ezDraggable=!1,this.ezSelectable=!1,this.itemSlotBuilder=void 0,this.itemLeftSlotBuilder=void 0,this.hoverFeedback=!1,this.enableMultipleSelection=!1,this.enabled=!0}async clearHistory(){this._listItemsHistory=[]}async scrollToTop(){this.useGroups?this._element.querySelector(".group-container").scrollTop=0:this._element.querySelector(".items-container").scrollTop=0}async setSelection(t,i,e,s){t&&this.ezSelectable?this.useGroups?this.setSelectionWithGroups(t,i):this.enableMultipleSelection&&s?this.setSelectionMultiple(t):this.enableMultipleSelection&&e?this.setSelectionRange(t):(this.setSelectionSingleItem(t,i),this.emitSelectedItems(t)):await this.removeSelection()}emitSelectedItems(t,i){this.ezSelectItem.emit(t),this.ezSelectMultipleItems.emit(null!=i?i:[t])}setSelectionRange(t){const i=this._listItems.findIndex((t=>t.selected)),e=this._listItems.findIndex((i=>i.id===t.id));if(i<0||i===e)return void this.setSelectionSingleItem(t);const s=Math.min(i,e),r=Math.max(i,e);let l=[...this._listItems];l.forEach(((t,i)=>{t.selected=i>=s&&i<=r})),this._listItems=[...l];const o=this._listItems.filter((t=>t.selected));this.emitSelectedItems(t,o)}setSelectionMultiple(t){let i=[...this._listItems];i.forEach((i=>{i.selected=i.id===t.id?!i.selected:i.selected})),this._listItems=[...i];const e=this._listItems.filter((t=>t.selected));this.emitSelectedItems(t,e)}setSelectionSingleItem(t,i){this.emitSelectedItems(t);let e=[...this._listItems];if(e.forEach((i=>{i.selected=i.id===t.id})),this._listItems=e,!i)return;let s=this._itemContainer.querySelector("li#item_"+t.id);s&&s.scrollIntoView()}setSelectionWithGroups(t,i){this.emitSelectedItems(t);let e=[...this._listGroupItems];if(e.forEach((i=>{i.items.forEach((i=>{i.selected=i.id===t.id}))})),this._listGroupItems=e,!i)return;let s=this._groupContainer.querySelector("li#item_"+t.id);s&&s.scrollIntoView()}async getSelection(){if(!this.useGroups)return this._listItems.find((t=>1==t.selected));let t;return this._listGroupItems.every((i=>{let e=i.items.find((t=>1==t.selected));return!e||(t=e,!1)})),t}async getList(){return this.useGroups?this._listGroupItems:this._listItems}async removeSelection(){if(this.useGroups){let t=[...this._listGroupItems];return t.forEach((t=>{t.items.forEach((t=>{t.selected=!1}))})),void(this._listGroupItems=t)}let t=[...this._listItems];t.forEach((t=>t.selected=!1)),this._listItems=t}applyUUID(t){t.id||(t.id=l.generateUUID())}createList(){if(this.useGroups){let t=this.dataSource.map((t=>t));t.forEach((t=>{t.items.map(this.applyUUID),this.sortGroup(t)})),this._listGroupItems=t}else this._listItems=this._listItemsHistory.length>0?this._listItemsHistory:this.dataSource.map((t=>(this.applyUUID(t),t)))}sortGroup(t){t.sort&&(t.items.sort((function(t,i){return t.label<i.label?-1:t.label>i.label?1:0})),"DSC"===t.sort&&t.items.reverse())}buildIdDraggableListAndSelectable(){const t=this._element.querySelectorAll(".draggable-list");null==t||t.forEach(((t,i)=>{var e,s;let r="draggableList";const l=null===(s=null===(e=this._listGroupItems)||void 0===e?void 0:e[i])||void 0===s?void 0:s.group;this.useGroups&&l&&(r=r.concat("_",l)),o.addIDInfoIfNotExists(t,r)}));const i=this._element.querySelectorAll(".selectable-container");null==i||i.forEach((t=>{o.addIDInfoIfNotExists(t,"selectable")}))}async componentWillLoad(){this.i18n=await c(),this._listItemsHistory=[]}componentWillRender(){this.createList(),this._element&&this.buildIdDraggableListAndSelectable()}componentDidLoad(){o.addIDInfo(this._element)}onDrop(t,i){t.stopPropagation(),this.removeOverClass(),this._dragStartItem&&(this.useGroups?this.onDropWithGroups(i):(this._listItems=[...a(this.buildDragHandlerConfig(i.index,!1))],this._listItemsHistory=[...this._listItems],this.ezChange.emit(this._listItems)))}buildDragHandlerConfig(t,i){return{listItems:this._listItems,dragItem:this._dragStartItem,enableMultipleSelection:this.enableMultipleSelection,targetIndex:t,moveToFinal:i,clearSelection:()=>this.setSelection(void 0)}}onDropWithGroups(t){this.setSelection(void 0);let i=[...this._listGroupItems],e=this._listGroupItems.find((i=>t.groupName==i.group));if(i.find((t=>t.group==this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1),e.sort)i.find((i=>i.group==t.groupName)).items.push(this._dragStartItem.item),i.find((i=>i.group==t.groupName)).items.sort((function(t,i){return t.label<i.label?-1:t.label>i.label?1:0})),"DSC"===e.sort&&i.find((i=>i.group==t.groupName)).items.reverse();else{let e=t.index>this._dragStartItem.index?t.index-1:t.index;i.find((i=>i.group==t.groupName)).items.splice(e,0,this._dragStartItem.item)}this._listGroupItems=i,this.ezChange.emit(this._listGroupItems)}onDropLastIndex(t,i){t.stopPropagation(),this.removeOverClass(),this._dragStartItem&&(this.useGroups?this.onDropLastItemWithGroups(i):(this._listItems=[...a(this.buildDragHandlerConfig(this._listItems.length-1,!0))],this._listItemsHistory=[...this._listItems],this.ezChange.emit(this._listItems)))}onDropLastItemWithGroups(t){this.setSelection(void 0);let i=[...this._listGroupItems],e=this._listGroupItems.find((i=>t.group==i.group));i.find((t=>t.group==this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1),i.find((i=>i.group==t.group)).items.push(this._dragStartItem.item),e.sort&&(i.find((i=>i.group==t.group)).items.sort((function(t,i){return t.label<i.label?-1:t.label>i.label?1:0})),"DSC"===e.sort&&i.find((i=>i.group==t.group)).items.reverse()),this._listGroupItems=i,this.ezChange.emit(this._listGroupItems)}onDropGroup(t){var i;let e=[...this._listGroupItems];this.setSelection(void 0);let s=e.find((i=>i.group===t.group));if(s){if((null===(i=s.items)||void 0===i?void 0:i.length)>0){let t;s.items.forEach(((i,e)=>{i.id===this._dragStartItem.item.id&&(t={item:i,index:e})})),t?(s.items.splice(t.index,1),s.items.unshift(t.item),this.sortGroup(s)):(s.items.unshift(this._dragStartItem.item),this.sortGroup(s),e.find((t=>t.group===this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1))}else e.find((t=>t.group===this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1),s.items=[this._dragStartItem.item];this._listGroupItems=e}}onDragEnd(){this._dragStartItem=void 0,this.useGroups&&this.hideOverlays()}addOverClass(t){(null==t?void 0:t.__proto__)==HTMLDivElement.prototype&&t.classList.contains("draggable")?t.classList.add("over"):(null==t?void 0:t.parentElement)&&!t.parentElement.classList.contains("draggable-list")&&this.addOverClass(t.parentElement)}addOverGroupClass(t,i){if(t.target){let t=this._groupContainer.querySelector("div#"+this.getDivGroupId(i.group)).getElementsByClassName("group-overlay")[0];i.items.length>0?t.setAttribute("style","display:grid"):(t.classList.add("presetedHeight"),t.setAttribute("style","display:grid"),t.scrollIntoView(!1))}}removeOverClass(){var t,i;let e,s;this.useGroups?(e=null===(t=this._groupContainer)||void 0===t?void 0:t.getElementsByClassName("over"),s=this._groupContainer.getElementsByClassName("last-droppable-space")):(e=null===(i=this._itemContainer)||void 0===i?void 0:i.getElementsByClassName("over"),s=this._itemContainer.getElementsByClassName("last-droppable-space")),e&&Array.from(e).forEach((function(t){t.classList.remove("over")})),s&&Array.from(s).forEach((function(t){t.classList.remove("over")}))}removeOverGroupClass(t,i){if(t.target){let t=this._groupContainer.querySelector("div#"+this.getDivGroupId(i.group)).getElementsByClassName("group-overlay")[0];t&&(t.classList.remove("presetedHeight"),t.setAttribute("style","display:none"))}}onDragStart(t,i,e){this._changeDeboucingTimeout&&window.clearTimeout(this._changeDeboucingTimeout),this.useGroups?this.onDragStartWithGroups(i,t,e):this._dragStartItem={item:t.item,index:t.index}}onDragStartWithGroups(t,i,e){this._dragStartItem={groupName:t.group,item:i,index:e},this._changeDeboucingTimeout=window.setTimeout((()=>{this.showOverlays(t)}),10)}selectFirstItem(){this.setSelection(this.useGroups?this._listGroupItems[0].items[0]:this._listItems[0])}nextOption(t){if(this.useGroups)return void this.setSelection(this.nextOptionWithGroups(t),!0);let i,e=this._listItems.findIndex((i=>i.id===t.id));e>=0&&e<this._listItems.length&&(i=this._listItems[e+1]),this.setSelection(i,!0)}nextOptionWithGroups(t){let i;return this._listGroupItems.every(((e,s,r)=>{let l,o=e.items.findIndex((i=>i.id==t.id));return null!=o&&-1!=o&&(o===e.items.length-1?s+1<=r.length-1&&(l={label:r[s+1].items[0].label}):l={label:e.items[o+1].label}),null==l||(i=l,!1)})),i}previousOption(t){if(this.useGroups)return void this.setSelection(this.previousOptionWithGroups(t),!0);let i,e=this._listItems.findIndex((i=>i.id===t.id));e>0&&e<this._listItems.length&&(i=this._listItems[e-1]),this.setSelection(i,!0)}previousOptionWithGroups(t){let i;return this._listGroupItems.every(((e,s,r)=>{let l,o=e.items.findIndex((i=>i.id===t.id));return null!=o&&-1!=o&&(0===o?s-1>=0&&(l={label:r[s-1].items[r[s-1].items.length-1].label}):l={label:e.items[o-1].label}),null==l||(i=l,!1)})),i}keyDownHandler(t){t.ctrlKey||t.preventDefault(),this.getSelection().then((i=>{if(i)switch(t.key){case"ArrowDown":this.nextOption(i);break;case"ArrowUp":this.previousOption(i)}else this.selectFirstItem()})),t.stopPropagation()}getDivGroupId(t){if(t)return"group-"+t.replace(/[^a-z0-9_]/gi,"_")}getGroupOverlayId(t){if(t)return"group-overlay-"+t.replace(/[^a-z0-9_]/gi,"_")}onDragOverGroup(t,i){this._dragStartItem&&this._dragStartItem.groupName!==i.group&&i.sort&&(t.preventDefault(),this.addOverGroupClass(t,i))}onDragOverItem(t){this._dragStartItem&&(t.preventDefault(),this.addOverClass(t.target),t.stopPropagation())}onDragOverLastIndex(t){t.preventDefault(),this._dragStartItem&&(t.target.classList.add("over"),t.stopPropagation())}showOverlays(t){let i=this._groupContainer.getElementsByClassName("group-overlay");Array.from(i).forEach((i=>{let e=this.getGroupOverlayId(t.group);e&&i.getAttribute("id")&&e!=i.getAttribute("id")&&(i.classList.add("presetedHeight"),i.setAttribute("style","display:grid"))}))}hideOverlays(){var t;let i=null===(t=this._groupContainer)||void 0===t?void 0:t.getElementsByClassName("group-overlay");Array.from(i).forEach((t=>{t.classList.remove("presetedHeight"),t.setAttribute("style","display:none")}))}getContainerItemBuilder(t,i,s,r){var l,o;const a="left"===t?null===(l=this.itemLeftSlotBuilder)||void 0===l?void 0:l.call(this,i,s):null===(o=this.itemSlotBuilder)||void 0===o?void 0:o.call(this,i,s);if(null!=a)return"string"!=typeof a?e("div",{class:r},a):e("div",{class:r,innerHTML:a})}doubleClickItem(t){this.ezDoubleClick.emit(t)}buildItem(t,i){return{id:t.id,label:t.label,check:i.detail}}renderListWithGroups(){return e("div",{class:"group-container",ref:t=>this._groupContainer=t,tabIndex:this.ezSelectable?0:void 0,onKeyDown:t=>this.keyDownHandler(t)},this._listGroupItems.map((t=>e("div",{id:this.getDivGroupId(t.group),class:"group",key:t.group+t.items.length,onDrop:()=>this.onDropGroup(t)},e("label",{draggable:!1,class:"group-name",title:t.group},t.group),e("section",{class:"section-container",onDragOver:t=>t.preventDefault()},e("div",{class:"group-items-container"},e("div",{class:"draggable-list"},t.items.map(((i,r)=>e("li",Object.assign({id:"item_"+i.id,class:{"selectable-container":this.ezSelectable,"hover-feedback":this.hoverFeedback},key:"item_"+i.id},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:o.getInternalIDInfo(`ezListItem__${l.replaceAccentuatedChars(i.label)}`)}),e("div",{class:"draggable"+(1==i.selected?" selected-item ":"")+(1==this.ezSelectable?" selectable ":""),onDblClick:()=>this.doubleClickItem(i),onClick:()=>this.setSelection(i),onDragLeave:()=>t.sort?void 0:this.removeOverClass(),onDragEnd:()=>this.onDragEnd(),onDragStart:()=>this.onDragStart(i,t,r),onDragOver:i=>t.sort?void 0:this.onDragOverItem(i),onDrop:e=>this.onDrop(e,{groupName:t.group,item:i,index:r}),draggable:this.ezDraggable},e("div",{class:"item-content"},this.ezDraggable?e("span",{class:"draggable-icon"}):void 0,"regular"===this.listMode?e(s,null,!!this.itemLeftSlotBuilder&&this.getContainerItemBuilder("left",i,t),e("p",{title:i.label,class:"person-name text--ellipsis"},i.label)):e("ez-check",{enabled:this.enabled,label:i.label,value:i.check,onEzChange:t=>this.ezCheckChange.emit(this.buildItem(i,t))})),!!this.itemSlotBuilder&&this.getContainerItemBuilder("right",i,t,"slot-item")))))),e("div",{class:"last-droppable-space",onDragLeave:()=>this.removeOverClass(),onDragOver:t=>this.onDragOverLastIndex(t),onDragEnd:()=>this.onDragEnd(),onDrop:i=>this.onDropLastIndex(i,t)})),t.sort?e("div",{id:this.getGroupOverlayId(t.group),class:"group-overlay"},this.i18n("ez-list.moveToGroup",{groupName:t.group})):void 0)))))}renderList(){return e("div",{class:"items-container",ref:t=>this._itemContainer=t,tabIndex:this.ezSelectable?0:void 0,onKeyDown:t=>{this.keyDownHandler(t)}},e("div",{class:"draggable-list"},this._listItems.map(((t,i)=>e("li",Object.assign({id:"item_"+t.id,class:{"selectable-container":this.ezSelectable,"hover-feedback":this.hoverFeedback},key:"item_"+t.id},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:o.getInternalIDInfo(`ezListItem__${l.replaceAccentuatedChars(t.label)}`)}),e("div",{class:"draggable"+(1==t.selected?" selected-item ":"")+(1==this.ezSelectable?" selectable ":""),onDblClick:()=>this.doubleClickItem(t),onClick:i=>this.setSelection(t,!1,i.shiftKey,i.altKey||i.metaKey),onDragStart:()=>this.onDragStart({item:t,index:i}),onDragOver:t=>this.onDragOverItem(t),onDragLeave:()=>this.removeOverClass(),onDragEnd:()=>this.onDragEnd(),onDrop:e=>this.onDrop(e,{item:t,index:i}),draggable:this.ezDraggable},e("div",{class:"item-content"},"regular"===this.listMode?e(s,null,this.ezDraggable?e("span",{class:"draggable-icon"}):void 0,!!this.itemLeftSlotBuilder&&this.getContainerItemBuilder("left",t),e("p",{title:t.label,class:"person-name text--ellipsis"},t.label)):e(s,null,this.ezDraggable?e("span",{class:"draggable-icon"}):void 0,e("ez-check",{enabled:this.enabled,label:t.label,value:t.check,onEzChange:i=>this.ezCheckChange.emit({id:t.id,label:t.label,check:i.detail})}))),!!this.itemSlotBuilder&&this.getContainerItemBuilder("right",t))))),e("div",{class:"last-droppable-space",onDragLeave:()=>this.removeOverClass(),onDragOver:t=>this.onDragOverLastIndex(t),onDragEnd:()=>this.onDragEnd(),onDrop:t=>this.onDropLastIndex(t)})))}render(){return e(r,{ref:t=>this._element=t},this.useGroups?this.renderListWithGroups():this.renderList())}};n.style='.sc-ez-list-h{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon--padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item--margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:none;--ez-list__item--border-bottom-color:none;--ez-list__item--font-family:var(--font-pattern, "Roboto");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__item--white-space:var(--ez-list__item--white-space, nowrap);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item--border-radius:var(--border--radius-small, 6px);--ez-list__selected-item--background-color:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, "Roboto");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group-overlay--font-family:var(--font-pattern, "Roboto");--ez-list__group-overlay--font-size:var(--text--medium, 14px);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable-list--padding-bottom:var(--space--small, 6px);--ez-list__draggable-icon--image:url(\'data:image/svg+xml;utf8,<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z"/></svg>\');--ez-list__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-list__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-list__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-list__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-list__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-list__scrollbar--width:var(--space--small, 6px);max-height:100%;width:100%;background-color:#fff;display:flex;outline:none;z-index:var(--ez-list__host--z-index)}p.sc-ez-list{margin:0}.draggable.sc-ez-list{width:100%;display:grid;grid-template-columns:minmax(0px, auto) minmax(0px, auto);place-items:center;border-top:1px dashed #fff;justify-content:space-between;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size)}.dragging.sc-ez-list{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable.sc-ez-list{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container.sc-ez-list{margin:0px !important}.hover-feedback.sc-ez-list:hover{background-color:var(--background--medium);border-radius:var(--border--radius-regular)}.item-content.sc-ez-list{display:flex;align-items:center;overflow:hidden;justify-content:flex-start;width:100%}.draggable-list.sc-ez-list{padding:0;margin:0;width:100%;max-height:100%;scrollbar-width:thin;color:var(--text-color);scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.draggable-list.sc-ez-list li.sc-ez-list{display:flex;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);border-bottom:var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color)}.draggable-list.sc-ez-list li.sc-ez-list>div.sc-ez-list{padding:var(--space--3xs, 4px) var(--space--3xs, 4px);margin:var(--ez-list__item--margin)}.over.sc-ez-list{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space.sc-ez-list{height:var(--ez-list__last-droppable-space--height)}.draggable-selected.sc-ez-list{background-color:var(--background--strong) !important}.draggable-selected.sc-ez-list div.sc-ez-list:hover{background-color:var(--background--strong) !important}.draggable-list.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.draggable-list.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.draggable-icon.sc-ez-list{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon.sc-ez-list::after{content:\'\';display:flex;width:18px;height:18px;background-color:var(--ez-list__icon--color);-webkit-mask-image:var(--ez-list__draggable-icon--image);mask-image:var(--ez-list__draggable-icon--image)}*.sc-ez-list{box-sizing:border-box}.checkbox.sc-ez-list{width:fit-content}.text--ellipsis.sc-ez-list{overflow:hidden;text-overflow:ellipsis;white-space:var(--ez-list__item--white-space)}.group-container.sc-ez-list{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%;scrollbar-width:thin;scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.group-name.sc-ez-list{-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--title--primary);font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom)}.group.sc-ez-list{display:flex;flex-direction:column}.group-container.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.group-container.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.group-container.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.section-container.sc-ez-list{display:flex;position:relative;height:100%}.items-container.sc-ez-list{width:100%;max-height:100%;outline:none;scrollbar-width:thin;scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.group-items-container.sc-ez-list{width:100%;max-height:100%;height:100%;outline:none}.items-container.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.items-container.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.items-container.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.group-overlay.sc-ez-list{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer;font-family:var(--ez-list__group-overlay--font-family);font-size:var(--ez-list__group-overlay--font-size)}.presetedHeight.sc-ez-list{min-height:100px}.overlay-text.sc-ez-list{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item.sc-ez-list{background:var(--ez-list__selected-item--background-color);border-radius:var(--ez-list__selected-item--border-radius)}.slot-item.sc-ez-list{align-items:flex-end}.overGroup.sc-ez-list{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}';export{n as ez_list}
|
|
1
|
+
import{r as t,c as i,h as e,F as s,H as r}from"./p-e4c7eb39.js";import{StringUtils as l,ElementIDUtils as o}from"@sankhyalabs/core";import{p as a}from"./p-80dfc50b.js";import{i as c}from"./p-42e1e733.js";const n=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezSelectItem=i(this,"ezSelectItem",7),this.ezSelectMultipleItems=i(this,"ezSelectMultipleItems",7),this.ezCheckChange=i(this,"ezCheckChange",7),this.ezDoubleClick=i(this,"ezDoubleClick",7),this._listItemsHistory=[],this._listItems=[],this._listGroupItems=[],this.dataSource=[],this.listMode="regular",this.useGroups=!1,this.ezDraggable=!1,this.ezSelectable=!1,this.itemSlotBuilder=void 0,this.itemLeftSlotBuilder=void 0,this.hoverFeedback=!1,this.enableMultipleSelection=!1,this.enabled=!0}async clearHistory(){this._listItemsHistory=[]}async scrollToTop(){this.useGroups?this._element.querySelector(".group-container").scrollTop=0:this._element.querySelector(".items-container").scrollTop=0}async setSelection(t,i,e,s){t&&this.ezSelectable?this.useGroups?this.setSelectionWithGroups(t,i):this.enableMultipleSelection&&s?this.setSelectionMultiple(t):this.enableMultipleSelection&&e?this.setSelectionRange(t):(this.setSelectionSingleItem(t,i),this.emitSelectedItems(t)):await this.removeSelection()}emitSelectedItems(t,i){this.ezSelectItem.emit(t),this.ezSelectMultipleItems.emit(null!=i?i:[t])}setSelectionRange(t){const i=this._listItems.findIndex((t=>t.selected)),e=this._listItems.findIndex((i=>i.id===t.id));if(i<0||i===e)return void this.setSelectionSingleItem(t);const s=Math.min(i,e),r=Math.max(i,e);let l=[...this._listItems];l.forEach(((t,i)=>{t.selected=i>=s&&i<=r})),this._listItems=[...l];const o=this._listItems.filter((t=>t.selected));this.emitSelectedItems(t,o)}setSelectionMultiple(t){let i=[...this._listItems];i.forEach((i=>{i.selected=i.id===t.id?!i.selected:i.selected})),this._listItems=[...i];const e=this._listItems.filter((t=>t.selected));this.emitSelectedItems(t,e)}setSelectionSingleItem(t,i){this.emitSelectedItems(t);let e=[...this._listItems];if(e.forEach((i=>{i.selected=i.id===t.id})),this._listItems=e,!i)return;let s=this._itemContainer.querySelector("li#item_"+t.id);s&&s.scrollIntoView()}setSelectionWithGroups(t,i){this.emitSelectedItems(t);let e=[...this._listGroupItems];if(e.forEach((i=>{i.items.forEach((i=>{i.selected=i.id===t.id}))})),this._listGroupItems=e,!i)return;let s=this._groupContainer.querySelector("li#item_"+t.id);s&&s.scrollIntoView()}async getSelection(){if(!this.useGroups)return this._listItems.find((t=>1==t.selected));let t;return this._listGroupItems.every((i=>{let e=i.items.find((t=>1==t.selected));return!e||(t=e,!1)})),t}async getList(){return this.useGroups?this._listGroupItems:this._listItems}async removeSelection(){if(this.useGroups){let t=[...this._listGroupItems];return t.forEach((t=>{t.items.forEach((t=>{t.selected=!1}))})),void(this._listGroupItems=t)}let t=[...this._listItems];t.forEach((t=>t.selected=!1)),this._listItems=t}applyUUID(t){t.id||(t.id=l.generateUUID())}createList(){if(this.useGroups){let t=this.dataSource.map((t=>t));t.forEach((t=>{t.items.map(this.applyUUID),this.sortGroup(t)})),this._listGroupItems=t}else this._listItems=this._listItemsHistory.length>0?this._listItemsHistory:this.dataSource.map((t=>(this.applyUUID(t),t)))}sortGroup(t){t.sort&&(t.items.sort((function(t,i){return t.label<i.label?-1:t.label>i.label?1:0})),"DSC"===t.sort&&t.items.reverse())}buildIdDraggableListAndSelectable(){const t=this._element.querySelectorAll(".draggable-list");null==t||t.forEach(((t,i)=>{var e,s;let r="draggableList";const l=null===(s=null===(e=this._listGroupItems)||void 0===e?void 0:e[i])||void 0===s?void 0:s.group;this.useGroups&&l&&(r=r.concat("_",l)),o.addIDInfoIfNotExists(t,r)}));const i=this._element.querySelectorAll(".selectable-container");null==i||i.forEach((t=>{o.addIDInfoIfNotExists(t,"selectable")}))}async componentWillLoad(){this.i18n=await c(),this._listItemsHistory=[]}componentWillRender(){this.createList(),this._element&&this.buildIdDraggableListAndSelectable()}componentDidLoad(){o.addIDInfo(this._element)}onDrop(t,i){t.stopPropagation(),this.removeOverClass(),this._dragStartItem&&(this.useGroups?this.onDropWithGroups(i):(this._listItems=[...a(this.buildDragHandlerConfig(i.index,!1))],this._listItemsHistory=[...this._listItems],this.ezChange.emit(this._listItems)))}buildDragHandlerConfig(t,i){return{listItems:this._listItems,dragItem:this._dragStartItem,enableMultipleSelection:this.enableMultipleSelection,targetIndex:t,moveToFinal:i,clearSelection:()=>this.setSelection(void 0)}}onDropWithGroups(t){this.setSelection(void 0);let i=[...this._listGroupItems],e=this._listGroupItems.find((i=>t.groupName==i.group));if(i.find((t=>t.group==this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1),e.sort)i.find((i=>i.group==t.groupName)).items.push(this._dragStartItem.item),i.find((i=>i.group==t.groupName)).items.sort((function(t,i){return t.label<i.label?-1:t.label>i.label?1:0})),"DSC"===e.sort&&i.find((i=>i.group==t.groupName)).items.reverse();else{let e=t.index>this._dragStartItem.index?t.index-1:t.index;i.find((i=>i.group==t.groupName)).items.splice(e,0,this._dragStartItem.item)}this._listGroupItems=i,this.ezChange.emit(this._listGroupItems)}onDropLastIndex(t,i){t.stopPropagation(),this.removeOverClass(),this._dragStartItem&&(this.useGroups?this.onDropLastItemWithGroups(i):(this._listItems=[...a(this.buildDragHandlerConfig(this._listItems.length-1,!0))],this._listItemsHistory=[...this._listItems],this.ezChange.emit(this._listItems)))}onDropLastItemWithGroups(t){this.setSelection(void 0);let i=[...this._listGroupItems],e=this._listGroupItems.find((i=>t.group==i.group));i.find((t=>t.group==this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1),i.find((i=>i.group==t.group)).items.push(this._dragStartItem.item),e.sort&&(i.find((i=>i.group==t.group)).items.sort((function(t,i){return t.label<i.label?-1:t.label>i.label?1:0})),"DSC"===e.sort&&i.find((i=>i.group==t.group)).items.reverse()),this._listGroupItems=i,this.ezChange.emit(this._listGroupItems)}onDropGroup(t){var i;let e=[...this._listGroupItems];this.setSelection(void 0);let s=e.find((i=>i.group===t.group));if(s){if((null===(i=s.items)||void 0===i?void 0:i.length)>0){let t;s.items.forEach(((i,e)=>{i.id===this._dragStartItem.item.id&&(t={item:i,index:e})})),t?(s.items.splice(t.index,1),s.items.unshift(t.item),this.sortGroup(s)):(s.items.unshift(this._dragStartItem.item),this.sortGroup(s),e.find((t=>t.group===this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1))}else e.find((t=>t.group===this._dragStartItem.groupName)).items.splice(this._dragStartItem.index,1),s.items=[this._dragStartItem.item];this._listGroupItems=e}}onDragEnd(){this._dragStartItem=void 0,this.useGroups&&this.hideOverlays()}addOverClass(t){(null==t?void 0:t.__proto__)==HTMLDivElement.prototype&&t.classList.contains("draggable")?t.classList.add("over"):(null==t?void 0:t.parentElement)&&!t.parentElement.classList.contains("draggable-list")&&this.addOverClass(t.parentElement)}addOverGroupClass(t,i){if(t.target){let t=this._groupContainer.querySelector("div#"+this.getDivGroupId(i.group)).getElementsByClassName("group-overlay")[0];i.items.length>0?t.setAttribute("style","display:grid"):(t.classList.add("presetedHeight"),t.setAttribute("style","display:grid"),t.scrollIntoView(!1))}}removeOverClass(){var t,i;let e,s;this.useGroups?(e=null===(t=this._groupContainer)||void 0===t?void 0:t.getElementsByClassName("over"),s=this._groupContainer.getElementsByClassName("last-droppable-space")):(e=null===(i=this._itemContainer)||void 0===i?void 0:i.getElementsByClassName("over"),s=this._itemContainer.getElementsByClassName("last-droppable-space")),e&&Array.from(e).forEach((function(t){t.classList.remove("over")})),s&&Array.from(s).forEach((function(t){t.classList.remove("over")}))}removeOverGroupClass(t,i){if(t.target){let t=this._groupContainer.querySelector("div#"+this.getDivGroupId(i.group)).getElementsByClassName("group-overlay")[0];t&&(t.classList.remove("presetedHeight"),t.setAttribute("style","display:none"))}}onDragStart(t,i,e){this._changeDeboucingTimeout&&window.clearTimeout(this._changeDeboucingTimeout),this.useGroups?this.onDragStartWithGroups(i,t,e):this._dragStartItem={item:t.item,index:t.index}}onDragStartWithGroups(t,i,e){this._dragStartItem={groupName:t.group,item:i,index:e},this._changeDeboucingTimeout=window.setTimeout((()=>{this.showOverlays(t)}),10)}selectFirstItem(){this.setSelection(this.useGroups?this._listGroupItems[0].items[0]:this._listItems[0])}nextOption(t){if(this.useGroups)return void this.setSelection(this.nextOptionWithGroups(t),!0);let i,e=this._listItems.findIndex((i=>i.id===t.id));e>=0&&e<this._listItems.length&&(i=this._listItems[e+1]),this.setSelection(i,!0)}nextOptionWithGroups(t){let i;return this._listGroupItems.every(((e,s,r)=>{let l,o=e.items.findIndex((i=>i.id==t.id));return null!=o&&-1!=o&&(o===e.items.length-1?s+1<=r.length-1&&(l={label:r[s+1].items[0].label}):l={label:e.items[o+1].label}),null==l||(i=l,!1)})),i}previousOption(t){if(this.useGroups)return void this.setSelection(this.previousOptionWithGroups(t),!0);let i,e=this._listItems.findIndex((i=>i.id===t.id));e>0&&e<this._listItems.length&&(i=this._listItems[e-1]),this.setSelection(i,!0)}previousOptionWithGroups(t){let i;return this._listGroupItems.every(((e,s,r)=>{let l,o=e.items.findIndex((i=>i.id===t.id));return null!=o&&-1!=o&&(0===o?s-1>=0&&(l={label:r[s-1].items[r[s-1].items.length-1].label}):l={label:e.items[o-1].label}),null==l||(i=l,!1)})),i}keyDownHandler(t){t.ctrlKey||t.preventDefault(),this.getSelection().then((i=>{if(i)switch(t.key){case"ArrowDown":this.nextOption(i);break;case"ArrowUp":this.previousOption(i)}else this.selectFirstItem()})),t.stopPropagation()}getDivGroupId(t){if(t)return"group-"+t.replace(/[^a-z0-9_]/gi,"_")}getGroupOverlayId(t){if(t)return"group-overlay-"+t.replace(/[^a-z0-9_]/gi,"_")}onDragOverGroup(t,i){this._dragStartItem&&this._dragStartItem.groupName!==i.group&&i.sort&&(t.preventDefault(),this.addOverGroupClass(t,i))}onDragOverItem(t){this._dragStartItem&&(t.preventDefault(),this.addOverClass(t.target),t.stopPropagation())}onDragOverLastIndex(t){t.preventDefault(),this._dragStartItem&&(t.target.classList.add("over"),t.stopPropagation())}showOverlays(t){let i=this._groupContainer.getElementsByClassName("group-overlay");Array.from(i).forEach((i=>{let e=this.getGroupOverlayId(t.group);e&&i.getAttribute("id")&&e!=i.getAttribute("id")&&(i.classList.add("presetedHeight"),i.setAttribute("style","display:grid"))}))}hideOverlays(){var t;let i=null===(t=this._groupContainer)||void 0===t?void 0:t.getElementsByClassName("group-overlay");Array.from(i).forEach((t=>{t.classList.remove("presetedHeight"),t.setAttribute("style","display:none")}))}getContainerItemBuilder(t,i,s,r){var l,o;const a="left"===t?null===(l=this.itemLeftSlotBuilder)||void 0===l?void 0:l.call(this,i,s):null===(o=this.itemSlotBuilder)||void 0===o?void 0:o.call(this,i,s);if(null!=a)return"string"!=typeof a?e("div",{class:r},a):e("div",{class:r,innerHTML:a})}doubleClickItem(t){this.ezDoubleClick.emit(t)}buildItem(t,i){return{id:t.id,label:t.label,check:i.detail}}renderListWithGroups(){return e("div",{class:"group-container",ref:t=>this._groupContainer=t,tabIndex:this.ezSelectable?0:void 0,onKeyDown:t=>this.keyDownHandler(t)},this._listGroupItems.map((t=>e("div",{id:this.getDivGroupId(t.group),class:"group",key:t.group+t.items.length,onDrop:()=>this.onDropGroup(t)},e("label",{draggable:!1,class:"group-name",title:t.group},t.group),e("section",{class:"section-container",onDragOver:t=>t.preventDefault()},e("div",{class:"group-items-container"},e("div",{class:"draggable-list"},t.items.map(((i,r)=>e("li",Object.assign({id:"item_"+i.id,class:{"selectable-container":this.ezSelectable,"hover-feedback":this.hoverFeedback},key:"item_"+i.id},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:o.getInternalIDInfo(`ezListItem__${l.replaceAccentuatedChars(i.label)}`)}),e("div",{class:"draggable"+(1==i.selected?" selected-item ":"")+(1==this.ezSelectable?" selectable ":""),onDblClick:()=>this.doubleClickItem(i),onClick:()=>this.setSelection(i),onDragLeave:()=>t.sort?void 0:this.removeOverClass(),onDragEnd:()=>this.onDragEnd(),onDragStart:()=>this.onDragStart(i,t,r),onDragOver:i=>t.sort?void 0:this.onDragOverItem(i),onDrop:e=>this.onDrop(e,{groupName:t.group,item:i,index:r}),draggable:this.ezDraggable},e("div",{class:"item-content"},this.ezDraggable?e("span",{class:"draggable-icon"}):void 0,"regular"===this.listMode?e(s,null,!!this.itemLeftSlotBuilder&&this.getContainerItemBuilder("left",i,t),e("p",{title:i.label,class:"person-name text--ellipsis"},i.label)):e("ez-check",{enabled:this.enabled,label:i.label,value:i.check,onEzChange:t=>this.ezCheckChange.emit(this.buildItem(i,t))})),!!this.itemSlotBuilder&&this.getContainerItemBuilder("right",i,t,"slot-item")))))),e("div",{class:"last-droppable-space",onDragLeave:()=>this.removeOverClass(),onDragOver:t=>this.onDragOverLastIndex(t),onDragEnd:()=>this.onDragEnd(),onDrop:i=>this.onDropLastIndex(i,t)})),t.sort?e("div",{id:this.getGroupOverlayId(t.group),class:"group-overlay"},this.i18n("ez-list.moveToGroup",{groupName:t.group})):void 0)))))}renderList(){return e("div",{class:"items-container",ref:t=>this._itemContainer=t,tabIndex:this.ezSelectable?0:void 0,onKeyDown:t=>{this.keyDownHandler(t)}},e("div",{class:"draggable-list"},this._listItems.map(((t,i)=>e("li",Object.assign({id:"item_"+t.id,class:{"selectable-container":this.ezSelectable,"hover-feedback":this.hoverFeedback},key:"item_"+t.id},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:o.getInternalIDInfo(`ezListItem__${l.replaceAccentuatedChars(t.label)}`)}),e("div",{class:"draggable"+(1==t.selected?" selected-item ":"")+(1==this.ezSelectable?" selectable ":""),onDblClick:()=>this.doubleClickItem(t),onClick:i=>this.setSelection(t,!1,i.shiftKey,i.altKey||i.metaKey),onDragStart:()=>this.onDragStart({item:t,index:i}),onDragOver:t=>this.onDragOverItem(t),onDragLeave:()=>this.removeOverClass(),onDragEnd:()=>this.onDragEnd(),onDrop:e=>this.onDrop(e,{item:t,index:i}),draggable:this.ezDraggable},e("div",{class:"item-content"},"regular"===this.listMode?e(s,null,this.ezDraggable?e("span",{class:"draggable-icon"}):void 0,!!this.itemLeftSlotBuilder&&this.getContainerItemBuilder("left",t),e("p",{title:t.label,class:"person-name text--ellipsis"},t.label)):e(s,null,this.ezDraggable?e("span",{class:"draggable-icon"}):void 0,e("ez-check",{enabled:this.enabled,label:t.label,value:t.check,onEzChange:i=>this.ezCheckChange.emit({id:t.id,label:t.label,check:i.detail})}))),!!this.itemSlotBuilder&&this.getContainerItemBuilder("right",t))))),e("div",{class:"last-droppable-space",onDragLeave:()=>this.removeOverClass(),onDragOver:t=>this.onDragOverLastIndex(t),onDragEnd:()=>this.onDragEnd(),onDrop:t=>this.onDropLastIndex(t)})))}render(){return e(r,{ref:t=>this._element=t},this.useGroups?this.renderListWithGroups():this.renderList())}};n.style='.sc-ez-list-h{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon--padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item--margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:none;--ez-list__item--border-bottom-color:none;--ez-list__item--font-family:var(--font-pattern, "Roboto");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__item--white-space:var(--ez-list__item--white-space, nowrap);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item--border-radius:var(--border--radius-small, 6px);--ez-list__selected-item--background-color:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, "Roboto");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group-overlay--font-family:var(--font-pattern, "Roboto");--ez-list__group-overlay--font-size:var(--text--medium, 14px);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable-list--padding-bottom:var(--space--small, 6px);--ez-list__draggable-icon--image:url(\'data:image/svg+xml;utf8,<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z"/></svg>\');--ez-list__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-list__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-list__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-list__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-list__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-list__scrollbar--width:var(--space--small, 6px);max-height:100%;width:100%;background-color:#fff;display:flex;outline:none;z-index:var(--ez-list__host--z-index)}p.sc-ez-list{margin:0}.draggable.sc-ez-list{width:100%;display:grid;grid-template-columns:minmax(0px, auto) minmax(0px, auto);place-items:center;border-top:1px dashed #fff;justify-content:space-between;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size)}.dragging.sc-ez-list{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable.sc-ez-list{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container.sc-ez-list{margin:0px !important}.hover-feedback.sc-ez-list:hover{background-color:var(--background--medium);border-radius:var(--border--radius-regular)}.item-content.sc-ez-list{display:flex;align-items:center;overflow:hidden;justify-content:flex-start;width:100%}.draggable-list.sc-ez-list{padding:0;margin:0;width:100%;max-height:100%;scrollbar-width:thin;color:var(--text-color);scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.draggable-list.sc-ez-list li.sc-ez-list{display:flex;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);border-bottom:var(--ez-list__item--border-bottom, none) var(--ez-list__item--border-bottom-color)}.draggable-list.sc-ez-list li.sc-ez-list>div.sc-ez-list{padding:var(--space--3xs, 4px) var(--space--3xs, 4px);margin:var(--ez-list__item--margin)}.over.sc-ez-list{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space.sc-ez-list{height:var(--ez-list__last-droppable-space--height)}.draggable-selected.sc-ez-list{background-color:var(--background--strong) !important}.draggable-selected.sc-ez-list div.sc-ez-list:hover{background-color:var(--background--strong) !important}.draggable-list.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.draggable-list.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.draggable-list.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.draggable-icon.sc-ez-list{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon.sc-ez-list::after{content:\'\';display:flex;width:18px;height:18px;background-color:var(--ez-list__icon--color);-webkit-mask-image:var(--ez-list__draggable-icon--image);mask-image:var(--ez-list__draggable-icon--image)}*.sc-ez-list{box-sizing:border-box}.checkbox.sc-ez-list{width:fit-content}.text--ellipsis.sc-ez-list{overflow:hidden;text-overflow:ellipsis;white-space:var(--ez-list__item--white-space)}.group-container.sc-ez-list{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%;scrollbar-width:thin;scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.group-name.sc-ez-list{-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--title--primary);font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom)}.group.sc-ez-list{display:flex;flex-direction:column}.group-container.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.group-container.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.group-container.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.group-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.group-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.section-container.sc-ez-list{display:flex;position:relative;height:100%}.items-container.sc-ez-list{width:100%;max-height:100%;outline:none;scrollbar-width:thin;scrollbar-color:var(--ez-list__scrollbar--color-clicked) var(--ez-list__scrollbar--color-background)}.group-items-container.sc-ez-list{width:100%;max-height:100%;height:100%;outline:none}.items-container.sc-ez-list::-webkit-scrollbar{background-color:var(--ez-list__scrollbar--color-background);width:var(--ez-list__scrollbar--width);max-width:var(--ez-list__scrollbar--width);min-width:var(--ez-list__scrollbar--width)}.items-container.sc-ez-list::-webkit-scrollbar-track{background-color:var(--ez-list__scrollbar--color-background);border-radius:var(--ez-list__scrollbar--border-radius)}.items-container.sc-ez-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__scrollbar--color-default);border-radius:var(--ez-list__scrollbar--border-radius)}.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:hover,.items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-list__scrollbar--color-hover)}.items-container.sc-ez-list::-webkit-scrollbar-thumb:vertical:active,.items-container.sc-ez-list::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-list__scrollbar--color-clicked)}.group-overlay.sc-ez-list{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer;font-family:var(--ez-list__group-overlay--font-family);font-size:var(--ez-list__group-overlay--font-size)}.presetedHeight.sc-ez-list{min-height:100px}.overlay-text.sc-ez-list{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item.sc-ez-list{background:var(--ez-list__selected-item--background-color);border-radius:var(--ez-list__selected-item--border-radius)}.slot-item.sc-ez-list{align-items:flex-end}.overGroup.sc-ez-list{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}';export{n as ez_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as h}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as h}from"./p-e4c7eb39.js";import{TimeFormatter as r,MaskFormatter as a,NumberUtils as n,ElementIDUtils as o}from"@sankhyalabs/core";import{C as l}from"./p-ec7db713.js";import{i as u}from"./p-42e1e733.js";const c=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.ezStartChange=s(this,"ezStartChange",7),this.ezCancelWaitingChange=s(this,"ezCancelWaitingChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular",this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||(this.prepareValue(this._viewValue),(this._textInput.value||"")!==this._viewValue&&(this._textInput.value=this._viewValue)))}observeShowSeconds(){this.prepareMask(this.showSeconds?"##:##:##":"##:##")}observeValue(t,s){if(this._textInput&&t!=s){let i=this.validateValue(t);i!=this.validateValue(s)&&(this._viewValue=null==i?"":i.toString(),this.prepareValue(this._viewValue),this._viewValue&&!r.validateTime(this._viewValue,this.showSeconds)?(this.setError(this.i18n("ez-time-input.invalidTime")),i=void 0):this.setError(""),this.ezChange.emit(null===i?void 0:i))}}prepareMask(t){null==this._maskFormatter?this._maskFormatter=new a(t):this._maskFormatter.mask=t}validateValue(t){return isNaN(t)||void 0===t?null:t}setError(t){this.errorMessage=t,this._textInput&&(null==t?void 0:t.trim())&&this.ezCancelWaitingChange.emit()}getViewValue(){return this._viewValue}prepareValue(t){try{this._viewValue=r.prepareValue(t,this.showSeconds),this._textInput&&this._textInput.value!==this._viewValue&&(this._textInput.value=this._viewValue)}catch(t){this.setError(t.message)}}async setFocus({selectText:t}){this._textInput.setFocus({selectText:t})}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleBlur(){if(this._textInput){this._viewValue=this._textInput.value,this.prepareValue(this._viewValue);const t=n.stringToNumber(this._viewValue.replace(/\D/g,""));this.value=["string","number"].includes(typeof t)?t:null}}handleInput(){const t=this._textInput.value;["string","number"].includes(typeof t)&&n.stringToNumber(t.replace(/\D/g,""))!==this.value&&this.ezStartChange.emit({waitmessage:"",blocking:!1})}async componentWillLoad(){this.i18n=await u(),this.observeShowSeconds(),this.value?this.prepareValue(this.value.toString()):this._viewValue&&this.prepareValue(this._viewValue)}componentDidLoad(){l.applyVarsTextInput(this._elem,this._textInput),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return o.addIDInfoIfNotExists(this._elem,"input"),i(e,null,i("ez-text-input",{class:"time__input","data-element-id":o.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",value:this._viewValue,enabled:this.enabled,label:this.label,restrict:"0123456789:",onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError,alternativePlaceholder:this.alternativePlaceholder},i("ez-icon",{slot:"leftIcon",iconName:"timer-outline"})))}static get assetsDirs(){return["../assets"]}get _elem(){return h(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],showSeconds:["observeShowSeconds"],value:["observeValue"]}}};c.style=":host{display:flex;flex-wrap:wrap;position:relative;width:100%}.time__input{height:100%}";export{c as ez_time_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as a,StringUtils as o}from"@sankhyalabs/core";import{a as l,r as h}from"./p-40a60148.js";const n=class{constructor(i){e(this,i),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}async observeOpened(e){e&&!this._popOverCore&&this.renderPopoverCore(),this._popOverCore.opened=e}async updatePosition(e,t){var i;await(null===(i=this._popOverCore)||void 0===i?void 0:i.updatePosition(e,t))}async show(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.show(e,t)}async showUnder(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.showUnder(e,t)}async hide(){var e;await(null===(e=this._popOverCore)||void 0===e?void 0:e.hide())}async setOptions(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setOptions(e))}async setAnchorElement(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setAnchorElement(e)),this.anchorElement=e}getFirstElement(e){return Array.isArray(e)&&e.length?e[0]:!Array.isArray(e)&&e.item?e.item(0):null}buildElementId(e){const t=e.filter((e=>!!e));return a.getInternalIDInfo(t.join("_"))}renderPopoverCore(){var e;this._popOverCore=document.createElement("ez-popover-core"),this._popOverCore.opened=this.opened,this._popOverCore.anchorElement=this.anchorElement,this._popOverCore.autoClose=this.autoClose,this._popOverCore.boxWidth=this.boxWidth,this._popOverCore.overlayType=this.overlayType,this._popOverCore.options=this.options,this._popOverCore.useAnchorSize=this.useAnchorSize,this._popOverCore.minWidth=this.minWidth,this._popOverCore.setAttribute("data-element-id",this.buildElementId(["ez-popover-core",this._host.getAttribute("data-element-id")])),this._popOverCore.addEventListener("ezVisibilityChange",(({detail:e})=>{this.ezVisibilityChange.emit(e),this.opened=e}));const t=this.getFirstElement(this._host.children);t?this._popOverCore.appendChild(t):console.warn("O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.");const i=document.body.querySelector("#root"),s=this.getFirstElement(document.body.getElementsByTagName("div"));(null!==(e=null!=i?i:s)&&void 0!==e?e:document.body).appendChild(this._popOverCore)}render(){return i(s,null,i("slot",null))}get _host(){return r(this)}static get watchers(){return{opened:["observeOpened"]}}};n.style=":host{display:none}";const c=class{constructor(t){e(this,t),this.message=void 0}render(){return i("div",{class:"multi-selection__message"},i("span",{class:"multi-selection__text-message"},this.message))}};c.style=".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";const d=class{constructor(i){e(this,i),this.changeValue=t(this,"changeValue",7),this.changePreSelection=t(this,"changePreSelection",7),this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this.MAX_HEIGHT=350,this.HEADER_MENU_HEIGHT=60,this.showLoading=void 0,this.visibleOptions=[],this.textEmptyList=void 0,this.canShowListOptions=void 0,this.value=void 0,this.showOptionValue=!0,this.preSelection=void 0}async nextOption(){const e=void 0===this.preSelection?0:Math.min(this.preSelection+1,this.visibleOptions.length-1);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}async previousOption(){const e=void 0===this.preSelection?0:Math.max(this.preSelection-1,0);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}selectOption(e){const t=Object.assign(Object.assign({},e),{value:l(null==e?void 0:e.value),label:l(null==e?void 0:e.label)}),i=Object.assign(Object.assign({},t),{value:h(null==t?void 0:t.value),label:h(null==t?void 0:t.label)});this.changeValue.emit(i)}createOption(e){let{key:t,title:i}=e;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");i=o.decodeHtmlEntities(i);const a={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==i?void 0:i.replace(s,"").replace(r,"")};this.selectOption(a)}scrollToOption(e){window.requestAnimationFrame((()=>{const t=(null==e?void 0:e.value)?this._optionsList.querySelector(`div#item_${e.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}buildItem(e,t){e.label=e.label||e.value;const s={key:e.value,title:e.label,details:e.details};return i("div",{style:{height:"100%"},class:t===this.preSelection?"item preselected":"item",id:`item_${e.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this.changePreSelection.emit(t)},i("ez-card-item",{item:s,compacted:!0,enableKey:this.showOptionValue}))}componentDidLoad(){this._optionsList&&(this._optionsList.style.maxHeight=`${this.MAX_HEIGHT}px`)}componentDidUpdate(){if(this._optionsList){const e=this._optionsList.getBoundingClientRect();window.innerHeight-e.bottom<0&&this.adjustMaxHeight(e)}}adjustMaxHeight(e){if(this._optionsList){const t=Math.min(e.top-this.HEADER_MENU_HEIGHT,this.MAX_HEIGHT);this._optionsList.style.maxHeight=`${t}px`}}cleanEmptyObjectArray(e){return e.filter((e=>Object.values(e).some((e=>void 0!==e))))}render(){return i(s,null,i("ul",{class:"list-options",ref:e=>this._optionsList=e},!this.showLoading&&0===this.cleanEmptyObjectArray(this.visibleOptions).length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.canShowListOptions&&this.visibleOptions.map(((e,t)=>this.buildItem(e,t)))))}};d.style=":host{--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--small, 6px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--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-search__list-title--primary);border-top:3px solid transparent}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--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}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);gap:var(--space--small, 6px)}.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)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";export{n as ez_popover_plus,c as multi_selection_box_message,d as search_list}
|
|
1
|
+
import{r as e,c as t,h as i,H as s,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as a,StringUtils as o}from"@sankhyalabs/core";import{a as l,r as h}from"./p-40a60148.js";const n=class{constructor(i){e(this,i),this.ezVisibilityChange=t(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}async observeOpened(e){e&&!this._popOverCore&&this.renderPopoverCore(),this._popOverCore.opened=e}async updatePosition(e,t){var i;await(null===(i=this._popOverCore)||void 0===i?void 0:i.updatePosition(e,t))}async show(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.show(e,t)}async showUnder(e,t){this._popOverCore||this.renderPopoverCore(),await this._popOverCore.showUnder(e,t)}async hide(){var e;await(null===(e=this._popOverCore)||void 0===e?void 0:e.hide())}async setOptions(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setOptions(e))}async setAnchorElement(e){var t;await(null===(t=this._popOverCore)||void 0===t?void 0:t.setAnchorElement(e)),this.anchorElement=e}getFirstElement(e){return Array.isArray(e)&&e.length?e[0]:!Array.isArray(e)&&e.item?e.item(0):null}buildElementId(e){const t=e.filter((e=>!!e));return a.getInternalIDInfo(t.join("_"))}renderPopoverCore(){var e;this._popOverCore=document.createElement("ez-popover-core"),this._popOverCore.opened=this.opened,this._popOverCore.anchorElement=this.anchorElement,this._popOverCore.autoClose=this.autoClose,this._popOverCore.boxWidth=this.boxWidth,this._popOverCore.overlayType=this.overlayType,this._popOverCore.options=this.options,this._popOverCore.useAnchorSize=this.useAnchorSize,this._popOverCore.minWidth=this.minWidth,this._popOverCore.setAttribute("data-element-id",this.buildElementId(["ez-popover-core",this._host.getAttribute("data-element-id")])),this._popOverCore.addEventListener("ezVisibilityChange",(({detail:e})=>{this.ezVisibilityChange.emit(e),this.opened=e}));const t=this.getFirstElement(this._host.children);t?this._popOverCore.appendChild(t):console.warn("O slot do popover está vazio. Adicione conteúdo ao slot para exibição correta.");const i=document.body.querySelector("#root"),s=this.getFirstElement(document.body.getElementsByTagName("div"));(null!==(e=null!=i?i:s)&&void 0!==e?e:document.body).appendChild(this._popOverCore)}render(){return i(s,null,i("slot",null))}get _host(){return r(this)}static get watchers(){return{opened:["observeOpened"]}}};n.style=":host{display:none}";const c=class{constructor(t){e(this,t),this.message=void 0}render(){return i("div",{class:"multi-selection__message"},i("span",{class:"multi-selection__text-message"},this.message))}};c.style=".multi-selection__message{display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;min-height:320px;text-align:center}.multi-selection__text-message{margin-top:-30px;font-family:var(--font-pattern);font-size:var(--text--meduim);padding:var(--space-xs);color:var(--text--primary)}";const d=class{constructor(i){e(this,i),this.changeValue=t(this,"changeValue",7),this.changePreSelection=t(this,"changePreSelection",7),this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this.MAX_HEIGHT=350,this.HEADER_MENU_HEIGHT=60,this.showLoading=void 0,this.visibleOptions=[],this.textEmptyList=void 0,this.canShowListOptions=void 0,this.value=void 0,this.showOptionValue=!0,this.preSelection=void 0}async nextOption(){const e=void 0===this.preSelection?0:Math.min(this.preSelection+1,this.visibleOptions.length-1);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}async previousOption(){const e=void 0===this.preSelection?0:Math.max(this.preSelection-1,0);this.changePreSelection.emit(e),this.scrollToOption(this.visibleOptions[e])}selectOption(e){const t=Object.assign(Object.assign({},e),{value:l(null==e?void 0:e.value),label:l(null==e?void 0:e.label)}),i=Object.assign(Object.assign({},t),{value:h(null==t?void 0:t.value),label:h(null==t?void 0:t.label)});this.changeValue.emit(i)}createOption(e){let{key:t,title:i}=e;const s=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");i=o.decodeHtmlEntities(i);const a={value:null==t?void 0:t.replace(s,"").replace(r,""),label:null==i?void 0:i.replace(s,"").replace(r,"")};this.selectOption(a)}scrollToOption(e){window.requestAnimationFrame((()=>{const t=(null==e?void 0:e.value)?this._optionsList.querySelector(`div#item_${e.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}buildItem(e,t){e.label=e.label||e.value;const s={key:e.value,title:e.label,details:e.details};return i("div",{style:{height:"100%"},class:t===this.preSelection?"item preselected":"item",id:`item_${e.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this.changePreSelection.emit(t)},i("ez-card-item",{item:s,compacted:!0,enableKey:this.showOptionValue}))}componentDidLoad(){this._optionsList&&(this._optionsList.style.maxHeight=`${this.MAX_HEIGHT}px`)}componentDidUpdate(){if(this._optionsList){const e=this._optionsList.getBoundingClientRect();window.innerHeight-e.bottom<0&&this.adjustMaxHeight(e)}}adjustMaxHeight(e){if(this._optionsList){const t=Math.min(e.top-this.HEADER_MENU_HEIGHT,this.MAX_HEIGHT);this._optionsList.style.maxHeight=`${t}px`}}cleanEmptyObjectArray(e){return e.filter((e=>Object.values(e).some((e=>void 0!==e))))}render(){return i(s,null,i("ul",{class:"list-options",ref:e=>this._optionsList=e},!this.showLoading&&0===this.cleanEmptyObjectArray(this.visibleOptions).length&&i("div",{class:"message"},i("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&i("div",{class:"message"},i("div",{class:"message__loading"})),this.canShowListOptions&&this.visibleOptions.map(((e,t)=>this.buildItem(e,t)))))}};d.style=":host{--ez-search__list-title--primary:var(--title--primary, #2B3A54);--ez-search__list-text--primary:var(--text--primary, #626e82);--ez-search__list-height:calc(var(--ez-search--font-size) + var(--ez-search--space--medium) + 4px);--ez-search__list-min-width:64px;--ez-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-search__scrollbar--width:var(--space--small, 6px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-search__scrollbar--color-clicked) var(--ez-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-search__scrollbar--color-background);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-search__scrollbar--color-default);border-radius:var(--ez-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-search__scrollbar--color-clicked)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;min-height:var(--ez-search__list-height)}.message__no-result{color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--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-search__list-title--primary);border-top:3px solid transparent}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-search__list-title--primary);font-family:var(--ez-search--font-family);font-size:var(--ez-search--font-size);line-height:var(--ez-search--line-height)}.item__label{font-weight:var(--ez-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-search__list-text--primary);font-weight:var(--ez-search--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}.item__list>li:hover{background-color:var(--ez-search--background-medium)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-search--border-radius-small);gap:var(--space--small, 6px)}.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)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";export{n as ez_popover_plus,c as multi_selection_box_message,d as search_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as t,H as e,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as n}from"@sankhyalabs/core";const i=class{constructor(t){o(this,t),this.createRipple=o=>{const t=this._button;if(!t||this.isDisabled||!this.enabled)return;const e=t.getBoundingClientRect();let r,n;o instanceof MouseEvent?(r=o.clientX,n=o.clientY):(r=o.touches[0].clientX,n=o.touches[0].clientY);const i={x:r-e.left,y:n-e.top,id:Date.now()};this.ripples=[...this.ripples,i],this.isPressed=!0,setTimeout((()=>{this.isPressed=!1}),150),setTimeout((()=>{this.ripples=this.ripples.filter((o=>o.id!==i.id))}),600)},this.ripples=[],this.isPressed=!1,this.label=void 0,this.enabled=!0,this.isDisabled=!1,this.mode="regular",this.image=void 0,this.iconName=void 0,this.size="medium",this.variant=void 0,this.type="button",this.leftIconName=void 0,this.rightIconName=void 0,this.suppressAnimation=!1}async setFocus(){this._button.focus(),this._button.classList.add("force-focus-visible")}async setBlur(){this._button.blur()}onMouseDown(o){this.createRipple(o)}onTouchStart(o){this.createRipple(o)}clickListener(o){(!this.enabled||!0===this.isDisabled||""===this.isDisabled||"full"===this.isDisabled)&&o.stopImmediatePropagation()}removeForcedFocusVisible(){var o;null===(o=this._button)||void 0===o||o.classList.remove("force-focus-visible")}connectedCallback(){var o,t;null===(o=this._button)||void 0===o||o.removeEventListener("blur",this.removeForcedFocusVisible.bind(this)),null===(t=this._button)||void 0===t||t.addEventListener("blur",this.removeForcedFocusVisible.bind(this))}componentDidLoad(){var o;this._element&&n.addIDInfo(this._element),this._button&&n.addIDInfo(this._button,"button",{id:"embedded"}),null===(o=this._button)||void 0===o||o.addEventListener("blur",this.removeForcedFocusVisible.bind(this))}disconnectCallback(){var o;null===(o=this._button)||void 0===o||o.removeEventListener("blur",this.removeForcedFocusVisible.bind(this))}getButtonSize(o="medium"){const t=this.size&&this.size.toLowerCase();return["x-small","small","medium","large"].includes(t)?t:o}getButtonSizeClass(){return this.getButtonSize()?`btn-icon--${this.getButtonSize()}`:""}getIconSize(){return"x-small"===this.size?"small":this.size}handleSlotChange(o){const t=o.target.assignedElements()[0];t&&("link"==this.mode?t.style.display="inline":t.style.setProperty("--ez-icon--color","var(--ez-icon--color)"))}renderRipples(){return this.ripples.map((o=>t("span",{key:o.id,class:"ripple",style:{left:o.x-10+"px",top:o.y-10+"px"}})))}render(){return t(e,{class:this.variant?`ez-button--${this.variant}`:""},(()=>"icon"==this.mode?t("button",{class:`btn-icon ${this.getButtonSizeClass()} ${this.isPressed?"pressed":""}`,type:this.type,disabled:"full"===this.isDisabled||!this.enabled,"aria-disabled":this.isDisabled&&!0===this.isDisabled,ref:o=>this._button=o},t("ez-icon",{class:"icon",href:this.image,iconName:this.iconName,size:this.getIconSize()}),!this.suppressAnimation&&this.renderRipples()):"label-icon"==this.mode?t("div",{class:"label-icon "+("full"!==this.isDisabled&&""!==this.isDisabled&&!0!==this.isDisabled&&this.enabled?"":"disabled")},t("button",{class:`btn-icon ${this.getButtonSizeClass()} ${this.isPressed?"pressed":""}`,type:this.type,disabled:"full"===this.isDisabled||!this.enabled,"aria-disabled":this.isDisabled&&!0===this.isDisabled,ref:o=>this._button=o},t("ez-icon",{class:"icon",href:this.image,iconName:this.iconName,size:this.getIconSize()}),!this.suppressAnimation&&this.renderRipples()),t("label",{title:this.label},this.label)):"link"==this.mode?t("a",{class:`${this.getIconSize()} ${"full"!==this.isDisabled&&""!==this.isDisabled&&!0!==this.isDisabled&&this.enabled?"":"disabled"}`,tabIndex:0,ref:o=>this._button=o},this.leftIconName?t("ez-icon",{class:"leftIcon",iconName:this.leftIconName,size:this.getIconSize()}):t("slot",{name:"leftIcon",onSlotchange:o=>{this.handleSlotChange(o)}}),this.label,this.rightIconName?t("ez-icon",{class:"rightIcon",iconName:this.rightIconName,size:this.getIconSize()}):t("slot",{name:"rightIcon",onSlotchange:o=>{this.handleSlotChange(o)}})):t("button",{class:`${this.getButtonSize("")} ${this.isPressed?"pressed":""}`,type:this.type,disabled:"full"===this.isDisabled||!this.enabled,"aria-disabled":this.isDisabled&&!0===this.isDisabled,ref:o=>this._button=o},this.leftIconName?t("ez-icon",{class:"leftIcon",iconName:this.leftIconName,size:this.getIconSize()}):t("slot",{name:"leftIcon",onSlotchange:o=>{this.handleSlotChange(o)}}),this.label,this.rightIconName?t("ez-icon",{class:"rightIcon",iconName:this.rightIconName,size:this.getIconSize()}):t("slot",{name:"rightIcon",onSlotchange:o=>{this.handleSlotChange(o)}}),!this.suppressAnimation&&this.renderRipples()))())}get _element(){return r(this)}};i.style=":host{--ez-button--min-width:50px;--ez-button--width:auto;--ez-button--height:var(--space--42, 42px);--ez-button--padding-top:var(--space--0, 0px);--ez-button--padding-bottom:var(--space--0, 0px);--ez-button--padding-right:var(--space--12, 12px);--ez-button--padding-left:var(--space--12, 12px);--ez-button--icon--gap:var(--space--8, 8px);--ez-button--color:var(--color--ocean-green-600, #008561);--ez-button--label-icon--color:var(--color--ocean-green-500, #1A9171);--ez-button--label-icon--hover-color:var(--color--ocean-green-700, #00684C);--ez-button--label-icon--disabled-color:var(--color--gray-400);--ez-button--left-icon--color:var(--color--ocean-green-600, #008561);--ez-button--right-icon--color:var(--color--ocean-green-600, #008561);--ez-button--left-icon--hover-color:var(--color--ocean-green-600, #008561);--ez-button--right-icon--hover-color:var(--color--ocean-green-600, #008561);--ez-button--left-icon--disabled-color:var(--color--gray-300, #A4A5A7);--ez-button--right-icon--disabled-color:var(--color--gray-300, #A4A5A7);--ez-button--font-size:var(--font-size--default, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--font-weight--medium, 500);--ez-button--background-color:var(--color--gray-70, #ffffff);--ez-button--border-radius:var(--border--radius--24, 24px);--ez-button--border:1px solid var(--color--gray-90, #EAEAEA);--ez-button--hover--border:1px solid var(--color--gray-90, #EAEAEA);--ez-button--justify-content:center;--ez-button--hover-color:var(--color--ocean-green-600, #008561);--ez-button--hover--background-color:var(--color--gray-80, #F9F9F9);--ez-button--disabled-color:var(--color--gray-400, #77777A);--ez-button--disabled--background-color:var(--color--gray-80, #F9F9F9);--ez-button--disabled--border:1px solid var(--color--gray-200, #A4A5A7);--ez-button--disabled-icon-color:var(--color--gray-400, #D2D2D3);--ez-button--link-color:var(--color--ocean-green-600, #008561);--ez-button--link--hover-color:var(--color--primary-700, #1C1D22);--ez-button--link-disabled-color:var(--color--gray-400, #77777A);--ez-button--link--small--font-size:var(--font-size--small, 12px);--ez-button--link--medium--font-size:var(--font-size--default, 14px);--ez-button--link--large--font-size:var(--font-size--medium, 16px);display:flex;width:fit-content}:host(.ez-button--primary){--ez-button--color:var(--color--gray-70);--ez-button--background-color:var(--color--ocean-green-500);--ez-button--font-weight:var(--font-weight--regular);--ez-button--left-icon--color:var(--color--gray-70);--ez-button--right-icon--color:var(--color--gray-70);--ez-button--border:1px solid var(--color--ocean-green-500);--ez-button--hover-color:var(--color--gray-70);--ez-button--hover--background-color:var(--color--ocean-green-700);--ez-button--hover--border:1px solid var(--color--ocean-green-700);--ez-button--left-icon--hover-color:var(--color--gray-70);--ez-button--right-icon--hover-color:var(--color--gray-70);--ez-button--disabled-color:var(--color--gray-70);--ez-button--disabled--background-color:var(--color--gray-400);--ez-button--disabled--border:1px solid var(--color--gray-400);--ez-button--disabled-icon-color:var(--color--gray-200);--ez-button--left-icon--disabled-color:var(--color--gray-200);--ez-button--right-icon--disabled-color:var(--color--gray-200)}:host(.ez-button--secondary){--ez-button--color:var(--color--ocean-green-600);--ez-button--background-color:var(--color--gray-70);--ez-button--border:1px solid var(--color--gray-90);--ez-button--left-icon--color:var(--color--ocean-green-600);--ez-button--right-icon--color:var(--color--ocean-green-600);--ez-button--hover-color:var(--color--ocean-green-600);--ez-button--hover--background-color:var(--color--gray-80);--ez-button--hover--border:1px solid var(--color--gray-90);--ez-button--left-icon--hover-color:var(--color--ocean-green-600);--ez-button--right-icon--hover-color:var(--color--ocean-green-600);--ez-button--disabled-color:var(--color--gray-400);--ez-button--disabled--background-color:var(--color--gray-80);--ez-button--disabled--border:1px solid var(--color--gray-200);--ez-button--disabled-icon-color:var(--color--gray-400);--ez-button--left-icon--disabled-color:var(--color--gray-300);--ez-button--right-icon--disabled-color:var(--color--gray-300)}:host(.ez-button--tertiary){--ez-button--color:var(--color--ocean-green-600);--ez-button--background-color:transparent;--ez-button--font-weight:var(--font-weight--regular);--ez-button--border:none;--ez-button--left-icon--color:var(--color--ocean-green-600);--ez-button--right-icon--color:var(--color--ocean-green-600);--ez-button--hover-color:var(--color--ocean-green-800);--ez-button--hover--background-color:transparent;--ez-button--hover--border:none;--ez-button--left-icon--hover-color:var(--color--ocean-green-800);--ez-button--right-icon--hover-color:var(--color--ocean-green-800);--ez-button--disabled-color:var(--color--gray-400);--ez-button--disabled--background-color:transparent;--ez-button--disabled--border:transparent;--ez-button--disabled-icon-color:var(--color--gray-200);--ez-button--left-icon--disabled-color:var(--color--gray-200);--ez-button--right-icon--disabled-color:var(--color--gray-200)}:host(.ez-button--link--primary){color:var(--color--primary);fill:var(--color--primary)}button{position:relative;display:flex;align-items:center;outline:0;border:0;margin:0;padding:0;cursor:pointer;transition:background-color 0.2s linear, transform 0.15s ease;white-space:nowrap;box-sizing:border-box;overflow:hidden;transform:scale(1);min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);gap:var(--ez-button--icon--gap);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button.pressed{transform:scale(0.98)}button.btn-icon{transition:background-color 0.2s linear, transform 0.15s ease;transform:scale(1)}button.btn-icon.pressed{transform:scale(0.95)}button:disabled,button[aria-disabled]{transform:scale(1) !important}.ripple{position:absolute;width:20px;height:20px;border-radius:50%;background:rgba(255, 255, 255, 0.3);pointer-events:none;transform:scale(0);animation:ripple-animation 0.6s linear;z-index:0}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}:host .ripple,:host(.ez-button--secondary) .ripple{background:rgba(0, 133, 97, 0.2)}:host(.ez-button--primary) .ripple{background:rgba(255, 255, 255, 0.3)}:host(.ez-button--tertiary) .ripple{background:rgba(0, 133, 97, 0.15)}button>*:not(.ripple){position:relative;z-index:1}button:disabled .ripple,button[aria-disabled] .ripple{display:none}button:hover{background-color:var(--ez-button--hover--background-color);border:var(--ez-button--hover--border);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button[aria-disabled]:active,button:disabled:active,button[aria-disabled]:hover,button:disabled:hover,button[aria-disabled],button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);--ez-icon--color:var(--ez-button--disabled-icon-color);--ez-button--left-icon--color:var(--ez-button--left-icon--disabled-color);--ez-button--right-icon--color:var(--ez-button--right-icon--disabled-color);cursor:no-drop;border:var(--ez-button--disabled--border)}button[aria-disabled].force-focus-visible,button[aria-disabled]:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--petroleum-100)}button ez-icon{--ez-icon--color:inherit}button ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--color)}button ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--color)}button:hover ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--hover-color)}button:hover ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--hover-color)}button:disabled:hover ez-icon.leftIcon,button[aria-disabled]:hover ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--disabled-color)}button:disabled:hover ez-icon.rightIcon,button[aria-disabled]:hover ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--disabled-color)}button.x-small{height:28px;--ez-button--font-size:var(--text--small, 12px)}button.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}button.medium{height:42px}button.large{height:46px}button.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--x-small{width:28px;min-width:28px;height:28px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--label-icon--color)}.label-icon:hover{color:var(--ez-button--label-icon--hover-color);fill:var(--ez-button--label-icon--hover-color)}.label-icon .disabled{color:var(--ez-button--label-icon--disabled-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button[aria-disabled]+label,button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--label-icon--disabled-color);cursor:no-drop}button.force-focus-visible,button:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--ocean-green-200)}div.label-icon{cursor:pointer}div.label-icon button[aria-disabled],div.label-icon button:disabled{cursor:no-drop}a{outline:0;border:0;margin:0;border-radius:0;padding:0;margin:0;padding-inline:var(--space--8);font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:var(--ez-button--border-radius);gap:var(--ez-button--icon--gap)}a ez-icon{--ez-icon--color:var(--ez-button--link--color)}a:hover{color:var(--ez-button--link--hover-color);--ez-icon--color:var(--ez-button--link--hover-color)}a:hover ez-icon{--ez-icon--color:var(--ez-button--link--hover-color)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}a.disabled ez-icon{--ez-icon--color:var(--ez-button--link-disabled-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}a.force-focus-visible,a:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--ocean-green-200)}a.disabled.force-focus-visible,a.disabled:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--petroleum-100)}";export{i as ez_button}
|
|
1
|
+
import{r as o,h as t,H as e,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as n}from"@sankhyalabs/core";const i=class{constructor(t){o(this,t),this.createRipple=o=>{const t=this._button;if(!t||this.isDisabled||!this.enabled)return;const e=t.getBoundingClientRect();let r,n;o instanceof MouseEvent?(r=o.clientX,n=o.clientY):(r=o.touches[0].clientX,n=o.touches[0].clientY);const i={x:r-e.left,y:n-e.top,id:Date.now()};this.ripples=[...this.ripples,i],this.isPressed=!0,setTimeout((()=>{this.isPressed=!1}),150),setTimeout((()=>{this.ripples=this.ripples.filter((o=>o.id!==i.id))}),600)},this.ripples=[],this.isPressed=!1,this.label=void 0,this.enabled=!0,this.isDisabled=!1,this.mode="regular",this.image=void 0,this.iconName=void 0,this.size="medium",this.variant=void 0,this.type="button",this.leftIconName=void 0,this.rightIconName=void 0,this.suppressAnimation=!1}async setFocus(){this._button.focus(),this._button.classList.add("force-focus-visible")}async setBlur(){this._button.blur()}onMouseDown(o){this.createRipple(o)}onTouchStart(o){this.createRipple(o)}clickListener(o){(!this.enabled||!0===this.isDisabled||""===this.isDisabled||"full"===this.isDisabled)&&o.stopImmediatePropagation()}removeForcedFocusVisible(){var o;null===(o=this._button)||void 0===o||o.classList.remove("force-focus-visible")}connectedCallback(){var o,t;null===(o=this._button)||void 0===o||o.removeEventListener("blur",this.removeForcedFocusVisible.bind(this)),null===(t=this._button)||void 0===t||t.addEventListener("blur",this.removeForcedFocusVisible.bind(this))}componentDidLoad(){var o;this._element&&n.addIDInfo(this._element),this._button&&n.addIDInfo(this._button,"button",{id:"embedded"}),null===(o=this._button)||void 0===o||o.addEventListener("blur",this.removeForcedFocusVisible.bind(this))}disconnectCallback(){var o;null===(o=this._button)||void 0===o||o.removeEventListener("blur",this.removeForcedFocusVisible.bind(this))}getButtonSize(o="medium"){const t=this.size&&this.size.toLowerCase();return["x-small","small","medium","large"].includes(t)?t:o}getButtonSizeClass(){return this.getButtonSize()?`btn-icon--${this.getButtonSize()}`:""}getIconSize(){return"x-small"===this.size?"small":this.size}handleSlotChange(o){const t=o.target.assignedElements()[0];t&&("link"==this.mode?t.style.display="inline":t.style.setProperty("--ez-icon--color","var(--ez-icon--color)"))}renderRipples(){return this.ripples.map((o=>t("span",{key:o.id,class:"ripple",style:{left:o.x-10+"px",top:o.y-10+"px"}})))}render(){return t(e,{class:this.variant?`ez-button--${this.variant}`:""},(()=>"icon"==this.mode?t("button",{class:`btn-icon ${this.getButtonSizeClass()} ${this.isPressed?"pressed":""}`,type:this.type,disabled:"full"===this.isDisabled||!this.enabled,"aria-disabled":this.isDisabled&&!0===this.isDisabled,ref:o=>this._button=o},t("ez-icon",{class:"icon",href:this.image,iconName:this.iconName,size:this.getIconSize()}),!this.suppressAnimation&&this.renderRipples()):"label-icon"==this.mode?t("div",{class:"label-icon "+("full"!==this.isDisabled&&""!==this.isDisabled&&!0!==this.isDisabled&&this.enabled?"":"disabled")},t("button",{class:`btn-icon ${this.getButtonSizeClass()} ${this.isPressed?"pressed":""}`,type:this.type,disabled:"full"===this.isDisabled||!this.enabled,"aria-disabled":this.isDisabled&&!0===this.isDisabled,ref:o=>this._button=o},t("ez-icon",{class:"icon",href:this.image,iconName:this.iconName,size:this.getIconSize()}),!this.suppressAnimation&&this.renderRipples()),t("label",{title:this.label},this.label)):"link"==this.mode?t("a",{class:`${this.getIconSize()} ${"full"!==this.isDisabled&&""!==this.isDisabled&&!0!==this.isDisabled&&this.enabled?"":"disabled"}`,tabIndex:0,ref:o=>this._button=o},this.leftIconName?t("ez-icon",{class:"leftIcon",iconName:this.leftIconName,size:this.getIconSize()}):t("slot",{name:"leftIcon",onSlotchange:o=>{this.handleSlotChange(o)}}),this.label,this.rightIconName?t("ez-icon",{class:"rightIcon",iconName:this.rightIconName,size:this.getIconSize()}):t("slot",{name:"rightIcon",onSlotchange:o=>{this.handleSlotChange(o)}})):t("button",{class:`${this.getButtonSize("")} ${this.isPressed?"pressed":""}`,type:this.type,disabled:"full"===this.isDisabled||!this.enabled,"aria-disabled":this.isDisabled&&!0===this.isDisabled,ref:o=>this._button=o},this.leftIconName?t("ez-icon",{class:"leftIcon",iconName:this.leftIconName,size:this.getIconSize()}):t("slot",{name:"leftIcon",onSlotchange:o=>{this.handleSlotChange(o)}}),this.label,this.rightIconName?t("ez-icon",{class:"rightIcon",iconName:this.rightIconName,size:this.getIconSize()}):t("slot",{name:"rightIcon",onSlotchange:o=>{this.handleSlotChange(o)}}),!this.suppressAnimation&&this.renderRipples()))())}get _element(){return r(this)}};i.style=":host{--ez-button--min-width:50px;--ez-button--width:auto;--ez-button--height:var(--space--42, 42px);--ez-button--padding-top:var(--space--0, 0px);--ez-button--padding-bottom:var(--space--0, 0px);--ez-button--padding-right:var(--space--12, 12px);--ez-button--padding-left:var(--space--12, 12px);--ez-button--icon--gap:var(--space--8, 8px);--ez-button--color:var(--color--ocean-green-600, #008561);--ez-button--label-icon--color:var(--color--ocean-green-500, #1A9171);--ez-button--label-icon--hover-color:var(--color--ocean-green-700, #00684C);--ez-button--label-icon--disabled-color:var(--color--gray-400);--ez-button--left-icon--color:var(--color--ocean-green-600, #008561);--ez-button--right-icon--color:var(--color--ocean-green-600, #008561);--ez-button--left-icon--hover-color:var(--color--ocean-green-600, #008561);--ez-button--right-icon--hover-color:var(--color--ocean-green-600, #008561);--ez-button--left-icon--disabled-color:var(--color--gray-300, #A4A5A7);--ez-button--right-icon--disabled-color:var(--color--gray-300, #A4A5A7);--ez-button--font-size:var(--font-size--default, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--font-weight--medium, 500);--ez-button--background-color:var(--color--gray-70, #ffffff);--ez-button--border-radius:var(--border--radius--24, 24px);--ez-button--border:1px solid var(--color--gray-90, #EAEAEA);--ez-button--hover--border:1px solid var(--color--gray-90, #EAEAEA);--ez-button--justify-content:center;--ez-button--hover-color:var(--color--ocean-green-600, #008561);--ez-button--hover--background-color:var(--color--gray-80, #F9F9F9);--ez-button--disabled-color:var(--color--gray-400, #77777A);--ez-button--disabled--background-color:var(--color--gray-80, #F9F9F9);--ez-button--disabled--border:1px solid var(--color--gray-200, #A4A5A7);--ez-button--disabled-icon-color:var(--color--gray-400, #D2D2D3);--ez-button--link-color:var(--color--ocean-green-600, #008561);--ez-button--link--hover-color:var(--color--primary-700, #1C1D22);--ez-button--link-disabled-color:var(--color--gray-400, #77777A);--ez-button--link--small--font-size:var(--font-size--small, 12px);--ez-button--link--medium--font-size:var(--font-size--default, 14px);--ez-button--link--large--font-size:var(--font-size--medium, 16px);display:flex;width:fit-content}:host(.ez-button--primary){--ez-button--color:var(--color--gray-70);--ez-button--background-color:var(--color--ocean-green-500);--ez-button--font-weight:var(--font-weight--regular);--ez-button--left-icon--color:var(--color--gray-70);--ez-button--right-icon--color:var(--color--gray-70);--ez-button--border:1px solid var(--color--ocean-green-500);--ez-button--hover-color:var(--color--gray-70);--ez-button--hover--background-color:var(--color--ocean-green-700);--ez-button--hover--border:1px solid var(--color--ocean-green-700);--ez-button--left-icon--hover-color:var(--color--gray-70);--ez-button--right-icon--hover-color:var(--color--gray-70);--ez-button--disabled-color:var(--color--gray-70);--ez-button--disabled--background-color:var(--color--gray-400);--ez-button--disabled--border:1px solid var(--color--gray-400);--ez-button--disabled-icon-color:var(--color--gray-200);--ez-button--left-icon--disabled-color:var(--color--gray-200);--ez-button--right-icon--disabled-color:var(--color--gray-200)}:host(.ez-button--secondary){--ez-button--color:var(--color--ocean-green-600);--ez-button--background-color:var(--color--gray-70);--ez-button--border:1px solid var(--color--gray-90);--ez-button--left-icon--color:var(--color--ocean-green-600);--ez-button--right-icon--color:var(--color--ocean-green-600);--ez-button--hover-color:var(--color--ocean-green-600);--ez-button--hover--background-color:var(--color--gray-80);--ez-button--hover--border:1px solid var(--color--gray-90);--ez-button--left-icon--hover-color:var(--color--ocean-green-600);--ez-button--right-icon--hover-color:var(--color--ocean-green-600);--ez-button--disabled-color:var(--color--gray-400);--ez-button--disabled--background-color:var(--color--gray-80);--ez-button--disabled--border:1px solid var(--color--gray-200);--ez-button--disabled-icon-color:var(--color--gray-400);--ez-button--left-icon--disabled-color:var(--color--gray-300);--ez-button--right-icon--disabled-color:var(--color--gray-300)}:host(.ez-button--tertiary){--ez-button--color:var(--color--ocean-green-600);--ez-button--background-color:transparent;--ez-button--font-weight:var(--font-weight--regular);--ez-button--border:none;--ez-button--left-icon--color:var(--color--ocean-green-600);--ez-button--right-icon--color:var(--color--ocean-green-600);--ez-button--hover-color:var(--color--ocean-green-800);--ez-button--hover--background-color:transparent;--ez-button--hover--border:none;--ez-button--left-icon--hover-color:var(--color--ocean-green-800);--ez-button--right-icon--hover-color:var(--color--ocean-green-800);--ez-button--disabled-color:var(--color--gray-400);--ez-button--disabled--background-color:transparent;--ez-button--disabled--border:transparent;--ez-button--disabled-icon-color:var(--color--gray-200);--ez-button--left-icon--disabled-color:var(--color--gray-200);--ez-button--right-icon--disabled-color:var(--color--gray-200)}:host(.ez-button--link--primary){color:var(--color--primary);fill:var(--color--primary)}button{position:relative;display:flex;align-items:center;outline:0;border:0;margin:0;padding:0;cursor:pointer;transition:background-color 0.2s linear, transform 0.15s ease;white-space:nowrap;box-sizing:border-box;overflow:hidden;transform:scale(1);min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);gap:var(--ez-button--icon--gap);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button.pressed{transform:scale(0.98)}button.btn-icon{transition:background-color 0.2s linear, transform 0.15s ease;transform:scale(1)}button.btn-icon.pressed{transform:scale(0.95)}button:disabled,button[aria-disabled]{transform:scale(1) !important}.ripple{position:absolute;width:20px;height:20px;border-radius:50%;background:rgba(255, 255, 255, 0.3);pointer-events:none;transform:scale(0);animation:ripple-animation 0.6s linear;z-index:0}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}:host .ripple,:host(.ez-button--secondary) .ripple{background:rgba(0, 133, 97, 0.2)}:host(.ez-button--primary) .ripple{background:rgba(255, 255, 255, 0.3)}:host(.ez-button--tertiary) .ripple{background:rgba(0, 133, 97, 0.15)}button>*:not(.ripple){position:relative;z-index:1}button:disabled .ripple,button[aria-disabled] .ripple{display:none}button:hover{background-color:var(--ez-button--hover--background-color);border:var(--ez-button--hover--border);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button[aria-disabled]:active,button:disabled:active,button[aria-disabled]:hover,button:disabled:hover,button[aria-disabled],button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);--ez-icon--color:var(--ez-button--disabled-icon-color);--ez-button--left-icon--color:var(--ez-button--left-icon--disabled-color);--ez-button--right-icon--color:var(--ez-button--right-icon--disabled-color);cursor:no-drop;border:var(--ez-button--disabled--border)}button[aria-disabled].force-focus-visible,button[aria-disabled]:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--petroleum-100)}button ez-icon{--ez-icon--color:inherit}button ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--color)}button ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--color)}button:hover ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--hover-color)}button:hover ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--hover-color)}button:disabled:hover ez-icon.leftIcon,button[aria-disabled]:hover ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--disabled-color)}button:disabled:hover ez-icon.rightIcon,button[aria-disabled]:hover ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--disabled-color)}button.x-small{height:28px;--ez-button--font-size:var(--text--small, 12px)}button.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}button.medium{height:42px}button.large{height:46px}button.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--x-small{width:28px;min-width:28px;height:28px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--label-icon--color)}.label-icon:hover{color:var(--ez-button--label-icon--hover-color);fill:var(--ez-button--label-icon--hover-color)}.label-icon .disabled{color:var(--ez-button--label-icon--disabled-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button[aria-disabled]+label,button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--label-icon--disabled-color);cursor:no-drop}button.force-focus-visible,button:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--ocean-green-200)}div.label-icon{cursor:pointer}div.label-icon button[aria-disabled],div.label-icon button:disabled{cursor:no-drop}a{outline:0;border:0;margin:0;border-radius:0;padding:0;margin:0;padding-inline:var(--space--8);font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:var(--ez-button--border-radius);gap:var(--ez-button--icon--gap)}a ez-icon{--ez-icon--color:var(--ez-button--link--color)}a:hover{color:var(--ez-button--link--hover-color);--ez-icon--color:var(--ez-button--link--hover-color)}a:hover ez-icon{--ez-icon--color:var(--ez-button--link--hover-color)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}a.disabled ez-icon{--ez-icon--color:var(--ez-button--link-disabled-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}a.force-focus-visible,a:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--ocean-green-200)}a.disabled.force-focus-visible,a.disabled:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--petroleum-100)}";export{i as ez_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as a,h as i,H as t,g as s}from"./p-
|
|
1
|
+
import{r as e,c as a,h as i,H as t,g as s}from"./p-e4c7eb39.js";import{ElementIDUtils as r}from"@sankhyalabs/core";import{E as o}from"./p-98bb8b16.js";import{i as n}from"./p-42e1e733.js";var d,l,h;!function(e){e.FLOAT="float",e.FIXED="fixed"}(d||(d={})),function(e){e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg"}(l||(l={})),function(e){e.FLOAT="float",e.FIXED="fixed",e.DYNAMIC="dynamic"}(h||(h={}));const b=class{constructor(i){e(this,i),this.ezChangeMode=a(this,"ezChangeMode",7),this.handleToggleSidebar=()=>{this.open=!this.open},this.handleToggleMode=()=>{this.mode=this.mode===d.FIXED?d.FLOAT:d.FIXED,this.ezChangeMode.emit(this.mode)},this.type=h.DYNAMIC,this.mode=d.FLOAT,this.size=l.SMALL,this.isResponsive=!1,this.titleMenu="",this.showCollapseMenu=!0,this.showFixedButton=!0,this.open=!1}async changeModeMenu(){this.type===h.DYNAMIC&&this.handleToggleMode()}async closeSidebar(){this.open=!1}async openSidebar(){this.open=!0}async componentWillLoad(){this.i18n=await n()}componentDidLoad(){this.type===h.FIXED&&(this.mode=d.FIXED,this.open=!0)}render(){return r.addIDInfoIfNotExists(this._element),i(t,null,i("ez-sidebar-button",{class:this.open?"hidden":"",onEzClick:this.mode===d.FIXED?this.handleToggleSidebar:void 0,onMouseEnter:this.mode===d.FLOAT?this.handleToggleSidebar:void 0,"aria-controls":"navigator","aria-expanded":this.open,"data-element-id":r.getInternalIDInfo("openButton")}),this.open?i("aside",{tabIndex:-1,id:"navigator",class:`ez-col ez-col--sd-12 ez-col--tb-3 ez-sidebar-navigator ${this.mode===d.FLOAT?"dynamic":"fixed"} ${this.isResponsive?"responsive":this.size} ${this.open?"show":"hidden"}`,"data-element-id":r.getInternalIDInfo("sidebar"),onMouseLeave:this.type!==h.FIXED&&this.mode===d.FLOAT?this.handleToggleSidebar:void 0},i("header",{class:"ez-sidebar-navigator__header"},i("slot",{name:"start"}),""!==this.titleMenu&&i("div",{class:"ez-sidebar-navigator__title",title:this.titleMenu},this.titleMenu),!this.titleMenu&&i("slot",{name:"content"}),i("div",{class:"ez-sidebar-navigator__end"},i("slot",{name:"end"}),this.type===h.DYNAMIC&&this.showFixedButton&&i("ez-button",{onClick:this.handleToggleMode,mode:"icon",size:"small",iconName:this.mode===d.FIXED?"un-pin":"push-pin",title:this.i18n(this.mode===d.FIXED?"ez-sidebar.unPinMenu":"ez-sidebar.pushPinMenu"),"aria-label":this.i18n(this.mode===d.FIXED?"ez-sidebar.unPinMenu":"ez-sidebar.pushPinMenu"),"aria-controls":"navigator","data-element-id":r.getInternalIDInfo("pinButton")}),this.mode===d.FIXED&&this.showCollapseMenu&&i("ez-button",{onClick:this.handleToggleSidebar,class:"inverted",mode:"icon",size:"small",iconName:"show_menu",title:this.i18n("ez-sidebar.hideMenu"),"aria-label":this.i18n("ez-sidebar.hideMenu"),"aria-controls":"navigator","data-element-id":r.getInternalIDInfo("closeButton")}))),this.titleMenu&&i("slot",{name:"content"}),i("ez-scroller",{class:"ez-sidebar-navigator__content",direction:o.VERTICAL,activeShadow:!0},i("slot",null)),i("footer",{class:"ez-sidebar-navigator__footer"},i("slot",{name:"footer"}))):void 0)}get _element(){return s(this)}};b.style=':host{--ez-sidebar-navigator--padding-left:var(--space--xs, 12px);--ez-sidebar-navigator--padding-right:var(--space--xs, 12px);--ez-sidebar-navigator--gap:var(--space--xs, 12px);--ez-sidebar-navigator--box-shadow:var(--shadow, 0px 0px 24px 0px #000);--ez-sidebar-navigator--background-color:var(--color--inverted);--ez-sidebar-navigator--border-radius:0px var(--border--radius-medium) var(--border--radius-medium) 0px;--ez-sidebar-navigator--height:calc(100vh - var(--space--lg, 24px));--ez-sidebar-navigator--z-index:var(--elevation--20, 20);--ez-sidebar-navigator--header-gap:var(--space--xs, 12px);--ez-sidebar-navigator--footer-gap:var(--space--xs, 12px);--ez-ez-sidebar-navigator__title--font-family:var(--font-pattern, "Roboto");--ez-ez-sidebar-navigator__title--font-size:var(--title--medium, 16px);--ez-ez-sidebar-navigator__title--color:var(--title--primary, #2b3a54);--ez-ez-sidebar-navigator__title--font-weight:var(--text-weight--extra-large, 700)}.inverted{transform:rotate(180deg)}.ez-sidebar-navigator{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:var(--ez-sidebar-navigator--height);padding-top:var(--space--xs, 12px);padding-bottom:var(--space--xs, 12px);outline:none;gap:var(--ez-sidebar-navigator--gap);padding-left:var(--ez-sidebar-navigator--padding-left);padding-right:var(--ez-sidebar-navigator--padding-right);background-color:var(--ez-sidebar-navigator--background-color);-webkit-box-shadow:var(--ez-sidebar-navigator--box-shadow);box-shadow:var(--ez-sidebar-navigator--box-shadow);border-radius:var(--ez-sidebar-navigator--border-radius)}.ez-sidebar-navigator__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;justify-content:space-between;gap:var(--ez-sidebar-navigator--header-gap)}.ez-sidebar-navigator__content{height:100%}.ez-sidebar-navigator__footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--ez-sidebar-navigator--footer-gap)}.ez-sidebar-navigator__title{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--ez-ez-sidebar-navigator__title--font-family);font-size:var(--ez-ez-sidebar-navigator__title--font-size);font-weight:var(--ez-ez-sidebar-navigator__title--font-weight);color:var(--ez-ez-sidebar-navigator__title--color)}.ez-sidebar-navigator__end{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-left:auto;gap:var(--ez-sidebar-navigator--gap)}.dynamic{position:absolute;z-index:var(--ez-sidebar-navigator--z-index)}.fixed{position:relative}.hidden{display:none}.show{animation:fadeIn .1s ease-in-out 1}@keyframes fadeIn{from{transform:translate(-100%)}}.sm{width:240px}.md{width:280px}.lg{width:320px}@media screen and (max-width: 991px){.responsive{width:240px}}@media screen and (min-width: 992px){.responsive{width:280px}}@media screen and (min-width: 1200px){.responsive{width:320px}}';export{b as ez_sidebar_navigator}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as s}from"./p-
|
|
1
|
+
import{r as t,c as i,h as o,H as e,g as s}from"./p-e4c7eb39.js";import{c as r,f as h,s as n}from"./p-d2601b25.js";const a=class{constructor(o){t(this,o),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this.autoClose=!0,this.boxWidth="fit-content",this.opened=!1,this.overlayType="light",this.anchorElement=void 0,this.options={horizontalGap:0,verticalGap:0,fromRight:!1},this.useAnchorSize=!1,this.minWidth=150}observeOpened(t,i){t!==i&&(t?this.openPopover():this.hidePopover())}async updatePosition(t,i){this.updateOptionPosition(t,i),await this.updatePositionPopover()}async show(t,i){this.updateOptionPosition(t,i),this.opened=!0}async showUnder(t,i){i&&(this.options=i),this.anchorElement=t,this.opened=!0}async hide(){this.opened=!1}async setOptions(t){Object.assign(this.options,t)}async setAnchorElement(t){this.anchorElement=t}parseSizePixel(t,i){return t?"string"==typeof t?Number(t.replace("px","")):null!=t?t:0:null!=i?i:0}updateOptionPosition(t,i){Object.assign(this.options,{horizontalGap:this.parseSizePixel(i,this.options.horizontalGap),verticalGap:this.parseSizePixel(t,this.options.verticalGap)})}getElement(t){return"string"==typeof t?document.getElementById(t):t}getAnchorElement(){if(!this.anchorElement)return this._host;if(Array.isArray(this.anchorElement)){for(const t of this.anchorElement){const i=this.getElement(t);if(i)return i}return this._host}return this.getElement(this.anchorElement)}async updatePositionPopover(){if(!this._box||!this.opened)return;const t=this.getAnchorElement();await r(t,this._box,{placement:this.options.fromRight?"bottom-end":"bottom-start",middleware:[h(),n({padding:5})],strategy:"fixed"}).then((({x:t,y:i,placement:o})=>{const e=o.includes("bottom")?i+this.options.verticalGap:i-this.options.verticalGap,s=o.includes("start")?t+this.options.horizontalGap:t-this.options.horizontalGap;Object.assign(this._box.style,{top:`${e}px`,left:`${s}px`})}))}hidePopover(){this._box&&(this._box.style.display="",this.hideOverlay(),this.ezVisibilityChange.emit(!1))}async openPopover(){if(this._box&&this.opened){if(this._box.style.display="flex",this._box.style.visibility="hidden",this.useAnchorSize){const t=this.getAnchorElement().getBoundingClientRect().width;this._box.style.width=`${t<this.minWidth?this.minWidth:t}px`}await this.updatePositionPopover(),this.openOverlay(),this.ezVisibilityChange.emit(!0),this._box.style.visibility="visible"}}openOverlay(){this._overlay&&this._overlayIsActive&&(this._overlay.style.display="block")}hideOverlay(){this._overlay&&(this._overlay.style.display="none")}checkStatusOverlay(){return"none"!==this.overlayType||!("none"!==this.overlayType||!this.autoClose)}handlePositionUpdate(){this.opened&&this.updatePositionPopover()}componentWillLoad(){window.addEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.addEventListener("resize",this.handlePositionUpdate.bind(this),!0)}componentDidLoad(){this._overlayIsActive=this.checkStatusOverlay(),this._resizeObserver=new ResizeObserver(this.updatePositionPopover.bind(this)),this._resizeObserver.observe(this._box),this.openPopover()}disconnectedCallback(){window.removeEventListener("scroll",this.handlePositionUpdate.bind(this),!0),window.removeEventListener("resize",this.handlePositionUpdate.bind(this),!0),this._resizeObserver.disconnect()}render(){return o(e,null,o("div",{ref:t=>this._overlay=t,onClick:()=>this.hide(),class:`popover__overlay popover__overlay--${this.overlayType}`}),o("section",{ref:t=>this._box=t,class:{popover__box:!0,"popover__box--fit-content":"fit-content"===this.boxWidth,"popover__box--full-width":"fit-content"!==this.boxWidth}},o("slot",null)))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};a.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--elevation--100, 100);--ez-popover__box--overlay-z-index:var(--elevation--24, 24);position:relative;display:flex;user-select:none}.popover__overlay{display:none;position:fixed;padding:0;top:0px;left:0px;width:100%;height:100vh;box-sizing:border-box;z-index:var(--ez-popover__box--overlay-z-index)}.popover__overlay--light{background-color:rgba(var(--rgb-background--overlay), var(--opacity--bright))}.popover__overlay--medium{background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.popover__box{display:none;position:fixed;top:0;left:0;z-index:var(--ez-popover__box--z-index);flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:calc(100% - 10px)}";export{a as ez_popover_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i}from"./p-
|
|
1
|
+
import{r as t,h as e,H as i}from"./p-e4c7eb39.js";import"./p-ad5e263d.js";import{C as s}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"@sankhyalabs/core";import{i as a}from"./p-42e1e733.js";import"./p-5895e687.js";import"./p-47e4a8ce.js";const l=class{constructor(e){t(this,e),this.label=void 0,this.enableExpand=!0,this._expanded=!1,this.size=void 0,this.structural=!1}toggleExpandItem(){var t,e;this._expanded=!this._expanded,null===(e=null===(t=this.expandButtonRef.shadowRoot)||void 0===t?void 0:t.querySelector("button"))||void 0===e||e.blur()}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){s.applyVarsGrid(this._element,this._slot.children[0])}render(){return e(i,{class:`box_split-item ${this._expanded?"expanded__item":""} ${this.structural?"structural__item":"content__item"}`,ref:t=>this._element=t},e("div",{class:"ez-split-item--header"},e("slot",{name:"leftButtons"}),e("div",{class:"ez-split-item--header-title"},this.label&&e("h3",{class:"ez-text ez-text--primary ez-title ez-title--medium ez-margin--small",title:this.label},this.label)),e("div",{class:"ez-split-item--header-buttons"},e("slot",{name:"rightButtons"}),this.enableExpand&&e("ez-button",{ref:t=>this.expandButtonRef=t,size:"small",mode:"icon",iconName:"expand",class:"ez-button--tertiary",onClick:()=>this.toggleExpandItem(),title:this.i18n(this._expanded?"app.collapse":"app.expand")}))),e("div",{class:"ez-split-item--content grid_height-0",ref:t=>this._slot=t},e("slot",null)))}};l.style=".box_split-item{background-color:var(--background--xlight);width:100%;height:100%;border-radius:var(--border--radius-medium);box-shadow:var(--shadow--xsmall);flex-direction:column;overflow:hidden;display:flex;padding:var(--space--nano)}.box_split-item>.ez-split-item--content{overflow:auto}.expanded__item{position:absolute;z-index:var(--more-visible);top:0;left:0;width:100%;height:100%}.ez-split-item--header{display:flex;align-items:center;justify-content:space-between}.ez-split-item--header-title{flex:1;white-space:nowrap;overflow:hidden}.ez-split-item--header-title h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.ez-split-item--header-buttons{display:flex;align-items:center;max-height:20px}.ez-split-item--content{display:block;height:100%}h3.ez-margin--small{margin-left:var(--space--small)}.structural__item{background:none;box-shadow:none;padding:0;margin:0;border:0}.content__item{margin:var(--space--extra-small);width:calc(100% - 2*(var(--space--extra-small)));height:calc(100% - 2*(var(--space--extra-small)))}";export{l as ez_split_item}
|
|
@@ -1 +1 @@
|
|
|
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-ad5e263d.js";import{g as o}from"./p-42e1e733.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&&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-CLASSIC-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-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",A=240,p=(t,s,i)=>l("ez-search",{class:"ez-padding--medium",style:{"--ez-search--min-width":"240px"},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:s=>{window.dispatchEvent(new CustomEvent("ezCloseSplitButtonDropdown",{detail:{action:t,value:s.detail}})),requestAnimationFrame((()=>{i(s.detail)}))},ignoreLimitCharsToSearch:!0}),f=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,p as a,c as b,A as c,f}
|
|
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-ad5e263d.js";import{g as o}from"./p-42e1e733.js";import{h as l}from"./p-e4c7eb39.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&&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-CLASSIC-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName||"EZ-CLASSIC-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",A=240,p=(t,s,i)=>l("ez-search",{class:"ez-padding--medium",style:{"--ez-search--min-width":"240px"},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:s=>{window.dispatchEvent(new CustomEvent("ezCloseSplitButtonDropdown",{detail:{action:t,value:s.detail}})),requestAnimationFrame((()=>{i(s.detail)}))},ignoreLimitCharsToSearch:!0}),f=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,p as a,c as b,A as c,f}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as r}from"./p-e4c7eb39.js";import{ElementIDUtils as o,MaskFormatter as a}from"@sankhyalabs/core";class n{constructor(t){this.mask=t,this.maskChars={"#":t=>/\d/.test(t),U:t=>/[a-zA-Z]/.test(t),L:t=>/[a-zA-Z]/.test(t),A:t=>/[a-zA-Z0-9]/.test(t),Z:t=>/[a-zA-Z0-9]/.test(t),"?":t=>/[a-zA-Z]/.test(t),"*":()=>!0}}format(t){if(!t||!this.mask)return t;const i=this.removeIncompatibleChars(t);let s="",e=0,r=0;for(;r<this.mask.length&&e<i.length;){const t=this.mask[r],o=i[e];if("'"!==t){if(this.maskChars[t]){if(!this.maskChars[t](o)){e++;continue}s+="U"===t||"Z"===t?o.toUpperCase():"L"===t?o.toLowerCase():o,e++}else s+=t,o===t&&e++;r++}else r++,r<this.mask.length&&(s+=this.mask[r],r++)}return s}removeIncompatibleChars(t){let i="";for(let s=0;s<t.length;s++){const e=t[s];let r=!1;for(const t in this.maskChars)if(this.maskChars[t](e)){r=!0;break}if(!r)for(let t=0;t<this.mask.length;t++)if(this.mask[t]===e&&!this.maskChars[this.mask[t]]){r=!0;break}r&&(i+=e)}return i}removeMask(t){if(!t||!this.mask)return t;let i="",s=0,e=0;for(;s<t.length&&e<this.mask.length;){const r=this.mask[e],o=t[s];"'"!==r?(this.maskChars[r]?(this.maskChars[r](o)&&(i+=o),s++):o===r&&s++,e++):(e++,e<this.mask.length&&(o===this.mask[e]&&s++,e++))}for(;s<t.length;){const e=t[s];/[a-zA-Z0-9]/.test(e)&&(i+=e),s++}return i}getMask(){return this.mask}generatePlaceholder(){if(!this.mask)return"";let t="",i=0;for(;i<this.mask.length;){const s=this.mask[i];if("'"!==s){if(this.maskChars[s])switch(s){case"#":case"~":t+="0";break;case"U":case"L":case"?":case"A":t+="A";break;default:t+="_"}else t+=s;i++}else i++,i<this.mask.length&&(t+=this.mask[i],i++)}return t}}const c=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezBlur=i(this,"ezBlur",7),this.ezFocus=i(this,"ezFocus",7),this.iconClick=i(this,"iconClick",7),this._internalValueChange=!1,this.type="text",this.value=void 0,this.label=void 0,this.helpText=void 0,this.errorMessage=void 0,this.placeholder=void 0,this.enabled=!0,this.readonly=!1,this.required=!1,this.name=void 0,this.size="default",this.minlength=void 0,this.maxlength=void 0,this.leftIconName=void 0,this.rightIconName=void 0,this.rightIconTooltip=void 0,this.leftIconTooltip=void 0,this.state="default",this.leftIconClickable=!1,this.rightIconClickable=!1,this.mask=void 0,this.emitMaskedValue=!1}async setFocus(t){(null==t?void 0:t.selectText)&&this._inputElem.select(),(null==t?void 0:t.preventScroll)||this._inputElem.scrollIntoView({behavior:"smooth",block:"center"}),this._inputElem.focus({preventScroll:!0})}async setBlur(){this._inputElem.blur()}async syncValue(){if(this._internalValueChange)this._internalValueChange=!1;else if(this.value&&this._maskFormatter&&this._inputElem){const t=this._maskFormatter.format(this.value);this._inputElem.value=t}else this._inputElem&&(this._inputElem.value=this.value||"")}async observeErrorMessage(t){this.state=t&&""!==t.trim()?"error":"default"}onInput(t){try{const i=t.target,s=i.value;if(this._maskFormatter){const{formattedValue:t,cleanValue:e}=this.processInputWithMask(s);this.updateInputValue(i,t,e)}else this.updateInputValueWithoutMask(s)}catch(t){console.error("Error processing input event:",t)}}processInputWithMask(t){return"cgc_cpf"===this.mask?this.processCgcCpfMask(t):this.processRegularMask(t)}processCgcCpfMask(t){const i=t.replace(/\D/g,"");return 11===i.length||14===i.length?(this._maskFormatter=new n(11===i.length?a.DEFAULT_MASKS.cpf:a.DEFAULT_MASKS.cnpj),{formattedValue:this._maskFormatter.format(i),cleanValue:i}):{formattedValue:i,cleanValue:i}}processRegularMask(t){const i=this._maskFormatter.format(t);return{formattedValue:i,cleanValue:this._maskFormatter.removeMask(i)}}updateInputValue(t,i,s){t.value=i,this._internalValueChange=!0,this.value=s,this.ezChange.emit(this.emitMaskedValue?i:s)}updateInputValueWithoutMask(t){this._internalValueChange=!0,this.value=t,this.ezChange.emit(t)}onBlur(){this.ezBlur.emit(this.value)}onFocus(){this.ezFocus.emit(this.value)}handleIconClick(t,i){this.enabled&&("left"===i&&!this.leftIconClickable||"right"===i&&!this.rightIconClickable?this.setFocus({preventScroll:!0}):(t.stopPropagation(),this.iconClick.emit({icon:i})))}addInfoId(){this._element&&o.addIDInfo(this._element),this._inputElem&&o.addIDInfo(this._inputElem,"classic-input",{id:"embedded"})}buildPlaceholder(){!this.placeholder&&this._maskFormatter&&(this.placeholder=this._maskFormatter.generatePlaceholder())}buildMaskFormatter(){if(this.mask&&(!this._maskFormatter||"cgc_cpf"===this.mask)){const t=this.getMaskToBuilder();this._maskFormatter=t?new n(t):void 0}}getMaskToBuilder(){return"cgc_cpf"===this.mask?this.getCGCCpfMask():"phone"===this.mask?this.getPhoneMask():this.mask in a.DEFAULT_MASKS?a.DEFAULT_MASKS[this.mask]:this.mask}getPhoneMask(){return this.value&&10===this.value.length?n.DEFAULT_MASKS?n.DEFAULT_MASKS.phone:void 0:this.value&&11===this.value.length&&n.DEFAULT_MASKS?n.DEFAULT_MASKS.phone_mobile:void 0}getCGCCpfMask(){var t,i;return 11===(null===(t=this.value)||void 0===t?void 0:t.length)?a.DEFAULT_MASKS.cpf:14===(null===(i=this.value)||void 0===i?void 0:i.length)?a.DEFAULT_MASKS.cnpj:void 0}componentDidRender(){this.buildMaskFormatter(),this.buildPlaceholder(),this.syncValue()}componentDidLoad(){this.syncValue(),this.addInfoId()}render(){return s(e,null,s("label",{title:this.label,htmlFor:this.name},this.label,this.required&&s("span",{class:"required-indicator"},"*")),s("div",{class:"input-container "+(this.size?`input-container--${this.size}`:""),"data-state":this.state,"data-disabled":(!this.enabled).toString(),onClick:()=>this.setFocus({preventScroll:!0})},this.leftIconName&&s("ez-icon",{iconName:this.leftIconName,title:this.leftIconTooltip,onClick:t=>this.handleIconClick(t,"left"),class:{"icon-clickable":this.leftIconClickable}}),s("input",{ref:t=>this._inputElem=t,id:this.name,type:this.type,title:this.value,placeholder:this.placeholder,disabled:!this.enabled,readonly:this.readonly,name:this.name,minlength:this.minlength,maxlength:this.maxlength,onInput:t=>this.onInput(t),onBlur:this.onBlur.bind(this),onFocus:this.onFocus.bind(this)}),this.rightIconName&&s("ez-icon",{iconName:this.rightIconName,title:this.rightIconTooltip,onClick:t=>this.handleIconClick(t,"right"),class:{"icon-clickable":this.rightIconClickable}})),(this.helpText||this.errorMessage)&&s("span",{id:"input_helpText",title:this.errorMessage||this.helpText},this.errorMessage||this.helpText))}get _element(){return r(this)}static get watchers(){return{value:["syncValue"],errorMessage:["observeErrorMessage"]}}};c.style=':host{display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);border:none;padding:0;padding-inline:var(--space--2, 2px);width:100%;--ez-classic-input--label-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--border-color-default:var(--color--gray-200, #D2D2D3);--ez-classic-input--border-color-focus:var(--color--gray-300, #A4A5A7);--ez-classic-input--border-color-success:var(--color--green-600, #157A00);--ez-classic-input--border-color-error:var(--color--red-600, #BD0025);--ez-classic-input--border-color-warning:var(--color--yellow-600, #EFB103);--ez-classic-input--background-color:var(--color--gray-70, #FFFFFF);--ez-classic-input--background-color-disabled:var(--color--gray-90, #EAEAEA);--ez-classic-input--text-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--placeholder-color:#bdbdbd;--ez-classic-input--icon-color:var(--color--gray-400, #77777A);--ez-classic-input--helptext-color:var(--color--ocean-green-1000, #00281D);--ez-classic-input--height:var(--space--56, 56px);--ez-classic-input--height-small:var(--space--48, 48px);--ez-classic-input--height-xsmall:var(--space--40, 40px);--ez-classic-input--gap:var(--space--10, 10px);--ez-classic-input--padding-inline:var(--space--16, 16px)}.input-container{display:flex;flex-direction:row;align-items:center;width:100%;border:none;border-radius:var(--border--radius-8, 8px);padding-inline:var(--ez-classic-input--padding-inline);box-sizing:border-box;gap:var(--ez-classic-input--gap);margin-block:var(--space--4, 4px);transition:box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);height:var(--ez-classic-input--height);background-color:var(--ez-classic-input--background-color)}.input-container--small{height:var(--ez-classic-input--height-small)}.input-container--xsmall{height:var(--ez-classic-input--height-xsmall)}.input-container,.input-container[data-state="default"]{box-shadow:0 0 0 1px var(--ez-classic-input--border-color-default)}.input-container[data-state="success"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-success)}.input-container[data-state="error"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-error)}.input-container[data-state="warning"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-warning)}.input-container:focus-within{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-classic-input--border-color-focus)}ez-icon{min-width:var(--space--24, 24px);color:var(--ez-classic-input--icon-color)}input{flex:1;border:none;outline:none;background:transparent;height:100%;width:100%;padding:0;font-family:var(--font--pattern, Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);text-overflow:ellipsis;color:var(--ez-classic-input--text-color)}input::placeholder{color:var(--ez-classic-input--placeholder-color)}.input-container[data-disabled="true"]{cursor:not-allowed;background:var(--ez-classic-input--background-color-disabled);border-color:var(--ez-classic-input--border-color-default)}.input-container[data-disabled="true"]>*{cursor:not-allowed}.input-container input:read-only{cursor:default}@keyframes ez-helptext-fadein{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-classic-input--helptext-color)}label{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-classic-input--label-color)}.icon-clickable{cursor:pointer}.required-indicator{font-size:var(--font--size--default, 14px);font-family:var(--font--pattern, \'Roboto\');color:var(--color--red-600, #BD0025);margin-left:var(--space--4, 4px);vertical-align:top}';export{c as ez_classic_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,c as i,h as
|
|
1
|
+
import{r as l,c as i,h as e,g as o}from"./p-e4c7eb39.js";import{ElementIDUtils as t}from"@sankhyalabs/core";import{A as s}from"./p-ad5e263d.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as a}from"./p-42e1e733.js";import"./p-5895e687.js";import"./p-47e4a8ce.js";const r=class{constructor(e){l(this,e),this.ezChange=i(this,"ezChange",7),this.ezRemove=i(this,"ezRemove",7),this.ezSaveEditLabel=i(this,"ezSaveEditLabel",7),this.ezEditLabelMode=i(this,"ezEditLabelMode",7),this._activeEditText=!1,this.value=!1,this.boxBordered=!1,this.label=void 0,this.subtitle=void 0,this.headerSize="small",this.iconPlacement="left",this.headerAlign="left",this.removable=!1,this.editable=!1,this.conditionalSave=void 0}async showHide(){this.value=!this.value}async applyFocusTextEdit(){var l;null===(l=this._refTextEdit)||void 0===l||l.applyFocusSelect()}async cancelEdition(){this._activeEditText=!1,this.ezEditLabelMode.emit(this._activeEditText)}observeCollapsedValue(){this.ezChange.emit(this.value)}getHeaderSize(){const l=this.headerSize&&this.headerSize.toLowerCase(),i=["xsmall","xlarge"].includes(l)?l.replace("x","x-"):l;return["x-small","small","medium","large","x-large"].includes(i)?i:"small"}removeElement(){this._hostElement&&this._hostElement.remove(),this.ezRemove.emit(this)}editLabel(l){l.preventDefault(),l.stopPropagation(),this._activeEditText=!0,this.ezEditLabelMode.emit(this._activeEditText)}async confirmRemove(l){l.stopPropagation();const i=this.i18n("ez-collapsible-box.confirmRemove",{label:this.label});await s.confirm(this.i18n("app.warning"),i)&&this.removeElement()}saveEditionText(l){const{value:i,newValue:e}=l.detail;if(i===e)return void this.cancelEdition();let o=!0;this.conditionalSave&&(o=this.conditionalSave(e)),this.label!==e&&o&&(this.label=e,this._activeEditText=!1,this.ezSaveEditLabel.emit(l.detail),this.ezEditLabelMode.emit(this._activeEditText))}getStyledLabel(){if(null!=this._refLabel)return{fontSize:window.getComputedStyle(this._refLabel).getPropertyValue("font-size"),fontWeight:window.getComputedStyle(this._refLabel).getPropertyValue("font-weight"),fontFamily:window.getComputedStyle(this._refLabel).getPropertyValue("font-family")}}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){t.addIDInfo(this._hostElement)}render(){return e("div",{class:`collapsible-box ${this.boxBordered&&"collapsable-box--bordered"}`},e("div",{class:"collapsible-box__header"},e("button",Object.assign({},this._activeEditText?null:{onClick:()=>{this.showHide()}},{class:"collapsible-box__title collapsible-box__title--"+(this.headerAlign||"left")+("right"===this.iconPlacement?" collapsible-box__title--icon-right":"")+(this.value?" collapsible-box__title--no-margin":"")}),e("ez-icon",{slot:"icon","icon-name":"chevron-right",size:this.getHeaderSize(),class:"collapsible-box__icon collapsible-box__icon--"+this.getHeaderSize()+(this.value?" collapsible-box__icon--collapsed":""),id:"toggleCollapsible"}),this._activeEditText?e("ez-text-edit",{class:"collapsible-box__text-edit",ref:l=>this._refTextEdit=l,value:this.label,styled:this.getStyledLabel(),onSaveEdition:l=>this.saveEditionText(l),onCancelEdition:()=>this.cancelEdition()}):e("label",{class:"collapsible-box__label font--"+this.getHeaderSize(),title:this.label,ref:l=>this._refLabel=l},e("span",null,this.label),this.editable&&e("ez-icon",{slot:"icon","icon-name":"edit",onClick:l=>this.editLabel(l),title:this.i18n("app.edit")}),this.removable&&e("ez-icon",{slot:"icon","icon-name":"delete",onClick:l=>this.confirmRemove(l),title:this.i18n("app.remove")}))),e("slot",{name:"rightSlot"})),e("div",{class:"collapsible-box__content"+(this.value?"":" collapsible-box__content--show")},this.subtitle&&e("div",{class:"subtitle-box__content"},e("label",{class:"subtitle-box__label",title:this.subtitle},e("span",null,this.subtitle))),e("slot",null)))}get _hostElement(){return o(this)}static get watchers(){return{value:["observeCollapsedValue"]}}};r.style=":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--subtitle--font-size:var(--text--medium, 14px);--ez-collapsible-box--subtitle--font-family:var(--font-pattern, 'Roboto');--ez-collapsible-box--subtitle--font-weight:var(--text-weight--medium, 400);--ez-collapsible-box--subtitle--color:var(--text--primary);--ez-collapsible-box--subtitle--margin-bottom:var(--space--medium, 12px);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%;overflow:hidden}.collapsable-box--bordered{border:var(--border--small);border-color:var(--color--strokes);border-radius:var(--border--radius-medium);padding:var(--space--xs)}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:100%;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.subtitle-box__label{display:flex;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;font-family:var(--ez-collapsible-box--subtitle--font-family);font-size:var(--ez-collapsible-box--subtitle--font-size);font-weight:var(--ez-collapsible-box--subtitle--font-weight);color:var(--ez-collapsible-box--subtitle--color);margin-bottom:var(--ez-collapsible-box--subtitle--margin-bottom)}.subtitle-box__content{width:100%}.collapsible-box__label ez-icon{visibility:hidden;transition:2s all ease-in-out}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--left{margin-right:auto}.collapsible-box__title--right{margin-left:auto}.collapsible-box__title--center{margin-left:auto;margin-right:auto}.collapsible-box__title--stretch{justify-content:space-between;width:100%}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";export{r as ez_collapsible_box}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as n}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,g as n}from"./p-e4c7eb39.js";import{ArrayUtils as r}from"@sankhyalabs/core";import{i as o}from"./p-42e1e733.js";
|
|
2
2
|
/**!
|
|
3
3
|
* Sortable 1.15.7
|
|
4
4
|
* @author RubaXa <trash@rubaxa.org>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as a,c as l,g as n,H as i}from"./p-23a36bb6.js";import{ObjectUtils as t,StringUtils as o,UserInterface as r,ElementIDUtils as s}from"@sankhyalabs/core";import{F as d}from"./p-47e4a8ce.js";import{C as c}from"./p-b853763b.js";import{g as m}from"./p-42e1e733.js";function u(a,l,n,i,t,o){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-top--medium ez-padding-bottom--medium ez-size-height--full "+((null==o?void 0:o.formLayout)===d.CLASSIC_CASCADE||(null==o?void 0:o.formLayout)===d.CLASSIC_SIDE_BY_SIDE?"ez-margin-top--small":"")},e("ez-check",{enabled:!n,label:l,mode:t?c.SWITCH:c.REGULAR,"data-field-name":a,"data-context-name":i,key:a}))}function p(a,l,n,i,t,o,r,s,c,m){var u;return e("div",{class:"ez-col ez-col--sd-12"},(null==m?void 0:m.formLayout)===d.CLASSIC_CASCADE||(null==m?void 0:m.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-number-input",{class:"ez-input__no-margin",enabled:!n,label:l,precision:i,prettyPrecision:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:r,size:null!==(u=null==m?void 0:m.size)&&void 0!==u?u:"small",required:c}):e("ez-number-input",{class:"ez-input__no-margin",enabled:!n,label:l,precision:i,prettyPrecision:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:r}))}const v=({name:a,label:l,readOnly:n,contextName:i,canShowError:t,props:o,required:r},s)=>{var c;return e("div",{class:"ez-col ez-col--sd-12"},(null==s?void 0:s.formLayout)===d.CLASSIC_CASCADE||(null==s?void 0:s.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-input",{class:"ez-input__no-margin",label:l,"data-field-name":a,"data-context-name":i,key:a,enabled:!n,mask:null==o?void 0:o.mask,"clean-value-mask":null==o?void 0:o.cleanValueMask,size:null!==(c=null==s?void 0:s.size)&&void 0!==c?c:"small",required:r}):e("ez-text-input",{class:"ez-input__no-margin",label:l,"data-field-name":a,"data-context-name":i,key:a,enabled:!n,canShowError:t,mask:null==o?void 0:o.mask,"clean-value-mask":null==o?void 0:o.cleanValueMask}))},h=new Map;h.set(r.CHECKBOX,((e,a)=>u(e.name,e.label,e.readOnly,e.contextName,!1,a))),h.set(r.SWITCH,((e,a)=>u(e.name,e.label,e.readOnly,e.contextName,!0,a))),h.set(r.OPTIONSELECTOR,(({name:a,label:l,readOnly:n,required:i,props:t,contextName:o,canShowError:r},s)=>{var c;const m=(null==s?void 0:s.formLayout)===d.CLASSIC_CASCADE||(null==s?void 0:s.formLayout)===d.CLASSIC_SIDE_BY_SIDE,u=null==t?void 0:t.options;let p;if("string"==typeof u){const e=JSON.parse(u);p=Object.keys(e).map((a=>({value:a,label:e[a]})))}else p=u;return e("div",{class:"ez-col ez-col--sd-12"},m?e("ez-classic-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":o,key:a,options:p,size:null!==(c=null==s?void 0:s.size)&&void 0!==c?c:"small",required:i}):e("ez-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":o,key:a,options:p,canShowError:r}))})),h.set(r.DATE,(({name:a,label:l,readOnly:n,canShowError:i,required:t},o)=>{var r;return e("div",{class:"ez-col ez-col--sd-12"},(null==o?void 0:o.formLayout)===d.CLASSIC_CASCADE||(null==o?void 0:o.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-date-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,size:null!==(r=null==o?void 0:o.size)&&void 0!==r?r:"small",required:t}):e("ez-date-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i}))})),h.set(r.TIME,(({name:a,label:l,readOnly:n,canShowError:i,props:t,required:o},r)=>{var s,c,m;return e("div",{class:"ez-col ez-col--sd-12"},(null==r?void 0:r.formLayout)===d.CLASSIC_CASCADE||(null==r?void 0:r.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,"show-seconds":null!==(s=null==t?void 0:t.showSeconds)&&void 0!==s&&s,size:null!==(c=null==r?void 0:r.size)&&void 0!==c?c:"small",required:o}):e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,"show-seconds":null!==(m=null==t?void 0:t.showSeconds)&&void 0!==m&&m}))})),h.set(r.ELAPSEDTIME,(({name:a,label:l,readOnly:n,canShowError:i,required:t},o)=>{var r;return e("div",{class:"ez-col ez-col--sd-12"},(null==o?void 0:o.formLayout)===d.CLASSIC_CASCADE||(null==o?void 0:o.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,showSeconds:!0,size:null!==(r=null==o?void 0:o.size)&&void 0!==r?r:"small",required:t}):e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,showSeconds:!0}))})),h.set(r.DATETIME,(({name:a,label:l,readOnly:n,contextName:i,canShowError:t,required:o},r)=>{var s;return e("div",{class:"ez-col ez-col--sd-12"},(null==r?void 0:r.formLayout)===d.CLASSIC_CASCADE||(null==r?void 0:r.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t,size:null!==(s=null==r?void 0:r.size)&&void 0!==s?s:"small",required:o}):e("ez-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t}))})),h.set(r.FILE,(({name:a,label:l,readOnly:n,contextName:i,props:o})=>{const r=t.removeEmptyValues({subTitle:o.subTitle,requestHeaders:Object.assign(Object.assign({},o.STORAGESTRATEGY&&{STORAGESTRATEGY:o.STORAGESTRATEGY}),o.INTERNAL_FILENAME&&{INTERNAL_FILENAME:o.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12"},e("ez-upload",Object.assign({enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a},r)))})),h.set(r.DECIMALNUMBER,(({name:e,label:a,readOnly:l,props:n,contextName:i,canShowError:t,required:o},r)=>{var s,d;const c=Number(null!==(s=null==n?void 0:n.precision)&&void 0!==s?s:2);return p(e,a,l,c,Number(null!==(d=null==n?void 0:n.prettyPrecision)&&void 0!==d?d:c),i,t,0,o,r)})),h.set(r.INTEGERNUMBER,(({name:e,label:a,readOnly:l,contextName:n,canShowError:i,props:t,required:o},r)=>p(e,a,l,0,0,n,i,0,o,r))),h.set(r.SEARCH,(({name:a,label:l,readOnly:n,required:i,contextName:t,canShowError:r,optionLoader:s,props:c},m)=>{var u,p,v;const h=!o.isEmpty(null==c?void 0:c.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},(null==m?void 0:m.formLayout)===d.CLASSIC_CASCADE||(null==m?void 0:m.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":t,key:a,canShowError:r,optionLoader:s,ignoreLimitCharsToSearch:null!==(u=null==c?void 0:c.ignoreLimitCharsToSearch)&&void 0!==u&&u,hideDescriptionInput:!h,size:null!==(p=null==m?void 0:m.size)&&void 0!==p?p:"small",required:i}):e("ez-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":t,key:a,canShowError:r,optionLoader:s,ignoreLimitCharsToSearch:null!==(v=null==c?void 0:c.ignoreLimitCharsToSearch)&&void 0!==v&&v,hideDescriptionInput:!h}))})),h.set(r.SEARCHPLUS,(({name:a,label:l,readOnly:n,contextName:i,canShowError:t,optionLoader:r,props:s,required:c},m)=>{var u;const p=(null==m?void 0:m.formLayout)===d.CLASSIC_CASCADE||(null==m?void 0:m.formLayout)===d.CLASSIC_SIDE_BY_SIDE,v=!o.isEmpty(null==s?void 0:s.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},p?e("ez-classic-search-plus",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t,optionLoader:r,hideDescriptionInput:!v,size:null!==(u=null==m?void 0:m.size)&&void 0!==u?u:"small",required:c}):e("ez-search-plus",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t,optionLoader:r,hideDescriptionInput:!v}))})),h.set(r.LONGTEXT,(({name:a,label:l,readOnly:n,rows:i,contextName:t,canShowError:o},r)=>e("div",{class:"ez-col ez-col--sd-12",key:a},(null==r?void 0:r.formLayout)===d.CLASSIC_CASCADE||(null==r?void 0:r.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-text-area",{enabled:!n,label:l,"data-field-name":a,"data-context-name":t,rows:i}):e("ez-text-area",{enabled:!n,label:l,"data-field-name":a,"data-context-name":t,rows:i,canShowError:o})))),h.set(r.HTML,(({name:a,label:l,readOnly:n,contextName:i,rows:t,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-rich-text",{key:a,enabled:!n,label:l,"data-field-name":a,"data-context-name":i,rows:t,canShowError:o})))),h.set(r.IMAGE,(({name:a,label:l,readOnly:n,contextName:i,props:t})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-image-input",Object.assign({enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,maxFileSize:1/0},t)))));const z=(e,a=new Map,l)=>{const n=m(),i=(null==l?void 0:l.formLayout)===d.CLASSIC_CASCADE||(null==l?void 0:l.formLayout)===d.CLASSIC_SIDE_BY_SIDE,t=a.get(e.userInterface)||h.get(e.userInterface)||v,o=!i&&e.required?`${e.label}${n("app.requiredInfo")}`:e.label,r=t(Object.assign(Object.assign({},e),{label:o}),l);return r.l["data-form-item"]=e.name,r};class w{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small","ez-margin-top--auto","ez-margin-bottom--extra-small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class b{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new w(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const f=class{constructor(e){a(this,e),this.ezContentReady=l(this,"ezContentReady",7),this.formItemsReady=l(this,"formItemsReady",7),this.MAIN_GROUP_NAME="__main",this._customEditors=new Map,this.fields=void 0,this.selectedRecord=void 0,this.singleColumn=!1,this.formLayout=void 0,this.customUiBuilders=new Map}async showUp(){this.singleColumn||this._element.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(e,a,l){const n=new Map(this._customEditors);n.set(e,{customEditor:a,detailContext:l}),this._customEditors=n}async setFieldProp(e,a,l){const n=this.fields.map((n=>(n.name!==e||!l&&0!==l||(n.props=n.props||{},n.props[a]=l),n)));this.fields=[...n]}getGroupByField(e){var a,l;const n=null!==(a=e.group)&&void 0!==a?a:null===(l=e.props)||void 0===l?void 0:l.UITabName;if(n&&n!==this.MAIN_GROUP_NAME)return n}groupFields(e){const a=new Map;return e.forEach((e=>{const l=this.getGroupByField(e);if(l){let n=a.get(l);null==n&&(n=[],a.set(l,n)),n.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this._formElements=Array.from(this._element.querySelectorAll("[data-field-name]")),this.ezContentReady.emit(this._formElements);const e=new b(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[r.FILE,r.LONGTEXT,r.HTML].includes(e)}buildFormItemElement(a,l=""){var n;this.isItemFullWidth(a.userInterface)&&(l+=` input-full_width ${this.singleColumn&&"single-column"}`);const i={formLayout:this.formLayout,size:"xsmall"};if(this._customEditors.has(a.name)){const t=null===(n=this._formElements.map((e=>({name:e.dataset.fieldName,value:e.value}))).find((e=>e.name===a.name)))||void 0===n?void 0:n.value,o=this._customEditors.get(a.name).customEditor;return e("div",{class:l},e("ez-custom-form-input",{"data-field-name":a.name,customEditor:o,formViewField:a,builderFallback:e=>z(e,this.customUiBuilders,i),value:t,selectedRecord:this.selectedRecord}))}return e("div",{class:l},z(a,this.customUiBuilders,i))}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],l=Array.from(this.groupFields(this.fields).entries()).map((([l,n])=>{if(Array.isArray(n))return e("ez-collapsible-box",{id:`group-${l}`,label:l,"header-size":"large",key:l},e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n.map((e=>this.buildFormItemElement(e)))));a.push(n)})),n=a.map((e=>this.buildFormItemElement(e))),t=e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n);return e(i,null,t,l)}get _element(){return n(this)}};f.style=".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:250px;--ez-form-view__long-item--min-width:530px;--ez-form-view__item--max-width:512px;--ez-form-view__long-item--max-width:100%;--ez-form-view__item--gap:var(--space--14, 14px);--ez-form-view__item--padding:var(--space--small)}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--gap);padding-inline:var(--ez-form-view__item--padding);width:100%}.form-view__content--single-column.sc-ez-form-view{grid-template-columns:1fr}.form-view__content--single-column.sc-ez-form-view>div.sc-ez-form-view:not(.input-full_width){width:clamp(var(--ez-form-view__item--min-width), 70%, var(--ez-form-view__item--max-width))}.input-full_width.sc-ez-form-view{grid-column:1/-1;width:clamp(var(--ez-form-view__long-item--min-width), 100%, var(--ez-form-view__long-item--max-width))}.single-column.sc-ez-form-view{--ez-form-view__long-item--max-width:1024px}*.sc-ez-form-view:has(*)+ez-collapsible-box.sc-ez-form-view{margin-top:var(--space--16, 16px)}";export{f as ez_form_view}
|
|
1
|
+
import{h as e,r as a,c as l,g as n,H as i}from"./p-e4c7eb39.js";import{ObjectUtils as t,StringUtils as o,UserInterface as r,ElementIDUtils as s}from"@sankhyalabs/core";import{F as d}from"./p-47e4a8ce.js";import{C as c}from"./p-b853763b.js";import{g as m}from"./p-42e1e733.js";function u(a,l,n,i,t,o){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-top--medium ez-padding-bottom--medium ez-size-height--full "+((null==o?void 0:o.formLayout)===d.CLASSIC_CASCADE||(null==o?void 0:o.formLayout)===d.CLASSIC_SIDE_BY_SIDE?"ez-margin-top--small":"")},e("ez-check",{enabled:!n,label:l,mode:t?c.SWITCH:c.REGULAR,"data-field-name":a,"data-context-name":i,key:a}))}function p(a,l,n,i,t,o,r,s,c,m){var u;return e("div",{class:"ez-col ez-col--sd-12"},(null==m?void 0:m.formLayout)===d.CLASSIC_CASCADE||(null==m?void 0:m.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-number-input",{class:"ez-input__no-margin",enabled:!n,label:l,precision:i,prettyPrecision:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:r,size:null!==(u=null==m?void 0:m.size)&&void 0!==u?u:"small",required:c}):e("ez-number-input",{class:"ez-input__no-margin",enabled:!n,label:l,precision:i,prettyPrecision:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:r}))}const v=({name:a,label:l,readOnly:n,contextName:i,canShowError:t,props:o,required:r},s)=>{var c;return e("div",{class:"ez-col ez-col--sd-12"},(null==s?void 0:s.formLayout)===d.CLASSIC_CASCADE||(null==s?void 0:s.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-input",{class:"ez-input__no-margin",label:l,"data-field-name":a,"data-context-name":i,key:a,enabled:!n,mask:null==o?void 0:o.mask,"clean-value-mask":null==o?void 0:o.cleanValueMask,size:null!==(c=null==s?void 0:s.size)&&void 0!==c?c:"small",required:r}):e("ez-text-input",{class:"ez-input__no-margin",label:l,"data-field-name":a,"data-context-name":i,key:a,enabled:!n,canShowError:t,mask:null==o?void 0:o.mask,"clean-value-mask":null==o?void 0:o.cleanValueMask}))},h=new Map;h.set(r.CHECKBOX,((e,a)=>u(e.name,e.label,e.readOnly,e.contextName,!1,a))),h.set(r.SWITCH,((e,a)=>u(e.name,e.label,e.readOnly,e.contextName,!0,a))),h.set(r.OPTIONSELECTOR,(({name:a,label:l,readOnly:n,required:i,props:t,contextName:o,canShowError:r},s)=>{var c;const m=(null==s?void 0:s.formLayout)===d.CLASSIC_CASCADE||(null==s?void 0:s.formLayout)===d.CLASSIC_SIDE_BY_SIDE,u=null==t?void 0:t.options;let p;if("string"==typeof u){const e=JSON.parse(u);p=Object.keys(e).map((a=>({value:a,label:e[a]})))}else p=u;return e("div",{class:"ez-col ez-col--sd-12"},m?e("ez-classic-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":o,key:a,options:p,size:null!==(c=null==s?void 0:s.size)&&void 0!==c?c:"small",required:i}):e("ez-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":o,key:a,options:p,canShowError:r}))})),h.set(r.DATE,(({name:a,label:l,readOnly:n,canShowError:i,required:t},o)=>{var r;return e("div",{class:"ez-col ez-col--sd-12"},(null==o?void 0:o.formLayout)===d.CLASSIC_CASCADE||(null==o?void 0:o.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-date-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,size:null!==(r=null==o?void 0:o.size)&&void 0!==r?r:"small",required:t}):e("ez-date-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i}))})),h.set(r.TIME,(({name:a,label:l,readOnly:n,canShowError:i,props:t,required:o},r)=>{var s,c,m;return e("div",{class:"ez-col ez-col--sd-12"},(null==r?void 0:r.formLayout)===d.CLASSIC_CASCADE||(null==r?void 0:r.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,"show-seconds":null!==(s=null==t?void 0:t.showSeconds)&&void 0!==s&&s,size:null!==(c=null==r?void 0:r.size)&&void 0!==c?c:"small",required:o}):e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,"show-seconds":null!==(m=null==t?void 0:t.showSeconds)&&void 0!==m&&m}))})),h.set(r.ELAPSEDTIME,(({name:a,label:l,readOnly:n,canShowError:i,required:t},o)=>{var r;return e("div",{class:"ez-col ez-col--sd-12"},(null==o?void 0:o.formLayout)===d.CLASSIC_CASCADE||(null==o?void 0:o.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,showSeconds:!0,size:null!==(r=null==o?void 0:o.size)&&void 0!==r?r:"small",required:t}):e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,key:a,canShowError:i,showSeconds:!0}))})),h.set(r.DATETIME,(({name:a,label:l,readOnly:n,contextName:i,canShowError:t,required:o},r)=>{var s;return e("div",{class:"ez-col ez-col--sd-12"},(null==r?void 0:r.formLayout)===d.CLASSIC_CASCADE||(null==r?void 0:r.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t,size:null!==(s=null==r?void 0:r.size)&&void 0!==s?s:"small",required:o}):e("ez-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t}))})),h.set(r.FILE,(({name:a,label:l,readOnly:n,contextName:i,props:o})=>{const r=t.removeEmptyValues({subTitle:o.subTitle,requestHeaders:Object.assign(Object.assign({},o.STORAGESTRATEGY&&{STORAGESTRATEGY:o.STORAGESTRATEGY}),o.INTERNAL_FILENAME&&{INTERNAL_FILENAME:o.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12"},e("ez-upload",Object.assign({enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a},r)))})),h.set(r.DECIMALNUMBER,(({name:e,label:a,readOnly:l,props:n,contextName:i,canShowError:t,required:o},r)=>{var s,d;const c=Number(null!==(s=null==n?void 0:n.precision)&&void 0!==s?s:2);return p(e,a,l,c,Number(null!==(d=null==n?void 0:n.prettyPrecision)&&void 0!==d?d:c),i,t,0,o,r)})),h.set(r.INTEGERNUMBER,(({name:e,label:a,readOnly:l,contextName:n,canShowError:i,props:t,required:o},r)=>p(e,a,l,0,0,n,i,0,o,r))),h.set(r.SEARCH,(({name:a,label:l,readOnly:n,required:i,contextName:t,canShowError:r,optionLoader:s,props:c},m)=>{var u,p,v;const h=!o.isEmpty(null==c?void 0:c.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},(null==m?void 0:m.formLayout)===d.CLASSIC_CASCADE||(null==m?void 0:m.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":t,key:a,canShowError:r,optionLoader:s,ignoreLimitCharsToSearch:null!==(u=null==c?void 0:c.ignoreLimitCharsToSearch)&&void 0!==u&&u,hideDescriptionInput:!h,size:null!==(p=null==m?void 0:m.size)&&void 0!==p?p:"small",required:i}):e("ez-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:i,label:l,"data-field-name":a,"data-context-name":t,key:a,canShowError:r,optionLoader:s,ignoreLimitCharsToSearch:null!==(v=null==c?void 0:c.ignoreLimitCharsToSearch)&&void 0!==v&&v,hideDescriptionInput:!h}))})),h.set(r.SEARCHPLUS,(({name:a,label:l,readOnly:n,contextName:i,canShowError:t,optionLoader:r,props:s,required:c},m)=>{var u;const p=(null==m?void 0:m.formLayout)===d.CLASSIC_CASCADE||(null==m?void 0:m.formLayout)===d.CLASSIC_SIDE_BY_SIDE,v=!o.isEmpty(null==s?void 0:s.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},p?e("ez-classic-search-plus",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t,optionLoader:r,hideDescriptionInput:!v,size:null!==(u=null==m?void 0:m.size)&&void 0!==u?u:"small",required:c}):e("ez-search-plus",{class:"ez-input__no-margin",enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,canShowError:t,optionLoader:r,hideDescriptionInput:!v}))})),h.set(r.LONGTEXT,(({name:a,label:l,readOnly:n,rows:i,contextName:t,canShowError:o},r)=>e("div",{class:"ez-col ez-col--sd-12",key:a},(null==r?void 0:r.formLayout)===d.CLASSIC_CASCADE||(null==r?void 0:r.formLayout)===d.CLASSIC_SIDE_BY_SIDE?e("ez-classic-text-area",{enabled:!n,label:l,"data-field-name":a,"data-context-name":t,rows:i}):e("ez-text-area",{enabled:!n,label:l,"data-field-name":a,"data-context-name":t,rows:i,canShowError:o})))),h.set(r.HTML,(({name:a,label:l,readOnly:n,contextName:i,rows:t,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-rich-text",{key:a,enabled:!n,label:l,"data-field-name":a,"data-context-name":i,rows:t,canShowError:o})))),h.set(r.IMAGE,(({name:a,label:l,readOnly:n,contextName:i,props:t})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-image-input",Object.assign({enabled:!n,label:l,"data-field-name":a,"data-context-name":i,key:a,maxFileSize:1/0},t)))));const z=(e,a=new Map,l)=>{const n=m(),i=(null==l?void 0:l.formLayout)===d.CLASSIC_CASCADE||(null==l?void 0:l.formLayout)===d.CLASSIC_SIDE_BY_SIDE,t=a.get(e.userInterface)||h.get(e.userInterface)||v,o=!i&&e.required?`${e.label}${n("app.requiredInfo")}`:e.label,r=t(Object.assign(Object.assign({},e),{label:o}),l);return r.l["data-form-item"]=e.name,r};class w{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small","ez-margin-top--auto","ez-margin-bottom--extra-small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class b{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new w(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const f=class{constructor(e){a(this,e),this.ezContentReady=l(this,"ezContentReady",7),this.formItemsReady=l(this,"formItemsReady",7),this.MAIN_GROUP_NAME="__main",this._customEditors=new Map,this.fields=void 0,this.selectedRecord=void 0,this.singleColumn=!1,this.formLayout=void 0,this.customUiBuilders=new Map}async showUp(){this.singleColumn||this._element.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(e,a,l){const n=new Map(this._customEditors);n.set(e,{customEditor:a,detailContext:l}),this._customEditors=n}async setFieldProp(e,a,l){const n=this.fields.map((n=>(n.name!==e||!l&&0!==l||(n.props=n.props||{},n.props[a]=l),n)));this.fields=[...n]}getGroupByField(e){var a,l;const n=null!==(a=e.group)&&void 0!==a?a:null===(l=e.props)||void 0===l?void 0:l.UITabName;if(n&&n!==this.MAIN_GROUP_NAME)return n}groupFields(e){const a=new Map;return e.forEach((e=>{const l=this.getGroupByField(e);if(l){let n=a.get(l);null==n&&(n=[],a.set(l,n)),n.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this._formElements=Array.from(this._element.querySelectorAll("[data-field-name]")),this.ezContentReady.emit(this._formElements);const e=new b(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[r.FILE,r.LONGTEXT,r.HTML].includes(e)}buildFormItemElement(a,l=""){var n;this.isItemFullWidth(a.userInterface)&&(l+=` input-full_width ${this.singleColumn&&"single-column"}`);const i={formLayout:this.formLayout,size:"xsmall"};if(this._customEditors.has(a.name)){const t=null===(n=this._formElements.map((e=>({name:e.dataset.fieldName,value:e.value}))).find((e=>e.name===a.name)))||void 0===n?void 0:n.value,o=this._customEditors.get(a.name).customEditor;return e("div",{class:l},e("ez-custom-form-input",{"data-field-name":a.name,customEditor:o,formViewField:a,builderFallback:e=>z(e,this.customUiBuilders,i),value:t,selectedRecord:this.selectedRecord}))}return e("div",{class:l},z(a,this.customUiBuilders,i))}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],l=Array.from(this.groupFields(this.fields).entries()).map((([l,n])=>{if(Array.isArray(n))return e("ez-collapsible-box",{id:`group-${l}`,label:l,"header-size":"large",key:l},e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n.map((e=>this.buildFormItemElement(e)))));a.push(n)})),n=a.map((e=>this.buildFormItemElement(e))),t=e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n);return e(i,null,t,l)}get _element(){return n(this)}};f.style=".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:250px;--ez-form-view__long-item--min-width:530px;--ez-form-view__item--max-width:512px;--ez-form-view__long-item--max-width:100%;--ez-form-view__item--gap:var(--space--14, 14px);--ez-form-view__item--padding:var(--space--small)}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--gap);padding-inline:var(--ez-form-view__item--padding);width:100%}.form-view__content--single-column.sc-ez-form-view{grid-template-columns:1fr}.form-view__content--single-column.sc-ez-form-view>div.sc-ez-form-view:not(.input-full_width){width:clamp(var(--ez-form-view__item--min-width), 70%, var(--ez-form-view__item--max-width))}.input-full_width.sc-ez-form-view{grid-column:1/-1;width:clamp(var(--ez-form-view__long-item--min-width), 100%, var(--ez-form-view__long-item--max-width))}.single-column.sc-ez-form-view{--ez-form-view__long-item--max-width:1024px}*.sc-ez-form-view:has(*)+ez-collapsible-box.sc-ez-form-view{margin-top:var(--space--16, 16px)}";export{f as ez_form_view}
|