@web-utils/component 2.7.21 → 2.7.22
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/chunks/confirmable-mixin.35bd1934.js +104 -0
- package/dist/chunks/{dayjs.b0f2f7d9.js → dayjs.ed2e1b73.js} +1 -1
- package/dist/chunks/{detail.6619700c.js → detail.d47a021c.js} +1 -1
- package/dist/chunks/{form-input-mixin.df413ca8.js → form-input-mixin.760cd65d.js} +1 -1
- package/dist/chunks/{form-item-mixin.b850e028.js → form-item-mixin.fa314b67.js} +14 -3
- package/dist/chunks/{tab-mixin.51886d91.js → tab-mixin.9d568df9.js} +1 -1
- package/dist/chunks/{vueComponentNormalizer.bf552d98.js → vueComponentNormalizer.77ec6792.js} +1 -1
- package/dist/components/address-input/index.js +1 -1
- package/dist/components/address-input/style.css +1 -10
- package/dist/components/affix/index.js +1 -1
- package/dist/components/affix/style.css +1 -4
- package/dist/components/aside-menu/index.js +1 -1
- package/dist/components/aside-menu/style.css +1 -3
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/style.css +1 -51
- package/dist/components/awesome-button/index.js +42 -12
- package/dist/components/base.css +1 -536
- package/dist/components/capsule-tab/index.js +1 -1
- package/dist/components/capsule-tab/style.css +1 -26
- package/dist/components/card/index.js +1 -1
- package/dist/components/card/style.css +1 -84
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/style.css +1 -35
- package/dist/components/chat/index.js +2 -2
- package/dist/components/chat/style.css +1 -277
- package/dist/components/chunk-file-uploader/index.js +1 -1
- package/dist/components/chunk-file-uploader/style.css +1 -3
- package/dist/components/chunk-file-uploader-button/index.js +1 -1
- package/dist/components/chunk-file-uploader-button/style.css +1 -16
- package/dist/components/chunk-file-uploader-drop/index.js +23 -5
- package/dist/components/chunk-file-uploader-drop/style.css +1 -11
- package/dist/components/chunk-file-uploader-file/index.js +2 -2
- package/dist/components/chunk-file-uploader-file/style.css +1 -124
- package/dist/components/chunk-file-uploader-files/index.js +1 -1
- package/dist/components/chunk-file-uploader-files/style.css +1 -8
- package/dist/components/chunk-file-uploader-list/index.js +1 -1
- package/dist/components/chunk-file-uploader-list/style.css +1 -8
- package/dist/components/chunk-file-uploader-un-support/index.js +1 -1
- package/dist/components/chunk-file-uploader-un-support/style.css +1 -5
- package/dist/components/code-mirror-editor/index.js +7 -7
- package/dist/components/code-mirror-editor/style.css +1 -11
- package/dist/components/color-picker/index.js +21 -3
- package/dist/components/column/index.js +1 -1
- package/dist/components/column-default/index.js +1 -1
- package/dist/components/column-dynamic/index.js +1 -1
- package/dist/components/column-menu/index.js +1 -1
- package/dist/components/column-slot/index.js +2 -2
- package/dist/components/comment/index.js +1 -1
- package/dist/components/comment/style.css +1 -110
- package/dist/components/confirm-button/index.js +2 -2
- package/dist/components/confirmable/index.js +2 -2
- package/dist/components/context-menu/index.js +1 -1
- package/dist/components/context-menu/style.css +1 -84
- package/dist/components/count-up/index.js +15 -4
- package/dist/components/custom-scrollbar/index.js +18 -5
- package/dist/components/data-box/index.js +1 -1
- package/dist/components/data-box/style.css +1 -52
- package/dist/components/data-card/index.js +1 -1
- package/dist/components/data-card/style.css +1 -35
- package/dist/components/data-cardtext/index.js +1 -1
- package/dist/components/data-cardtext/style.css +1 -30
- package/dist/components/data-display/index.js +1 -1
- package/dist/components/data-display/style.css +1 -31
- package/dist/components/data-icons/index.js +1 -1
- package/dist/components/data-icons/style.css +1 -47
- package/dist/components/data-imgtext/index.js +1 -1
- package/dist/components/data-imgtext/style.css +1 -65
- package/dist/components/data-operatext/index.js +1 -1
- package/dist/components/data-operatext/style.css +1 -72
- package/dist/components/data-panel/index.js +1 -1
- package/dist/components/data-panel/style.css +1 -31
- package/dist/components/data-pay/index.js +1 -1
- package/dist/components/data-pay/style.css +1 -96
- package/dist/components/data-price/index.js +1 -1
- package/dist/components/data-price/style.css +1 -75
- package/dist/components/data-progress/index.js +1 -1
- package/dist/components/data-progress/style.css +1 -24
- package/dist/components/data-rotate/index.js +1 -1
- package/dist/components/data-rotate/style.css +1 -44
- package/dist/components/data-table-picker/index.js +1 -1
- package/dist/components/data-tabs/index.js +1 -1
- package/dist/components/data-tabs/style.css +1 -64
- package/dist/components/dialog-column/index.js +1 -1
- package/dist/components/dialog-excel/index.js +2 -2
- package/dist/components/dialog-filter/index.js +1 -1
- package/dist/components/dialog-form/index.js +1 -1
- package/dist/components/dynamic-table/index.js +1 -1
- package/dist/components/dynamic-table/style.css +1 -24
- package/dist/components/e-charts/index.js +1 -1
- package/dist/components/e-charts/style.css +1 -4
- package/dist/components/easy-popup/index.js +1 -1
- package/dist/components/easy-popup/style.css +1 -12
- package/dist/components/editable-progress/index.js +1 -1
- package/dist/components/editable-progress/style.css +1 -33
- package/dist/components/editable-tree/index.js +216 -163
- package/dist/components/editable-tree/style.css +1 -79
- package/dist/components/egd-collapse/index.js +1 -1
- package/dist/components/egd-collapse-item/index.js +1 -1
- package/dist/components/element-dialog/index.js +1 -1
- package/dist/components/element-dialog/style.css +1 -82
- package/dist/components/empty-view/index.js +1 -1
- package/dist/components/empty-view/style.css +1 -11
- package/dist/components/error-view/index.js +1 -1
- package/dist/components/error-view/style.css +1 -11
- package/dist/components/flex-column/index.js +14 -2
- package/dist/components/flex-item/index.js +15 -3
- package/dist/components/flex-row/index.js +14 -2
- package/dist/components/flex-scroller/index.js +1 -1
- package/dist/components/flex-scroller/style.css +1 -14
- package/dist/components/flow/index.js +1 -1
- package/dist/components/flow/style.css +1 -38
- package/dist/components/flow-node/index.js +1 -1
- package/dist/components/flow-viewer/index.js +34 -7
- package/dist/components/flow-viewer/style.css +1 -13
- package/dist/components/form-button/index.js +2 -2
- package/dist/components/form-cascader/index.js +14 -3
- package/dist/components/form-checkbox-group/index.js +14 -3
- package/dist/components/form-checkbox-group/style.css +1 -45
- package/dist/components/form-date-picker/index.js +20 -11
- package/dist/components/form-group/index.js +1 -1
- package/dist/components/form-group/style.css +1 -76
- package/dist/components/form-holder/index.js +21 -3
- package/dist/components/form-input/index.js +14 -3
- package/dist/components/form-input-email/index.js +14 -3
- package/dist/components/form-input-id-card/index.js +14 -3
- package/dist/components/form-input-number/index.js +14 -3
- package/dist/components/form-input-number/style.css +1 -6
- package/dist/components/form-input-phone-number/index.js +14 -3
- package/dist/components/form-input-time/index.js +14 -3
- package/dist/components/form-item/index.js +43 -15
- package/dist/components/form-item/style.css +1 -5
- package/dist/components/form-item-config-provider/index.js +1 -1
- package/dist/components/form-item-group/index.js +1 -1
- package/dist/components/form-item-group/style.css +1 -25
- package/dist/components/form-radio-group/index.js +14 -3
- package/dist/components/form-radio-group/style.css +1 -47
- package/dist/components/form-select/index.js +14 -3
- package/dist/components/form-switch/index.js +14 -3
- package/dist/components/form-temp/index.js +1 -1
- package/dist/components/form-textarea/index.js +14 -3
- package/dist/components/form-view/index.js +35 -13
- package/dist/components/form-view/style.css +1 -155
- package/dist/components/fy-array/index.js +1 -1
- package/dist/components/fy-array/style.css +1 -12
- package/dist/components/fy-article/index.js +1 -1
- package/dist/components/fy-article/style.css +1 -56
- package/dist/components/fy-cascader/index.js +1 -1
- package/dist/components/fy-checkbox/index.js +1 -1
- package/dist/components/fy-checkbox/style.css +1 -9
- package/dist/components/fy-code/index.js +1 -1
- package/dist/components/fy-curd/index.js +1 -1
- package/dist/components/fy-curd/style.css +1 -236
- package/dist/components/fy-date/index.js +1 -1
- package/dist/components/fy-date/style.css +1 -15
- package/dist/components/fy-dialog-form/index.js +1 -1
- package/dist/components/fy-dialog-form/style.css +1 -0
- package/dist/components/fy-draggable/index.js +1 -1
- package/dist/components/fy-draggable/style.css +1 -136
- package/dist/components/fy-dynamic/index.js +1 -1
- package/dist/components/fy-dynamic/style.css +1 -29
- package/dist/components/fy-empty/index.js +1 -1
- package/dist/components/fy-empty/style.css +1 -18
- package/dist/components/fy-form/index.js +23 -5
- package/dist/components/fy-form/style.css +1 -73
- package/dist/components/fy-form-design/index.js +73 -49
- package/dist/components/fy-form-design/style.css +1 -560
- package/dist/components/fy-form-menu/index.js +1 -1
- package/dist/components/fy-input/index.js +1 -1
- package/dist/components/fy-input-color/index.js +1 -1
- package/dist/components/fy-input-icon/index.js +1 -1
- package/dist/components/fy-input-icon/style.css +1 -33
- package/dist/components/fy-input-map/index.js +1 -1
- package/dist/components/fy-input-map/style.css +1 -44
- package/dist/components/fy-input-number/index.js +1 -1
- package/dist/components/fy-input-table/index.js +1 -1
- package/dist/components/fy-input-table/style.css +1 -4
- package/dist/components/fy-input-tree/index.js +1 -1
- package/dist/components/fy-input-tree/style.css +1 -19
- package/dist/components/fy-progress/index.js +1 -1
- package/dist/components/fy-radio/index.js +1 -1
- package/dist/components/fy-radio/style.css +1 -6
- package/dist/components/fy-rate/index.js +1 -1
- package/dist/components/fy-rate/style.css +1 -3
- package/dist/components/fy-select/index.js +1 -1
- package/dist/components/fy-select/style.css +1 -19
- package/dist/components/fy-slider/index.js +1 -1
- package/dist/components/fy-switch/index.js +1 -1
- package/dist/components/fy-tabs/index.js +1 -1
- package/dist/components/fy-time/index.js +1 -1
- package/dist/components/fy-title/index.js +1 -1
- package/dist/components/fy-title/style.css +1 -5
- package/dist/components/fy-tree/index.js +1 -1
- package/dist/components/fy-tree/style.css +1 -39
- package/dist/components/fy-u-editor/index.js +47 -14
- package/dist/components/fy-u-editor/style.css +1 -9
- package/dist/components/fy-upload/index.js +1 -1
- package/dist/components/fy-upload/style.css +1 -55
- package/dist/components/guide-steps/index.js +1 -1
- package/dist/components/guide-steps/style.css +1 -28
- package/dist/components/header-menu/index.js +1 -1
- package/dist/components/header-search/index.js +1 -1
- package/dist/components/highlight-j-s/index.js +1 -1
- package/dist/components/highlight-j-s/style.css +1 -18
- package/dist/components/icon-card/index.js +1 -1
- package/dist/components/icon-card/style.css +1 -50
- package/dist/components/icon-temp/index.js +1 -1
- package/dist/components/icon-temp/style.css +1 -17
- package/dist/components/iframe-window/index.js +1 -1
- package/dist/components/iframe-window/style.css +1 -14
- package/dist/components/image-cropper/index.js +15 -6
- package/dist/components/image-cropper/style.css +1 -28
- package/dist/components/image-preview/index.js +15 -5
- package/dist/components/image-preview/style.css +1 -66
- package/dist/components/image-viewer/index.js +1 -1
- package/dist/components/image-viewer/style.css +1 -15
- package/dist/components/input-number/index.js +1 -1
- package/dist/components/input-number/style.css +1 -9
- package/dist/components/input-number-range/index.js +1 -1
- package/dist/components/input-number-range/style.css +1 -6
- package/dist/components/keep-view-alive/index.js +1 -1
- package/dist/components/keyboard/index.js +1 -1
- package/dist/components/keyboard/style.css +1 -473
- package/dist/components/license/index.js +1 -1
- package/dist/components/loading-view/index.js +1 -1
- package/dist/components/loading-view/style.css +1 -11
- package/dist/components/login/index.js +1 -1
- package/dist/components/login/style.css +1 -19
- package/dist/components/name-avatar/index.js +1 -1
- package/dist/components/name-avatar/style.css +1 -30
- package/dist/components/nav-bar/index.js +1 -1
- package/dist/components/nav-bar/style.css +1 -11
- package/dist/components/not-implement/index.js +1 -1
- package/dist/components/not-implement/style.css +1 -9
- package/dist/components/notice/index.js +1 -1
- package/dist/components/notice/style.css +1 -48
- package/dist/components/page/index.js +1 -1
- package/dist/components/page/style.css +1 -6
- package/dist/components/page-header/index.js +1 -1
- package/dist/components/page-header/style.css +1 -8
- package/dist/components/page-index/index.js +42 -18
- package/dist/components/page-index/style.css +1 -17
- package/dist/components/page-index-top/index.js +38 -16
- package/dist/components/page-skeleton/index.js +1 -1
- package/dist/components/page-skeleton/style.css +1 -17
- package/dist/components/page-skeleton-new/index.js +1 -1
- package/dist/components/page-skeleton-new/style.css +1 -36
- package/dist/components/pageable-table/index.js +78 -34
- package/dist/components/pageable-table/style.css +1 -66
- package/dist/components/pageable-view/index.js +78 -34
- package/dist/components/pageable-view/style.css +1 -63
- package/dist/components/photo-swipe/index.js +46 -24
- package/dist/components/process-designer/index.js +80 -50
- package/dist/components/process-designer/style.css +1 -1648
- package/dist/components/properties-panel/index.js +77 -51
- package/dist/components/properties-panel/style.css +1 -106
- package/dist/components/queue/index.js +1 -1
- package/dist/components/record-video/index.js +1 -1
- package/dist/components/record-video/style.css +1 -47
- package/dist/components/resize-observer/index.js +1 -1
- package/dist/components/resize-observer/style.css +1 -25
- package/dist/components/search/index.js +1 -1
- package/dist/components/search/style.css +1 -51
- package/dist/components/search-popover/index.js +29 -9
- package/dist/components/search-popover/style.css +1 -90
- package/dist/components/sign/index.js +2 -2
- package/dist/components/sign/style.css +1 -6
- package/dist/components/sign-panel/index.js +1 -1
- package/dist/components/sign-panel/style.css +1 -91
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/skeleton/style.css +1 -55
- package/dist/components/split-pane/index.js +21 -3
- package/dist/components/split-pane/style.css +1 -98
- package/dist/components/stateful/index.js +1 -1
- package/dist/components/stateful/style.css +1 -27
- package/dist/components/static-pageable-table/index.js +1 -1
- package/dist/components/static-pageable-table/style.css +1 -3
- package/dist/components/swiper/index.js +25 -5
- package/dist/components/swiper/style.css +1 -37
- package/dist/components/tab/index.js +2 -2
- package/dist/components/tab/style.css +1 -108
- package/dist/components/tab-item/index.js +3 -3
- package/dist/components/table-column/index.js +17 -7
- package/dist/components/table-page/index.js +1 -1
- package/dist/components/table-view/index.js +62 -36
- package/dist/components/table-view/style.css +1 -90
- package/dist/components/tag-render/index.js +13 -2
- package/dist/components/tag-render/style.css +1 -27
- package/dist/components/text-ellipsis/index.js +1 -1
- package/dist/components/text-ellipsis/style.css +1 -3
- package/dist/components/tinymce-editor/index.js +27 -9
- package/dist/components/tinymce-editor/style.css +1 -37
- package/dist/components/tinymce-wrapper/index.js +17 -7
- package/dist/components/tinymce-wrapper/style.css +1 -30
- package/dist/components/toolbar/index.js +4 -4
- package/dist/components/toolbar/style.css +1 -35
- package/dist/components/toolbar-button/index.js +28 -10
- package/dist/components/toolbar-button/style.css +1 -15
- package/dist/components/trigger/index.js +1 -1
- package/dist/components/verify/index.js +1 -1
- package/dist/components/verify/style.css +1 -9
- package/dist/components/vue-tags-input/index.js +1 -1
- package/dist/components/vue-tags-input/style.css +1 -102
- package/dist/components/watermark/index.js +15 -5
- package/dist/components/watermark/style.css +1 -10
- package/dist/index.css +26 -68
- package/dist/index.es.js +990 -877
- package/package.json +4 -4
- package/web-types.json +1 -1
- package/dist/chunks/confirmable-mixin.7112b769.js +0 -75
- package/dist/components/dialog-form/style.css +0 -5
|
@@ -5,7 +5,7 @@ import { CanvasRenderer } from "echarts/renderers";
|
|
|
5
5
|
import { isString } from "@web-utils/core";
|
|
6
6
|
import { debounce } from "@web-utils/integrations/lodash";
|
|
7
7
|
import { addListener, removeListener } from "resize-detector";
|
|
8
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
8
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
9
9
|
var render = function() {
|
|
10
10
|
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
11
11
|
return _c("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
1
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
2
2
|
var render = function() {
|
|
3
3
|
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
4
4
|
return _vm.rendered ? _c("div", {
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
.easy-popup
|
|
2
|
-
position: fixed;
|
|
3
|
-
z-index: 9999;
|
|
4
|
-
user-select: none;
|
|
5
|
-
width: 300px;
|
|
6
|
-
padding: 12px;
|
|
7
|
-
border: 1px solid #ebeef5;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
background: #fff;
|
|
10
|
-
box-shadow: 0 2px 12px #0000001a;
|
|
11
|
-
min-height: 200px;
|
|
12
|
-
}
|
|
1
|
+
.easy-popup{position:fixed;z-index:9999;user-select:none;width:300px;padding:12px;border:1px solid #ebeef5;border-radius:4px;background:#fff;box-shadow:0 2px 12px #0000001a;min-height:200px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
1
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
2
2
|
var render = function() {
|
|
3
3
|
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
4
4
|
return _c("div", {
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
.editable-progress {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: flex-start;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
width: 100%;
|
|
7
|
-
background-color: #e4e7ed;
|
|
8
|
-
border-radius: 100px;
|
|
9
|
-
}
|
|
10
|
-
.editable-progress .el-progress,
|
|
11
|
-
.editable-progress .el-slider {
|
|
12
|
-
width: 100%;
|
|
13
|
-
font-weight: 700;
|
|
14
|
-
}
|
|
15
|
-
.editable-progress .el-slider__runway {
|
|
16
|
-
margin: 0;
|
|
17
|
-
}
|
|
18
|
-
.editable-progress .el-progress-bar__outer {
|
|
19
|
-
background-color: #e4e7ed;
|
|
20
|
-
}
|
|
21
|
-
.editable-progress .el-slider__bar,
|
|
22
|
-
.editable-progress .el-slider__runway {
|
|
23
|
-
height: 22px;
|
|
24
|
-
border-radius: 100px;
|
|
25
|
-
}
|
|
26
|
-
.editable-progress .el-slider__button-wrapper {
|
|
27
|
-
width: 52px;
|
|
28
|
-
height: 52px;
|
|
29
|
-
}
|
|
30
|
-
.editable-progress .el-slider__button-wrapper .el-slider__button {
|
|
31
|
-
width: 24px;
|
|
32
|
-
height: 24px;
|
|
33
|
-
}
|
|
1
|
+
.editable-progress{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;background-color:#e4e7ed;border-radius:100px}.editable-progress .el-progress,.editable-progress .el-slider{width:100%;font-weight:700}.editable-progress .el-slider__runway{margin:0}.editable-progress .el-progress-bar__outer{background-color:#e4e7ed}.editable-progress .el-slider__bar,.editable-progress .el-slider__runway{height:22px;border-radius:100px}.editable-progress .el-slider__button-wrapper{width:52px;height:52px}.editable-progress .el-slider__button-wrapper .el-slider__button{width:24px;height:24px}
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
|
|
2
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
|
|
6
|
+
for (var prop in b || (b = {}))
|
|
7
|
+
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
8
|
+
if (__getOwnPropSymbols)
|
|
9
|
+
for (var prop of __getOwnPropSymbols(b))
|
|
10
|
+
__propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
11
|
+
return a;
|
|
12
|
+
}, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
13
|
+
var __async = (__this, __arguments, generator) => new Promise((resolve, reject) => {
|
|
14
|
+
var fulfilled = (value) => {
|
|
15
|
+
try {
|
|
16
|
+
step(generator.next(value));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
reject(e);
|
|
19
|
+
}
|
|
20
|
+
}, rejected = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.throw(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
27
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
28
|
+
});
|
|
1
29
|
import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
|
|
2
30
|
import { cloneDeep } from "@web-utils/integrations/lodash";
|
|
3
31
|
import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
|
|
4
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
32
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
5
33
|
var MapShim = function() {
|
|
6
|
-
if (typeof Map
|
|
34
|
+
if (typeof Map != "undefined")
|
|
7
35
|
return Map;
|
|
8
36
|
function getIndex(arr, key) {
|
|
9
37
|
var result = -1;
|
|
@@ -48,8 +76,8 @@ var MapShim = function() {
|
|
|
48
76
|
}, class_1;
|
|
49
77
|
}()
|
|
50
78
|
);
|
|
51
|
-
}(), isBrowser = typeof window
|
|
52
|
-
return typeof global
|
|
79
|
+
}(), isBrowser = typeof window != "undefined" && typeof document != "undefined" && window.document === document, global$1 = function() {
|
|
80
|
+
return typeof global != "undefined" && global.Math === Math ? global : typeof self != "undefined" && self.Math === Math ? self : typeof window != "undefined" && window.Math === Math ? window : Function("return this")();
|
|
53
81
|
}(), requestAnimationFrame$1 = function() {
|
|
54
82
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(global$1) : function(callback) {
|
|
55
83
|
return setTimeout(function() {
|
|
@@ -77,7 +105,7 @@ function throttle(callback, delay2) {
|
|
|
77
105
|
}
|
|
78
106
|
return proxy;
|
|
79
107
|
}
|
|
80
|
-
var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], mutationObserverSupported = typeof MutationObserver
|
|
108
|
+
var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], mutationObserverSupported = typeof MutationObserver != "undefined", ResizeObserverController = (
|
|
81
109
|
/** @class */
|
|
82
110
|
function() {
|
|
83
111
|
function ResizeObserverController2() {
|
|
@@ -165,7 +193,7 @@ function getHTMLElementContentRect(target) {
|
|
|
165
193
|
return createRectInit(paddings.left, paddings.top, width, height);
|
|
166
194
|
}
|
|
167
195
|
var isSVGGraphicsElement = function() {
|
|
168
|
-
return typeof SVGGraphicsElement
|
|
196
|
+
return typeof SVGGraphicsElement != "undefined" ? function(target) {
|
|
169
197
|
return target instanceof getWindowOf(target).SVGGraphicsElement;
|
|
170
198
|
} : function(target) {
|
|
171
199
|
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox == "function";
|
|
@@ -178,7 +206,7 @@ function getContentRect(target) {
|
|
|
178
206
|
return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
|
|
179
207
|
}
|
|
180
208
|
function createReadOnlyRect(_a) {
|
|
181
|
-
var x = _a.x, y = _a.y, width = _a.width, height = _a.height, Constr = typeof DOMRectReadOnly
|
|
209
|
+
var x = _a.x, y = _a.y, width = _a.width, height = _a.height, Constr = typeof DOMRectReadOnly != "undefined" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
|
|
182
210
|
return defineConfigurable(rect, {
|
|
183
211
|
x,
|
|
184
212
|
y,
|
|
@@ -227,7 +255,7 @@ var ResizeObservation = (
|
|
|
227
255
|
return ResizeObserverSPI2.prototype.observe = function(target) {
|
|
228
256
|
if (!arguments.length)
|
|
229
257
|
throw new TypeError("1 argument required, but only 0 present.");
|
|
230
|
-
if (!(typeof Element
|
|
258
|
+
if (!(typeof Element == "undefined" || !(Element instanceof Object))) {
|
|
231
259
|
if (!(target instanceof getWindowOf(target).Element))
|
|
232
260
|
throw new TypeError('parameter 1 is not of type "Element".');
|
|
233
261
|
var observations = this.observations_;
|
|
@@ -236,7 +264,7 @@ var ResizeObservation = (
|
|
|
236
264
|
}, ResizeObserverSPI2.prototype.unobserve = function(target) {
|
|
237
265
|
if (!arguments.length)
|
|
238
266
|
throw new TypeError("1 argument required, but only 0 present.");
|
|
239
|
-
if (!(typeof Element
|
|
267
|
+
if (!(typeof Element == "undefined" || !(Element instanceof Object))) {
|
|
240
268
|
if (!(target instanceof getWindowOf(target).Element))
|
|
241
269
|
throw new TypeError('parameter 1 is not of type "Element".');
|
|
242
270
|
var observations = this.observations_;
|
|
@@ -262,7 +290,7 @@ var ResizeObservation = (
|
|
|
262
290
|
return this.activeObservations_.length > 0;
|
|
263
291
|
}, ResizeObserverSPI2;
|
|
264
292
|
}()
|
|
265
|
-
), observers = typeof WeakMap
|
|
293
|
+
), observers = typeof WeakMap != "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim(), ResizeObserver = (
|
|
266
294
|
/** @class */
|
|
267
295
|
function() {
|
|
268
296
|
function ResizeObserver2(callback) {
|
|
@@ -287,9 +315,9 @@ var ResizeObservation = (
|
|
|
287
315
|
};
|
|
288
316
|
});
|
|
289
317
|
var index = function() {
|
|
290
|
-
return typeof global$1.ResizeObserver
|
|
318
|
+
return typeof global$1.ResizeObserver != "undefined" ? global$1.ResizeObserver : ResizeObserver;
|
|
291
319
|
}();
|
|
292
|
-
const isServer = typeof window
|
|
320
|
+
const isServer = typeof window == "undefined", resizeHandler = (entries) => {
|
|
293
321
|
for (const entry of entries) {
|
|
294
322
|
const listeners = entry.target.__resizeListeners__ || [];
|
|
295
323
|
listeners.length && listeners.forEach((fn) => {
|
|
@@ -799,45 +827,51 @@ const __vue2_script = {
|
|
|
799
827
|
resize() {
|
|
800
828
|
isVerticalScrollbarVisible(this.$refs.treeWrapper) ? this.right = 4 + scrollbarWidth : this.right = 4;
|
|
801
829
|
},
|
|
802
|
-
|
|
803
|
-
|
|
830
|
+
showContextMenu(event, data, node) {
|
|
831
|
+
return __async(this, null, function* () {
|
|
832
|
+
data.contextmenu === !1 || data.id === -1 || data.id === 0 || data.edit === !0 || this.contextMenu && (this.curNode = node, this.curData = data, this.showMenu = !0, this.$refs.tree.setCurrentKey(data.id), yield this.$nextTick(), this.position = computePosition(event, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
833
|
+
});
|
|
804
834
|
},
|
|
805
835
|
hideContextMenu() {
|
|
806
836
|
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
807
837
|
},
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
838
|
+
tryFetch() {
|
|
839
|
+
return __async(this, null, function* () {
|
|
840
|
+
var _a, _b;
|
|
841
|
+
if (this.lazy === !1 && this.fetchApi) {
|
|
842
|
+
const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, {});
|
|
843
|
+
if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
|
|
844
|
+
const data = cloneDeep(this.customRootNode);
|
|
845
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
|
|
846
|
+
} else if (isFunction(this.customRootNode)) {
|
|
847
|
+
const data = this.customRootNode(res.data);
|
|
848
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
|
|
849
|
+
} else
|
|
850
|
+
this.treeData = res.data;
|
|
851
|
+
}
|
|
852
|
+
});
|
|
821
853
|
},
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
854
|
+
loadNode(node, resolve) {
|
|
855
|
+
return __async(this, null, function* () {
|
|
856
|
+
var _a, _b, _c, _d;
|
|
857
|
+
if (node.level === 0) {
|
|
858
|
+
const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, node);
|
|
859
|
+
if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
|
|
860
|
+
const data = cloneDeep(this.customRootNode);
|
|
861
|
+
data[this.treeProps.children || "children"] = res.data, resolve([data]);
|
|
862
|
+
} else if (isFunction(this.customRootNode)) {
|
|
863
|
+
const data = this.customRootNode(res.data);
|
|
864
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
|
|
865
|
+
} else
|
|
866
|
+
resolve(res.data);
|
|
867
|
+
yield this.$nextTick(), this.$emit("root-node-loaded", res.data), this.defaultExpandedKeys ? this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(_d = res == null ? void 0 : res.data[0]) == null ? void 0 : _d.id]);
|
|
868
|
+
} else {
|
|
869
|
+
if (node.leaf || node.data.isTempNode)
|
|
870
|
+
return resolve([]);
|
|
871
|
+
const res = yield this.fetchApi(node.data.id, node);
|
|
872
|
+
resolve(res.data), yield this.$nextTick(), this.$emit("node-loaded", res.data);
|
|
873
|
+
}
|
|
874
|
+
});
|
|
841
875
|
},
|
|
842
876
|
clear() {
|
|
843
877
|
this.cancelEdit(), this.removeNewNode();
|
|
@@ -851,67 +885,68 @@ const __vue2_script = {
|
|
|
851
885
|
cancelEdit() {
|
|
852
886
|
this.editData && (isUndefined(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
853
887
|
},
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
+
editNode(node, data) {
|
|
889
|
+
return __async(this, null, function* () {
|
|
890
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = data, this.text = data[this.treeProps.label], isUndefined(data.edit) ? this.$set(data, "edit", !0) : data.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
|
|
891
|
+
inputValue: data[this.treeProps.label],
|
|
892
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
893
|
+
if (action === "confirm") {
|
|
894
|
+
try {
|
|
895
|
+
instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, yield this.onConfirm(this.curNode, this.curData), done();
|
|
896
|
+
} catch (e) {
|
|
897
|
+
instance.confirmButtonText = "确定";
|
|
898
|
+
}
|
|
899
|
+
instance.confirmButtonLoading = !1;
|
|
900
|
+
} else
|
|
901
|
+
done();
|
|
902
|
+
})
|
|
903
|
+
})).catch((_) => _);
|
|
904
|
+
});
|
|
905
|
+
},
|
|
906
|
+
appendRootNode() {
|
|
907
|
+
return __async(this, null, function* () {
|
|
908
|
+
this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.scrollIntoView(!0)) : yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
|
|
909
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
910
|
+
if (action === "confirm") {
|
|
911
|
+
try {
|
|
912
|
+
this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
|
|
913
|
+
const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
|
|
914
|
+
this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), done();
|
|
915
|
+
} catch (e) {
|
|
916
|
+
instance.confirmButtonText = "确定";
|
|
917
|
+
}
|
|
918
|
+
instance.confirmButtonLoading = !1;
|
|
919
|
+
} else
|
|
920
|
+
done();
|
|
921
|
+
})
|
|
922
|
+
})).catch((_) => _);
|
|
923
|
+
});
|
|
888
924
|
},
|
|
889
925
|
appendChildNode(node) {
|
|
890
926
|
this.text = "";
|
|
891
927
|
const expanded = node.expanded;
|
|
892
|
-
node.expand(
|
|
893
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(node.data.id), this.$refs.tree.append(this.newChild, node),
|
|
894
|
-
|
|
895
|
-
beforeClose: async (action, instance, done) => {
|
|
928
|
+
node.expand(() => __async(this, null, function* () {
|
|
929
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(node.data.id), this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded)) : yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
|
|
930
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
896
931
|
if (action === "confirm") {
|
|
897
932
|
try {
|
|
898
933
|
this.createNewChild(node.data.id), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
|
|
899
|
-
const res =
|
|
900
|
-
this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.append(this.newChild, node),
|
|
901
|
-
} catch {
|
|
934
|
+
const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
|
|
935
|
+
this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.append(this.newChild, node), yield this.locateView(), done();
|
|
936
|
+
} catch (e) {
|
|
902
937
|
instance.confirmButtonText = "确定";
|
|
903
938
|
}
|
|
904
939
|
instance.confirmButtonLoading = !1;
|
|
905
940
|
} else
|
|
906
941
|
done();
|
|
907
|
-
}
|
|
908
|
-
}).catch((_) => _);
|
|
909
|
-
});
|
|
942
|
+
})
|
|
943
|
+
})).catch((_) => _);
|
|
944
|
+
}));
|
|
910
945
|
},
|
|
911
946
|
appendChildNodeWithData(node, parentId, label) {
|
|
912
947
|
this.text = "";
|
|
913
948
|
const expanded = node.expanded;
|
|
914
|
-
node.expand(
|
|
949
|
+
node.expand(() => __async(this, null, function* () {
|
|
915
950
|
this.clear(), this.newChild = {
|
|
916
951
|
id: -1,
|
|
917
952
|
parentId,
|
|
@@ -919,24 +954,30 @@ const __vue2_script = {
|
|
|
919
954
|
edit: !1,
|
|
920
955
|
isTempNode: !0,
|
|
921
956
|
hasChildren: !1
|
|
922
|
-
}, this.$refs.tree.append(this.newChild, node),
|
|
923
|
-
});
|
|
957
|
+
}, this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded);
|
|
958
|
+
}));
|
|
924
959
|
},
|
|
925
960
|
appendPeerNode(node) {
|
|
926
961
|
node.parent && node.parent.level !== 0 ? this.appendChildNode(node.parent) : this.appendRootNode();
|
|
927
962
|
},
|
|
928
|
-
|
|
929
|
-
this
|
|
963
|
+
addRootNode(data) {
|
|
964
|
+
return __async(this, null, function* () {
|
|
965
|
+
this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
|
|
966
|
+
});
|
|
930
967
|
},
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
this
|
|
934
|
-
|
|
968
|
+
addChildNode(data) {
|
|
969
|
+
return __async(this, null, function* () {
|
|
970
|
+
this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => __async(this, null, function* () {
|
|
971
|
+
this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode);
|
|
972
|
+
})) : yield this.addRootNode(data);
|
|
973
|
+
});
|
|
935
974
|
},
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
this
|
|
939
|
-
|
|
975
|
+
addPeerNode(data) {
|
|
976
|
+
return __async(this, null, function* () {
|
|
977
|
+
this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => __async(this, null, function* () {
|
|
978
|
+
this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
|
|
979
|
+
})) : yield this.addRootNode(data);
|
|
980
|
+
});
|
|
940
981
|
},
|
|
941
982
|
updateNode(data) {
|
|
942
983
|
const node = this.$refs.tree.getNode(data);
|
|
@@ -955,60 +996,66 @@ const __vue2_script = {
|
|
|
955
996
|
hasChildren: !1
|
|
956
997
|
}, this.$emit("create-new-node", this.newChild);
|
|
957
998
|
},
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
999
|
+
removeNodeModal(node) {
|
|
1000
|
+
return __async(this, null, function* () {
|
|
1001
|
+
yield this.$confirm(
|
|
1002
|
+
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
|
|
1003
|
+
"系统提示",
|
|
1004
|
+
{
|
|
1005
|
+
type: "warning",
|
|
1006
|
+
modal: !0,
|
|
1007
|
+
dangerouslyUseHTMLString: !0,
|
|
1008
|
+
iconClass: "el-icon-question",
|
|
1009
|
+
closeOnClickModal: !1,
|
|
1010
|
+
confirmButtonClass: "el-button--danger",
|
|
1011
|
+
cancelButtonClass: "el-button--primary is-plain",
|
|
1012
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
1013
|
+
if (action === "confirm") {
|
|
1014
|
+
try {
|
|
1015
|
+
instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
|
|
1016
|
+
const parentNode = node.parent, res = yield this.deleteApi(node.data.id);
|
|
1017
|
+
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
|
|
1018
|
+
} catch (_) {
|
|
1019
|
+
}
|
|
1020
|
+
instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
|
|
1021
|
+
} else
|
|
1022
|
+
done();
|
|
1023
|
+
})
|
|
981
1024
|
}
|
|
1025
|
+
).catch((_) => _);
|
|
1026
|
+
});
|
|
1027
|
+
},
|
|
1028
|
+
removeNode(node) {
|
|
1029
|
+
return __async(this, null, function* () {
|
|
1030
|
+
try {
|
|
1031
|
+
const parentNode = node.parent;
|
|
1032
|
+
if (this.deleteApi) {
|
|
1033
|
+
const res = yield this.deleteApi(node.data.id);
|
|
1034
|
+
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
|
|
1035
|
+
} else
|
|
1036
|
+
this.$refs.tree.remove(node);
|
|
1037
|
+
} catch (e) {
|
|
982
1038
|
}
|
|
983
|
-
)
|
|
984
|
-
},
|
|
985
|
-
async removeNode(node) {
|
|
986
|
-
try {
|
|
987
|
-
const parentNode = node.parent;
|
|
988
|
-
if (this.deleteApi) {
|
|
989
|
-
const res = await this.deleteApi(node.data.id);
|
|
990
|
-
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
|
|
991
|
-
} else
|
|
992
|
-
this.$refs.tree.remove(node);
|
|
993
|
-
} catch {
|
|
994
|
-
}
|
|
1039
|
+
});
|
|
995
1040
|
},
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
this.
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1041
|
+
onConfirm(node, data) {
|
|
1042
|
+
return __async(this, null, function* () {
|
|
1043
|
+
if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
|
|
1044
|
+
this.clear();
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
|
|
1048
|
+
try {
|
|
1049
|
+
if (this.loading = !0, data.id === -1) {
|
|
1050
|
+
const res = yield this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
|
|
1051
|
+
assignReactiveProperties(data, __spreadProps(__spreadValues({}, res.data), { isTempNode: !1 })), this.$emit("node-added", data, old, node), this.registerNode(node);
|
|
1052
|
+
} else
|
|
1053
|
+
yield this.updateApi(__spreadProps(__spreadValues({}, data), { [this.treeProps.label]: this.text }));
|
|
1054
|
+
data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
|
|
1055
|
+
} catch (e) {
|
|
1056
|
+
}
|
|
1057
|
+
data.loading = !1, this.loading = !1;
|
|
1058
|
+
});
|
|
1012
1059
|
},
|
|
1013
1060
|
onCancel(node, data) {
|
|
1014
1061
|
data.id === -1 ? this.$refs.tree.remove(node) : data.edit = !1, this.text = "";
|
|
@@ -1019,14 +1066,18 @@ const __vue2_script = {
|
|
|
1019
1066
|
getCurrentNode() {
|
|
1020
1067
|
return this.$refs.tree.getCurrentNode();
|
|
1021
1068
|
},
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1069
|
+
locateView() {
|
|
1070
|
+
return __async(this, null, function* () {
|
|
1071
|
+
yield this.$nextTick();
|
|
1072
|
+
const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
|
|
1073
|
+
el && el.scrollIntoView();
|
|
1074
|
+
});
|
|
1026
1075
|
},
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1076
|
+
scrollIntoView(expanded) {
|
|
1077
|
+
return __async(this, null, function* () {
|
|
1078
|
+
var _a, _b;
|
|
1079
|
+
yield this.$nextTick(), expanded || (yield delay(300)), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
|
|
1080
|
+
});
|
|
1030
1081
|
},
|
|
1031
1082
|
inputKeyup(event, node, data) {
|
|
1032
1083
|
event.keyCode === 13 && this.onConfirm(node, data), event.keyCode === 27 && this.clear();
|
|
@@ -1062,8 +1113,10 @@ const __vue2_script = {
|
|
|
1062
1113
|
registerNode(node) {
|
|
1063
1114
|
node.store.registerNode(node), delete node.store.nodesMap[-1];
|
|
1064
1115
|
},
|
|
1065
|
-
|
|
1066
|
-
this
|
|
1116
|
+
reloadTree() {
|
|
1117
|
+
return __async(this, null, function* () {
|
|
1118
|
+
this.lazy ? this.treeKey = Date.now() : yield this.tryFetch();
|
|
1119
|
+
});
|
|
1067
1120
|
}
|
|
1068
1121
|
}
|
|
1069
1122
|
}, __cssModules = {};
|