@daracl/dialog 0.0.8 → 0.0.9
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/README.md +1 -1
- package/dist/daracl.dialog.css +4 -1
- package/dist/daracl.dialog.js +100 -68
- package/dist/daracl.dialog.js.map +1 -1
- package/dist/daracl.dialog.min.css +1 -1
- package/dist/daracl.dialog.min.js +3 -3
- package/dist/daracl.dialog.min.umd.js +3 -3
- package/dist/daracl.dialog.umd.js +100 -68
- package/dist/daracl.dialog.umd.js.map +1 -1
- package/dist/dialog.d.ts +24 -1
- package/dist/index.cjs +100 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -1
- package/dist/index.js +100 -68
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +2 -2
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +147 -124
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -3
- package/style/daracl.dialog.scss +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(:root,[data-daracl-theme=light]){--dui-primary-color: #2563eb;--dui-primary-hover-color: #1d4ed8;--dui-primary-font-color: #ffffff;--dui-primary-soft-bg: rgba(37, 99, 235, .1);--dui-danger-color: #dc2626;--dui-alert-success-color: #0abf30;--dui-alert-error-color: #e24d4c;--dui-alert-warning-color: #e9bd0c;--dui-alert-info-color: #3498db;--dui-active-bg: #337ab7;--dui-active-color: #ffffff;--dui-sunday-color: #f00d0d;--dui-bar-positive-bg: #77c0fc;--dui-bar-negative-bg: #ff8989;--dui-tooltip-color: #ffffff;--dui-icon-stroke-on-color: #ffffff;--dui-icon-fill-stroke-on-color: #494949;--dui-font-color: #222222;--dui-label-color: #444444;--dui-font-soft-color: #4a4a4a;--dui-font-hover-color: #000000;--dui-font-disable-color: #9aa1ab;--dui-muted-color: #626976;--dui-border-color: #d9dde3;--dui-border-thick-color: #b9bdc1;--dui-border-light-color: #e5e7eb;--dui-divider-color: #cccccc;--dui-body-bg: #ffffff;--dui-body-bg-thin: #f0f0f0;--dui-body-bg-deep: #dedede;--dui-body-bg-hover: #d2d2d2;--dui-disabled-bg: #ebebeb;--dui-panel-header-bg: #f7f9fc;--dui-input-bg: #ffffff;--dui-input-color: #212529;--dui-input-border-color: #cdcdcd;--dui-input-border-hover-color: #b9bdc1;--dui-input-disabled-bg: #ebebeb;--dui-button-bg: #ffffff;--dui-button-border-color: #c9ced6;--dui-button-hover-bg: #e3e3e3;--dui-button-bg-active: #dfe7f3;--dui-tab-bg: #f6f6f6;--dui-tab-bg-hover: #ebebeb;--dui-tooltip-bg: #3e3e3e;--dui-error-color: #b42318;--dui-error-bg: #fff4f4;--dui-error-border-color: #f0b4b4;--dui-required-color: #d92d20;--dui-invalid-font-color: #c4281c;--dui-invalid-border-color: #ffb6b4;--dui-invalid-bg: #ffdddd;--dui-hover-bg: #eef3fc;--dui-hover-color: #000000;--dui-hover-accent-bg: #dff5ff;--dui-hover-accent-color: #000000;--dui-selected-bg: #e9faff;--dui-selected-color: #212529;--dui-selected-border-color: #4762fa;--dui-item-check-color: #1a73e8;--dui-search-match-color: #0040ff;--dui-accent-text-color: #5970f5;--dui-today-bg: #a9d5ff;--dui-check-bg: #dfdfdf;--dui-check-active-bg: #4caf50;--dui-check-mark-color: #ffffff;--dui-check-indeterminate-bg: #686868;--dui-scroll-bg: #f7f7f7;--dui-scroll-track-bg: #f7f7f7;--dui-scroll-thumb-bg: #a5a5a5;--dui-scroll-thumb-hover-bg: #696969;--dui-scroll-button-bg: #c5c3c3;--dui-icon-stroke-color: #5a5858;--dui-icon-fill-stroke-color: #ffffff;--dui-empty-icon-color: #adabab;--dui-overlay-bg: rgba(15, 23, 42, .45);--dui-shadow: 0 2px 8px rgba(0, 0, 0, .15);--dui-page-shadow: 0 1px 3px rgba(15, 23, 42, .12)}@media(prefers-color-scheme:dark){:where(:root:not([data-daracl-theme])){--dui-primary-color: #2563eb;--dui-primary-hover-color: #1d4ed8;--dui-primary-font-color: #ffffff;--dui-primary-soft-bg: rgba(37, 99, 235, .1);--dui-danger-color: #dc2626;--dui-alert-success-color: #0abf30;--dui-alert-error-color: #e24d4c;--dui-alert-warning-color: #e9bd0c;--dui-alert-info-color: #3498db;--dui-active-bg: #337ab7;--dui-active-color: #ffffff;--dui-sunday-color: #f00d0d;--dui-bar-positive-bg: #77c0fc;--dui-bar-negative-bg: #ff8989;--dui-tooltip-color: #ffffff;--dui-icon-stroke-on-color: #ffffff;--dui-icon-fill-stroke-on-color: #494949;--dui-font-color: #cfd3dc;--dui-label-color: #a3a6ad;--dui-font-soft-color: #b9bdc6;--dui-font-hover-color: #e5eaf3;--dui-font-disable-color: #6c6e72;--dui-muted-color: #8d9095;--dui-border-color: #4c4d4f;--dui-border-thick-color: #636466;--dui-border-light-color: #363637;--dui-divider-color: #58585b;--dui-body-bg: #1d1e1f;--dui-body-bg-thin: #262727;--dui-body-bg-deep: #303030;--dui-body-bg-hover: #39393a;--dui-disabled-bg: #262727;--dui-panel-header-bg: #0a0a0a;--dui-input-bg: #1d1e1f;--dui-input-color: #e5eaf3;--dui-input-border-color: #4c4d4f;--dui-input-border-hover-color: #636466;--dui-input-disabled-bg: #262727;--dui-button-bg: #1d1e1f;--dui-button-border-color: #4c4d4f;--dui-button-hover-bg: #303030;--dui-button-bg-active: #39393a;--dui-tab-bg: #0a0a0a;--dui-tab-bg-hover: #262727;--dui-tooltip-bg: #303030;--dui-error-color: #f56c6c;--dui-error-bg: #2b1d1d;--dui-error-border-color: #582e2e;--dui-required-color: #ff9b9b;--dui-invalid-font-color: #ff9b9b;--dui-invalid-border-color: #ff5e5e;--dui-invalid-bg: #3a1f1f;--dui-hover-bg: #39393a;--dui-hover-color: #e5eaf3;--dui-hover-accent-bg: #213d5b;--dui-hover-accent-color: #e5eaf3;--dui-selected-bg: #264f78;--dui-selected-color: #e5eaf3;--dui-selected-border-color: #47dcfa;--dui-item-check-color: #68a9ff;--dui-search-match-color: #1fa0ff;--dui-accent-text-color: #68e4f9;--dui-today-bg: #5660d9;--dui-check-bg: #979797;--dui-check-active-bg: #00c1ff;--dui-check-mark-color: #4e4e4e;--dui-check-indeterminate-bg: #fffbfb;--dui-scroll-bg: #1d1e1f;--dui-scroll-track-bg: #1d1e1f;--dui-scroll-thumb-bg: #424243;--dui-scroll-thumb-hover-bg: #58585b;--dui-scroll-button-bg: #262727;--dui-icon-stroke-color: #fffbfb;--dui-icon-fill-stroke-color: #1a1a1a;--dui-empty-icon-color: #888888;--dui-overlay-bg: rgba(0, 0, 0, .8);--dui-shadow: 0 2px 12px rgba(0, 0, 0, .72);--dui-page-shadow: 0 0 6px rgba(0, 0, 0, .72)}}:where([data-daracl-theme=dark]){--dui-primary-color: #2563eb;--dui-primary-hover-color: #1d4ed8;--dui-primary-font-color: #ffffff;--dui-primary-soft-bg: rgba(37, 99, 235, .1);--dui-danger-color: #dc2626;--dui-alert-success-color: #0abf30;--dui-alert-error-color: #e24d4c;--dui-alert-warning-color: #e9bd0c;--dui-alert-info-color: #3498db;--dui-active-bg: #337ab7;--dui-active-color: #ffffff;--dui-sunday-color: #f00d0d;--dui-bar-positive-bg: #77c0fc;--dui-bar-negative-bg: #ff8989;--dui-tooltip-color: #ffffff;--dui-icon-stroke-on-color: #ffffff;--dui-icon-fill-stroke-on-color: #494949;--dui-font-color: #cfd3dc;--dui-label-color: #a3a6ad;--dui-font-soft-color: #b9bdc6;--dui-font-hover-color: #e5eaf3;--dui-font-disable-color: #6c6e72;--dui-muted-color: #8d9095;--dui-border-color: #4c4d4f;--dui-border-thick-color: #636466;--dui-border-light-color: #363637;--dui-divider-color: #58585b;--dui-body-bg: #1d1e1f;--dui-body-bg-thin: #262727;--dui-body-bg-deep: #303030;--dui-body-bg-hover: #39393a;--dui-disabled-bg: #262727;--dui-panel-header-bg: #0a0a0a;--dui-input-bg: #1d1e1f;--dui-input-color: #e5eaf3;--dui-input-border-color: #4c4d4f;--dui-input-border-hover-color: #636466;--dui-input-disabled-bg: #262727;--dui-button-bg: #1d1e1f;--dui-button-border-color: #4c4d4f;--dui-button-hover-bg: #303030;--dui-button-bg-active: #39393a;--dui-tab-bg: #0a0a0a;--dui-tab-bg-hover: #262727;--dui-tooltip-bg: #303030;--dui-error-color: #f56c6c;--dui-error-bg: #2b1d1d;--dui-error-border-color: #582e2e;--dui-required-color: #ff9b9b;--dui-invalid-font-color: #ff9b9b;--dui-invalid-border-color: #ff5e5e;--dui-invalid-bg: #3a1f1f;--dui-hover-bg: #39393a;--dui-hover-color: #e5eaf3;--dui-hover-accent-bg: #213d5b;--dui-hover-accent-color: #e5eaf3;--dui-selected-bg: #264f78;--dui-selected-color: #e5eaf3;--dui-selected-border-color: #47dcfa;--dui-item-check-color: #68a9ff;--dui-search-match-color: #1fa0ff;--dui-accent-text-color: #68e4f9;--dui-today-bg: #5660d9;--dui-check-bg: #979797;--dui-check-active-bg: #00c1ff;--dui-check-mark-color: #4e4e4e;--dui-check-indeterminate-bg: #fffbfb;--dui-scroll-bg: #1d1e1f;--dui-scroll-track-bg: #1d1e1f;--dui-scroll-thumb-bg: #424243;--dui-scroll-thumb-hover-bg: #58585b;--dui-scroll-button-bg: #262727;--dui-icon-stroke-color: #fffbfb;--dui-icon-fill-stroke-color: #1a1a1a;--dui-empty-icon-color: #888888;--dui-overlay-bg: rgba(0, 0, 0, .8);--dui-shadow: 0 2px 12px rgba(0, 0, 0, .72);--dui-page-shadow: 0 0 6px rgba(0, 0, 0, .72)}.daracl-dialog-wrapper,[data-daracl-theme=light] .daracl-dialog-wrapper,.daracl-dialog-wrapper[data-daracl-theme=light],.daracl-dialog-overlay,[data-daracl-theme=light] .daracl-dialog-overlay,.daracl-dialog-overlay[data-daracl-theme=light]{--ddlg-overlay-bg: #aaaaaa;--ddlg-overlay-opacity: .3;--ddlg-btn-primary-bg: #cce5ff;--ddlg-btn-primary-border-color: #b8daff;--ddlg-btn-primary-color: #004085;--ddlg-btn-secondary-bg: #e2e3e5;--ddlg-btn-secondary-border-color: #d6d8db;--ddlg-btn-secondary-color: #383d41;--ddlg-btn-info-bg: #d1ecf1;--ddlg-btn-info-border-color: #bee5eb;--ddlg-btn-info-color: #0c5460;--ddlg-btn-success-bg: #d4edda;--ddlg-btn-success-border-color: #c3e6cb;--ddlg-btn-success-color: #155724;--ddlg-btn-warning-bg: #fff3cd;--ddlg-btn-warning-border-color: #ffeeba;--ddlg-btn-warning-color: #856404;--ddlg-btn-danger-bg: #f8d7da;--ddlg-btn-danger-border-color: #f5c6cb;--ddlg-btn-danger-color: #721c24}@media(prefers-color-scheme:dark){:where(:root:not([data-daracl-theme])) .daracl-dialog-wrapper,:where(:root:not([data-daracl-theme])) .daracl-dialog-overlay{--ddlg-overlay-bg: #000000;--ddlg-overlay-opacity: .5;--ddlg-btn-primary-bg: #1c3d5e;--ddlg-btn-primary-border-color: #2b5a8a;--ddlg-btn-primary-color: #cfe2ff;--ddlg-btn-secondary-bg: #3a3b3d;--ddlg-btn-secondary-border-color: #4a4c4f;--ddlg-btn-secondary-color: #e2e3e5;--ddlg-btn-info-bg: #12414a;--ddlg-btn-info-border-color: #1b5c69;--ddlg-btn-info-color: #b6effb;--ddlg-btn-success-bg: #1e4a2b;--ddlg-btn-success-border-color: #2b6a3d;--ddlg-btn-success-color: #c3e6cb;--ddlg-btn-warning-bg: #5c4a13;--ddlg-btn-warning-border-color: #7a6420;--ddlg-btn-warning-color: #ffe69c;--ddlg-btn-danger-bg: #5c1f25;--ddlg-btn-danger-border-color: #842029;--ddlg-btn-danger-color: #f5c2c7}}[data-daracl-theme=dark] .daracl-dialog-wrapper,.daracl-dialog-wrapper[data-daracl-theme=dark],[data-daracl-theme=dark] .daracl-dialog-overlay,.daracl-dialog-overlay[data-daracl-theme=dark]{--ddlg-overlay-bg: #000000;--ddlg-overlay-opacity: .5;--ddlg-btn-primary-bg: #1c3d5e;--ddlg-btn-primary-border-color: #2b5a8a;--ddlg-btn-primary-color: #cfe2ff;--ddlg-btn-secondary-bg: #3a3b3d;--ddlg-btn-secondary-border-color: #4a4c4f;--ddlg-btn-secondary-color: #e2e3e5;--ddlg-btn-info-bg: #12414a;--ddlg-btn-info-border-color: #1b5c69;--ddlg-btn-info-color: #b6effb;--ddlg-btn-success-bg: #1e4a2b;--ddlg-btn-success-border-color: #2b6a3d;--ddlg-btn-success-color: #c3e6cb;--ddlg-btn-warning-bg: #5c4a13;--ddlg-btn-warning-border-color: #7a6420;--ddlg-btn-warning-color: #ffe69c;--ddlg-btn-danger-bg: #5c1f25;--ddlg-btn-danger-border-color: #842029;--ddlg-btn-danger-color: #f5c2c7}.daracl-dialog-hidden{visibility:visible;width:0px;height:0px;z-index:1000}.daracl-dialog-overlay{background:var(--ddlg-overlay-bg, #aaaaaa);opacity:var(--ddlg-overlay-opacity, .3);position:fixed;top:0;left:0;width:100%;height:100%}.daracl-dialog-wrapper{z-index:10000;position:fixed;width:400px;color:var(--dui-font-color, #222222);top:45%;left:50%;transform:translate(-50%,-50%)}.daracl-dialog-wrapper *{box-sizing:border-box}.daracl-dialog-wrapper.hide{display:none}.daracl-dialog-wrapper:focus{outline:none}.daracl-dialog-wrapper.transform-disable{transform:none!important}.daracl-dialog-wrapper.move-on .dialog-move-overay{display:block!important}.daracl-dialog-wrapper.move-on .resizer{display:none;position:relative;z-index:0}.daracl-dialog-wrapper.maximise{width:calc(100% - 6px)!important;height:calc(100% - 6px)!important;top:3px!important;left:3px!important;transform:initial}.daracl-dialog-wrapper.maximise .resizer{display:none}.daracl-dialog-wrapper.maximise .dialog-header{cursor:default!important}.daracl-dialog-wrapper>.daracl-dialog{border:1px solid var(--dui-border-light-color, #e5e7eb);border-radius:4px;height:100%;position:relative;background:var(--dui-body-bg, #ffffff)}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header{width:100%;height:40px;padding:10px 30px 10px 20px;background:var(--dui-panel-header-bg, #f7f9fc);border:var(--dui-border-light-color, #e5e7eb);border-radius:4px 4px 0 0;cursor:move}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header>.btn-area{position:absolute;top:10px;right:10px}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header>.btn-area>.dialog-maximise{width:16px;height:16px;display:inline-block;cursor:pointer;background-repeat:no-repeat;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236c6c6c' width='16px' height='16px' viewBox='0 0 16 16' %3E%3Cpath d='M4.5 3C3.67157 3 3 3.67157 3 4.5V11.5C3 12.3284 3.67157 13 4.5 13H11.5C12.3284 13 13 12.3284 13 11.5V4.5C13 3.67157 12.3284 3 11.5 3H4.5ZM4.5 4H11.5C11.7761 4 12 4.22386 12 4.5V11.5C12 11.7761 11.7761 12 11.5 12H4.5C4.22386 12 4 11.7761 4 11.5V4.5C4 4.22386 4.22386 4 4.5 4Z' /%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header>.btn-area>.dialog-close{width:16px;height:16px;display:inline-block;cursor:pointer;background-repeat:no-repeat;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236c6c6c' width='16px' height='16px' viewBox='0 0 1024 1024'%3E%3Cpath d='M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog .dialog-move-overay{width:100%;height:100%;position:absolute;z-index:1;display:none;top:0;left:0;opacity:0}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body{padding:10px;height:calc(100% - 75px);border-top:1px solid var(--dui-border-light-color, #e5e7eb);border-bottom:1px solid var(--dui-border-light-color, #e5e7eb);min-height:50px;position:relative;background-repeat:no-repeat;background-position:10px 10px}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.primary{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232496ed' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-271.521q20.603 0 34.541-13.938 13.938-13.938 13.938-34.541v-151.521q0-20.604-13.938-34.541Q500.603-520 480-520q-20.603 0-34.541 13.938-13.938 13.937-13.938 34.541V-320q0 20.603 13.938 34.541 13.938 13.938 34.541 13.938Zm0-317.174q21.805 0 36.555-14.75T531.305-640q0-21.805-14.75-36.555T480-691.305q-21.805 0-36.555 14.75T428.695-640q0 21.805 14.75 36.555T480-588.695Zm0 527.913q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.secondary{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232496ed' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-271.521q20.603 0 34.541-13.938 13.938-13.938 13.938-34.541v-151.521q0-20.604-13.938-34.541Q500.603-520 480-520q-20.603 0-34.541 13.938-13.938 13.937-13.938 34.541V-320q0 20.603 13.938 34.541 13.938 13.938 34.541 13.938Zm0-317.174q21.805 0 36.555-14.75T531.305-640q0-21.805-14.75-36.555T480-691.305q-21.805 0-36.555 14.75T428.695-640q0 21.805 14.75 36.555T480-588.695Zm0 527.913q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.info{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232496ed' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-271.521q20.603 0 34.541-13.938 13.938-13.938 13.938-34.541v-151.521q0-20.604-13.938-34.541Q500.603-520 480-520q-20.603 0-34.541 13.938-13.938 13.937-13.938 34.541V-320q0 20.603 13.938 34.541 13.938 13.938 34.541 13.938Zm0-317.174q21.805 0 36.555-14.75T531.305-640q0-21.805-14.75-36.555T480-691.305q-21.805 0-36.555 14.75T428.695-640q0 21.805 14.75 36.555T480-588.695Zm0 527.913q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.success{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23493fff' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='m422.304-427.784-71.303-71.303q-14.392-14.392-35.914-14.392-21.522 0-35.913 14.392-14.392 14.391-14.109 35.913.283 21.522 14.674 35.914l104.956 104.956q16.162 15.956 37.712 15.956 21.55 0 37.506-15.956l217.522-217.522q14.391-14.391 14.391-35.63 0-21.24-14.391-35.631-14.392-14.392-35.914-14.392-21.522 0-35.913 14.392L422.304-427.784ZM480-60.782q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.warning{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e18787' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M115.218-110.391q-14.957 0-26.832-7.365-11.876-7.365-18.473-19.418-6.696-11.826-7.196-25.772-.5-13.946 7.196-27.228L433.695-820q7.696-13.391 20.363-19.805 12.666-6.413 26-6.413 13.333 0 25.942 6.413 12.609 6.414 20.305 19.805l363.782 629.826q7.696 13.282 7.196 27.228-.5 13.946-7.196 25.772-6.696 11.826-18.522 19.305-11.826 7.478-26.783 7.478H115.218Zm76.913-97.522h575.738L480-704.173l-287.869 496.26ZM480-241.696q17.565 0 30.196-12.63 12.63-12.631 12.63-30.196t-12.63-29.913Q497.565-326.783 480-326.783t-30.196 12.348q-12.63 12.348-12.63 29.913 0 17.565 12.63 30.196 12.631 12.63 30.196 12.63ZM480-360q17 0 28.5-11.5T520-400v-113.782q0-17-11.5-28.5t-28.5-11.5q-17 0-28.5 11.5t-11.5 28.5V-400q0 17 11.5 28.5T480-360Zm0-96.043Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.danger{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ef2e40' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M479.871-260.782q23.912 0 40.217-16.175 16.304-16.176 16.304-40.088 0-23.912-16.176-40.499-16.175-16.587-40.087-16.587-23.912 0-40.217 16.587-16.304 16.587-16.304 40.499 0 23.912 16.176 40.088 16.175 16.175 40.087 16.175ZM480-438.87q22.087 0 37.544-15.456 15.457-15.457 15.457-37.544v-147q0-22.087-15.457-37.543Q502.087-691.87 480-691.87q-22.087 0-37.544 15.457-15.457 15.456-15.457 37.543v147q0 22.087 15.457 37.544Q457.913-438.87 480-438.87Zm0 378.088q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body>.dialog-content{height:100%;word-break:keep-all;word-wrap:break-word;overflow:auto}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body>.dialog-content>.dialog-frame{width:100%;height:100%;border:0}.daracl-dialog-wrapper>.daracl-dialog>.dialog-footer{height:45px}.daracl-dialog-wrapper>.daracl-dialog>.dialog-footer>.btn-area{text-align:right;padding:12px 5px 0}.daracl-dialog-wrapper>.daracl-dialog>.resizer{position:absolute;z-index:2}.daracl-dialog-wrapper>.daracl-dialog>.resizer.top{top:-2px;left:0;width:100%;height:5px;cursor:n-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.left{top:0;left:-2px;width:5px;height:100%;cursor:e-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.right{top:0;right:-2px;width:5px;height:100%;cursor:w-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.bottom{bottom:-2px;left:0;width:100%;height:5px;cursor:s-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.top-left{top:0;left:0;width:7px;height:7px;cursor:nwse-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.top-right{top:0;right:0;width:7px;height:7px;cursor:nesw-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.bottom-left{bottom:0;left:0;width:7px;height:7px;cursor:nesw-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.bottom-right{bottom:0;right:0;width:7px;height:7px;cursor:nwse-resize}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn{border-radius:4px;background-color:var(--dui-hover-bg, #eef3fc);border:none;text-align:center;font-size:16px;padding:3px 5px;margin-right:10px;cursor:pointer;color:var(--dui-font-color, #222222);display:inline-block}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.primary{background-color:var(--ddlg-btn-primary-bg, #cce5ff);border-color:var(--ddlg-btn-primary-border-color, #b8daff);color:var(--ddlg-btn-primary-color, #004085)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.secondary{background-color:var(--ddlg-btn-secondary-bg, #e2e3e5);border-color:var(--ddlg-btn-secondary-border-color, #d6d8db);color:var(--ddlg-btn-secondary-color, #383d41)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.info{background-color:var(--ddlg-btn-info-bg, #d1ecf1);border-color:var(--ddlg-btn-info-border-color, #bee5eb);color:var(--ddlg-btn-info-color, #0c5460)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.success{background-color:var(--ddlg-btn-success-bg, #d4edda);border-color:var(--ddlg-btn-success-border-color, #c3e6cb);color:var(--ddlg-btn-success-color, #155724)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.warning{background-color:var(--ddlg-btn-warning-bg, #fff3cd);border-color:var(--ddlg-btn-warning-border-color, #ffeeba);color:var(--ddlg-btn-warning-color, #856404)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.danger{background-color:var(--ddlg-btn-danger-bg, #f8d7da);border-color:var(--ddlg-btn-danger-border-color, #f5c6cb);color:var(--ddlg-btn-danger-color, #721c24)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn:focus-visible,.daracl-dialog-wrapper>.daracl-dialog .dialog-maximise:focus-visible,.daracl-dialog-wrapper>.daracl-dialog .dialog-close:focus-visible{outline:2px solid var(--dui-selected-border-color, #4762fa);outline-offset:1px}.daracl-dialog-wrapper>.daracl-dialog.hide{animation:ddlg-fade-out .3s;animation-fill-mode:forwards}@keyframes ddlg-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ddlg-fade-out{0%{opacity:1}to{opacity:0}}@keyframes daradialogHide{0%{transform:translate(-10px)}40%{transform:translate(0)}80%{transform:translate(-5%)}to{transform:translate(calc(100% + 20px))}}
|
|
1
|
+
:where(:root,[data-daracl-theme=light]){--dui-primary-color: #2563eb;--dui-primary-hover-color: #1d4ed8;--dui-primary-font-color: #ffffff;--dui-primary-soft-bg: rgba(37, 99, 235, .1);--dui-danger-color: #dc2626;--dui-alert-success-color: #0abf30;--dui-alert-error-color: #e24d4c;--dui-alert-warning-color: #e9bd0c;--dui-alert-info-color: #3498db;--dui-active-bg: #337ab7;--dui-active-color: #ffffff;--dui-sunday-color: #f00d0d;--dui-bar-positive-bg: #77c0fc;--dui-bar-negative-bg: #ff8989;--dui-tooltip-color: #ffffff;--dui-icon-stroke-on-color: #ffffff;--dui-icon-fill-stroke-on-color: #494949;--dui-font-color: #222222;--dui-label-color: #444444;--dui-font-soft-color: #4a4a4a;--dui-font-hover-color: #000000;--dui-font-disable-color: #9aa1ab;--dui-muted-color: #626976;--dui-border-color: #d9dde3;--dui-border-thick-color: #b9bdc1;--dui-border-light-color: #e5e7eb;--dui-divider-color: #cccccc;--dui-body-bg: #ffffff;--dui-body-bg-thin: #f0f0f0;--dui-body-bg-deep: #dedede;--dui-body-bg-hover: #d2d2d2;--dui-disabled-bg: #ebebeb;--dui-panel-header-bg: #f7f9fc;--dui-input-bg: #ffffff;--dui-input-color: #212529;--dui-input-border-color: #cdcdcd;--dui-input-border-hover-color: #b9bdc1;--dui-input-disabled-bg: #ebebeb;--dui-button-bg: #ffffff;--dui-button-border-color: #c9ced6;--dui-button-hover-bg: #e3e3e3;--dui-button-bg-active: #dfe7f3;--dui-tab-bg: #f6f6f6;--dui-tab-bg-hover: #ebebeb;--dui-tooltip-bg: #3e3e3e;--dui-error-color: #b42318;--dui-error-bg: #fff4f4;--dui-error-border-color: #f0b4b4;--dui-required-color: #d92d20;--dui-invalid-font-color: #c4281c;--dui-invalid-border-color: #ffb6b4;--dui-invalid-bg: #ffdddd;--dui-hover-bg: #eef3fc;--dui-hover-color: #000000;--dui-hover-accent-bg: #dff5ff;--dui-hover-accent-color: #000000;--dui-selected-bg: #e9faff;--dui-selected-color: #212529;--dui-selected-border-color: #4762fa;--dui-item-check-color: #1a73e8;--dui-search-match-color: #0040ff;--dui-accent-text-color: #5970f5;--dui-today-bg: #a9d5ff;--dui-check-bg: #dfdfdf;--dui-check-active-bg: #4caf50;--dui-check-mark-color: #ffffff;--dui-check-indeterminate-bg: #686868;--dui-scroll-bg: #f7f7f7;--dui-scroll-track-bg: #f7f7f7;--dui-scroll-thumb-bg: #a5a5a5;--dui-scroll-thumb-hover-bg: #696969;--dui-scroll-button-bg: #c5c3c3;--dui-icon-stroke-color: #5a5858;--dui-icon-fill-stroke-color: #ffffff;--dui-empty-icon-color: #adabab;--dui-overlay-bg: rgba(15, 23, 42, .45);--dui-shadow: 0 2px 8px rgba(0, 0, 0, .15);--dui-page-shadow: 0 1px 3px rgba(15, 23, 42, .12)}@media(prefers-color-scheme:dark){:where(:root:not([data-daracl-theme])){--dui-primary-color: #2563eb;--dui-primary-hover-color: #1d4ed8;--dui-primary-font-color: #ffffff;--dui-primary-soft-bg: rgba(37, 99, 235, .1);--dui-danger-color: #dc2626;--dui-alert-success-color: #0abf30;--dui-alert-error-color: #e24d4c;--dui-alert-warning-color: #e9bd0c;--dui-alert-info-color: #3498db;--dui-active-bg: #337ab7;--dui-active-color: #ffffff;--dui-sunday-color: #f00d0d;--dui-bar-positive-bg: #77c0fc;--dui-bar-negative-bg: #ff8989;--dui-tooltip-color: #ffffff;--dui-icon-stroke-on-color: #ffffff;--dui-icon-fill-stroke-on-color: #494949;--dui-font-color: #cfd3dc;--dui-label-color: #a3a6ad;--dui-font-soft-color: #b9bdc6;--dui-font-hover-color: #e5eaf3;--dui-font-disable-color: #6c6e72;--dui-muted-color: #8d9095;--dui-border-color: #4c4d4f;--dui-border-thick-color: #636466;--dui-border-light-color: #363637;--dui-divider-color: #58585b;--dui-body-bg: #1d1e1f;--dui-body-bg-thin: #262727;--dui-body-bg-deep: #303030;--dui-body-bg-hover: #39393a;--dui-disabled-bg: #262727;--dui-panel-header-bg: #0a0a0a;--dui-input-bg: #1d1e1f;--dui-input-color: #e5eaf3;--dui-input-border-color: #4c4d4f;--dui-input-border-hover-color: #636466;--dui-input-disabled-bg: #262727;--dui-button-bg: #1d1e1f;--dui-button-border-color: #4c4d4f;--dui-button-hover-bg: #303030;--dui-button-bg-active: #39393a;--dui-tab-bg: #0a0a0a;--dui-tab-bg-hover: #262727;--dui-tooltip-bg: #303030;--dui-error-color: #f56c6c;--dui-error-bg: #2b1d1d;--dui-error-border-color: #582e2e;--dui-required-color: #ff9b9b;--dui-invalid-font-color: #ff9b9b;--dui-invalid-border-color: #ff5e5e;--dui-invalid-bg: #3a1f1f;--dui-hover-bg: #39393a;--dui-hover-color: #e5eaf3;--dui-hover-accent-bg: #213d5b;--dui-hover-accent-color: #e5eaf3;--dui-selected-bg: #264f78;--dui-selected-color: #e5eaf3;--dui-selected-border-color: #47dcfa;--dui-item-check-color: #68a9ff;--dui-search-match-color: #1fa0ff;--dui-accent-text-color: #68e4f9;--dui-today-bg: #5660d9;--dui-check-bg: #979797;--dui-check-active-bg: #00c1ff;--dui-check-mark-color: #4e4e4e;--dui-check-indeterminate-bg: #fffbfb;--dui-scroll-bg: #1d1e1f;--dui-scroll-track-bg: #1d1e1f;--dui-scroll-thumb-bg: #424243;--dui-scroll-thumb-hover-bg: #58585b;--dui-scroll-button-bg: #262727;--dui-icon-stroke-color: #fffbfb;--dui-icon-fill-stroke-color: #1a1a1a;--dui-empty-icon-color: #888888;--dui-overlay-bg: rgba(0, 0, 0, .8);--dui-shadow: 0 2px 12px rgba(0, 0, 0, .72);--dui-page-shadow: 0 0 6px rgba(0, 0, 0, .72)}}:where([data-daracl-theme=dark]){--dui-primary-color: #2563eb;--dui-primary-hover-color: #1d4ed8;--dui-primary-font-color: #ffffff;--dui-primary-soft-bg: rgba(37, 99, 235, .1);--dui-danger-color: #dc2626;--dui-alert-success-color: #0abf30;--dui-alert-error-color: #e24d4c;--dui-alert-warning-color: #e9bd0c;--dui-alert-info-color: #3498db;--dui-active-bg: #337ab7;--dui-active-color: #ffffff;--dui-sunday-color: #f00d0d;--dui-bar-positive-bg: #77c0fc;--dui-bar-negative-bg: #ff8989;--dui-tooltip-color: #ffffff;--dui-icon-stroke-on-color: #ffffff;--dui-icon-fill-stroke-on-color: #494949;--dui-font-color: #cfd3dc;--dui-label-color: #a3a6ad;--dui-font-soft-color: #b9bdc6;--dui-font-hover-color: #e5eaf3;--dui-font-disable-color: #6c6e72;--dui-muted-color: #8d9095;--dui-border-color: #4c4d4f;--dui-border-thick-color: #636466;--dui-border-light-color: #363637;--dui-divider-color: #58585b;--dui-body-bg: #1d1e1f;--dui-body-bg-thin: #262727;--dui-body-bg-deep: #303030;--dui-body-bg-hover: #39393a;--dui-disabled-bg: #262727;--dui-panel-header-bg: #0a0a0a;--dui-input-bg: #1d1e1f;--dui-input-color: #e5eaf3;--dui-input-border-color: #4c4d4f;--dui-input-border-hover-color: #636466;--dui-input-disabled-bg: #262727;--dui-button-bg: #1d1e1f;--dui-button-border-color: #4c4d4f;--dui-button-hover-bg: #303030;--dui-button-bg-active: #39393a;--dui-tab-bg: #0a0a0a;--dui-tab-bg-hover: #262727;--dui-tooltip-bg: #303030;--dui-error-color: #f56c6c;--dui-error-bg: #2b1d1d;--dui-error-border-color: #582e2e;--dui-required-color: #ff9b9b;--dui-invalid-font-color: #ff9b9b;--dui-invalid-border-color: #ff5e5e;--dui-invalid-bg: #3a1f1f;--dui-hover-bg: #39393a;--dui-hover-color: #e5eaf3;--dui-hover-accent-bg: #213d5b;--dui-hover-accent-color: #e5eaf3;--dui-selected-bg: #264f78;--dui-selected-color: #e5eaf3;--dui-selected-border-color: #47dcfa;--dui-item-check-color: #68a9ff;--dui-search-match-color: #1fa0ff;--dui-accent-text-color: #68e4f9;--dui-today-bg: #5660d9;--dui-check-bg: #979797;--dui-check-active-bg: #00c1ff;--dui-check-mark-color: #4e4e4e;--dui-check-indeterminate-bg: #fffbfb;--dui-scroll-bg: #1d1e1f;--dui-scroll-track-bg: #1d1e1f;--dui-scroll-thumb-bg: #424243;--dui-scroll-thumb-hover-bg: #58585b;--dui-scroll-button-bg: #262727;--dui-icon-stroke-color: #fffbfb;--dui-icon-fill-stroke-color: #1a1a1a;--dui-empty-icon-color: #888888;--dui-overlay-bg: rgba(0, 0, 0, .8);--dui-shadow: 0 2px 12px rgba(0, 0, 0, .72);--dui-page-shadow: 0 0 6px rgba(0, 0, 0, .72)}.daracl-dialog-wrapper,[data-daracl-theme=light] .daracl-dialog-wrapper,.daracl-dialog-wrapper[data-daracl-theme=light],.daracl-dialog-overlay,[data-daracl-theme=light] .daracl-dialog-overlay,.daracl-dialog-overlay[data-daracl-theme=light]{--ddlg-overlay-bg: #aaaaaa;--ddlg-overlay-opacity: .3;--ddlg-btn-primary-bg: #cce5ff;--ddlg-btn-primary-border-color: #b8daff;--ddlg-btn-primary-color: #004085;--ddlg-btn-secondary-bg: #e2e3e5;--ddlg-btn-secondary-border-color: #d6d8db;--ddlg-btn-secondary-color: #383d41;--ddlg-btn-info-bg: #d1ecf1;--ddlg-btn-info-border-color: #bee5eb;--ddlg-btn-info-color: #0c5460;--ddlg-btn-success-bg: #d4edda;--ddlg-btn-success-border-color: #c3e6cb;--ddlg-btn-success-color: #155724;--ddlg-btn-warning-bg: #fff3cd;--ddlg-btn-warning-border-color: #ffeeba;--ddlg-btn-warning-color: #856404;--ddlg-btn-danger-bg: #f8d7da;--ddlg-btn-danger-border-color: #f5c6cb;--ddlg-btn-danger-color: #721c24}@media(prefers-color-scheme:dark){:where(:root:not([data-daracl-theme])) .daracl-dialog-wrapper,:where(:root:not([data-daracl-theme])) .daracl-dialog-overlay{--ddlg-overlay-bg: #000000;--ddlg-overlay-opacity: .5;--ddlg-btn-primary-bg: #1c3d5e;--ddlg-btn-primary-border-color: #2b5a8a;--ddlg-btn-primary-color: #cfe2ff;--ddlg-btn-secondary-bg: #3a3b3d;--ddlg-btn-secondary-border-color: #4a4c4f;--ddlg-btn-secondary-color: #e2e3e5;--ddlg-btn-info-bg: #12414a;--ddlg-btn-info-border-color: #1b5c69;--ddlg-btn-info-color: #b6effb;--ddlg-btn-success-bg: #1e4a2b;--ddlg-btn-success-border-color: #2b6a3d;--ddlg-btn-success-color: #c3e6cb;--ddlg-btn-warning-bg: #5c4a13;--ddlg-btn-warning-border-color: #7a6420;--ddlg-btn-warning-color: #ffe69c;--ddlg-btn-danger-bg: #5c1f25;--ddlg-btn-danger-border-color: #842029;--ddlg-btn-danger-color: #f5c2c7}}[data-daracl-theme=dark] .daracl-dialog-wrapper,.daracl-dialog-wrapper[data-daracl-theme=dark],[data-daracl-theme=dark] .daracl-dialog-overlay,.daracl-dialog-overlay[data-daracl-theme=dark]{--ddlg-overlay-bg: #000000;--ddlg-overlay-opacity: .5;--ddlg-btn-primary-bg: #1c3d5e;--ddlg-btn-primary-border-color: #2b5a8a;--ddlg-btn-primary-color: #cfe2ff;--ddlg-btn-secondary-bg: #3a3b3d;--ddlg-btn-secondary-border-color: #4a4c4f;--ddlg-btn-secondary-color: #e2e3e5;--ddlg-btn-info-bg: #12414a;--ddlg-btn-info-border-color: #1b5c69;--ddlg-btn-info-color: #b6effb;--ddlg-btn-success-bg: #1e4a2b;--ddlg-btn-success-border-color: #2b6a3d;--ddlg-btn-success-color: #c3e6cb;--ddlg-btn-warning-bg: #5c4a13;--ddlg-btn-warning-border-color: #7a6420;--ddlg-btn-warning-color: #ffe69c;--ddlg-btn-danger-bg: #5c1f25;--ddlg-btn-danger-border-color: #842029;--ddlg-btn-danger-color: #f5c2c7}.daracl-dialog-hidden{visibility:visible;width:0px;height:0px;z-index:1000}.daracl-dialog-overlay{background:var(--ddlg-overlay-bg, #aaaaaa);opacity:var(--ddlg-overlay-opacity, .3);position:fixed;top:0;left:0;width:100%;height:100%}.daracl-dialog-wrapper{z-index:10000;position:fixed;width:400px;color:var(--dui-font-color, #222222);top:45%;left:50%;transform:translate(-50%,-50%)}.daracl-dialog-wrapper *{box-sizing:border-box}.daracl-dialog-wrapper.hide{display:none}.daracl-dialog-wrapper:focus{outline:none}.daracl-dialog-wrapper.transform-disable{transform:none!important}.daracl-dialog-wrapper.draggable>.daracl-dialog>.dialog-header{cursor:move}.daracl-dialog-wrapper.move-on .dialog-move-overay{display:block!important}.daracl-dialog-wrapper.move-on .resizer{display:none;position:relative;z-index:0}.daracl-dialog-wrapper.maximise{width:calc(100% - 6px)!important;height:calc(100% - 6px)!important;top:3px!important;left:3px!important;transform:initial}.daracl-dialog-wrapper.maximise .resizer{display:none}.daracl-dialog-wrapper.maximise .dialog-header{cursor:default!important}.daracl-dialog-wrapper>.daracl-dialog{border:1px solid var(--dui-border-light-color, #e5e7eb);border-radius:4px;height:100%;position:relative;background:var(--dui-body-bg, #ffffff)}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header{width:100%;height:40px;padding:10px 30px 10px 20px;background:var(--dui-panel-header-bg, #f7f9fc);border:var(--dui-border-light-color, #e5e7eb);border-radius:4px 4px 0 0;cursor:default}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header>.btn-area{position:absolute;top:10px;right:10px}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header>.btn-area>.dialog-maximise{width:16px;height:16px;display:inline-block;cursor:pointer;background-repeat:no-repeat;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236c6c6c' width='16px' height='16px' viewBox='0 0 16 16' %3E%3Cpath d='M4.5 3C3.67157 3 3 3.67157 3 4.5V11.5C3 12.3284 3.67157 13 4.5 13H11.5C12.3284 13 13 12.3284 13 11.5V4.5C13 3.67157 12.3284 3 11.5 3H4.5ZM4.5 4H11.5C11.7761 4 12 4.22386 12 4.5V11.5C12 11.7761 11.7761 12 11.5 12H4.5C4.22386 12 4 11.7761 4 11.5V4.5C4 4.22386 4.22386 4 4.5 4Z' /%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-header>.btn-area>.dialog-close{width:16px;height:16px;display:inline-block;cursor:pointer;background-repeat:no-repeat;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236c6c6c' width='16px' height='16px' viewBox='0 0 1024 1024'%3E%3Cpath d='M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog .dialog-move-overay{width:100%;height:100%;position:absolute;z-index:1;display:none;top:0;left:0;opacity:0}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body{padding:10px;height:calc(100% - 75px);border-top:1px solid var(--dui-border-light-color, #e5e7eb);border-bottom:1px solid var(--dui-border-light-color, #e5e7eb);min-height:50px;position:relative;background-repeat:no-repeat;background-position:10px 10px}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.primary{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232496ed' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-271.521q20.603 0 34.541-13.938 13.938-13.938 13.938-34.541v-151.521q0-20.604-13.938-34.541Q500.603-520 480-520q-20.603 0-34.541 13.938-13.938 13.937-13.938 34.541V-320q0 20.603 13.938 34.541 13.938 13.938 34.541 13.938Zm0-317.174q21.805 0 36.555-14.75T531.305-640q0-21.805-14.75-36.555T480-691.305q-21.805 0-36.555 14.75T428.695-640q0 21.805 14.75 36.555T480-588.695Zm0 527.913q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.secondary{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232496ed' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-271.521q20.603 0 34.541-13.938 13.938-13.938 13.938-34.541v-151.521q0-20.604-13.938-34.541Q500.603-520 480-520q-20.603 0-34.541 13.938-13.938 13.937-13.938 34.541V-320q0 20.603 13.938 34.541 13.938 13.938 34.541 13.938Zm0-317.174q21.805 0 36.555-14.75T531.305-640q0-21.805-14.75-36.555T480-691.305q-21.805 0-36.555 14.75T428.695-640q0 21.805 14.75 36.555T480-588.695Zm0 527.913q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.info{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232496ed' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M480-271.521q20.603 0 34.541-13.938 13.938-13.938 13.938-34.541v-151.521q0-20.604-13.938-34.541Q500.603-520 480-520q-20.603 0-34.541 13.938-13.938 13.937-13.938 34.541V-320q0 20.603 13.938 34.541 13.938 13.938 34.541 13.938Zm0-317.174q21.805 0 36.555-14.75T531.305-640q0-21.805-14.75-36.555T480-691.305q-21.805 0-36.555 14.75T428.695-640q0 21.805 14.75 36.555T480-588.695Zm0 527.913q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.success{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23493fff' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='m422.304-427.784-71.303-71.303q-14.392-14.392-35.914-14.392-21.522 0-35.913 14.392-14.392 14.391-14.109 35.913.283 21.522 14.674 35.914l104.956 104.956q16.162 15.956 37.712 15.956 21.55 0 37.506-15.956l217.522-217.522q14.391-14.391 14.391-35.63 0-21.24-14.391-35.631-14.392-14.392-35.914-14.392-21.522 0-35.913 14.392L422.304-427.784ZM480-60.782q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.warning{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23e18787' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M115.218-110.391q-14.957 0-26.832-7.365-11.876-7.365-18.473-19.418-6.696-11.826-7.196-25.772-.5-13.946 7.196-27.228L433.695-820q7.696-13.391 20.363-19.805 12.666-6.413 26-6.413 13.333 0 25.942 6.413 12.609 6.414 20.305 19.805l363.782 629.826q7.696 13.282 7.196 27.228-.5 13.946-7.196 25.772-6.696 11.826-18.522 19.305-11.826 7.478-26.783 7.478H115.218Zm76.913-97.522h575.738L480-704.173l-287.869 496.26ZM480-241.696q17.565 0 30.196-12.63 12.63-12.631 12.63-30.196t-12.63-29.913Q497.565-326.783 480-326.783t-30.196 12.348q-12.63 12.348-12.63 29.913 0 17.565 12.63 30.196 12.631 12.63 30.196 12.63ZM480-360q17 0 28.5-11.5T520-400v-113.782q0-17-11.5-28.5t-28.5-11.5q-17 0-28.5 11.5t-11.5 28.5V-400q0 17 11.5 28.5T480-360Zm0-96.043Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body.danger{padding-left:45px;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ef2e40' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath d='M479.871-260.782q23.912 0 40.217-16.175 16.304-16.176 16.304-40.088 0-23.912-16.176-40.499-16.175-16.587-40.087-16.587-23.912 0-40.217 16.587-16.304 16.587-16.304 40.499 0 23.912 16.176 40.088 16.175 16.175 40.087 16.175ZM480-438.87q22.087 0 37.544-15.456 15.457-15.457 15.457-37.544v-147q0-22.087-15.457-37.543Q502.087-691.87 480-691.87q-22.087 0-37.544 15.457-15.457 15.456-15.457 37.543v147q0 22.087 15.457 37.544Q457.913-438.87 480-438.87Zm0 378.088q-87.522 0-163.906-32.96-76.385-32.96-132.888-89.464-56.504-56.503-89.464-132.888Q60.782-392.478 60.782-480t32.96-163.906q32.96-76.385 89.464-132.888 56.503-56.504 132.888-89.464 76.384-32.96 163.906-32.96t163.906 32.96q76.385 32.96 132.888 89.464 56.504 56.503 89.464 132.888 32.96 76.384 32.96 163.906t-32.96 163.906q-32.96 76.385-89.464 132.888-56.503 56.504-132.888 89.464Q567.522-60.782 480-60.782Zm0-106.001q131.739 0 222.478-90.739T793.217-480q0-131.739-90.739-222.478T480-793.217q-131.739 0-222.478 90.739T166.783-480q0 131.739 90.739 222.478T480-166.783ZM480-480Z'/%3E%3C/svg%3E")}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body>.dialog-content{height:100%;word-break:keep-all;word-wrap:break-word;overflow:auto}.daracl-dialog-wrapper>.daracl-dialog>.dialog-body>.dialog-content>.dialog-frame{width:100%;height:100%;border:0}.daracl-dialog-wrapper>.daracl-dialog>.dialog-footer{height:45px}.daracl-dialog-wrapper>.daracl-dialog>.dialog-footer>.btn-area{text-align:right;padding:12px 5px 0}.daracl-dialog-wrapper>.daracl-dialog>.resizer{position:absolute;z-index:2}.daracl-dialog-wrapper>.daracl-dialog>.resizer.top{top:-2px;left:0;width:100%;height:5px;cursor:n-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.left{top:0;left:-2px;width:5px;height:100%;cursor:e-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.right{top:0;right:-2px;width:5px;height:100%;cursor:w-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.bottom{bottom:-2px;left:0;width:100%;height:5px;cursor:s-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.top-left{top:0;left:0;width:7px;height:7px;cursor:nwse-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.top-right{top:0;right:0;width:7px;height:7px;cursor:nesw-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.bottom-left{bottom:0;left:0;width:7px;height:7px;cursor:nesw-resize}.daracl-dialog-wrapper>.daracl-dialog>.resizer.bottom-right{bottom:0;right:0;width:7px;height:7px;cursor:nwse-resize}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn{border-radius:4px;background-color:var(--dui-hover-bg, #eef3fc);border:none;text-align:center;font-size:16px;padding:3px 5px;margin-right:10px;cursor:pointer;color:var(--dui-font-color, #222222);display:inline-block}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.primary{background-color:var(--ddlg-btn-primary-bg, #cce5ff);border-color:var(--ddlg-btn-primary-border-color, #b8daff);color:var(--ddlg-btn-primary-color, #004085)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.secondary{background-color:var(--ddlg-btn-secondary-bg, #e2e3e5);border-color:var(--ddlg-btn-secondary-border-color, #d6d8db);color:var(--ddlg-btn-secondary-color, #383d41)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.info{background-color:var(--ddlg-btn-info-bg, #d1ecf1);border-color:var(--ddlg-btn-info-border-color, #bee5eb);color:var(--ddlg-btn-info-color, #0c5460)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.success{background-color:var(--ddlg-btn-success-bg, #d4edda);border-color:var(--ddlg-btn-success-border-color, #c3e6cb);color:var(--ddlg-btn-success-color, #155724)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.warning{background-color:var(--ddlg-btn-warning-bg, #fff3cd);border-color:var(--ddlg-btn-warning-border-color, #ffeeba);color:var(--ddlg-btn-warning-color, #856404)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn.danger{background-color:var(--ddlg-btn-danger-bg, #f8d7da);border-color:var(--ddlg-btn-danger-border-color, #f5c6cb);color:var(--ddlg-btn-danger-color, #721c24)}.daracl-dialog-wrapper>.daracl-dialog .dialog-btn:focus-visible,.daracl-dialog-wrapper>.daracl-dialog .dialog-maximise:focus-visible,.daracl-dialog-wrapper>.daracl-dialog .dialog-close:focus-visible{outline:2px solid var(--dui-selected-border-color, #4762fa);outline-offset:1px}.daracl-dialog-wrapper>.daracl-dialog.hide{animation:ddlg-fade-out .3s;animation-fill-mode:forwards}@keyframes ddlg-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ddlg-fade-out{0%{opacity:1}to{opacity:0}}@keyframes daradialogHide{0%{transform:translate(-10px)}40%{transform:translate(0)}80%{transform:translate(-5%)}to{transform:translate(calc(100% + 20px))}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @daracl/dialog v0.0.
|
|
1
|
+
(function(E){typeof define=="function"&&define.amd?define(E):E()})((function(){"use strict";var K=Object.defineProperty;var $=(E,x,W)=>x in E?K(E,x,{enumerable:!0,configurable:!0,writable:!0,value:W}):E[x]=W;var A=(E,x,W)=>$(E,typeof x!="symbol"?x+"":x,W);/*!
|
|
2
|
+
* @daracl/dialog v0.0.9
|
|
3
3
|
* Copyright 2024-2026 darainfo and other contributors;
|
|
4
4
|
* Licensed MIT
|
|
5
|
-
*/function u(n){const e=n.trim().replace(/[\u0000-\u001F\u007F\s]+/g,"");if(!e)return!1;const t=/^([a-z][a-z0-9+.-]*):/i.exec(e);return t?t[1].toLowerCase()==="data"?/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp)(?:;|,)/i.test(e):["http","https","mailto","tel"].includes(t[1].toLowerCase()):!0}const w=new Set(["script","style","iframe","frame","frameset","object","embed","applet","link","meta","base","form","input","button","textarea","select","option","svg","math","template","noscript","title"]),A=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","del","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","li","mark","ol","p","pre","s","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),_=new Set(["class","style","title","alt","href","src","target","width","height","colspan","rowspan","align","valign","dir","lang"]),j=new Set(["href","src"]),P=/url\s*\(|expression\s*\(|javascript:|@import|behavior\s*:|-moz-binding|position\s*:\s*(?:fixed|absolute|sticky)|\\|\/\*/i;function U(n){Array.from(n.attributes).forEach(e=>{const t=e.name.toLowerCase(),i=e.value;_.has(t)&&(!j.has(t)||u(i))&&(t!=="style"||!P.test(i))&&(t!=="target"||i==="_blank"||i==="_self")||n.removeAttribute(e.name)}),n.tagName==="A"&&n.getAttribute("target")==="_blank"&&n.setAttribute("rel","noopener noreferrer")}function B(n){Array.from(n.childNodes).forEach(e=>{var s;if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){(s=e.parentNode)==null||s.removeChild(e);return}const t=e,i=t.tagName.toLowerCase();if(w.has(i)){t.remove();return}B(t),A.has(i)?U(t):t.replaceWith(...Array.from(t.childNodes))})}function q(n){const e=document.createElement("template");e.innerHTML=n;const t=e.content;return B(t),document.importNode(t,!0)}let C=0,z=0;const R="daraclDialogHidden",H="data-daracl-theme",X={primary:"primary",secondary:"secondary",info:"info",success:"success",warning:"warning",danger:"danger"},K=["a[href]","area[href]","button:not([disabled])","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","iframe","[contenteditable=true]","[tabindex]:not([tabindex='-1'])"].join(",");let F={width:400,height:300,styleClass:"",isModal:!1,icon:"",autoOpen:!0,draggable:!0,resizable:!1,enableHeader:!0,enableFooter:!0,enableMaxButton:!0,enableCloseButton:!0,closeOnEscape:!0,autoFocus:!0,minHeight:130,minWidth:230,zIndex:1e4,dragOverflow:!0,buttons:[],moveDelay:15,afterOpen:!1};function Y(){let n=document.getElementById(R);return n==null&&(n=document.createElement("div"),n.id=R,n.className="daracl-dialog-hidden",document.body.appendChild(n)),n}function L(n){return n==null||n===""?"":typeof n=="number"||/^\d+(\.\d+)?$/.test(String(n))?n+"px":String(n)}function I(n,e){typeof e=="string"&&e.split(/\s+/).filter(t=>t!=="").forEach(t=>n.classList.add(t))}function $(n){return n.key==="Enter"||n.key===" "||n.key==="Spacebar"}function O(n){const e=n.touches&&n.touches[0]?n.touches[0]:n.changedTouches&&n.changedTouches[0]?n.changedTouches[0]:n;return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}const S=class S{constructor(e){W(this,"onKeydown",e=>{if(this.options){if((e.key==="Escape"||e.key==="Esc")&&this.options.closeOnEscape!==!1&&this.options.enableCloseButton!==!1){e.stopPropagation(),this.hide();return}if(e.key==="Tab"&&this.options.isModal===!0){const t=this.getFocusableElements();if(t.length===0){e.preventDefault(),this.dialogWrapperElement.focus();return}const i=t[0],s=t[t.length-1],o=document.activeElement;e.shiftKey&&(o===i||o===this.dialogWrapperElement)?(e.preventDefault(),s.focus()):!e.shiftKey&&o===s&&(e.preventDefault(),i.focus())}}});W(this,"show",()=>{if(!this.dialogWrapperElement||!this.dialogWrapperElement.classList.contains("hide"))return this;z=Math.max(z,C)+2;const e=this.options.zIndex+z;if(this.returnFocusElement=typeof document!="undefined"?document.activeElement:null,this.dialogWrapperElement.style.zIndex=String(e),this.dialogWrapperElement.classList.remove("hide"),this.options.isModal===!0){this.removeDialogOverrayElement();const t=document.createElement("div");t.className="daracl-dialog-overlay",t.style.zIndex=String(e-1),this.themeName&&t.setAttribute(H,this.themeName);const i=Y(),s=i.firstChild;s?i.insertBefore(t,s):i.appendChild(t),this.dialogOverrayElement=t}if(this.options.autoFocus!==!1){const t=this.getFocusableElements(),s=t.find(o=>o.closest(".dialog-content"))||t.find(o=>o.closest(".dialog-footer"))||this.dialogWrapperElement;try{s.focus({preventScroll:!0})}catch(o){s.focus()}}return typeof this.options.afterOpen=="function"&&this.options.afterOpen.call(this,this.dialogWrapperElement),this});W(this,"hide",()=>{if(!this.dialogWrapperElement)return this;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);return this.dialogWrapperElement.classList.add("hide"),this.options.isModal===!0&&this.removeDialogOverrayElement(),e&&this.restoreFocus(t),this});W(this,"maximise",()=>{if(!this.dialogWrapperElement)return;const e=this.dialogWrapperElement.classList;e.contains("maximise")?e.remove("maximise"):e.add("maximise")});W(this,"destroy",()=>{if(!this.dialogWrapperElement)return;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);this.eventList.forEach(([s,o,a])=>s.removeEventListener(o,a,!1)),this.eventList=[],this.timerSet.forEach(s=>clearTimeout(s)),this.timerSet.clear(),this.removeDialogOverrayElement(),e&&this.restoreFocus(t);const i=this.dialogWrapperElement;i.parentNode&&i.parentNode.removeChild(i),this.dialogWrapperElement=null,this.options=null,this.idx=-1});typeof e=="string"&&(e={template:e,items:e}),this.options=Object.assign({},F,e),this.idx=C+=1,this.eventList=[],this.timerSet=new Set;const t=document.createElement("div");t.className=`daracl-dialog-wrapper hide dd-${C}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),this.options.isModal===!0&&t.setAttribute("aria-modal","true");const i=t.style;i.zIndex=String(this.options.zIndex+C),i.width=L(this.options.width),i.height=L(this.options.height),i.minHeight=L(this.options.minHeight),i.minWidth=L(this.options.minWidth),Y().appendChild(t),this.dialogWrapperElement=t,this.setTheme(this.options.theme),this.dialogTemplate(),this.addEvent(t,"keydown",this.onKeydown),this.options.draggable!==!1&&this.initDrag(),this.options.resizable===!0&&(t.classList.add("resizable"),this.initResize()),this.options.autoOpen!==!1&&this.show()}static create(e){return new S(e)}static setOptions(e){F=Object.assign({},F,e)}appendHtml(e,t,i){if(t==null)return;if(typeof Node!="undefined"&&t instanceof Node){e.appendChild(t);return}const s=String(t),o=this.options.sanitize;if(typeof o=="function"){const a=o(s);typeof Node!="undefined"&&a instanceof Node?e.appendChild(a):e.insertAdjacentHTML("beforeend",a==null?"":String(a));return}if(o===!1||i&&o!==!0){e.insertAdjacentHTML("beforeend",s);return}e.appendChild(q(s))}getFocusableElements(){return this.dialogWrapperElement?Array.prototype.slice.call(this.dialogWrapperElement.querySelectorAll(K)).filter(e=>!e.closest(".resizer")):[]}setTimer(e,t){const i=setTimeout(()=>{this.timerSet.delete(i),e()},t);return this.timerSet.add(i),i}clearTimer(e){e!==void 0&&(clearTimeout(e),this.timerSet.delete(e))}initResize(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelectorAll(".resizer");let i,s,o,a,r="",p=-1,m=-1,f,y;this.addEvent(t,"mousedown touchstart",l=>{if(this.isMaximise())return!1;r=l.currentTarget.getAttribute("data-mode")||"",f=r.indexOf("t")>-1,y=r.indexOf("l")>-1,p=y?e.getBoundingClientRect().left:-1,m=f?e.getBoundingClientRect().top:-1,l.preventDefault();const c=O(l);if(o=c.pageX,a=c.pageY,i=e.clientWidth,s=e.clientHeight,!e.classList.contains("transform-disable")){const d=e.getBoundingClientRect();this.setPosition(c,c.clientX-d.left,c.clientY-d.top,i,s),e.classList.add("transform-disable")}this.addEvent(document,"mousemove touchmove",b),this.addEvent(document,"mouseup touchend touchcancel",N)});let g=-1,x;const E=this.options.moveDelay,b=l=>{g==-1&&(g=new Date().getTime()),new Date().getTime()-E<=g&&this.clearTimer(x);const c=O(l);x=this.setTimer(()=>{if(g=-1,!this.options)return;let d=c.pageX-o,h=c.pageY-a;h=f?h*-1:h,d=y?d*-1:d;let v=s+h,T=i+d;this.options.minHeight>=v&&(v=this.options.minHeight,h=(s-v)*-1),this.options.minWidth>=T&&(T=this.options.minWidth,d=(i-T)*-1);let D=-1;f&&(D=m-h,D<=0&&(D=0,v=s+m),e.style.top=D+"px");let M=-1;y&&(M=p-d,M<=0&&(M=0,T=i+p),e.style.left=M+"px"),r!="b"&&r!="t"&&(e.style.width=T+"px"),r!="r"&&r!="l"&&(e.style.height=v+"px")},E)},N=()=>{this.clearTimer(x),g=-1,this.removeEvent(document,"mousemove touchmove",b),this.removeEvent(document,"mouseup touchend touchcancel",N)}}initDrag(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelector(".dialog-header");if(!t)return;let i=!1,s,o,a,r,p=!1;this.addEvent(t,"mousedown touchstart",E=>{const b=E.target;if((b.tagName||"").search(/(input|textarea|select|button)/gi)>-1||b.closest&&b.closest(".btn-area"))return!0;if(this.isMaximise())return!1;E.preventDefault();const l=O(E),c=e.getBoundingClientRect();a=e.clientWidth,r=e.clientHeight,i=!0,s=l.clientX-c.left,o=l.clientY-c.top,p||(this.setPosition(l,s,o,a,r),p=!0,e.classList.add("transform-disable")),e.classList.add("move-on"),this.addEvent(document,"mousemove touchmove",g),this.addEvent(document,"mouseup touchend touchcancel",x)});let m=-1,f;const y=this.options.moveDelay,g=E=>{if(i){m==-1&&(m=new Date().getTime()),new Date().getTime()-y<=m&&this.clearTimer(f);const b=O(E);f=this.setTimer(()=>{m=-1,this.dialogWrapperElement&&this.setPosition(b,s,o,a,r)},y)}},x=()=>{i=!1,m=-1,this.clearTimer(f),e.classList.remove("move-on"),this.removeEvent(document,"mousemove touchmove",g),this.removeEvent(document,"mouseup touchend touchcancel",x)}}setPosition(e,t,i,s,o){let a,r;this.options.dragOverflow===!1?(a=Math.min(Math.max(e.clientX-t,0),window.innerWidth-s),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-o)):(a=Math.min(Math.max(e.clientX-t,(s-80)*-1),window.innerWidth-80),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-30)),this.dialogWrapperElement.style.left=a+"px",this.dialogWrapperElement.style.top=r+"px"}bindButton(e,t,i){e.setAttribute("role","button"),e.setAttribute("tabindex","0"),this.addEvent(e,t,i),this.addEvent(e,"keydown",s=>{$(s)&&(s.preventDefault(),i(s))})}dialogTemplate(){var y,g,x,E,b,N;const e=this.options,t=e.enableHeader!==!1,i=e.enableFooter!==!1,s=document.createElement("div");if(s.className="daracl-dialog",I(s,(y=e.styleClass)!=null?y:""),t){const l=document.createElement("div");l.className="dialog-header",this.appendHtml(l,(g=e.title)!=null?g:"",!1);const c=(l.textContent||"").trim();c!==""&&this.dialogWrapperElement.setAttribute("aria-label",c);const d=document.createElement("div");if(d.className="btn-area",e.enableMaxButton){const h=document.createElement("span");h.className="dialog-maximise",h.setAttribute("aria-label","Maximize"),h.setAttribute("title","Maximize"),d.appendChild(h)}if(e.enableCloseButton){const h=document.createElement("span");h.className="dialog-close",h.setAttribute("aria-label","Close"),h.setAttribute("title","Close"),d.appendChild(h)}l.appendChild(d),s.appendChild(l)}const o=document.createElement("div");o.className="dialog-body",Object.prototype.hasOwnProperty.call(X,e.icon)&&o.classList.add(X[e.icon]),o.style.height=`calc(100%${t?" - 40px":""}${i?" - 45px":""})`;const a=document.createElement("div");a.className="dialog-move-overay",o.appendChild(a);const r=document.createElement("div");if(r.className="dialog-content",o.appendChild(r),e.url){const l=String(e.url);if(u(l)){const c=document.createElement("iframe");c.className="dialog-frame",c.src=l,typeof e.title=="string"&&(c.title=(this.dialogWrapperElement.getAttribute("aria-label")||"").slice(0,200)),r.appendChild(c)}else console.warn("[daracl.dialog] unsafe url blocked : "+l.slice(0,100))}else typeof e.template=="function"?this.appendHtml(r,e.template(),!0):this.appendHtml(r,e.template,!0);s.appendChild(o);const p=(x=e.buttons)!=null?x:[];if(i){const l=document.createElement("div");l.className="dialog-footer";const c=document.createElement("div");c.className="btn-area";for(let d=0;d<p.length;d++){const h=(E=p[d])!=null?E:{},v=document.createElement("span");v.className=`dialog-btn dialog-btn-${d}`,I(v,(b=h.styleClass)!=null?b:"success"),this.appendHtml(v,(N=h.label)!=null?N:"",!1),this.bindButton(v,"mousedown",T=>{typeof h.callback=="function"&&h.callback(T)}),c.appendChild(v)}l.appendChild(c),s.appendChild(l)}e.resizable===!0&&[["top","t"],["left","l"],["right","r"],["bottom","b"],["top-left","tl"],["top-right","tr"],["bottom-left","bl"],["bottom-right","br"]].forEach(([l,c])=>{const d=document.createElement("div");d.className=`resizer ${l}`,d.setAttribute("data-mode",c),s.appendChild(d)}),this.dialogWrapperElement.appendChild(s);const m=s.querySelector(".dialog-header .dialog-maximise");m&&this.bindButton(m,"click",()=>{this.maximise()});const f=s.querySelector(".dialog-header .dialog-close");f&&this.bindButton(f,"click",()=>{this.hide()})}setTheme(e){return this.dialogWrapperElement?(this.themeName=e?String(e):"",[this.dialogWrapperElement,this.dialogOverrayElement].forEach(t=>{t&&(this.themeName?t.setAttribute(H,this.themeName):t.removeAttribute(H))}),this):this}isOpen(){return!!this.dialogWrapperElement&&!this.dialogWrapperElement.classList.contains("hide")}restoreFocus(e){const t=this.returnFocusElement;this.returnFocusElement=null,!(!this.options||this.options.autoFocus===!1||!e)&&t&&typeof t.focus=="function"&&document.body.contains(t)&&t.focus()}removeDialogOverrayElement(){const e=this.dialogOverrayElement;this.dialogOverrayElement=void 0,e&&e.parentNode&&e.parentNode.removeChild(e)}isMaximise(){return!!this.dialogWrapperElement&&this.dialogWrapperElement.classList.contains("maximise")}addEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(o=>{o!==""&&s.forEach(a=>{a&&(this.eventList.some(([r,p,m])=>r===a&&p===o&&m===i)||(a.addEventListener(o,i,!1),this.eventList.push([a,o,i])))})})}removeEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(o=>{s.forEach(a=>{a&&(a.removeEventListener(o,i,!1),this.eventList=this.eventList.filter(([r,p,m])=>!(r===a&&p===o&&m===i)))})})}};W(S,"VERSION","0.0.8");let k=S;typeof window!="undefined"&&(window.Daracl=window.Daracl||{},window.Daracl.dialog=k)}));
|
|
5
|
+
*/function E(o){const e=o.trim().replace(/[\u0000-\u001F\u007F\s]+/g,"");if(!e)return!1;const t=/^([a-z][a-z0-9+.-]*):/i.exec(e);return t?t[1].toLowerCase()==="data"?/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp)(?:;|,)/i.test(e):["http","https","mailto","tel"].includes(t[1].toLowerCase()):!0}const x=new Set(["script","style","iframe","frame","frameset","object","embed","applet","link","meta","base","form","input","button","textarea","select","option","svg","math","template","noscript","title"]),W=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","del","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","li","mark","ol","p","pre","s","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),X=new Set(["class","style","title","alt","href","src","target","width","height","colspan","rowspan","align","valign","dir","lang"]),Y=new Set(["href","src"]),I=/url\s*\(|expression\s*\(|javascript:|@import|behavior\s*:|-moz-binding|position\s*:\s*(?:fixed|absolute|sticky)|\\|\/\*/i;function _(o){Array.from(o.attributes).forEach(e=>{const t=e.name.toLowerCase(),i=e.value;X.has(t)&&(!Y.has(t)||E(i))&&(t!=="style"||!I.test(i))&&(t!=="target"||i==="_blank"||i==="_self")||o.removeAttribute(e.name)}),o.tagName==="A"&&o.getAttribute("target")==="_blank"&&o.setAttribute("rel","noopener noreferrer")}function D(o){Array.from(o.childNodes).forEach(e=>{var s;if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){(s=e.parentNode)==null||s.removeChild(e);return}const t=e,i=t.tagName.toLowerCase();if(x.has(i)){t.remove();return}D(t),W.has(i)?_(t):t.replaceWith(...Array.from(t.childNodes))})}function q(o){const e=document.createElement("template");e.innerHTML=o;const t=e.content;return D(t),document.importNode(t,!0)}let N=0,T=0;const H="daraclDialogHidden",M="data-daracl-theme",k={primary:"primary",secondary:"secondary",info:"info",success:"success",warning:"warning",danger:"danger"},U=["a[href]","area[href]","button:not([disabled])","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","iframe","[contenteditable=true]","[tabindex]:not([tabindex='-1'])"].join(",");let z={width:400,height:300,styleClass:"",isModal:!1,icon:"",autoOpen:!0,draggable:!0,resizable:!1,enableHeader:!0,enableFooter:!0,enableMaxButton:!0,enableCloseButton:!0,closeOnEscape:!0,autoFocus:!0,minHeight:130,minWidth:230,zIndex:1e4,dragOverflow:!0,buttons:[],moveDelay:15,afterOpen:!1};function B(){let o=document.getElementById(H);return o==null&&(o=document.createElement("div"),o.id=H,o.className="daracl-dialog-hidden",document.body.appendChild(o)),o}function C(o){return o==null||o===""?"":typeof o=="number"||/^\d+(\.\d+)?$/.test(String(o))?o+"px":String(o)}function R(o,e){typeof e=="string"&&e.split(/\s+/).filter(t=>t!=="").forEach(t=>o.classList.add(t))}function j(o){return o.key==="Enter"||o.key===" "||o.key==="Spacebar"}function S(o){const e=o.touches&&o.touches[0]?o.touches[0]:o.changedTouches&&o.changedTouches[0]?o.changedTouches[0]:o;return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}const O=class O{constructor(e){A(this,"onKeydown",e=>{if(this.options){if((e.key==="Escape"||e.key==="Esc")&&this.options.closeOnEscape!==!1&&this.options.enableCloseButton!==!1){e.stopPropagation(),this.hide();return}if(e.key==="Tab"&&this.options.isModal===!0){const t=this.getFocusableElements();if(t.length===0){e.preventDefault(),this.dialogWrapperElement.focus();return}const i=t[0],s=t[t.length-1],n=document.activeElement;e.shiftKey&&(n===i||n===this.dialogWrapperElement)?(e.preventDefault(),s.focus()):!e.shiftKey&&n===s&&(e.preventDefault(),i.focus())}}});A(this,"show",()=>{if(!this.dialogWrapperElement||!this.dialogWrapperElement.classList.contains("hide"))return this;T=Math.max(T,N)+2;const e=this.options.zIndex+T;if(this.returnFocusElement=typeof document!="undefined"?document.activeElement:null,this.dialogWrapperElement.style.zIndex=String(e),this.dialogWrapperElement.classList.remove("hide"),this.options.isModal===!0){this.removeDialogOverrayElement();const t=document.createElement("div");t.className="daracl-dialog-overlay",t.style.zIndex=String(e-1),this.themeName&&t.setAttribute(M,this.themeName);const i=B(),s=i.firstChild;s?i.insertBefore(t,s):i.appendChild(t),this.dialogOverrayElement=t}if(this.options.autoFocus!==!1){const t=this.getFocusableElements(),s=t.find(n=>n.closest(".dialog-content"))||t.find(n=>n.closest(".dialog-footer"))||this.dialogWrapperElement;try{s.focus({preventScroll:!0})}catch(n){s.focus()}}return typeof this.options.afterOpen=="function"&&this.options.afterOpen.call(this,this.dialogWrapperElement),this});A(this,"hide",()=>{if(!this.dialogWrapperElement)return this;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);return this.dialogWrapperElement.classList.add("hide"),this.options.isModal===!0&&this.removeDialogOverrayElement(),e&&this.restoreFocus(t),this});A(this,"maximise",()=>{if(!this.dialogWrapperElement)return;const e=this.dialogWrapperElement.classList;e.contains("maximise")?e.remove("maximise"):e.add("maximise")});A(this,"destroy",()=>{if(!this.dialogWrapperElement)return;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);this.eventList.forEach(([s,n,a])=>s.removeEventListener(n,a,!1)),this.eventList=[],this.timerSet.forEach(s=>clearTimeout(s)),this.timerSet.clear(),typeof cancelAnimationFrame=="function"&&this.frameSet.forEach(s=>cancelAnimationFrame(s)),this.frameSet.clear(),this.removeDialogOverrayElement(),e&&this.restoreFocus(t);const i=this.dialogWrapperElement;i.parentNode&&i.parentNode.removeChild(i),this.dialogWrapperElement=null,this.options=null,this.idx=-1});typeof e=="string"&&(e={template:e,items:e}),this.options=Object.assign({},z,e),this.idx=N+=1,this.eventList=[],this.timerSet=new Set,this.frameSet=new Set;const t=document.createElement("div");t.className=`daracl-dialog-wrapper hide dd-${N}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),this.options.isModal===!0&&t.setAttribute("aria-modal","true");const i=t.style;i.zIndex=String(this.options.zIndex+N),i.width=C(this.options.width),i.height=C(this.options.height),i.minHeight=C(this.options.minHeight),i.minWidth=C(this.options.minWidth),B().appendChild(t),this.dialogWrapperElement=t,this.setTheme(this.options.theme),this.dialogTemplate(),this.addEvent(t,"keydown",this.onKeydown),this.options.draggable!==!1&&(t.classList.add("draggable"),this.initDrag()),this.options.resizable===!0&&(t.classList.add("resizable"),this.initResize()),this.options.autoOpen!==!1&&this.show()}static create(e){return new O(e)}static setOptions(e){z=Object.assign({},z,e)}appendHtml(e,t,i){if(t==null)return;if(typeof Node!="undefined"&&t instanceof Node){e.appendChild(t);return}const s=String(t),n=this.options.sanitize;if(typeof n=="function"){const a=n(s);typeof Node!="undefined"&&a instanceof Node?e.appendChild(a):e.insertAdjacentHTML("beforeend",a==null?"":String(a));return}if(n===!1||i&&n!==!0){e.insertAdjacentHTML("beforeend",s);return}e.appendChild(q(s))}getFocusableElements(){return this.dialogWrapperElement?Array.prototype.slice.call(this.dialogWrapperElement.querySelectorAll(U)).filter(e=>!e.closest(".resizer")):[]}setTimer(e,t){const i=setTimeout(()=>{this.timerSet.delete(i),e()},t);return this.timerSet.add(i),i}clearTimer(e){e!==void 0&&(clearTimeout(e),this.timerSet.delete(e))}createFrameUpdater(e){let t=null,i=0,s;const n=()=>{i&&(cancelAnimationFrame(i),this.frameSet.delete(i),i=0),this.clearTimer(s),s=void 0},a=()=>{n();const r=t;t=null,r&&this.dialogWrapperElement&&e(r)};return{request:r=>{if(t=r,!(i||s!==void 0))if(typeof requestAnimationFrame=="function"){const u=requestAnimationFrame(()=>{this.frameSet.delete(u),i=0,a()});i=u,this.frameSet.add(u)}else s=this.setTimer(()=>{s=void 0,a()},Math.max(this.options.moveDelay||0,0))},flush:a}}initResize(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelectorAll(".resizer");let i,s,n,a,r="",u=-1,f=-1,b,v;this.addEvent(t,"mousedown touchstart",p=>{if(this.isMaximise())return!1;r=p.currentTarget.getAttribute("data-mode")||"",b=r.indexOf("t")>-1,v=r.indexOf("l")>-1,u=v?e.getBoundingClientRect().left:-1,f=b?e.getBoundingClientRect().top:-1,p.preventDefault();const m=S(p);if(n=m.pageX,a=m.pageY,i=e.clientWidth,s=e.clientHeight,!e.classList.contains("transform-disable")){const l=e.getBoundingClientRect();this.setPosition(m,m.clientX-l.left,m.clientY-l.top,i,s),e.classList.add("transform-disable")}this.addEvent(document,"mousemove touchmove",w),this.addEvent(document,"mouseup touchend touchcancel",L)});const g=this.createFrameUpdater(p=>{let m=p.pageX-n,l=p.pageY-a;l=b?l*-1:l,m=v?m*-1:m;let c=s+l,d=i+m;this.options.minHeight>=c&&(c=this.options.minHeight,l=(s-c)*-1),this.options.minWidth>=d&&(d=this.options.minWidth,m=(i-d)*-1);let h=-1;b&&(h=f-l,h<=0&&(h=0,c=s+f),e.style.top=h+"px");let y=-1;v&&(y=u-m,y<=0&&(y=0,d=i+u),e.style.left=y+"px"),r!="b"&&r!="t"&&(e.style.width=d+"px"),r!="r"&&r!="l"&&(e.style.height=c+"px")}),w=p=>{g.request(S(p))},L=()=>{g.flush(),this.removeEvent(document,"mousemove touchmove",w),this.removeEvent(document,"mouseup touchend touchcancel",L)}}initDrag(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelector(".dialog-header");if(!t)return;let i=!1,s,n,a,r,u=!1;this.addEvent(t,"mousedown touchstart",g=>{const w=g.target;if((w.tagName||"").search(/(input|textarea|select|button)/gi)>-1||w.closest&&w.closest(".btn-area"))return!0;if(this.isMaximise())return!1;g.preventDefault();const p=S(g),m=e.getBoundingClientRect();a=e.clientWidth,r=e.clientHeight,i=!0,s=p.clientX-m.left,n=p.clientY-m.top,u||(this.setPosition(p,s,n,a,r),u=!0,e.classList.add("transform-disable")),e.classList.add("move-on"),this.addEvent(document,"mousemove touchmove",b),this.addEvent(document,"mouseup touchend touchcancel",v)});const f=this.createFrameUpdater(g=>{this.setPosition(g,s,n,a,r)}),b=g=>{i&&f.request(S(g))},v=()=>{f.flush(),i=!1,e.classList.remove("move-on"),this.removeEvent(document,"mousemove touchmove",b),this.removeEvent(document,"mouseup touchend touchcancel",v)}}setPosition(e,t,i,s,n){let a,r;this.options.dragOverflow===!1?(a=Math.min(Math.max(e.clientX-t,0),window.innerWidth-s),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-n)):(a=Math.min(Math.max(e.clientX-t,(s-80)*-1),window.innerWidth-80),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-30)),this.dialogWrapperElement.style.left=a+"px",this.dialogWrapperElement.style.top=r+"px"}bindButton(e,t,i){e.setAttribute("role","button"),e.setAttribute("tabindex","0"),this.addEvent(e,t,i),this.addEvent(e,"keydown",s=>{j(s)&&(s.preventDefault(),i(s))})}dialogTemplate(){var v,g,w,L,p,m;const e=this.options,t=e.enableHeader!==!1,i=e.enableFooter!==!1,s=document.createElement("div");if(s.className="daracl-dialog",R(s,(v=e.styleClass)!=null?v:""),t){const l=document.createElement("div");l.className="dialog-header",this.appendHtml(l,(g=e.title)!=null?g:"",!1);const c=(l.textContent||"").trim();c!==""&&this.dialogWrapperElement.setAttribute("aria-label",c);const d=document.createElement("div");if(d.className="btn-area",e.enableMaxButton){const h=document.createElement("span");h.className="dialog-maximise",h.setAttribute("aria-label","Maximize"),h.setAttribute("title","Maximize"),d.appendChild(h)}if(e.enableCloseButton){const h=document.createElement("span");h.className="dialog-close",h.setAttribute("aria-label","Close"),h.setAttribute("title","Close"),d.appendChild(h)}l.appendChild(d),s.appendChild(l)}const n=document.createElement("div");n.className="dialog-body",Object.prototype.hasOwnProperty.call(k,e.icon)&&n.classList.add(k[e.icon]),n.style.height=`calc(100%${t?" - 40px":""}${i?" - 45px":""})`;const a=document.createElement("div");a.className="dialog-move-overay",n.appendChild(a);const r=document.createElement("div");if(r.className="dialog-content",n.appendChild(r),e.url){const l=String(e.url);if(E(l)){const c=document.createElement("iframe");c.className="dialog-frame",c.src=l,typeof e.title=="string"&&(c.title=(this.dialogWrapperElement.getAttribute("aria-label")||"").slice(0,200)),r.appendChild(c)}else console.warn("[daracl.dialog] unsafe url blocked : "+l.slice(0,100))}else typeof e.template=="function"?this.appendHtml(r,e.template(),!0):this.appendHtml(r,e.template,!0);s.appendChild(n);const u=(w=e.buttons)!=null?w:[];if(i){const l=document.createElement("div");l.className="dialog-footer";const c=document.createElement("div");c.className="btn-area";for(let d=0;d<u.length;d++){const h=(L=u[d])!=null?L:{},y=document.createElement("span");y.className=`dialog-btn dialog-btn-${d}`,R(y,(p=h.styleClass)!=null?p:"success"),this.appendHtml(y,(m=h.label)!=null?m:"",!1),this.bindButton(y,"mousedown",P=>{typeof h.callback=="function"&&h.callback(P)}),c.appendChild(y)}l.appendChild(c),s.appendChild(l)}e.resizable===!0&&[["top","t"],["left","l"],["right","r"],["bottom","b"],["top-left","tl"],["top-right","tr"],["bottom-left","bl"],["bottom-right","br"]].forEach(([l,c])=>{const d=document.createElement("div");d.className=`resizer ${l}`,d.setAttribute("data-mode",c),s.appendChild(d)}),this.dialogWrapperElement.appendChild(s);const f=s.querySelector(".dialog-header .dialog-maximise");f&&this.bindButton(f,"click",()=>{this.maximise()});const b=s.querySelector(".dialog-header .dialog-close");b&&this.bindButton(b,"click",()=>{this.hide()})}setTheme(e){return this.dialogWrapperElement?(this.themeName=e?String(e):"",[this.dialogWrapperElement,this.dialogOverrayElement].forEach(t=>{t&&(this.themeName?t.setAttribute(M,this.themeName):t.removeAttribute(M))}),this):this}isOpen(){return!!this.dialogWrapperElement&&!this.dialogWrapperElement.classList.contains("hide")}restoreFocus(e){const t=this.returnFocusElement;this.returnFocusElement=null,!(!this.options||this.options.autoFocus===!1||!e)&&t&&typeof t.focus=="function"&&document.body.contains(t)&&t.focus()}removeDialogOverrayElement(){const e=this.dialogOverrayElement;this.dialogOverrayElement=void 0,e&&e.parentNode&&e.parentNode.removeChild(e)}isMaximise(){return!!this.dialogWrapperElement&&this.dialogWrapperElement.classList.contains("maximise")}addEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(n=>{n!==""&&s.forEach(a=>{a&&(this.eventList.some(([r,u,f])=>r===a&&u===n&&f===i)||(a.addEventListener(n,i,!1),this.eventList.push([a,n,i])))})})}removeEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(n=>{s.forEach(a=>{a&&(a.removeEventListener(n,i,!1),this.eventList=this.eventList.filter(([r,u,f])=>!(r===a&&u===n&&f===i)))})})}};A(O,"VERSION","0.0.9");let F=O;typeof window!="undefined"&&(window.Daracl=window.Daracl||{},window.Daracl.dialog=F)}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @daracl/dialog v0.0.
|
|
1
|
+
(function(E){typeof define=="function"&&define.amd?define(E):E()})((function(){"use strict";var K=Object.defineProperty;var $=(E,x,W)=>x in E?K(E,x,{enumerable:!0,configurable:!0,writable:!0,value:W}):E[x]=W;var A=(E,x,W)=>$(E,typeof x!="symbol"?x+"":x,W);/*!
|
|
2
|
+
* @daracl/dialog v0.0.9
|
|
3
3
|
* Copyright 2024-2026 darainfo and other contributors;
|
|
4
4
|
* Licensed MIT
|
|
5
|
-
*/function u(n){const e=n.trim().replace(/[\u0000-\u001F\u007F\s]+/g,"");if(!e)return!1;const t=/^([a-z][a-z0-9+.-]*):/i.exec(e);return t?t[1].toLowerCase()==="data"?/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp)(?:;|,)/i.test(e):["http","https","mailto","tel"].includes(t[1].toLowerCase()):!0}const w=new Set(["script","style","iframe","frame","frameset","object","embed","applet","link","meta","base","form","input","button","textarea","select","option","svg","math","template","noscript","title"]),A=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","del","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","li","mark","ol","p","pre","s","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),_=new Set(["class","style","title","alt","href","src","target","width","height","colspan","rowspan","align","valign","dir","lang"]),j=new Set(["href","src"]),P=/url\s*\(|expression\s*\(|javascript:|@import|behavior\s*:|-moz-binding|position\s*:\s*(?:fixed|absolute|sticky)|\\|\/\*/i;function U(n){Array.from(n.attributes).forEach(e=>{const t=e.name.toLowerCase(),i=e.value;_.has(t)&&(!j.has(t)||u(i))&&(t!=="style"||!P.test(i))&&(t!=="target"||i==="_blank"||i==="_self")||n.removeAttribute(e.name)}),n.tagName==="A"&&n.getAttribute("target")==="_blank"&&n.setAttribute("rel","noopener noreferrer")}function B(n){Array.from(n.childNodes).forEach(e=>{var s;if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){(s=e.parentNode)==null||s.removeChild(e);return}const t=e,i=t.tagName.toLowerCase();if(w.has(i)){t.remove();return}B(t),A.has(i)?U(t):t.replaceWith(...Array.from(t.childNodes))})}function q(n){const e=document.createElement("template");e.innerHTML=n;const t=e.content;return B(t),document.importNode(t,!0)}let C=0,z=0;const R="daraclDialogHidden",H="data-daracl-theme",X={primary:"primary",secondary:"secondary",info:"info",success:"success",warning:"warning",danger:"danger"},K=["a[href]","area[href]","button:not([disabled])","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","iframe","[contenteditable=true]","[tabindex]:not([tabindex='-1'])"].join(",");let F={width:400,height:300,styleClass:"",isModal:!1,icon:"",autoOpen:!0,draggable:!0,resizable:!1,enableHeader:!0,enableFooter:!0,enableMaxButton:!0,enableCloseButton:!0,closeOnEscape:!0,autoFocus:!0,minHeight:130,minWidth:230,zIndex:1e4,dragOverflow:!0,buttons:[],moveDelay:15,afterOpen:!1};function Y(){let n=document.getElementById(R);return n==null&&(n=document.createElement("div"),n.id=R,n.className="daracl-dialog-hidden",document.body.appendChild(n)),n}function L(n){return n==null||n===""?"":typeof n=="number"||/^\d+(\.\d+)?$/.test(String(n))?n+"px":String(n)}function I(n,e){typeof e=="string"&&e.split(/\s+/).filter(t=>t!=="").forEach(t=>n.classList.add(t))}function $(n){return n.key==="Enter"||n.key===" "||n.key==="Spacebar"}function O(n){const e=n.touches&&n.touches[0]?n.touches[0]:n.changedTouches&&n.changedTouches[0]?n.changedTouches[0]:n;return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}const S=class S{constructor(e){W(this,"onKeydown",e=>{if(this.options){if((e.key==="Escape"||e.key==="Esc")&&this.options.closeOnEscape!==!1&&this.options.enableCloseButton!==!1){e.stopPropagation(),this.hide();return}if(e.key==="Tab"&&this.options.isModal===!0){const t=this.getFocusableElements();if(t.length===0){e.preventDefault(),this.dialogWrapperElement.focus();return}const i=t[0],s=t[t.length-1],o=document.activeElement;e.shiftKey&&(o===i||o===this.dialogWrapperElement)?(e.preventDefault(),s.focus()):!e.shiftKey&&o===s&&(e.preventDefault(),i.focus())}}});W(this,"show",()=>{if(!this.dialogWrapperElement||!this.dialogWrapperElement.classList.contains("hide"))return this;z=Math.max(z,C)+2;const e=this.options.zIndex+z;if(this.returnFocusElement=typeof document!="undefined"?document.activeElement:null,this.dialogWrapperElement.style.zIndex=String(e),this.dialogWrapperElement.classList.remove("hide"),this.options.isModal===!0){this.removeDialogOverrayElement();const t=document.createElement("div");t.className="daracl-dialog-overlay",t.style.zIndex=String(e-1),this.themeName&&t.setAttribute(H,this.themeName);const i=Y(),s=i.firstChild;s?i.insertBefore(t,s):i.appendChild(t),this.dialogOverrayElement=t}if(this.options.autoFocus!==!1){const t=this.getFocusableElements(),s=t.find(o=>o.closest(".dialog-content"))||t.find(o=>o.closest(".dialog-footer"))||this.dialogWrapperElement;try{s.focus({preventScroll:!0})}catch(o){s.focus()}}return typeof this.options.afterOpen=="function"&&this.options.afterOpen.call(this,this.dialogWrapperElement),this});W(this,"hide",()=>{if(!this.dialogWrapperElement)return this;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);return this.dialogWrapperElement.classList.add("hide"),this.options.isModal===!0&&this.removeDialogOverrayElement(),e&&this.restoreFocus(t),this});W(this,"maximise",()=>{if(!this.dialogWrapperElement)return;const e=this.dialogWrapperElement.classList;e.contains("maximise")?e.remove("maximise"):e.add("maximise")});W(this,"destroy",()=>{if(!this.dialogWrapperElement)return;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);this.eventList.forEach(([s,o,a])=>s.removeEventListener(o,a,!1)),this.eventList=[],this.timerSet.forEach(s=>clearTimeout(s)),this.timerSet.clear(),this.removeDialogOverrayElement(),e&&this.restoreFocus(t);const i=this.dialogWrapperElement;i.parentNode&&i.parentNode.removeChild(i),this.dialogWrapperElement=null,this.options=null,this.idx=-1});typeof e=="string"&&(e={template:e,items:e}),this.options=Object.assign({},F,e),this.idx=C+=1,this.eventList=[],this.timerSet=new Set;const t=document.createElement("div");t.className=`daracl-dialog-wrapper hide dd-${C}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),this.options.isModal===!0&&t.setAttribute("aria-modal","true");const i=t.style;i.zIndex=String(this.options.zIndex+C),i.width=L(this.options.width),i.height=L(this.options.height),i.minHeight=L(this.options.minHeight),i.minWidth=L(this.options.minWidth),Y().appendChild(t),this.dialogWrapperElement=t,this.setTheme(this.options.theme),this.dialogTemplate(),this.addEvent(t,"keydown",this.onKeydown),this.options.draggable!==!1&&this.initDrag(),this.options.resizable===!0&&(t.classList.add("resizable"),this.initResize()),this.options.autoOpen!==!1&&this.show()}static create(e){return new S(e)}static setOptions(e){F=Object.assign({},F,e)}appendHtml(e,t,i){if(t==null)return;if(typeof Node!="undefined"&&t instanceof Node){e.appendChild(t);return}const s=String(t),o=this.options.sanitize;if(typeof o=="function"){const a=o(s);typeof Node!="undefined"&&a instanceof Node?e.appendChild(a):e.insertAdjacentHTML("beforeend",a==null?"":String(a));return}if(o===!1||i&&o!==!0){e.insertAdjacentHTML("beforeend",s);return}e.appendChild(q(s))}getFocusableElements(){return this.dialogWrapperElement?Array.prototype.slice.call(this.dialogWrapperElement.querySelectorAll(K)).filter(e=>!e.closest(".resizer")):[]}setTimer(e,t){const i=setTimeout(()=>{this.timerSet.delete(i),e()},t);return this.timerSet.add(i),i}clearTimer(e){e!==void 0&&(clearTimeout(e),this.timerSet.delete(e))}initResize(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelectorAll(".resizer");let i,s,o,a,r="",p=-1,m=-1,f,y;this.addEvent(t,"mousedown touchstart",l=>{if(this.isMaximise())return!1;r=l.currentTarget.getAttribute("data-mode")||"",f=r.indexOf("t")>-1,y=r.indexOf("l")>-1,p=y?e.getBoundingClientRect().left:-1,m=f?e.getBoundingClientRect().top:-1,l.preventDefault();const c=O(l);if(o=c.pageX,a=c.pageY,i=e.clientWidth,s=e.clientHeight,!e.classList.contains("transform-disable")){const d=e.getBoundingClientRect();this.setPosition(c,c.clientX-d.left,c.clientY-d.top,i,s),e.classList.add("transform-disable")}this.addEvent(document,"mousemove touchmove",b),this.addEvent(document,"mouseup touchend touchcancel",N)});let g=-1,x;const E=this.options.moveDelay,b=l=>{g==-1&&(g=new Date().getTime()),new Date().getTime()-E<=g&&this.clearTimer(x);const c=O(l);x=this.setTimer(()=>{if(g=-1,!this.options)return;let d=c.pageX-o,h=c.pageY-a;h=f?h*-1:h,d=y?d*-1:d;let v=s+h,T=i+d;this.options.minHeight>=v&&(v=this.options.minHeight,h=(s-v)*-1),this.options.minWidth>=T&&(T=this.options.minWidth,d=(i-T)*-1);let D=-1;f&&(D=m-h,D<=0&&(D=0,v=s+m),e.style.top=D+"px");let M=-1;y&&(M=p-d,M<=0&&(M=0,T=i+p),e.style.left=M+"px"),r!="b"&&r!="t"&&(e.style.width=T+"px"),r!="r"&&r!="l"&&(e.style.height=v+"px")},E)},N=()=>{this.clearTimer(x),g=-1,this.removeEvent(document,"mousemove touchmove",b),this.removeEvent(document,"mouseup touchend touchcancel",N)}}initDrag(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelector(".dialog-header");if(!t)return;let i=!1,s,o,a,r,p=!1;this.addEvent(t,"mousedown touchstart",E=>{const b=E.target;if((b.tagName||"").search(/(input|textarea|select|button)/gi)>-1||b.closest&&b.closest(".btn-area"))return!0;if(this.isMaximise())return!1;E.preventDefault();const l=O(E),c=e.getBoundingClientRect();a=e.clientWidth,r=e.clientHeight,i=!0,s=l.clientX-c.left,o=l.clientY-c.top,p||(this.setPosition(l,s,o,a,r),p=!0,e.classList.add("transform-disable")),e.classList.add("move-on"),this.addEvent(document,"mousemove touchmove",g),this.addEvent(document,"mouseup touchend touchcancel",x)});let m=-1,f;const y=this.options.moveDelay,g=E=>{if(i){m==-1&&(m=new Date().getTime()),new Date().getTime()-y<=m&&this.clearTimer(f);const b=O(E);f=this.setTimer(()=>{m=-1,this.dialogWrapperElement&&this.setPosition(b,s,o,a,r)},y)}},x=()=>{i=!1,m=-1,this.clearTimer(f),e.classList.remove("move-on"),this.removeEvent(document,"mousemove touchmove",g),this.removeEvent(document,"mouseup touchend touchcancel",x)}}setPosition(e,t,i,s,o){let a,r;this.options.dragOverflow===!1?(a=Math.min(Math.max(e.clientX-t,0),window.innerWidth-s),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-o)):(a=Math.min(Math.max(e.clientX-t,(s-80)*-1),window.innerWidth-80),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-30)),this.dialogWrapperElement.style.left=a+"px",this.dialogWrapperElement.style.top=r+"px"}bindButton(e,t,i){e.setAttribute("role","button"),e.setAttribute("tabindex","0"),this.addEvent(e,t,i),this.addEvent(e,"keydown",s=>{$(s)&&(s.preventDefault(),i(s))})}dialogTemplate(){var y,g,x,E,b,N;const e=this.options,t=e.enableHeader!==!1,i=e.enableFooter!==!1,s=document.createElement("div");if(s.className="daracl-dialog",I(s,(y=e.styleClass)!=null?y:""),t){const l=document.createElement("div");l.className="dialog-header",this.appendHtml(l,(g=e.title)!=null?g:"",!1);const c=(l.textContent||"").trim();c!==""&&this.dialogWrapperElement.setAttribute("aria-label",c);const d=document.createElement("div");if(d.className="btn-area",e.enableMaxButton){const h=document.createElement("span");h.className="dialog-maximise",h.setAttribute("aria-label","Maximize"),h.setAttribute("title","Maximize"),d.appendChild(h)}if(e.enableCloseButton){const h=document.createElement("span");h.className="dialog-close",h.setAttribute("aria-label","Close"),h.setAttribute("title","Close"),d.appendChild(h)}l.appendChild(d),s.appendChild(l)}const o=document.createElement("div");o.className="dialog-body",Object.prototype.hasOwnProperty.call(X,e.icon)&&o.classList.add(X[e.icon]),o.style.height=`calc(100%${t?" - 40px":""}${i?" - 45px":""})`;const a=document.createElement("div");a.className="dialog-move-overay",o.appendChild(a);const r=document.createElement("div");if(r.className="dialog-content",o.appendChild(r),e.url){const l=String(e.url);if(u(l)){const c=document.createElement("iframe");c.className="dialog-frame",c.src=l,typeof e.title=="string"&&(c.title=(this.dialogWrapperElement.getAttribute("aria-label")||"").slice(0,200)),r.appendChild(c)}else console.warn("[daracl.dialog] unsafe url blocked : "+l.slice(0,100))}else typeof e.template=="function"?this.appendHtml(r,e.template(),!0):this.appendHtml(r,e.template,!0);s.appendChild(o);const p=(x=e.buttons)!=null?x:[];if(i){const l=document.createElement("div");l.className="dialog-footer";const c=document.createElement("div");c.className="btn-area";for(let d=0;d<p.length;d++){const h=(E=p[d])!=null?E:{},v=document.createElement("span");v.className=`dialog-btn dialog-btn-${d}`,I(v,(b=h.styleClass)!=null?b:"success"),this.appendHtml(v,(N=h.label)!=null?N:"",!1),this.bindButton(v,"mousedown",T=>{typeof h.callback=="function"&&h.callback(T)}),c.appendChild(v)}l.appendChild(c),s.appendChild(l)}e.resizable===!0&&[["top","t"],["left","l"],["right","r"],["bottom","b"],["top-left","tl"],["top-right","tr"],["bottom-left","bl"],["bottom-right","br"]].forEach(([l,c])=>{const d=document.createElement("div");d.className=`resizer ${l}`,d.setAttribute("data-mode",c),s.appendChild(d)}),this.dialogWrapperElement.appendChild(s);const m=s.querySelector(".dialog-header .dialog-maximise");m&&this.bindButton(m,"click",()=>{this.maximise()});const f=s.querySelector(".dialog-header .dialog-close");f&&this.bindButton(f,"click",()=>{this.hide()})}setTheme(e){return this.dialogWrapperElement?(this.themeName=e?String(e):"",[this.dialogWrapperElement,this.dialogOverrayElement].forEach(t=>{t&&(this.themeName?t.setAttribute(H,this.themeName):t.removeAttribute(H))}),this):this}isOpen(){return!!this.dialogWrapperElement&&!this.dialogWrapperElement.classList.contains("hide")}restoreFocus(e){const t=this.returnFocusElement;this.returnFocusElement=null,!(!this.options||this.options.autoFocus===!1||!e)&&t&&typeof t.focus=="function"&&document.body.contains(t)&&t.focus()}removeDialogOverrayElement(){const e=this.dialogOverrayElement;this.dialogOverrayElement=void 0,e&&e.parentNode&&e.parentNode.removeChild(e)}isMaximise(){return!!this.dialogWrapperElement&&this.dialogWrapperElement.classList.contains("maximise")}addEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(o=>{o!==""&&s.forEach(a=>{a&&(this.eventList.some(([r,p,m])=>r===a&&p===o&&m===i)||(a.addEventListener(o,i,!1),this.eventList.push([a,o,i])))})})}removeEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(o=>{s.forEach(a=>{a&&(a.removeEventListener(o,i,!1),this.eventList=this.eventList.filter(([r,p,m])=>!(r===a&&p===o&&m===i)))})})}};W(S,"VERSION","0.0.8");let k=S;typeof window!="undefined"&&(window.Daracl=window.Daracl||{},window.Daracl.dialog=k)}));
|
|
5
|
+
*/function E(o){const e=o.trim().replace(/[\u0000-\u001F\u007F\s]+/g,"");if(!e)return!1;const t=/^([a-z][a-z0-9+.-]*):/i.exec(e);return t?t[1].toLowerCase()==="data"?/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp)(?:;|,)/i.test(e):["http","https","mailto","tel"].includes(t[1].toLowerCase()):!0}const x=new Set(["script","style","iframe","frame","frameset","object","embed","applet","link","meta","base","form","input","button","textarea","select","option","svg","math","template","noscript","title"]),W=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","del","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","li","mark","ol","p","pre","s","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),X=new Set(["class","style","title","alt","href","src","target","width","height","colspan","rowspan","align","valign","dir","lang"]),Y=new Set(["href","src"]),I=/url\s*\(|expression\s*\(|javascript:|@import|behavior\s*:|-moz-binding|position\s*:\s*(?:fixed|absolute|sticky)|\\|\/\*/i;function _(o){Array.from(o.attributes).forEach(e=>{const t=e.name.toLowerCase(),i=e.value;X.has(t)&&(!Y.has(t)||E(i))&&(t!=="style"||!I.test(i))&&(t!=="target"||i==="_blank"||i==="_self")||o.removeAttribute(e.name)}),o.tagName==="A"&&o.getAttribute("target")==="_blank"&&o.setAttribute("rel","noopener noreferrer")}function D(o){Array.from(o.childNodes).forEach(e=>{var s;if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){(s=e.parentNode)==null||s.removeChild(e);return}const t=e,i=t.tagName.toLowerCase();if(x.has(i)){t.remove();return}D(t),W.has(i)?_(t):t.replaceWith(...Array.from(t.childNodes))})}function q(o){const e=document.createElement("template");e.innerHTML=o;const t=e.content;return D(t),document.importNode(t,!0)}let N=0,T=0;const H="daraclDialogHidden",M="data-daracl-theme",k={primary:"primary",secondary:"secondary",info:"info",success:"success",warning:"warning",danger:"danger"},U=["a[href]","area[href]","button:not([disabled])","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","iframe","[contenteditable=true]","[tabindex]:not([tabindex='-1'])"].join(",");let z={width:400,height:300,styleClass:"",isModal:!1,icon:"",autoOpen:!0,draggable:!0,resizable:!1,enableHeader:!0,enableFooter:!0,enableMaxButton:!0,enableCloseButton:!0,closeOnEscape:!0,autoFocus:!0,minHeight:130,minWidth:230,zIndex:1e4,dragOverflow:!0,buttons:[],moveDelay:15,afterOpen:!1};function B(){let o=document.getElementById(H);return o==null&&(o=document.createElement("div"),o.id=H,o.className="daracl-dialog-hidden",document.body.appendChild(o)),o}function C(o){return o==null||o===""?"":typeof o=="number"||/^\d+(\.\d+)?$/.test(String(o))?o+"px":String(o)}function R(o,e){typeof e=="string"&&e.split(/\s+/).filter(t=>t!=="").forEach(t=>o.classList.add(t))}function j(o){return o.key==="Enter"||o.key===" "||o.key==="Spacebar"}function S(o){const e=o.touches&&o.touches[0]?o.touches[0]:o.changedTouches&&o.changedTouches[0]?o.changedTouches[0]:o;return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}const O=class O{constructor(e){A(this,"onKeydown",e=>{if(this.options){if((e.key==="Escape"||e.key==="Esc")&&this.options.closeOnEscape!==!1&&this.options.enableCloseButton!==!1){e.stopPropagation(),this.hide();return}if(e.key==="Tab"&&this.options.isModal===!0){const t=this.getFocusableElements();if(t.length===0){e.preventDefault(),this.dialogWrapperElement.focus();return}const i=t[0],s=t[t.length-1],n=document.activeElement;e.shiftKey&&(n===i||n===this.dialogWrapperElement)?(e.preventDefault(),s.focus()):!e.shiftKey&&n===s&&(e.preventDefault(),i.focus())}}});A(this,"show",()=>{if(!this.dialogWrapperElement||!this.dialogWrapperElement.classList.contains("hide"))return this;T=Math.max(T,N)+2;const e=this.options.zIndex+T;if(this.returnFocusElement=typeof document!="undefined"?document.activeElement:null,this.dialogWrapperElement.style.zIndex=String(e),this.dialogWrapperElement.classList.remove("hide"),this.options.isModal===!0){this.removeDialogOverrayElement();const t=document.createElement("div");t.className="daracl-dialog-overlay",t.style.zIndex=String(e-1),this.themeName&&t.setAttribute(M,this.themeName);const i=B(),s=i.firstChild;s?i.insertBefore(t,s):i.appendChild(t),this.dialogOverrayElement=t}if(this.options.autoFocus!==!1){const t=this.getFocusableElements(),s=t.find(n=>n.closest(".dialog-content"))||t.find(n=>n.closest(".dialog-footer"))||this.dialogWrapperElement;try{s.focus({preventScroll:!0})}catch(n){s.focus()}}return typeof this.options.afterOpen=="function"&&this.options.afterOpen.call(this,this.dialogWrapperElement),this});A(this,"hide",()=>{if(!this.dialogWrapperElement)return this;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);return this.dialogWrapperElement.classList.add("hide"),this.options.isModal===!0&&this.removeDialogOverrayElement(),e&&this.restoreFocus(t),this});A(this,"maximise",()=>{if(!this.dialogWrapperElement)return;const e=this.dialogWrapperElement.classList;e.contains("maximise")?e.remove("maximise"):e.add("maximise")});A(this,"destroy",()=>{if(!this.dialogWrapperElement)return;const e=this.isOpen(),t=this.dialogWrapperElement.contains(document.activeElement);this.eventList.forEach(([s,n,a])=>s.removeEventListener(n,a,!1)),this.eventList=[],this.timerSet.forEach(s=>clearTimeout(s)),this.timerSet.clear(),typeof cancelAnimationFrame=="function"&&this.frameSet.forEach(s=>cancelAnimationFrame(s)),this.frameSet.clear(),this.removeDialogOverrayElement(),e&&this.restoreFocus(t);const i=this.dialogWrapperElement;i.parentNode&&i.parentNode.removeChild(i),this.dialogWrapperElement=null,this.options=null,this.idx=-1});typeof e=="string"&&(e={template:e,items:e}),this.options=Object.assign({},z,e),this.idx=N+=1,this.eventList=[],this.timerSet=new Set,this.frameSet=new Set;const t=document.createElement("div");t.className=`daracl-dialog-wrapper hide dd-${N}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),this.options.isModal===!0&&t.setAttribute("aria-modal","true");const i=t.style;i.zIndex=String(this.options.zIndex+N),i.width=C(this.options.width),i.height=C(this.options.height),i.minHeight=C(this.options.minHeight),i.minWidth=C(this.options.minWidth),B().appendChild(t),this.dialogWrapperElement=t,this.setTheme(this.options.theme),this.dialogTemplate(),this.addEvent(t,"keydown",this.onKeydown),this.options.draggable!==!1&&(t.classList.add("draggable"),this.initDrag()),this.options.resizable===!0&&(t.classList.add("resizable"),this.initResize()),this.options.autoOpen!==!1&&this.show()}static create(e){return new O(e)}static setOptions(e){z=Object.assign({},z,e)}appendHtml(e,t,i){if(t==null)return;if(typeof Node!="undefined"&&t instanceof Node){e.appendChild(t);return}const s=String(t),n=this.options.sanitize;if(typeof n=="function"){const a=n(s);typeof Node!="undefined"&&a instanceof Node?e.appendChild(a):e.insertAdjacentHTML("beforeend",a==null?"":String(a));return}if(n===!1||i&&n!==!0){e.insertAdjacentHTML("beforeend",s);return}e.appendChild(q(s))}getFocusableElements(){return this.dialogWrapperElement?Array.prototype.slice.call(this.dialogWrapperElement.querySelectorAll(U)).filter(e=>!e.closest(".resizer")):[]}setTimer(e,t){const i=setTimeout(()=>{this.timerSet.delete(i),e()},t);return this.timerSet.add(i),i}clearTimer(e){e!==void 0&&(clearTimeout(e),this.timerSet.delete(e))}createFrameUpdater(e){let t=null,i=0,s;const n=()=>{i&&(cancelAnimationFrame(i),this.frameSet.delete(i),i=0),this.clearTimer(s),s=void 0},a=()=>{n();const r=t;t=null,r&&this.dialogWrapperElement&&e(r)};return{request:r=>{if(t=r,!(i||s!==void 0))if(typeof requestAnimationFrame=="function"){const u=requestAnimationFrame(()=>{this.frameSet.delete(u),i=0,a()});i=u,this.frameSet.add(u)}else s=this.setTimer(()=>{s=void 0,a()},Math.max(this.options.moveDelay||0,0))},flush:a}}initResize(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelectorAll(".resizer");let i,s,n,a,r="",u=-1,f=-1,b,v;this.addEvent(t,"mousedown touchstart",p=>{if(this.isMaximise())return!1;r=p.currentTarget.getAttribute("data-mode")||"",b=r.indexOf("t")>-1,v=r.indexOf("l")>-1,u=v?e.getBoundingClientRect().left:-1,f=b?e.getBoundingClientRect().top:-1,p.preventDefault();const m=S(p);if(n=m.pageX,a=m.pageY,i=e.clientWidth,s=e.clientHeight,!e.classList.contains("transform-disable")){const l=e.getBoundingClientRect();this.setPosition(m,m.clientX-l.left,m.clientY-l.top,i,s),e.classList.add("transform-disable")}this.addEvent(document,"mousemove touchmove",w),this.addEvent(document,"mouseup touchend touchcancel",L)});const g=this.createFrameUpdater(p=>{let m=p.pageX-n,l=p.pageY-a;l=b?l*-1:l,m=v?m*-1:m;let c=s+l,d=i+m;this.options.minHeight>=c&&(c=this.options.minHeight,l=(s-c)*-1),this.options.minWidth>=d&&(d=this.options.minWidth,m=(i-d)*-1);let h=-1;b&&(h=f-l,h<=0&&(h=0,c=s+f),e.style.top=h+"px");let y=-1;v&&(y=u-m,y<=0&&(y=0,d=i+u),e.style.left=y+"px"),r!="b"&&r!="t"&&(e.style.width=d+"px"),r!="r"&&r!="l"&&(e.style.height=c+"px")}),w=p=>{g.request(S(p))},L=()=>{g.flush(),this.removeEvent(document,"mousemove touchmove",w),this.removeEvent(document,"mouseup touchend touchcancel",L)}}initDrag(){const e=this.dialogWrapperElement,t=this.dialogWrapperElement.querySelector(".dialog-header");if(!t)return;let i=!1,s,n,a,r,u=!1;this.addEvent(t,"mousedown touchstart",g=>{const w=g.target;if((w.tagName||"").search(/(input|textarea|select|button)/gi)>-1||w.closest&&w.closest(".btn-area"))return!0;if(this.isMaximise())return!1;g.preventDefault();const p=S(g),m=e.getBoundingClientRect();a=e.clientWidth,r=e.clientHeight,i=!0,s=p.clientX-m.left,n=p.clientY-m.top,u||(this.setPosition(p,s,n,a,r),u=!0,e.classList.add("transform-disable")),e.classList.add("move-on"),this.addEvent(document,"mousemove touchmove",b),this.addEvent(document,"mouseup touchend touchcancel",v)});const f=this.createFrameUpdater(g=>{this.setPosition(g,s,n,a,r)}),b=g=>{i&&f.request(S(g))},v=()=>{f.flush(),i=!1,e.classList.remove("move-on"),this.removeEvent(document,"mousemove touchmove",b),this.removeEvent(document,"mouseup touchend touchcancel",v)}}setPosition(e,t,i,s,n){let a,r;this.options.dragOverflow===!1?(a=Math.min(Math.max(e.clientX-t,0),window.innerWidth-s),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-n)):(a=Math.min(Math.max(e.clientX-t,(s-80)*-1),window.innerWidth-80),r=Math.min(Math.max(e.clientY-i,0),window.innerHeight-30)),this.dialogWrapperElement.style.left=a+"px",this.dialogWrapperElement.style.top=r+"px"}bindButton(e,t,i){e.setAttribute("role","button"),e.setAttribute("tabindex","0"),this.addEvent(e,t,i),this.addEvent(e,"keydown",s=>{j(s)&&(s.preventDefault(),i(s))})}dialogTemplate(){var v,g,w,L,p,m;const e=this.options,t=e.enableHeader!==!1,i=e.enableFooter!==!1,s=document.createElement("div");if(s.className="daracl-dialog",R(s,(v=e.styleClass)!=null?v:""),t){const l=document.createElement("div");l.className="dialog-header",this.appendHtml(l,(g=e.title)!=null?g:"",!1);const c=(l.textContent||"").trim();c!==""&&this.dialogWrapperElement.setAttribute("aria-label",c);const d=document.createElement("div");if(d.className="btn-area",e.enableMaxButton){const h=document.createElement("span");h.className="dialog-maximise",h.setAttribute("aria-label","Maximize"),h.setAttribute("title","Maximize"),d.appendChild(h)}if(e.enableCloseButton){const h=document.createElement("span");h.className="dialog-close",h.setAttribute("aria-label","Close"),h.setAttribute("title","Close"),d.appendChild(h)}l.appendChild(d),s.appendChild(l)}const n=document.createElement("div");n.className="dialog-body",Object.prototype.hasOwnProperty.call(k,e.icon)&&n.classList.add(k[e.icon]),n.style.height=`calc(100%${t?" - 40px":""}${i?" - 45px":""})`;const a=document.createElement("div");a.className="dialog-move-overay",n.appendChild(a);const r=document.createElement("div");if(r.className="dialog-content",n.appendChild(r),e.url){const l=String(e.url);if(E(l)){const c=document.createElement("iframe");c.className="dialog-frame",c.src=l,typeof e.title=="string"&&(c.title=(this.dialogWrapperElement.getAttribute("aria-label")||"").slice(0,200)),r.appendChild(c)}else console.warn("[daracl.dialog] unsafe url blocked : "+l.slice(0,100))}else typeof e.template=="function"?this.appendHtml(r,e.template(),!0):this.appendHtml(r,e.template,!0);s.appendChild(n);const u=(w=e.buttons)!=null?w:[];if(i){const l=document.createElement("div");l.className="dialog-footer";const c=document.createElement("div");c.className="btn-area";for(let d=0;d<u.length;d++){const h=(L=u[d])!=null?L:{},y=document.createElement("span");y.className=`dialog-btn dialog-btn-${d}`,R(y,(p=h.styleClass)!=null?p:"success"),this.appendHtml(y,(m=h.label)!=null?m:"",!1),this.bindButton(y,"mousedown",P=>{typeof h.callback=="function"&&h.callback(P)}),c.appendChild(y)}l.appendChild(c),s.appendChild(l)}e.resizable===!0&&[["top","t"],["left","l"],["right","r"],["bottom","b"],["top-left","tl"],["top-right","tr"],["bottom-left","bl"],["bottom-right","br"]].forEach(([l,c])=>{const d=document.createElement("div");d.className=`resizer ${l}`,d.setAttribute("data-mode",c),s.appendChild(d)}),this.dialogWrapperElement.appendChild(s);const f=s.querySelector(".dialog-header .dialog-maximise");f&&this.bindButton(f,"click",()=>{this.maximise()});const b=s.querySelector(".dialog-header .dialog-close");b&&this.bindButton(b,"click",()=>{this.hide()})}setTheme(e){return this.dialogWrapperElement?(this.themeName=e?String(e):"",[this.dialogWrapperElement,this.dialogOverrayElement].forEach(t=>{t&&(this.themeName?t.setAttribute(M,this.themeName):t.removeAttribute(M))}),this):this}isOpen(){return!!this.dialogWrapperElement&&!this.dialogWrapperElement.classList.contains("hide")}restoreFocus(e){const t=this.returnFocusElement;this.returnFocusElement=null,!(!this.options||this.options.autoFocus===!1||!e)&&t&&typeof t.focus=="function"&&document.body.contains(t)&&t.focus()}removeDialogOverrayElement(){const e=this.dialogOverrayElement;this.dialogOverrayElement=void 0,e&&e.parentNode&&e.parentNode.removeChild(e)}isMaximise(){return!!this.dialogWrapperElement&&this.dialogWrapperElement.classList.contains("maximise")}addEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(n=>{n!==""&&s.forEach(a=>{a&&(this.eventList.some(([r,u,f])=>r===a&&u===n&&f===i)||(a.addEventListener(n,i,!1),this.eventList.push([a,n,i])))})})}removeEvent(e,t,i){const s=e instanceof NodeList||Array.isArray(e)?Array.prototype.slice.call(e):[e];t.split(" ").forEach(n=>{s.forEach(a=>{a&&(a.removeEventListener(n,i,!1),this.eventList=this.eventList.filter(([r,u,f])=>!(r===a&&u===n&&f===i)))})})}};A(O,"VERSION","0.0.9");let F=O;typeof window!="undefined"&&(window.Daracl=window.Daracl||{},window.Daracl.dialog=F)}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
7
|
/*!
|
|
8
|
-
* @daracl/dialog v0.0.
|
|
8
|
+
* @daracl/dialog v0.0.9
|
|
9
9
|
* Copyright 2024-2026 darainfo and other contributors;
|
|
10
10
|
* Licensed MIT
|
|
11
11
|
*/
|
|
@@ -360,6 +360,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
360
360
|
this.eventList = [];
|
|
361
361
|
this.timerSet.forEach((timer) => clearTimeout(timer));
|
|
362
362
|
this.timerSet.clear();
|
|
363
|
+
if (typeof cancelAnimationFrame === "function") {
|
|
364
|
+
this.frameSet.forEach((frame) => cancelAnimationFrame(frame));
|
|
365
|
+
}
|
|
366
|
+
this.frameSet.clear();
|
|
363
367
|
this.removeDialogOverrayElement();
|
|
364
368
|
if (wasOpen) {
|
|
365
369
|
this.restoreFocus(hadFocus);
|
|
@@ -380,6 +384,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
380
384
|
this.idx = DIALOG_IDX += 1;
|
|
381
385
|
this.eventList = [];
|
|
382
386
|
this.timerSet = /* @__PURE__ */ new Set();
|
|
387
|
+
this.frameSet = /* @__PURE__ */ new Set();
|
|
383
388
|
const dialogWrapperElement = document.createElement("div");
|
|
384
389
|
dialogWrapperElement.className = `daracl-dialog-wrapper hide dd-${DIALOG_IDX}`;
|
|
385
390
|
dialogWrapperElement.setAttribute("role", "dialog");
|
|
@@ -399,6 +404,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
399
404
|
this.dialogTemplate();
|
|
400
405
|
this.addEvent(dialogWrapperElement, "keydown", this.onKeydown);
|
|
401
406
|
if (this.options.draggable !== false) {
|
|
407
|
+
dialogWrapperElement.classList.add("draggable");
|
|
402
408
|
this.initDrag();
|
|
403
409
|
}
|
|
404
410
|
if (this.options.resizable === true) {
|
|
@@ -483,6 +489,56 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
483
489
|
clearTimeout(timer);
|
|
484
490
|
this.timerSet.delete(timer);
|
|
485
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
* 마우스 / 터치 이동을 화면 갱신 주기(requestAnimationFrame)마다 한 번만 반영한다.
|
|
494
|
+
* 한 프레임 안의 여러 move 이벤트는 마지막 좌표만 쓰고, flush 는 남은 좌표를 바로 반영한다 (놓을 때 마지막 이동 유지).
|
|
495
|
+
* requestAnimationFrame 이 없는 환경에서는 moveDelay(ms) 타이머로 대신한다.
|
|
496
|
+
* @param {(point: {clientX: number, clientY: number, pageX: number, pageY: number}) => void} apply
|
|
497
|
+
*/
|
|
498
|
+
createFrameUpdater(apply) {
|
|
499
|
+
let pending = null;
|
|
500
|
+
let frame = 0;
|
|
501
|
+
let timer;
|
|
502
|
+
const cancel = () => {
|
|
503
|
+
if (frame) {
|
|
504
|
+
cancelAnimationFrame(frame);
|
|
505
|
+
this.frameSet.delete(frame);
|
|
506
|
+
frame = 0;
|
|
507
|
+
}
|
|
508
|
+
this.clearTimer(timer);
|
|
509
|
+
timer = void 0;
|
|
510
|
+
};
|
|
511
|
+
const run = () => {
|
|
512
|
+
cancel();
|
|
513
|
+
const point = pending;
|
|
514
|
+
pending = null;
|
|
515
|
+
if (point && this.dialogWrapperElement) {
|
|
516
|
+
apply(point);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
return {
|
|
520
|
+
/** @param {{clientX: number, clientY: number, pageX: number, pageY: number}} point */
|
|
521
|
+
request: (point) => {
|
|
522
|
+
pending = point;
|
|
523
|
+
if (frame || timer !== void 0) return;
|
|
524
|
+
if (typeof requestAnimationFrame === "function") {
|
|
525
|
+
const id = requestAnimationFrame(() => {
|
|
526
|
+
this.frameSet.delete(id);
|
|
527
|
+
frame = 0;
|
|
528
|
+
run();
|
|
529
|
+
});
|
|
530
|
+
frame = id;
|
|
531
|
+
this.frameSet.add(id);
|
|
532
|
+
} else {
|
|
533
|
+
timer = this.setTimer(() => {
|
|
534
|
+
timer = void 0;
|
|
535
|
+
run();
|
|
536
|
+
}, Math.max(this.options.moveDelay || 0, 0));
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
flush: run
|
|
540
|
+
};
|
|
541
|
+
}
|
|
486
542
|
/** 사이즈 조절 초기화 */
|
|
487
543
|
initResize() {
|
|
488
544
|
const dialogElement = this.dialogWrapperElement;
|
|
@@ -516,61 +572,49 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
516
572
|
this.addEvent(document, "mousemove touchmove", onResizeMouseMove);
|
|
517
573
|
this.addEvent(document, "mouseup touchend touchcancel", onResizeMouseUp);
|
|
518
574
|
});
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
575
|
+
const resizeFrame = this.createFrameUpdater((point) => {
|
|
576
|
+
let moveX = point.pageX - startX, moveY = point.pageY - startY;
|
|
577
|
+
moveY = isResizeTop ? moveY * -1 : moveY;
|
|
578
|
+
moveX = isResizeLeft ? moveX * -1 : moveX;
|
|
579
|
+
let resizeHeight = dialogHeight + moveY, resizeWidth = dialogWidth + moveX;
|
|
580
|
+
if (this.options.minHeight >= resizeHeight) {
|
|
581
|
+
resizeHeight = this.options.minHeight;
|
|
582
|
+
moveY = (dialogHeight - resizeHeight) * -1;
|
|
525
583
|
}
|
|
526
|
-
if (
|
|
527
|
-
this.
|
|
584
|
+
if (this.options.minWidth >= resizeWidth) {
|
|
585
|
+
resizeWidth = this.options.minWidth;
|
|
586
|
+
moveX = (dialogWidth - resizeWidth) * -1;
|
|
528
587
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
if (
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
moveX = isResizeLeft ? moveX * -1 : moveX;
|
|
536
|
-
let resizeHeight = dialogHeight + moveY, resizeWidth = dialogWidth + moveX;
|
|
537
|
-
if (this.options.minHeight >= resizeHeight) {
|
|
538
|
-
resizeHeight = this.options.minHeight;
|
|
539
|
-
moveY = (dialogHeight - resizeHeight) * -1;
|
|
540
|
-
}
|
|
541
|
-
if (this.options.minWidth >= resizeWidth) {
|
|
542
|
-
resizeWidth = this.options.minWidth;
|
|
543
|
-
moveX = (dialogWidth - resizeWidth) * -1;
|
|
588
|
+
let topVal = -1;
|
|
589
|
+
if (isResizeTop) {
|
|
590
|
+
topVal = offsetY - moveY;
|
|
591
|
+
if (topVal <= 0) {
|
|
592
|
+
topVal = 0;
|
|
593
|
+
resizeHeight = dialogHeight + offsetY;
|
|
544
594
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
let leftVal = -1;
|
|
555
|
-
if (isResizeLeft) {
|
|
556
|
-
leftVal = offsetX - moveX;
|
|
557
|
-
if (leftVal <= 0) {
|
|
558
|
-
leftVal = 0;
|
|
559
|
-
resizeWidth = dialogWidth + offsetX;
|
|
560
|
-
}
|
|
561
|
-
dialogElement.style.left = leftVal + "px";
|
|
562
|
-
}
|
|
563
|
-
if (moveMode != "b" && moveMode != "t") {
|
|
564
|
-
dialogElement.style.width = resizeWidth + "px";
|
|
565
|
-
}
|
|
566
|
-
if (moveMode != "r" && moveMode != "l") {
|
|
567
|
-
dialogElement.style.height = resizeHeight + "px";
|
|
595
|
+
dialogElement.style.top = topVal + "px";
|
|
596
|
+
}
|
|
597
|
+
let leftVal = -1;
|
|
598
|
+
if (isResizeLeft) {
|
|
599
|
+
leftVal = offsetX - moveX;
|
|
600
|
+
if (leftVal <= 0) {
|
|
601
|
+
leftVal = 0;
|
|
602
|
+
resizeWidth = dialogWidth + offsetX;
|
|
568
603
|
}
|
|
569
|
-
|
|
604
|
+
dialogElement.style.left = leftVal + "px";
|
|
605
|
+
}
|
|
606
|
+
if (moveMode != "b" && moveMode != "t") {
|
|
607
|
+
dialogElement.style.width = resizeWidth + "px";
|
|
608
|
+
}
|
|
609
|
+
if (moveMode != "r" && moveMode != "l") {
|
|
610
|
+
dialogElement.style.height = resizeHeight + "px";
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
const onResizeMouseMove = (e) => {
|
|
614
|
+
resizeFrame.request(eventPoint(e));
|
|
570
615
|
};
|
|
571
616
|
const onResizeMouseUp = () => {
|
|
572
|
-
|
|
573
|
-
startTime = -1;
|
|
617
|
+
resizeFrame.flush();
|
|
574
618
|
this.removeEvent(document, "mousemove touchmove", onResizeMouseMove);
|
|
575
619
|
this.removeEvent(document, "mouseup touchend touchcancel", onResizeMouseUp);
|
|
576
620
|
};
|
|
@@ -617,29 +661,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
617
661
|
this.addEvent(document, "mousemove touchmove", onMouseMove);
|
|
618
662
|
this.addEvent(document, "mouseup touchend touchcancel", onMouseUp);
|
|
619
663
|
});
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
664
|
+
const dragFrame = this.createFrameUpdater((point) => {
|
|
665
|
+
this.setPosition(point, offsetX, offsetY, dialogWidth, dialogHeight);
|
|
666
|
+
});
|
|
623
667
|
const onMouseMove = (e) => {
|
|
624
668
|
if (isDragging) {
|
|
625
|
-
|
|
626
|
-
startTime = (/* @__PURE__ */ new Date()).getTime();
|
|
627
|
-
}
|
|
628
|
-
if ((/* @__PURE__ */ new Date()).getTime() - moveDelay <= startTime) {
|
|
629
|
-
this.clearTimer(moveTimer);
|
|
630
|
-
}
|
|
631
|
-
const point = eventPoint(e);
|
|
632
|
-
moveTimer = this.setTimer(() => {
|
|
633
|
-
startTime = -1;
|
|
634
|
-
if (!this.dialogWrapperElement) return;
|
|
635
|
-
this.setPosition(point, offsetX, offsetY, dialogWidth, dialogHeight);
|
|
636
|
-
}, moveDelay);
|
|
669
|
+
dragFrame.request(eventPoint(e));
|
|
637
670
|
}
|
|
638
671
|
};
|
|
639
672
|
const onMouseUp = () => {
|
|
673
|
+
dragFrame.flush();
|
|
640
674
|
isDragging = false;
|
|
641
|
-
startTime = -1;
|
|
642
|
-
this.clearTimer(moveTimer);
|
|
643
675
|
dialogElement.classList.remove("move-on");
|
|
644
676
|
this.removeEvent(document, "mousemove touchmove", onMouseMove);
|
|
645
677
|
this.removeEvent(document, "mouseup touchend touchcancel", onMouseUp);
|
|
@@ -894,7 +926,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
894
926
|
});
|
|
895
927
|
}
|
|
896
928
|
};
|
|
897
|
-
__publicField(_Dialog, "VERSION", "0.0.
|
|
929
|
+
__publicField(_Dialog, "VERSION", "0.0.9");
|
|
898
930
|
let Dialog = _Dialog;
|
|
899
931
|
if (typeof window !== "undefined") {
|
|
900
932
|
window.Daracl = window.Daracl || {};
|