eservices-core 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eservices-core.cjs.js +11 -0
- package/dist/eservices-core.es.js +4258 -0
- package/dist/eservices-core.umd.js +11 -0
- package/package.json +8 -7
- package/svg-folder/dist/icons.css +21 -0
- package/svg-folder/dist/icons.eot +0 -0
- package/svg-folder/dist/icons.woff +0 -0
- package/svg-folder/dist/icons.woff2 +0 -0
|
@@ -0,0 +1,4258 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('[dir=rtl] .icon[data-v-6412ede6]{transform:scaleX(-1)}.input-text-container[data-v-65e2ee2d]{position:relative;height:var(--input-height);width:100%;background-color:var(--input-background-color);border:var(--input-border);border-radius:var(--input-border-radius)}.input-text-container[data-v-65e2ee2d]:focus-within{outline:var(--input-border-active)}.input-text__error[data-v-65e2ee2d]{position:absolute;margin:0;top:100%}.input-text[data-v-65e2ee2d]{width:100%;height:100%;padding:0 10px;background-color:transparent;border:0;color:var(--input-color);font-size:var(--input-font-size);outline:none}.input-text[data-v-65e2ee2d]::placeholder{color:var(--input-placeholder-color)}.input-text-container[disabled=true][data-v-65e2ee2d]{background-color:var(--input-background-color-disabled);border:var(--input-border-disabled)}.input-text-container[error=true][data-v-65e2ee2d]{border:var(--input-border-error)}.input-text__password[data-v-65e2ee2d]{padding:0 6px;display:flex;align-items:center}.input-title[data-v-65e2ee2d]{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.input-title_required[data-v-65e2ee2d],.input-text__error[data-v-65e2ee2d]{color:red}.input__toggle[data-v-56d58611]{position:relative;width:40px;height:20px;background-color:var(--input-toggle-background-color);border-radius:var(--input-toggle-border-radius);cursor:pointer;transition:var(--fast);border:var(--input-toggle-border)}.input__toggle[data-v-56d58611]:before{content:"";position:absolute;top:0;bottom:0;margin:auto;left:3px;height:14px;width:14px;border-radius:var(--input-toggle-round-radius);background-color:var(--input-toggle-round-background-color);transition:var(--transition-fast)}.input__toggle.active[data-v-56d58611]{background-color:var(--input-toggle-background-color-active)}.input__toggle.active[data-v-56d58611]:before{transform:translate(20px)}.input__toggle.disabled[data-v-56d58611]{background-color:var(--input-disabled-background-color);border:var(--input-disabled-border)}.input__toggle.disabled[data-v-56d58611]:before{background-color:var(--gray-1)}.input__toggle.disabled[data-v-56d58611]{cursor:auto}.item-wrap[data-v-69ab8592]{display:flex;align-items:center}.input-select__item[data-v-69ab8592]{margin:0;text-overflow:ellipsis;overflow:hidden;color:var(--text-black);transition:var(--fast);font-size:14px;line-height:19px;font-weight:400}.input-select__item.active[data-v-69ab8592]{background-color:var(--main);color:var(--text-white)}.input-select-container[data-v-c4acd469]{position:relative;width:100%;outline:none}.input-select-container.disabled>.input-select-container__current[data-v-c4acd469]{background-color:var(--input-background-color-disabled)}.input-select-container__list[data-v-c4acd469]{display:none;position:absolute;top:calc(100% - 5px);z-index:100;padding-top:4px;border:1px solid var(--gray-1);border-top:0;max-height:250px;width:100%;overflow:auto}.input-select-container.active .input-select-container__list[data-v-c4acd469]{display:block}.input-select-container.active>.input-select-container__current>img[data-v-c4acd469]{transform:rotate(-180deg)}.input-select-container__current[data-v-c4acd469]{display:flex;justify-content:space-between;align-items:center;padding:0 10px 0 0;border:var(--input-border);width:100%;border-radius:var(--input-border-radius);cursor:pointer;background-color:var(--input-background-color)}.current-placeholder[data-v-c4acd469]{padding:0 10px;color:var(--input-placeholder-color)}.input-select__ico-toggle[data-v-c4acd469]{fill:var(--main)}.input-select-container.error>.input-select-container__current[data-v-c4acd469]{border:1px solid var(--error)}.input-select-container.active>.input-select-container__current[data-v-c4acd469]{outline:var(--input-border-active)}.input-select-value[data-v-c4acd469]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:0 16px;color:var(--input-color)}.container-input-file[data-v-bdbf1475]{height:var(--input-height);border:var(--input-border);background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:5px;display:flex;align-items:center;position:relative}.icon__file-upload[data-v-bdbf1475]{font-size:12px;color:var(--input-color)}.input-file[data-v-bdbf1475]{position:absolute;left:0;top:0;z-index:500;width:100%;height:100%;opacity:0;cursor:pointer}.input-file[data-v-bdbf1475]::-webkit-file-upload-button{visibility:hidden}.process-info[data-v-bdbf1475]{margin:4px 0}.widget-input__container[data-v-1e3f1057]{position:relative;outline:none}.widget-input__underline[data-v-1e3f1057]{height:2px;background-color:var(--input-line-color)}.widget-input__placeholder[data-v-1e3f1057]{margin:2px 0 0;color:var(--input-line-placeholder-color);font-size:var(--input-line-placeholder-font-size);line-height:var(--input-line-placeholder-line-height);-webkit-user-select:none;user-select:none}.widget-input__placeholder_error[data-v-1e3f1057]{color:var(--error)}.input-container__content[data-v-1e3f1057]{width:100%;display:flex}.input-text[data-v-212b50e2]{height:31px;width:100%;border:unset;outline:unset;background-color:transparent;color:var(--input-line-color);font-size:var(--input-line-font-size)}.input-text__password[data-v-212b50e2]{padding:0 6px;display:flex;align-items:center}.input-title[data-v-9c3e5ea6]{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.input-text-container[data-v-9c3e5ea6]{position:relative;height:32px;width:100%;background-color:var(--input-background-color);border:var(--input-border);border-radius:var(--input-border-radius)}.input-text-container[data-v-9c3e5ea6]:focus-within{border:var(--input-border-active)!important}.input-text__error[data-v-9c3e5ea6]{position:absolute;margin:0;top:100%;text-align:right}.input-text[data-v-9c3e5ea6]{width:100%;height:100%;padding:0 10px;background-color:transparent;border:0;color:var(--input-color);font-size:var(--input-font-size)}.input-text[data-v-9c3e5ea6]::placeholder{color:var(--input-placeholder-color)}.input-text-container[disabled=true][data-v-9c3e5ea6]{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.input-text-container[error=true][data-v-9c3e5ea6]{border:var(--input-border-error)}.input-text__password[data-v-9c3e5ea6]{padding:0 6px;display:flex;align-items:center}.input-text[data-v-9c3e5ea6]:focus{border:0;outline:0}.widget-button-wrap[data-v-b6be5c12]{width:fit-content;outline:none;-webkit-user-select:none;user-select:none;position:relative;--size: 30px;max-height:var(--size);height:var(--size)}.widget-button[data-v-b6be5c12]{background-color:var(--widget-button-background);color:var(--widget-button-color);border:var(--widget-button-border);border-radius:var(--widget-button-radius);height:fit-content;overflow:hidden}.widget-button__toggle[data-v-b6be5c12]{height:var(--size);width:var(--size)}.widget-button__toggle[data-v-b6be5c12]:hover{background-color:var(--widget-button-background-hover)}.widget-button__list[data-v-b6be5c12]{overflow:hidden;max-height:var(--size);transition:var(--fast);height:fit-content}.widget-button .widget-button__toggle-icon[data-v-b6be5c12]{transition:var(--fast)}.widget-button.active .widget-button__toggle-icon[data-v-b6be5c12]{transform:rotate(-180deg)}.widget-button__list-elem[data-v-b6be5c12]{line-height:var(--size);font-size:14px;padding:0 10px;transition:var(--extra-fast);min-width:80px}.widget-button__list-elem[data-v-b6be5c12]:hover{background-color:var(--widget-button-background-hover)}.function-item[data-v-73f7eb9f]{padding:10px}.form-title[data-v-c91ffa31]{flex-grow:1}.widget-form[data-v-c3e88e10]{width:100%;max-width:966px;overflow:hidden;border:var(--form-border);background-color:var(--form-background-color);box-shadow:var(--form-shadow);border-radius:var(--form-radius);border-bottom:5px solid var(--form-border-bottom)}.widget-form__head[data-v-c3e88e10]{min-height:60px;align-items:center;background-color:var(--form-head-background-color)}@media screen and (min-width: 769px){.widget-form__head[data-v-c3e88e10]{flex-wrap:nowrap;padding:0 20px 0 40px}.widget-form__head-button[data-v-c3e88e10]{margin-right:15px}}@media screen and (max-width: 768px){.widget-form[data-v-c3e88e10]{width:100%}.widget-form__head[data-v-c3e88e10]{flex-wrap:wrap}}.widget-form__head-functions[data-v-c3e88e10]{height:100%;align-items:center}.widget-form__body[data-v-c3e88e10]{overflow:auto}.form-container-item[data-v-9264f6f4]{flex-wrap:wrap;gap:10px}.form-container-item-center[data-v-9264f6f4]{flex-grow:1;max-width:240px}.form-container-item__title[data-v-9264f6f4]{min-width:180px;max-width:180px;min-height:30px;justify-content:flex-end}.form-container-item__title>span[data-v-9264f6f4]{display:flex;align-items:center;font-size:14px;height:30px;line-height:130%}.form-container-item-1 .form-container-item-center[data-v-9264f6f4]{max-width:unset}.form-container-item__right[data-v-9264f6f4]{flex-grow:1;max-width:240px}.content_double[data-v-9264f6f4]{max-width:480px}.container-auth-wrap[data-v-0b1a5e81]{display:flex;align-items:center;justify-content:center;background-color:var(--container-auth-background-color);border-radius:var(--container-auth-border-radius);box-shadow:var(--container-auth-box-shadow);overflow:hidden;max-width:900px}.container-auth-wrap[data-v-0b1a5e81]{display:flex;width:100%;height:100%}.container-auth-sidebar[data-v-0b1a5e81]{width:300px;background-color:var(--container-auth-sidebar-background-color)}.container-auth-main[data-v-0b1a5e81]{display:flex;flex-direction:column;flex-grow:1;position:relative}@media screen and (min-width: 768px){.container-auth-wrap[data-v-0b1a5e81]{height:500px}.container-auth-wrap>div[data-v-0b1a5e81]{height:100%}.container-auth-sidebar[data-v-0b1a5e81]{height:100%}}@media screen and (max-width: 768px){.container-auth-wrap[data-v-0b1a5e81]{flex-direction:column}.container-auth-sidebar[data-v-0b1a5e81]{height:220px}}.loader[data-v-12ff0501],.loader[data-v-12ff0501]:after{border-radius:50%;width:14px;height:14px}.loader[data-v-12ff0501]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8-12ff0501 1.1s infinite linear;animation:load8-12ff0501 1.1s infinite linear}@-webkit-keyframes load8-12ff0501{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8-12ff0501{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.button-wrap[data-v-937d2e62]{position:relative}.button-spinner[data-v-937d2e62]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.button-element[data-v-937d2e62]{height:100%;width:100%;padding:0 20px;cursor:pointer;background-color:transparent;outline:unset;border:unset;color:unset;font-weight:unset;font-size:unset}.widget-button-wrap[data-v-13176c56]{--button-size: 40px;max-height:var(--button-size);z-index:1;position:relative;cursor:pointer;width:fit-content}.widget-multi-button[data-v-13176c56]{display:flex;background-color:#3949ab;border-radius:20px;overflow:hidden}.button__content[data-v-13176c56]{max-height:40px;min-width:80px;transition:.2s;overflow:hidden}.button__content_active[data-v-13176c56]{max-height:200px}.button__content-title[data-v-13176c56]{white-space:nowrap;font-size:14px;line-height:20px;padding:10px 10px 10px 20px;color:#fff;margin:0;transition:background-color .2s}.button__content-title[data-v-13176c56]:hover{background-color:#223296}.button__toggle_active[data-v-13176c56]{transform:rotate(180deg)}.button__side[data-v-13176c56]{min-width:var(--button-size)}.button__size-toggle[data-v-13176c56]{height:var(--button-size)}.button__size-toggle[data-v-13176c56]{cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .1s,background-color .2s;color:#fff}.button__size-toggle[data-v-13176c56]:hover{background-color:#223296}.button__toggle-icon[data-v-13176c56]{height:16px}.button__size-progress[data-v-13176c56]{display:flex;align-items:center;justify-content:center;height:var(--button-size)}.widget-error[data-v-8a0a0924]{height:38px;background-color:#ffb694;box-shadow:4px 4px 10px #ff500033}.widget-error-text[data-v-8a0a0924]{margin:0}.widget-error-wrap[data-v-8a0a0924]{height:100%;display:flex;align-items:center;justify-content:center}.widget-error-close[data-v-8a0a0924]{display:flex;align-items:center;justify-content:center;height:100%;width:40px;cursor:pointer}.widget-error-close[data-v-8a0a0924]:after,.widget-error-close[data-v-8a0a0924]:before{position:absolute;content:"";height:20px;width:2px;background-color:#000;border-radius:2px}.widget-error-close[data-v-8a0a0924]:after{transform:rotate(45deg)}.widget-error-close[data-v-8a0a0924]:before{transform:rotate(-45deg)}.widget-error-message[data-v-8a0a0924]{font-size:14px;line-height:130%;letter-spacing:.05em;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.widget-error-main[data-v-8a0a0924]{width:700px}.widget-error__container-close[data-v-8a0a0924]{height:100%}.article-details[data-v-8a0a0924]{font-size:18px;line-height:130%;letter-spacing:.05em;text-decoration-line:underline;font-weight:700;cursor:pointer}.fade-enter-active[data-v-aa732044],.fade-leave-active[data-v-aa732044]{transition:.5s ease;max-height:38px}.fade-enter-from[data-v-aa732044],.fade-leave-to[data-v-aa732044]{opacity:0;max-height:0}.container-errors[data-v-8e9870dd]{display:flex;gap:1px;flex-direction:column;position:fixed;top:0;left:0;width:100%;z-index:11}.fade-enter-active[data-v-8e9870dd],.fade-leave-active[data-v-8e9870dd]{transition:.5s ease;max-height:38px}.fade-enter-from[data-v-8e9870dd],.fade-leave-to[data-v-8e9870dd]{opacity:0;max-height:0}.modal__wait[data-v-430b5c94]{padding:40px 30px;max-width:450px}*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.grid{display:grid}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_20{gap:20px}.margin-0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15,.padding_20{padding:15px}.es-list-container{overflow:auto}.widget-table__head[data-v-2ce532f4]{text-align:left}.widget-table__head-cell[data-v-2ce532f4]{padding:18px}.widget-table__head-title[data-v-2ce532f4]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:600;font-size:14px;line-height:19px;margin:0}.widget-loader[data-v-a01a837d]{display:grid;grid-template-columns:max-content max-content;padding:4px;gap:10px;align-items:center}.widget-table-loader{padding:10px 0}.breadcrumb[data-v-1702aee0]{gap:8px;align-items:center;color:#828282;cursor:pointer}.breadcrumb__title[data-v-1702aee0]{font-weight:400;font-size:12px;line-height:16px;margin:0}.breadcrumb__icon[data-v-1702aee0]{height:16px}.breadcrumb_active[data-v-1702aee0],.breadcrumb[data-v-1702aee0]:hover{color:#4f4f4f}.widget-breadcrumbs[data-v-1dfb2668]{display:flex;gap:14px}tr[data-v-47478206]{border:1px solid #F3F4FC;height:30px}th[data-v-47478206],td[data-v-47478206]{position:relative;padding:0 11px}th[data-v-47478206]{text-align:left}p[data-v-47478206]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.head-cell[data-v-7106cb6a]{padding:0 15px;display:flex}.head-cell[data-v-7106cb6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-7106cb6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-7106cb6a]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-7106cb6a]{transform:rotate(180deg)}.head-cell-resize[data-v-7106cb6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-7106cb6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-7106cb6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-1a4b03e9]{position:sticky;top:-1px;z-index:1}.test-block[data-v-1a4b03e9]{background-color:#e7f2ff;inset-block-start:-1px;position:absolute;z-index:2;-webkit-user-select:none;user-select:none;white-space:nowrap;padding:0 10px;height:calc(100% + 1px);display:none;place-content:center}.widget-list-head th[data-v-1a4b03e9]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.head-cell[data-v-1a4b03e9]{display:flex;cursor:pointer;padding:0 10px}.head-cell-label[data-v-1a4b03e9]{flex-grow:1;margin:0;white-space:nowrap;-webkit-user-select:none;user-select:none}.list-arrow[data-v-1a4b03e9]{position:relative;display:block;height:15px;width:2px;background-color:gray;border-radius:2px}.list-arrow[data-v-1a4b03e9]:after,.list-arrow[data-v-1a4b03e9]:before{position:absolute;display:block;content:"";background-color:gray;height:8px;width:2px;border-radius:2px}.list-arrow[data-v-1a4b03e9]:after{transform:rotate(-30deg);right:-2px}.list-arrow[data-v-1a4b03e9]:before{transform:rotate(30deg);left:-2px}.block-list-arrow[data-v-1a4b03e9]{transition:.1s}.down[data-v-1a4b03e9]{transform:rotate(180deg)}.head-cell-order[data-v-1a4b03e9]{display:grid;place-content:center}.widget-list-head-label[data-v-1a4b03e9]{font-weight:400;font-size:13px;line-height:16px;padding:5px 0}.head-cell-resize[data-v-1a4b03e9]{position:relative;padding:3px 10px;cursor:col-resize}.head-cell-resize[data-v-1a4b03e9]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:gray}.widget-list-body[data-v-5526b1ce]{position:relative}.widget-list-body[data-v-5526b1ce]:after{content:"";background-color:transparent;z-index:-1;transition:.1s}.widget-list-body_inactive[data-v-5526b1ce]:after{z-index:0;position:absolute;top:0;background-color:#afafaf80;height:100%;width:100%}.widget-section[data-v-07232553]{background-color:var(--form-section-background-color);box-shadow:var(--form-section-box-shadow);border-radius:var(--form-section-border-radius)}.widget-section__header[data-v-07232553]{border-radius:10px 10px 0 0;display:flex;padding:8px 8px 8px 40px;background-color:var(--form-section-header-background-color)}.widget-section-title[data-v-07232553]{flex-grow:1;font-weight:var(--form-section-title-font-weight);color:var(--form-section-title-color);font-size:var(--form-section-title-font-size);line-height:var(--form-section-title-line-height);margin:0}.widget-section__body[data-v-07232553]{padding:20px 40px}.widget-table__head[data-v-cae93640]{text-align:left;position:sticky;top:-1px;z-index:0}.widget-table__head-cell[data-v-cae93640]{padding:18px}.widget-table__head-title[data-v-cae93640]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:600;font-size:14px;line-height:19px;margin:0}.form-titles[data-v-6ea1062c]{display:flex;flex-direction:column;justify-content:center}.form-label[data-v-6ea1062c]{display:flex;gap:10px;padding:4px 7px;align-items:center}.form-container-label[data-v-6ea1062c]{margin:0 0 0 6px}.form-info[data-v-6ea1062c]{color:#828282}.form-label[data-v-6ea1062c]{background-color:#ff6262;color:#fff;border-radius:4px}.form-title[data-v-6ea1062c]{font-weight:700;font-size:18px;line-height:25px}.form-label__title[data-v-6ea1062c]{margin:0;line-height:16px}.form-label__icon[data-v-6ea1062c]{height:16px;font-size:16px}.form-label_inactive[data-v-6ea1062c]{background-color:gray}.form-label_correct[data-v-6ea1062c]{background-color:green}.form-label_warning[data-v-6ea1062c]{background-color:#ff0}.form-label_error[data-v-6ea1062c]{background-color:#ff6262}.widget-form[data-v-3d88d93f]{display:flex;flex-direction:column;gap:10px}.widget-form__head[data-v-3d88d93f]{display:flex;gap:16px;align-items:center;z-index:1;padding:10px 0}.widget-form__button[data-v-3d88d93f]{margin-left:auto}.wrap__widget-form[data-v-3d88d93f]{padding:20px}.widget-form__head[data-v-3d88d93f]{position:sticky;top:0}@media screen and (max-width: 768px){.wrap__widget-form[data-v-3d88d93f]{padding:10px}.widget-form__head[data-v-3d88d93f]{top:15px}}.head-image[data-v-3d88d93f]{padding:15px;background-color:#f3f4fc;border-radius:8px}.validation-item[data-v-e6138c02]{display:grid;grid-template-columns:70px 1fr;border:1px solid #00CCB1;border-radius:4px}.validation-item_failed[data-v-e6138c02]{border-color:#ee8030}.validation-item-header[data-v-e6138c02]{display:grid;place-content:center;background-color:#00ccb1}.validation-item_failed .validation-item-header[data-v-e6138c02]{background-color:#ee8030}.validation-item__title[data-v-e6138c02]{font-weight:700;font-size:18px;line-height:25px;color:#fff}.validation-item-content[data-v-e6138c02]{display:flex;flex-direction:column;padding:10px 16px;gap:10px}.modal-wrap[data-v-119165b9]{max-height:80%;display:flex;flex-direction:column}.modal-wrap-head[data-v-119165b9]{display:flex;align-items:center;padding:10px;background:#F3F4FC;border-radius:8px 8px 0 0}.modal-head__title[data-v-119165b9]{font-weight:700;font-size:18px;line-height:25px}.modal-wrap-body[data-v-119165b9]{background-color:#fff;border-radius:0 0 8px 8px;overflow:auto}.modal-validation-body[data-v-a39cfe2f]{display:flex;flex-direction:column;gap:10px;padding:20px}.widget-input-check[data-v-f4a3dc6c]{display:grid;place-items:center;height:20px;aspect-ratio:1/1;border:2px solid #1a1a1a;border-radius:4px;cursor:pointer;background-color:#fff}.widget-input-check_active[data-v-f4a3dc6c]{background-color:#2f2f2f}.widget-input-check>i[data-v-f4a3dc6c]{font-size:12px;height:12px;color:#fff}.widget-card[data-v-bca33c5b]{display:flex}.widget-card-toggle[data-v-bca33c5b]{padding:10px}.widget-card-wrap[data-v-bca33c5b]{display:flex;flex-grow:1;background-color:#fff;border:1px solid #cbcbcb;border-radius:8px}.widget-card-arrow[data-v-bca33c5b]{padding:10px;cursor:pointer}.card-icon-arrow[data-v-bca33c5b]{display:block;transition:transform var(--fast)}.card-icon-arrow_active[data-v-bca33c5b]{transform:rotate(90deg)}.widget-card-title[data-v-bca33c5b]{margin:0;font-weight:600;font-size:18px;line-height:20px}.widget-card-content[data-v-bca33c5b]{padding:9px 0;flex-grow:1}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { h as N, resolveComponent as x, openBlock as l, createElementBlock as u, createTextVNode as Ae, toDisplayString as y, createCommentVNode as _, createElementVNode as d, createVNode as C, normalizeClass as I, createBlock as b, Fragment as O, renderList as M, reactive as A, defineComponent as $, renderSlot as U, pushScopeId as Lt, popScopeId as Wt, withCtx as fe, withKeys as gn, computed as V, ref as q, normalizeStyle as ut, withModifiers as mn, onMounted as Ke, onUnmounted as yn, unref as P, TransitionGroup as Dt, provide as Mt, inject as dt, resolveDynamicComponent as Ft, mergeProps as jt, useSlots as xt, Transition as vn, defineModel as Se, watch as Tt, readonly as Ut } from "vue";
|
|
3
|
+
import { openModal as Bt } from "jenesius-vue-modal";
|
|
4
|
+
import { Form as K, utils as oe, FormField as ot } from "jenesius-vue-form";
|
|
5
|
+
import qt from "object-hash";
|
|
6
|
+
import { RouterLink as Gt, useRoute as wn } from "vue-router";
|
|
7
|
+
import bn from "date-and-time";
|
|
8
|
+
import { Manager as $n } from "socket.io-client";
|
|
9
|
+
/*!
|
|
10
|
+
* eservices-core v1.2.2
|
|
11
|
+
* (c) 2023 ESERVICES
|
|
12
|
+
*/
|
|
13
|
+
const m = (t, e) => {
|
|
14
|
+
const n = t.__vccOpts || t;
|
|
15
|
+
for (const [s, r] of e)
|
|
16
|
+
n[s] = r;
|
|
17
|
+
return n;
|
|
18
|
+
}, En = {
|
|
19
|
+
props: {
|
|
20
|
+
name: String
|
|
21
|
+
},
|
|
22
|
+
setup(t, e) {
|
|
23
|
+
let n = "unknown";
|
|
24
|
+
try {
|
|
25
|
+
n = e.slots.default()[0].children;
|
|
26
|
+
} catch {
|
|
27
|
+
n = t.name;
|
|
28
|
+
}
|
|
29
|
+
return () => N("i", {
|
|
30
|
+
class: `icon icon-${n}`
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}, R = /* @__PURE__ */ m(En, [["__scopeId", "data-v-6412ede6"]]);
|
|
34
|
+
function Tn(t, e) {
|
|
35
|
+
return !!t && t === e || "password is not equal";
|
|
36
|
+
}
|
|
37
|
+
function Ye(t) {
|
|
38
|
+
return Number(t.replace(/[^0-9.]/g, ""));
|
|
39
|
+
}
|
|
40
|
+
function pt(t, e = null) {
|
|
41
|
+
let s = String(Ye(t)).split(".");
|
|
42
|
+
return s[0] = s[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), s.length > 1 && e !== null && s[1].length > e && (s[1] = s[1].substring(0, e)), s.join(".");
|
|
43
|
+
}
|
|
44
|
+
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
45
|
+
__proto__: null,
|
|
46
|
+
numeric: Ye,
|
|
47
|
+
prettyNumeric: pt,
|
|
48
|
+
validPassword: Tn
|
|
49
|
+
}, Symbol.toStringTag, { value: "Module" })), le = {
|
|
50
|
+
props: {
|
|
51
|
+
title: {
|
|
52
|
+
type: String
|
|
53
|
+
},
|
|
54
|
+
modelValue: {
|
|
55
|
+
default() {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
placeholder: [String],
|
|
60
|
+
required: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default() {
|
|
63
|
+
return !1;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
rules: {
|
|
67
|
+
type: Array,
|
|
68
|
+
default() {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
array: Array,
|
|
73
|
+
name: String,
|
|
74
|
+
disabled: Boolean,
|
|
75
|
+
/**
|
|
76
|
+
* Complex - true скажет, что не нужно устанавливать связь с формой
|
|
77
|
+
* */
|
|
78
|
+
complex: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default() {
|
|
81
|
+
return !1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
data: () => ({
|
|
86
|
+
errorMessage: !1,
|
|
87
|
+
isInsideDisabled: !1,
|
|
88
|
+
isInsideRequired: !1,
|
|
89
|
+
value: null
|
|
90
|
+
}),
|
|
91
|
+
computed: {
|
|
92
|
+
arrayParse() {
|
|
93
|
+
return this.array ? this.array.map((t) => ["string", "number"].includes(typeof t) ? { value: t, title: t } : t) : [];
|
|
94
|
+
},
|
|
95
|
+
currentTitle() {
|
|
96
|
+
let t = "", e = this.arrayParse.find((n) => n.value === this.value);
|
|
97
|
+
return e && (t = e.title), t;
|
|
98
|
+
},
|
|
99
|
+
elemController() {
|
|
100
|
+
return {
|
|
101
|
+
_self: this,
|
|
102
|
+
name: this.name,
|
|
103
|
+
setValue: (t) => {
|
|
104
|
+
this.setValue(t);
|
|
105
|
+
},
|
|
106
|
+
getValue: () => this.value,
|
|
107
|
+
validate: () => this.validate(),
|
|
108
|
+
disable: () => {
|
|
109
|
+
this.isInsideDisabled = !0;
|
|
110
|
+
},
|
|
111
|
+
enable: () => {
|
|
112
|
+
this.isInsideDisabled = !1;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
emits: ["update:modelValue", "input"],
|
|
118
|
+
//input -- ручной ввод!!!
|
|
119
|
+
inject: {
|
|
120
|
+
formController: {
|
|
121
|
+
default: null
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
validate() {
|
|
126
|
+
const t = [...this.rules];
|
|
127
|
+
this.required && t.push((e) => e != null || "Please fill in this field");
|
|
128
|
+
for (let e = 0; e < t.length; e++) {
|
|
129
|
+
let n = t[e](this.value);
|
|
130
|
+
if (n !== !0)
|
|
131
|
+
return this.setError(n), !1;
|
|
132
|
+
}
|
|
133
|
+
return !0;
|
|
134
|
+
},
|
|
135
|
+
input(t) {
|
|
136
|
+
this.errorMessage = !1, !(this.disabled || this.isInsideDisabled) && (typeof t == "string" && t.length === 0 && (t = null), this.name && this.formController && this.formController.onInput({
|
|
137
|
+
name: this.name,
|
|
138
|
+
value: t
|
|
139
|
+
}), this.setValue(t));
|
|
140
|
+
},
|
|
141
|
+
setValue(t) {
|
|
142
|
+
this.value = t, this.$emit("update:modelValue", t), this.$emit("input", t);
|
|
143
|
+
},
|
|
144
|
+
select(t) {
|
|
145
|
+
this.input(t);
|
|
146
|
+
},
|
|
147
|
+
setError(t) {
|
|
148
|
+
this.errorMessage = t;
|
|
149
|
+
},
|
|
150
|
+
error(t) {
|
|
151
|
+
this.errorMessage = t;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
mounted() {
|
|
155
|
+
!this.complex && this.formController && this.formController.onDepend(this.elemController);
|
|
156
|
+
},
|
|
157
|
+
beforeUnmount() {
|
|
158
|
+
!this.complex && this.formController && this.formController.unDepend(this.elemController);
|
|
159
|
+
},
|
|
160
|
+
watch: {
|
|
161
|
+
modelValue(t) {
|
|
162
|
+
this.value = t;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, Xe = {
|
|
166
|
+
props: {
|
|
167
|
+
password: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: () => !1
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
data: () => ({
|
|
173
|
+
isPasswordVisible: !1
|
|
174
|
+
}),
|
|
175
|
+
methods: {
|
|
176
|
+
togglePasswordVisible(t = !this.isPasswordVisible) {
|
|
177
|
+
this.isPasswordVisible = t;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
computed: {
|
|
181
|
+
inputType() {
|
|
182
|
+
return this.password && !this.isPasswordVisible ? "password" : "text";
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, Cn = {
|
|
186
|
+
props: {
|
|
187
|
+
password: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: () => !1
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
data: () => ({
|
|
193
|
+
isPasswordVisible: !1
|
|
194
|
+
}),
|
|
195
|
+
methods: {
|
|
196
|
+
togglePasswordVisible(t = !this.isPasswordVisible) {
|
|
197
|
+
this.isPasswordVisible = t;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}, In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
201
|
+
__proto__: null,
|
|
202
|
+
MixinInput: le,
|
|
203
|
+
MixinInputPassword: Cn,
|
|
204
|
+
MixinInputText: Xe
|
|
205
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
206
|
+
function Ve(t, e = []) {
|
|
207
|
+
let n = t;
|
|
208
|
+
return e.forEach((s) => {
|
|
209
|
+
n = s(n);
|
|
210
|
+
}), n;
|
|
211
|
+
}
|
|
212
|
+
const An = {
|
|
213
|
+
components: { Icon: R },
|
|
214
|
+
props: {
|
|
215
|
+
modify: {
|
|
216
|
+
type: Function,
|
|
217
|
+
default: (t) => t
|
|
218
|
+
},
|
|
219
|
+
pretty: {
|
|
220
|
+
type: Function,
|
|
221
|
+
default: (t) => t
|
|
222
|
+
},
|
|
223
|
+
numeric: {
|
|
224
|
+
type: Boolean,
|
|
225
|
+
default: !1
|
|
226
|
+
},
|
|
227
|
+
prettyNumeric: {
|
|
228
|
+
type: Boolean,
|
|
229
|
+
default: !1
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
computed: {
|
|
233
|
+
prettyValue() {
|
|
234
|
+
return console.log("pretty value"), this.pretty(Ve(this.modelValue, this.arrayInputPrettyModifiers));
|
|
235
|
+
},
|
|
236
|
+
arrayInputModifiers() {
|
|
237
|
+
let t = [];
|
|
238
|
+
return (this.numeric || this.prettyNumeric) && t.push(Ye), t;
|
|
239
|
+
},
|
|
240
|
+
arrayInputPrettyModifiers() {
|
|
241
|
+
let t = [];
|
|
242
|
+
return this.prettyNumeric && t.push(pt), t;
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
methods: {
|
|
246
|
+
//Not used
|
|
247
|
+
onChange(t) {
|
|
248
|
+
let e = this.modify(Ve(t.target.value, this.arrayInputModifiers));
|
|
249
|
+
this.input(e);
|
|
250
|
+
},
|
|
251
|
+
onInput() {
|
|
252
|
+
const t = this.$refs.input.value, e = this.modify(t);
|
|
253
|
+
this.input(e), this.$refs.input.value = this.pretty(e);
|
|
254
|
+
},
|
|
255
|
+
_onInput(t) {
|
|
256
|
+
let e = this.modify(Ve(t.target.value, this.arrayInputModifiers));
|
|
257
|
+
this.input(e), this.$refs.input.value = this.pretty(Ve(this.modelValue, this.arrayInputPrettyModifiers));
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
mixins: [le, Xe],
|
|
261
|
+
name: "InputText"
|
|
262
|
+
}, kn = { class: "input-wrap" }, Nn = {
|
|
263
|
+
key: 0,
|
|
264
|
+
class: "input-title"
|
|
265
|
+
}, Pn = {
|
|
266
|
+
key: 0,
|
|
267
|
+
class: "input-title_required"
|
|
268
|
+
}, On = ["disabled", "error"], Rn = ["type", "placeholder", "disabled", "error", "value"], Vn = {
|
|
269
|
+
key: 1,
|
|
270
|
+
class: "input-text__error text_sm"
|
|
271
|
+
};
|
|
272
|
+
function Ln(t, e, n, s, r, i) {
|
|
273
|
+
const a = x("icon");
|
|
274
|
+
return l(), u("div", kn, [
|
|
275
|
+
t.title ? (l(), u("p", Nn, [
|
|
276
|
+
Ae(y(t.title) + " ", 1),
|
|
277
|
+
t.required ? (l(), u("span", Pn, "*")) : _("", !0)
|
|
278
|
+
])) : _("", !0),
|
|
279
|
+
d("div", {
|
|
280
|
+
class: "input-text-container input_size_md flex",
|
|
281
|
+
disabled: t.disabled || t.isInsideDisabled,
|
|
282
|
+
error: !!t.errorMessage
|
|
283
|
+
}, [
|
|
284
|
+
d("input", {
|
|
285
|
+
class: "input-text",
|
|
286
|
+
type: t.inputType,
|
|
287
|
+
placeholder: t.placeholder,
|
|
288
|
+
disabled: t.disabled || t.isInsideDisabled,
|
|
289
|
+
error: !!t.errorMessage,
|
|
290
|
+
ref: "input",
|
|
291
|
+
value: n.pretty(t.value),
|
|
292
|
+
onInput: e[0] || (e[0] = (...o) => i.onInput && i.onInput(...o))
|
|
293
|
+
}, null, 40, Rn),
|
|
294
|
+
t.password ? (l(), u("div", {
|
|
295
|
+
key: 0,
|
|
296
|
+
class: "input-text__password",
|
|
297
|
+
onClick: e[1] || (e[1] = (o) => t.togglePasswordVisible())
|
|
298
|
+
}, [
|
|
299
|
+
C(a, {
|
|
300
|
+
class: "cursor_pointer",
|
|
301
|
+
name: t.isPasswordVisible ? "eye-crossed" : "eye"
|
|
302
|
+
}, null, 8, ["name"])
|
|
303
|
+
])) : _("", !0),
|
|
304
|
+
t.errorMessage ? (l(), u("p", Vn, y(t.errorMessage), 1)) : _("", !0)
|
|
305
|
+
], 8, On)
|
|
306
|
+
]);
|
|
307
|
+
}
|
|
308
|
+
const Wn = /* @__PURE__ */ m(An, [["render", Ln], ["__scopeId", "data-v-65e2ee2d"]]);
|
|
309
|
+
const Dn = {
|
|
310
|
+
mixins: [le],
|
|
311
|
+
name: "InputToggle"
|
|
312
|
+
};
|
|
313
|
+
function Mn(t, e, n, s, r, i) {
|
|
314
|
+
return l(), u("div", {
|
|
315
|
+
class: I(["input__toggle widget-input", { active: t.value, disabled: t.disabled || t.isInsideDisabled }]),
|
|
316
|
+
onClick: e[0] || (e[0] = (a) => t.input(!t.value))
|
|
317
|
+
}, null, 2);
|
|
318
|
+
}
|
|
319
|
+
const Fn = /* @__PURE__ */ m(Dn, [["render", Mn], ["__scopeId", "data-v-56d58611"]]);
|
|
320
|
+
const jn = {
|
|
321
|
+
props: ["isActive", "title"],
|
|
322
|
+
name: "FragmentInputSelectItem"
|
|
323
|
+
}, xn = { class: "item-wrap" };
|
|
324
|
+
function Un(t, e, n, s, r, i) {
|
|
325
|
+
return l(), u("div", xn, [
|
|
326
|
+
d("p", {
|
|
327
|
+
class: I(["input-select__item cursor_pointer", { active: n.isActive }])
|
|
328
|
+
}, y(n.title), 3)
|
|
329
|
+
]);
|
|
330
|
+
}
|
|
331
|
+
const Bn = /* @__PURE__ */ m(jn, [["render", Un], ["__scopeId", "data-v-69ab8592"]]);
|
|
332
|
+
function ke(t, e) {
|
|
333
|
+
if (!t)
|
|
334
|
+
return console.warn("Element is not provided.");
|
|
335
|
+
function n(r, i) {
|
|
336
|
+
return r == i.target || r.contains(i.target);
|
|
337
|
+
}
|
|
338
|
+
const s = (r) => {
|
|
339
|
+
n(t, r) || (e(), window.removeEventListener("click", s));
|
|
340
|
+
};
|
|
341
|
+
window.addEventListener("click", s);
|
|
342
|
+
}
|
|
343
|
+
const qn = {
|
|
344
|
+
data: () => ({
|
|
345
|
+
isActive: !1
|
|
346
|
+
}),
|
|
347
|
+
computed: {
|
|
348
|
+
titleValue() {
|
|
349
|
+
try {
|
|
350
|
+
return this.arrayParse.find((t) => t.value === this.value).title;
|
|
351
|
+
} catch {
|
|
352
|
+
return "";
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
methods: {
|
|
357
|
+
active(t = !this.isActive) {
|
|
358
|
+
this.isInsideDisabled || this.disabled || (this.isActive = t);
|
|
359
|
+
},
|
|
360
|
+
hide() {
|
|
361
|
+
this.isActive = !1;
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
watch: {
|
|
365
|
+
isActive(t) {
|
|
366
|
+
t && ke(this.$refs.input, () => this.hide());
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
components: { Icon: R, FragmentInputSelectItem: Bn },
|
|
370
|
+
mixins: [le],
|
|
371
|
+
name: "InputSelect"
|
|
372
|
+
}, Gn = { class: "input-wrap" }, zn = {
|
|
373
|
+
key: 0,
|
|
374
|
+
class: "input-title"
|
|
375
|
+
}, Hn = {
|
|
376
|
+
key: 0,
|
|
377
|
+
class: "color__text_red"
|
|
378
|
+
}, Jn = { class: "input-select-container__current input_size_md flex" }, Kn = {
|
|
379
|
+
key: 0,
|
|
380
|
+
class: "input-select-value"
|
|
381
|
+
}, Yn = {
|
|
382
|
+
key: 1,
|
|
383
|
+
class: "current-placeholder text_md"
|
|
384
|
+
}, Xn = { class: "input-select-list input-select-container__list" }, Zn = {
|
|
385
|
+
key: 0,
|
|
386
|
+
class: "input-text__error position_absolute margin-0 text_sm color__text_red"
|
|
387
|
+
};
|
|
388
|
+
function Qn(t, e, n, s, r, i) {
|
|
389
|
+
const a = x("icon"), o = x("fragment-input-select-item");
|
|
390
|
+
return l(), u("div", Gn, [
|
|
391
|
+
t.title ? (l(), u("p", zn, [
|
|
392
|
+
Ae(y(t.title) + " ", 1),
|
|
393
|
+
t.required ? (l(), u("span", Hn, "*")) : _("", !0)
|
|
394
|
+
])) : _("", !0),
|
|
395
|
+
d("div", {
|
|
396
|
+
class: I(["input-select-container cursor_pointer", { active: t.isActive, disabled: t.disabled || t.isInsideDisabled, error: !!t.errorMessage }]),
|
|
397
|
+
onClick: e[1] || (e[1] = (c) => i.active()),
|
|
398
|
+
ref: "input"
|
|
399
|
+
}, [
|
|
400
|
+
d("div", Jn, [
|
|
401
|
+
t.value === void 0 || t.value === null ? (l(), u("span", Yn, y(t.placeholder), 1)) : (l(), u("p", Kn, y(i.titleValue), 1)),
|
|
402
|
+
t.disabled || t.isInsideDisabled ? _("", !0) : (l(), b(a, {
|
|
403
|
+
key: 2,
|
|
404
|
+
class: "input-select__ico-toggle",
|
|
405
|
+
name: "caret-down"
|
|
406
|
+
}))
|
|
407
|
+
]),
|
|
408
|
+
d("div", Xn, [
|
|
409
|
+
t.value ? (l(), b(o, {
|
|
410
|
+
key: 0,
|
|
411
|
+
onClick: e[0] || (e[0] = (c) => t.input(null))
|
|
412
|
+
})) : _("", !0),
|
|
413
|
+
(l(!0), u(O, null, M(t.arrayParse, (c, p) => (l(), b(o, {
|
|
414
|
+
class: "input-select-list__item",
|
|
415
|
+
key: p,
|
|
416
|
+
"is-active": c.value === t.value,
|
|
417
|
+
title: c.title,
|
|
418
|
+
onClick: (f) => t.input(c.value)
|
|
419
|
+
}, null, 8, ["is-active", "title", "onClick"]))), 128))
|
|
420
|
+
]),
|
|
421
|
+
t.errorMessage ? (l(), u("p", Zn, y(t.errorMessage), 1)) : _("", !0)
|
|
422
|
+
], 2)
|
|
423
|
+
]);
|
|
424
|
+
}
|
|
425
|
+
const es = /* @__PURE__ */ m(qn, [["render", Qn], ["__scopeId", "data-v-c4acd469"]]);
|
|
426
|
+
class ts {
|
|
427
|
+
static async upload(e, n) {
|
|
428
|
+
const s = new FormData();
|
|
429
|
+
s.append("file", e);
|
|
430
|
+
const r = `/close-api/files?entityName=${n}`;
|
|
431
|
+
return await fetch(r, {
|
|
432
|
+
method: "POST",
|
|
433
|
+
body: s
|
|
434
|
+
}).then((i) => i.json()).then((i) => (i.filename = e.name, i));
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
function ft(t = () => null) {
|
|
438
|
+
let e = t;
|
|
439
|
+
const n = A({
|
|
440
|
+
wait: !1,
|
|
441
|
+
error: !1,
|
|
442
|
+
ready: !1
|
|
443
|
+
});
|
|
444
|
+
return n.call = async function(...s) {
|
|
445
|
+
this.wait = !0, this.error = !1, this.ready = !1;
|
|
446
|
+
try {
|
|
447
|
+
await e(...s), this.ready = !0;
|
|
448
|
+
} catch {
|
|
449
|
+
this.error = !0;
|
|
450
|
+
}
|
|
451
|
+
this.wait = !1;
|
|
452
|
+
}, n.setFunction = async function(s) {
|
|
453
|
+
e = s;
|
|
454
|
+
}, n;
|
|
455
|
+
}
|
|
456
|
+
const ns = $({
|
|
457
|
+
props: {
|
|
458
|
+
entityName: {
|
|
459
|
+
type: String,
|
|
460
|
+
required: !0
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
emits: ["load", "change", "input"],
|
|
464
|
+
data: () => ({
|
|
465
|
+
pw: null
|
|
466
|
+
}),
|
|
467
|
+
created() {
|
|
468
|
+
this.pw = ft(this.onLoad);
|
|
469
|
+
},
|
|
470
|
+
methods: {
|
|
471
|
+
async onChange(t) {
|
|
472
|
+
t && this.pw.call(t);
|
|
473
|
+
},
|
|
474
|
+
async onLoad(t) {
|
|
475
|
+
const e = await ts.upload(t, this.entityName);
|
|
476
|
+
this.$emit("load", e), this.name && this.input(e.id);
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
mixins: [le],
|
|
480
|
+
components: { Icon: R }
|
|
481
|
+
}), ss = { class: "container-input-file" }, rs = {
|
|
482
|
+
key: 0,
|
|
483
|
+
class: "process-info input-file__wait text_size_sm"
|
|
484
|
+
}, is = {
|
|
485
|
+
key: 1,
|
|
486
|
+
class: "process-info input-file__error text_size_sm text_error"
|
|
487
|
+
};
|
|
488
|
+
function as(t, e, n, s, r, i) {
|
|
489
|
+
const a = x("icon");
|
|
490
|
+
return l(), u("div", ss, [
|
|
491
|
+
C(a, {
|
|
492
|
+
name: "plus",
|
|
493
|
+
class: "icon__file-upload"
|
|
494
|
+
}),
|
|
495
|
+
d("input", {
|
|
496
|
+
type: "file",
|
|
497
|
+
class: "input-file",
|
|
498
|
+
onChange: e[0] || (e[0] = (o) => t.onChange(o.target.files[0]))
|
|
499
|
+
}, null, 32),
|
|
500
|
+
t.pw.wait ? (l(), u("p", rs, "Loading...")) : _("", !0),
|
|
501
|
+
t.pw.error ? (l(), u("p", is, "Error load file")) : _("", !0)
|
|
502
|
+
]);
|
|
503
|
+
}
|
|
504
|
+
const os = /* @__PURE__ */ m(ns, [["render", as], ["__scopeId", "data-v-bdbf1475"]]), ls = {
|
|
505
|
+
//InputAddress,
|
|
506
|
+
InputText: Wn,
|
|
507
|
+
InputToggle: Fn,
|
|
508
|
+
InputSelect: es,
|
|
509
|
+
InputLoadFile: os
|
|
510
|
+
/*InputTextArea,
|
|
511
|
+
InputDate,
|
|
512
|
+
,
|
|
513
|
+
InputPhone,
|
|
514
|
+
InputRadio,
|
|
515
|
+
InputApplicationType,
|
|
516
|
+
InputApplicationStatus,
|
|
517
|
+
InputCustomerType,
|
|
518
|
+
InputCheckbox,
|
|
519
|
+
InputCustomer,
|
|
520
|
+
InputCustomerStatus,
|
|
521
|
+
InputIdentityDocument,
|
|
522
|
+
InputLicenseType,
|
|
523
|
+
InputLicenseStatus*/
|
|
524
|
+
};
|
|
525
|
+
const cs = {
|
|
526
|
+
props: {
|
|
527
|
+
placeholder: String,
|
|
528
|
+
error: [Boolean, String]
|
|
529
|
+
},
|
|
530
|
+
setup() {
|
|
531
|
+
return {};
|
|
532
|
+
},
|
|
533
|
+
name: "WidgetInputContainer"
|
|
534
|
+
}, us = (t) => (Lt("data-v-1e3f1057"), t = t(), Wt(), t), ds = { class: "widget-input__container" }, ps = { class: "input-container__content" }, fs = /* @__PURE__ */ us(() => /* @__PURE__ */ d("div", { class: "widget-input__underline" }, null, -1));
|
|
535
|
+
function hs(t, e, n, s, r, i) {
|
|
536
|
+
return l(), u("div", ds, [
|
|
537
|
+
d("div", ps, [
|
|
538
|
+
U(t.$slots, "default", {}, void 0, !0)
|
|
539
|
+
]),
|
|
540
|
+
fs,
|
|
541
|
+
n.placeholder ? (l(), u("p", {
|
|
542
|
+
key: 0,
|
|
543
|
+
class: I(["widget-input__placeholder", { "widget-input__placeholder_error": n.error }])
|
|
544
|
+
}, y(n.placeholder), 3)) : _("", !0)
|
|
545
|
+
]);
|
|
546
|
+
}
|
|
547
|
+
const _s = /* @__PURE__ */ m(cs, [["render", hs], ["__scopeId", "data-v-1e3f1057"]]);
|
|
548
|
+
const gs = {
|
|
549
|
+
components: { Icon: R, WidgetInputContainer: _s },
|
|
550
|
+
mixins: [le, Xe],
|
|
551
|
+
name: "InputText"
|
|
552
|
+
}, ms = ["type", "value"];
|
|
553
|
+
function ys(t, e, n, s, r, i) {
|
|
554
|
+
const a = x("icon"), o = x("widget-input-container");
|
|
555
|
+
return l(), b(o, {
|
|
556
|
+
placeholder: t.placeholder,
|
|
557
|
+
error: !!t.errorMessage
|
|
558
|
+
}, {
|
|
559
|
+
default: fe(() => [
|
|
560
|
+
d("input", {
|
|
561
|
+
type: t.password && !t.isPasswordVisible ? "password" : "text",
|
|
562
|
+
class: "input-text title_sm",
|
|
563
|
+
value: t.value,
|
|
564
|
+
onChange: e[0] || (e[0] = (c) => t.input(c.target.value)),
|
|
565
|
+
onKeyup: e[1] || (e[1] = gn((c) => t.$emit("enter"), ["enter"]))
|
|
566
|
+
}, null, 40, ms),
|
|
567
|
+
t.password ? (l(), u("div", {
|
|
568
|
+
key: 0,
|
|
569
|
+
class: "input-text__password",
|
|
570
|
+
onClick: e[2] || (e[2] = (c) => t.togglePasswordVisible())
|
|
571
|
+
}, [
|
|
572
|
+
C(a, {
|
|
573
|
+
class: "cursor_pointer",
|
|
574
|
+
name: t.isPasswordVisible ? "eye-crossed" : "eye"
|
|
575
|
+
}, null, 8, ["name"])
|
|
576
|
+
])) : _("", !0)
|
|
577
|
+
]),
|
|
578
|
+
_: 1
|
|
579
|
+
}, 8, ["placeholder", "error"]);
|
|
580
|
+
}
|
|
581
|
+
const vs = /* @__PURE__ */ m(gs, [["render", ys], ["__scopeId", "data-v-212b50e2"]]), ws = {
|
|
582
|
+
InputText: vs
|
|
583
|
+
};
|
|
584
|
+
function Le(t, e = []) {
|
|
585
|
+
let n = t;
|
|
586
|
+
return e.forEach((s) => {
|
|
587
|
+
n = s(n);
|
|
588
|
+
}), n;
|
|
589
|
+
}
|
|
590
|
+
const bs = $({
|
|
591
|
+
components: { Icon: R },
|
|
592
|
+
props: {
|
|
593
|
+
title: String,
|
|
594
|
+
modify: {
|
|
595
|
+
type: Function,
|
|
596
|
+
default: (t) => t
|
|
597
|
+
},
|
|
598
|
+
pretty: {
|
|
599
|
+
type: Function,
|
|
600
|
+
default: (t) => t
|
|
601
|
+
},
|
|
602
|
+
numeric: {
|
|
603
|
+
type: Boolean,
|
|
604
|
+
default: !1
|
|
605
|
+
},
|
|
606
|
+
prettyNumeric: {
|
|
607
|
+
type: Boolean,
|
|
608
|
+
default: !1
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
computed: {
|
|
612
|
+
prettyValue() {
|
|
613
|
+
return console.log("pretty value"), this.pretty(Le(this.modelValue, this.arrayInputPrettyModifiers));
|
|
614
|
+
},
|
|
615
|
+
arrayInputModifiers() {
|
|
616
|
+
let t = [];
|
|
617
|
+
return (this.numeric || this.prettyNumeric) && t.push(Ye), t;
|
|
618
|
+
},
|
|
619
|
+
arrayInputPrettyModifiers() {
|
|
620
|
+
let t = [];
|
|
621
|
+
return this.prettyNumeric && t.push(pt), t;
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
methods: {
|
|
625
|
+
//Not used
|
|
626
|
+
onChange(t) {
|
|
627
|
+
let e = this.modify(Le(t.target.value, this.arrayInputModifiers));
|
|
628
|
+
this.input(e);
|
|
629
|
+
},
|
|
630
|
+
onInput() {
|
|
631
|
+
const t = this.$refs.input.value, e = this.modify(t);
|
|
632
|
+
this.input(e), this.$refs.input.value = this.pretty(e);
|
|
633
|
+
},
|
|
634
|
+
_onInput(t) {
|
|
635
|
+
let e = this.modify(Le(t.target.value, this.arrayInputModifiers));
|
|
636
|
+
this.input(e), this.$refs.input.value = this.pretty(Le(this.modelValue, this.arrayInputPrettyModifiers));
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
mixins: [le, Xe],
|
|
640
|
+
name: "InputText"
|
|
641
|
+
}), $s = {
|
|
642
|
+
key: 0,
|
|
643
|
+
class: "input-title"
|
|
644
|
+
}, Es = {
|
|
645
|
+
key: 0,
|
|
646
|
+
class: "color__text_red"
|
|
647
|
+
}, Ts = ["disabled", "error"], Ss = ["type", "placeholder", "disabled", "error", "value"], Cs = {
|
|
648
|
+
key: 1,
|
|
649
|
+
class: "input-text__error text_sm color__text_red"
|
|
650
|
+
};
|
|
651
|
+
function Is(t, e, n, s, r, i) {
|
|
652
|
+
const a = x("icon");
|
|
653
|
+
return l(), u(O, null, [
|
|
654
|
+
t.title ? (l(), u("p", $s, [
|
|
655
|
+
Ae(y(t.title) + " ", 1),
|
|
656
|
+
t.required ? (l(), u("span", Es, "*")) : _("", !0)
|
|
657
|
+
])) : _("", !0),
|
|
658
|
+
d("div", {
|
|
659
|
+
class: "input-text-container flex",
|
|
660
|
+
disabled: t.disabled || t.isInsideDisabled,
|
|
661
|
+
error: !!t.errorMessage
|
|
662
|
+
}, [
|
|
663
|
+
d("input", {
|
|
664
|
+
class: "input-text",
|
|
665
|
+
type: t.inputType,
|
|
666
|
+
placeholder: t.placeholder,
|
|
667
|
+
disabled: t.disabled || t.isInsideDisabled,
|
|
668
|
+
error: !!t.errorMessage,
|
|
669
|
+
ref: "input",
|
|
670
|
+
value: t.pretty(t.value),
|
|
671
|
+
onInput: e[0] || (e[0] = (...o) => t.onInput && t.onInput(...o))
|
|
672
|
+
}, null, 40, Ss),
|
|
673
|
+
t.password ? (l(), u("div", {
|
|
674
|
+
key: 0,
|
|
675
|
+
class: "input-text__password",
|
|
676
|
+
onClick: e[1] || (e[1] = (o) => t.togglePasswordVisible())
|
|
677
|
+
}, [
|
|
678
|
+
C(a, {
|
|
679
|
+
class: "cursor_pointer",
|
|
680
|
+
name: t.isPasswordVisible ? "eye-crossed" : "eye"
|
|
681
|
+
}, null, 8, ["name"])
|
|
682
|
+
])) : _("", !0),
|
|
683
|
+
t.errorMessage ? (l(), u("p", Cs, y(t.errorMessage), 1)) : _("", !0)
|
|
684
|
+
], 8, Ts)
|
|
685
|
+
], 64);
|
|
686
|
+
}
|
|
687
|
+
const As = /* @__PURE__ */ m(bs, [["render", Is], ["__scopeId", "data-v-9c3e5ea6"]]), ks = {
|
|
688
|
+
InputText: As
|
|
689
|
+
}, Ns = {
|
|
690
|
+
default: ls,
|
|
691
|
+
line: ws,
|
|
692
|
+
naomi: ks
|
|
693
|
+
};
|
|
694
|
+
const Ps = {
|
|
695
|
+
components: { Icon: R },
|
|
696
|
+
props: {
|
|
697
|
+
title: String,
|
|
698
|
+
values: [Object, Array, String]
|
|
699
|
+
},
|
|
700
|
+
setup(t) {
|
|
701
|
+
Array.isArray(t.values) && t.values.forEach((a) => {
|
|
702
|
+
a.func && console.warn("Prop func is deprecated. Use callback.", a);
|
|
703
|
+
});
|
|
704
|
+
const e = V(() => {
|
|
705
|
+
if (!s.value)
|
|
706
|
+
return "30px";
|
|
707
|
+
let a = 0;
|
|
708
|
+
return Array.isArray(t.values) && (a += t.values.length), t.title && a++, typeof t.values == "string" && !Array.isArray(t.values) && a++, a * 30 + "px";
|
|
709
|
+
}), n = V(() => Array.isArray(t.values) ? t.values : typeof t.values == "string" ? { title: t.values } : [t.values]), s = q(!1);
|
|
710
|
+
function r(a = !s.value) {
|
|
711
|
+
s.value = a, a && ke(i.value, () => r(!1));
|
|
712
|
+
}
|
|
713
|
+
const i = q(null);
|
|
714
|
+
return {
|
|
715
|
+
isActive: s,
|
|
716
|
+
array: n,
|
|
717
|
+
toggle: r,
|
|
718
|
+
button: i,
|
|
719
|
+
maxHeight: e
|
|
720
|
+
};
|
|
721
|
+
},
|
|
722
|
+
name: "Button"
|
|
723
|
+
}, Os = { class: "widget-button-wrap flex" }, Rs = ["onClick"];
|
|
724
|
+
function Vs(t, e, n, s, r, i) {
|
|
725
|
+
const a = x("icon");
|
|
726
|
+
return l(), u("div", Os, [
|
|
727
|
+
d("div", {
|
|
728
|
+
class: I(["widget-button flex", { active: s.isActive }]),
|
|
729
|
+
ref: "button"
|
|
730
|
+
}, [
|
|
731
|
+
d("div", {
|
|
732
|
+
class: "widget-button__list flex_column",
|
|
733
|
+
style: ut({ maxHeight: s.maxHeight })
|
|
734
|
+
}, [
|
|
735
|
+
n.title ? (l(), u("span", {
|
|
736
|
+
key: 0,
|
|
737
|
+
class: "widget-button__list-elem cursor_pointer",
|
|
738
|
+
onClick: e[0] || (e[0] = (o) => s.toggle())
|
|
739
|
+
}, y(n.title), 1)) : _("", !0),
|
|
740
|
+
(l(!0), u(O, null, M(s.array, (o, c) => (l(), u("span", {
|
|
741
|
+
class: "widget-button__list-elem cursor_pointer",
|
|
742
|
+
onClick: (p) => (o.callback(), s.toggle(!1)),
|
|
743
|
+
key: c
|
|
744
|
+
}, y(o.title), 9, Rs))), 128))
|
|
745
|
+
], 4),
|
|
746
|
+
s.array.length > 1 ? (l(), u("div", {
|
|
747
|
+
key: 0,
|
|
748
|
+
class: "widget-button__toggle flex flex_center cursor_pointer",
|
|
749
|
+
onClick: e[1] || (e[1] = mn((o) => s.toggle(), ["stop"]))
|
|
750
|
+
}, [
|
|
751
|
+
C(a, {
|
|
752
|
+
class: "widget-button__toggle-icon",
|
|
753
|
+
name: "angle-small-down"
|
|
754
|
+
})
|
|
755
|
+
])) : _("", !0)
|
|
756
|
+
], 2)
|
|
757
|
+
]);
|
|
758
|
+
}
|
|
759
|
+
const zt = /* @__PURE__ */ m(Ps, [["render", Vs], ["__scopeId", "data-v-b6be5c12"]]);
|
|
760
|
+
const Ls = {
|
|
761
|
+
props: {
|
|
762
|
+
icon: String,
|
|
763
|
+
func: Function
|
|
764
|
+
},
|
|
765
|
+
name: "WidgetFormFunctionItem",
|
|
766
|
+
components: { Icon: R }
|
|
767
|
+
};
|
|
768
|
+
function Ws(t, e, n, s, r, i) {
|
|
769
|
+
const a = x("icon");
|
|
770
|
+
return l(), u("div", {
|
|
771
|
+
class: "function-item cursor_pointer",
|
|
772
|
+
onClick: e[0] || (e[0] = (...o) => n.func && n.func(...o))
|
|
773
|
+
}, [
|
|
774
|
+
C(a, { name: n.icon }, null, 8, ["name"])
|
|
775
|
+
]);
|
|
776
|
+
}
|
|
777
|
+
const Ds = /* @__PURE__ */ m(Ls, [["render", Ws], ["__scopeId", "data-v-73f7eb9f"]]);
|
|
778
|
+
const Ms = {
|
|
779
|
+
props: {
|
|
780
|
+
title: String
|
|
781
|
+
},
|
|
782
|
+
name: "WidgetFormTitle"
|
|
783
|
+
}, Fs = { class: "form-title" }, js = { class: "title_lg color__text_black margin-0" };
|
|
784
|
+
function xs(t, e, n, s, r, i) {
|
|
785
|
+
return l(), u("div", Fs, [
|
|
786
|
+
d("h2", js, y(n.title), 1)
|
|
787
|
+
]);
|
|
788
|
+
}
|
|
789
|
+
const Us = /* @__PURE__ */ m(Ms, [["render", xs], ["__scopeId", "data-v-c91ffa31"]]);
|
|
790
|
+
const Bs = {
|
|
791
|
+
components: { WidgetFormTitle: Us, WidgetFormFunctionItem: Ds, WidgetButton: zt },
|
|
792
|
+
props: {
|
|
793
|
+
title: String,
|
|
794
|
+
button: {
|
|
795
|
+
type: [Array, Object],
|
|
796
|
+
default: () => []
|
|
797
|
+
},
|
|
798
|
+
functions: [Array]
|
|
799
|
+
},
|
|
800
|
+
name: "WidgetForm"
|
|
801
|
+
}, qs = { class: "widget-form flex_column" }, Gs = { class: "widget-form__head flex" }, zs = { class: "widget-form__head-functions flex" }, Hs = { class: "widget-form__body" };
|
|
802
|
+
function Js(t, e, n, s, r, i) {
|
|
803
|
+
const a = x("widget-form-title"), o = x("widget-button"), c = x("widget-form-function-item");
|
|
804
|
+
return l(), u("div", qs, [
|
|
805
|
+
d("div", Gs, [
|
|
806
|
+
C(a, { title: n.title }, null, 8, ["title"]),
|
|
807
|
+
Array.isArray(n.button) && n.button.length || !Array.isArray(n.button) && n.button ? (l(), b(o, {
|
|
808
|
+
key: 0,
|
|
809
|
+
class: "widget-form__head-button",
|
|
810
|
+
values: n.button
|
|
811
|
+
}, null, 8, ["values"])) : _("", !0),
|
|
812
|
+
d("div", zs, [
|
|
813
|
+
(l(!0), u(O, null, M(n.functions, (p, f) => (l(), b(c, {
|
|
814
|
+
key: f,
|
|
815
|
+
icon: p.icon,
|
|
816
|
+
func: p.callback
|
|
817
|
+
}, null, 8, ["icon", "func"]))), 128))
|
|
818
|
+
])
|
|
819
|
+
]),
|
|
820
|
+
d("div", Hs, [
|
|
821
|
+
U(t.$slots, "default", {}, void 0, !0)
|
|
822
|
+
])
|
|
823
|
+
]);
|
|
824
|
+
}
|
|
825
|
+
const Ks = /* @__PURE__ */ m(Bs, [["render", Js], ["__scopeId", "data-v-c3e88e10"]]), Ys = {
|
|
826
|
+
default: {
|
|
827
|
+
WidgetForm: Ks
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
const Xs = {
|
|
831
|
+
props: {
|
|
832
|
+
title: String,
|
|
833
|
+
subTitle: String,
|
|
834
|
+
type: [String, Number],
|
|
835
|
+
double: {
|
|
836
|
+
type: Boolean,
|
|
837
|
+
default: () => !1
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
name: "ContainerFormElem"
|
|
841
|
+
}, Zs = { class: "form-container-item__title flex" }, Qs = { class: "" }, er = {
|
|
842
|
+
key: 0,
|
|
843
|
+
class: ""
|
|
844
|
+
}, tr = { class: "title_sm" }, nr = {
|
|
845
|
+
key: 1,
|
|
846
|
+
class: "form-container-item__right"
|
|
847
|
+
};
|
|
848
|
+
function sr(t, e, n, s, r, i) {
|
|
849
|
+
return l(), u("div", {
|
|
850
|
+
class: I(["form-container-item flex", [`form-container-item-${n.type}`]])
|
|
851
|
+
}, [
|
|
852
|
+
d("div", Zs, [
|
|
853
|
+
d("span", Qs, y(n.title), 1)
|
|
854
|
+
]),
|
|
855
|
+
d("div", {
|
|
856
|
+
class: I(["form-container-item-center flex_column", { content_double: n.double }])
|
|
857
|
+
}, [
|
|
858
|
+
U(t.$slots, "default", {}, void 0, !0)
|
|
859
|
+
], 2),
|
|
860
|
+
n.subTitle ? (l(), u("div", er, [
|
|
861
|
+
d("span", tr, y(n.subTitle), 1),
|
|
862
|
+
U(t.$slots, "centerRight", {}, void 0, !0)
|
|
863
|
+
])) : _("", !0),
|
|
864
|
+
t.$slots.right ? (l(), u("div", nr, [
|
|
865
|
+
U(t.$slots, "right", {}, void 0, !0)
|
|
866
|
+
])) : _("", !0)
|
|
867
|
+
], 2);
|
|
868
|
+
}
|
|
869
|
+
const rr = /* @__PURE__ */ m(Xs, [["render", sr], ["__scopeId", "data-v-9264f6f4"]]);
|
|
870
|
+
const ir = {
|
|
871
|
+
name: "ContainerAuthView"
|
|
872
|
+
}, ar = { class: "container-auth-wrap" }, or = { class: "container-auth-sidebar" }, lr = { class: "container-auth-main" };
|
|
873
|
+
function cr(t, e, n, s, r, i) {
|
|
874
|
+
return l(), u("div", ar, [
|
|
875
|
+
d("div", or, [
|
|
876
|
+
U(t.$slots, "side", {}, void 0, !0)
|
|
877
|
+
]),
|
|
878
|
+
d("div", lr, [
|
|
879
|
+
U(t.$slots, "default", {}, void 0, !0)
|
|
880
|
+
])
|
|
881
|
+
]);
|
|
882
|
+
}
|
|
883
|
+
const ur = /* @__PURE__ */ m(ir, [["render", cr], ["__scopeId", "data-v-0b1a5e81"]]), dr = {
|
|
884
|
+
ContainerFormElem: rr,
|
|
885
|
+
ContainerAuthView: ur
|
|
886
|
+
}, pr = /* @__PURE__ */ $({
|
|
887
|
+
__name: "WidgetSpinner",
|
|
888
|
+
props: {
|
|
889
|
+
color: {}
|
|
890
|
+
},
|
|
891
|
+
setup(t) {
|
|
892
|
+
return (e, n) => (l(), u("div", {
|
|
893
|
+
class: "loader",
|
|
894
|
+
style: ut({ "border-left": `1.1em solid ${e.color ? e.color : "#fff"}` })
|
|
895
|
+
}, null, 4));
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
const he = /* @__PURE__ */ m(pr, [["__scopeId", "data-v-12ff0501"]]), fr = { class: "button-element" }, hr = /* @__PURE__ */ $({
|
|
899
|
+
__name: "WidgetButton",
|
|
900
|
+
props: {
|
|
901
|
+
title: {},
|
|
902
|
+
callback: { type: Function },
|
|
903
|
+
wait: { type: Boolean },
|
|
904
|
+
default: { type: Boolean }
|
|
905
|
+
},
|
|
906
|
+
setup(t) {
|
|
907
|
+
const e = t;
|
|
908
|
+
function n(r) {
|
|
909
|
+
r.key === "Enter" && s.call();
|
|
910
|
+
}
|
|
911
|
+
Ke(() => {
|
|
912
|
+
e.default && document.addEventListener("keypress", n);
|
|
913
|
+
}), yn(() => {
|
|
914
|
+
document.removeEventListener("keypress", n);
|
|
915
|
+
});
|
|
916
|
+
const s = ft(e.callback);
|
|
917
|
+
return (r, i) => (l(), u("div", {
|
|
918
|
+
class: "button-wrap",
|
|
919
|
+
onClick: i[0] || (i[0] = (a) => P(s).call())
|
|
920
|
+
}, [
|
|
921
|
+
P(s).wait || r.wait ? (l(), b(he, {
|
|
922
|
+
key: 0,
|
|
923
|
+
class: "button-spinner"
|
|
924
|
+
})) : _("", !0),
|
|
925
|
+
d("button", fr, [
|
|
926
|
+
Ae(y(r.title) + " ", 1),
|
|
927
|
+
U(r.$slots, "default", {}, void 0, !0)
|
|
928
|
+
])
|
|
929
|
+
]));
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
const _r = /* @__PURE__ */ m(hr, [["__scopeId", "data-v-937d2e62"]]), gr = { class: "widget-button-wrap" }, mr = { class: "widget-multi-button" }, yr = { class: "widget-button-list" }, vr = ["onClick"], wr = { class: "button__side" }, br = {
|
|
933
|
+
key: 0,
|
|
934
|
+
class: "button__size-progress"
|
|
935
|
+
}, $r = /* @__PURE__ */ $({
|
|
936
|
+
__name: "WidgetMultiButton",
|
|
937
|
+
props: {
|
|
938
|
+
title: {},
|
|
939
|
+
array: {}
|
|
940
|
+
},
|
|
941
|
+
setup(t) {
|
|
942
|
+
const e = ft(), n = A({
|
|
943
|
+
active: !1
|
|
944
|
+
});
|
|
945
|
+
function s(i = !n.active) {
|
|
946
|
+
n.active = i;
|
|
947
|
+
}
|
|
948
|
+
function r(i) {
|
|
949
|
+
e.setFunction(i), e.call();
|
|
950
|
+
}
|
|
951
|
+
return (i, a) => (l(), u("div", gr, [
|
|
952
|
+
d("div", mr, [
|
|
953
|
+
d("div", {
|
|
954
|
+
class: I(["button__content", { button__content_active: n.active }])
|
|
955
|
+
}, [
|
|
956
|
+
i.title ? (l(), u("p", {
|
|
957
|
+
key: 0,
|
|
958
|
+
class: "button__content-title widget-multi-button-row",
|
|
959
|
+
onClick: a[0] || (a[0] = (o) => s())
|
|
960
|
+
}, y(i.title), 1)) : _("", !0),
|
|
961
|
+
d("div", yr, [
|
|
962
|
+
(l(!0), u(O, null, M(i.array, (o, c) => (l(), u("p", {
|
|
963
|
+
class: "button__content-title widget-multi-button-row",
|
|
964
|
+
key: c,
|
|
965
|
+
onClick: (p) => (r(o.callback), s(!1))
|
|
966
|
+
}, y(o.title), 9, vr))), 128))
|
|
967
|
+
])
|
|
968
|
+
], 2),
|
|
969
|
+
d("div", wr, [
|
|
970
|
+
P(e).wait ? (l(), u("div", br, [
|
|
971
|
+
C(he, { class: "button-spinner" })
|
|
972
|
+
])) : i.array && i.array.length > 1 ? (l(), u("div", {
|
|
973
|
+
key: 1,
|
|
974
|
+
class: I(["button__size-toggle widget-multi-button-toggle", { button__toggle_active: n.active }]),
|
|
975
|
+
onClick: a[1] || (a[1] = (o) => s())
|
|
976
|
+
}, [
|
|
977
|
+
C(R, {
|
|
978
|
+
class: "button__toggle-icon",
|
|
979
|
+
name: "angle-small-down"
|
|
980
|
+
})
|
|
981
|
+
], 2)) : _("", !0)
|
|
982
|
+
])
|
|
983
|
+
])
|
|
984
|
+
]));
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
const Ht = /* @__PURE__ */ m($r, [["__scopeId", "data-v-13176c56"]]), Er = {
|
|
988
|
+
WidgetButton: _r,
|
|
989
|
+
WidgetMultiButton: Ht
|
|
990
|
+
}, Tr = {
|
|
991
|
+
Icon: R
|
|
992
|
+
}, Sr = {
|
|
993
|
+
WidgetSpinner: he
|
|
994
|
+
}, D = new class {
|
|
995
|
+
constructor() {
|
|
996
|
+
this.store = A([]);
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* @description Метод используется для добавления новых уведомлений. Принимает два обязательных поля type и message,
|
|
1000
|
+
* которые будут отображаться в системе уведомлений.
|
|
1001
|
+
* @param type Тип уведомления. В данной реализации данный тип влияет на способ отображения сообщения.
|
|
1002
|
+
* @param msg {String} Текстовая метка уведомления.
|
|
1003
|
+
* @param options Params for current notification item: children, timeout (Default 10) in seconds.
|
|
1004
|
+
*/
|
|
1005
|
+
add(e, n, { children: s, timeout: r = 10 } = {}) {
|
|
1006
|
+
const i = new Cr(e, n, r, s || []);
|
|
1007
|
+
return this.store.push(i), r && setTimeout(this.remove.bind(this, i.id), r * 1e3), i;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* @description Function remove item by id. Return true if card was founded, otherwise false.
|
|
1011
|
+
* */
|
|
1012
|
+
remove(e) {
|
|
1013
|
+
const n = this.store.findIndex((s) => s.id === e);
|
|
1014
|
+
if (n === -1)
|
|
1015
|
+
return !1;
|
|
1016
|
+
this.store.splice(n, 1);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* @description Removing child message, Throwing error if card of children not founded.
|
|
1020
|
+
* */
|
|
1021
|
+
removeChild(e, n) {
|
|
1022
|
+
throw new Error("Removing children error.");
|
|
1023
|
+
}
|
|
1024
|
+
}(), Jt = class Kt {
|
|
1025
|
+
constructor(e, n, s, r) {
|
|
1026
|
+
this.type = e, this.msg = n, this.timeout = s, this.children = r, this.id = Kt.cardId++;
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
Jt.cardId = 1;
|
|
1030
|
+
let Cr = Jt;
|
|
1031
|
+
const Ir = { class: "widget-error" }, Ar = { class: "widget-error-wrap" }, kr = { class: "widget-error-main" }, Nr = { class: "widget-error-text widget-error-message" }, Pr = { class: "widget-error__container-close" }, Or = /* @__PURE__ */ $({
|
|
1032
|
+
__name: "WidgetError",
|
|
1033
|
+
props: {
|
|
1034
|
+
isGroup: { type: Boolean },
|
|
1035
|
+
message: {}
|
|
1036
|
+
},
|
|
1037
|
+
emits: ["close", "toggle"],
|
|
1038
|
+
setup(t, { emit: e }) {
|
|
1039
|
+
return (n, s) => (l(), u("div", Ir, [
|
|
1040
|
+
d("div", Ar, [
|
|
1041
|
+
d("div", kr, [
|
|
1042
|
+
d("p", Nr, y(n.message), 1)
|
|
1043
|
+
]),
|
|
1044
|
+
n.isGroup ? (l(), u("p", {
|
|
1045
|
+
key: 0,
|
|
1046
|
+
onClick: s[0] || (s[0] = (r) => e("toggle")),
|
|
1047
|
+
class: "article-details"
|
|
1048
|
+
}, "See details")) : _("", !0),
|
|
1049
|
+
d("div", Pr, [
|
|
1050
|
+
d("div", {
|
|
1051
|
+
class: "widget-error-close",
|
|
1052
|
+
onClick: s[1] || (s[1] = (r) => e("close"))
|
|
1053
|
+
})
|
|
1054
|
+
])
|
|
1055
|
+
])
|
|
1056
|
+
]));
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
const St = /* @__PURE__ */ m(Or, [["__scopeId", "data-v-8a0a0924"]]), Rr = {
|
|
1060
|
+
key: 0,
|
|
1061
|
+
class: "widget-error-details"
|
|
1062
|
+
}, Vr = /* @__PURE__ */ $({
|
|
1063
|
+
__name: "WidgetErrorGroup",
|
|
1064
|
+
props: {
|
|
1065
|
+
card: {}
|
|
1066
|
+
},
|
|
1067
|
+
emits: ["closeCard", "closeChild"],
|
|
1068
|
+
setup(t, { emit: e }) {
|
|
1069
|
+
const n = t, s = V(() => {
|
|
1070
|
+
var i;
|
|
1071
|
+
return !!((i = n.card.children) != null && i.length);
|
|
1072
|
+
}), r = q(!0);
|
|
1073
|
+
return (i, a) => (l(), u("div", null, [
|
|
1074
|
+
(l(), b(St, {
|
|
1075
|
+
message: i.card.msg,
|
|
1076
|
+
key: i.card.id,
|
|
1077
|
+
onClose: a[0] || (a[0] = (o) => e("closeCard", i.card.id)),
|
|
1078
|
+
onToggle: a[1] || (a[1] = (o) => r.value = !r.value),
|
|
1079
|
+
"is-group": s.value
|
|
1080
|
+
}, null, 8, ["message", "is-group"])),
|
|
1081
|
+
!r.value && i.card.children ? (l(), u("div", Rr, [
|
|
1082
|
+
C(Dt, { name: "fade" }, {
|
|
1083
|
+
default: fe(() => [
|
|
1084
|
+
(l(!0), u(O, null, M(i.card.children, (o) => (l(), b(St, {
|
|
1085
|
+
key: o.id,
|
|
1086
|
+
message: o.msg,
|
|
1087
|
+
onClose: (c) => e("closeChild", o.id)
|
|
1088
|
+
}, null, 8, ["message", "onClose"]))), 128))
|
|
1089
|
+
]),
|
|
1090
|
+
_: 1
|
|
1091
|
+
})
|
|
1092
|
+
])) : _("", !0)
|
|
1093
|
+
]));
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
const Lr = /* @__PURE__ */ m(Vr, [["__scopeId", "data-v-aa732044"]]), Wr = { class: "container-errors" }, Dr = /* @__PURE__ */ $({
|
|
1097
|
+
__name: "WidgetNotificationSystem",
|
|
1098
|
+
setup(t) {
|
|
1099
|
+
return (e, n) => (l(), u("div", Wr, [
|
|
1100
|
+
C(Dt, { name: "fade" }, {
|
|
1101
|
+
default: fe(() => [
|
|
1102
|
+
(l(!0), u(O, null, M(P(D).store, (s) => (l(), b(Lr, {
|
|
1103
|
+
key: s.id,
|
|
1104
|
+
card: s,
|
|
1105
|
+
onCloseCard: (r) => P(D).remove(s.id),
|
|
1106
|
+
onCloseChild: (r) => P(D).removeChild(s.id, r)
|
|
1107
|
+
}, null, 8, ["card", "onCloseCard", "onCloseChild"]))), 128))
|
|
1108
|
+
]),
|
|
1109
|
+
_: 1
|
|
1110
|
+
})
|
|
1111
|
+
]));
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
const Mr = /* @__PURE__ */ m(Dr, [["__scopeId", "data-v-8e9870dd"]]), Fr = {
|
|
1115
|
+
default: Mr
|
|
1116
|
+
};
|
|
1117
|
+
let jr = {
|
|
1118
|
+
inputs: Ns,
|
|
1119
|
+
forms: Ys,
|
|
1120
|
+
spinners: Sr,
|
|
1121
|
+
containers: dr,
|
|
1122
|
+
buttons: Er,
|
|
1123
|
+
icons: Tr,
|
|
1124
|
+
errorSystem: Fr
|
|
1125
|
+
};
|
|
1126
|
+
const xr = {
|
|
1127
|
+
inputs: Sn
|
|
1128
|
+
};
|
|
1129
|
+
function Ne(t, e) {
|
|
1130
|
+
if (typeof t != "object" || t === null)
|
|
1131
|
+
return;
|
|
1132
|
+
if (e in t)
|
|
1133
|
+
return t[e];
|
|
1134
|
+
let n = e.indexOf(".");
|
|
1135
|
+
if (n > -1) {
|
|
1136
|
+
const s = e.substring(0, n);
|
|
1137
|
+
return s in t ? Ne(t[s], e.substr(n + 1)) : void 0;
|
|
1138
|
+
}
|
|
1139
|
+
return t[e];
|
|
1140
|
+
}
|
|
1141
|
+
function ht(t) {
|
|
1142
|
+
return t.reduce((e, n) => e.then((s) => n == null ? void 0 : n(s)), Promise.resolve());
|
|
1143
|
+
}
|
|
1144
|
+
const Yt = class S extends Error {
|
|
1145
|
+
constructor(e, n = null) {
|
|
1146
|
+
super(), this.message = e, this.details = n, this.id = S.ID++;
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* @description Не удалось найти родительскую форму. Обычно ошибка используется при вызове Form.getParentForm();
|
|
1150
|
+
* */
|
|
1151
|
+
static ParentFormNotFound() {
|
|
1152
|
+
return new S("Can't found parent form.");
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* ОДИН ИЗ ЭЛЕМЕНТОВ, КОТОРЫЙ ПЫТАЕТСЯ ПОДПИСАТЬСЯ НА ФОРМУ
|
|
1156
|
+
* НЕ ИМЕЕТ ПАРАМЕТРА NAME.
|
|
1157
|
+
* */
|
|
1158
|
+
static UndefinedNameOfCompositeFormController(e) {
|
|
1159
|
+
return new S("Composite object name is undefined", e);
|
|
1160
|
+
}
|
|
1161
|
+
static EntityWithoutName(e) {
|
|
1162
|
+
return new S("'Entity doesn't have a name", e);
|
|
1163
|
+
}
|
|
1164
|
+
static NotResolvedNameEventEmitter(e) {
|
|
1165
|
+
return new S(`'${e}' is not a valid Event emitter name`);
|
|
1166
|
+
}
|
|
1167
|
+
static FormIsNotValidated(e) {
|
|
1168
|
+
return new S("Form is not validated", e);
|
|
1169
|
+
}
|
|
1170
|
+
static ListWorkerIsRunningOrEnd(e) {
|
|
1171
|
+
return new S("List data request is running or already done", e);
|
|
1172
|
+
}
|
|
1173
|
+
static ObjectIdNotNumber(e) {
|
|
1174
|
+
return new S(`${e} (id) is not a number`);
|
|
1175
|
+
}
|
|
1176
|
+
static UndefinedErrorId(e, n) {
|
|
1177
|
+
return S.ApiNotAvailable();
|
|
1178
|
+
}
|
|
1179
|
+
static ApiError(e) {
|
|
1180
|
+
return new S("Request error", e);
|
|
1181
|
+
}
|
|
1182
|
+
static ApiNotAvailable() {
|
|
1183
|
+
return new S(`Sorry, we experience difficulties here.
|
|
1184
|
+
Please try again later or submit a feedback if problem doesn't go.`);
|
|
1185
|
+
}
|
|
1186
|
+
static AuthServiceError(e, n) {
|
|
1187
|
+
return !e && !n ? S.ApiNotAvailable() : new S(e || "Authorization Error", n);
|
|
1188
|
+
}
|
|
1189
|
+
static ApiResponseParseFailed() {
|
|
1190
|
+
return S.ApiNotAvailable();
|
|
1191
|
+
}
|
|
1192
|
+
static MissingIdInValuesEntity(e) {
|
|
1193
|
+
return new S(
|
|
1194
|
+
"Object doesn't have id",
|
|
1195
|
+
e
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
static ObjectWithIdNotFound(e, n) {
|
|
1199
|
+
return new S(`Can't find object with id: ${e}`, n);
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* ОШИБКА ДЛЯ ТАБЛИЦЫ, В ТОМ СЛУЧАЕ, ЕСЛИ ОБЪЕКТ НА ОБНОВЛЕНИЕ НЕ СВЯЗАН
|
|
1203
|
+
* С СУЩЕСТВУЮЩИМ ОБЪЕКТОМ ПО _tableId
|
|
1204
|
+
* */
|
|
1205
|
+
static ObjectWithoutConnectToPresentArray(e, n) {
|
|
1206
|
+
return new S("Object is not found.", {
|
|
1207
|
+
object: e,
|
|
1208
|
+
array: n
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
static EntityWithoutId(e) {
|
|
1212
|
+
return new S("Entity doesn't have id.", e);
|
|
1213
|
+
}
|
|
1214
|
+
static NotFoundedTableIndex(e, n) {
|
|
1215
|
+
return new S(`Can't find the element with tableIndex ${e}`, n);
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Использовать в случае, когда тип ошибки не определён или место её
|
|
1219
|
+
* появления не понятно
|
|
1220
|
+
* */
|
|
1221
|
+
static UndefinedError(e, n = []) {
|
|
1222
|
+
return new S(e, n);
|
|
1223
|
+
}
|
|
1224
|
+
static TableArrayAlreadyIncludeProvidedIndexValue(e, n, s) {
|
|
1225
|
+
return new S(`Array already includes the element with value ${e}`, { array: n, table: s });
|
|
1226
|
+
}
|
|
1227
|
+
static MetadataEntityIsNotAvailable(e) {
|
|
1228
|
+
return new S(`Metadata for the ${e} is not currently available.`);
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
Yt.ID = 0;
|
|
1232
|
+
let B = Yt;
|
|
1233
|
+
const Xt = "Please try again later or submit a feedback if problem doesn't go.";
|
|
1234
|
+
function ze(t) {
|
|
1235
|
+
return typeof t == "string" ? nt(t) : Ur(t) ? nt(t.message) : nt(Xt);
|
|
1236
|
+
}
|
|
1237
|
+
function Ur(t) {
|
|
1238
|
+
return !!(typeof t == "object" && Object.hasOwnProperty.call(t, "message") && t !== null);
|
|
1239
|
+
}
|
|
1240
|
+
function nt(t, e = []) {
|
|
1241
|
+
return {
|
|
1242
|
+
message: t,
|
|
1243
|
+
details: e
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
class Br {
|
|
1247
|
+
static getClientData() {
|
|
1248
|
+
return g("/close-api/client-content");
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* @description Получение навигационного меню для текущего контекста.
|
|
1252
|
+
* */
|
|
1253
|
+
static getNavigation() {
|
|
1254
|
+
return g("/close-api/client/navigation");
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
/*!
|
|
1258
|
+
* jenesius-event-emitter v1.0.2
|
|
1259
|
+
* (c) 2022 Jenesius
|
|
1260
|
+
* @license MIT
|
|
1261
|
+
*/
|
|
1262
|
+
const Ct = function(t, e) {
|
|
1263
|
+
return t in this.events || (this.events[t] = []), this.events[t].push(e), this.off.bind(this, t, e);
|
|
1264
|
+
}, It = function(t, e) {
|
|
1265
|
+
t in this.events && this.events[t].forEach((n) => n(e));
|
|
1266
|
+
}, At = function(t, e) {
|
|
1267
|
+
const n = this.events[t];
|
|
1268
|
+
if (!n)
|
|
1269
|
+
return;
|
|
1270
|
+
const s = n.indexOf(e);
|
|
1271
|
+
s !== -1 && n.splice(s, 1);
|
|
1272
|
+
}, kt = function() {
|
|
1273
|
+
this.events = {};
|
|
1274
|
+
};
|
|
1275
|
+
class H {
|
|
1276
|
+
constructor() {
|
|
1277
|
+
this.events = {};
|
|
1278
|
+
}
|
|
1279
|
+
on(e, n) {
|
|
1280
|
+
return Ct.call(this, e, n);
|
|
1281
|
+
}
|
|
1282
|
+
emit(e, n) {
|
|
1283
|
+
return It.call(this, e, n);
|
|
1284
|
+
}
|
|
1285
|
+
off(e, n) {
|
|
1286
|
+
return At.call(this, e, n);
|
|
1287
|
+
}
|
|
1288
|
+
cleanEvents() {
|
|
1289
|
+
kt.call(this);
|
|
1290
|
+
}
|
|
1291
|
+
static on(e, n) {
|
|
1292
|
+
return Ct.call(H, e, n);
|
|
1293
|
+
}
|
|
1294
|
+
static emit(e, n) {
|
|
1295
|
+
return It.call(H, e, n);
|
|
1296
|
+
}
|
|
1297
|
+
static off(e, n) {
|
|
1298
|
+
return At.call(H, e, n);
|
|
1299
|
+
}
|
|
1300
|
+
static cleanEvents() {
|
|
1301
|
+
kt.call(H);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
H.events = {};
|
|
1305
|
+
var Zt = (t, e, n) => {
|
|
1306
|
+
if (!e.has(t))
|
|
1307
|
+
throw TypeError("Cannot " + n);
|
|
1308
|
+
}, We = (t, e, n) => (Zt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), st = (t, e, n) => {
|
|
1309
|
+
if (e.has(t))
|
|
1310
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
1311
|
+
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
1312
|
+
}, rt = (t, e, n, s) => (Zt(t, e, "write to private field"), s ? s.call(t, n) : e.set(t, n), n), ye, Me, Fe;
|
|
1313
|
+
const ce = class z extends H {
|
|
1314
|
+
constructor() {
|
|
1315
|
+
super(...arguments), st(this, ye, void 0), st(this, Me, "front"), this.organizations = [], st(this, Fe, !1);
|
|
1316
|
+
}
|
|
1317
|
+
set language(e) {
|
|
1318
|
+
localStorage.setItem(z.LOCALSTORAGE_LANGUAGE_KEY, e);
|
|
1319
|
+
}
|
|
1320
|
+
get language() {
|
|
1321
|
+
return localStorage.getItem(z.LOCALSTORAGE_LANGUAGE_KEY) || z.DEFAULT_LANGUAGE;
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* @description Проверяет находится ли язык в local-storage
|
|
1325
|
+
* */
|
|
1326
|
+
checkLanguageInStorage() {
|
|
1327
|
+
return !!localStorage.getItem(z.LOCALSTORAGE_LANGUAGE_KEY);
|
|
1328
|
+
}
|
|
1329
|
+
get contextType() {
|
|
1330
|
+
var e;
|
|
1331
|
+
if (this.contextId)
|
|
1332
|
+
return ((e = this.person) == null ? void 0 : e.id) === this.contextId ? "person" : "organization";
|
|
1333
|
+
}
|
|
1334
|
+
set router(e) {
|
|
1335
|
+
rt(this, ye, e);
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* @description VueRouter of Application
|
|
1339
|
+
* */
|
|
1340
|
+
get router() {
|
|
1341
|
+
if (!We(this, ye))
|
|
1342
|
+
throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");
|
|
1343
|
+
return We(this, ye);
|
|
1344
|
+
}
|
|
1345
|
+
set type(e) {
|
|
1346
|
+
rt(this, Me, e);
|
|
1347
|
+
}
|
|
1348
|
+
get type() {
|
|
1349
|
+
return We(this, Me);
|
|
1350
|
+
}
|
|
1351
|
+
get isBack() {
|
|
1352
|
+
return this.type === "back";
|
|
1353
|
+
}
|
|
1354
|
+
get isFront() {
|
|
1355
|
+
return this.type === "front";
|
|
1356
|
+
}
|
|
1357
|
+
set ready(e) {
|
|
1358
|
+
rt(this, Fe, e), this.emit(z.EVENT_READY_UPDATE, e);
|
|
1359
|
+
}
|
|
1360
|
+
get ready() {
|
|
1361
|
+
return We(this, Fe);
|
|
1362
|
+
}
|
|
1363
|
+
onReady(e) {
|
|
1364
|
+
return this.on(z.EVENT_READY_UPDATE, e);
|
|
1365
|
+
}
|
|
1366
|
+
onupdateContext(e) {
|
|
1367
|
+
return this.on(z.EVENT_CONTEXT_UPDATE, e);
|
|
1368
|
+
}
|
|
1369
|
+
onupdateData(e) {
|
|
1370
|
+
return this.on(z.EVENT_DATA_UPDATE, e);
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* @description Method for update current context. After success emit event[EVENT_UPDATE_CONTEXT]
|
|
1374
|
+
*/
|
|
1375
|
+
setCurrentContext(e) {
|
|
1376
|
+
if (this.contextId === e)
|
|
1377
|
+
return console.log("[application-manager] The current context has already been installed.");
|
|
1378
|
+
this.contextId = Number(e), localStorage.setItem(z.CURRENT_CONTEXT_KEY, String(e)), this.emit(z.EVENT_CONTEXT_UPDATE, e), console.log(`Current context id %c${e}`, "color: purple");
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* @description Возвращает текущий контекст. В случае, если контекст ещё не получен, или (Внутрення ошибка) не найде
|
|
1382
|
+
* но ни одного соответствия с уже запрошенными контекстами, возвращается null.
|
|
1383
|
+
* */
|
|
1384
|
+
get context() {
|
|
1385
|
+
var e;
|
|
1386
|
+
return this.contextId ? this.contextId === ((e = this.person) == null ? void 0 : e.id) ? this.person : this.organizations.find((n) => n.id === this.contextId) || null : null;
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* @description Initialization of ApplicationManager
|
|
1390
|
+
*/
|
|
1391
|
+
async init() {
|
|
1392
|
+
try {
|
|
1393
|
+
const e = await this.loadCustomerData();
|
|
1394
|
+
this.person = e, this.organizations = e.organizations, this.user = e.user, this.ready = !0;
|
|
1395
|
+
const n = Number.parseInt(localStorage.getItem(z.CURRENT_CONTEXT_KEY) || "");
|
|
1396
|
+
!Number.isNaN(n) && this.validateContextId(Number(n)) ? this.setCurrentContext(n) : this.setCurrentContext(Number(e.id));
|
|
1397
|
+
} catch {
|
|
1398
|
+
D.add("error", B.ApiNotAvailable().message);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
loadCustomerData() {
|
|
1402
|
+
return Br.getClientData();
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* @description The main method of application. Load the main information about user.
|
|
1406
|
+
* @deprecated
|
|
1407
|
+
*/
|
|
1408
|
+
async updateFullClientData() {
|
|
1409
|
+
return this.init();
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* @description Method using for validate provided ID, Checking with existing person ID and each organization ID.
|
|
1413
|
+
* */
|
|
1414
|
+
validateContextId(e) {
|
|
1415
|
+
var n;
|
|
1416
|
+
return ((n = this.person) == null ? void 0 : n.id) == e ? !0 : !!this.organizations.find((s) => s.id === e);
|
|
1417
|
+
}
|
|
1418
|
+
getListKeyById(e) {
|
|
1419
|
+
return console.log("DEPRECATED"), `list-information-${e}`;
|
|
1420
|
+
}
|
|
1421
|
+
getListInformationFromLocalStorage(e) {
|
|
1422
|
+
console.log("DEPRECATED");
|
|
1423
|
+
const n = localStorage.getItem(this.getListKeyById(e));
|
|
1424
|
+
return n && JSON.parse(n);
|
|
1425
|
+
}
|
|
1426
|
+
setListInformationToLocalStorage(e, n) {
|
|
1427
|
+
console.log("DEPRECATED"), localStorage.setItem(this.getListKeyById(e), JSON.stringify(n));
|
|
1428
|
+
}
|
|
1429
|
+
};
|
|
1430
|
+
ye = /* @__PURE__ */ new WeakMap();
|
|
1431
|
+
Me = /* @__PURE__ */ new WeakMap();
|
|
1432
|
+
Fe = /* @__PURE__ */ new WeakMap();
|
|
1433
|
+
ce.DEFAULT_LANGUAGE = "en";
|
|
1434
|
+
ce.LOCALSTORAGE_LANGUAGE_KEY = "CurrentLanguage";
|
|
1435
|
+
ce.EVENT_CONTEXT_UPDATE = "event:context-update";
|
|
1436
|
+
ce.EVENT_READY_UPDATE = "event:ready-update";
|
|
1437
|
+
ce.EVENT_DATA_UPDATE = "event:data-update";
|
|
1438
|
+
ce.CURRENT_CONTEXT_KEY = "CurrentContext";
|
|
1439
|
+
let qr = ce;
|
|
1440
|
+
const E = new qr();
|
|
1441
|
+
function lo() {
|
|
1442
|
+
const t = A({
|
|
1443
|
+
contextType: E.contextType,
|
|
1444
|
+
contextId: E.contextId,
|
|
1445
|
+
context: E.context
|
|
1446
|
+
});
|
|
1447
|
+
return E.onupdateContext(() => {
|
|
1448
|
+
t.contextType = E.contextType, t.contextId = E.contextId, t.context = E.context;
|
|
1449
|
+
}), t;
|
|
1450
|
+
}
|
|
1451
|
+
function Gr(t) {
|
|
1452
|
+
return t.text().then((e) => {
|
|
1453
|
+
try {
|
|
1454
|
+
return JSON.parse(e);
|
|
1455
|
+
} catch {
|
|
1456
|
+
return Xt;
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
function g(t, e = {}) {
|
|
1461
|
+
return E.isFront && (e.headers || (e.headers = {}), e.headers["Context-Id"] = E.contextId), e.redirect = "manual", fetch(t, e).then((n) => n.type === "opaqueredirect" ? void window.location.replace("/auth") : n).catch(() => {
|
|
1462
|
+
throw B.ApiNotAvailable();
|
|
1463
|
+
}).then((n) => Gr(n).then((s) => {
|
|
1464
|
+
if (!n.ok)
|
|
1465
|
+
throw s;
|
|
1466
|
+
return s;
|
|
1467
|
+
}));
|
|
1468
|
+
}
|
|
1469
|
+
class Ze {
|
|
1470
|
+
constructor() {
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* @description Парсит конфигуратор списка таблицы или листа. Возвращает
|
|
1474
|
+
* строку для graphQL.
|
|
1475
|
+
* @return {string} graphQLQuery
|
|
1476
|
+
*
|
|
1477
|
+
* */
|
|
1478
|
+
static parseNamesFromListConfig(e) {
|
|
1479
|
+
let n = Ze.parseFieldsToGraphQL(e.reduce((r, i) => (i.name && r.push(i.name), r), []));
|
|
1480
|
+
function s(r) {
|
|
1481
|
+
let i = "";
|
|
1482
|
+
for (let a in r)
|
|
1483
|
+
typeof r[a] == "boolean" ? i += ` ${a} ` : i += ` ${a} { ${s(r[a])} }`;
|
|
1484
|
+
return i;
|
|
1485
|
+
}
|
|
1486
|
+
return s(n);
|
|
1487
|
+
}
|
|
1488
|
+
static parseSortFromListConfig(e) {
|
|
1489
|
+
let n = {};
|
|
1490
|
+
for (let s in e)
|
|
1491
|
+
n[s] = e[s] ? "ASC" : "DESC";
|
|
1492
|
+
return n;
|
|
1493
|
+
}
|
|
1494
|
+
static parseFieldsToGraphQL(e) {
|
|
1495
|
+
function n(s, r) {
|
|
1496
|
+
if (r.includes(".")) {
|
|
1497
|
+
const i = r.indexOf("."), a = r.substring(i + 1), o = r.substring(0, i);
|
|
1498
|
+
o in s || (s[o] = {}), n(s[o], a);
|
|
1499
|
+
} else
|
|
1500
|
+
s[r] = !0;
|
|
1501
|
+
return s;
|
|
1502
|
+
}
|
|
1503
|
+
return e.reduce(n, {});
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
class zr {
|
|
1507
|
+
constructor() {
|
|
1508
|
+
this.public = !1, this.errors = new Proxy([], {
|
|
1509
|
+
set: (e, n, s) => (n !== "length" && this.public && console.log(`Journal [Error] ${JSON.stringify(s)}`), e[n] = s, !0)
|
|
1510
|
+
}), window._journal = this;
|
|
1511
|
+
}
|
|
1512
|
+
get error() {
|
|
1513
|
+
return {
|
|
1514
|
+
/**
|
|
1515
|
+
* @description Добавить ошибку в журнал
|
|
1516
|
+
*
|
|
1517
|
+
* @param {Any} err
|
|
1518
|
+
*
|
|
1519
|
+
* */
|
|
1520
|
+
add: (...e) => {
|
|
1521
|
+
this.errors.push(e);
|
|
1522
|
+
},
|
|
1523
|
+
clean: () => {
|
|
1524
|
+
this.errors.splice(0, this.errors.length);
|
|
1525
|
+
},
|
|
1526
|
+
/**
|
|
1527
|
+
* @description Выведет все ошибки в консоль
|
|
1528
|
+
* */
|
|
1529
|
+
console: () => {
|
|
1530
|
+
console.log(this.errors);
|
|
1531
|
+
}
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
welcome() {
|
|
1535
|
+
console.log("The journal has been initialized. To get access check %c_journal in console.", "background: blue; color: white");
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
const Qt = new zr();
|
|
1539
|
+
function en(t) {
|
|
1540
|
+
return t && t[0].toLowerCase() + t.slice(1);
|
|
1541
|
+
}
|
|
1542
|
+
const Hr = {
|
|
1543
|
+
props: {
|
|
1544
|
+
message: String
|
|
1545
|
+
},
|
|
1546
|
+
name: "ModalWait",
|
|
1547
|
+
components: { WidgetSpinner: he }
|
|
1548
|
+
}, Jr = { class: "modal__wait modal-default flex_column" };
|
|
1549
|
+
function Kr(t, e, n, s, r, i) {
|
|
1550
|
+
const a = x("widget-spinner");
|
|
1551
|
+
return l(), u("div", Jr, [
|
|
1552
|
+
C(a),
|
|
1553
|
+
d("p", null, y(n.message), 1)
|
|
1554
|
+
]);
|
|
1555
|
+
}
|
|
1556
|
+
const Yr = /* @__PURE__ */ m(Hr, [["render", Kr], ["__scopeId", "data-v-430b5c94"]]), Xr = {
|
|
1557
|
+
error: !0,
|
|
1558
|
+
wait: !1,
|
|
1559
|
+
throw: !0
|
|
1560
|
+
};
|
|
1561
|
+
async function _t(t, e = {}) {
|
|
1562
|
+
const n = {
|
|
1563
|
+
modalWait: null
|
|
1564
|
+
};
|
|
1565
|
+
e = Object.assign({}, e, Xr);
|
|
1566
|
+
try {
|
|
1567
|
+
e.wait && (n.modalWait = await Bt(Yr, { message: typeof e.wait == "string" ? e.wait : "" }));
|
|
1568
|
+
} catch (s) {
|
|
1569
|
+
console.warn(s);
|
|
1570
|
+
}
|
|
1571
|
+
return Promise.resolve(t()).catch((s) => {
|
|
1572
|
+
let r = s;
|
|
1573
|
+
if (typeof r == "string" && (r = B.UndefinedError(r)), e.error && (console.log(r, r.details), r instanceof B ? D.add("error", r.message, {
|
|
1574
|
+
children: r.details || [],
|
|
1575
|
+
timeout: 12
|
|
1576
|
+
}) : r != null && r.message ? D.add("error", r.message) : (console.warn(r), D.add("error", B.ApiResponseParseFailed().message))), e.throw)
|
|
1577
|
+
throw r;
|
|
1578
|
+
}).finally(() => {
|
|
1579
|
+
var s;
|
|
1580
|
+
(s = n.modalWait) == null || s.close();
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1583
|
+
function Qe(t) {
|
|
1584
|
+
return Object.keys(t).reduce((e, n) => {
|
|
1585
|
+
let s = t[n];
|
|
1586
|
+
const r = n.charAt(0).toUpperCase() + n.slice(1);
|
|
1587
|
+
return typeof s == "object" && !(s == null || Array.isArray(s)) && (s = Qe(s)), e[r] = s, e;
|
|
1588
|
+
}, {});
|
|
1589
|
+
}
|
|
1590
|
+
function tn(t, e = 2) {
|
|
1591
|
+
if (!(typeof t == "string" || typeof t == "number"))
|
|
1592
|
+
return "";
|
|
1593
|
+
let s = String(t).split(".");
|
|
1594
|
+
return s[0] = s[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), s.length < 2 && (s[1] = ""), s[1] = s[1].padEnd(e, "0"), s[1].length > e && (s[1] = s[1].substring(0, e)), s.join(".");
|
|
1595
|
+
}
|
|
1596
|
+
const Ce = {
|
|
1597
|
+
Request: g,
|
|
1598
|
+
clickOutside: ke,
|
|
1599
|
+
getPropFromObject: Ne,
|
|
1600
|
+
runPromiseQueue: ht,
|
|
1601
|
+
GraphQL: Ze,
|
|
1602
|
+
firstChapterToLowerCase: en,
|
|
1603
|
+
requestHandler: _t,
|
|
1604
|
+
valuesToUpperCase: Qe,
|
|
1605
|
+
prettyMoney: tn
|
|
1606
|
+
}, Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1607
|
+
__proto__: null,
|
|
1608
|
+
GraphQL: Ze,
|
|
1609
|
+
Journal: Qt,
|
|
1610
|
+
Request: g,
|
|
1611
|
+
clickOutside: ke,
|
|
1612
|
+
default: Ce,
|
|
1613
|
+
firstChapterToLowerCase: en,
|
|
1614
|
+
getPropFromObject: Ne,
|
|
1615
|
+
requestHandler: _t,
|
|
1616
|
+
runPromiseQueue: ht,
|
|
1617
|
+
valuesToUpperCase: Qe
|
|
1618
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1619
|
+
function nn(t, e = "") {
|
|
1620
|
+
for (let n in t) {
|
|
1621
|
+
if (typeof t[n] == "object") {
|
|
1622
|
+
nn(t[n], (e.length ? `${e}-` : "") + n);
|
|
1623
|
+
continue;
|
|
1624
|
+
}
|
|
1625
|
+
let s = "--" + ((e.length ? `${e}-` : "") + n).replace(
|
|
1626
|
+
/([A-Z])/g,
|
|
1627
|
+
(r) => `-${r}`.toLowerCase()
|
|
1628
|
+
);
|
|
1629
|
+
document.documentElement.style.setProperty(s, t[n]);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
const te = {};
|
|
1633
|
+
function Qr(t) {
|
|
1634
|
+
for (let e in t)
|
|
1635
|
+
te[e] = t[e];
|
|
1636
|
+
t.styles && nn(t.styles), Qt.welcome(), console.log("The config has been initialized. To get access check %c_config in console.", "background: purple; color: white"), window._config = te;
|
|
1637
|
+
}
|
|
1638
|
+
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1639
|
+
__proto__: null
|
|
1640
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1641
|
+
function ti(t) {
|
|
1642
|
+
return Array.isArray(t) && t.length === 2 && typeof t[0] == "string" && typeof t[1] == "number";
|
|
1643
|
+
}
|
|
1644
|
+
const ni = "masterId", si = "masterEntity";
|
|
1645
|
+
function He(t, e) {
|
|
1646
|
+
if (!Array.isArray(e))
|
|
1647
|
+
return;
|
|
1648
|
+
if (ti(e))
|
|
1649
|
+
return n(e);
|
|
1650
|
+
e.forEach(n);
|
|
1651
|
+
function n(s) {
|
|
1652
|
+
t.append(si, s[0]), t.append(ni, s[1].toString());
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
class J {
|
|
1656
|
+
static async anonymousGetList(e) {
|
|
1657
|
+
return await g(`/open-api/data/${e}`, {
|
|
1658
|
+
method: "GET",
|
|
1659
|
+
headers: {
|
|
1660
|
+
"Content-Type": "application/json"
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* @description Возвращает массив элементов
|
|
1666
|
+
* Используется для получения списка items.
|
|
1667
|
+
* */
|
|
1668
|
+
static async getList(e, n) {
|
|
1669
|
+
const s = new URLSearchParams();
|
|
1670
|
+
function r(a, o) {
|
|
1671
|
+
const c = (p) => s.append("fields", p);
|
|
1672
|
+
if (typeof o == "string")
|
|
1673
|
+
return c(o);
|
|
1674
|
+
if (Array.isArray(o))
|
|
1675
|
+
return c(o.join(" "));
|
|
1676
|
+
if (typeof o == "object")
|
|
1677
|
+
return c(Object.keys(o).join(" "));
|
|
1678
|
+
}
|
|
1679
|
+
function i(a, o) {
|
|
1680
|
+
if (!o || !Object.keys(o).length)
|
|
1681
|
+
return;
|
|
1682
|
+
const c = Object.entries(o).map(([p, f]) => `@${p} ${f}`).join(",");
|
|
1683
|
+
a.append("order", c);
|
|
1684
|
+
}
|
|
1685
|
+
return n && (r(s, n.fields), i(s, n.order), n.limit && s.append("limit", n.limit.toString()), n.offset && s.append("offset", n.offset.toString()), n.filter && s.append("filter", n.filter.toString()), n.useUsageContext && s.append("useUsageContext", n.useUsageContext.toString())), await g(`/close-api/data/${e}?${s.toString()}`, {
|
|
1686
|
+
method: "GET",
|
|
1687
|
+
headers: {
|
|
1688
|
+
"Content-Type": "application/json"
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* @description Возвращает Number - количество записей сущности
|
|
1694
|
+
* */
|
|
1695
|
+
static getCount(e, n) {
|
|
1696
|
+
const s = new URLSearchParams();
|
|
1697
|
+
function r(a, o) {
|
|
1698
|
+
const c = (p) => s.append("fields", p);
|
|
1699
|
+
if (typeof o == "string")
|
|
1700
|
+
return c(o);
|
|
1701
|
+
if (Array.isArray(o))
|
|
1702
|
+
return c(o.join(" "));
|
|
1703
|
+
if (typeof o == "object")
|
|
1704
|
+
return c(Object.keys(o).join(" "));
|
|
1705
|
+
}
|
|
1706
|
+
function i(a, o) {
|
|
1707
|
+
if (!o || !Object.keys(o).length)
|
|
1708
|
+
return;
|
|
1709
|
+
const c = Object.entries(o).map(([p, f]) => `@${p} ${f}`).join(",");
|
|
1710
|
+
a.append("order", c);
|
|
1711
|
+
}
|
|
1712
|
+
return n && (r(s, n.fields), i(s, n.order), n.limit && s.append("limit", n.limit.toString()), n.offset && s.append("offset", n.offset.toString()), n.filter && s.append("filter", n.filter.toString()), n.useUsageContext && s.append("useUsageContext", n.useUsageContext.toString())), g(`/close-api/data/entities/${e}/count?${s.toString()}`, {
|
|
1713
|
+
method: "GET",
|
|
1714
|
+
headers: {
|
|
1715
|
+
"Content-Type": "application/json"
|
|
1716
|
+
}
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* @description Creating entity.
|
|
1721
|
+
* */
|
|
1722
|
+
static create(e, n, s) {
|
|
1723
|
+
const r = new URLSearchParams();
|
|
1724
|
+
return He(r, s == null ? void 0 : s.masterEntities), g(`/close-api/data/${e}?${r.toString()}`, {
|
|
1725
|
+
method: "POST",
|
|
1726
|
+
headers: {
|
|
1727
|
+
"Content-Type": "application/json"
|
|
1728
|
+
},
|
|
1729
|
+
body: JSON.stringify({
|
|
1730
|
+
values: n
|
|
1731
|
+
})
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* @description Default update method, update entity by primaryKeys.
|
|
1736
|
+
* */
|
|
1737
|
+
static update(e, n, s, r = {}) {
|
|
1738
|
+
return g(`/close-api/data/entities/${e}`, {
|
|
1739
|
+
method: "PUT",
|
|
1740
|
+
headers: {
|
|
1741
|
+
"Content-Type": "application/json"
|
|
1742
|
+
},
|
|
1743
|
+
body: JSON.stringify({
|
|
1744
|
+
values: s
|
|
1745
|
+
})
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
/**
|
|
1749
|
+
* @description Reading entity's data by id.
|
|
1750
|
+
* @param {String} entity Entity name in the singular.
|
|
1751
|
+
* @param {Number} id Entity id.
|
|
1752
|
+
* @param {Object} options
|
|
1753
|
+
* @param {String | String[]} options.fields String or Array of String. Contains input names.
|
|
1754
|
+
*/
|
|
1755
|
+
static readById(e, n, s = {}) {
|
|
1756
|
+
const r = new URLSearchParams();
|
|
1757
|
+
if (s.fields) {
|
|
1758
|
+
let i = s.fields;
|
|
1759
|
+
typeof i == "string" && (i = [i]), r.append("fields", i.join(" "));
|
|
1760
|
+
}
|
|
1761
|
+
return g(`/close-api/data/entities/${e}/id/${n}?${r.toString()}`, {
|
|
1762
|
+
method: "GET",
|
|
1763
|
+
headers: {
|
|
1764
|
+
"Content-Type": "application/json"
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
static updateById(e, n, s, r) {
|
|
1769
|
+
const i = new URLSearchParams();
|
|
1770
|
+
return He(i, r == null ? void 0 : r.masterEntities), g(`/close-api/data/entities/${e}/id/${n}?${i.toString()}`, {
|
|
1771
|
+
method: "PUT",
|
|
1772
|
+
headers: {
|
|
1773
|
+
"Content-Type": "application/json"
|
|
1774
|
+
},
|
|
1775
|
+
body: JSON.stringify({
|
|
1776
|
+
values: s,
|
|
1777
|
+
version: r == null ? void 0 : r.version
|
|
1778
|
+
})
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* @description Method for removing element by ID or array ID.
|
|
1783
|
+
* */
|
|
1784
|
+
static removeById(e, n, s) {
|
|
1785
|
+
const r = typeof n == "number" ? { Id: n } : n;
|
|
1786
|
+
return J.removeByKeys(e, r, s);
|
|
1787
|
+
}
|
|
1788
|
+
static removeByKeys(e, n, s) {
|
|
1789
|
+
return g(`/close-api/data/entities/${e}`, {
|
|
1790
|
+
method: "delete",
|
|
1791
|
+
headers: {
|
|
1792
|
+
"Content-Type": "application/json"
|
|
1793
|
+
},
|
|
1794
|
+
body: JSON.stringify({ keys: n, version: s })
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
var sn = (t, e, n) => {
|
|
1799
|
+
if (!e.has(t))
|
|
1800
|
+
throw TypeError("Cannot " + n);
|
|
1801
|
+
}, it = (t, e, n) => (sn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), Nt = (t, e, n) => {
|
|
1802
|
+
if (e.has(t))
|
|
1803
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
1804
|
+
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
1805
|
+
}, Pt = (t, e, n, s) => (sn(t, e, "write to private field"), s ? s.call(t, n) : e.set(t, n), n), ve, je;
|
|
1806
|
+
const gt = class pe extends H {
|
|
1807
|
+
constructor(e) {
|
|
1808
|
+
super(), Nt(this, ve, []), Nt(this, je, !1), this.hashParams = "", this.offset = 0, this.name = e.name;
|
|
1809
|
+
}
|
|
1810
|
+
set wait(e) {
|
|
1811
|
+
Pt(this, je, e), this.emit(pe.EVENT_CHANGE_WAIT, e);
|
|
1812
|
+
}
|
|
1813
|
+
get wait() {
|
|
1814
|
+
return it(this, je);
|
|
1815
|
+
}
|
|
1816
|
+
read(e) {
|
|
1817
|
+
var r, i;
|
|
1818
|
+
this.wait = !0;
|
|
1819
|
+
const n = {};
|
|
1820
|
+
e.order && (n.order = {
|
|
1821
|
+
[(r = e.order) == null ? void 0 : r.name]: (i = e.order) == null ? void 0 : i.duration
|
|
1822
|
+
}), e.fields && (n.fields = e.fields), e.filter && (n.filter = e.filter);
|
|
1823
|
+
const s = JSON.stringify(n.order) + JSON.stringify(n.filter);
|
|
1824
|
+
return s !== this.hashParams && (this.offset = 0, this.hashParams = s), e.limit && (n.limit = e.limit), e.offset && (n.offset = e.offset || this.offset), J.getList(this.name, n).then((a) => (this.offset === 0 && (this.array = []), this.offset += n.limit, a)).then((a) => {
|
|
1825
|
+
this.array.push(...a);
|
|
1826
|
+
}).then(() => this.emit(pe.EVENT_DATA, this.array)).finally(() => {
|
|
1827
|
+
this.wait = !1;
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
set array(e) {
|
|
1831
|
+
Pt(this, ve, e), this.emit(pe.EVENT_DATA, this.array);
|
|
1832
|
+
}
|
|
1833
|
+
add(e) {
|
|
1834
|
+
it(this, ve).push(...e), this.emit(pe.EVENT_DATA, this.array);
|
|
1835
|
+
}
|
|
1836
|
+
get array() {
|
|
1837
|
+
return it(this, ve);
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* @description Function get all names from Config.
|
|
1841
|
+
* */
|
|
1842
|
+
static GetFieldNames(e) {
|
|
1843
|
+
return e.reduce((n, s) => (s.name && (typeof s.name == "string" ? n.push(s.name) : n.push(...s.name)), n), []);
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* @description Получение стандартной информации из ячейки и значений. {name, value}
|
|
1847
|
+
* @example
|
|
1848
|
+
* cell: { name: ['title', 'id'], value: (x) => `${x}_${x}` }
|
|
1849
|
+
* values: {id: 1, title: "GG"}
|
|
1850
|
+
* Output: { name: 'title', value: 'GG_GG'}
|
|
1851
|
+
*/
|
|
1852
|
+
static getCellInfo(e, n) {
|
|
1853
|
+
const s = pe.getCellName(e), r = (() => {
|
|
1854
|
+
let i = s ? Ne(n, s) : null;
|
|
1855
|
+
return i === void 0 && (i = null), e.value ? e.value(i, n) : i;
|
|
1856
|
+
})();
|
|
1857
|
+
return {
|
|
1858
|
+
name: s,
|
|
1859
|
+
value: r
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
static getCellName(e) {
|
|
1863
|
+
return typeof e.name == "string" ? e.name : Array.isArray(e.name) ? e.name[0] : null;
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
ve = /* @__PURE__ */ new WeakMap();
|
|
1867
|
+
je = /* @__PURE__ */ new WeakMap();
|
|
1868
|
+
gt.EVENT_DATA = "LIST:DATA";
|
|
1869
|
+
gt.EVENT_CHANGE_WAIT = "LIST:UPDATE-WAIT";
|
|
1870
|
+
let rn = gt;
|
|
1871
|
+
const W = Symbol("__ROW_INDEX__");
|
|
1872
|
+
let et = class extends rn {
|
|
1873
|
+
constructor(e) {
|
|
1874
|
+
super(e), this.rowIndex = 1, this.changes = {
|
|
1875
|
+
new: {},
|
|
1876
|
+
edit: {},
|
|
1877
|
+
remove: []
|
|
1878
|
+
}, this.save = () => {
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
get changed() {
|
|
1882
|
+
return Object.keys(this.changes.new).length || Object.keys(this.changes.edit).length || this.changes.remove.length;
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* @description Создание новой записи.
|
|
1886
|
+
*/
|
|
1887
|
+
create(e) {
|
|
1888
|
+
const n = this.wrapData(e);
|
|
1889
|
+
this.changes.new[n[W]] = n, this.emitChanges();
|
|
1890
|
+
}
|
|
1891
|
+
cleanChanges() {
|
|
1892
|
+
this.changes.new = {}, this.changes.edit = {}, this.changes.remove = [], this.emitChanges();
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* @description Edit row of table.
|
|
1896
|
+
* @param {Number} rowIndex number of uniq row.
|
|
1897
|
+
* @param data Values
|
|
1898
|
+
*/
|
|
1899
|
+
edit(e, n) {
|
|
1900
|
+
const s = this.wrapData(n, e);
|
|
1901
|
+
if (this.changes.new[e])
|
|
1902
|
+
return this.changes.new[e] = s, this.emitChanges();
|
|
1903
|
+
this.array.find((r) => r[W] === e) && (this.changes.edit[e] = {
|
|
1904
|
+
...this.changes.edit[e],
|
|
1905
|
+
...s
|
|
1906
|
+
}, this.emitChanges());
|
|
1907
|
+
}
|
|
1908
|
+
remove(e) {
|
|
1909
|
+
if (this.changes.new[e])
|
|
1910
|
+
return delete this.changes.new[e], this.emitChanges();
|
|
1911
|
+
this.array.find((n) => n[W] === e) && (delete this.changes.edit[e], this.changes.remove.includes(e) || this.changes.remove.push(e), this.emitChanges());
|
|
1912
|
+
}
|
|
1913
|
+
wrapData(e, n) {
|
|
1914
|
+
return n === void 0 && !Object.prototype.hasOwnProperty.call(e, W.toString()) && (n = ++this.rowIndex), {
|
|
1915
|
+
...e,
|
|
1916
|
+
[W]: n
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
emitChanges() {
|
|
1920
|
+
this.emit(K.EVENT_CHANGED, !0);
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* @override
|
|
1924
|
+
* */
|
|
1925
|
+
set array(e) {
|
|
1926
|
+
super.array = e.map((n) => this.wrapData(n));
|
|
1927
|
+
}
|
|
1928
|
+
get array() {
|
|
1929
|
+
return super.array;
|
|
1930
|
+
}
|
|
1931
|
+
log(e) {
|
|
1932
|
+
console.log(`[table] ${e}`);
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
et.PROVIDE_NAME = "table-controller";
|
|
1936
|
+
function ri(t) {
|
|
1937
|
+
return function(n) {
|
|
1938
|
+
return {
|
|
1939
|
+
activate() {
|
|
1940
|
+
t(n);
|
|
1941
|
+
},
|
|
1942
|
+
deactivate() {
|
|
1943
|
+
t(null);
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
};
|
|
1947
|
+
}
|
|
1948
|
+
function uo(t) {
|
|
1949
|
+
const e = A(t.array);
|
|
1950
|
+
Mt(et.PROVIDE_NAME, t);
|
|
1951
|
+
const n = A(t.changes);
|
|
1952
|
+
t.on(rn.EVENT_DATA, (a) => e.splice(0, e.length, ...a)), t.on(K.EVENT_CHANGED, () => {
|
|
1953
|
+
n.new = Object.keys(t.changes.new).reduce((a, o) => {
|
|
1954
|
+
const c = Number(o);
|
|
1955
|
+
return a[c] = t.changes.new[c], a;
|
|
1956
|
+
}, {});
|
|
1957
|
+
});
|
|
1958
|
+
const s = V(() => [
|
|
1959
|
+
...e.reduce((a, o) => {
|
|
1960
|
+
const c = o[W];
|
|
1961
|
+
return t.changes.remove.includes(c) || a.push({
|
|
1962
|
+
...o,
|
|
1963
|
+
...t.changes.edit[c]
|
|
1964
|
+
}), a;
|
|
1965
|
+
}, []),
|
|
1966
|
+
...Object.values(n.new)
|
|
1967
|
+
]), r = K.getParentForm();
|
|
1968
|
+
return r == null || r.subscribe(t), {
|
|
1969
|
+
activeRow: q(null),
|
|
1970
|
+
array: s
|
|
1971
|
+
};
|
|
1972
|
+
}
|
|
1973
|
+
function po(t, e) {
|
|
1974
|
+
t.read = () => J.getList(t.name, {
|
|
1975
|
+
fields: e == null ? void 0 : e.fields
|
|
1976
|
+
}).then((n) => t.array = n).then(() => t.emit(K.EVENT_READ, t.array)), t.save = () => {
|
|
1977
|
+
const n = t.name;
|
|
1978
|
+
Object.values(t.changes.new).forEach(async (r) => {
|
|
1979
|
+
await J.create(n, r);
|
|
1980
|
+
}), Object.entries(t.changes.edit).forEach(async ([r, i]) => {
|
|
1981
|
+
await J.updateById(t.name, s(Number(r)), i);
|
|
1982
|
+
});
|
|
1983
|
+
function s(r) {
|
|
1984
|
+
const i = t.array.find((a) => a[W] === r);
|
|
1985
|
+
return i.id | i.Id;
|
|
1986
|
+
}
|
|
1987
|
+
t.changes.remove.forEach(async (r) => {
|
|
1988
|
+
await J.removeById(n, s(r), 0);
|
|
1989
|
+
}), t.emit(K.EVENT_SAVE);
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1993
|
+
__proto__: null
|
|
1994
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1995
|
+
class ho {
|
|
1996
|
+
static readHistoryById(e, n) {
|
|
1997
|
+
return g(`/close-api/audits/history/${e}/${n}`, {
|
|
1998
|
+
method: "GET",
|
|
1999
|
+
headers: {
|
|
2000
|
+
"Content-Type": "application/json"
|
|
2001
|
+
}
|
|
2002
|
+
}).then((s) => {
|
|
2003
|
+
const r = s.history.map((i) => {
|
|
2004
|
+
if (!i.changes)
|
|
2005
|
+
return i;
|
|
2006
|
+
const a = i.changes.map((o) => ({
|
|
2007
|
+
...o,
|
|
2008
|
+
oldValue: o.originalValue,
|
|
2009
|
+
name: o.fieldName
|
|
2010
|
+
}));
|
|
2011
|
+
return {
|
|
2012
|
+
...i,
|
|
2013
|
+
changes: a
|
|
2014
|
+
};
|
|
2015
|
+
});
|
|
2016
|
+
return {
|
|
2017
|
+
...s,
|
|
2018
|
+
history: r
|
|
2019
|
+
};
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
var an = (t, e, n) => {
|
|
2024
|
+
if (!e.has(t))
|
|
2025
|
+
throw TypeError("Cannot " + n);
|
|
2026
|
+
}, Q = (t, e, n) => (an(t, e, "read from private field"), n ? n.call(t) : e.get(t)), se = (t, e, n) => {
|
|
2027
|
+
if (e.has(t))
|
|
2028
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
2029
|
+
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
2030
|
+
}, re = (t, e, n, s) => (an(t, e, "write to private field"), s ? s.call(t, n) : e.set(t, n), n), xe, we, Ue, Be, be, $e, lt;
|
|
2031
|
+
const ie = "_______LIST_______ROW_______INDEX________NAME_______", Pe = class ee extends H {
|
|
2032
|
+
constructor(e) {
|
|
2033
|
+
super(), this.LIST_ROW_KEY = 1, se(this, xe, void 0), this.array = [], se(this, we, []), se(this, Ue, []), se(this, Be, new Proxy({}, {
|
|
2034
|
+
set: (n, s, r, i) => (n[s] = r, this.emit(ee.EVENT_FILTERS_UPDATE, n), !0),
|
|
2035
|
+
deleteProperty: (n, s) => (delete n[s], this.emit(ee.EVENT_FILTERS_UPDATE, n), !0)
|
|
2036
|
+
})), se(this, be, !1), se(this, $e, (...n) => Promise), se(this, lt, () => {
|
|
2037
|
+
}), re(this, xe, e.primaryKeys || []), this.name = e.name || void 0, e.config && re(this, we, e.config);
|
|
2038
|
+
}
|
|
2039
|
+
set config(e) {
|
|
2040
|
+
re(this, we, e.map(oe.copyObject)), this.emitUpdateConfig();
|
|
2041
|
+
}
|
|
2042
|
+
get config() {
|
|
2043
|
+
return Q(this, we);
|
|
2044
|
+
}
|
|
2045
|
+
emitUpdateConfig() {
|
|
2046
|
+
this.emit(ee.EVENT_CONFIG_UPDATE, this.config);
|
|
2047
|
+
}
|
|
2048
|
+
get order() {
|
|
2049
|
+
return Q(this, Ue);
|
|
2050
|
+
}
|
|
2051
|
+
set order(e) {
|
|
2052
|
+
re(this, Ue, e), this.emit(ee.EVENT_ORDER_UPDATE, this.order);
|
|
2053
|
+
}
|
|
2054
|
+
get filters() {
|
|
2055
|
+
return Q(this, Be);
|
|
2056
|
+
}
|
|
2057
|
+
set filters(e) {
|
|
2058
|
+
on(Q(this, Be), e);
|
|
2059
|
+
}
|
|
2060
|
+
set wait(e) {
|
|
2061
|
+
re(this, be, e), this.emit(K.EVENT_WAIT, Q(this, be));
|
|
2062
|
+
}
|
|
2063
|
+
/**
|
|
2064
|
+
* @description Value is true if request is running
|
|
2065
|
+
* */
|
|
2066
|
+
get wait() {
|
|
2067
|
+
return Q(this, be);
|
|
2068
|
+
}
|
|
2069
|
+
get primaryKeys() {
|
|
2070
|
+
return Q(this, xe);
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* @description Получение элемента массива по обычно индексу. Не путать с List.LIST_ROW_INDEX_NAME
|
|
2074
|
+
* */
|
|
2075
|
+
at(e) {
|
|
2076
|
+
return this.array[e % this.array.length];
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* @description Получение записи по ROW_KEY.
|
|
2080
|
+
* */
|
|
2081
|
+
atByKey(e) {
|
|
2082
|
+
return this.array.find((n) => n[ie] === e);
|
|
2083
|
+
}
|
|
2084
|
+
/**
|
|
2085
|
+
* @description Возвращает индекс записи по её RowKey, если запись не найдена то -1.
|
|
2086
|
+
* */
|
|
2087
|
+
indexByKey(e) {
|
|
2088
|
+
return this.array.findIndex((n) => n[ie] === e);
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* @description Получение значения ключа из объекта
|
|
2092
|
+
* */
|
|
2093
|
+
static getKey(e) {
|
|
2094
|
+
return e[ie];
|
|
2095
|
+
}
|
|
2096
|
+
static hasKey(e) {
|
|
2097
|
+
return typeof e != "object" || e === null ? !1 : Object.prototype.hasOwnProperty.call(e, ie);
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* @description Добавляет к массиву новые элементы.
|
|
2101
|
+
* */
|
|
2102
|
+
add(...e) {
|
|
2103
|
+
const n = this.wrapArray(e);
|
|
2104
|
+
this.array.push(...n), this.emit(ee.EVENT_DATA, this.array);
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* @description Полностью заменяет содержимое массива, новым
|
|
2108
|
+
* */
|
|
2109
|
+
set(e) {
|
|
2110
|
+
this.array = [], this.add(...e);
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* @description Removing data by rowKey
|
|
2114
|
+
* */
|
|
2115
|
+
removeByKey(e) {
|
|
2116
|
+
const n = this.indexByKey(e);
|
|
2117
|
+
n !== -1 && (this.array.splice(n, 1), this.emit(ee.EVENT_DATA, this.array));
|
|
2118
|
+
}
|
|
2119
|
+
/**
|
|
2120
|
+
* @description Merging data by RowKey
|
|
2121
|
+
* */
|
|
2122
|
+
updateByKey(e, n) {
|
|
2123
|
+
const s = this.atByKey(e);
|
|
2124
|
+
s && (Object.assign(s, n), this.emit(ee.EVENT_DATA, this.array));
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
* @description Just alias for array and method wrapItem
|
|
2128
|
+
* */
|
|
2129
|
+
wrapArray(e) {
|
|
2130
|
+
return e.map(this.wrapItem.bind(this));
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* @description Wrapping data to IDefaultListData
|
|
2134
|
+
* */
|
|
2135
|
+
wrapItem(e) {
|
|
2136
|
+
return this.isWrapped(e) ? e : {
|
|
2137
|
+
...e,
|
|
2138
|
+
[ie]: this.LIST_ROW_KEY++
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* @description Return true if provided data is IDefaultListData.
|
|
2143
|
+
* */
|
|
2144
|
+
isWrapped(e) {
|
|
2145
|
+
return Object.prototype.hasOwnProperty.call(e, ie);
|
|
2146
|
+
}
|
|
2147
|
+
set read(e) {
|
|
2148
|
+
re(this, $e, e);
|
|
2149
|
+
}
|
|
2150
|
+
get read() {
|
|
2151
|
+
return (...e) => Promise.resolve().then(() => {
|
|
2152
|
+
const n = Q(this, $e).call(this, ...e);
|
|
2153
|
+
return this.wait = !0, n;
|
|
2154
|
+
}).finally(() => this.wait = !1);
|
|
2155
|
+
}
|
|
2156
|
+
set save(e) {
|
|
2157
|
+
re(this, $e, e);
|
|
2158
|
+
}
|
|
2159
|
+
get save() {
|
|
2160
|
+
return () => Promise.resolve().then(() => this.wait = !0).then(() => Q(this, lt).call(this)).finally(() => this.wait = !1);
|
|
2161
|
+
}
|
|
2162
|
+
/**
|
|
2163
|
+
* @description Function get all names from Config.
|
|
2164
|
+
* */
|
|
2165
|
+
static GetFieldNames(e) {
|
|
2166
|
+
return e.reduce((n, s) => (s.name && (typeof s.name == "string" ? n.push(s.name) : n.push(...s.name)), n), []);
|
|
2167
|
+
}
|
|
2168
|
+
/**
|
|
2169
|
+
* @description Put ROW_KEY to data. Override keu if data include key.
|
|
2170
|
+
* */
|
|
2171
|
+
static mergeWithKey(e, n) {
|
|
2172
|
+
return {
|
|
2173
|
+
...e,
|
|
2174
|
+
[ie]: n
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* @description Methods using for get name from cell config.
|
|
2179
|
+
* */
|
|
2180
|
+
static getCellName(e) {
|
|
2181
|
+
return typeof e.name == "string" ? e.name : Array.isArray(e.name) ? e.name[0] : null;
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* @description Получение стандартной информации из ячейки и значений. {name, value}
|
|
2185
|
+
* @example
|
|
2186
|
+
* cell: { name: ['title', 'id'], value: (x) => `${x}_${x}` }
|
|
2187
|
+
* values: {id: 1, title: "GG"}
|
|
2188
|
+
* Output: { name: 'title', value: 'GG_GG'}
|
|
2189
|
+
*/
|
|
2190
|
+
static getCellInfo(e, n) {
|
|
2191
|
+
const s = ee.getCellName(e), r = (() => {
|
|
2192
|
+
let i = s ? Ne(n, s) : null;
|
|
2193
|
+
return i === void 0 && (i = null), e.value ? e.value(i, n) : i;
|
|
2194
|
+
})();
|
|
2195
|
+
return {
|
|
2196
|
+
name: s,
|
|
2197
|
+
value: r
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
xe = /* @__PURE__ */ new WeakMap();
|
|
2202
|
+
we = /* @__PURE__ */ new WeakMap();
|
|
2203
|
+
Ue = /* @__PURE__ */ new WeakMap();
|
|
2204
|
+
Be = /* @__PURE__ */ new WeakMap();
|
|
2205
|
+
be = /* @__PURE__ */ new WeakMap();
|
|
2206
|
+
$e = /* @__PURE__ */ new WeakMap();
|
|
2207
|
+
lt = /* @__PURE__ */ new WeakMap();
|
|
2208
|
+
Pe.EVENT_DATA = "list-data: update";
|
|
2209
|
+
Pe.EVENT_CONFIG_UPDATE = "list-config:update";
|
|
2210
|
+
Pe.EVENT_ORDER_UPDATE = "list-order:update";
|
|
2211
|
+
Pe.EVENT_FILTERS_UPDATE = "list-filters:update";
|
|
2212
|
+
let Z = Pe;
|
|
2213
|
+
function ii(t, e) {
|
|
2214
|
+
let n = "", s = 0, r;
|
|
2215
|
+
t.read = (i = {}) => {
|
|
2216
|
+
if (t.wait)
|
|
2217
|
+
return r;
|
|
2218
|
+
i.clean && (n = "", s = 0);
|
|
2219
|
+
let a = e;
|
|
2220
|
+
typeof a == "function" && (a = a());
|
|
2221
|
+
const o = {};
|
|
2222
|
+
if (!t.name)
|
|
2223
|
+
throw new Error("Reading list`s data without name is not available.");
|
|
2224
|
+
a.order && Array.isArray(a.order) && a.order.length && (o.order = {
|
|
2225
|
+
[a.order[0]]: a.order[1] || "asc"
|
|
2226
|
+
}), a.fields && (o.fields = a.fields), a.filter && (o.filter = a.filter);
|
|
2227
|
+
const c = JSON.stringify(o.order) + JSON.stringify(o.filter) + JSON.stringify(o.fields);
|
|
2228
|
+
return c !== n && !Number.isNaN(c) && (s = 0, n = c), "limit" in a && (o.limit = a.limit), o.offset = s || a.offset || 0, r = J.getList(t.name, o).then((p) => ((s === 0 || i.clean) && t.set([]), s += o.limit, p)).then((p) => (t.add(...p), p)), r;
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
function ai(t) {
|
|
2232
|
+
const e = A({
|
|
2233
|
+
wait: t.wait,
|
|
2234
|
+
array: []
|
|
2235
|
+
});
|
|
2236
|
+
return t.on(Z.EVENT_DATA, (n) => {
|
|
2237
|
+
e.array.splice(0, e.array.length, ...n.map((s) => Object.freeze(JSON.parse(JSON.stringify(s)))));
|
|
2238
|
+
}), t.on(K.EVENT_WAIT, () => {
|
|
2239
|
+
e.wait = t.wait;
|
|
2240
|
+
}), e;
|
|
2241
|
+
}
|
|
2242
|
+
function oi(t, e) {
|
|
2243
|
+
const n = "list-flex-config", s = dt(n, void 0);
|
|
2244
|
+
if (s)
|
|
2245
|
+
return s;
|
|
2246
|
+
if (!t || !e)
|
|
2247
|
+
throw new Error("Hook useProvideList has two required params: list and defaultSettings");
|
|
2248
|
+
t.on(Z.EVENT_CONFIG_UPDATE, () => {
|
|
2249
|
+
t.read();
|
|
2250
|
+
});
|
|
2251
|
+
const r = {
|
|
2252
|
+
list: t,
|
|
2253
|
+
defaultSettings: e
|
|
2254
|
+
};
|
|
2255
|
+
return Mt(n, r), r;
|
|
2256
|
+
}
|
|
2257
|
+
function _o(t) {
|
|
2258
|
+
const e = A([...t.config]);
|
|
2259
|
+
return t.on(Z.EVENT_CONFIG_UPDATE, (n) => {
|
|
2260
|
+
e.splice(0, e.length, ...n);
|
|
2261
|
+
}), e;
|
|
2262
|
+
}
|
|
2263
|
+
function li(t) {
|
|
2264
|
+
const e = t.order || [], n = A(e);
|
|
2265
|
+
return t.on(Z.EVENT_ORDER_UPDATE, (s) => {
|
|
2266
|
+
n.splice(0, n.length, ...s), t.read();
|
|
2267
|
+
}), n;
|
|
2268
|
+
}
|
|
2269
|
+
function go(t) {
|
|
2270
|
+
const e = q(""), n = V(() => {
|
|
2271
|
+
const s = e.value.toLowerCase();
|
|
2272
|
+
return P(t).filter((r) => e.value.length ? Object.values(r).join().toLowerCase().includes(s) : !0);
|
|
2273
|
+
});
|
|
2274
|
+
return {
|
|
2275
|
+
search: e,
|
|
2276
|
+
searchArray: n
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
function on(t, e) {
|
|
2280
|
+
Object.keys(t).forEach((n) => delete t[n]), Object.entries(e).forEach(([n, s]) => {
|
|
2281
|
+
t[n] = s;
|
|
2282
|
+
});
|
|
2283
|
+
}
|
|
2284
|
+
function mo(t) {
|
|
2285
|
+
const e = A(oe.copyObject(t.filters));
|
|
2286
|
+
return t.on(Z.EVENT_FILTERS_UPDATE, (n) => {
|
|
2287
|
+
on(e, n), t.read();
|
|
2288
|
+
}), e;
|
|
2289
|
+
}
|
|
2290
|
+
function yo(t) {
|
|
2291
|
+
const e = A([]);
|
|
2292
|
+
function n(o) {
|
|
2293
|
+
return e.includes(o);
|
|
2294
|
+
}
|
|
2295
|
+
function s(o) {
|
|
2296
|
+
n(o) || e.push(o);
|
|
2297
|
+
}
|
|
2298
|
+
function r(o) {
|
|
2299
|
+
const c = e.findIndex((p) => p === o);
|
|
2300
|
+
c !== -1 && e.splice(c, 1);
|
|
2301
|
+
}
|
|
2302
|
+
function i(o) {
|
|
2303
|
+
const c = P(t);
|
|
2304
|
+
if (o === void 0) {
|
|
2305
|
+
e.length === 0 ? c.forEach(s) : c.forEach(r);
|
|
2306
|
+
return;
|
|
2307
|
+
}
|
|
2308
|
+
n(o) ? r(o) : s(o);
|
|
2309
|
+
}
|
|
2310
|
+
const a = V(() => {
|
|
2311
|
+
const o = P(t);
|
|
2312
|
+
return e.length === o.length && o.length !== 0;
|
|
2313
|
+
});
|
|
2314
|
+
return [e, i, a, s, r];
|
|
2315
|
+
}
|
|
2316
|
+
class ci extends Z {
|
|
2317
|
+
constructor(e) {
|
|
2318
|
+
super(e), this.changes = [], this.save = ui.bind(this);
|
|
2319
|
+
}
|
|
2320
|
+
get changed() {
|
|
2321
|
+
return !!this.changes.find((e) => e.status === "active");
|
|
2322
|
+
}
|
|
2323
|
+
addChange(e, n) {
|
|
2324
|
+
this.changes.push({
|
|
2325
|
+
type: e,
|
|
2326
|
+
status: "active",
|
|
2327
|
+
// @ts-ignore
|
|
2328
|
+
data: this.wrapItem(n)
|
|
2329
|
+
});
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
function ui() {
|
|
2333
|
+
const t = this.changes.filter((e) => e.status === "active");
|
|
2334
|
+
return ht(t.map((e) => {
|
|
2335
|
+
console.log("++");
|
|
2336
|
+
}));
|
|
2337
|
+
}
|
|
2338
|
+
function di() {
|
|
2339
|
+
const t = q(null);
|
|
2340
|
+
function e(n) {
|
|
2341
|
+
t.value = n && qt(n);
|
|
2342
|
+
}
|
|
2343
|
+
return {
|
|
2344
|
+
activeRow: t,
|
|
2345
|
+
activateRow: e
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2348
|
+
const pi = {
|
|
2349
|
+
props: {
|
|
2350
|
+
config: Array
|
|
2351
|
+
},
|
|
2352
|
+
name: "WidgetTableHead"
|
|
2353
|
+
}, fi = { class: "widget-table__head" }, hi = { class: "widget-table__head-title" };
|
|
2354
|
+
function _i(t, e, n, s, r, i) {
|
|
2355
|
+
return l(), u("tr", fi, [
|
|
2356
|
+
(l(!0), u(O, null, M(n.config, (a, o) => (l(), u("th", {
|
|
2357
|
+
class: "widget-table__head-cell",
|
|
2358
|
+
key: o
|
|
2359
|
+
}, [
|
|
2360
|
+
d("p", hi, y(a.title), 1)
|
|
2361
|
+
]))), 128))
|
|
2362
|
+
]);
|
|
2363
|
+
}
|
|
2364
|
+
const gi = /* @__PURE__ */ m(pi, [["render", _i], ["__scopeId", "data-v-2ce532f4"]]);
|
|
2365
|
+
function ln(t) {
|
|
2366
|
+
return mt(t, "YYYY/MM/DD HH:mm:ss");
|
|
2367
|
+
}
|
|
2368
|
+
function mt(t, e = "YYYY/MM/DD") {
|
|
2369
|
+
if (!t)
|
|
2370
|
+
return "";
|
|
2371
|
+
try {
|
|
2372
|
+
const n = new Date(t);
|
|
2373
|
+
return bn.format(n, e);
|
|
2374
|
+
} catch (n) {
|
|
2375
|
+
return console.log(n), "Invalid date";
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
function mi(t, e) {
|
|
2379
|
+
const n = t.config.map((s) => yi(s, t, e));
|
|
2380
|
+
return N("tr", { class: "widget-table__row widget-table-row" }, n);
|
|
2381
|
+
}
|
|
2382
|
+
function yi(t, e, n) {
|
|
2383
|
+
const s = e.values;
|
|
2384
|
+
let { name: r, value: i } = Z.getCellInfo(t, s);
|
|
2385
|
+
const a = {
|
|
2386
|
+
onClick: [],
|
|
2387
|
+
class: ["widget-table__cell widget-table-cell"]
|
|
2388
|
+
};
|
|
2389
|
+
function o(h) {
|
|
2390
|
+
a.onClick.push(() => h(s));
|
|
2391
|
+
}
|
|
2392
|
+
function c(h) {
|
|
2393
|
+
Array.isArray(h) ? a.class.push(...h) : a.class.push(h);
|
|
2394
|
+
}
|
|
2395
|
+
const p = [], f = [];
|
|
2396
|
+
if (t.hide && t.hide(s))
|
|
2397
|
+
return [N("td")];
|
|
2398
|
+
if (t.type)
|
|
2399
|
+
switch (c(`widget-table-cell_${t.type}`), t.type) {
|
|
2400
|
+
case "number": {
|
|
2401
|
+
typeof i == "number" && (i = new Intl.NumberFormat().format(i));
|
|
2402
|
+
break;
|
|
2403
|
+
}
|
|
2404
|
+
case "date": {
|
|
2405
|
+
i = mt(typeof i == "string" ? i : null);
|
|
2406
|
+
break;
|
|
2407
|
+
}
|
|
2408
|
+
case "dateTime":
|
|
2409
|
+
case "dateWithTime": {
|
|
2410
|
+
i = ln(typeof i == "string" ? i : null);
|
|
2411
|
+
break;
|
|
2412
|
+
}
|
|
2413
|
+
case "multi-select":
|
|
2414
|
+
f.push(N(ot, {
|
|
2415
|
+
type: "single-checkbox",
|
|
2416
|
+
modelValue: e.selected
|
|
2417
|
+
})), o(vi.bind(null, n, !0));
|
|
2418
|
+
}
|
|
2419
|
+
if (t.checked) {
|
|
2420
|
+
const h = t.checked(s);
|
|
2421
|
+
f.push(
|
|
2422
|
+
N(ot, {
|
|
2423
|
+
type: "single-checkbox",
|
|
2424
|
+
modelValue: h
|
|
2425
|
+
})
|
|
2426
|
+
);
|
|
2427
|
+
}
|
|
2428
|
+
if (t.onClick && o(t.onClick), t.link)
|
|
2429
|
+
try {
|
|
2430
|
+
const h = t.link(s);
|
|
2431
|
+
if (h) {
|
|
2432
|
+
const w = N(Gt, { to: h });
|
|
2433
|
+
f.push(w), c("list-cell-link");
|
|
2434
|
+
}
|
|
2435
|
+
} catch (h) {
|
|
2436
|
+
console.warn("Error handle: Add Router link to cell", h);
|
|
2437
|
+
}
|
|
2438
|
+
return t.href && (f.push(N("a", {
|
|
2439
|
+
href: t.href(s),
|
|
2440
|
+
target: "_blank"
|
|
2441
|
+
})), c("list-cell-link")), i != null && f.push(
|
|
2442
|
+
N("p", {
|
|
2443
|
+
class: "widget-list-cell-text"
|
|
2444
|
+
}, i)
|
|
2445
|
+
), t.icon && f.push(N(R, { name: t.icon })), t.class && (typeof t.class == "function" ? c(t.class(s)) : c(t.class)), p.push(N("td", a, f)), p;
|
|
2446
|
+
}
|
|
2447
|
+
function vi(t, e) {
|
|
2448
|
+
t.emit("select", e);
|
|
2449
|
+
}
|
|
2450
|
+
function cn(t, e) {
|
|
2451
|
+
return () => {
|
|
2452
|
+
try {
|
|
2453
|
+
return mi(t, e);
|
|
2454
|
+
} catch (n) {
|
|
2455
|
+
return console.warn(n), null;
|
|
2456
|
+
}
|
|
2457
|
+
};
|
|
2458
|
+
}
|
|
2459
|
+
const wi = {
|
|
2460
|
+
props: {
|
|
2461
|
+
values: Object,
|
|
2462
|
+
config: Object,
|
|
2463
|
+
selected: Boolean
|
|
2464
|
+
},
|
|
2465
|
+
setup: cn
|
|
2466
|
+
}, bi = ["colspan"], Ot = /* @__PURE__ */ $({
|
|
2467
|
+
__name: "widget-table-form",
|
|
2468
|
+
props: {
|
|
2469
|
+
rowLength: {},
|
|
2470
|
+
component: {},
|
|
2471
|
+
values: {}
|
|
2472
|
+
},
|
|
2473
|
+
emits: ["save", "remove", "close"],
|
|
2474
|
+
setup(t, { emit: e }) {
|
|
2475
|
+
const n = t, s = q(), r = V(() => !n.values && !Z.hasKey(n.values));
|
|
2476
|
+
return Ke(() => {
|
|
2477
|
+
setTimeout(() => {
|
|
2478
|
+
s.value && s.value.scrollIntoView({ block: "nearest", inline: "nearest", behavior: "smooth" });
|
|
2479
|
+
}, 250);
|
|
2480
|
+
}), (i, a) => (l(), u("tr", {
|
|
2481
|
+
class: "widget-table-form",
|
|
2482
|
+
ref_key: "refTableForm",
|
|
2483
|
+
ref: s
|
|
2484
|
+
}, [
|
|
2485
|
+
d("td", { colspan: i.rowLength }, [
|
|
2486
|
+
(l(), b(Ft(i.component), jt(i.$attrs, {
|
|
2487
|
+
values: i.values,
|
|
2488
|
+
new: r.value,
|
|
2489
|
+
onClose: a[0] || (a[0] = (o) => e("close")),
|
|
2490
|
+
onSave: a[1] || (a[1] = (o) => e("save", o))
|
|
2491
|
+
}), null, 16, ["values", "new"]))
|
|
2492
|
+
], 8, bi)
|
|
2493
|
+
], 512));
|
|
2494
|
+
}
|
|
2495
|
+
}), $i = { class: "widget-loader" }, Ei = /* @__PURE__ */ $({
|
|
2496
|
+
__name: "widget-loader",
|
|
2497
|
+
props: {
|
|
2498
|
+
color: {},
|
|
2499
|
+
label: {}
|
|
2500
|
+
},
|
|
2501
|
+
setup(t) {
|
|
2502
|
+
return (e, n) => (l(), u("div", $i, [
|
|
2503
|
+
C(he, { color: e.color }, null, 8, ["color"]),
|
|
2504
|
+
d("span", null, y(e.label), 1)
|
|
2505
|
+
]));
|
|
2506
|
+
}
|
|
2507
|
+
});
|
|
2508
|
+
const Ti = /* @__PURE__ */ m(Ei, [["__scopeId", "data-v-a01a837d"]]), Si = /* @__PURE__ */ $({
|
|
2509
|
+
__name: "widget-table",
|
|
2510
|
+
props: {
|
|
2511
|
+
array: {},
|
|
2512
|
+
config: {},
|
|
2513
|
+
mini: { type: Boolean },
|
|
2514
|
+
activeRow: {},
|
|
2515
|
+
selectRows: {},
|
|
2516
|
+
wait: { type: Boolean },
|
|
2517
|
+
classCallback: { type: Function }
|
|
2518
|
+
},
|
|
2519
|
+
emits: ["update:activeRow", "update:selectRows", "save", "read"],
|
|
2520
|
+
setup(t, { emit: e }) {
|
|
2521
|
+
const n = t, s = xt(), r = V(() => {
|
|
2522
|
+
var c;
|
|
2523
|
+
return (c = s == null ? void 0 : s.default) == null ? void 0 : c.call(s)[0];
|
|
2524
|
+
}), i = V(() => n.array.map((c) => ({
|
|
2525
|
+
values: c,
|
|
2526
|
+
hash: qt(c)
|
|
2527
|
+
})));
|
|
2528
|
+
function a(c, p = !0) {
|
|
2529
|
+
return n.selectRows ? p ? n.selectRows.indexOf(c) === -1 ? e("update:selectRows", [...n.selectRows, c]) : e("update:selectRows", n.selectRows.filter((h) => h !== c)) : e("update:selectRows", [c]) : void 0;
|
|
2530
|
+
}
|
|
2531
|
+
function o(c) {
|
|
2532
|
+
e("save", c), e("update:activeRow", null);
|
|
2533
|
+
}
|
|
2534
|
+
return (c, p) => (l(), u("div", null, [
|
|
2535
|
+
C(vn, { name: "move-horizontal" }, {
|
|
2536
|
+
default: fe(() => [
|
|
2537
|
+
c.wait ? (l(), b(Ti, {
|
|
2538
|
+
key: 0,
|
|
2539
|
+
label: "Loading data",
|
|
2540
|
+
color: "black",
|
|
2541
|
+
class: "widget-table-loader"
|
|
2542
|
+
})) : _("", !0)
|
|
2543
|
+
]),
|
|
2544
|
+
_: 1
|
|
2545
|
+
}),
|
|
2546
|
+
d("table", {
|
|
2547
|
+
class: I(["widget-table", { "widget-table_mini": c.mini }])
|
|
2548
|
+
}, [
|
|
2549
|
+
C(gi, { config: c.config }, null, 8, ["config"]),
|
|
2550
|
+
d("tbody", null, [
|
|
2551
|
+
(l(!0), u(O, null, M(i.value, ({ values: f, hash: h }, w) => {
|
|
2552
|
+
var T;
|
|
2553
|
+
return l(), u(O, { key: w }, [
|
|
2554
|
+
C(wi, {
|
|
2555
|
+
config: c.config,
|
|
2556
|
+
values: f,
|
|
2557
|
+
selected: (T = c.selectRows) == null ? void 0 : T.includes(f),
|
|
2558
|
+
onSelect: (F) => a(f, F),
|
|
2559
|
+
class: I(c.classCallback ? c.classCallback(f) : "")
|
|
2560
|
+
}, null, 8, ["config", "values", "selected", "onSelect", "class"]),
|
|
2561
|
+
r.value && c.activeRow === h ? (l(), b(Ot, {
|
|
2562
|
+
key: 0,
|
|
2563
|
+
component: r.value,
|
|
2564
|
+
"row-length": c.config.length,
|
|
2565
|
+
values: f,
|
|
2566
|
+
onClose: p[0] || (p[0] = (F) => e("update:activeRow", null)),
|
|
2567
|
+
onSave: o,
|
|
2568
|
+
onRead: p[1] || (p[1] = (F) => e("read"))
|
|
2569
|
+
}, null, 8, ["component", "row-length", "values"])) : _("", !0)
|
|
2570
|
+
], 64);
|
|
2571
|
+
}), 128)),
|
|
2572
|
+
c.activeRow === 0 ? (l(), b(Ot, {
|
|
2573
|
+
key: 0,
|
|
2574
|
+
component: r.value,
|
|
2575
|
+
"row-length": c.config.length,
|
|
2576
|
+
onClose: p[2] || (p[2] = (f) => e("update:activeRow", null)),
|
|
2577
|
+
onSave: o,
|
|
2578
|
+
onRead: p[3] || (p[3] = (f) => e("read"))
|
|
2579
|
+
}, null, 8, ["component", "row-length"])) : _("", !0)
|
|
2580
|
+
])
|
|
2581
|
+
], 2)
|
|
2582
|
+
]));
|
|
2583
|
+
}
|
|
2584
|
+
});
|
|
2585
|
+
const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2586
|
+
__proto__: null,
|
|
2587
|
+
List: Z,
|
|
2588
|
+
Table: ci,
|
|
2589
|
+
WidgetTable: Si,
|
|
2590
|
+
useListOrder: li,
|
|
2591
|
+
useListProvide: oi,
|
|
2592
|
+
useListRead: ii,
|
|
2593
|
+
useListState: ai,
|
|
2594
|
+
useTableActiveRow: di
|
|
2595
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2596
|
+
class Ci extends H {
|
|
2597
|
+
constructor() {
|
|
2598
|
+
super(), this.EVENT_NEW = "event:new-metadata", this.store = {};
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* @description Возвращает объект для работы с метаданными
|
|
2602
|
+
* */
|
|
2603
|
+
get(e) {
|
|
2604
|
+
return this.store[e];
|
|
2605
|
+
}
|
|
2606
|
+
/**
|
|
2607
|
+
* @description Метод используется для загрузки метаданных. Если метаданные для сущности уже были полученные, вызываться
|
|
2608
|
+
* перечитывание не будет.
|
|
2609
|
+
* */
|
|
2610
|
+
async load(e) {
|
|
2611
|
+
return this.store[e] || this.set(e, await this.loadEntityInformation(e)), this.store[e];
|
|
2612
|
+
}
|
|
2613
|
+
set(e, n) {
|
|
2614
|
+
this.store[e] = n, this.emit(this.EVENT_NEW, {
|
|
2615
|
+
entityName: e
|
|
2616
|
+
});
|
|
2617
|
+
}
|
|
2618
|
+
async loadEntityInformation(e) {
|
|
2619
|
+
return await pn.get(e);
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
const De = new Ci();
|
|
2623
|
+
function wo(t) {
|
|
2624
|
+
const e = q(De.get(t));
|
|
2625
|
+
return De.on(De.EVENT_NEW, (n) => {
|
|
2626
|
+
t === n.entityName && (e.value = De.get(t));
|
|
2627
|
+
}), e;
|
|
2628
|
+
}
|
|
2629
|
+
function bo(t, e) {
|
|
2630
|
+
return e.dataType === "DateTime" && typeof t == "string" ? new Date(t).toLocaleString() : t;
|
|
2631
|
+
}
|
|
2632
|
+
class $o {
|
|
2633
|
+
/**
|
|
2634
|
+
* @description Загрузка словаря для определённого языка.
|
|
2635
|
+
* */
|
|
2636
|
+
static getDictionary(e) {
|
|
2637
|
+
if (!e)
|
|
2638
|
+
throw new Error(`Can't get dictionary for ${e}.`);
|
|
2639
|
+
return g(`/open-api/internationalization/language/${e}`);
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
let ae = {};
|
|
2643
|
+
function Ie(t) {
|
|
2644
|
+
if (typeof t != "string")
|
|
2645
|
+
return console.trace(`Label is not provided for translation: ${t}`), "undefined";
|
|
2646
|
+
const e = oe.getPropFromObject((this == null ? void 0 : this.vocabulary) || ae, t);
|
|
2647
|
+
if (typeof e == "string")
|
|
2648
|
+
return e;
|
|
2649
|
+
const n = oe.getPropFromObject(ae == null ? void 0 : ae.root, t);
|
|
2650
|
+
return typeof n == "string" ? n : (typeof e === void 0 && console.warn(`Translation for label "${t}" is not founded.`), t);
|
|
2651
|
+
}
|
|
2652
|
+
Ie.setGlobalVocabulary = function(t) {
|
|
2653
|
+
ae = t;
|
|
2654
|
+
};
|
|
2655
|
+
Ie.getScope = function(t) {
|
|
2656
|
+
return Ie.bind({
|
|
2657
|
+
vocabulary: oe.getPropFromObject(ae, t)
|
|
2658
|
+
});
|
|
2659
|
+
};
|
|
2660
|
+
Ie.setVocabulary = function(t) {
|
|
2661
|
+
return typeof t == "string" && (t = oe.getPropFromObject(ae, t)), Ie.bind({
|
|
2662
|
+
vocabulary: t
|
|
2663
|
+
});
|
|
2664
|
+
};
|
|
2665
|
+
function Eo(t = "default") {
|
|
2666
|
+
if (ct.manager)
|
|
2667
|
+
return ct.manager.socket(`/${t}`);
|
|
2668
|
+
}
|
|
2669
|
+
class ct {
|
|
2670
|
+
}
|
|
2671
|
+
function To(t = window.location.origin + "/socket.io") {
|
|
2672
|
+
ct.manager = new $n(t, {
|
|
2673
|
+
reconnectionDelayMax: 1e3,
|
|
2674
|
+
withCredentials: !0,
|
|
2675
|
+
transports: ["websocket", "polling"]
|
|
2676
|
+
});
|
|
2677
|
+
}
|
|
2678
|
+
const Ii = { class: "breadcrumb__title" }, Ai = /* @__PURE__ */ $({
|
|
2679
|
+
__name: "widget-breadcrumb-item",
|
|
2680
|
+
props: {
|
|
2681
|
+
active: { type: Boolean },
|
|
2682
|
+
title: {},
|
|
2683
|
+
link: {}
|
|
2684
|
+
},
|
|
2685
|
+
setup(t) {
|
|
2686
|
+
return (e, n) => (l(), u("div", {
|
|
2687
|
+
class: I(["breadcrumb flex", { breadcrumb_active: e.active }])
|
|
2688
|
+
}, [
|
|
2689
|
+
d("p", Ii, y(e.title), 1),
|
|
2690
|
+
e.active ? _("", !0) : (l(), b(R, {
|
|
2691
|
+
key: 0,
|
|
2692
|
+
class: "breadcrumb__icon",
|
|
2693
|
+
name: "caret-right"
|
|
2694
|
+
}))
|
|
2695
|
+
], 2));
|
|
2696
|
+
}
|
|
2697
|
+
});
|
|
2698
|
+
const ki = /* @__PURE__ */ m(Ai, [["__scopeId", "data-v-1702aee0"]]), Ni = { class: "widget-breadcrumbs" }, Pi = /* @__PURE__ */ $({
|
|
2699
|
+
__name: "widget-breadcrumbs",
|
|
2700
|
+
props: {
|
|
2701
|
+
array: {}
|
|
2702
|
+
},
|
|
2703
|
+
setup(t) {
|
|
2704
|
+
return (e, n) => (l(), u("div", Ni, [
|
|
2705
|
+
(l(!0), u(O, null, M(e.array, (s, r) => (l(), b(ki, {
|
|
2706
|
+
key: r,
|
|
2707
|
+
title: s.title,
|
|
2708
|
+
link: s.link,
|
|
2709
|
+
active: r === e.array.length - 1
|
|
2710
|
+
}, null, 8, ["title", "link", "active"]))), 128))
|
|
2711
|
+
]));
|
|
2712
|
+
}
|
|
2713
|
+
});
|
|
2714
|
+
const So = /* @__PURE__ */ m(Pi, [["__scopeId", "data-v-1dfb2668"]]), Oi = {
|
|
2715
|
+
props: {
|
|
2716
|
+
config: Array,
|
|
2717
|
+
values: Object,
|
|
2718
|
+
selected: Boolean
|
|
2719
|
+
},
|
|
2720
|
+
setup: cn
|
|
2721
|
+
};
|
|
2722
|
+
const Ri = /* @__PURE__ */ m(Oi, [["__scopeId", "data-v-47478206"]]), Vi = (t) => (Lt("data-v-7106cb6a"), t = t(), Wt(), t), Li = { class: "head-cell" }, Wi = /* @__PURE__ */ Vi(() => /* @__PURE__ */ d("div", { class: "head-cell-resize" }, null, -1)), Di = /* @__PURE__ */ $({
|
|
2723
|
+
__name: "widget-list-head-cell",
|
|
2724
|
+
props: {
|
|
2725
|
+
title: {},
|
|
2726
|
+
label: {},
|
|
2727
|
+
name: {},
|
|
2728
|
+
type: {},
|
|
2729
|
+
minWidth: {},
|
|
2730
|
+
maxWidth: {},
|
|
2731
|
+
width: {},
|
|
2732
|
+
order: {}
|
|
2733
|
+
},
|
|
2734
|
+
emits: ["select", "order"],
|
|
2735
|
+
setup(t, { emit: e }) {
|
|
2736
|
+
const n = t;
|
|
2737
|
+
return n.title && console.warn(`For cell ${n.name} using title,it should be replaced with label.`), (s, r) => (l(), u("th", null, [
|
|
2738
|
+
d("div", Li, [
|
|
2739
|
+
d("div", {
|
|
2740
|
+
class: "head-cell-content flex_grow",
|
|
2741
|
+
style: ut({ "min-width": s.minWidth, "max-width": s.maxWidth, width: s.width })
|
|
2742
|
+
}, [
|
|
2743
|
+
s.type === "multi-select" ? (l(), b(P(ot), {
|
|
2744
|
+
key: 0,
|
|
2745
|
+
type: "single-checkbox",
|
|
2746
|
+
onClick: r[0] || (r[0] = (i) => e("select"))
|
|
2747
|
+
})) : (l(), u("p", {
|
|
2748
|
+
key: 1,
|
|
2749
|
+
class: "widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",
|
|
2750
|
+
onClick: r[1] || (r[1] = (i) => e("order"))
|
|
2751
|
+
}, y(s.title || s.label), 1))
|
|
2752
|
+
], 4),
|
|
2753
|
+
s.name && s.order.length && s.order[0] === s.name ? (l(), b(P(R), {
|
|
2754
|
+
key: 0,
|
|
2755
|
+
class: I(["head-cell-order", { "head-cell-order_down": s.order.length > 1 && s.order[1] === "desc" }])
|
|
2756
|
+
}, {
|
|
2757
|
+
default: fe(() => [
|
|
2758
|
+
Ae("core-arrow-up")
|
|
2759
|
+
]),
|
|
2760
|
+
_: 1
|
|
2761
|
+
}, 8, ["class"])) : _("", !0),
|
|
2762
|
+
Wi
|
|
2763
|
+
])
|
|
2764
|
+
]));
|
|
2765
|
+
}
|
|
2766
|
+
});
|
|
2767
|
+
const Mi = /* @__PURE__ */ m(Di, [["__scopeId", "data-v-7106cb6a"]]), Fi = /* @__PURE__ */ $({
|
|
2768
|
+
__name: "widget-list-head",
|
|
2769
|
+
setup(t) {
|
|
2770
|
+
const e = Se("config", {
|
|
2771
|
+
required: !0
|
|
2772
|
+
}), n = Se("order", {
|
|
2773
|
+
required: !0,
|
|
2774
|
+
default: () => []
|
|
2775
|
+
}), s = q(), r = q();
|
|
2776
|
+
Ke(() => {
|
|
2777
|
+
function a(h, w) {
|
|
2778
|
+
let T = -1;
|
|
2779
|
+
do
|
|
2780
|
+
T++, w -= h[T];
|
|
2781
|
+
while (w > 0 && T < h.length);
|
|
2782
|
+
return T;
|
|
2783
|
+
}
|
|
2784
|
+
function o(h, w) {
|
|
2785
|
+
let T = 0;
|
|
2786
|
+
for (; w > 0 && w > h[T] && T < h.length; )
|
|
2787
|
+
w -= h[T], T++;
|
|
2788
|
+
return console.log(w, T), T > 0 ? T : 0;
|
|
2789
|
+
}
|
|
2790
|
+
function c(h) {
|
|
2791
|
+
try {
|
|
2792
|
+
r.value.style.insetInlineStart = h + "px";
|
|
2793
|
+
} catch (w) {
|
|
2794
|
+
console.log(w);
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
function p(h) {
|
|
2798
|
+
try {
|
|
2799
|
+
r.value.style.width = h + "px", r.value.style.minWidth = h + "px", r.value.style.maxWidth = h + "px";
|
|
2800
|
+
} catch (w) {
|
|
2801
|
+
console.log(w);
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
function f(h) {
|
|
2805
|
+
return h === null ? !1 : h.classList.contains("head-cell-resize");
|
|
2806
|
+
}
|
|
2807
|
+
s.value.addEventListener("pointerdown", function(w) {
|
|
2808
|
+
var Et;
|
|
2809
|
+
function T(G) {
|
|
2810
|
+
return G.screenX + ue - ne;
|
|
2811
|
+
}
|
|
2812
|
+
const F = s.value, _e = [...F.children].filter((G) => G.localName === "th"), ue = ((Et = F.offsetParent) == null ? void 0 : Et.scrollLeft) || 0, v = _e.map((G) => G.clientWidth), L = f(w.target), ne = F.getBoundingClientRect().left, de = T(w), k = a(v, de), vt = v.slice(0, k).reduce((G, X) => G + X, 0), wt = de - vt, tt = F.offsetWidth, ge = _e[k].clientWidth;
|
|
2813
|
+
console.group("START"), console.log(), console.log("Start screenX", w.screenX), console.log("Widths", v), console.log("max width", tt), console.log("Start Position", de), console.log("Position From", k), console.log("Start Position", k), console.log("Global offset (Отступ самой таблицы от края экрана)", ne), console.log("Del", wt), console.groupEnd(), r.value.innerText = _e[k].textContent || "", r.value.style.display = "grid", r.value.style.width = ge + "px", r.value.style.cursor = "grabbing", c(vt), p(ge), document.addEventListener("pointermove", $t, { passive: !0 }), document.addEventListener("pointerup", bt);
|
|
2814
|
+
function bt(G) {
|
|
2815
|
+
if (console.group("END"), document.removeEventListener("pointermove", $t), document.removeEventListener("pointerup", bt), L && (e.value[k].width = r.value.style.width, e.value[k].minWidth = r.value.style.width, e.value[k].maxWidth = r.value.style.width), !L) {
|
|
2816
|
+
const X = G.screenX + ue - ne;
|
|
2817
|
+
console.log("ENP Position", X);
|
|
2818
|
+
const Re = o(v, X);
|
|
2819
|
+
if (console.log(k, "->", Re), Re !== k) {
|
|
2820
|
+
const me = e.value[k];
|
|
2821
|
+
e.value.splice(k, 1), e.value.splice(Re, 0, me);
|
|
2822
|
+
} else {
|
|
2823
|
+
const me = e.value[k].name;
|
|
2824
|
+
i(me);
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
r.value.style.display = "none", document.body.style.cursor = "unset", console.groupEnd();
|
|
2828
|
+
}
|
|
2829
|
+
function $t(G) {
|
|
2830
|
+
if (L) {
|
|
2831
|
+
const me = T(G) - de + ge;
|
|
2832
|
+
p(me);
|
|
2833
|
+
return;
|
|
2834
|
+
}
|
|
2835
|
+
let X = G.screenX + ue - ne - wt;
|
|
2836
|
+
X < 0 && (X = 0), X + ge > tt && (X = tt - ge), c(X);
|
|
2837
|
+
}
|
|
2838
|
+
});
|
|
2839
|
+
});
|
|
2840
|
+
function i(a) {
|
|
2841
|
+
if (!a)
|
|
2842
|
+
return;
|
|
2843
|
+
if (Array.isArray(a)) {
|
|
2844
|
+
if (a.length < 1)
|
|
2845
|
+
return;
|
|
2846
|
+
a = a[0];
|
|
2847
|
+
}
|
|
2848
|
+
if (n.value.length === 0 || n.value[0] !== a) {
|
|
2849
|
+
n.value = [a];
|
|
2850
|
+
return;
|
|
2851
|
+
}
|
|
2852
|
+
const o = n.value.length === 1 || n.value[1] === "asc" ? "asc" : "desc";
|
|
2853
|
+
n.value = [a, o === "asc" ? "desc" : "asc"];
|
|
2854
|
+
}
|
|
2855
|
+
return (a, o) => (l(), u("tr", {
|
|
2856
|
+
class: "widget-list-head",
|
|
2857
|
+
ref_key: "refHead",
|
|
2858
|
+
ref: s
|
|
2859
|
+
}, [
|
|
2860
|
+
(l(!0), u(O, null, M(e.value, (c, p) => (l(), b(Mi, jt({ key: c }, c, {
|
|
2861
|
+
onOrder: (f) => i(c.name),
|
|
2862
|
+
order: n.value
|
|
2863
|
+
}), null, 16, ["onOrder", "order"]))), 128)),
|
|
2864
|
+
d("div", {
|
|
2865
|
+
class: "test-block text_md",
|
|
2866
|
+
ref_key: "refDisplayPosition",
|
|
2867
|
+
ref: r
|
|
2868
|
+
}, "test", 512)
|
|
2869
|
+
], 512));
|
|
2870
|
+
}
|
|
2871
|
+
});
|
|
2872
|
+
const ji = /* @__PURE__ */ m(Fi, [["__scopeId", "data-v-1a4b03e9"]]), xi = 50, Ui = /* @__PURE__ */ $({
|
|
2873
|
+
__name: "widget-list",
|
|
2874
|
+
props: {
|
|
2875
|
+
array: {},
|
|
2876
|
+
wait: { type: Boolean }
|
|
2877
|
+
},
|
|
2878
|
+
emits: ["scrollEnd"],
|
|
2879
|
+
setup(t, { emit: e }) {
|
|
2880
|
+
const n = t, s = Se("config"), r = Se("selectRows"), i = Se("order");
|
|
2881
|
+
function a(p, f = !0) {
|
|
2882
|
+
var h;
|
|
2883
|
+
if (r.value)
|
|
2884
|
+
if (!f)
|
|
2885
|
+
r.value = [p];
|
|
2886
|
+
else {
|
|
2887
|
+
const w = r.value.indexOf(p);
|
|
2888
|
+
w === -1 ? r.value.push(p) : (h = r.value) == null || h.splice(w, 1);
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
function o() {
|
|
2892
|
+
var p;
|
|
2893
|
+
if (((p = r.value) == null ? void 0 : p.length) !== n.array.length)
|
|
2894
|
+
return r.value = n.array;
|
|
2895
|
+
r.value = [];
|
|
2896
|
+
}
|
|
2897
|
+
function c(p) {
|
|
2898
|
+
if (!p)
|
|
2899
|
+
return;
|
|
2900
|
+
const f = p.target;
|
|
2901
|
+
f.scrollTop + f.clientHeight + xi > f.scrollHeight && e("scrollEnd");
|
|
2902
|
+
}
|
|
2903
|
+
return (p, f) => (l(), u("div", {
|
|
2904
|
+
class: "es-list-container",
|
|
2905
|
+
onScrollPassive: c
|
|
2906
|
+
}, [
|
|
2907
|
+
d("table", {
|
|
2908
|
+
class: I(["widget-list", { "widget-list_load": p.wait }])
|
|
2909
|
+
}, [
|
|
2910
|
+
d("thead", null, [
|
|
2911
|
+
C(ji, {
|
|
2912
|
+
onSelect: f[0] || (f[0] = (h) => o()),
|
|
2913
|
+
config: s.value,
|
|
2914
|
+
"onUpdate:config": f[1] || (f[1] = (h) => s.value = h),
|
|
2915
|
+
order: i.value,
|
|
2916
|
+
"onUpdate:order": f[2] || (f[2] = (h) => i.value = h)
|
|
2917
|
+
}, null, 8, ["config", "order"])
|
|
2918
|
+
]),
|
|
2919
|
+
d("tbody", {
|
|
2920
|
+
class: I(["widget-list-body", { "widget-list-body_inactive": p.wait }])
|
|
2921
|
+
}, [
|
|
2922
|
+
(l(!0), u(O, null, M(p.array, (h, w) => {
|
|
2923
|
+
var T;
|
|
2924
|
+
return l(), b(Ri, {
|
|
2925
|
+
key: w,
|
|
2926
|
+
class: "widget-list-row",
|
|
2927
|
+
values: h,
|
|
2928
|
+
config: s.value,
|
|
2929
|
+
selected: (T = r.value) == null ? void 0 : T.includes(h),
|
|
2930
|
+
onSelect: (F) => a(h, F)
|
|
2931
|
+
}, null, 8, ["values", "config", "selected", "onSelect"]);
|
|
2932
|
+
}), 128))
|
|
2933
|
+
], 2)
|
|
2934
|
+
], 2)
|
|
2935
|
+
], 32));
|
|
2936
|
+
}
|
|
2937
|
+
});
|
|
2938
|
+
const Co = /* @__PURE__ */ m(Ui, [["__scopeId", "data-v-5526b1ce"]]), Bi = { class: "widget-section" }, qi = { class: "widget-section__header" }, Gi = { class: "widget-section-title" }, zi = { class: "widget-section__body" }, Hi = /* @__PURE__ */ $({
|
|
2939
|
+
__name: "widget-section",
|
|
2940
|
+
props: {
|
|
2941
|
+
title: {}
|
|
2942
|
+
},
|
|
2943
|
+
setup(t) {
|
|
2944
|
+
return (e, n) => (l(), u("div", Bi, [
|
|
2945
|
+
d("div", qi, [
|
|
2946
|
+
d("p", Gi, y(e.title), 1)
|
|
2947
|
+
]),
|
|
2948
|
+
d("div", zi, [
|
|
2949
|
+
U(e.$slots, "default", {}, void 0, !0)
|
|
2950
|
+
])
|
|
2951
|
+
]));
|
|
2952
|
+
}
|
|
2953
|
+
});
|
|
2954
|
+
const Io = /* @__PURE__ */ m(Hi, [["__scopeId", "data-v-07232553"]]);
|
|
2955
|
+
const Ji = {
|
|
2956
|
+
props: {
|
|
2957
|
+
config: Array
|
|
2958
|
+
},
|
|
2959
|
+
name: "WidgetTableHead"
|
|
2960
|
+
}, Ki = { class: "widget-table__head" }, Yi = { class: "widget-table__head-title" };
|
|
2961
|
+
function Xi(t, e, n, s, r, i) {
|
|
2962
|
+
return l(), u("tr", Ki, [
|
|
2963
|
+
(l(!0), u(O, null, M(n.config, (a, o) => (l(), u("th", {
|
|
2964
|
+
class: "widget-table__head-cell",
|
|
2965
|
+
key: o
|
|
2966
|
+
}, [
|
|
2967
|
+
d("p", Yi, y(a.title), 1)
|
|
2968
|
+
]))), 128))
|
|
2969
|
+
]);
|
|
2970
|
+
}
|
|
2971
|
+
const Zi = /* @__PURE__ */ m(Ji, [["render", Xi], ["__scopeId", "data-v-cae93640"]]);
|
|
2972
|
+
function Qi(t, e, n) {
|
|
2973
|
+
const s = t.map((r) => ea(r, e, n));
|
|
2974
|
+
return N("tr", { class: "widget-table__row widget-table-row" }, s);
|
|
2975
|
+
}
|
|
2976
|
+
function ea(t, e, n) {
|
|
2977
|
+
const { name: s, value: r } = Z.getCellInfo(t, e), i = {
|
|
2978
|
+
onClick: [],
|
|
2979
|
+
class: ["widget-table__cell widget-table-cell"]
|
|
2980
|
+
};
|
|
2981
|
+
function a(f) {
|
|
2982
|
+
i.onClick.push(() => f(r, e));
|
|
2983
|
+
}
|
|
2984
|
+
function o(f) {
|
|
2985
|
+
Array.isArray(f) ? i.class.push(...f) : i.class.push(f);
|
|
2986
|
+
}
|
|
2987
|
+
const c = [], p = [];
|
|
2988
|
+
if (t.type)
|
|
2989
|
+
switch (o(`widget-table-cell_${t.type}`), t.type) {
|
|
2990
|
+
case "edit": {
|
|
2991
|
+
t.icon = "edit", a(n.activate);
|
|
2992
|
+
break;
|
|
2993
|
+
}
|
|
2994
|
+
case "remove": {
|
|
2995
|
+
a(n.removeRow), t.icon = "remove";
|
|
2996
|
+
break;
|
|
2997
|
+
}
|
|
2998
|
+
case "select-multi": {
|
|
2999
|
+
a(n.select.bind(n, !0)), o("widget-table-cell_use"), o("widget-table-cell_select"), p.push(N("div", { class: {
|
|
3000
|
+
"table-cell-toggle": !0,
|
|
3001
|
+
// @ts-ignore
|
|
3002
|
+
"table-cell-toggle_active": n.selected.value
|
|
3003
|
+
} }));
|
|
3004
|
+
break;
|
|
3005
|
+
}
|
|
3006
|
+
case "select": {
|
|
3007
|
+
a(n.select.bind(n, !1)), o("widget-table-cell_use"), o("widget-table-cell_select"), p.push(N("div", { class: {
|
|
3008
|
+
"table-cell-toggle": !0,
|
|
3009
|
+
// @ts-ignore
|
|
3010
|
+
"table-cell-toggle_active": n.selected.value
|
|
3011
|
+
} }));
|
|
3012
|
+
break;
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
return t.onClick && a(t.onClick), t.link && (p.push(N(Gt, {
|
|
3016
|
+
to: t.link(r, e)
|
|
3017
|
+
})), o("list-cell-link")), t.href && (p.push(N("a", {
|
|
3018
|
+
href: t.href(r, e),
|
|
3019
|
+
target: "_blank"
|
|
3020
|
+
})), o("list-cell-link")), r && p.push(N("p", {}, r)), t.icon && p.push(N(R, { name: t.icon })), t.class && o(t.class), c.push(N("td", i, p)), c;
|
|
3021
|
+
}
|
|
3022
|
+
const ta = {
|
|
3023
|
+
props: {
|
|
3024
|
+
values: Object,
|
|
3025
|
+
config: Object,
|
|
3026
|
+
selected: zt
|
|
3027
|
+
},
|
|
3028
|
+
emits: ["set", "remove", "select"],
|
|
3029
|
+
setup(t, e) {
|
|
3030
|
+
const { emit: n } = e, s = {
|
|
3031
|
+
activate() {
|
|
3032
|
+
n("set", t.values[W]);
|
|
3033
|
+
},
|
|
3034
|
+
deactivate() {
|
|
3035
|
+
n("set", null);
|
|
3036
|
+
},
|
|
3037
|
+
removeRow() {
|
|
3038
|
+
n("remove");
|
|
3039
|
+
},
|
|
3040
|
+
selected: V(() => t.selected),
|
|
3041
|
+
select(r = !1) {
|
|
3042
|
+
n("select", r);
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
return () => Qi(t.config, t.values, s);
|
|
3046
|
+
}
|
|
3047
|
+
}, na = { class: "widget-table-form" }, sa = ["colspan"], Rt = /* @__PURE__ */ $({
|
|
3048
|
+
__name: "widget-table-form",
|
|
3049
|
+
props: {
|
|
3050
|
+
rowLength: {},
|
|
3051
|
+
component: {},
|
|
3052
|
+
values: {},
|
|
3053
|
+
controller: {}
|
|
3054
|
+
},
|
|
3055
|
+
setup(t) {
|
|
3056
|
+
const e = t, n = V(() => {
|
|
3057
|
+
var a;
|
|
3058
|
+
return !((a = e.values) != null && a[W]);
|
|
3059
|
+
}), s = dt(et.PROVIDE_NAME);
|
|
3060
|
+
function r(a) {
|
|
3061
|
+
s && (n.value ? s.create(a) : s.edit(e.values[W], a));
|
|
3062
|
+
}
|
|
3063
|
+
function i() {
|
|
3064
|
+
e.controller.deactivate();
|
|
3065
|
+
}
|
|
3066
|
+
return (a, o) => (l(), u("tr", na, [
|
|
3067
|
+
d("td", { colspan: a.rowLength }, [
|
|
3068
|
+
(l(), b(Ft(a.component), {
|
|
3069
|
+
values: a.values,
|
|
3070
|
+
"table-controller": a.controller,
|
|
3071
|
+
onSave: r,
|
|
3072
|
+
onClose: i,
|
|
3073
|
+
new: n.value
|
|
3074
|
+
}, null, 40, ["values", "table-controller", "new"]))
|
|
3075
|
+
], 8, sa)
|
|
3076
|
+
]));
|
|
3077
|
+
}
|
|
3078
|
+
}), Ao = /* @__PURE__ */ $({
|
|
3079
|
+
__name: "widget-table",
|
|
3080
|
+
props: {
|
|
3081
|
+
array: {},
|
|
3082
|
+
config: {},
|
|
3083
|
+
mini: { type: Boolean },
|
|
3084
|
+
activeRow: {},
|
|
3085
|
+
selectRows: {}
|
|
3086
|
+
},
|
|
3087
|
+
emits: ["update:activeRow", "update:selectRows"],
|
|
3088
|
+
setup(t, { emit: e }) {
|
|
3089
|
+
const n = t;
|
|
3090
|
+
dt(et.PROVIDE_NAME);
|
|
3091
|
+
const s = xt(), r = V(() => {
|
|
3092
|
+
var o;
|
|
3093
|
+
return (o = s == null ? void 0 : s.default) == null ? void 0 : o.call(s)[0];
|
|
3094
|
+
});
|
|
3095
|
+
function i(o, c = !0) {
|
|
3096
|
+
return n.selectRows ? c ? n.selectRows.indexOf(o) === -1 ? e("update:selectRows", [...n.selectRows, o]) : e("update:selectRows", n.selectRows.filter((f) => f !== o)) : e("update:selectRows", [o]) : void 0;
|
|
3097
|
+
}
|
|
3098
|
+
const a = ri((o) => e("update:activeRow", o));
|
|
3099
|
+
return (o, c) => (l(), u("table", {
|
|
3100
|
+
class: I(["widget-table", { "widget-table_mini": o.mini }])
|
|
3101
|
+
}, [
|
|
3102
|
+
C(Zi, { config: o.config }, null, 8, ["config"]),
|
|
3103
|
+
d("tbody", null, [
|
|
3104
|
+
(l(!0), u(O, null, M(o.array, (p, f) => {
|
|
3105
|
+
var h;
|
|
3106
|
+
return l(), u(O, { key: f }, [
|
|
3107
|
+
C(ta, {
|
|
3108
|
+
config: o.config,
|
|
3109
|
+
values: p,
|
|
3110
|
+
selected: (h = o.selectRows) == null ? void 0 : h.includes(p[P(W)]),
|
|
3111
|
+
onSet: c[0] || (c[0] = (w) => e("update:activeRow", w)),
|
|
3112
|
+
onSelect: (w) => i(p[P(W)], w)
|
|
3113
|
+
}, null, 8, ["config", "values", "selected", "onSelect"]),
|
|
3114
|
+
o.activeRow === p[P(W)] ? (l(), b(Rt, {
|
|
3115
|
+
key: 0,
|
|
3116
|
+
component: r.value,
|
|
3117
|
+
controller: P(a)(p[P(W)]),
|
|
3118
|
+
"row-length": o.config.length,
|
|
3119
|
+
values: p
|
|
3120
|
+
}, null, 8, ["component", "controller", "row-length", "values"])) : _("", !0)
|
|
3121
|
+
], 64);
|
|
3122
|
+
}), 128)),
|
|
3123
|
+
o.activeRow === 0 ? (l(), b(Rt, {
|
|
3124
|
+
key: 0,
|
|
3125
|
+
component: r.value,
|
|
3126
|
+
controller: P(a)(0),
|
|
3127
|
+
"row-length": o.config.length
|
|
3128
|
+
}, null, 8, ["component", "controller", "row-length"])) : _("", !0)
|
|
3129
|
+
])
|
|
3130
|
+
], 2));
|
|
3131
|
+
}
|
|
3132
|
+
}), ra = { class: "widget-form-info flex" }, ia = { class: "form-titles" }, aa = { class: "form-title margin-0" }, oa = { class: "form-info text_size_md margin-0" }, la = {
|
|
3133
|
+
key: 0,
|
|
3134
|
+
class: "form-container-label"
|
|
3135
|
+
}, ca = { class: "form-label__title text_size_sm" }, ua = /* @__PURE__ */ $({
|
|
3136
|
+
__name: "WidgetFormInfo",
|
|
3137
|
+
props: {
|
|
3138
|
+
title: {},
|
|
3139
|
+
info: {},
|
|
3140
|
+
label: {}
|
|
3141
|
+
},
|
|
3142
|
+
setup(t) {
|
|
3143
|
+
return (e, n) => (l(), u("div", ra, [
|
|
3144
|
+
d("div", ia, [
|
|
3145
|
+
d("p", aa, y(e.title), 1),
|
|
3146
|
+
d("p", oa, y(e.info), 1)
|
|
3147
|
+
]),
|
|
3148
|
+
e.label ? (l(), u("div", la, [
|
|
3149
|
+
d("div", {
|
|
3150
|
+
class: I(["form-label", `form-label_${e.label.type}`])
|
|
3151
|
+
}, [
|
|
3152
|
+
e.label.icon ? (l(), b(R, {
|
|
3153
|
+
key: 0,
|
|
3154
|
+
class: "form-label__icon",
|
|
3155
|
+
name: e.label.icon
|
|
3156
|
+
}, null, 8, ["name"])) : _("", !0),
|
|
3157
|
+
d("p", ca, y(e.label.title), 1)
|
|
3158
|
+
], 2)
|
|
3159
|
+
])) : _("", !0)
|
|
3160
|
+
]));
|
|
3161
|
+
}
|
|
3162
|
+
});
|
|
3163
|
+
const da = /* @__PURE__ */ m(ua, [["__scopeId", "data-v-6ea1062c"]]), pa = { class: "wrap__widget-form" }, fa = { class: "widget-form" }, ha = { class: "widget-form__head" }, _a = { class: "head-image" }, ga = { key: 1 }, ma = { class: "widget-form__body" }, ya = /* @__PURE__ */ $({
|
|
3164
|
+
__name: "WidgetForm",
|
|
3165
|
+
props: {
|
|
3166
|
+
title: {},
|
|
3167
|
+
info: {},
|
|
3168
|
+
image: {},
|
|
3169
|
+
icon: {},
|
|
3170
|
+
label: {},
|
|
3171
|
+
button: {},
|
|
3172
|
+
wait: { type: Boolean }
|
|
3173
|
+
},
|
|
3174
|
+
setup(t) {
|
|
3175
|
+
return (e, n) => (l(), u("div", pa, [
|
|
3176
|
+
d("div", fa, [
|
|
3177
|
+
d("div", ha, [
|
|
3178
|
+
d("div", _a, [
|
|
3179
|
+
e.wait ? (l(), b(he, {
|
|
3180
|
+
key: 0,
|
|
3181
|
+
color: "#3949AB"
|
|
3182
|
+
})) : (l(), u("div", ga, [
|
|
3183
|
+
e.icon ? (l(), b(R, {
|
|
3184
|
+
key: 0,
|
|
3185
|
+
class: "form-image",
|
|
3186
|
+
name: e.icon
|
|
3187
|
+
}, null, 8, ["name"])) : _("", !0)
|
|
3188
|
+
]))
|
|
3189
|
+
]),
|
|
3190
|
+
C(da, {
|
|
3191
|
+
title: e.title,
|
|
3192
|
+
info: e.info,
|
|
3193
|
+
label: e.label
|
|
3194
|
+
}, null, 8, ["title", "info", "label"]),
|
|
3195
|
+
e.button && e.button.length ? (l(), b(Ht, {
|
|
3196
|
+
key: 0,
|
|
3197
|
+
class: "widget-form__button",
|
|
3198
|
+
array: e.button
|
|
3199
|
+
}, null, 8, ["array"])) : _("", !0)
|
|
3200
|
+
]),
|
|
3201
|
+
d("div", ma, [
|
|
3202
|
+
U(e.$slots, "default", {}, void 0, !0)
|
|
3203
|
+
])
|
|
3204
|
+
])
|
|
3205
|
+
]));
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3208
|
+
const ko = /* @__PURE__ */ m(ya, [["__scopeId", "data-v-3d88d93f"]]), va = { class: "validation-item-header" }, wa = { class: "validation-item__title text_bold margin-0" }, ba = { class: "validation-item-content" }, $a = { class: "text_bold text_md margin-0" }, Ea = { class: "text_md margin-0" }, Ta = /* @__PURE__ */ $({
|
|
3209
|
+
__name: "modal-validation-item",
|
|
3210
|
+
props: {
|
|
3211
|
+
message: {},
|
|
3212
|
+
status: {},
|
|
3213
|
+
statusName: {},
|
|
3214
|
+
title: {},
|
|
3215
|
+
name: {}
|
|
3216
|
+
},
|
|
3217
|
+
setup(t) {
|
|
3218
|
+
return (e, n) => (l(), u("div", {
|
|
3219
|
+
class: I(["validation-item", `validation-item_${e.statusName.toLowerCase()}`])
|
|
3220
|
+
}, [
|
|
3221
|
+
d("div", va, [
|
|
3222
|
+
d("p", wa, y(e.statusName), 1)
|
|
3223
|
+
]),
|
|
3224
|
+
d("div", ba, [
|
|
3225
|
+
d("p", $a, y(e.title), 1),
|
|
3226
|
+
d("p", Ea, y(e.message), 1)
|
|
3227
|
+
])
|
|
3228
|
+
], 2));
|
|
3229
|
+
}
|
|
3230
|
+
});
|
|
3231
|
+
const Sa = /* @__PURE__ */ m(Ta, [["__scopeId", "data-v-e6138c02"]]), Ca = { class: "modal-wrap" }, Ia = { class: "modal-wrap-head" }, Aa = { class: "modal-head__title margin-0" }, ka = { class: "modal-wrap-body" }, Na = /* @__PURE__ */ $({
|
|
3232
|
+
__name: "modal-wrap",
|
|
3233
|
+
props: {
|
|
3234
|
+
title: {}
|
|
3235
|
+
},
|
|
3236
|
+
setup(t) {
|
|
3237
|
+
return (e, n) => (l(), u("div", Ca, [
|
|
3238
|
+
d("div", Ia, [
|
|
3239
|
+
d("p", Aa, y(e.title), 1)
|
|
3240
|
+
]),
|
|
3241
|
+
d("div", ka, [
|
|
3242
|
+
U(e.$slots, "default", {}, void 0, !0)
|
|
3243
|
+
])
|
|
3244
|
+
]));
|
|
3245
|
+
}
|
|
3246
|
+
});
|
|
3247
|
+
const Pa = /* @__PURE__ */ m(Na, [["__scopeId", "data-v-119165b9"]]), Oa = { class: "modal-validation-body" }, Ra = /* @__PURE__ */ $({
|
|
3248
|
+
__name: "modal-validation",
|
|
3249
|
+
props: {
|
|
3250
|
+
array: {}
|
|
3251
|
+
},
|
|
3252
|
+
setup(t) {
|
|
3253
|
+
return (e, n) => (l(), b(Pa, { title: "Validation results" }, {
|
|
3254
|
+
default: fe(() => [
|
|
3255
|
+
d("div", Oa, [
|
|
3256
|
+
(l(!0), u(O, null, M(e.array, (s, r) => (l(), b(Sa, {
|
|
3257
|
+
key: r,
|
|
3258
|
+
message: s.message,
|
|
3259
|
+
name: s.name,
|
|
3260
|
+
status: s.statusCode,
|
|
3261
|
+
"status-name": s.statusName,
|
|
3262
|
+
title: s.title
|
|
3263
|
+
}, null, 8, ["message", "name", "status", "status-name", "title"]))), 128))
|
|
3264
|
+
])
|
|
3265
|
+
]),
|
|
3266
|
+
_: 1
|
|
3267
|
+
}));
|
|
3268
|
+
}
|
|
3269
|
+
});
|
|
3270
|
+
const No = /* @__PURE__ */ m(Ra, [["__scopeId", "data-v-a39cfe2f"]]), Va = ["alt", "src"], Po = /* @__PURE__ */ $({
|
|
3271
|
+
__name: "widget-image",
|
|
3272
|
+
props: {
|
|
3273
|
+
src: {},
|
|
3274
|
+
alt: {},
|
|
3275
|
+
default: {}
|
|
3276
|
+
},
|
|
3277
|
+
setup(t) {
|
|
3278
|
+
const e = t, n = q();
|
|
3279
|
+
return Ke(() => {
|
|
3280
|
+
n.value && (n.value.src = e.src), n.value.onerror = function() {
|
|
3281
|
+
e.default && (n.value.src = e.default);
|
|
3282
|
+
};
|
|
3283
|
+
}), (s, r) => (l(), u("img", {
|
|
3284
|
+
alt: s.alt,
|
|
3285
|
+
ref_key: "refImage",
|
|
3286
|
+
ref: n,
|
|
3287
|
+
src: s.src || s.$props.default
|
|
3288
|
+
}, null, 8, Va));
|
|
3289
|
+
}
|
|
3290
|
+
}), La = /* @__PURE__ */ $({
|
|
3291
|
+
__name: "widget-input-check",
|
|
3292
|
+
props: {
|
|
3293
|
+
modelValue: { type: Boolean }
|
|
3294
|
+
},
|
|
3295
|
+
emits: ["update:modelValue"],
|
|
3296
|
+
setup(t, { emit: e }) {
|
|
3297
|
+
const n = t;
|
|
3298
|
+
function s() {
|
|
3299
|
+
e("update:modelValue", !n.modelValue);
|
|
3300
|
+
}
|
|
3301
|
+
return (r, i) => (l(), u("div", {
|
|
3302
|
+
class: I(["widget-input-check", { "widget-input-check_active": r.modelValue }]),
|
|
3303
|
+
onClick: s
|
|
3304
|
+
}, [
|
|
3305
|
+
r.modelValue ? (l(), b(R, {
|
|
3306
|
+
key: 0,
|
|
3307
|
+
name: "check"
|
|
3308
|
+
})) : _("", !0)
|
|
3309
|
+
], 2));
|
|
3310
|
+
}
|
|
3311
|
+
});
|
|
3312
|
+
const Wa = /* @__PURE__ */ m(La, [["__scopeId", "data-v-f4a3dc6c"]]), Da = { class: "widget-card" }, Ma = { class: "widget-card-toggle" }, Fa = { class: "widget-card-wrap" }, ja = { class: "widget-card-content" }, xa = {
|
|
3313
|
+
key: 0,
|
|
3314
|
+
class: "widget-card-title"
|
|
3315
|
+
}, Ua = /* @__PURE__ */ $({
|
|
3316
|
+
__name: "widget-card",
|
|
3317
|
+
props: {
|
|
3318
|
+
title: {}
|
|
3319
|
+
},
|
|
3320
|
+
setup(t, { expose: e }) {
|
|
3321
|
+
const n = A({
|
|
3322
|
+
selected: !1,
|
|
3323
|
+
hidden: !0
|
|
3324
|
+
});
|
|
3325
|
+
return e({
|
|
3326
|
+
state: n
|
|
3327
|
+
}), (s, r) => (l(), u("div", Da, [
|
|
3328
|
+
d("div", Ma, [
|
|
3329
|
+
C(Wa, {
|
|
3330
|
+
modelValue: n.selected,
|
|
3331
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => n.selected = i)
|
|
3332
|
+
}, null, 8, ["modelValue"])
|
|
3333
|
+
]),
|
|
3334
|
+
d("div", Fa, [
|
|
3335
|
+
d("div", {
|
|
3336
|
+
class: "widget-card-arrow",
|
|
3337
|
+
onClick: r[1] || (r[1] = (i) => n.hidden = !n.hidden)
|
|
3338
|
+
}, [
|
|
3339
|
+
C(R, {
|
|
3340
|
+
name: "angle-small-right",
|
|
3341
|
+
class: I(["card-icon-arrow", { "card-icon-arrow_active": !n.hidden }])
|
|
3342
|
+
}, null, 8, ["class"])
|
|
3343
|
+
]),
|
|
3344
|
+
d("div", ja, [
|
|
3345
|
+
s.title ? (l(), u("p", xa, y(s.title), 1)) : _("", !0),
|
|
3346
|
+
U(s.$slots, "main", {}, void 0, !0),
|
|
3347
|
+
n.hidden ? _("", !0) : U(s.$slots, "sub", { key: 1 }, void 0, !0)
|
|
3348
|
+
])
|
|
3349
|
+
])
|
|
3350
|
+
]));
|
|
3351
|
+
}
|
|
3352
|
+
});
|
|
3353
|
+
const Oo = /* @__PURE__ */ m(Ua, [["__scopeId", "data-v-bca33c5b"]]);
|
|
3354
|
+
class j {
|
|
3355
|
+
static parseError(e) {
|
|
3356
|
+
let n = e.errors ? Object.values(e.errors).map((s) => s[0]) : null;
|
|
3357
|
+
throw B.AuthServiceError(e.title, n);
|
|
3358
|
+
}
|
|
3359
|
+
/**
|
|
3360
|
+
* @deprecated
|
|
3361
|
+
* */
|
|
3362
|
+
static login(e) {
|
|
3363
|
+
return g(te.identityServerURL + "/api/Authenticate/Login", {
|
|
3364
|
+
method: "POST",
|
|
3365
|
+
headers: {
|
|
3366
|
+
"Content-Type": "application/json"
|
|
3367
|
+
},
|
|
3368
|
+
credentials: "include",
|
|
3369
|
+
body: JSON.stringify({
|
|
3370
|
+
...e,
|
|
3371
|
+
AppName: te.applicationName
|
|
3372
|
+
})
|
|
3373
|
+
}).catch(j.parseError);
|
|
3374
|
+
}
|
|
3375
|
+
/**
|
|
3376
|
+
* @deprecated
|
|
3377
|
+
* */
|
|
3378
|
+
static registration(e) {
|
|
3379
|
+
return e.AppName = te.applicationName, g(te.identityServerURL + "/api/Authenticate/Registration", {
|
|
3380
|
+
method: "POST",
|
|
3381
|
+
headers: {
|
|
3382
|
+
"Content-Type": "application/json"
|
|
3383
|
+
},
|
|
3384
|
+
credentials: "include",
|
|
3385
|
+
body: JSON.stringify(e)
|
|
3386
|
+
}).catch(j.parseError);
|
|
3387
|
+
}
|
|
3388
|
+
static parseProcessAnswer(e) {
|
|
3389
|
+
if (e.statusCode > 4)
|
|
3390
|
+
throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g, " $1").replace(/(\d)/g, " $1"));
|
|
3391
|
+
return e;
|
|
3392
|
+
}
|
|
3393
|
+
static startRegistrationProcess(e) {
|
|
3394
|
+
return j.requestStepRegistrationProcess("StartRegistration", e);
|
|
3395
|
+
}
|
|
3396
|
+
static confirmPhoneRegistrationProcess(e) {
|
|
3397
|
+
return j.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration", e);
|
|
3398
|
+
}
|
|
3399
|
+
static confirmEmailRegistrationProcess(e) {
|
|
3400
|
+
return j.requestStepRegistrationProcess("ConfirmEmailByRegistration", e);
|
|
3401
|
+
}
|
|
3402
|
+
static finishEmailRegistrationProcess(e) {
|
|
3403
|
+
return j.requestStepRegistrationProcess("FinishRegistration", e);
|
|
3404
|
+
}
|
|
3405
|
+
/**
|
|
3406
|
+
* @description Steps of registration process are the same. Current method provide one requestInterface for all
|
|
3407
|
+
* steps.
|
|
3408
|
+
* */
|
|
3409
|
+
static requestStepRegistrationProcess(e, n) {
|
|
3410
|
+
return g(`${te.identityServerURL}/api/Authenticate/${e}`, {
|
|
3411
|
+
method: "POST",
|
|
3412
|
+
headers: {
|
|
3413
|
+
"Content-Type": "application/json"
|
|
3414
|
+
},
|
|
3415
|
+
credentials: "include",
|
|
3416
|
+
body: JSON.stringify(n)
|
|
3417
|
+
}).catch(j.parseError);
|
|
3418
|
+
}
|
|
3419
|
+
static startLoginProcess(e) {
|
|
3420
|
+
return j.requestStepLoginProcess("StartLogin", e);
|
|
3421
|
+
}
|
|
3422
|
+
static loginWithPassword(e) {
|
|
3423
|
+
return j.requestStepLoginProcess("LoginWithPassword", e);
|
|
3424
|
+
}
|
|
3425
|
+
static loginWithOtpCode(e) {
|
|
3426
|
+
return j.requestStepLoginProcess("LoginWithOtpCode", e);
|
|
3427
|
+
}
|
|
3428
|
+
/**
|
|
3429
|
+
* @description Method for step-to-step login process
|
|
3430
|
+
* @return {ILoginAnswer} answer
|
|
3431
|
+
* */
|
|
3432
|
+
static requestStepLoginProcess(e, n) {
|
|
3433
|
+
return g(`${te.identityServerURL}/api/Authenticate/${e}`, {
|
|
3434
|
+
method: "POST",
|
|
3435
|
+
headers: {
|
|
3436
|
+
"Content-Type": "application/json"
|
|
3437
|
+
},
|
|
3438
|
+
credentials: "include",
|
|
3439
|
+
body: JSON.stringify(n)
|
|
3440
|
+
}).catch(j.parseError).then(j.parseLoginProcessAnswer);
|
|
3441
|
+
}
|
|
3442
|
+
static parseLoginProcessAnswer(e) {
|
|
3443
|
+
if (e.statusCode > 3)
|
|
3444
|
+
throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g, " $1").replace(/(\d)/g, " $1"));
|
|
3445
|
+
return e;
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
const un = class Ee {
|
|
3449
|
+
static async create(e) {
|
|
3450
|
+
return g(Ee.url, {
|
|
3451
|
+
method: "post",
|
|
3452
|
+
body: JSON.stringify(e),
|
|
3453
|
+
headers: {
|
|
3454
|
+
"Content-Type": "application/json"
|
|
3455
|
+
}
|
|
3456
|
+
});
|
|
3457
|
+
}
|
|
3458
|
+
/**
|
|
3459
|
+
* @description Чтение списка разговоров
|
|
3460
|
+
* */
|
|
3461
|
+
static async read(e) {
|
|
3462
|
+
const n = new URLSearchParams({
|
|
3463
|
+
targetCode: String(e.targetCode),
|
|
3464
|
+
entityName: e.entity.name,
|
|
3465
|
+
entityCatalogId: e.entity.catalogId
|
|
3466
|
+
});
|
|
3467
|
+
return g(Ee.url + "?" + n.toString(), {
|
|
3468
|
+
method: "get"
|
|
3469
|
+
});
|
|
3470
|
+
}
|
|
3471
|
+
/**
|
|
3472
|
+
* @description Получение списка сообщений по Talk Id.
|
|
3473
|
+
*/
|
|
3474
|
+
static async readMessages(e) {
|
|
3475
|
+
return g(`${Ee.url}/${e}/messages`, {
|
|
3476
|
+
method: "get"
|
|
3477
|
+
});
|
|
3478
|
+
}
|
|
3479
|
+
static async createMessage(e) {
|
|
3480
|
+
return g(`${Ee.url}/${e.talkId}/messages`, {
|
|
3481
|
+
method: "post",
|
|
3482
|
+
body: JSON.stringify({
|
|
3483
|
+
text: e.text
|
|
3484
|
+
}),
|
|
3485
|
+
headers: {
|
|
3486
|
+
"Content-Type": "application/json"
|
|
3487
|
+
}
|
|
3488
|
+
});
|
|
3489
|
+
}
|
|
3490
|
+
};
|
|
3491
|
+
un.url = "/close-api/communications";
|
|
3492
|
+
let qe = un;
|
|
3493
|
+
class Ro {
|
|
3494
|
+
static async getDefaultView(e) {
|
|
3495
|
+
return g("/close-api/views/" + e, {
|
|
3496
|
+
method: "GET",
|
|
3497
|
+
headers: {
|
|
3498
|
+
"Content-Type": "application/json"
|
|
3499
|
+
}
|
|
3500
|
+
});
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
function Vt(t) {
|
|
3504
|
+
return {
|
|
3505
|
+
...t,
|
|
3506
|
+
createdEntities: t.createdEntites
|
|
3507
|
+
};
|
|
3508
|
+
}
|
|
3509
|
+
const dn = class Ge {
|
|
3510
|
+
static async getStartConfig(e, n) {
|
|
3511
|
+
return g([Ge.url, e, n].join("/"), {
|
|
3512
|
+
method: "GET",
|
|
3513
|
+
headers: {
|
|
3514
|
+
"Content-Type": "application/json"
|
|
3515
|
+
}
|
|
3516
|
+
});
|
|
3517
|
+
}
|
|
3518
|
+
static async startProcess(e, n) {
|
|
3519
|
+
return g([Ge.url, e, n].join("/"), {
|
|
3520
|
+
method: "POST",
|
|
3521
|
+
headers: {
|
|
3522
|
+
"Content-Type": "application/json"
|
|
3523
|
+
}
|
|
3524
|
+
}).then(Vt);
|
|
3525
|
+
}
|
|
3526
|
+
static async runStep(e, n, s, r, i) {
|
|
3527
|
+
return g([Ge.url, e, n].join("/"), {
|
|
3528
|
+
method: "PUT",
|
|
3529
|
+
headers: {
|
|
3530
|
+
"Content-Type": "application/json"
|
|
3531
|
+
},
|
|
3532
|
+
body: JSON.stringify({
|
|
3533
|
+
stepName: s,
|
|
3534
|
+
token: r,
|
|
3535
|
+
values: i
|
|
3536
|
+
})
|
|
3537
|
+
}).then(Vt);
|
|
3538
|
+
}
|
|
3539
|
+
};
|
|
3540
|
+
dn.url = "/close-api/views/process-wizard";
|
|
3541
|
+
let at = dn;
|
|
3542
|
+
class pn {
|
|
3543
|
+
static get url() {
|
|
3544
|
+
return "/close-api/metadata";
|
|
3545
|
+
}
|
|
3546
|
+
static async get(e, n, s) {
|
|
3547
|
+
console.warn("GETTING METADATA BY DEPRECATED METHOD."), console.trace();
|
|
3548
|
+
const r = new URLSearchParams();
|
|
3549
|
+
return n && r.append("criteria", n), s && r.append("id", String(s)), await fetch(this.url + `/${e}?${r.toString()}`, {
|
|
3550
|
+
method: "GET"
|
|
3551
|
+
}).then((i) => i.json());
|
|
3552
|
+
}
|
|
3553
|
+
static getById(e, n, s = []) {
|
|
3554
|
+
const r = new URLSearchParams();
|
|
3555
|
+
return He(r, s), n && r.append("id", n), g([this.url, e].join("/") + `?${r.toString()}`);
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
class Vo {
|
|
3559
|
+
static invite(e, n, s) {
|
|
3560
|
+
return g("/close-api/accounts/invitePerson", {
|
|
3561
|
+
method: "POST",
|
|
3562
|
+
headers: {
|
|
3563
|
+
"Content-Type": "application/json"
|
|
3564
|
+
},
|
|
3565
|
+
body: JSON.stringify({
|
|
3566
|
+
organizationId: e,
|
|
3567
|
+
personKey: n,
|
|
3568
|
+
relatedRoleCode: s
|
|
3569
|
+
})
|
|
3570
|
+
});
|
|
3571
|
+
}
|
|
3572
|
+
static accept(e, n) {
|
|
3573
|
+
return g("/close-api/accounts/markInvite", {
|
|
3574
|
+
method: "POST",
|
|
3575
|
+
headers: {
|
|
3576
|
+
"Content-Type": "application/json"
|
|
3577
|
+
},
|
|
3578
|
+
body: JSON.stringify({
|
|
3579
|
+
invitationId: e,
|
|
3580
|
+
version: n,
|
|
3581
|
+
mark: !0
|
|
3582
|
+
})
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
static decline(e, n) {
|
|
3586
|
+
return g("/close-api/accounts/markInvite", {
|
|
3587
|
+
method: "POST",
|
|
3588
|
+
headers: {
|
|
3589
|
+
"Content-Type": "application/json"
|
|
3590
|
+
},
|
|
3591
|
+
body: JSON.stringify({
|
|
3592
|
+
invitationId: e,
|
|
3593
|
+
version: n,
|
|
3594
|
+
mark: !1
|
|
3595
|
+
})
|
|
3596
|
+
});
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
class fn {
|
|
3600
|
+
static get url() {
|
|
3601
|
+
return "/close-api/rules-validation/";
|
|
3602
|
+
}
|
|
3603
|
+
static validate(e, n) {
|
|
3604
|
+
return g(fn.url + e, {
|
|
3605
|
+
method: "POST",
|
|
3606
|
+
body: JSON.stringify(n)
|
|
3607
|
+
});
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
class Lo {
|
|
3611
|
+
static getConfiguration() {
|
|
3612
|
+
return g("/open-api/webserver-configuration", {
|
|
3613
|
+
method: "GET",
|
|
3614
|
+
headers: {
|
|
3615
|
+
"Content-Type": "application/json"
|
|
3616
|
+
}
|
|
3617
|
+
});
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
class Ba {
|
|
3621
|
+
static url() {
|
|
3622
|
+
return "/close-api/actions";
|
|
3623
|
+
}
|
|
3624
|
+
static async get({ criterion: e }) {
|
|
3625
|
+
const n = new URLSearchParams();
|
|
3626
|
+
return e && n.append("criterion", e), await fetch(this.url() + `?${n.toString()}`, {
|
|
3627
|
+
method: "GET"
|
|
3628
|
+
}).then((s) => s.json());
|
|
3629
|
+
}
|
|
3630
|
+
static getById(e, n, s = []) {
|
|
3631
|
+
const r = new URLSearchParams();
|
|
3632
|
+
return He(r, s), g([this.url(), e, n].join("/") + `?${r.toString()}`, {
|
|
3633
|
+
method: "GET"
|
|
3634
|
+
});
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
const hn = class _n extends H {
|
|
3638
|
+
constructor(e = []) {
|
|
3639
|
+
super(), this.array = A([]), this.defaultArray = [], this.setDefault(e);
|
|
3640
|
+
}
|
|
3641
|
+
emitUpdate() {
|
|
3642
|
+
this.emit(_n.EVENT_DATA, this.array);
|
|
3643
|
+
}
|
|
3644
|
+
setDefault(e) {
|
|
3645
|
+
const n = JSON.parse(JSON.stringify(e));
|
|
3646
|
+
this.defaultArray = n, this.set(n);
|
|
3647
|
+
}
|
|
3648
|
+
revert() {
|
|
3649
|
+
this.set(this.defaultArray);
|
|
3650
|
+
}
|
|
3651
|
+
set(e) {
|
|
3652
|
+
this.array.splice(0, this.array.length, ...e), this.emitUpdate();
|
|
3653
|
+
}
|
|
3654
|
+
append(e) {
|
|
3655
|
+
this.array.push(e), this.emitUpdate();
|
|
3656
|
+
}
|
|
3657
|
+
/**
|
|
3658
|
+
* @description Перемещает элемент с позиции I, на позицию J
|
|
3659
|
+
* */
|
|
3660
|
+
moveTo(e, n) {
|
|
3661
|
+
if (this.isOutOfRange(e) || this.isOutOfRange(n))
|
|
3662
|
+
throw new Error(`Provided position is out of range: ${e}, ${n}`);
|
|
3663
|
+
const s = this.array[e];
|
|
3664
|
+
this.array.splice(e, 1), this.array.splice(n, 0, s), this.emitUpdate();
|
|
3665
|
+
}
|
|
3666
|
+
remove(e) {
|
|
3667
|
+
this.array.splice(e, 1), this.emitUpdate();
|
|
3668
|
+
}
|
|
3669
|
+
isOutOfRange(e) {
|
|
3670
|
+
return !(e >= 0 && e < this.array.length);
|
|
3671
|
+
}
|
|
3672
|
+
};
|
|
3673
|
+
hn.EVENT_DATA = "list-config:update";
|
|
3674
|
+
let Wo = hn;
|
|
3675
|
+
class Do extends H {
|
|
3676
|
+
constructor(e) {
|
|
3677
|
+
super(), this.name = "Communication", this.read = () => {
|
|
3678
|
+
}, this.id = e;
|
|
3679
|
+
}
|
|
3680
|
+
sendMessage(e) {
|
|
3681
|
+
return qe.createMessage({ talkId: this.id, text: e });
|
|
3682
|
+
}
|
|
3683
|
+
static checkAndGenerate(e) {
|
|
3684
|
+
return qe.read(e).then((n) => n.length === 0 ? qe.create(e) : n[0]);
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
function Mo(t) {
|
|
3688
|
+
const e = K.getParentForm();
|
|
3689
|
+
e ? e.subscribe(t) : console.warn(B.ParentFormNotFound());
|
|
3690
|
+
const n = A([]);
|
|
3691
|
+
return t.read = () => qe.readMessages(t.id).then((s) => (n.splice(0, n.length, ...s), s)), {
|
|
3692
|
+
array: n
|
|
3693
|
+
};
|
|
3694
|
+
}
|
|
3695
|
+
function qa(t) {
|
|
3696
|
+
return typeof t != "object" || t === null ? !1 : !!(t.hasOwnProperty("start") || t.hasOwnProperty("end"));
|
|
3697
|
+
}
|
|
3698
|
+
function Y(t) {
|
|
3699
|
+
return Object.keys(t).reduce((e, n) => {
|
|
3700
|
+
const s = t[n];
|
|
3701
|
+
if (Array.isArray(s)) {
|
|
3702
|
+
const r = s.map((i) => typeof i == "string" ? `'${i}'` : i).join(", ");
|
|
3703
|
+
return s.length && e.push(`@${n} in (${r})`), e;
|
|
3704
|
+
}
|
|
3705
|
+
if (qa(s)) {
|
|
3706
|
+
let r = function(i) {
|
|
3707
|
+
var a;
|
|
3708
|
+
return ((a = i.match(/([^Z]*)/)) == null ? void 0 : a[0]) + "0000Z";
|
|
3709
|
+
};
|
|
3710
|
+
return s.start && e.push(`@${n} ge ${r(s.start)}`), s.end && e.push(`@${n} le ${r(s.end)}`), e;
|
|
3711
|
+
}
|
|
3712
|
+
return typeof s == "number" ? (e.push(`@${n} eq ${s}`), e) : typeof s == "string" ? (s.length !== 0 && e.push(`@${n} eq '${s}'`), e) : (s === null && e.push(Y.is(n, s)), e);
|
|
3713
|
+
}, []).join(" and ");
|
|
3714
|
+
}
|
|
3715
|
+
function Oe(t) {
|
|
3716
|
+
return typeof t == "string" ? `'${t}'` : `${t}`;
|
|
3717
|
+
}
|
|
3718
|
+
Y.includes = function(e, n) {
|
|
3719
|
+
return `@${e} Contains ${Oe(n)}`;
|
|
3720
|
+
};
|
|
3721
|
+
Y.beginWith = function(e, n) {
|
|
3722
|
+
return `@${e} BeginWith ${Oe(n)}`;
|
|
3723
|
+
};
|
|
3724
|
+
Y.notEq = function(e, n) {
|
|
3725
|
+
return `@${e} nq ${Oe(n)}`;
|
|
3726
|
+
};
|
|
3727
|
+
Y.eq = function(e, n) {
|
|
3728
|
+
return Array.isArray(n) ? Y.in(e, n) : `@${e} eq ${Oe(n)}`;
|
|
3729
|
+
};
|
|
3730
|
+
Y.in = function(e, n) {
|
|
3731
|
+
const s = n.map(Oe).join(", ");
|
|
3732
|
+
return `@${e} in (${s})`;
|
|
3733
|
+
};
|
|
3734
|
+
Y.and = function(...e) {
|
|
3735
|
+
return e.join(" and ");
|
|
3736
|
+
};
|
|
3737
|
+
Y.is = function(e, n) {
|
|
3738
|
+
return `@${e} is ${n}`;
|
|
3739
|
+
};
|
|
3740
|
+
Y.or = function(...e) {
|
|
3741
|
+
return e.join(" or ");
|
|
3742
|
+
};
|
|
3743
|
+
function Ga(t, e = "images") {
|
|
3744
|
+
return `/static-folder/${e}/${t}`;
|
|
3745
|
+
}
|
|
3746
|
+
function za(t, e, n) {
|
|
3747
|
+
return t.reduce((s, r) => {
|
|
3748
|
+
var o;
|
|
3749
|
+
let i = typeof e == "function" ? e(r) : r[e];
|
|
3750
|
+
const a = (o = s[s.length - 1]) == null ? void 0 : o.value;
|
|
3751
|
+
return a && n(a, i) ? s[s.length - 1].array.push(r) : s.push({
|
|
3752
|
+
value: i,
|
|
3753
|
+
array: [r]
|
|
3754
|
+
}), s;
|
|
3755
|
+
}, []);
|
|
3756
|
+
}
|
|
3757
|
+
function Ha() {
|
|
3758
|
+
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(
|
|
3759
|
+
/[018]/g,
|
|
3760
|
+
(t) => (t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> t / 4).toString(16)
|
|
3761
|
+
);
|
|
3762
|
+
}
|
|
3763
|
+
function Fo(t, e = 1e3) {
|
|
3764
|
+
let n = 0;
|
|
3765
|
+
return (...s) => {
|
|
3766
|
+
clearTimeout(n), n = setTimeout(() => t(...s), e);
|
|
3767
|
+
};
|
|
3768
|
+
}
|
|
3769
|
+
function jo(t, e) {
|
|
3770
|
+
const n = q(null);
|
|
3771
|
+
function s() {
|
|
3772
|
+
return t.name ? pn.getById(t.name, e, []).then((r) => {
|
|
3773
|
+
n.value = r, r.fields.forEach((i) => {
|
|
3774
|
+
i.canSet ? t.enable(i.name) : t.disable(i.name);
|
|
3775
|
+
});
|
|
3776
|
+
}).catch(() => {
|
|
3777
|
+
n.value = null;
|
|
3778
|
+
const r = B.MetadataEntityIsNotAvailable(t.name || "FORM_WITHOUT_NAME");
|
|
3779
|
+
D.add("error", r.message);
|
|
3780
|
+
}) : Promise.reject();
|
|
3781
|
+
}
|
|
3782
|
+
return t.on(K.EVENT_READ, s), {
|
|
3783
|
+
metadata: n,
|
|
3784
|
+
update: s
|
|
3785
|
+
};
|
|
3786
|
+
}
|
|
3787
|
+
class yt extends Error {
|
|
3788
|
+
static UndefinedStatus() {
|
|
3789
|
+
return new yt("Status is undefined.");
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
class Ja extends yt {
|
|
3793
|
+
}
|
|
3794
|
+
function xo(t, e) {
|
|
3795
|
+
const n = A([]);
|
|
3796
|
+
async function s(i, a) {
|
|
3797
|
+
if (!i)
|
|
3798
|
+
throw Ja.UndefinedStatus();
|
|
3799
|
+
const o = await Ba.get({ criterion: i });
|
|
3800
|
+
n.splice(0, n.length), n.push(...o.map((c) => r(c, a)));
|
|
3801
|
+
}
|
|
3802
|
+
return {
|
|
3803
|
+
actions: n,
|
|
3804
|
+
update: s
|
|
3805
|
+
};
|
|
3806
|
+
function r(i, a) {
|
|
3807
|
+
return {
|
|
3808
|
+
title: i.title,
|
|
3809
|
+
callback: () => (() => Promise.resolve().then(() => {
|
|
3810
|
+
if (t.changed)
|
|
3811
|
+
return t.save();
|
|
3812
|
+
}).then(() => fetch(i.url, {
|
|
3813
|
+
method: "POST",
|
|
3814
|
+
body: JSON.stringify({
|
|
3815
|
+
keys: {
|
|
3816
|
+
Id: a
|
|
3817
|
+
},
|
|
3818
|
+
contextId: E.contextId
|
|
3819
|
+
}),
|
|
3820
|
+
headers: {
|
|
3821
|
+
"Content-Type": "application/json"
|
|
3822
|
+
}
|
|
3823
|
+
})).then((c) => c.json()).then((c) => {
|
|
3824
|
+
if (!c.success)
|
|
3825
|
+
throw e != null && e.ModalValidationResult && c.validationEffect ? Bt(e.ModalValidationResult, {
|
|
3826
|
+
rules: c.validationEffect.results
|
|
3827
|
+
}) : D.add("error", c.message), new Error();
|
|
3828
|
+
return c;
|
|
3829
|
+
}).then((c) => {
|
|
3830
|
+
c.message && D.add("info", c.message), e != null && e.handleAffectedEntities && e.handleAffectedEntities(c.affectedEntities);
|
|
3831
|
+
}).then(() => t.read()))()
|
|
3832
|
+
};
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
class Je {
|
|
3836
|
+
static url() {
|
|
3837
|
+
return "/close-api/presentation";
|
|
3838
|
+
}
|
|
3839
|
+
static getStatuses(e, n) {
|
|
3840
|
+
return fetch(`${Je.url()}/status/${e}/${n}`).then((s) => s.json());
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
function Uo(t) {
|
|
3844
|
+
const e = A({
|
|
3845
|
+
title: "Loading",
|
|
3846
|
+
type: "wait"
|
|
3847
|
+
});
|
|
3848
|
+
function n(s) {
|
|
3849
|
+
if (t.name && Number.isInteger(s))
|
|
3850
|
+
return Je.getStatuses(t.name, s).then((r) => {
|
|
3851
|
+
e.type = r.type, e.title = r.name;
|
|
3852
|
+
});
|
|
3853
|
+
}
|
|
3854
|
+
return t.on(K.EVENT_READ, (s) => {
|
|
3855
|
+
var a, o;
|
|
3856
|
+
const { code: r, name: i } = {
|
|
3857
|
+
code: (a = s.Status) == null ? void 0 : a.Code,
|
|
3858
|
+
name: (o = s.Status) == null ? void 0 : o.Name
|
|
3859
|
+
};
|
|
3860
|
+
return t.name ? !Number.isInteger(r) && !i ? void console.log("Undefined code or name is Status prop.") : Je.getStatuses(t.name, r).then((c) => {
|
|
3861
|
+
e.type = c.type, e.title = i;
|
|
3862
|
+
}) : void console.log("Form without name.");
|
|
3863
|
+
}), { label: e, update: n };
|
|
3864
|
+
}
|
|
3865
|
+
function Bo(t, e) {
|
|
3866
|
+
const n = wn(), s = V(() => Number(n.params.id)), r = A({
|
|
3867
|
+
ready: !1,
|
|
3868
|
+
show: !1
|
|
3869
|
+
});
|
|
3870
|
+
return Tt(() => s.value, () => {
|
|
3871
|
+
r.ready = !1;
|
|
3872
|
+
}), Tt(() => s.value, () => {
|
|
3873
|
+
Number.isInteger(s.value) && t.read();
|
|
3874
|
+
}, { immediate: !0 }), t.read = Ce.requestHandler.bind(
|
|
3875
|
+
null,
|
|
3876
|
+
() => Promise.resolve().then(() => {
|
|
3877
|
+
if (!t.name)
|
|
3878
|
+
throw new Error("Form without entity name. Please set form.name");
|
|
3879
|
+
return J.readById(t.name, s.value, {
|
|
3880
|
+
fields: e.fields
|
|
3881
|
+
});
|
|
3882
|
+
}).then(Ce.valuesToUpperCase).then((i) => (Number.isInteger(i.Version) && (t.version = i.Version), t.setValues(i), r.show = !0, i)).catch((i) => {
|
|
3883
|
+
throw Object.prototype.hasOwnProperty.call(i, "status") && [403, 404].includes(i.status) && (r.show = !1), i;
|
|
3884
|
+
}).finally(() => {
|
|
3885
|
+
r.ready = !0;
|
|
3886
|
+
})
|
|
3887
|
+
), t.save = Ce.requestHandler.bind(
|
|
3888
|
+
null,
|
|
3889
|
+
() => Promise.resolve().then(() => {
|
|
3890
|
+
if (!t.name)
|
|
3891
|
+
throw new Error("Form without entity name. Please set form.name");
|
|
3892
|
+
return J.updateById(t.name, s.value, t.changes, { version: t.version });
|
|
3893
|
+
}).then((i) => {
|
|
3894
|
+
t.version = i.version;
|
|
3895
|
+
})
|
|
3896
|
+
), t.on(K.EVENT_SAVE, t.read.bind(t)), {
|
|
3897
|
+
formShadowState: r
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
3900
|
+
function qo() {
|
|
3901
|
+
const t = A({
|
|
3902
|
+
contextId: E.contextId,
|
|
3903
|
+
person: E.person,
|
|
3904
|
+
organizations: E.organizations,
|
|
3905
|
+
ready: E.ready,
|
|
3906
|
+
user: E.user
|
|
3907
|
+
}), e = V(() => {
|
|
3908
|
+
if (!E.ready || !E.person)
|
|
3909
|
+
return null;
|
|
3910
|
+
const s = t.contextId;
|
|
3911
|
+
return E.person.id === s ? E.person : E.organizations.find((r) => r.id === s) || null;
|
|
3912
|
+
}), n = V(() => {
|
|
3913
|
+
var s;
|
|
3914
|
+
return t.contextId === ((s = t.person) == null ? void 0 : s.id);
|
|
3915
|
+
});
|
|
3916
|
+
return E.onupdateContext((s) => {
|
|
3917
|
+
t.contextId = s;
|
|
3918
|
+
}), E.onupdateData(() => {
|
|
3919
|
+
t.person = E.person, t.organizations = E.organizations, t.user = E.user;
|
|
3920
|
+
}), E.onReady((s) => {
|
|
3921
|
+
t.ready = s;
|
|
3922
|
+
}), {
|
|
3923
|
+
state: Ut(t),
|
|
3924
|
+
currentContext: e,
|
|
3925
|
+
isPerson: n
|
|
3926
|
+
};
|
|
3927
|
+
}
|
|
3928
|
+
function Go(t, e) {
|
|
3929
|
+
const n = A({
|
|
3930
|
+
ready: !1,
|
|
3931
|
+
show: !1
|
|
3932
|
+
});
|
|
3933
|
+
function s() {
|
|
3934
|
+
n.ready = !1, n.show = !1;
|
|
3935
|
+
}
|
|
3936
|
+
return t.read = () => {
|
|
3937
|
+
let r = e();
|
|
3938
|
+
return Promise.resolve().then(() => {
|
|
3939
|
+
if (!t.name)
|
|
3940
|
+
throw B.EntityWithoutName("Use Form Request");
|
|
3941
|
+
return J.readById(t.name, r.id, {
|
|
3942
|
+
fields: r.fields
|
|
3943
|
+
});
|
|
3944
|
+
}).then(Ce.valuesToUpperCase).then((i) => (i.hasOwnProperty("Version") && (t.version = Number(i.Version)), t.setValues(i), n.show = !0, i)).catch((i) => {
|
|
3945
|
+
const a = ze(i);
|
|
3946
|
+
throw D.add("error", a.message), a;
|
|
3947
|
+
}).finally(() => {
|
|
3948
|
+
n.ready = !0;
|
|
3949
|
+
});
|
|
3950
|
+
}, t.save = () => {
|
|
3951
|
+
let r = e();
|
|
3952
|
+
return Promise.resolve().then(() => {
|
|
3953
|
+
if (!t.name)
|
|
3954
|
+
throw B.EntityWithoutName("Use Form Request");
|
|
3955
|
+
return J.updateById(t.name, r.id, t.changes, { version: t.version });
|
|
3956
|
+
}).then((i) => {
|
|
3957
|
+
t.version = i.version || i.Version;
|
|
3958
|
+
}).catch((i) => {
|
|
3959
|
+
const a = ze(i);
|
|
3960
|
+
throw D.add("error", a.message), a;
|
|
3961
|
+
});
|
|
3962
|
+
}, t.on(K.EVENT_SAVE, t.read.bind(t)), { shadowFormState: n, initShadow: s };
|
|
3963
|
+
}
|
|
3964
|
+
class zo {
|
|
3965
|
+
static getRequiredDocuments(e, n, s) {
|
|
3966
|
+
const r = new URLSearchParams({
|
|
3967
|
+
entity: e,
|
|
3968
|
+
primaryKey: n,
|
|
3969
|
+
statusCode: s
|
|
3970
|
+
});
|
|
3971
|
+
return fetch(`/close-api/views/required-documents?${r.toString()}`).then((i) => i.json());
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
class Te {
|
|
3975
|
+
static url() {
|
|
3976
|
+
return "close-api/billing";
|
|
3977
|
+
}
|
|
3978
|
+
static getBillingMetadata(e) {
|
|
3979
|
+
return fetch(`/${Te.url()}/calculator/${e}`);
|
|
3980
|
+
}
|
|
3981
|
+
static calculate(e, n) {
|
|
3982
|
+
return g(`/${Te.url()}/calculator`, {
|
|
3983
|
+
method: "POST",
|
|
3984
|
+
headers: {
|
|
3985
|
+
"Content-Type": "application/json"
|
|
3986
|
+
},
|
|
3987
|
+
body: JSON.stringify({
|
|
3988
|
+
entity: e,
|
|
3989
|
+
values: n
|
|
3990
|
+
})
|
|
3991
|
+
}).then((s) => {
|
|
3992
|
+
if (s && s.status === 1)
|
|
3993
|
+
return s;
|
|
3994
|
+
throw Array.isArray(s.notes) ? new Error(s.notes[0]) : B.ApiNotAvailable();
|
|
3995
|
+
});
|
|
3996
|
+
}
|
|
3997
|
+
static parseMetadataField(e) {
|
|
3998
|
+
function n(s) {
|
|
3999
|
+
switch (s.type) {
|
|
4000
|
+
case "ValueType":
|
|
4001
|
+
switch (s.dataType) {
|
|
4002
|
+
case "Integer":
|
|
4003
|
+
return "number";
|
|
4004
|
+
default:
|
|
4005
|
+
return s.dataType;
|
|
4006
|
+
}
|
|
4007
|
+
case "EntityReference":
|
|
4008
|
+
return s.dataType;
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
return {
|
|
4012
|
+
name: e.name,
|
|
4013
|
+
label: e.title,
|
|
4014
|
+
required: e.required,
|
|
4015
|
+
type: n(e)
|
|
4016
|
+
};
|
|
4017
|
+
}
|
|
4018
|
+
/**
|
|
4019
|
+
* @description Метод для создания онлайн платежа.
|
|
4020
|
+
* */
|
|
4021
|
+
static createOnlinePayment(e, n) {
|
|
4022
|
+
return g(`/${Te.url()}/online-payment`, {
|
|
4023
|
+
method: "POST",
|
|
4024
|
+
headers: {
|
|
4025
|
+
"Content-Type": "application/json"
|
|
4026
|
+
},
|
|
4027
|
+
body: JSON.stringify({
|
|
4028
|
+
paymentId: e,
|
|
4029
|
+
returnURL: n
|
|
4030
|
+
})
|
|
4031
|
+
});
|
|
4032
|
+
}
|
|
4033
|
+
/**
|
|
4034
|
+
* @description Подтверждение online платежа. После получение ответа от банка(в момент редирект), мы должны отправить
|
|
4035
|
+
* все полученные данные(в нашем случае весь URL) на аппсервер.
|
|
4036
|
+
* */
|
|
4037
|
+
static applyOnlinePayment(e) {
|
|
4038
|
+
return g(`/${Te.url()}/online-payment`, {
|
|
4039
|
+
method: "PUT",
|
|
4040
|
+
headers: {
|
|
4041
|
+
"Content-Type": "application/json"
|
|
4042
|
+
},
|
|
4043
|
+
body: JSON.stringify({
|
|
4044
|
+
response: e
|
|
4045
|
+
})
|
|
4046
|
+
});
|
|
4047
|
+
}
|
|
4048
|
+
}
|
|
4049
|
+
class Ho {
|
|
4050
|
+
/**
|
|
4051
|
+
* @description Загрузка конфигурации из списка
|
|
4052
|
+
* */
|
|
4053
|
+
static getListSettings(e, n) {
|
|
4054
|
+
const s = new URLSearchParams();
|
|
4055
|
+
s.set("entity", e), n && s.set("mark", n);
|
|
4056
|
+
const r = `/close-api/views/list/configs?${s.toString()}`;
|
|
4057
|
+
return g(r);
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
function Ka(t) {
|
|
4061
|
+
return t.statusName === "Completed";
|
|
4062
|
+
}
|
|
4063
|
+
function Ya(t) {
|
|
4064
|
+
return t.statusName === "FinalStepWithConfirmation";
|
|
4065
|
+
}
|
|
4066
|
+
function Xa(t) {
|
|
4067
|
+
return t.statusName === "ValidationError";
|
|
4068
|
+
}
|
|
4069
|
+
function Jo(t, e, n) {
|
|
4070
|
+
let s = null;
|
|
4071
|
+
const r = A({
|
|
4072
|
+
wait: null
|
|
4073
|
+
});
|
|
4074
|
+
let i = [], a = null;
|
|
4075
|
+
const o = q(null);
|
|
4076
|
+
function c() {
|
|
4077
|
+
o.value = i.find((v) => v.name === a) || null;
|
|
4078
|
+
}
|
|
4079
|
+
function p() {
|
|
4080
|
+
var v;
|
|
4081
|
+
return a ? ((v = i.find((L) => L.name === a)) == null ? void 0 : v.fields) || [] : [];
|
|
4082
|
+
}
|
|
4083
|
+
function f(v) {
|
|
4084
|
+
if (c(), Xa(v))
|
|
4085
|
+
return void n.onValidation(v.validationResults);
|
|
4086
|
+
if ((v.statusName === "FinalStep" || v.statusName === "NextStep") && (!p().length || Za(p(), n.presets)))
|
|
4087
|
+
return ue(n.presets || {});
|
|
4088
|
+
Ka(v) && n.onCompleted(v), Ya(v) && n.onConfirmation(v);
|
|
4089
|
+
}
|
|
4090
|
+
async function h() {
|
|
4091
|
+
try {
|
|
4092
|
+
await w(), await _e();
|
|
4093
|
+
} catch (v) {
|
|
4094
|
+
const { message: L } = ze(v);
|
|
4095
|
+
D.add("error", L);
|
|
4096
|
+
}
|
|
4097
|
+
}
|
|
4098
|
+
function w() {
|
|
4099
|
+
return r.wait = "Loading process information.", at.getStartConfig(e, t).then((v) => {
|
|
4100
|
+
i = v.steps.map((L) => ({
|
|
4101
|
+
label: L.title,
|
|
4102
|
+
name: L.stepName,
|
|
4103
|
+
number: L.number,
|
|
4104
|
+
fields: L.frontendEntity.objectTypes.reduce((ne, de) => (de.properties.forEach((k) => {
|
|
4105
|
+
ne.push({
|
|
4106
|
+
name: k.name,
|
|
4107
|
+
label: k.title,
|
|
4108
|
+
type: k.refEntityName || k.dataType
|
|
4109
|
+
});
|
|
4110
|
+
}), ne), [])
|
|
4111
|
+
}));
|
|
4112
|
+
}).then((v) => (r.wait = !1, v));
|
|
4113
|
+
}
|
|
4114
|
+
function T(v) {
|
|
4115
|
+
return a = v.nextStepName, s = v.token, v;
|
|
4116
|
+
}
|
|
4117
|
+
function F(v) {
|
|
4118
|
+
const L = ze(v);
|
|
4119
|
+
D.add("error", L.message);
|
|
4120
|
+
}
|
|
4121
|
+
function _e() {
|
|
4122
|
+
return r.wait = "Starting process", at.startProcess(e, t).then(T).then(f).catch(F).finally(() => {
|
|
4123
|
+
r.wait = null;
|
|
4124
|
+
});
|
|
4125
|
+
}
|
|
4126
|
+
function ue(v = {}) {
|
|
4127
|
+
return !s || !a ? Promise.reject("Not step or token.") : (r.wait = "Expect the result", at.runStep(e, t, a, s, v).then(T).then(f).catch(F).finally(() => {
|
|
4128
|
+
r.wait = !1;
|
|
4129
|
+
}));
|
|
4130
|
+
}
|
|
4131
|
+
return {
|
|
4132
|
+
initialize: h,
|
|
4133
|
+
state: r,
|
|
4134
|
+
currentStepConfig: Ut(o),
|
|
4135
|
+
next: ue
|
|
4136
|
+
};
|
|
4137
|
+
}
|
|
4138
|
+
function Za(t, e) {
|
|
4139
|
+
for (let n = 0; n < t.length; n++) {
|
|
4140
|
+
const s = t[n];
|
|
4141
|
+
if (!oe.getPropFromObject(e, s.name))
|
|
4142
|
+
return !1;
|
|
4143
|
+
}
|
|
4144
|
+
return !0;
|
|
4145
|
+
}
|
|
4146
|
+
const Qa = "close-api/proxy/Equipment/Search";
|
|
4147
|
+
class Ko {
|
|
4148
|
+
static search(e, n, s, r, i) {
|
|
4149
|
+
const a = new URLSearchParams();
|
|
4150
|
+
a.append("pattern", e || ""), n && a.append("categoryId", n), s && a.append("useType", String(s)), r && a.append("statusCode", r), i && (a.append("limit", String(i.limit)), a.append("offset", String(i.offset)));
|
|
4151
|
+
const o = `/${Qa}?${a.toString()}`;
|
|
4152
|
+
return g(o, {
|
|
4153
|
+
method: "GET",
|
|
4154
|
+
headers: {
|
|
4155
|
+
"Content-Type": "application/json"
|
|
4156
|
+
}
|
|
4157
|
+
});
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4160
|
+
const Yo = {
|
|
4161
|
+
clickOutside: ke,
|
|
4162
|
+
requestHandler: _t,
|
|
4163
|
+
valuesToUpperCase: Qe,
|
|
4164
|
+
prettyDate: mt,
|
|
4165
|
+
prettyDateWithTime: ln,
|
|
4166
|
+
Filter: Y,
|
|
4167
|
+
staticLink: Ga,
|
|
4168
|
+
groupArrayByField: za,
|
|
4169
|
+
uuidv4: Ha,
|
|
4170
|
+
Request: g,
|
|
4171
|
+
prettyMoney: tn
|
|
4172
|
+
}, Xo = {
|
|
4173
|
+
widgets: jr,
|
|
4174
|
+
usage: xr,
|
|
4175
|
+
utils: Zr,
|
|
4176
|
+
mixins: In,
|
|
4177
|
+
config: Qr,
|
|
4178
|
+
types: ei
|
|
4179
|
+
};
|
|
4180
|
+
export {
|
|
4181
|
+
qr as ApplicationManager,
|
|
4182
|
+
Do as Communication,
|
|
4183
|
+
wo as ComputedMetadata,
|
|
4184
|
+
B as CoreError,
|
|
4185
|
+
Y as Filter,
|
|
4186
|
+
Z as List,
|
|
4187
|
+
Wo as ListConfig,
|
|
4188
|
+
E as Manager,
|
|
4189
|
+
De as MetadataStore,
|
|
4190
|
+
No as ModalValidation,
|
|
4191
|
+
D as NotificationSystem,
|
|
4192
|
+
ft as ProcessWrap,
|
|
4193
|
+
g as Request,
|
|
4194
|
+
W as SYMBOL_ROW,
|
|
4195
|
+
et as Table,
|
|
4196
|
+
So as WidgetBreadcrumbs,
|
|
4197
|
+
_r as WidgetButton,
|
|
4198
|
+
Oo as WidgetCard,
|
|
4199
|
+
ko as WidgetForm,
|
|
4200
|
+
R as WidgetIcon,
|
|
4201
|
+
Po as WidgetImage,
|
|
4202
|
+
Co as WidgetList,
|
|
4203
|
+
Ht as WidgetMultiButton,
|
|
4204
|
+
Mr as WidgetNotificationSystem,
|
|
4205
|
+
Io as WidgetSection,
|
|
4206
|
+
he as WidgetSpinner,
|
|
4207
|
+
Ao as WidgetTable,
|
|
4208
|
+
Ba as actionService,
|
|
4209
|
+
j as authService,
|
|
4210
|
+
Te as billingService,
|
|
4211
|
+
ke as clickOutside,
|
|
4212
|
+
Br as clientService,
|
|
4213
|
+
qe as communicationService,
|
|
4214
|
+
Ho as configurationService,
|
|
4215
|
+
J as dataService,
|
|
4216
|
+
Fo as debounce,
|
|
4217
|
+
Xo as default,
|
|
4218
|
+
zo as documentsService,
|
|
4219
|
+
Ko as equipmentService,
|
|
4220
|
+
ts as fileService,
|
|
4221
|
+
ho as historyService,
|
|
4222
|
+
$o as internationalizationService,
|
|
4223
|
+
Vo as invitationService,
|
|
4224
|
+
pn as metadataService,
|
|
4225
|
+
vo as newImport,
|
|
4226
|
+
Lo as openService,
|
|
4227
|
+
ze as parseError,
|
|
4228
|
+
bo as prettifyValueByMetadata,
|
|
4229
|
+
at as processWizardService,
|
|
4230
|
+
_t as requestHandler,
|
|
4231
|
+
fn as ruleValidationService,
|
|
4232
|
+
To as setupSocket,
|
|
4233
|
+
Ie as t,
|
|
4234
|
+
fo as testTypes,
|
|
4235
|
+
Mo as useCommunication,
|
|
4236
|
+
qo as useCustomerState,
|
|
4237
|
+
xo as useFormAction,
|
|
4238
|
+
Uo as useFormLabel,
|
|
4239
|
+
jo as useFormMetadata,
|
|
4240
|
+
Go as useFormRequest,
|
|
4241
|
+
Bo as useFormRequestData,
|
|
4242
|
+
_o as useListConfig,
|
|
4243
|
+
mo as useListFilter,
|
|
4244
|
+
li as useListOrder,
|
|
4245
|
+
oi as useListProvide,
|
|
4246
|
+
ii as useListRead,
|
|
4247
|
+
go as useListSearch,
|
|
4248
|
+
yo as useListSelect,
|
|
4249
|
+
ai as useListState,
|
|
4250
|
+
lo as useManagerState,
|
|
4251
|
+
Eo as useSocket,
|
|
4252
|
+
po as useTableRequest,
|
|
4253
|
+
uo as useTableState,
|
|
4254
|
+
Jo as useWizard,
|
|
4255
|
+
Yo as utils,
|
|
4256
|
+
Ro as viewService
|
|
4257
|
+
};
|
|
4258
|
+
//# sourceMappingURL=eservices-core.es.js.map
|