@sankhyalabs/ezui 7.1.0-dev.5 → 7.1.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
- package/dist/cjs/ez-badge.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +2 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +2 -2
- package/dist/cjs/ez-grid-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +2 -2
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +3 -12
- 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 +5 -2
- package/dist/cjs/ez-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-plus.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-panel.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-tag-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tag.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tile-medium.cjs.entry.js +1 -1
- package/dist/cjs/ez-tile.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +124 -14
- package/dist/cjs/ez-underface.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/{index-9e5554cb.js → index-a7b0c73d.js} +0 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{search-column-540f3925.js → search-column-8bfee733.js} +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +2 -8
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -10
- package/dist/collection/components/ez-popup/ez-popup.js +4 -1
- package/dist/collection/components/ez-tree/ez-tree.js +139 -14
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
- package/dist/collection/components/ez-tree/types/Node.js +7 -0
- package/dist/collection/components/ez-tree/types/Tree.js +17 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
- package/dist/custom-elements/index.js +129 -25
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-avatar.entry.js +1 -1
- package/dist/esm/ez-badge.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-classic-combo-box.entry.js +1 -1
- package/dist/esm/ez-classic-input.entry.js +1 -1
- package/dist/esm/ez-classic-text-area.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_4.entry.js +2 -2
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-empty-card.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +2 -2
- package/dist/esm/ez-grid-view.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +2 -2
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list-item.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +3 -12
- 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 +5 -2
- package/dist/esm/ez-progress-bar.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-rich-toolbar-item.entry.js +1 -1
- package/dist/esm/ez-scroller_2.entry.js +1 -1
- package/dist/esm/ez-search-plus.entry.js +1 -1
- package/dist/esm/ez-search-result-list.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-sortable-list.entry.js +1 -1
- package/dist/esm/ez-spinner.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +1 -1
- package/dist/esm/ez-split-item.entry.js +1 -1
- package/dist/esm/ez-split-panel.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-tag-input.entry.js +1 -1
- package/dist/esm/ez-tag.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-tile-medium.entry.js +1 -1
- package/dist/esm/ez-tile.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +124 -14
- package/dist/esm/ez-underface.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-5a720e56.js → index-baa5e267.js} +1 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{search-column-4e827a95.js → search-column-c00119ae.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-5d1adf13.entry.js → p-0b333f09.entry.js} +1 -1
- package/dist/ezui/{p-1d846a77.entry.js → p-0c0eb410.entry.js} +1 -1
- package/dist/ezui/{p-cf4e2a35.entry.js → p-0e49c0ff.entry.js} +1 -1
- package/dist/ezui/{p-77e738d5.entry.js → p-124699e0.entry.js} +1 -1
- package/dist/ezui/{p-26077a43.entry.js → p-1266fe78.entry.js} +1 -1
- package/dist/ezui/{p-06ca9d9a.entry.js → p-1730ee24.entry.js} +1 -1
- package/dist/ezui/{p-3b5bafe4.entry.js → p-1adf7139.entry.js} +1 -1
- package/dist/ezui/{p-13949839.entry.js → p-1bfef8e5.entry.js} +1 -1
- package/dist/ezui/{p-4cc79a52.entry.js → p-1cde96f9.entry.js} +1 -1
- package/dist/ezui/{p-81461d2f.entry.js → p-1e7a8633.entry.js} +1 -1
- package/dist/ezui/{p-6b51c9cc.entry.js → p-1f50fa05.entry.js} +1 -1
- package/dist/ezui/{p-cf33bc48.entry.js → p-20c024f7.entry.js} +1 -1
- package/dist/ezui/{p-e4c7eb39.js → p-23a36bb6.js} +2 -2
- package/dist/ezui/{p-169d460d.entry.js → p-2528e988.entry.js} +1 -1
- package/dist/ezui/{p-06f1b8e4.entry.js → p-288631d1.entry.js} +1 -1
- package/dist/ezui/p-294f54fe.entry.js +1 -0
- package/dist/ezui/{p-3136f418.entry.js → p-2a70f094.entry.js} +1 -1
- package/dist/ezui/{p-b77a0ce4.entry.js → p-2ba2d792.entry.js} +1 -1
- package/dist/ezui/{p-2d803ee6.entry.js → p-3fe05d6b.entry.js} +1 -1
- package/dist/ezui/{p-f7ca8634.entry.js → p-411c0222.entry.js} +1 -1
- package/dist/ezui/{p-570cf58a.entry.js → p-48effc69.entry.js} +1 -1
- package/dist/ezui/{p-4a876b8b.entry.js → p-4d30b703.entry.js} +1 -1
- package/dist/ezui/{p-b5b33be8.entry.js → p-4e1df756.entry.js} +1 -1
- package/dist/ezui/{p-4296e9f9.js → p-4f0632b4.js} +1 -1
- package/dist/ezui/{p-8aa7d60b.entry.js → p-59092a66.entry.js} +1 -1
- package/dist/ezui/{p-78f18973.entry.js → p-59a98e31.entry.js} +1 -1
- package/dist/ezui/{p-129fea99.entry.js → p-5ab08b60.entry.js} +1 -1
- package/dist/ezui/{p-6fc26622.entry.js → p-5ed81457.entry.js} +1 -1
- package/dist/ezui/{p-c754774e.entry.js → p-6020f3d5.entry.js} +1 -1
- package/dist/ezui/{p-51e34317.entry.js → p-6369a0cd.entry.js} +1 -1
- package/dist/ezui/{p-b3530711.entry.js → p-6a9a20a0.entry.js} +1 -1
- package/dist/ezui/{p-0b531233.entry.js → p-6d596a5a.entry.js} +1 -1
- package/dist/ezui/{p-30513f10.entry.js → p-6f119d5f.entry.js} +1 -1
- package/dist/ezui/{p-1723f728.entry.js → p-6f77a359.entry.js} +1 -1
- package/dist/ezui/{p-e2eb894a.entry.js → p-79277e43.entry.js} +1 -1
- package/dist/ezui/{p-e195eaad.entry.js → p-7f792043.entry.js} +1 -1
- package/dist/ezui/{p-0391f255.entry.js → p-7f8c1fce.entry.js} +1 -1
- package/dist/ezui/{p-b7c6ce20.entry.js → p-7fe97ef5.entry.js} +1 -1
- package/dist/ezui/p-870506ba.entry.js +1 -0
- package/dist/ezui/{p-1d8ea7d2.entry.js → p-8bb3aeb0.entry.js} +1 -1
- package/dist/ezui/{p-cb4f1ee9.entry.js → p-8c57ffa4.entry.js} +1 -1
- package/dist/ezui/{p-53e773a4.entry.js → p-8dc267ff.entry.js} +1 -1
- package/dist/ezui/{p-82fa4b09.entry.js → p-8df1ca33.entry.js} +1 -1
- package/dist/ezui/{p-78e975b4.entry.js → p-91c9d50e.entry.js} +1 -1
- package/dist/ezui/{p-05e68ab3.entry.js → p-93e1c917.entry.js} +1 -1
- package/dist/ezui/{p-7fdf1f2b.entry.js → p-957d08cd.entry.js} +1 -1
- package/dist/ezui/{p-d3779449.entry.js → p-9b2e6438.entry.js} +1 -1
- package/dist/ezui/{p-c2b20f78.entry.js → p-9f5fa3f9.entry.js} +1 -1
- package/dist/ezui/{p-bc693db6.entry.js → p-a0bf1fc7.entry.js} +1 -1
- package/dist/ezui/{p-9bcfa689.entry.js → p-a3075f52.entry.js} +1 -1
- package/dist/ezui/{p-f26b97e9.entry.js → p-a3ada561.entry.js} +1 -1
- package/dist/ezui/{p-c73964f8.entry.js → p-a401041c.entry.js} +1 -1
- package/dist/ezui/{p-43106b79.entry.js → p-a7eab406.entry.js} +1 -1
- package/dist/ezui/{p-dfca5946.entry.js → p-a80b1287.entry.js} +1 -1
- package/dist/ezui/{p-a48979a8.entry.js → p-ba7e908a.entry.js} +1 -1
- package/dist/ezui/p-bc2f844e.entry.js +1 -0
- package/dist/ezui/{p-015a6319.entry.js → p-bd6146c5.entry.js} +1 -1
- package/dist/ezui/{p-b81d19c7.entry.js → p-c82acfc6.entry.js} +1 -1
- package/dist/ezui/p-ce5d69da.entry.js +1 -0
- package/dist/ezui/{p-4a530109.entry.js → p-d0e6911e.entry.js} +1 -1
- package/dist/ezui/{p-c96e536d.entry.js → p-d2645bdf.entry.js} +1 -1
- package/dist/ezui/{p-a9432878.entry.js → p-d6742c1e.entry.js} +1 -1
- package/dist/ezui/{p-770cf2b8.entry.js → p-d6f50207.entry.js} +1 -1
- package/dist/ezui/p-d8cc640d.entry.js +1 -0
- package/dist/ezui/{p-5f4a66ec.entry.js → p-dee18824.entry.js} +1 -1
- package/dist/ezui/p-e03b2f19.entry.js +1 -0
- package/dist/ezui/{p-74f08ec9.entry.js → p-e27d7dc2.entry.js} +1 -1
- package/dist/ezui/{p-4815ddbf.entry.js → p-e46a4d06.entry.js} +1 -1
- package/dist/ezui/{p-000159dc.entry.js → p-e75c7a23.entry.js} +1 -1
- package/dist/ezui/{p-e9b409c1.entry.js → p-e7a7c594.entry.js} +1 -1
- package/dist/ezui/{p-4dc07e01.entry.js → p-e882635e.entry.js} +1 -1
- package/dist/ezui/{p-b21efe83.entry.js → p-e8c57463.entry.js} +1 -1
- package/dist/ezui/{p-a859ea2e.entry.js → p-e8c6c973.entry.js} +1 -1
- package/dist/ezui/{p-f17e7182.entry.js → p-e99cbb51.entry.js} +1 -1
- package/dist/ezui/{p-53412766.entry.js → p-eee3c7ff.entry.js} +1 -1
- package/dist/ezui/{p-35e3715c.entry.js → p-ef8bd3e8.entry.js} +1 -1
- package/dist/ezui/{p-44b39e81.entry.js → p-fa6732f2.entry.js} +1 -1
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +0 -2
- package/dist/types/components/ez-popup/ez-popup.d.ts +1 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +15 -1
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
- package/dist/types/components.d.ts +10 -1
- package/package.json +1 -1
- package/dist/ezui/p-14d6aeb8.entry.js +0 -1
- package/dist/ezui/p-3be7d8d8.entry.js +0 -1
- package/dist/ezui/p-6ec40dec.entry.js +0 -1
- package/dist/ezui/p-7390c7e6.entry.js +0 -1
- package/dist/ezui/p-a1c3f74d.entry.js +0 -1
- package/dist/ezui/p-bd65ce5d.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as i,H as t,g as o}from"./p-
|
|
1
|
+
import{r as e,h as i,H as t,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as l}from"@sankhyalabs/core";const r=class{constructor(i){e(this,i),this.color="default",this.iconName=void 0,this.iconColor=void 0,this.smallTitleText=void 0,this.smallTitleMaximumLines=void 0,this.titleText=void 0,this.titleMaximumLines=void 0,this.descriptionText=void 0,this.descriptionMaximumLines=void 0,this.height=void 0,this.width=void 0,this.avatarProps=void 0,this.buttonProps=void 0,this.tags=void 0}async setButtonFocus(){var e;this._button&&(null===(e=this._button)||void 0===e||e.setFocus())}async setButtonBlur(){var e;this._button&&(null===(e=this._button)||void 0===e||e.setBlur())}renderBadges(){return this.tags&&0!==this.tags.length?this.tags.slice(0,3).map(((e,t)=>i("ez-badge",{id:`tag-${e.label}`,key:`tag-${t}`,label:e.label,size:"medium",style:{"--ez-badge--background-color":`var(${e.color}, #008561)`}}))):null}setCustomCSSProperties(){var e,i;const t=null!==(i=null===(e=this.buttonProps)||void 0===e?void 0:e.colors)&&void 0!==i?i:{},{background:o,backgroundHover:l,backgroundActive:r,text:a,textHover:m,textActive:n}=t;return Object.assign({},this.height&&{"--ez-tile-medium--custom-height":`${this.height}`},this.width&&{"--ez-tile-medium--custom-width":`${this.width}`},this.smallTitleMaximumLines&&{"--ez-tile-medium--small-title--maximum-lines":`${this.smallTitleMaximumLines}`},this.titleMaximumLines&&{"--ez-tile-medium--title--maximum-lines":`${this.titleMaximumLines}`},this.descriptionMaximumLines&&{"--ez-tile-medium--description--maximum-lines":`${this.descriptionMaximumLines}`},this.iconColor&&{"--ez-tile-medium--custom-icon-color":`var(${this.iconColor})`},o&&{"--ez-tile-medium_button--background-color":`var(${o}, #008561)`},l&&{"--ez-tile-medium_button--hover--background-color":`var(${l}, #00684C)`},r&&{"--ez-tile-medium_button--active--background-color":`var(${r}, #1A9171)`},a&&{"--ez-tile-medium_button--color":`var(${a}, #ffffff)`},m&&{"--ez-tile-medium_button--hover-color":`var(${m}, #ffffff)`},n&&{"--ez-tile-medium_button--active-color":`var(${n}, #ffffff)`})}componentDidLoad(){this.setCustomCSSProperties(),this._element&&l.addIDInfo(this._element),this._button&&l.addIDInfo(this._button,"tile-medium_button",{id:"embedded"})}render(){var e,o,l,r,a,m,n,d,c,u;return i(t,{style:this.setCustomCSSProperties()},i("div",{class:`tile-medium_container ${this.color}`},i("div",{class:"tile-medium_header"},i("div",{class:"tile-medium_header-image"},this.avatarProps?i("ez-avatar",{size:"60",name:null===(e=this.avatarProps)||void 0===e?void 0:e.name,imageSrc:null===(o=this.avatarProps)||void 0===o?void 0:o.imageSrc,shape:(null===(l=this.avatarProps)||void 0===l?void 0:l.shape)||"square"}):this.iconName&&i("ez-icon",{size:"x-large",class:"icon",iconName:this.iconName})),i("div",{class:"tag_group"},this.renderBadges())),i("div",{class:"tile-medium_content"},i("div",null,this.smallTitleText&&i("span",{class:"small_title",title:this.smallTitleText},this.smallTitleText),this.titleText&&i("span",{class:"main_title",title:this.titleText},this.titleText),this.descriptionText&&i("span",{class:"description",title:this.descriptionText},this.descriptionText)),this.buttonProps&&i("ez-button",{ref:e=>this._button=e,class:"tile-medium_button",label:(null===(r=this.buttonProps)||void 0===r?void 0:r.label)||void 0,enabled:null===(m=null===(a=this.buttonProps)||void 0===a?void 0:a.enabled)||void 0===m||m,mode:null===(n=this.buttonProps)||void 0===n?void 0:n.mode,iconName:null===(d=this.buttonProps)||void 0===d?void 0:d.iconName,size:null===(c=this.buttonProps)||void 0===c?void 0:c.size,onClick:null===(u=this.buttonProps)||void 0===u?void 0:u.onClick}))))}get _element(){return o(this)}};r.style=":host{--ez-tile-medium--width:446px;--ez-tile-medium--height:257px;--ez-tile-medium--padding:var(--space--24, 24px);--ez-tile-medium--border-radius:var(--border--radius-16, 16px);--ez-tile-medium--background-color:var(--color--ocean-gray-70, #ffffff);--ez-tile-medium--color:var(--color--ocean-green-900, #003D2D);--ez-tile-medium--icon-color:var(--color--ocean-green-400, #42A58A);--ez-tile-medium--font-family:var(--font-pattern, Arial);--ez-tile-medium--header-gap:var(--space--16, 16px);--ez-tile-medium--icon-line-height:var(--line-height--30, 30px);--ez-tile-medium--tag-group-gap:var(--space--4, 4px);--ez-tile-medium_button--background-color:var(--color--ocean-green-600, #1A9171);--ez-tile-medium_button--color:var(--color--gray-70, #ffffff);--ez-tile-medium_button--hover--background-color:var(--color--ocean-green-700, #00684C);--ez-tile-medium_button--hover-color:var(--color--gray-70, #ffffff);--ez-tile-medium_button--active--background-color:var(--color--ocean-green-500, #1A9171);--ez-tile-medium_button--active-color:var(--color--gray-70, #ffffff)}.tile-medium_container{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;overflow:hidden;outline:none;box-shadow:none;width:var(--ez-tile-medium--custom-width, var(--ez-tile-medium--width));height:var(--ez-tile-medium--custom-height, var(--ez-tile-medium--height));border-radius:var(--ez-tile-medium--border-radius);background-color:var(--ez-tile-medium--background-color);color:var(--ez-tile-medium--color);box-sizing:border-box;padding:var(--ez-tile-medium--padding)}.tile-medium_header{display:flex;flex-direction:row;align-items:flex-start;align-self:stretch;width:100%;gap:var(--ez-tile-medium--header-gap)}.tile-medium_header-image{display:flex;align-items:flex-start;gap:var(--space--10, 10px);flex:1 0 0}.tag_group{display:flex;flex-direction:row;gap:var(--ez-tile-medium--tag-group-gap);flex-wrap:wrap;justify-content:flex-end}.tile-medium_content{display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:var(--space--14, 14px);align-self:stretch}span{font-family:var(--ez-tile-medium--font-family);display:-webkit-box;-webkit-box-orient:vertical;width:100%;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:pre-wrap;align-self:stretch;font-style:normal}.small_title{color:var(--color--gray-400, #77777A);font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--regular);line-height:var(--line-height--20, 20px);-webkit-line-clamp:var(--ez-tile-medium--small-title--maximum-lines, 1);line-clamp:var(--ez-tile-medium--small-title--maximum-lines,1)}.main_title{color:var(--color--ocean-green-900, #003D2D);font-size:var(--font-size--xxlarge, 22px);font-weight:var(--font-weight--bold);line-height:var(--line-height--32, 32px);-webkit-line-clamp:var(--ez-tile-medium--title--maximum-lines, 1);line-clamp:var(--ez-tile-medium--title--maximum-lines,1)}.description{color:var(--color--ocean-green-900, #003D2D);font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--regular);line-height:var(--line-height--24, 24px);-webkit-line-clamp:var(--ez-tile-medium--description--maximum-lines, 3);line-clamp:var(--ez-tile-medium--description--maximum-lines, 3)}.tile-medium_button{--ez-button--background-color:var(--ez-tile-medium_button--background-color);--ez-button--color:var(--ez-tile-medium_button--color);--ez-button--hover--background-color:var(--ez-tile-medium_button--hover--background-color);--ez-button--hover-color:var(--ez-tile-medium_button--hover-color);--ez-button--active--background-color:var(--ez-tile-medium_button--active--background-color);--ez-button--active-color:var(--ez-tile-medium_button--active-color)}ez-icon{--ez-icon--color:var(--ez-tile-medium--custom-icon-color, var(--ez-tile-medium--icon-color));line-height:var(--ez-tile-medium--icon-line-height)}.green{--ez-tile-medium--background-color:var(--color--ocean-green-90);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--ocean-green-500))}.gray{--ez-tile-medium--background-color:var(--color--gray-80);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--ocean-green-400))}.red{--ez-tile-medium--background-color:var(--color--red-100);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--red-300))}.yellow{--ez-tile-medium--background-color:var(--color--yellow-100);--ez-tile-medium--icon-color:var(--ez-tile-medium--custom-icon-color, var(--color--yellow-400))}";export{r as ez_tile_medium}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as n}from"./p-
|
|
1
|
+
import{r as t,h as e,H as i,g as n}from"./p-23a36bb6.js";import{FloatingManager as a,ElementIDUtils as o}from"@sankhyalabs/core";import{i as l}from"./p-641ee538.js";const r=class{constructor(e){t(this,e),this._container=void 0,this.alerts=[],this.enableDragAndDrop=void 0,this.enableExpand=!0,this.itemRightSlotBuilder=void 0,this.opened=!0,this.expanded=!1}observeOpened(){this.opened&&this.manageOverlay()}alertId(t,e){return`alert-${e}-${(t=>{var e;return null!==(e=null==t?void 0:t.split(" ").join("-"))&&void 0!==e?e:""})(t)}`}getAlertTitle(t){var e;return null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t)))||void 0===e?void 0:e.title}getLinkActionClick(t){var e;return(null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t.id)))||void 0===e?void 0:e.onClickLink)||(()=>{})}getTitleText(t){var e;const i=null!==(e=this.getAlertTitle(t.id))&&void 0!==e?e:"";return`${i}${i&&t.label?":":""}`}toggleExpandContainer(){this.enableExpand&&(this.expanded=!this.expanded,this._container.classList.toggle("expanded",this.expanded),this.expanded?this.updatePosition(this.getBoundingRight(),this.getBoundingBottom()):this.updatePosition("10px","10px"))}manageOverlay(){if(this.opened&&this._container)this._overlayId=a.float(this._container,this._overlayRef,this.getFloatOptions());else{if(void 0===this._overlayId)return;a.close(this._overlayId),this._overlayId=void 0}}updatePosition(t,e){this.opened&&a.updateFloatPosition(this._container,this._overlayRef,Object.assign(Object.assign({},this.getFloatOptions()),{right:t,bottom:e}))}getFloatOptions(){return{autoClose:!1,isFixed:!0,bottom:"10px",right:"10px"}}getBoundingRight(){return(document.body.clientWidth-this._container.getBoundingClientRect().width)/2+"px"}getBoundingBottom(){return(document.body.clientHeight-this._container.getBoundingClientRect().height)/2+"px"}componentDidLoad(){this.manageOverlay(),this.opened&&this._container&&this._container.focus()}async componentWillLoad(){this.dataElementId=o.addIDInfo(this._element,"EzAlertList"),this.i18n=await l()}render(){return e(i,Object.assign({},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:this.dataElementId}),this.opened?e("div",{ref:t=>this._overlayRef=t},e("div",{class:"alert-list__container "+(this.expanded?"expanded":""),ref:t=>this._container=t},e("div",{class:"alert-list__content"},e("div",{class:"alert-list__header"},e("div",{class:"alert-list__title"},`${this.i18n("app.alerts")} (${this.alerts.length})`),e("div",{class:"alert-list__header__buttons"},this.enableExpand&&e("ez-button",{mode:"icon",size:"small",iconName:"expand",onClick:()=>this.toggleExpandContainer(),"data-element-id":o.getInternalIDInfo("expandButton"),title:this.i18n(this.expanded?"app.collapse":"app.expand")}),e("ez-button",{mode:"icon",size:"small",iconName:"close","data-element-id":o.getInternalIDInfo("closeButton"),onClick:()=>{this.opened=!1},title:this.i18n("app.close")}))),e("div",{class:"alert-list__expandable-content"},e("ez-list",{itemSlotBuilder:this.itemRightSlotBuilder,hoverFeedback:!0,itemLeftSlotBuilder:t=>e("a",{onClick:this.getLinkActionClick(t),style:{fontFamily:"var(--font-pattern, 'Roboto')",fontSize:"var(--text--medium, 14px)",fontWeight:"var(--text-weight--medium, 400)",color:"var(--color--primary, #008561)",marginRight:"4px",cursor:"pointer",display:"flex",width:"max-content",textDecoration:"none"}},this.getTitleText(t)),dataSource:this.alerts.map(((t,e)=>{var i;return{id:this.alertId(t.title,e),label:null!==(i=t.detail)&&void 0!==i?i:""}}))}))))):null)}get _element(){return n(this)}static get watchers(){return{_container:["observeOpened"]}}};r.style=':host {\n display: flex;\n\n /* Alert List */\n \n /*@doc Define a largura da lista minimizado */\n --ez-alert-list__container--width: 680px;\n /*@doc Define a altura da lista minimizado */\n --ez-alert-list__container--height: 220px;\n \n /*@doc Define a largura da lista maximizada */\n --ez-alert-list__container--width--expanded: 920px;\n /*@doc Define a altura da lista maximizada */\n --ez-alert-list__container--height--expanded: 540px;\n\n /* Title */\n /*@doc Define a fonte do título do componente */\n --ez-alert-list__title--font-family: var(--font-pattern, "Roboto");\n /*@doc Define o tamanho da fonte do título do popup.*/\n --ez-alert-list__title--font-size: var(--title--large, 20px);\n /*@doc Define a cor da fonte do título do popup.*/\n --ez-alert-list__title--color: var(--title--primary, #2b3a54);\n /*@doc Define o peso da fonte do título do popup.*/\n --ez-alert-list__title--font-weight: var(--text-weight--extra-large, 700);\n\n /* @doc Define a borda inferior do item da lista. */\n --ez-list__item--border-bottom: var(--border--small, 1px solid);\n\n /* @doc Define a cor da borda inferior do item da lista. */\n --ez-list__item--border-bottom-color: var(--color--strokes, #DCE0E8);\n\n /* @doc Define o tipo da quebra de linha do item da lista. */\n --ez-list__item--white-space: break-space;\n}\n\n.alert-list__content {\n display: flex;\n flex-direction: column;\n \n gap: var(--space--xs);\n margin: var(--space--large, 24px);\n width: 100%;\n}\n\n.alert-list__container {\n z-index: var(--ez-elevation--8, 8);\n display: flex;\n height: var(--ez-alert-list__container--height);\n width: var(--ez-alert-list__container--width);\n border-radius: var(--border--radius-medium);\n background-color: var(--background--xlight);\n box-shadow: var(--shadow--medium);\n\n &.expanded {\n height: var(--ez-alert-list__container--height--expanded);\n width: var(--ez-alert-list__container--width--expanded);\n }\n\n @media (max-height: 640px) {\n max-height: calc(100vh - var(--space--3xl));\n } \n}\n\n.alert-list__header {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.alert-list__title {\n font-family: var(--ez-alert-list__title--font-family);\n font-size: var(--ez-alert-list__title--font-size);\n font-weight: var(--ez-alert-list__title--font-weight);\n color: var(--ez-alert-list__title--color);\n}\n\n.alert-list__header__buttons {\n display: flex;\n gap: var(--space--xs);\n}\n\n.alert-list__expandable-content {\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n';export{r as ez_alert_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as o}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as r}from"@sankhyalabs/core";class a{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),"?":t=>/[a-zA-Z]/.test(t),"*":()=>!0}}format(t){if(!t||!this.mask)return t;const i=this.removeIncompatibleChars(t);let s="",e=0,o=0;for(;o<this.mask.length&&e<i.length;){const t=this.mask[o],r=i[e];if("'"!==t){if(this.maskChars[t]){if(!this.maskChars[t](r)){e++;continue}s+="U"===t?r.toUpperCase():"L"===t?r.toLowerCase():r,e++}else s+=t,r===t&&e++;o++}else o++,o<this.mask.length&&(s+=this.mask[o],o++)}return s}removeIncompatibleChars(t){let i="";for(let s=0;s<t.length;s++){const e=t[s];let o=!1;for(const t in this.maskChars)if(this.maskChars[t](e)){o=!0;break}if(!o)for(let t=0;t<this.mask.length;t++)if(this.mask[t]===e&&!this.maskChars[this.mask[t]]){o=!0;break}o&&(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 o=this.mask[e],r=t[s];"'"!==o?(this.maskChars[o]?(this.maskChars[o](r)&&(i+=r),s++):r===o&&s++,e++):(e++,e<this.mask.length&&(r===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.placeholder=void 0,this.enabled=!0,this.readonly=!1,this.name=void 0,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||"")}onInput(t){try{const i=t.target;let s=i.value;if(this._maskFormatter){const t=this._maskFormatter.format(s),e=this._maskFormatter.removeMask(t);i.value=t,this._internalValueChange=!0,this.value=e,this.ezChange.emit(this.emitMaskedValue?t:e)}else this._internalValueChange=!0,this.value=s,this.ezChange.emit(s)}catch(t){console.error("Error processing input event:",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&&r.addIDInfo(this._element),this._inputElem&&r.addIDInfo(this._inputElem,"classic-input",{id:"embedded"})}componentWillLoad(){this.mask&&!this._maskFormatter&&(this._maskFormatter=new a(this.mask)),!this.placeholder&&this._maskFormatter&&(this.placeholder=this._maskFormatter.generatePlaceholder())}componentDidLoad(){this.syncValue(),this.addInfoId()}render(){return s(e,null,s("label",{title:this.label,htmlFor:this.name},this.label),s("div",{class:"input-container","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&&s("span",{title:this.helpText},this.helpText))}get _element(){return o(this)}static get watchers(){return{value:["syncValue"]}}};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;--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:56px}.input-container{display:flex;flex-direction:row;align-items:center;width:100%;border:none;border-radius:var(--border--radius-8, 8px);padding:var(--space--16, 16px);box-sizing:border-box;gap:var(--space--10, 10px);margin:var(--space--4, 4px) var(--space--2, 2px);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,.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;line-height:var(--line-height--20, 20px);color:var(--ez-classic-input--label-color)}.icon-clickable{cursor:pointer}';export{c as ez_classic_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as r,h as a,H as e,g as i}from"./p-
|
|
1
|
+
import{r as o,c as r,h as a,H as e,g as i}from"./p-23a36bb6.js";import{ElementIDUtils as t}from"@sankhyalabs/core";const d=class{constructor(a){o(this,a),this.ezChange=r(this,"ezChange",7),this.value=void 0,this.options=[],this.enabled=!0,this.label=void 0,this.direction="vertical"}componentDidLoad(){this.hostElement&&t.addIDInfo(this.hostElement,"input")}componentWillRender(){this._options=[...this.options];const o=this.hostElement.querySelectorAll("ez-radio-button-option");o&&o.forEach((o=>{let r=o.getAttribute("label"),a=o.getAttribute("value");this._options.push({label:r,value:a})}))}handleInputChange(o){this.value=o.target.value,this.ezChange.emit(this.value)}render(){return a(e,null,this.label&&a("label",{class:"label"},this.label),a("div",{class:"form form--"+this.direction},this._options.map(((o,r)=>a("div",{class:"form__group"},a("input",{id:"rad"+r,class:"form__radio",name:"theradio",type:"radio",value:o.value,onChange:o=>{this.handleInputChange(o)},disabled:!this.enabled,checked:o.value===this.value,"data-element-id":t.getInternalIDInfo(`input_${o.value}`)}),a("label",{htmlFor:"rad"+r,class:"form__label"},o.label))))))}get hostElement(){return i(this)}};d.style=":host{--ez-radio-button--font-family:var(--font-pattern, Arial);--ez-radio-button--font-size:var(--text--medium, 14px);--ez-radio-button--font-weight:var(--text-weight--large);--ez-radio-button--font-color:var(--title--primary, #2B3A54);--ez-radio-button--padding-vertical:var(--space--medium, 12px);--ez-radio-button--padding-horizontal:var(--space--small, 6px);--ez-radio-button__form-label--font-family:var(--font-pattern, Arial);--ez-radio-button__form-label--font-weight:var(--text-weight--medium, 400);--ez-radio-button__form-label--title-primary:var(--title--primary, #2B3A54);--ez-radio-button__form-label--font-size:var(--text--medium, 14px);--ez-radio-button__form-label--padding-horizontal:var(--space--medium, 12px);--ez-radio-button__form-radio--border-color:var(--title--primary, #2B3A54);--ez-radio-button__form-radio--checked--color:var(--color--primary, #008561);--ez-radio-button__form-radio--disabled--border-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--disabled--background-color:var(--background--medium, #f0f3f7);--ez-radio-button__form-radio--disabled--color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--disabled--before--background-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--focus--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--box-shadow-color:var(--background--strong, #e4eaf1);--ez-radio-button__form-radio--checked--focus--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--focus--box-shadow-color:var(--color--primary-300, #e2f4ef);--ez-radio-button__form-radio--checked--hover--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--hover--box-shadow-color:#daece7;--ez-radio-button__form-radio--hover--box-shadow-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--checked--disabled--hover--background-color:var(--background--medium, #f0f3f7);display:flex;width:100%;flex-direction:column;align-items:flex-start;box-sizing:border-box}.form{padding:var(--ez-radio-button--padding-vertical) var(--ez-radio-button--padding-horizontal);gap:var(--ez-radio-button__form-label--padding-horizontal)}.form--vertical{display:flex;flex-direction:column}.form--horizontal{display:flex;flex-direction:row}.form__group{display:grid;grid-template-columns:20px auto;align-items:center}.label{font-family:var(--ez-radio-button--font-family);font-size:var(--ez-radio-button--font-size);font-weight:var(--ez-radio-button--font-weight);color:var(--ez-radio-button--font-color)}.form__label{cursor:pointer;font-weight:var(--ez-radio-button__form-label--font-weight);color:var(--ez-radio-button__form-label--title-primary);font-family:var(--ez-radio-button__form-label--font-family);font-size:var(--ez-radio-button__form-label--font-size);padding-left:var(--ez-radio-button__form-label--padding-horizontal);padding-right:var(--ez-radio-button__form-label--padding-horizontal)}.form__radio{cursor:pointer;appearance:none;outline:none;position:relative;display:flex;align-items:center;justify-content:center;margin:0;padding:0;width:20px;height:20px;border-radius:50%;border:2px solid var(--ez-radio-button__form-radio--border-color)}.form__radio::before{content:'';display:block;position:absolute;opacity:0;transition:all 300ms ease-in-out;height:100%;width:100%;border-radius:50%;transform:scale(0.5);background:var(--ez-radio-button__form-radio--checked--color)}.form__radio:checked:before{opacity:1}.form__radio:checked{border:2px solid var(--ez-radio-button__form-radio--checked--color)}.form__radio:disabled{cursor:default;border:2px solid var(--ez-radio-button__form-radio--disabled--border-color);background-color:var(--ez-radio-button__form-radio--disabled--background-color)}.form__radio:disabled:hover{box-shadow:inherit}input[type=radio]:disabled~label{cursor:default;color:var(--ez-radio-button__form-radio--disabled--color)}.form__radio:disabled:before{background:var(--ez-radio-button__form-radio--disabled--before--background-color)}.form__radio:focus{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--focus--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--box-shadow-color)}.form__radio:checked:focus{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--checked--focus--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--focus--box-shadow-color)}.form__radio:checked:hover{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--checked--hover--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--hover--box-shadow-color)}.form__radio:hover{transition:0.25s linear;box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--hover--box-shadow-color)}.form__radio:checked:disabled:hover{box-shadow:none;background-color:var(--ez-radio-button__form-radio--checked--disabled--hover--background-color)}";export{d as ez_radio_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as
|
|
1
|
+
import{r as t,c as i,h as a,H as e,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as s,KeyboardManager as o}from"@sankhyalabs/core";const n=class{constructor(a){t(this,a),this.ezChange=i(this,"ezChange",7),this.ezTagAdded=i(this,"ezTagAdded",7),this.ezTagRemoved=i(this,"ezTagRemoved",7),this.ezFocus=i(this,"ezFocus",7),this.ezBlur=i(this,"ezBlur",7),this.ezValidationError=i(this,"ezValidationError",7),this.ezType=i(this,"ezType",7),this.handleInputChange=t=>{this._inputElement.value=t.target.value,this.ezType.emit(this._inputElement.value)},this.handleInputKeyDown=t=>{"Backspace"===t.key&&""===this._inputElement.value&&this.tags.length>0&&!this.suppressBackspaceToRemove&&this.handleRemoveTag(this.tags[this.tags.length-1])},this.handleInputFocus=()=>{this.ezFocus.emit(this.tags)},this.handleInputBlur=()=>{this.ezBlur.emit(this.tags)},this.handleTagClick=(t,i)=>{this.enabled&&!this.readonly&&(this.handleRemoveTag(t),this.updateTagFocus(i))},this.handleClearInput=()=>{this._inputElement.value=""},this.label="",this.placeholder="",this.helpText=void 0,this.enabled=!0,this.readonly=!1,this.name=void 0,this.tags=[],this.maxTagLength=void 0,this.maxTags=void 0,this.allowDuplicates=!1,this.state="default",this.validator=void 0,this.suppressTagsKeyboardNavigation=!1,this.suppressBackspaceToRemove=!1}async setFocus(t){(null==t?void 0:t.selectText)&&this._inputElement.select(),(null==t?void 0:t.preventScroll)||this._inputElement.scrollIntoView({behavior:"smooth",block:"center"}),this._inputElement.focus({preventScroll:!0})}async setBlur(){this._inputElement.blur()}async addTag(t){return this.handleAddTag(t)}async removeTag(t){return this.handleRemoveTag(t)}async clearTags(){this.tags=[],this.ezChange.emit([...this.tags])}addInfoId(){this._element&&s.addIDInfo(this._element),this._inputElement&&s.addIDInfo(this._inputElement,"tag-input",{id:"embedded"})}initializeKeyboardManager(){this._keyboardManager=new o({propagate:!0,element:this._element}).bind("Enter",(()=>this.handleAddCurrentTag())).bind("Tab",(()=>this.handleAddCurrentTag())).bind("Escape",(()=>this.handleClearInput())).bind("ArrowLeft",(()=>this.handlePreviousTagFocus())).bind("ArrowRight",(()=>this.handleNextTagFocus()))}handleAddCurrentTag(){if(this._inputElement.value.trim()){const t=this.handleAddTag(this._inputElement.value);return t&&(this._inputElement.value=""),t}return!1}handleAddTag(t){const i=t.trim();if(!this.enabled||this.readonly)return!1;if(!i||0===i.length)return!1;if(this.maxTagLength&&i.length>this.maxTagLength)return!1;if(this.maxTags&&this.tags.length>=this.maxTags)return!1;if(!this.allowDuplicates&&this.tags.includes(i))return!1;if(this.validator){const t=this.validator(i,[...this.tags]);if(!1===t)return this.ezValidationError.emit({tag:i,error:void 0}),!1;if("string"==typeof t)return this.ezValidationError.emit({tag:i,error:t}),!1}return this.tags=[...this.tags,i],this.ezChange.emit([...this.tags]),this.ezTagAdded.emit(i),!0}async updateTagFocus(t){var i;if(!(null===(i=this.tags)||void 0===i?void 0:i.length)||this.suppressTagsKeyboardNavigation)return void await this.setFocus();if(!t)return;const a=this._element.shadowRoot.querySelector("#tag-"+(t-1));a&&await a.setFocus()}getCurrentActiveTagIndex(){var t;const i=this._element.shadowRoot.activeElement;if(!(null===(t=this.tags)||void 0===t?void 0:t.length)||"ez-chip"!==i.tagName.toLowerCase())return null;const a=parseInt(i.id.split("-")[1],10);return Number.isNaN(a)||a<0||a>=this.tags.length?null:a}async setTagFocus(t){const i=this._element.shadowRoot.querySelector(`#tag-${t}`);i&&await i.setFocus()}async handlePreviousTagFocus(){if(this.suppressTagsKeyboardNavigation||!this.enabled||this.readonly)return;if(this._element.shadowRoot.activeElement===this._inputElement)return void await this.setTagFocus(this.tags.length-1);const t=this.getCurrentActiveTagIndex();null!==t?0!==t&&await this.setTagFocus(t-1):await this.setFocus()}async handleNextTagFocus(){if(this.suppressTagsKeyboardNavigation||!this.enabled||this.readonly)return;const t=this.getCurrentActiveTagIndex();null===t||t>=this.tags.length-1?await this.setFocus():await this.setTagFocus(t+1)}handleRemoveTag(t){return!(!this.enabled||this.readonly)&&(-1!==this.tags.indexOf(t)&&(this.tags=this.tags.filter((i=>i!==t)),this.ezChange.emit([...this.tags]),this.ezTagRemoved.emit(t),!0))}async componentWillLoad(){this.tags||(this.tags=[])}componentDidLoad(){this.addInfoId(),this.initializeKeyboardManager()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}render(){return a(e,null,a("label",{htmlFor:this.name},this.label),a("div",{class:"tag-input__container","data-state":this.state,"data-disabled":(!this.enabled).toString(),onClick:()=>this.setFocus({preventScroll:!0})},this.tags.map(((t,i)=>a("ez-chip",{key:`tag-${i}`,id:`tag-${i}`,label:t,enabled:this.enabled&&!this.readonly,removePosition:this.enabled&&!this.readonly?"right":void 0,mode:"label",onRemoveChip:()=>this.handleTagClick(t,i),tabIndex:this.suppressTagsKeyboardNavigation||!this.enabled||this.readonly?-1:0,disableAutoUpdateValue:!0,removeWithKeyboard:!0}))),a("input",{ref:t=>this._inputElement=t,id:this.name,type:"text",placeholder:this.placeholder,disabled:!this.enabled,readonly:this.readonly,maxlength:this.maxTagLength,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur})),this.helpText&&a("span",{title:this.helpText},this.helpText))}get _element(){return r(this)}};n.style=':host{--ez-tag-input--background-color:var(--color--gray-70, #FFFFFF);--ez-tag-input--border-color-default:var(--color--gray-200, #D2D2D3);--ez-tag-input--border-color-focused:var(--color--gray-300, #A4A5A7);--ez-tag-input--border-color-error:var(--color--red-600, #BD0025);--ez-tag-input--border-color-success:var(--color--green-600, #157A00);--ez-tag-input--border-color-warning:var(--color--yellow-600, #EFB103);--ez-tag-input--border-radius:var(--border--radius-8, 8px);--ez-tag-input--padding:var(--space--12, 12px);--ez-tag-input--gap:var(--space--8, 8px);--ez-tag-input--label-color:var(--color--petroleum-900, #141B27);--ez-tag-input--label-font-weight:var(--font-weight--regular, 400);--ez-tag-input--input-color:var(--color--petroleum-900, #141B27);--ez-tag-input--input-font-size:var(--font-size--default, 14px);--ez-tag-input--placeholder-color:var(--color--gray-400, #77777A);--ez-tag-input--background-color-disabled:var(--color--gray-90, #EAEAEA);--ez-tag-input--helptext-color:var(--color--ocean-green-1000, #00281D);display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;font-family:var(--font--pattern, \'Roboto\', Arial, sans-serif);font-size:var(--font-size--default, 14px);color:var(--color--ocean-green-1000, #00281D);width:100%;border:none;padding:0}label{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--line-height--20, 20px);color:var(--ez-tag-input--label-color);font-weight:var(--ez-tag-input--label-font-weight)}.tag-input__container{display:flex;flex-wrap:wrap;align-items:center;width:100%;box-sizing:border-box;gap:var(--ez-tag-input--gap);padding:var(--ez-tag-input--padding);margin:var(--space--4, 4px) 0;background-color:var(--ez-tag-input--background-color);border-radius:var(--ez-tag-input--border-radius);transition:box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1)}.tag-input__container,.tag-input__container[data-state="default"]{box-shadow:0 0 0 1px var(--ez-tag-input--border-color-default)}.tag-input__container[data-state="error"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-error)}.tag-input__container[data-state="success"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-success)}.tag-input__container[data-state="warning"]{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-warning)}.tag-input__container:focus-within{box-shadow:0 0 0 var(--space--2, 2px) var(--ez-tag-input--border-color-focused)}input{flex:1;height:var(--space--24, 24px);background:transparent;border:none;outline:none;color:var(--ez-tag-input--input-color);font-family:var(--font--pattern, \'Roboto\');font-size:var(--ez-tag-input--input-font-size);font-weight:var(--font-weight--regular, 400);line-height:var(--line-height--20, 20px)}input::placeholder{color:var(--ez-tag-input--placeholder-color)}.tag-input__container[data-disabled="true"]{cursor:not-allowed;background:var(--ez-tag-input--background-color-disabled);box-shadow:0 0 0 1px var(--ez-tag-input--border-color-default)}.tag-input__container[data-disabled="true"]>*{cursor:not-allowed}input:read-only .tag-input__container>*{cursor:default}@keyframes ez-helptext-fadein{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}span{font-size:var(--font-size--xsmall, 10px);line-height:var(--line-height--16, 16px);overflow:hidden;text-overflow:ellipsis;animation:ez-helptext-fadein 0.3s ease;color:var(--ez-tag-input--helptext-color)}';export{n as ez_tag_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as e,H as s}from"./p-
|
|
1
|
+
import{r,h as e,H as s}from"./p-23a36bb6.js";const a=class{constructor(e){r(this,e),this.percent=void 0,this.label=void 0,this.helpText=void 0}renderHeader(){if(this.label)return e("div",{class:"ez-progress-bar__header"},e("span",{class:"ez-progress-bar__header-label"},this.label),e("span",{class:"ez-progress-bar__header-percent"},this.percent,"%"))}renderHelpText(){if(this.helpText)return e("div",{class:"ez-progress-bar__help-text"},this.helpText)}render(){return e(s,null,this.renderHeader(),e("div",{class:"progress-bar__container"},e("div",{class:"progress-bar__content",style:{width:`${this.percent}%`}})),this.renderHelpText())}};a.style=".sc-ez-progress-bar-h{--ez-progress-bar-container-height:var(--space--16, 16px);--ez-progress-bar-radius:var(--border--radius-10, 10px);--ez-progress-bar-container-background:var(--background--medium, #F0F3F7);--ez-progress-bar-container-border:1px solid var(--color--strokes, #DCE0E8);--ez-progress-bar-height:var(--space--12, 12px);--ez-progress-bar-background:var(--color--primary, #008561);--ez-progress-bar-font-size:var(--text--medium, 14px);--ez-progress-bar-header-color:var(--color--ocean-green-1000, #00281D);--ez-progress-bar-gap:var(--space--6, 6px);--ez-progress-bar-help-text-color:var(--color--ocean-green-1000, #00281D);--ez-progress-bar-help-text-font-size:var(--text--small, 12px);display:flex;flex-direction:column;width:100%;gap:var(--ez-progress-bar-gap)}.ez-progress-bar__header.sc-ez-progress-bar{display:flex;flex-direction:row;justify-content:space-between;color:var(--ez-progress-bar-header-color);font-size:var(--ez-progress-bar-font-size)}.progress-bar__container.sc-ez-progress-bar{width:100%;display:flex;align-items:center;justify-content:start;height:var(--ez-progress-bar-container-height);border-radius:var(--ez-progress-bar-radius);background:var(--ez-progress-bar-container-background);border:var(--ez-progress-bar-container-border);padding:var(--space--2, 2px)}.progress-bar__content.sc-ez-progress-bar{height:var(--ez-progress-bar-height);background:var(--ez-progress-bar-background);border-radius:var(--ez-progress-bar-radius)}.ez-progress-bar__help-text.sc-ez-progress-bar{color:var(--ez-progress-bar-help-text-color);font-size:var(--ez-progress-bar-help-text-font-size)}";export{a as ez_progress_bar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as a,H as r,g as e}from"./p-
|
|
1
|
+
import{r as o,h as a,H as r,g as e}from"./p-23a36bb6.js";import{ElementIDUtils as l}from"@sankhyalabs/core";const t=class{constructor(a){o(this,a),this.label=void 0,this.color="ocean-green",this.customBackgroundColor=void 0,this.customLabelColor=void 0}componentDidLoad(){this._element&&l.addIDInfo(this._element),this._tag&&l.addIDInfo(this._tag,"EzTag",{id:"embedded"})}validateLabel(){return this.label&&""!==this.label.trim()}render(){const o=Object.assign({},this.customBackgroundColor&&{"--ez-tag--custom-background-color":`var(${this.customBackgroundColor})`},this.customLabelColor&&{"--ez-tag_label--custom-color":`var(${this.customLabelColor})`});return a(r,{style:o},a("div",{ref:o=>{this._tag=o},class:`tag ${this.color||""}`},this.validateLabel()&&a("label",{title:this.label},this.label)))}get _element(){return e(this)}};t.style=":host{--ez-tag--padding-x:var(--space--8, 8px);--ez-tag--padding-y:var(--space--4, 4px);--ez-tag--min-width:var(--space--6, 6px);--ez-tag--min-height:var(--space--14, 14px);--ez-tag--border-radius:var(--border--radius-24, 24px);--ez-tag--background-color:var(--color--ocean-green-600, #008561);--ez-tag_label--font-weight:var(--font-weight--regular, 400);--ez-tag_label--font-size:var(--font-size--default, 14px);--ez-tag_label--color:var(--color--gray-70, #FFFFFF)}.tag{background-color:var(--ez-tag--custom-background-color, var(--ez-tag--background-color));padding:var(--ez-tag--padding-y) var(--ez-tag--padding-x);border-radius:var(--ez-tag--border-radius);min-width:var(--ez-tag--min-width);min-height:var(--ez-tag--min-height);display:inline-flex;justify-content:center;align-items:center}label{font-weight:var(--ez-tag_label--font-weight);font-size:var(--ez-tag_label--font-size);color:var(--ez-tag_label--custom-color, var(--ez-tag_label--color));font-family:var(--font--pattern, Arial);line-height:var(--ez-tag_label--font-size);text-align:center;line-height:normal}.light-ocean-green{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--ocean-green-100));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--ocean-green-600))}.green{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--green-600));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--gray-70))}.light-green{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--green-200));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--green-600))}.yellow{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--yellow-600));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--yellow-900))}.light-yellow{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--yellow-200));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--yellow-800))}.red{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--red-600));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--gray-70))}.light-red{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--red-200));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--red-600))}.gray{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--gray-500));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--gray-100))}.light-gray{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--gray-100));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--gray-400))}.petroleum{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--petroleum-600));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--petroleum-200))}.light-petroleum{--ez-tag--background-color:var(--ez-tag--custom-background-color, var(--color--petroleum-100));--ez-tag_label--color:var(--ez-tag_label--custom-color, var(--color--petroleum-400))}";export{t as ez_tag}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as a,F as s}from"./p-e4c7eb39.js";import{a as o,b as r,R as l}from"./p-3e767a74.js";import{i as n}from"./p-641ee538.js";import"@sankhyalabs/core";const c=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.textToShow=void 0,this.link=void 0,this.openInNewGuide=!1}async show(e){this._popupElement.opened=!0,e&&(this.textToShow=e)}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.clearValues(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}clearValues(){this.link="",this.textToShow="",this.openInNewGuide=!1}async handleCreateLink(){this.executeToolbarCommand.emit({command:o.FORMAT,value:`<a href="${this.link}" ${this.openInNewGuide?'target="_blank" rel="noopener noreferrer"':""}>${this.textToShow?this.textToShow:this.link}</a>`}),this.clearValues(),await this.hide()}async handleActionPopup(e){"OK"!==e.detail?"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel():await this.handleCreateLink()}getOkButtonStatus(){var e;return(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{heightMode:"auto",size:"small",useHeader:!1,ref:e=>this._popupElement=e,onEzClosePopup:()=>this.clearValues()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-link-builder.addLinkTitle"),modalSubTitle:this.i18n("ez-link-builder.addLinkSubtitle"),okButtonLabel:this.i18n("ez-link-builder.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"link-builder-container"},i("ez-text-input",{id:"link_url_input",label:this.i18n("ez-link-builder.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail}),i("ez-text-input",{id:"link_text_input",label:this.i18n("ez-link-builder.textInputLabel"),value:this.textToShow,onEzChange:e=>this.textToShow=e.detail}),i("ez-check",{label:this.i18n("ez-link-builder.openInNewPage"),value:this.openInNewGuide,onEzChange:e=>this.openInNewGuide=e.detail})))))}};c.style=".link-builder-container.sc-ez-link-builder{font-family:'Roboto';color:#2b3a54;display:flex;flex-direction:column;gap:10px;justify-content:space-between}.header.sc-ez-link-builder{display:flex;font-weight:500;font-size:16px}.actions.sc-ez-link-builder{display:flex;justify-content:flex-end;gap:12px;margin-top:12px;width:100%}";const h=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.showPreview=!0,this.isPreviewMode=!1,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}async componentWillLoad(){this.i18n=await n()}handleActionTriggered(e){this.executeToolbarCommand.emit({command:e.detail.command,value:e.detail.value})}handleClickPreview(){this.executeToolbarCommand.emit({command:o.PREVIEW})}renderArrows(){if(this.showUndoRedo)return i("div",{id:"rich-toolbar-undo-redo",class:"taskbar-group"},i("ez-rich-toolbar-arrows",null))}renderLetters(){if(this.showTextFormat)return i("div",{id:"rich-toolbar-text-format",class:"taskbar-group"},i("ez-rich-toolbar-letters",null))}renderConfigs(){if(this.showConfigs)return i("div",{id:"rich-toolbar-options-configs",class:"taskbar-group"},i("ez-rich-toolbar-configs",null))}renderPreview(){if(this.showPreview)return i("div",{class:"taskbar-group"},i("span",{id:"rich-text-preview-btn",class:"preview-btn",title:this.getPreviewTitle(),onClick:this.handleClickPreview.bind(this)},this.i18n(this.isPreviewMode?"ez-rich-text.edit":"ez-rich-text.preview")))}getPreviewTitle(){return this.i18n(this.isPreviewMode?"ez-rich-text.title.edit":"ez-rich-text.title.preview")}render(){return i(a,null,i("div",{class:"taskbar"},this.renderPreview(),this.renderArrows(),this.renderLetters(),this.renderConfigs()))}};h.style=".sc-ez-rich-toolbar-h{display:block;width:100%}.taskbar.sc-ez-rich-toolbar{display:flex;padding:8px;border-radius:4px 4px 0 0}.taskbar-group.sc-ez-rich-toolbar{display:flex;margin-right:15px;padding-right:15px;border-right:1px solid #ddd}.taskbar-group.sc-ez-rich-toolbar:last-child{border-right:none}.preview-btn.sc-ez-rich-toolbar{font-family:Roboto;font-size:14px;background:none;display:flex;align-items:center;padding:0 8px;border-radius:4px;cursor:pointer;color:var(--color--secondary, #383c45);transition:0.3s all ease-in-out;width:110px;justify-content:center}.preview-btn.sc-ez-rich-toolbar:hover{background-color:#f5f5f5}";const d=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.UNDO,command:o.UNDO,title:this.i18n("ez-rich-text.title.undo")}),i("ez-rich-toolbar-item",{icon:r.REDO,command:o.REDO,title:this.i18n("ez-rich-text.title.redo")}))}};d.style=".sc-ez-rich-toolbar-arrows-h{display:flex;gap:5px}";const p=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.LIST,command:o.FORMAT,value:l.LIST,title:this.i18n("ez-rich-text.title.list")}),i("ez-rich-toolbar-item",{icon:r.IMAGE,command:o.IMAGE,title:this.i18n("ez-rich-text.title.image")}),i("ez-rich-toolbar-item",{icon:r.LINK,command:o.LINK,title:this.i18n("ez-rich-text.title.link")}))}};p.style=".sc-ez-rich-toolbar-configs-h{display:flex;gap:5px}";const u=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.BOLD,command:o.FORMAT,value:l.BOLD,title:this.i18n("ez-rich-text.title.bold")}),i("ez-rich-toolbar-item",{icon:r.ITALIC,command:o.FORMAT,value:l.ITALIC,title:this.i18n("ez-rich-text.title.italic")}),i("ez-rich-toolbar-item",{icon:r.UNDERLINE,command:o.FORMAT,value:l.UNDERLINE,title:this.i18n("ez-rich-text.title.underline")}))}};function m(e,t=1){if(0===e)return"0 Bytes";const i=t<0?0:t,a=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,a)).toFixed(i))+" "+["Bytes","Kilobytes","Megabytes","Gigabytes","Terabytes","Petabytes","Exabytes","Zettabytes","Yottabytes"][a]}u.style=".sc-ez-rich-toolbar-letters-h{display:flex;gap:5px}";const b=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.link=void 0,this.base64=void 0,this.messageError=void 0,this.selectedFile=void 0,this.maxSize=500}async show(){this._popupElement.opened=!0}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.removeSelectedFile(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}removeSelectedFile(e){null==e||e.stopPropagation(),this.link=void 0,this.base64=void 0,this.selectedFile=void 0,this.messageError=void 0}triggerFileSelect(){this.selectedFile||this._fileInput.click()}async handleImage(e){const t=e&&e[0];t&&(t.size<1e3*this.maxSize?(this.selectedFile=t,this.base64=await function(e){return new Promise(((t,i)=>{try{const i=new FileReader;i.onload=()=>{t(i.result)},i.readAsDataURL(e)}catch(e){i(e)}}))}(t)):this.messageError=this.i18n("ez-simple-image-uploader.imageTooLarge",{maxSize:m(this.maxSize)}))}getFileList(e){return e instanceof DragEvent?Array.from(e.dataTransfer.files):e.target.files}handleFileChange(e){e.preventDefault(),this.messageError=void 0,this._dropZone.classList.remove("dragging");const t=this.getFileList(e);this.handleImage(t),e.target.value=""}handleDragOver(e){e.stopPropagation(),e.preventDefault()}handleDragEnter(e){e.preventDefault(),this._dropZone.classList.add("dragging")}handleDragLeave(e){e.preventDefault(),this._dropZone.contains(e.relatedTarget)||this._dropZone.classList.remove("dragging")}async handleActionPopup(e){"OK"===e.detail?await this.handleCreateImgTag():"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel()}async handleCreateImgTag(){var e;const t=`<img src="${null!==(e=this.base64)&&void 0!==e?e:this.link}" alt="${this.i18n("ez-simple-image-uploader.imageAlt")}" />`;this.executeToolbarCommand.emit({command:o.FORMAT,value:t}),this.removeSelectedFile(),await this.hide()}getOkButtonStatus(){var e;return this.base64||(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{ref:e=>this._popupElement=e,heightMode:"auto",size:"small",useHeader:!1,onEzClosePopup:()=>this.handleCancel()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-simple-image-uploader.uploadTitle"),modalSubTitle:this.i18n("ez-simple-image-uploader.uploadSubtitle"),okButtonLabel:this.i18n("ez-simple-image-uploader.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"image-uploader-container"},i("ez-tooltip",{message:this.i18n("ez-simple-image-uploader.tooltipMessage"),active:!!this.selectedFile},i("ez-text-input",{label:this.i18n("ez-simple-image-uploader.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail,enabled:!this.selectedFile})),i("span",null,this.i18n("ez-simple-image-uploader.orText")),i("section",{class:"drop-zone-section"},i("div",{ref:e=>this._dropZone=e,class:"drop-zone",onDrop:e=>this.handleFileChange(e),onDragOver:e=>this.handleDragOver(e),onDragEnter:e=>this.handleDragEnter(e),onDragLeave:e=>this.handleDragLeave(e)},i("div",{class:{"drop-zone-container":!0,clickable:!this.selectedFile},onClick:()=>this.triggerFileSelect()},this.selectedFile?i(s,null,i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.selectedFile.name," (",m(this.selectedFile.size),")"),i("button",{class:"button-close",onClick:e=>this.removeSelectedFile(e),title:this.i18n("ez-simple-image-uploader.removeFile")},i("ez-icon",{iconName:"close"}))):i(s,null,i("ez-icon",{iconName:"anexo"}),i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.i18n("ez-simple-image-uploader.dragDropText")))),i("input",{ref:e=>this._fileInput=e,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>this.handleFileChange(e)})),!!this.messageError&&i("span",{class:"text-error"},this.messageError))))))}};b.style='.image-uploader-container.sc-ez-simple-image-uploader{font-family:"Roboto";color:#2b3a54;display:flex;flex-direction:column;gap:var(--space--10, 10px);justify-content:space-between;align-items:center;padding-bottom:var(--space--8, 8px)}.header.sc-ez-simple-image-uploader{display:flex;font-weight:500;font-size:var(--font-size--medium, 16px)}.actions.sc-ez-simple-image-uploader{display:flex;justify-content:flex-end;gap:var(--space--12, 12px);margin-top:var(--space--12, 12px);width:100%}.drop-zone-section.sc-ez-simple-image-uploader{width:100%}.drop-zone.sc-ez-simple-image-uploader{display:flex;flex-wrap:wrap;background-color:var(--color--petroleum-70, #F4F6F9);padding:var(--space--6, 6px);width:100%;border-radius:var(--space--12, 12px);box-sizing:border-box;min-height:100px}.clickable.sc-ez-simple-image-uploader{cursor:pointer}.dragging.sc-ez-simple-image-uploader{background-color:var(--color--petroleum-100, #C8CCD3)}.drop-zone-container.sc-ez-simple-image-uploader{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:6px;box-sizing:border-box}.text-error.sc-ez-simple-image-uploader{font-family:var(--font--pattern, "Roboto");color:var(--color--red-600, #BD0025);font-size:var(--font-size--small, 12px)}.button-close.sc-ez-simple-image-uploader{border:none;background:none;cursor:pointer}';export{c as ez_link_builder,h as ez_rich_toolbar,d as ez_rich_toolbar_arrows,p as ez_rich_toolbar_configs,u as ez_rich_toolbar_letters,b as ez_simple_image_uploader}
|
|
1
|
+
import{r as e,c as t,h as i,H as a,F as s}from"./p-23a36bb6.js";import{a as o,b as r,R as l}from"./p-3e767a74.js";import{i as n}from"./p-641ee538.js";import"@sankhyalabs/core";const c=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.textToShow=void 0,this.link=void 0,this.openInNewGuide=!1}async show(e){this._popupElement.opened=!0,e&&(this.textToShow=e)}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.clearValues(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}clearValues(){this.link="",this.textToShow="",this.openInNewGuide=!1}async handleCreateLink(){this.executeToolbarCommand.emit({command:o.FORMAT,value:`<a href="${this.link}" ${this.openInNewGuide?'target="_blank" rel="noopener noreferrer"':""}>${this.textToShow?this.textToShow:this.link}</a>`}),this.clearValues(),await this.hide()}async handleActionPopup(e){"OK"!==e.detail?"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel():await this.handleCreateLink()}getOkButtonStatus(){var e;return(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{heightMode:"auto",size:"small",useHeader:!1,ref:e=>this._popupElement=e,onEzClosePopup:()=>this.clearValues()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-link-builder.addLinkTitle"),modalSubTitle:this.i18n("ez-link-builder.addLinkSubtitle"),okButtonLabel:this.i18n("ez-link-builder.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"link-builder-container"},i("ez-text-input",{id:"link_url_input",label:this.i18n("ez-link-builder.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail}),i("ez-text-input",{id:"link_text_input",label:this.i18n("ez-link-builder.textInputLabel"),value:this.textToShow,onEzChange:e=>this.textToShow=e.detail}),i("ez-check",{label:this.i18n("ez-link-builder.openInNewPage"),value:this.openInNewGuide,onEzChange:e=>this.openInNewGuide=e.detail})))))}};c.style=".link-builder-container.sc-ez-link-builder{font-family:'Roboto';color:#2b3a54;display:flex;flex-direction:column;gap:10px;justify-content:space-between}.header.sc-ez-link-builder{display:flex;font-weight:500;font-size:16px}.actions.sc-ez-link-builder{display:flex;justify-content:flex-end;gap:12px;margin-top:12px;width:100%}";const h=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.showPreview=!0,this.isPreviewMode=!1,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}async componentWillLoad(){this.i18n=await n()}handleActionTriggered(e){this.executeToolbarCommand.emit({command:e.detail.command,value:e.detail.value})}handleClickPreview(){this.executeToolbarCommand.emit({command:o.PREVIEW})}renderArrows(){if(this.showUndoRedo)return i("div",{id:"rich-toolbar-undo-redo",class:"taskbar-group"},i("ez-rich-toolbar-arrows",null))}renderLetters(){if(this.showTextFormat)return i("div",{id:"rich-toolbar-text-format",class:"taskbar-group"},i("ez-rich-toolbar-letters",null))}renderConfigs(){if(this.showConfigs)return i("div",{id:"rich-toolbar-options-configs",class:"taskbar-group"},i("ez-rich-toolbar-configs",null))}renderPreview(){if(this.showPreview)return i("div",{class:"taskbar-group"},i("span",{id:"rich-text-preview-btn",class:"preview-btn",title:this.getPreviewTitle(),onClick:this.handleClickPreview.bind(this)},this.i18n(this.isPreviewMode?"ez-rich-text.edit":"ez-rich-text.preview")))}getPreviewTitle(){return this.i18n(this.isPreviewMode?"ez-rich-text.title.edit":"ez-rich-text.title.preview")}render(){return i(a,null,i("div",{class:"taskbar"},this.renderPreview(),this.renderArrows(),this.renderLetters(),this.renderConfigs()))}};h.style=".sc-ez-rich-toolbar-h{display:block;width:100%}.taskbar.sc-ez-rich-toolbar{display:flex;padding:8px;border-radius:4px 4px 0 0}.taskbar-group.sc-ez-rich-toolbar{display:flex;margin-right:15px;padding-right:15px;border-right:1px solid #ddd}.taskbar-group.sc-ez-rich-toolbar:last-child{border-right:none}.preview-btn.sc-ez-rich-toolbar{font-family:Roboto;font-size:14px;background:none;display:flex;align-items:center;padding:0 8px;border-radius:4px;cursor:pointer;color:var(--color--secondary, #383c45);transition:0.3s all ease-in-out;width:110px;justify-content:center}.preview-btn.sc-ez-rich-toolbar:hover{background-color:#f5f5f5}";const d=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.UNDO,command:o.UNDO,title:this.i18n("ez-rich-text.title.undo")}),i("ez-rich-toolbar-item",{icon:r.REDO,command:o.REDO,title:this.i18n("ez-rich-text.title.redo")}))}};d.style=".sc-ez-rich-toolbar-arrows-h{display:flex;gap:5px}";const p=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.LIST,command:o.FORMAT,value:l.LIST,title:this.i18n("ez-rich-text.title.list")}),i("ez-rich-toolbar-item",{icon:r.IMAGE,command:o.IMAGE,title:this.i18n("ez-rich-text.title.image")}),i("ez-rich-toolbar-item",{icon:r.LINK,command:o.LINK,title:this.i18n("ez-rich-text.title.link")}))}};p.style=".sc-ez-rich-toolbar-configs-h{display:flex;gap:5px}";const u=class{constructor(t){e(this,t)}async componentWillLoad(){this.i18n=await n()}render(){return i(a,null,i("ez-rich-toolbar-item",{icon:r.BOLD,command:o.FORMAT,value:l.BOLD,title:this.i18n("ez-rich-text.title.bold")}),i("ez-rich-toolbar-item",{icon:r.ITALIC,command:o.FORMAT,value:l.ITALIC,title:this.i18n("ez-rich-text.title.italic")}),i("ez-rich-toolbar-item",{icon:r.UNDERLINE,command:o.FORMAT,value:l.UNDERLINE,title:this.i18n("ez-rich-text.title.underline")}))}};function m(e,t=1){if(0===e)return"0 Bytes";const i=t<0?0:t,a=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,a)).toFixed(i))+" "+["Bytes","Kilobytes","Megabytes","Gigabytes","Terabytes","Petabytes","Exabytes","Zettabytes","Yottabytes"][a]}u.style=".sc-ez-rich-toolbar-letters-h{display:flex;gap:5px}";const b=class{constructor(i){e(this,i),this.executeToolbarCommand=t(this,"executeToolbarCommand",7),this.link=void 0,this.base64=void 0,this.messageError=void 0,this.selectedFile=void 0,this.maxSize=500}async show(){this._popupElement.opened=!0}async hide(){this._popupElement.opened=!1}async componentWillLoad(){this.i18n=await n()}async handleCancel(){this.removeSelectedFile(),this.executeToolbarCommand.emit({command:o.FOCUS}),await this.hide()}removeSelectedFile(e){null==e||e.stopPropagation(),this.link=void 0,this.base64=void 0,this.selectedFile=void 0,this.messageError=void 0}triggerFileSelect(){this.selectedFile||this._fileInput.click()}async handleImage(e){const t=e&&e[0];t&&(t.size<1e3*this.maxSize?(this.selectedFile=t,this.base64=await function(e){return new Promise(((t,i)=>{try{const i=new FileReader;i.onload=()=>{t(i.result)},i.readAsDataURL(e)}catch(e){i(e)}}))}(t)):this.messageError=this.i18n("ez-simple-image-uploader.imageTooLarge",{maxSize:m(this.maxSize)}))}getFileList(e){return e instanceof DragEvent?Array.from(e.dataTransfer.files):e.target.files}handleFileChange(e){e.preventDefault(),this.messageError=void 0,this._dropZone.classList.remove("dragging");const t=this.getFileList(e);this.handleImage(t),e.target.value=""}handleDragOver(e){e.stopPropagation(),e.preventDefault()}handleDragEnter(e){e.preventDefault(),this._dropZone.classList.add("dragging")}handleDragLeave(e){e.preventDefault(),this._dropZone.contains(e.relatedTarget)||this._dropZone.classList.remove("dragging")}async handleActionPopup(e){"OK"===e.detail?await this.handleCreateImgTag():"CANCEL"!==e.detail&&"CLOSE"!==e.detail||await this.handleCancel()}async handleCreateImgTag(){var e;const t=`<img src="${null!==(e=this.base64)&&void 0!==e?e:this.link}" alt="${this.i18n("ez-simple-image-uploader.imageAlt")}" />`;this.executeToolbarCommand.emit({command:o.FORMAT,value:t}),this.removeSelectedFile(),await this.hide()}getOkButtonStatus(){var e;return this.base64||(null===(e=this.link)||void 0===e?void 0:e.trim())?"ENABLED":"DISABLED"}render(){return i("ez-popup",{ref:e=>this._popupElement=e,heightMode:"auto",size:"small",useHeader:!1,onEzClosePopup:()=>this.handleCancel()},i("div",null,i("ez-modal-container",{modalTitle:this.i18n("ez-simple-image-uploader.uploadTitle"),modalSubTitle:this.i18n("ez-simple-image-uploader.uploadSubtitle"),okButtonLabel:this.i18n("ez-simple-image-uploader.submit"),cancelButtonLabel:this.i18n("app.cancel"),onEzModalAction:this.handleActionPopup.bind(this),okButtonStatus:this.getOkButtonStatus()},i("div",{class:"image-uploader-container"},i("ez-tooltip",{message:this.i18n("ez-simple-image-uploader.tooltipMessage"),active:!!this.selectedFile},i("ez-text-input",{label:this.i18n("ez-simple-image-uploader.urlInputLabel"),value:this.link,onEzChange:e=>this.link=e.detail,enabled:!this.selectedFile})),i("span",null,this.i18n("ez-simple-image-uploader.orText")),i("section",{class:"drop-zone-section"},i("div",{ref:e=>this._dropZone=e,class:"drop-zone",onDrop:e=>this.handleFileChange(e),onDragOver:e=>this.handleDragOver(e),onDragEnter:e=>this.handleDragEnter(e),onDragLeave:e=>this.handleDragLeave(e)},i("div",{class:{"drop-zone-container":!0,clickable:!this.selectedFile},onClick:()=>this.triggerFileSelect()},this.selectedFile?i(s,null,i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.selectedFile.name," (",m(this.selectedFile.size),")"),i("button",{class:"button-close",onClick:e=>this.removeSelectedFile(e),title:this.i18n("ez-simple-image-uploader.removeFile")},i("ez-icon",{iconName:"close"}))):i(s,null,i("ez-icon",{iconName:"anexo"}),i("span",{class:"ez-text ez-text--primary ez-text--medium"},this.i18n("ez-simple-image-uploader.dragDropText")))),i("input",{ref:e=>this._fileInput=e,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>this.handleFileChange(e)})),!!this.messageError&&i("span",{class:"text-error"},this.messageError))))))}};b.style='.image-uploader-container.sc-ez-simple-image-uploader{font-family:"Roboto";color:#2b3a54;display:flex;flex-direction:column;gap:var(--space--10, 10px);justify-content:space-between;align-items:center;padding-bottom:var(--space--8, 8px)}.header.sc-ez-simple-image-uploader{display:flex;font-weight:500;font-size:var(--font-size--medium, 16px)}.actions.sc-ez-simple-image-uploader{display:flex;justify-content:flex-end;gap:var(--space--12, 12px);margin-top:var(--space--12, 12px);width:100%}.drop-zone-section.sc-ez-simple-image-uploader{width:100%}.drop-zone.sc-ez-simple-image-uploader{display:flex;flex-wrap:wrap;background-color:var(--color--petroleum-70, #F4F6F9);padding:var(--space--6, 6px);width:100%;border-radius:var(--space--12, 12px);box-sizing:border-box;min-height:100px}.clickable.sc-ez-simple-image-uploader{cursor:pointer}.dragging.sc-ez-simple-image-uploader{background-color:var(--color--petroleum-100, #C8CCD3)}.drop-zone-container.sc-ez-simple-image-uploader{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:6px;box-sizing:border-box}.text-error.sc-ez-simple-image-uploader{font-family:var(--font--pattern, "Roboto");color:var(--color--red-600, #BD0025);font-size:var(--font-size--small, 12px)}.button-close.sc-ez-simple-image-uploader{border:none;background:none;cursor:pointer}';export{c as ez_link_builder,h as ez_rich_toolbar,d as ez_rich_toolbar_arrows,p as ez_rich_toolbar_configs,u as ez_rich_toolbar_letters,b as ez_simple_image_uploader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as n,H as r,g as s}from"./p-
|
|
1
|
+
import{r as e,h as n,H as r,g as s}from"./p-23a36bb6.js";import{ElementIDUtils as i}from"@sankhyalabs/core";import{g as a}from"./p-641ee538.js";const t=class{constructor(n){e(this,n),this.size="small"}addInfoId(){this._element&&i.addIDInfo(this._element)}async componentWillLoad(){this.i18n=a()}componentDidLoad(){this.addInfoId()}render(){return n(r,null,n("div",{class:"spinner__container","data-size":this.size,role:"status","aria-label":this.i18n?this.i18n("spinner.loading"):"Carregando..."},n("svg",{viewBox:"0 0 24 24",class:"spinner__svg"},n("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round",class:"spinner__path"}))))}get _element(){return s(this)}};t.style=':host{--ez-spinner--color:var(--color--ocean-green-600, #008561);--ez-spinner--size-default:24px;--ez-spinner--size-medium:32px;--ez-spinner--size-large:42px;--ez-spinner--animation-duration:1.4s;display:inline-flex;align-items:center;justify-content:center}.spinner__container{display:inline-flex;align-items:center;justify-content:center}.spinner__svg{color:var(--ez-spinner--color);width:var(--ez-spinner--size-default);height:var(--ez-spinner--size-default)}.spinner__container[data-size="medium"] .spinner__svg{width:var(--ez-spinner--size-medium);height:var(--ez-spinner--size-medium)}.spinner__container[data-size="large"] .spinner__svg{width:var(--ez-spinner--size-large);height:var(--ez-spinner--size-large)}.spinner__path{animation:spinner-dash var(--ez-spinner--animation-duration) ease-in-out infinite,\n spinner-rotate var(--ez-spinner--animation-duration) linear infinite;transform-origin:center;will-change:stroke-dasharray, stroke-dashoffset}@keyframes spinner-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes spinner-dash{0%{stroke-dasharray:1, 63;stroke-dashoffset:0}50%{stroke-dasharray:32, 63;stroke-dashoffset:-16}100%{stroke-dasharray:1, 63;stroke-dashoffset:-63}}';export{t as ez_spinner}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as o,h as i,H as e,g as s}from"./p-
|
|
1
|
+
import{r as t,c as o,h as i,H as e,g as s}from"./p-23a36bb6.js";import{FloatingManager as r}from"@sankhyalabs/core";const n=class{constructor(i){t(this,i),this.ezVisibilityChange=o(this,"ezVisibilityChange",7),this._firstRender=!0,this.innerClickTest=(t,o,i)=>{const e=[t];this.innerElement&&("string"==typeof this.innerElement?e.push(document.querySelector(`#${this.innerElement}`)):this.innerElement.forEach((t=>{e.push(document.querySelector(`#${t}`))})));const s=(null==i?void 0:i.composedPath())||[];for(var r=0;r<e.length;r++){let t=e[r];if(null!=t){if(s.includes(t))return!0;if(t.contains(o))return!0;if(i&&"nodeType"in(null==i?void 0:i.target)&&t.contains(i.target))return!0;if(t.shadowRoot&&t.shadowRoot.contains(o))return!0;if(t=this._host,t.lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(o):t.contains(o))return!0}}return!1},this.backClickListener=()=>{this.ezVisibilityChange.emit(!1)},this.autoClose=!0,this.boxWidth="fit-content",this.opened=void 0,this.innerElement=void 0,this.overlayType="light"}observeOpened(t,o){t!=o&&(o?this.hide():this.show(),this.ezVisibilityChange.emit(t))}async updatePosition(t,o){r.updateFloatPosition(this._box,this._container,{autoClose:this.autoClose,top:t,left:o,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener})}async show(t,o){this.float({top:t,left:o})}async showUnder(t,o){t&&this._host?this.float(this.calculatePosition(t,Object.assign({verticalGap:0,horizontalGap:0,fromRight:!1},o))):this.show((null==o?void 0:o.verticalGap)?`${o.verticalGap}px`:void 0,(null==o?void 0:o.horizontalGap)?`${o.horizontalGap}px`:void 0)}calculatePosition(t,o){const i=this._host.getBoundingClientRect(),e=t.getBoundingClientRect(),s=`${(o.fromRight?i.right-e.right:e.x-i.x)+o.horizontalGap}px`;return{top:`${e.bottom-i.y+o.verticalGap}px`,left:o.fromRight?"":s,right:o.fromRight?s:""}}float(t){this._box.style.top="",this._box.style.left="",this._box.style.right="";const o="none"!==this.overlayType,i=`ez-scrim ez-scrim--${this.overlayType}`;let e=Object.assign(Object.assign({},t),{autoClose:this.autoClose,innerClickTest:this.innerClickTest,backClickListener:this.backClickListener});o&&(e=Object.assign(Object.assign({},e),{autoClose:!0,useOverlay:o,overlayClassName:i})),this._floatingID=r.float(this._box,this._container,e),this.opened=!0}async hide(){void 0!==this._floatingID&&(r.close(this._floatingID),this._floatingID=void 0,this.opened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return i(e,null,i("section",{ref:t=>this._container=t},i("div",{class:"popover__box "+("fit-content"===this.boxWidth?"popover__box--fit-content":"popover__box--full-width"),ref:t=>this._box=t},i("slot",null))))}get _host(){return s(this)}static get watchers(){return{opened:["observeOpened"]}}};n.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--most-visible, 3);position:relative;display:flex;user-select:none}.popover__box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";export{n as ez_popover}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as o,H as i,g as e}from"./p-
|
|
1
|
+
import{r as t,h as o,H as i,g as e}from"./p-23a36bb6.js";import{a,c as s,o as r,f as l,s as h,b as n}from"./p-2a806303.js";import{ElementIDUtils as p}from"@sankhyalabs/core";const d=class{constructor(o){t(this,o),this._opened=!1,this.message=void 0,this.anchoringElement=void 0,this.placement="bottom",this.gapOptions={horizontalGap:0,verticalGap:0},this.type="default",this.debouncingTime=500,this.active=!0,this.maxWidth=200,this.useAnchorSize=!1,this.strategy="absolute"}watchAnchoringElement(t,o){t&&(this.setEvents(t),this.removeEvents(o))}watchMessage(t){t?this.updatePosition():this.closeTooltip()}openTooltip(){this.message&&this.active&&(this._debouncingTimeout&&clearTimeout(this._debouncingTimeout),this._debouncingTimeout=setTimeout((()=>{this._opened=!0,this._tooltipElement.style.display="block",this.updatePosition()}),this.debouncingTime))}closeTooltip(){clearTimeout(this._debouncingTimeout),this._tooltipElement.style.display="none",this._opened=!1}async updatePosition(t=this.anchoringElement){if(t&&this._opened){if(this.useAnchorSize){const o=t.getBoundingClientRect().width;this._tooltipElement.style.width=`${o}px`}this._cleanup&&this._cleanup(),this._cleanup=a(t,this._tooltipElement,(()=>{s(t,this._tooltipElement,{placement:this.placement,strategy:this.strategy,middleware:[r(5),l(),h({padding:8}),n({element:this._arrowElement})]}).then((({x:t,y:o,placement:i,middlewareData:e})=>{const a=i.includes("bottom")?o+this.gapOptions.verticalGap:o-this.gapOptions.verticalGap,s=i.includes("start")?t+this.gapOptions.horizontalGap:t-this.gapOptions.horizontalGap;if(Object.assign(this._tooltipElement.style,{top:`${a}px`,left:`${s}px`}),e.arrow){const{x:t}=e.arrow,o=i.includes("bottom");Object.assign(this._arrowElement.style,{left:`${t}px`,top:o?-this._arrowElement.offsetHeight/2+"px":"",bottom:o?"":-this._arrowElement.offsetHeight/2+"px"})}}))}))}}handleSlotChange(t){const o=t.target.assignedElements()[0];this.anchoringElement=o}setEvents(t=this.anchoringElement){t&&(this.removeEvents(t),this._mouseEnterHandler=()=>this.openTooltip(),this._mouseLeaveHandler=()=>this.closeTooltip(),t.addEventListener("mouseenter",this._mouseEnterHandler),t.addEventListener("mouseleave",this._mouseLeaveHandler))}removeEvents(t=this.anchoringElement){t&&(this._mouseEnterHandler&&t.removeEventListener("mouseenter",this._mouseEnterHandler),this._mouseLeaveHandler&&t.removeEventListener("mouseleave",this._mouseLeaveHandler))}componentDidLoad(){this.setEvents(),this.addInfoId()}addInfoId(){this._element&&p.addIDInfo(this._element)}disconnectedCallback(){this.removeEvents(),this._cleanup&&this._cleanup(),clearTimeout(this._debouncingTimeout)}render(){return o(i,null,o("div",Object.assign({ref:t=>this._tooltipElement=t},{inert:!0},{class:"tooltip","data-type":this.type,"data-active":this.active.toString(),"data-strategy":this.strategy,style:{maxWidth:this.maxWidth&&!this.useAnchorSize?`${this.maxWidth}px`:void 0},role:"tooltip","data-element-id":p.getInternalIDInfo("tooltip")}),this.message,o("div",{ref:t=>this._arrowElement=t,class:"arrow"})),o("slot",{onSlotchange:t=>{this.handleSlotChange(t)}}))}get _element(){return e(this)}static get watchers(){return{anchoringElement:["watchAnchoringElement"],message:["watchMessage"]}}};d.style=':host{--ez-tooltip--triangle-size:var(--space--8);--ez-tooltip--z-index:var(--elevation--24);--ez-tooltip--padding:var(--space--4) var(--space--8);--ez-tooltip--border-radius:var(--border--radius-8);--ez-tooltip--font-family:var(--font--pattern);--ez-tooltip--font-size:var(--font-size--small);--ez-tooltip--font-weight:var(--font-weight--regular);width:100%}.tooltip{position:absolute;z-index:var(--ez-tooltip--z-index);padding:var(--ez-tooltip--padding);border-radius:var(--ez-tooltip--border-radius);box-sizing:border-box;font-family:var(--ez-tooltip--font-family);font-size:var(--ez-tooltip--font-size);font-weight:var(--ez-tooltip--font-weight);text-align:center;width:max-content;display:none}.tooltip[data-strategy="fixed"]{position:fixed}.arrow{position:absolute;width:var(--ez-tooltip--triangle-size);height:var(--ez-tooltip--triangle-size);transform:rotate(45deg)}.tooltip[data-type="default"]{background:var(--color--petroleum-600);color:var(--color--gray-70)}.tooltip[data-type="default"] .arrow{background:var(--color--petroleum-600)}.tooltip[data-type="error"]{background:var(--color--red-600);color:var(--color--red-100)}.tooltip[data-type="error"] .arrow{background:var(--color--red-600)}.tooltip[data-type="success"]{background:var(--color--green-600);color:var(--color--green-100)}.tooltip[data-type="success"] .arrow{background:var(--color--green-600)}.tooltip[data-type="warning"]{background:var(--color--yellow-600);color:var(--color--yellow-100)}.tooltip[data-type="warning"] .arrow{background:var(--color--yellow-600)}.tooltip[data-active="false"]{display:none !important}';export{d as ez_tooltip}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as t,h as a}from"./p-23a36bb6.js";const i=class{constructor(a){o(this,a),this.applicationLoaded=t(this,"applicationLoaded",7)}componentWillLoad(){}componentDidLoad(){this.applicationLoaded.emit(!0)}render(){return a("div",null)}};i.style="";export{i as ez_application}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as o,h as e,g as a}from"./p-e4c7eb39.js";import{D as n}from"./p-ab574d59.js";import{FloatingManager as l,ElementIDUtils as r,KeyboardManager as d}from"@sankhyalabs/core";import{F as c}from"./p-dc628ed3.js";import{i as s}from"./p-641ee538.js";class h{constructor(t,i,o,e,a,n,l,r,d,c){this.title=t,this.message=i,this.dialogType=o,this.confirm=e,this.icon=a,this.labelCancel=n,this.labelConfirm=l,this.btnConfirmDanger=r,this.callBack=d,this.beforeClose=c}}const g=class{constructor(o){t(this,o),this.ezCancel=i(this,"ezCancel",7),this.ezAccept=i(this,"ezAccept",7),this.PRIMARY_BUTTON_ID="EZ_DIALOG_PRIMARY_BUTTON",this.btnConfirmDanger=!1,this._messageQueue=[],this._canFocusOnPrimaryBtn=!1,this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(t,i){this.manageOverflow(),t&&!i&&(this._canFocusOnPrimaryBtn=!0)}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=l.subscribeOverlayControl(this._overlayRef):l.unsubscribeOverlayControl(this._overlayRef||this._overlayId)}handleButtonClick(t){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(t)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(t),t?this.ezAccept.emit(t):this.ezCancel.emit(t),this._currentMessage=this._messageQueue.shift(),o(this))}async show(t,i,o,e,a,n,l,r,d){return this.opened=!0,new Promise((c=>{this._messageQueue.push(new h(t,i,o,e,a,n,l,r,c,d))}))}isCritical(t){return t===n.CRITICAL}getIconElement(t){if(t.dialogType===n.DEFAULT)return;const i=this.getIconClass(t.dialogType);return e("div",{class:`changeable__icon__container ${i}`},e("ez-icon",{class:"changeable__icon",size:"small",iconName:this.getIconName(t)}))}getIconClass(t){return this.isCritical(t)?"title-icon--critical":t===n.SUCCESS?"title-icon--success":t===n.WARN?"title-icon--warn":""}getIconName(t){return t.icon?t.icon:this.isCritical(t.dialogType)?"alert-circle-inverted":t.dialogType===n.WARN?"warning-outline":t.dialogType===n.SUCCESS?"check":void 0}getTypeIndicatorElement(t){if(t.dialogType!==n.DEFAULT)return e("div",{class:this.getClassIconIndicator(t.dialogType)})}getClassIconIndicator(t){return this.isCritical(t)?"dialog__critical--indicator":t==n.SUCCESS?"dialog__success--indicator":t==n.WARN?"dialog__warning--indicator":""}getClassContainer(t){return(t.dialogType||n.DEFAULT)===n.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(t){return null==this.getIconElement(t)?"title title__label title__label--no-icon":"title title__label"}async componentWillLoad(){this.i18n=await s()}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new h(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.i18n("app.no"),this.i18n("app.yes"),this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){r.addIDInfo(this._element),this._keyboardManager=new d({propagate:!1,element:this._element}).bind("Enter",(()=>this.handleButtonClick(!0)),{description:this.i18n("ez-dialog.confirmButton"),element:this._element}).bind("Escape",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element}).bind("Esc",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element})}componentDidRender(){this.manageOverlay(),this.focusOnDialog(),this.handleFocusOnPrimaryButton()}focusOnDialog(){const t=this._element.shadowRoot.querySelector(".overlay .dialog");t instanceof HTMLDivElement&&(t.style.outline="none",this._lastActiveElement=document.activeElement,t.focus())}handleFocusOnPrimaryButton(){this._canFocusOnPrimaryBtn&&(this.focusOnPrimaryButton(),this._canFocusOnPrimaryBtn=!1)}focusOnPrimaryButton(){const t=this._element.shadowRoot.querySelector(`#${this.PRIMARY_BUTTON_ID}`),i=null==t?void 0:t.shadowRoot.querySelector("button");requestAnimationFrame((()=>{null==i||i.focus()}))}disconnectedCallback(){var t;c.resolveFocus(this._lastActiveElement),this._lastActiveElement=void 0,null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}render(){return this.opened&&this._currentMessage?e("div",{class:"overlay",ref:t=>this._overlayRef=t},e("div",{tabindex:"-1",class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),e("div",{class:this.getClassContainer(this._currentMessage)},e("div",{class:"title__container"},e("div",{class:"title__box"},this.getIconElement(this._currentMessage),e("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":r.getInternalIDInfo("title")})),e("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":r.getInternalIDInfo("buttonClose")})),e("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":r.getInternalIDInfo("message")}),this._currentMessage.confirm&&e("div",{class:"button-yes-no__container"},e("ez-button",{class:"button__cancel","data-element-id":r.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),e("ez-button",{id:this.PRIMARY_BUTTON_ID,class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":r.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&e("div",{class:"button__confirm--container"},e("ez-button",{id:this.PRIMARY_BUTTON_ID,label:"Ok","data-element-id":r.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return a(this)}static get watchers(){return{opened:["observeConfig"]}}};g.style=':host{--dialog__container-padding:var(--space--md, 20px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--medium, 12px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--elevation--100, 100);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:var(--space--medium);overflow-y:auto}.changeable__icon__container{background:var(--dialog__warning--background-color);display:flex;justify-content:center;align-items:center;min-width:26px;min-height:26px;border-radius:50%}.changeable__icon{--ez-icon--color:var(--dialog__icon--color)}.changeable__icon__container.title-icon--critical{background-color:var(--dialog__critical--background-color)}.changeable__icon__container.title-icon--success{background-color:var(--dialog__success--background-color)}.changeable__icon__container.title-icon--warn{background-color:var(--dialog__warning--background-color)}.changeable__icon__container.title-icon--warn ez-icon{transform:translateY(-1px)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);color:var(--title--primary)}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{g as ez_dialog}
|
|
1
|
+
import{r as t,c as i,f as o,h as a,g as e}from"./p-23a36bb6.js";import{D as n}from"./p-ab574d59.js";import{FloatingManager as l,ElementIDUtils as r,KeyboardManager as d}from"@sankhyalabs/core";import{F as c}from"./p-dc628ed3.js";import{i as s}from"./p-641ee538.js";class h{constructor(t,i,o,a,e,n,l,r,d,c){this.title=t,this.message=i,this.dialogType=o,this.confirm=a,this.icon=e,this.labelCancel=n,this.labelConfirm=l,this.btnConfirmDanger=r,this.callBack=d,this.beforeClose=c}}const g=class{constructor(o){t(this,o),this.ezCancel=i(this,"ezCancel",7),this.ezAccept=i(this,"ezAccept",7),this.PRIMARY_BUTTON_ID="EZ_DIALOG_PRIMARY_BUTTON",this.btnConfirmDanger=!1,this._messageQueue=[],this._canFocusOnPrimaryBtn=!1,this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(t,i){this.manageOverflow(),t&&!i&&(this._canFocusOnPrimaryBtn=!0)}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=l.subscribeOverlayControl(this._overlayRef):l.unsubscribeOverlayControl(this._overlayRef||this._overlayId)}handleButtonClick(t){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(t)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(t),t?this.ezAccept.emit(t):this.ezCancel.emit(t),this._currentMessage=this._messageQueue.shift(),o(this))}async show(t,i,o,a,e,n,l,r,d){return this.opened=!0,new Promise((c=>{this._messageQueue.push(new h(t,i,o,a,e,n,l,r,c,d))}))}isCritical(t){return t===n.CRITICAL}getIconElement(t){if(t.dialogType===n.DEFAULT)return;const i=this.getIconClass(t.dialogType);return a("div",{class:`changeable__icon__container ${i}`},a("ez-icon",{class:"changeable__icon",size:"small",iconName:this.getIconName(t)}))}getIconClass(t){return this.isCritical(t)?"title-icon--critical":t===n.SUCCESS?"title-icon--success":t===n.WARN?"title-icon--warn":""}getIconName(t){return t.icon?t.icon:this.isCritical(t.dialogType)?"alert-circle-inverted":t.dialogType===n.WARN?"warning-outline":t.dialogType===n.SUCCESS?"check":void 0}getTypeIndicatorElement(t){if(t.dialogType!==n.DEFAULT)return a("div",{class:this.getClassIconIndicator(t.dialogType)})}getClassIconIndicator(t){return this.isCritical(t)?"dialog__critical--indicator":t==n.SUCCESS?"dialog__success--indicator":t==n.WARN?"dialog__warning--indicator":""}getClassContainer(t){return(t.dialogType||n.DEFAULT)===n.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(t){return null==this.getIconElement(t)?"title title__label title__label--no-icon":"title title__label"}async componentWillLoad(){this.i18n=await s()}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new h(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.i18n("app.no"),this.i18n("app.yes"),this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){r.addIDInfo(this._element),this._keyboardManager=new d({propagate:!1,element:this._element}).bind("Enter",(()=>this.handleButtonClick(!0)),{description:this.i18n("ez-dialog.confirmButton"),element:this._element}).bind("Escape",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element}).bind("Esc",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element})}componentDidRender(){this.manageOverlay(),this.focusOnDialog(),this.handleFocusOnPrimaryButton()}focusOnDialog(){const t=this._element.shadowRoot.querySelector(".overlay .dialog");t instanceof HTMLDivElement&&(t.style.outline="none",this._lastActiveElement=document.activeElement,t.focus())}handleFocusOnPrimaryButton(){this._canFocusOnPrimaryBtn&&(this.focusOnPrimaryButton(),this._canFocusOnPrimaryBtn=!1)}focusOnPrimaryButton(){const t=this._element.shadowRoot.querySelector(`#${this.PRIMARY_BUTTON_ID}`),i=null==t?void 0:t.shadowRoot.querySelector("button");requestAnimationFrame((()=>{null==i||i.focus()}))}disconnectedCallback(){var t;c.resolveFocus(this._lastActiveElement),this._lastActiveElement=void 0,null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay",ref:t=>this._overlayRef=t},a("div",{tabindex:"-1",class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":r.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":r.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":r.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":r.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{id:this.PRIMARY_BUTTON_ID,class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":r.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{id:this.PRIMARY_BUTTON_ID,label:"Ok","data-element-id":r.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return e(this)}static get watchers(){return{opened:["observeConfig"]}}};g.style=':host{--dialog__container-padding:var(--space--md, 20px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--medium, 12px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--elevation--100, 100);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:var(--space--medium);overflow-y:auto}.changeable__icon__container{background:var(--dialog__warning--background-color);display:flex;justify-content:center;align-items:center;min-width:26px;min-height:26px;border-radius:50%}.changeable__icon{--ez-icon--color:var(--dialog__icon--color)}.changeable__icon__container.title-icon--critical{background-color:var(--dialog__critical--background-color)}.changeable__icon__container.title-icon--success{background-color:var(--dialog__success--background-color)}.changeable__icon__container.title-icon--warn{background-color:var(--dialog__warning--background-color)}.changeable__icon__container.title-icon--warn ez-icon{transform:translateY(-1px)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);color:var(--title--primary)}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{g as ez_dialog}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-e4c7eb39.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as u,KeyboardManager as h,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as m,f as p,c as b,D as y}from"./p-4296e9f9.js";import{g as w,i as g}from"./p-641ee538.js";import{F as _}from"./p-30ffb9ed.js";import"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class E{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const j=(t,i)=>{var e;if(i)return null===(e=i.tabs)||void 0===e?void 0:e.find((i=>i.label===t))},F=(t,i,e)=>{if("string"!=typeof t)return t;if(e){const i=j(t,e);if(i)return i}return Array.from(i.keys()).find((i=>i.label===t))||{label:t,visible:!0}};function z(t,i){var e,n;return"__main"===t[0].label&&"__main"!==i[0].label?-1:"__main"!==t[0].label&&"__main"===i[0].label?1:(null!==(e=t[0].order)&&void 0!==e?e:Number.MAX_VALUE)-(null!==(n=i[0].order)&&void 0!==n?n:Number.MAX_VALUE)}const x=t=>`child[${t.name}]`,A=t=>({name:x(t),label:t.label,fields:[]});function N(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var S="function"==typeof Symbol&&Symbol.observable||"@@observable",D=function(){return Math.random().toString(36).substring(7).split("").join(".")},M={INIT:"@@redux/INIT"+D(),REPLACE:"@@redux/REPLACE"+D(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+D()}};function R(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function T(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(N(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(N(1));return e(T)(t,i)}if("function"!=typeof t)throw new Error(N(2));var s=t,r=i,o=[],l=o,a=!1;function u(){l===o&&(l=o.slice())}function h(){if(a)throw new Error(N(3));return r}function c(t){if("function"!=typeof t)throw new Error(N(4));if(a)throw new Error(N(5));var i=!0;return u(),l.push(t),function(){if(i){if(a)throw new Error(N(6));i=!1,u();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!R(t))throw new Error(N(7));if(void 0===t.type)throw new Error(N(8));if(a)throw new Error(N(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(N(10));s=t,d({type:M.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(N(11));function e(){t.next&&t.next(h())}return e(),{unsubscribe:i(e)}}})[S]=function(){return this},t}return d({type:M.INIT}),(n={dispatch:d,subscribe:c,getState:h,replaceReducer:f})[S]=v,n}const P={};function I(t=P,i){switch(i.type){case K.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case K.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function L(t){return t.formMetadata}function V(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var K;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(K||(K={}));const $=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=L(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=V(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:K.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${u.replaceAccentuatedChars(u.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:u.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new h({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(m,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await p(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1,n)=>{var s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],u={};(null!==(s=null==t?void 0:t.tabs)&&void 0!==s?s:[]).forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),function(t,i,e,n,s,r,o){var l;null===(l=null==t?void 0:t.fields)||void 0===l||l.forEach((l=>{var a,u,h;if(!1!==l.visible){const c=F(l.tab||"__main",i,t);if(e.has(c.label))return;const d=n.getField(l.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&c.visible){i.has(c)||i.set(c,[]);const t=f(d,l);i.get(c).push(t),t.required&&s.push(l.name),((null==l.cleanOnCopy?null===(a=d.properties)||void 0===a?void 0:a.cleanOnCopy:l.cleanOnCopy)||(null===(u=d.properties)||void 0===u?void 0:u.cleanOnCopy))&&r.push(l.name);let e=null==l.defaultValue?null===(h=d.properties)||void 0===h?void 0:h.defaultValue:l.defaultValue;if(e&&null!=e.value){const{type:t,value:i}=e;if(t)if("V"===t)e=i;else try{const t=JSON.parse(i);e=t&&"value"in t?t:i}catch(t){}o[l.name]=e}}}}))}(t,r,o,i,l,a,u);const h=new E;return h.setDefaultVars(t.defaultVars),e&&function(t,i,e){const n=t.metadata;void 0!==n&&void 0!==n.children&&n.children.forEach((t=>{const n=j(t.label,i);if(n)return void e.set(Object.assign(n,{name:x(t),isDetail:!0}),[]);const{label:s,name:r,fields:o}=A(t);e.set({name:r,label:s,isDetail:!0},o)}))}(i,t,r),n&&function(t,i,e){t.forEach((t=>{const n=j(t.label,i),s={};Object.entries(t).forEach((([t,i])=>{(function(t){return["id","label"].includes(t)})(t)||(s[t]=i)})),e.set(n?Object.assign(n,{name:t.id,isCustom:!0,ctxProps:s}):{label:t.label,name:t.id,isCustom:!0,visible:!0,ctxProps:s},[])}))}(n,t,r),Array.from(r.entries()).sort(z).forEach((([t,i])=>{o.has(t.label)||h.addSheet(function(t,i){const e=w();return{label:"__main"===t.label?e("ez-form.mainTab"):t.label,name:t.name||t.label,isCustom:t.isCustom,isDetail:t.isDetail,ctxProps:t.ctxProps,fields:i}}(t,i))})),h.addRequiredFields(l),h.addCleanOnCopyFields(a),h.addDefaultValues(u),h})(this.config,this.dataUnit);this._store.dispatch({type:K.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=T(I),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===_.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===_.CASCADE}))}componentDidRender(){const t=L(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=V(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=u.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};$.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{$ as ez_form}
|
|
1
|
+
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-23a36bb6.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as u,KeyboardManager as h,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as m,f as p,c as b,D as y}from"./p-4f0632b4.js";import{g as w,i as g}from"./p-641ee538.js";import{F as _}from"./p-30ffb9ed.js";import"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class E{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const j=(t,i)=>{var e;if(i)return null===(e=i.tabs)||void 0===e?void 0:e.find((i=>i.label===t))},F=(t,i,e)=>{if("string"!=typeof t)return t;if(e){const i=j(t,e);if(i)return i}return Array.from(i.keys()).find((i=>i.label===t))||{label:t,visible:!0}};function z(t,i){var e,n;return"__main"===t[0].label&&"__main"!==i[0].label?-1:"__main"!==t[0].label&&"__main"===i[0].label?1:(null!==(e=t[0].order)&&void 0!==e?e:Number.MAX_VALUE)-(null!==(n=i[0].order)&&void 0!==n?n:Number.MAX_VALUE)}const x=t=>`child[${t.name}]`,A=t=>({name:x(t),label:t.label,fields:[]});function N(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var S="function"==typeof Symbol&&Symbol.observable||"@@observable",D=function(){return Math.random().toString(36).substring(7).split("").join(".")},M={INIT:"@@redux/INIT"+D(),REPLACE:"@@redux/REPLACE"+D(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+D()}};function R(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function T(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(N(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(N(1));return e(T)(t,i)}if("function"!=typeof t)throw new Error(N(2));var s=t,r=i,o=[],l=o,a=!1;function u(){l===o&&(l=o.slice())}function h(){if(a)throw new Error(N(3));return r}function c(t){if("function"!=typeof t)throw new Error(N(4));if(a)throw new Error(N(5));var i=!0;return u(),l.push(t),function(){if(i){if(a)throw new Error(N(6));i=!1,u();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!R(t))throw new Error(N(7));if(void 0===t.type)throw new Error(N(8));if(a)throw new Error(N(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(N(10));s=t,d({type:M.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(N(11));function e(){t.next&&t.next(h())}return e(),{unsubscribe:i(e)}}})[S]=function(){return this},t}return d({type:M.INIT}),(n={dispatch:d,subscribe:c,getState:h,replaceReducer:f})[S]=v,n}const P={};function I(t=P,i){switch(i.type){case K.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case K.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function L(t){return t.formMetadata}function V(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var K;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(K||(K={}));const $=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=L(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=V(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:K.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${u.replaceAccentuatedChars(u.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:u.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new h({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(m,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await p(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1,n)=>{var s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],u={};(null!==(s=null==t?void 0:t.tabs)&&void 0!==s?s:[]).forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),function(t,i,e,n,s,r,o){var l;null===(l=null==t?void 0:t.fields)||void 0===l||l.forEach((l=>{var a,u,h;if(!1!==l.visible){const c=F(l.tab||"__main",i,t);if(e.has(c.label))return;const d=n.getField(l.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&c.visible){i.has(c)||i.set(c,[]);const t=f(d,l);i.get(c).push(t),t.required&&s.push(l.name),((null==l.cleanOnCopy?null===(a=d.properties)||void 0===a?void 0:a.cleanOnCopy:l.cleanOnCopy)||(null===(u=d.properties)||void 0===u?void 0:u.cleanOnCopy))&&r.push(l.name);let e=null==l.defaultValue?null===(h=d.properties)||void 0===h?void 0:h.defaultValue:l.defaultValue;if(e&&null!=e.value){const{type:t,value:i}=e;if(t)if("V"===t)e=i;else try{const t=JSON.parse(i);e=t&&"value"in t?t:i}catch(t){}o[l.name]=e}}}}))}(t,r,o,i,l,a,u);const h=new E;return h.setDefaultVars(t.defaultVars),e&&function(t,i,e){const n=t.metadata;void 0!==n&&void 0!==n.children&&n.children.forEach((t=>{const n=j(t.label,i);if(n)return void e.set(Object.assign(n,{name:x(t),isDetail:!0}),[]);const{label:s,name:r,fields:o}=A(t);e.set({name:r,label:s,isDetail:!0},o)}))}(i,t,r),n&&function(t,i,e){t.forEach((t=>{const n=j(t.label,i),s={};Object.entries(t).forEach((([t,i])=>{(function(t){return["id","label"].includes(t)})(t)||(s[t]=i)})),e.set(n?Object.assign(n,{name:t.id,isCustom:!0,ctxProps:s}):{label:t.label,name:t.id,isCustom:!0,visible:!0,ctxProps:s},[])}))}(n,t,r),Array.from(r.entries()).sort(z).forEach((([t,i])=>{o.has(t.label)||h.addSheet(function(t,i){const e=w();return{label:"__main"===t.label?e("ez-form.mainTab"):t.label,name:t.name||t.label,isCustom:t.isCustom,isDetail:t.isDetail,ctxProps:t.ctxProps,fields:i}}(t,i))})),h.addRequiredFields(l),h.addCleanOnCopyFields(a),h.addDefaultValues(u),h})(this.config,this.dataUnit);this._store.dispatch({type:K.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=T(I),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===_.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===_.CASCADE}))}componentDidRender(){const t=L(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=V(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=u.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};$.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{$ as ez_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as o,H as e,g as l}from"./p-23a36bb6.js";import{KeyboardManager as s,FloatingManager as n}from"@sankhyalabs/core";import{i as a}from"./p-641ee538.js";const d=class{constructor(o){t(this,o),this.ezClosePopup=i(this,"ezClosePopup",7),this.ezPopupAction=i(this,"ezPopupAction",7),this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0,this.enabledScroll=!1,this.autoClose=!0,this.footerButtons=[]}observeConfig(){this.manageOverflow()}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){this.popUpFocus(),this._keyboardManager=new s({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezPopupAction.emit.bind("OK")).bind("Escape",(()=>this.closePopup())).bind("Esc",(()=>this.closePopup()))}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}closePopup(){this.opened=!1,this.manageOverflow(),this.ezClosePopup.emit()}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=n.subscribeOverlayControl(this._popupRef):n.unsubscribeOverlayControl(this._popupRef||this._overlayId)}popUpFocus(){this.opened&&this._popupRef&&this._popupRef.focus()}getGridSize(){const t={"x-small":"col--sd-3 ez-popup__size-limit--x-small",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11",default:"ez-popup__size-limit--x-small",auto:""};return this.size&&t.hasOwnProperty(this.size)&&t[this.size]||t.medium}getDialogClass(){let t="popup__container";return"auto"===this.heightMode&&(t+=" popup__container--auto"),this.enabledScroll&&(t+=" popup__overflow-y--auto"),t+=` ${this.getGridSize()}`,t}componentDidRender(){this.manageOverlay(),this.popUpFocus()}handleAutoClose(t){if(!this.opened||!this._popupRef||!this.autoClose)return;if(this._popupRef.contains(t.target))return;const i=this._popupRef.querySelector("slot");if(i&&i.assignedElements().length>0){const o=i.assignedElements();for(const i of o)if(i.contains(t.target))return}this._popupRef.shadowRoot&&this._popupRef.shadowRoot.contains(t.target)||this.closePopup()}handleDefaultPropsButtonsByIndex(t){switch(t){case 0:return{label:this.i18n?this.i18n("app.confirm"):"Confirmar",variant:"primary",size:"small",onClick:()=>{this.closePopup(),this.ezPopupAction.emit("OK")}};case 1:return{label:this.i18n?this.i18n("app.cancel"):"Cancelar",variant:"secondary",size:"small",onClick:()=>{this.closePopup()}};case 2:return{label:this.i18n?this.i18n("app.close"):"Fechar",variant:"tertiary",size:"small",onClick:()=>{this.closePopup()}}}}renderFooterButtons(){return this.footerButtons.slice(0,3).map(((t,i)=>o("ez-button",Object.assign({key:i},this.handleDefaultPropsButtonsByIndex(i),t))))}render(){return o(e,null,this.opened&&o("div",{class:"overlay",tabIndex:-1,onClick:this.handleAutoClose.bind(this)},o("dialog",{ref:t=>this._popupRef=t,class:this.getDialogClass()},this.useHeader&&o("header",{class:"popup__header"},!!this.ezTitle&&o("h1",{class:"popup__title"},this.ezTitle),o("ez-button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",variant:"tertiary",mode:"icon",iconName:"close",size:"small",onClick:this.closePopup.bind(this)})),o("main",{class:"popup__expandable-content"},o("slot",null)),o("footer",{class:"popup__footer"},this.footerButtons.length>0&&this.renderFooterButtons(),o("slot",{name:"footer"})))))}get _element(){return l(this)}static get watchers(){return{opened:["observeConfig"]}}};d.style=':host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, "Roboto");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{overflow-y:auto;flex-grow:1;box-sizing:border-box;width:100%;font-family:var(--font--pattern, "Roboto");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400);line-height:var(--line-height--24, 24px)}.popup__header{flex-shrink:0;width:100%;display:flex;align-items:center}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{flex-shrink:0;display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{d as ez_popup}
|