@sankhyalabs/ezui 7.1.0-dev.1 → 7.1.0-dev.10
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-combo-box-list_4.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +110 -38
- package/dist/cjs/ez-grid.cjs.entry.js +3 -3
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -11
- package/dist/cjs/ez-popup.cjs.entry.js +9 -6
- package/dist/cjs/ez-tree.cjs.entry.js +154 -7
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{purify-47a2f27b.js → purify-453a8028.js} +35 -12
- package/dist/cjs/{search-column-9aa090ec.js → search-column-8bfee733.js} +1 -1
- package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +3 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -10
- package/dist/collection/components/ez-popup/ez-popup.css +3 -2
- package/dist/collection/components/ez-popup/ez-popup.js +9 -6
- package/dist/collection/components/ez-tree/ez-tree.css +4 -0
- package/dist/collection/components/ez-tree/ez-tree.js +185 -6
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
- package/dist/collection/components/ez-tree/types/Node.js +7 -0
- package/dist/collection/components/ez-tree/types/Tree.js +19 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +1 -1
- package/dist/collection/utils/form/FormMetadata.js +109 -37
- package/dist/custom-elements/index.js +313 -77
- package/dist/esm/ez-combo-box-list_4.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +110 -38
- package/dist/esm/ez-grid.entry.js +3 -3
- package/dist/esm/ez-modal-container.entry.js +2 -11
- package/dist/esm/ez-popup.entry.js +9 -6
- package/dist/esm/ez-tree.entry.js +154 -7
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{purify-dc6814bf.js → purify-003c47e2.js} +35 -12
- package/dist/esm/{search-column-83562552.js → search-column-c00119ae.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-294f54fe.entry.js +1 -0
- package/dist/ezui/p-4f0632b4.js +1 -0
- package/dist/ezui/{p-d66bf34e.entry.js → p-8c57ffa4.entry.js} +2 -2
- package/dist/ezui/p-ae5f64cd.entry.js +1 -0
- package/dist/ezui/p-bb409cba.js +3 -0
- package/dist/ezui/p-c82acfc6.entry.js +1 -0
- package/dist/ezui/{p-c943f7c4.entry.js → p-e03b2f19.entry.js} +1 -1
- package/dist/ezui/p-e77610ef.entry.js +1 -0
- package/dist/ezui/p-ff4bde07.entry.js +1 -0
- 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 +20 -1
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
- package/dist/types/components.d.ts +18 -1
- package/dist/types/utils/form/FormMetadata.d.ts +2 -1
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +3 -0
- package/dist/types/utils/form/interfaces/ITabConfig.d.ts +3 -0
- package/package.json +1 -1
- package/dist/ezui/p-02f6e3b0.entry.js +0 -1
- package/dist/ezui/p-191cfbc8.entry.js +0 -1
- package/dist/ezui/p-228a4d2f.js +0 -3
- package/dist/ezui/p-2df50161.entry.js +0 -1
- package/dist/ezui/p-4c4f0850.entry.js +0 -1
- package/dist/ezui/p-623161e2.js +0 -1
- package/dist/ezui/p-bd6146c5.entry.js +0 -1
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const index$1 = require('./index-00d0166b.js');
|
|
8
8
|
const FormLayout = require('./FormLayout-18853e70.js');
|
|
9
9
|
const RichToolbarHelper = require('./RichToolbarHelper-ea12328f.js');
|
|
10
|
-
const purify = require('./purify-
|
|
10
|
+
const purify = require('./purify-453a8028.js');
|
|
11
11
|
const ApplicationUtils = require('./ApplicationUtils-d04f5c94.js');
|
|
12
12
|
require('./DialogType-2114c337.js');
|
|
13
13
|
require('./CheckMode-ecb90b87.js');
|
|
@@ -8,7 +8,7 @@ const core = require('@sankhyalabs/core');
|
|
|
8
8
|
const FocusResolver = require('./FocusResolver-885f2173.js');
|
|
9
9
|
const index$1 = require('./index-00d0166b.js');
|
|
10
10
|
|
|
11
|
-
const ezDialogCss = ":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%}}";
|
|
11
|
+
const ezDialogCss = ":host{--dialog__container-padding:var(--space--md, 20px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--8, 8px);--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__btn__min-width:80px;--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);--ez-button--min-width:var(--dialog__btn__min-width)}.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);--ez-button--min-width:var(--dialog__btn__min-width)}.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);--ez-button--min-width:var(--dialog__btn__min-width)}.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%}}";
|
|
12
12
|
|
|
13
13
|
class Message {
|
|
14
14
|
constructor(title, message, dialogType, confirm, icon, labelCancel, labelConfirm, btnConfirmDanger, callBack, beforeClose) {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const searchColumn = require('./search-column-
|
|
7
|
+
const searchColumn = require('./search-column-8bfee733.js');
|
|
8
8
|
const index = require('./index-00d0166b.js');
|
|
9
9
|
const FormLayout = require('./FormLayout-18853e70.js');
|
|
10
10
|
require('./ApplicationUtils-d04f5c94.js');
|
|
@@ -82,28 +82,59 @@ const buildFormConfigFromDataUnit = (dataUnit) => {
|
|
|
82
82
|
.filter(descriptor => descriptor.visible !== false)
|
|
83
83
|
.map(descriptor => { return { name: descriptor.name, defaultValue: descriptor.defaultValue }; });
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
return config;
|
|
85
|
+
return { emptyConfig: false, fields };
|
|
87
86
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const defaultValues = {};
|
|
98
|
-
(_a = config === null || config === void 0 ? void 0 : config.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
|
|
99
|
-
if (!hiddenTabs.has(tab.label) && tab.visible === false) {
|
|
100
|
-
hiddenTabs.set(tab.label, tab);
|
|
87
|
+
function handleDetailTabs(dataUnit, config, sheets) {
|
|
88
|
+
const unitMD = dataUnit.metadata;
|
|
89
|
+
if (unitMD === undefined || unitMD.children === undefined)
|
|
90
|
+
return;
|
|
91
|
+
unitMD.children.forEach((child) => {
|
|
92
|
+
const tabConfig = getTabFromConfig(child.label, config);
|
|
93
|
+
if (tabConfig) {
|
|
94
|
+
sheets.set(Object.assign(tabConfig, { name: buildChildName(child), isDetail: true }), []);
|
|
95
|
+
return;
|
|
101
96
|
}
|
|
97
|
+
const { label, name, fields } = buildDetailSheet(child);
|
|
98
|
+
sheets.set({ name, label, isDetail: true }, fields);
|
|
102
99
|
});
|
|
103
|
-
|
|
100
|
+
}
|
|
101
|
+
function handleCustomTabs(customGuides, config, sheets) {
|
|
102
|
+
customGuides.forEach((guide) => {
|
|
103
|
+
const tabConfig = getTabFromConfig(guide.label, config);
|
|
104
|
+
const ctxProps = {};
|
|
105
|
+
Object.entries(guide).forEach(([key, value]) => {
|
|
106
|
+
if (!isReservedKey(key)) {
|
|
107
|
+
ctxProps[key] = value;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
if (tabConfig) {
|
|
111
|
+
sheets.set(Object.assign(tabConfig, { name: guide.id, isCustom: true, ctxProps }), []);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const sheet = { label: guide.label, name: guide.id, isCustom: true, visible: true, ctxProps };
|
|
115
|
+
sheets.set(sheet, []);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function isReservedKey(key) {
|
|
119
|
+
return ['id', 'label'].includes(key);
|
|
120
|
+
}
|
|
121
|
+
function parseTabToFormSheet(key, fields) {
|
|
122
|
+
const i18n = index.getI18n();
|
|
123
|
+
return {
|
|
124
|
+
label: (key.label === "__main") ? i18n("ez-form.mainTab") : key.label,
|
|
125
|
+
name: key.name || key.label,
|
|
126
|
+
isCustom: key.isCustom,
|
|
127
|
+
isDetail: key.isDetail,
|
|
128
|
+
ctxProps: key.ctxProps,
|
|
129
|
+
fields
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function handleFields(config, sheets, hiddenTabs, dataUnit, requiredFields, cleanOnCopyFields, defaultValues) {
|
|
133
|
+
var _a;
|
|
134
|
+
(_a = config === null || config === void 0 ? void 0 : config.fields) === null || _a === void 0 ? void 0 : _a.forEach((field) => {
|
|
104
135
|
var _a, _b, _c;
|
|
105
136
|
if (field.visible !== false) {
|
|
106
|
-
const tabConfig = getTabConfig(field.tab || "__main", sheets);
|
|
137
|
+
const tabConfig = getTabConfig(field.tab || "__main", sheets, config);
|
|
107
138
|
if (hiddenTabs.has(tabConfig.label)) {
|
|
108
139
|
return;
|
|
109
140
|
}
|
|
@@ -139,7 +170,8 @@ const buildFormMetadata = (config, dataUnit, includeDetails = false) => {
|
|
|
139
170
|
defaultValue = value;
|
|
140
171
|
}
|
|
141
172
|
}
|
|
142
|
-
catch (_d) {
|
|
173
|
+
catch (_d) {
|
|
174
|
+
}
|
|
143
175
|
}
|
|
144
176
|
}
|
|
145
177
|
defaultValues[field.name] = defaultValue;
|
|
@@ -147,42 +179,82 @@ const buildFormMetadata = (config, dataUnit, includeDetails = false) => {
|
|
|
147
179
|
}
|
|
148
180
|
}
|
|
149
181
|
});
|
|
182
|
+
}
|
|
183
|
+
const buildFormMetadata = (config, dataUnit, includeDetails = false, customGuides) => {
|
|
184
|
+
var _a;
|
|
185
|
+
if (config == undefined || (config === null || config === void 0 ? void 0 : config.emptyConfig) === true) {
|
|
186
|
+
config = buildFormConfigFromDataUnit(dataUnit);
|
|
187
|
+
}
|
|
188
|
+
const sheets = new Map();
|
|
189
|
+
const hiddenTabs = new Map();
|
|
190
|
+
const requiredFields = [];
|
|
191
|
+
const cleanOnCopyFields = [];
|
|
192
|
+
const defaultValues = {};
|
|
193
|
+
const tabs = (_a = config === null || config === void 0 ? void 0 : config.tabs) !== null && _a !== void 0 ? _a : [];
|
|
194
|
+
tabs.forEach((tab) => {
|
|
195
|
+
if (!hiddenTabs.has(tab.label) && tab.visible === false) {
|
|
196
|
+
hiddenTabs.set(tab.label, tab);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
handleFields(config, sheets, hiddenTabs, dataUnit, requiredFields, cleanOnCopyFields, defaultValues);
|
|
150
200
|
const metadata = new FormMetadata();
|
|
151
201
|
metadata.setDefaultVars(config.defaultVars);
|
|
152
202
|
if (includeDetails) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
sheets.set({ name, label }, fields);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
203
|
+
handleDetailTabs(dataUnit, config, sheets);
|
|
204
|
+
}
|
|
205
|
+
if (customGuides) {
|
|
206
|
+
handleCustomTabs(customGuides, config, sheets);
|
|
160
207
|
}
|
|
161
|
-
const i18n = index.getI18n();
|
|
162
208
|
Array.from(sheets.entries())
|
|
163
209
|
.sort(sortTabs)
|
|
164
|
-
.forEach(([
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
fields
|
|
169
|
-
});
|
|
210
|
+
.forEach(([tab, fields]) => {
|
|
211
|
+
if (!hiddenTabs.has(tab.label)) {
|
|
212
|
+
metadata.addSheet(parseTabToFormSheet(tab, fields));
|
|
213
|
+
}
|
|
170
214
|
});
|
|
171
215
|
metadata.addRequiredFields(requiredFields);
|
|
172
216
|
metadata.addCleanOnCopyFields(cleanOnCopyFields);
|
|
173
217
|
metadata.addDefaultValues(defaultValues);
|
|
174
218
|
return metadata;
|
|
175
219
|
};
|
|
176
|
-
const
|
|
177
|
-
|
|
220
|
+
const getTabFromConfig = (tab, config) => {
|
|
221
|
+
var _a;
|
|
222
|
+
if (!config) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
return (_a = config.tabs) === null || _a === void 0 ? void 0 : _a.find(t => t.label === tab);
|
|
226
|
+
};
|
|
227
|
+
const getTabConfig = (tab, sheets, config) => {
|
|
228
|
+
if (typeof tab !== "string") {
|
|
229
|
+
return tab;
|
|
230
|
+
}
|
|
231
|
+
if (config) {
|
|
232
|
+
const tabConfig = getTabFromConfig(tab, config);
|
|
233
|
+
if (tabConfig) {
|
|
234
|
+
return tabConfig;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const tabConfig = Array.from(sheets.keys()).find(t => t.label === tab);
|
|
178
238
|
return tabConfig || { label: tab, visible: true };
|
|
179
239
|
};
|
|
180
|
-
|
|
181
|
-
|
|
240
|
+
function sortTabs(a, b) {
|
|
241
|
+
var _a, _b;
|
|
242
|
+
if (a[0].label === '__main' && b[0].label !== '__main') {
|
|
243
|
+
return -1;
|
|
244
|
+
}
|
|
245
|
+
if (a[0].label !== '__main' && b[0].label === '__main') {
|
|
246
|
+
return 1;
|
|
247
|
+
}
|
|
248
|
+
const aOrder = (_a = a[0].order) !== null && _a !== void 0 ? _a : Number.MAX_VALUE;
|
|
249
|
+
const bOrder = (_b = b[0].order) !== null && _b !== void 0 ? _b : Number.MAX_VALUE;
|
|
250
|
+
return aOrder - bOrder;
|
|
251
|
+
}
|
|
252
|
+
const buildChildName = (child) => {
|
|
253
|
+
return `child[${child.name}]`;
|
|
182
254
|
};
|
|
183
255
|
const buildDetailSheet = (child) => {
|
|
184
256
|
return {
|
|
185
|
-
name:
|
|
257
|
+
name: buildChildName(child),
|
|
186
258
|
label: child.label,
|
|
187
259
|
fields: []
|
|
188
260
|
};
|
|
@@ -10,10 +10,10 @@ require('./DialogType-2114c337.js');
|
|
|
10
10
|
require('./CheckMode-ecb90b87.js');
|
|
11
11
|
const index = require('./index-00d0166b.js');
|
|
12
12
|
const FormLayout = require('./FormLayout-18853e70.js');
|
|
13
|
-
const searchColumn = require('./search-column-
|
|
13
|
+
const searchColumn = require('./search-column-8bfee733.js');
|
|
14
14
|
const constants = require('./constants-72b7e05e.js');
|
|
15
15
|
const FocusResolver = require('./FocusResolver-885f2173.js');
|
|
16
|
-
const purify = require('./purify-
|
|
16
|
+
const purify = require('./purify-453a8028.js');
|
|
17
17
|
require('./_commonjsHelpers-537d719a.js');
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -65578,7 +65578,7 @@ class AgGridController {
|
|
|
65578
65578
|
const colDefsWithConfigs = this.getColsDefWithConfigApplied(colDefs, this._lastColsConfig);
|
|
65579
65579
|
this._gridOptions.api.setColumnDefs(colDefsWithConfigs);
|
|
65580
65580
|
}
|
|
65581
|
-
getColsDefWithConfigApplied(colDefs, colsConfig) {
|
|
65581
|
+
getColsDefWithConfigApplied(colDefs, colsConfig = []) {
|
|
65582
65582
|
//Cria map de colunas existentes na config e seu índice
|
|
65583
65583
|
const orderMap = colsConfig.reduce((map, col, index) => {
|
|
65584
65584
|
map[col.name] = index;
|
|
@@ -23,7 +23,7 @@ var ModalButtonStatus;
|
|
|
23
23
|
})(ModalButtonStatus || (ModalButtonStatus = {}));
|
|
24
24
|
const ModalButtonStatus$1 = ModalButtonStatus;
|
|
25
25
|
|
|
26
|
-
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:hidden;display:
|
|
26
|
+
const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:hidden;display:flex;flex-direction:column;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between;align-items:start}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x);outline:none}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--8, 8px);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none;outline:none;padding:var(--space--6, 6px) 0px}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}";
|
|
27
27
|
|
|
28
28
|
const EzModalContainer = class {
|
|
29
29
|
constructor(hostRef) {
|
|
@@ -70,17 +70,8 @@ const EzModalContainer = class {
|
|
|
70
70
|
closeModal() {
|
|
71
71
|
this.ezModalAction.emit("CLOSE");
|
|
72
72
|
}
|
|
73
|
-
focusLast() {
|
|
74
|
-
if (this._okButton == undefined) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this._okButton.setFocus();
|
|
78
|
-
}
|
|
79
|
-
focusFirst() {
|
|
80
|
-
this._closeButton.focus();
|
|
81
|
-
}
|
|
82
73
|
render() {
|
|
83
|
-
return (index.h(index.Host, null, index.h("
|
|
74
|
+
return (index.h(index.Host, null, index.h("header", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (index.h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, index.h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, index.h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (index.h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && index.h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE), "aria-label": this.i18n("app.close") }, index.h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), index.h("main", { tabIndex: -1, class: "ez-modal-container__content" }, index.h("slot", null)), index.h("footer", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (index.h("ez-button", { label: this.cancelButtonLabel || this.i18n("app.cancel"), isDisabled: this.cancelButtonStatus === ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (index.h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel || this.i18n("app.ok"), isDisabled: this.okButtonStatus === ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) })))));
|
|
84
75
|
}
|
|
85
76
|
get _element() { return index.getElement(this); }
|
|
86
77
|
};
|
|
@@ -6,7 +6,7 @@ const index = require('./index-a7b0c73d.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const index$1 = require('./index-00d0166b.js');
|
|
8
8
|
|
|
9
|
-
const ezPopupCss = ":host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, \"Roboto\");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;
|
|
9
|
+
const ezPopupCss = ":host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, \"Roboto\");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{flex-grow:1;box-sizing:border-box;width:100%;font-family:var(--font--pattern, \"Roboto\");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400)}.popup__header{flex-shrink:0;width:100%;display:flex;align-items:center}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{flex-shrink:0;display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
10
10
|
|
|
11
11
|
const EzPopup = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -18,7 +18,7 @@ const EzPopup = class {
|
|
|
18
18
|
this.useHeader = true;
|
|
19
19
|
this.heightMode = "full";
|
|
20
20
|
this.ezTitle = undefined;
|
|
21
|
-
this.enabledScroll =
|
|
21
|
+
this.enabledScroll = true;
|
|
22
22
|
this.autoClose = true;
|
|
23
23
|
this.footerButtons = [];
|
|
24
24
|
}
|
|
@@ -88,9 +88,6 @@ const EzPopup = class {
|
|
|
88
88
|
if (this.heightMode === 'auto') {
|
|
89
89
|
className += ' popup__container--auto';
|
|
90
90
|
}
|
|
91
|
-
if (this.enabledScroll) {
|
|
92
|
-
className += ' popup__overflow-y--auto';
|
|
93
|
-
}
|
|
94
91
|
className += ` ${this.getGridSize()}`;
|
|
95
92
|
return className;
|
|
96
93
|
}
|
|
@@ -151,9 +148,15 @@ const EzPopup = class {
|
|
|
151
148
|
};
|
|
152
149
|
}
|
|
153
150
|
}
|
|
151
|
+
renderFooterButtons() {
|
|
152
|
+
return this.footerButtons.slice(0, 3).map((buttonProps, index$1) => (index.h("ez-button", Object.assign({ key: index$1 }, this.handleDefaultPropsButtonsByIndex(index$1), buttonProps))));
|
|
153
|
+
}
|
|
154
154
|
render() {
|
|
155
155
|
return (index.h(index.Host, null, this.opened && (index.h("div", { class: "overlay", tabIndex: -1, onClick: this.handleAutoClose.bind(this) }, index.h("dialog", { ref: ref => this._popupRef = ref, class: this.getDialogClass() }, this.useHeader &&
|
|
156
|
-
index.h("header", { class: "popup__header" }, !!this.ezTitle && index.h("h1", { class: "popup__title" }, this.ezTitle), index.h("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) })), index.h("main", { class:
|
|
156
|
+
index.h("header", { class: "popup__header" }, !!this.ezTitle && index.h("h1", { class: "popup__title" }, this.ezTitle), index.h("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) })), index.h("main", { class: {
|
|
157
|
+
"popup__expandable-content": true,
|
|
158
|
+
"popup__overflow-y--auto": this.enabledScroll
|
|
159
|
+
} }, index.h("slot", null)), index.h("footer", { class: "popup__footer" }, this.footerButtons.length > 0 && (this.renderFooterButtons()), index.h("slot", { name: 'footer' })))))));
|
|
157
160
|
}
|
|
158
161
|
get _element() { return index.getElement(this); }
|
|
159
162
|
static get watchers() { return {
|
|
@@ -39,6 +39,9 @@ const TreeItem = (props) => {
|
|
|
39
39
|
iconClick(treeItem);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
function handleIconDoubleClick(event) {
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
}
|
|
42
45
|
return (index.h("ul", { class: level === 1 ? "first-level" : undefined },
|
|
43
46
|
index.h("li", Object.assign({ title: tooltipResolver(treeItem, !disabled, level), class: `tree-item ${treeItem.id !== selectedId ? "tree-item-error" : ""}`, onClick: () => available && itemClick(treeItem), onDblClick: () => available && itemDoubleClick(treeItem) }, {
|
|
44
47
|
disabled,
|
|
@@ -47,7 +50,7 @@ const TreeItem = (props) => {
|
|
|
47
50
|
}),
|
|
48
51
|
index.h("div", { class: "item-label-container" },
|
|
49
52
|
index.h("div", { class: "item-icon-box" }, expandable &&
|
|
50
|
-
index.h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: (event) => handleIconClick(event) })),
|
|
53
|
+
index.h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: (event) => handleIconClick(event), onDblClick: (event) => handleIconDoubleClick(event) })),
|
|
51
54
|
index.h("label", { class: `item-label ${treeItem.bold ? "item-label--bold" : ""}` }, treeItem.label)),
|
|
52
55
|
getBadgeElement(treeItem.id, treeItem.badge, treeItem.id === selectedId)),
|
|
53
56
|
expanded
|
|
@@ -139,6 +142,13 @@ class Node {
|
|
|
139
142
|
this.children.set(item.id, new Node(tree, item, this));
|
|
140
143
|
}
|
|
141
144
|
}
|
|
145
|
+
removeChild(id) {
|
|
146
|
+
if (this.children.has(id)) {
|
|
147
|
+
this.children.delete(id);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
142
152
|
addPlaceHolder() {
|
|
143
153
|
this.children.clear();
|
|
144
154
|
const id = this.item.id;
|
|
@@ -188,6 +198,8 @@ class Tree extends Node {
|
|
|
188
198
|
async addChildAt(parentId, item) {
|
|
189
199
|
const parent = this.getNode(parentId);
|
|
190
200
|
if (parent == undefined) {
|
|
201
|
+
this.addChild(this, item);
|
|
202
|
+
this._changeCallback();
|
|
191
203
|
return;
|
|
192
204
|
}
|
|
193
205
|
parent.addChild(this, item);
|
|
@@ -251,6 +263,23 @@ class Tree extends Node {
|
|
|
251
263
|
}
|
|
252
264
|
this._changeCallback();
|
|
253
265
|
}
|
|
266
|
+
removeItem(id) {
|
|
267
|
+
if (!id) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const node = this.getNode(id);
|
|
271
|
+
if (!node) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (node.parent) {
|
|
275
|
+
node.parent.removeChild(id);
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
this.children.delete(id);
|
|
279
|
+
}
|
|
280
|
+
this._disabledValues.delete(id);
|
|
281
|
+
this._changeCallback();
|
|
282
|
+
}
|
|
254
283
|
async open(path) {
|
|
255
284
|
return new Promise(async (resolve) => {
|
|
256
285
|
await this.walkPath(this, path, node => node.item.expanded = true);
|
|
@@ -374,7 +403,7 @@ class Tree extends Node {
|
|
|
374
403
|
}
|
|
375
404
|
}
|
|
376
405
|
|
|
377
|
-
const ezTreeCss = ":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:0px;--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree--font-weight--bold:var(--text-weight--large, 600);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;cursor:default;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center;overflow:hidden}.tree-item{display:flex;align-items:center;cursor:pointer;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";
|
|
406
|
+
const ezTreeCss = ":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:0px;--ez-tree--user-select:auto;--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree--font-weight--bold:var(--text-weight--large, 600);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;cursor:default;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center;overflow:hidden}.tree-item{display:flex;align-items:center;cursor:pointer;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;user-select:var(--ez-tree--user-select);font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";
|
|
378
407
|
|
|
379
408
|
const EzTree = class {
|
|
380
409
|
constructor(hostRef) {
|
|
@@ -382,12 +411,20 @@ const EzTree = class {
|
|
|
382
411
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
383
412
|
this.ezOpenItem = index.createEvent(this, "ezOpenItem", 7);
|
|
384
413
|
this.ezDbClickItem = index.createEvent(this, "ezDbClickItem", 7);
|
|
414
|
+
this.ezRemoveItem = index.createEvent(this, "ezRemoveItem", 7);
|
|
385
415
|
this._onItemClick = (item) => {
|
|
386
|
-
this.
|
|
416
|
+
if (!this.selectable) {
|
|
417
|
+
this.openClose(item);
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (this.value && this.value.id === item.id) {
|
|
421
|
+
this.value = undefined;
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
this.value = item;
|
|
387
425
|
};
|
|
388
426
|
this._onIconClick = (item) => {
|
|
389
427
|
this.openClose(item);
|
|
390
|
-
this.value = item;
|
|
391
428
|
};
|
|
392
429
|
this._tree = new Tree(() => index.forceUpdate(this));
|
|
393
430
|
this._waintingForLoad = undefined;
|
|
@@ -397,6 +434,7 @@ const EzTree = class {
|
|
|
397
434
|
this.iconResolver = defaultIconResolver;
|
|
398
435
|
this.tooltipResolver = undefined;
|
|
399
436
|
this.enableHierarchicalFilter = true;
|
|
437
|
+
this.selectable = true;
|
|
400
438
|
}
|
|
401
439
|
/**
|
|
402
440
|
* Efetua a seleção de um item.
|
|
@@ -447,10 +485,14 @@ const EzTree = class {
|
|
|
447
485
|
parentId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
|
|
448
486
|
}
|
|
449
487
|
this._tree.addChildAt(parentId, item);
|
|
488
|
+
this.addItemInIndexedList(parentId, item);
|
|
450
489
|
const node = this._tree.getNode(parentId);
|
|
451
490
|
if (node) {
|
|
452
491
|
node.item.expanded = true;
|
|
453
492
|
}
|
|
493
|
+
else {
|
|
494
|
+
this.collapseAll();
|
|
495
|
+
}
|
|
454
496
|
}
|
|
455
497
|
/**
|
|
456
498
|
* Efetua a seleção de um item.
|
|
@@ -473,12 +515,48 @@ const EzTree = class {
|
|
|
473
515
|
/**
|
|
474
516
|
* Atualiza um item
|
|
475
517
|
*/
|
|
476
|
-
async updateItem(item) {
|
|
477
|
-
var _a;
|
|
478
|
-
|
|
518
|
+
async updateItem(item, config) {
|
|
519
|
+
var _a, _b, _c;
|
|
520
|
+
if (Array.isArray(item)) {
|
|
521
|
+
item.forEach(i => this.updateItem(i, config));
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
if (config === null || config === void 0 ? void 0 : config.updatedBySelectedId) {
|
|
525
|
+
Object.assign(item, { id: this.selectedId });
|
|
526
|
+
}
|
|
527
|
+
this._tree.updateItem((config === null || config === void 0 ? void 0 : config.forceDefaultValues) ? this.applyDefaultValues(item) : item);
|
|
528
|
+
this.updateItemInIndexedList(item, config === null || config === void 0 ? void 0 : config.forceDefaultValues);
|
|
479
529
|
const node = (_a = this._tree) === null || _a === void 0 ? void 0 : _a.getNode(this.selectedId);
|
|
480
530
|
if (node == undefined) {
|
|
481
531
|
this.value = this._visibleItems ? this._visibleItems[0] : undefined;
|
|
532
|
+
this._tree.collapseAll();
|
|
533
|
+
}
|
|
534
|
+
if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.id) === item.id) {
|
|
535
|
+
this.value = item;
|
|
536
|
+
this.ezChange.emit(this.value);
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
const childSelected = this.getItemById((_c = this.value) === null || _c === void 0 ? void 0 : _c.id, [item]);
|
|
540
|
+
if (childSelected) {
|
|
541
|
+
this.value = childSelected;
|
|
542
|
+
this.ezChange.emit(this.value);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Remove um item da árvore pelo seu ID.
|
|
547
|
+
* Se o item removido estiver selecionado, a seleção será limpa.
|
|
548
|
+
*/
|
|
549
|
+
async removeItem(id) {
|
|
550
|
+
var _a;
|
|
551
|
+
id = id !== null && id !== void 0 ? id : this.selectedId;
|
|
552
|
+
if (!id) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
this._tree.removeItem(id);
|
|
556
|
+
this.removeItemFromIndexedList(id);
|
|
557
|
+
this.ezRemoveItem.emit(id);
|
|
558
|
+
if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.id) === id) {
|
|
559
|
+
this.value = undefined;
|
|
482
560
|
}
|
|
483
561
|
}
|
|
484
562
|
/**
|
|
@@ -566,6 +644,75 @@ const EzTree = class {
|
|
|
566
644
|
event.preventDefault();
|
|
567
645
|
}
|
|
568
646
|
}
|
|
647
|
+
getItemById(id, items) {
|
|
648
|
+
for (const treeItem of items) {
|
|
649
|
+
if (treeItem.id === id) {
|
|
650
|
+
return treeItem;
|
|
651
|
+
}
|
|
652
|
+
else if (treeItem.children && Array.isArray(treeItem.children)) {
|
|
653
|
+
const itemFound = this.getItemById(id, treeItem.children);
|
|
654
|
+
if (itemFound) {
|
|
655
|
+
return itemFound;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return undefined;
|
|
660
|
+
}
|
|
661
|
+
addItemInIndexedList(parentId, item, items) {
|
|
662
|
+
var _a, _b;
|
|
663
|
+
items = (_a = items !== null && items !== void 0 ? items : this.items) !== null && _a !== void 0 ? _a : [];
|
|
664
|
+
if (!parentId) {
|
|
665
|
+
items.push(item);
|
|
666
|
+
}
|
|
667
|
+
const itemFound = this.getItemById(parentId, items);
|
|
668
|
+
itemFound.children = ((_b = itemFound.children) !== null && _b !== void 0 ? _b : []);
|
|
669
|
+
itemFound.children.push(item);
|
|
670
|
+
itemFound.childrenCount = itemFound.children.length;
|
|
671
|
+
}
|
|
672
|
+
applyDefaultValues(item) {
|
|
673
|
+
if (item.disabled === undefined) {
|
|
674
|
+
item.disabled = false;
|
|
675
|
+
}
|
|
676
|
+
if (item.expanded === undefined) {
|
|
677
|
+
item.expanded = false;
|
|
678
|
+
}
|
|
679
|
+
return item;
|
|
680
|
+
}
|
|
681
|
+
updateItemInIndexedList(item, forceDefaultValues = false) {
|
|
682
|
+
if (!item || !this.items) {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
const itemFound = this.getItemById(item.id, this.items);
|
|
686
|
+
if (itemFound) {
|
|
687
|
+
Object.assign(itemFound, forceDefaultValues ? this.applyDefaultValues(item) : item);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
removeItemFromIndexedList(id, items) {
|
|
691
|
+
var _a;
|
|
692
|
+
items = (_a = items !== null && items !== void 0 ? items : this.items) !== null && _a !== void 0 ? _a : [];
|
|
693
|
+
if (!id) {
|
|
694
|
+
return false;
|
|
695
|
+
}
|
|
696
|
+
const rootIndex = items.findIndex(item => item.id === id);
|
|
697
|
+
if (rootIndex !== -1) {
|
|
698
|
+
items.splice(rootIndex, 1);
|
|
699
|
+
return true;
|
|
700
|
+
}
|
|
701
|
+
for (const treeItem of items) {
|
|
702
|
+
if (treeItem.children && Array.isArray(treeItem.children)) {
|
|
703
|
+
const childIndex = treeItem.children.findIndex(child => child.id === id);
|
|
704
|
+
if (childIndex !== -1) {
|
|
705
|
+
treeItem.children.splice(childIndex, 1);
|
|
706
|
+
treeItem.childrenCount = treeItem.children.length;
|
|
707
|
+
return true;
|
|
708
|
+
}
|
|
709
|
+
if (this.removeItemFromIndexedList(id, treeItem.children)) {
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return false;
|
|
715
|
+
}
|
|
569
716
|
getItemPathAttrs({ id, label }) {
|
|
570
717
|
return { id, label };
|
|
571
718
|
}
|