@web-utils/component 2.7.21 → 2.7.28
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/{detail.6619700c.js → detail.544c52b0.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 +2 -100
- 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 +206 -451
- 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 +2 -11
- 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 +780 -1310
- package/package.json +4 -4
- package/web-types.json +1 -1
- package/dist/chunks/confirmable-mixin.7112b769.js +0 -75
- package/dist/chunks/dayjs.b0f2f7d9.js +0 -247
- package/dist/components/dialog-form/style.css +0 -5
|
@@ -1,306 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
return Object.defineProperty(class_1.prototype, "size", {
|
|
21
|
-
/**
|
|
22
|
-
* @returns {boolean}
|
|
23
|
-
*/
|
|
24
|
-
get: function() {
|
|
25
|
-
return this.__entries__.length;
|
|
26
|
-
},
|
|
27
|
-
enumerable: !0,
|
|
28
|
-
configurable: !0
|
|
29
|
-
}), class_1.prototype.get = function(key) {
|
|
30
|
-
var index2 = getIndex(this.__entries__, key), entry = this.__entries__[index2];
|
|
31
|
-
return entry && entry[1];
|
|
32
|
-
}, class_1.prototype.set = function(key, value) {
|
|
33
|
-
var index2 = getIndex(this.__entries__, key);
|
|
34
|
-
~index2 ? this.__entries__[index2][1] = value : this.__entries__.push([key, value]);
|
|
35
|
-
}, class_1.prototype.delete = function(key) {
|
|
36
|
-
var entries = this.__entries__, index2 = getIndex(entries, key);
|
|
37
|
-
~index2 && entries.splice(index2, 1);
|
|
38
|
-
}, class_1.prototype.has = function(key) {
|
|
39
|
-
return !!~getIndex(this.__entries__, key);
|
|
40
|
-
}, class_1.prototype.clear = function() {
|
|
41
|
-
this.__entries__.splice(0);
|
|
42
|
-
}, class_1.prototype.forEach = function(callback, ctx) {
|
|
43
|
-
ctx === void 0 && (ctx = null);
|
|
44
|
-
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
45
|
-
var entry = _a[_i];
|
|
46
|
-
callback.call(ctx, entry[1], entry[0]);
|
|
47
|
-
}
|
|
48
|
-
}, class_1;
|
|
49
|
-
}()
|
|
50
|
-
);
|
|
51
|
-
}(), isBrowser = typeof window < "u" && typeof document < "u" && window.document === document, global$1 = function() {
|
|
52
|
-
return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
|
|
53
|
-
}(), requestAnimationFrame$1 = function() {
|
|
54
|
-
return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(global$1) : function(callback) {
|
|
55
|
-
return setTimeout(function() {
|
|
56
|
-
return callback(Date.now());
|
|
57
|
-
}, 1e3 / 60);
|
|
58
|
-
};
|
|
59
|
-
}(), trailingTimeout = 2;
|
|
60
|
-
function throttle(callback, delay2) {
|
|
61
|
-
var leadingCall = !1, trailingCall = !1, lastCallTime = 0;
|
|
62
|
-
function resolvePending() {
|
|
63
|
-
leadingCall && (leadingCall = !1, callback()), trailingCall && proxy();
|
|
64
|
-
}
|
|
65
|
-
function timeoutCallback() {
|
|
66
|
-
requestAnimationFrame$1(resolvePending);
|
|
67
|
-
}
|
|
68
|
-
function proxy() {
|
|
69
|
-
var timeStamp = Date.now();
|
|
70
|
-
if (leadingCall) {
|
|
71
|
-
if (timeStamp - lastCallTime < trailingTimeout)
|
|
72
|
-
return;
|
|
73
|
-
trailingCall = !0;
|
|
74
|
-
} else
|
|
75
|
-
leadingCall = !0, trailingCall = !1, setTimeout(timeoutCallback, delay2);
|
|
76
|
-
lastCallTime = timeStamp;
|
|
77
|
-
}
|
|
78
|
-
return proxy;
|
|
79
|
-
}
|
|
80
|
-
var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], mutationObserverSupported = typeof MutationObserver < "u", ResizeObserverController = (
|
|
81
|
-
/** @class */
|
|
82
|
-
function() {
|
|
83
|
-
function ResizeObserverController2() {
|
|
84
|
-
this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
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);
|
|
85
19
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, ResizeObserverController2.prototype.refresh = function() {
|
|
92
|
-
var changesDetected = this.updateObservers_();
|
|
93
|
-
changesDetected && this.refresh();
|
|
94
|
-
}, ResizeObserverController2.prototype.updateObservers_ = function() {
|
|
95
|
-
var activeObservers = this.observers_.filter(function(observer) {
|
|
96
|
-
return observer.gatherActive(), observer.hasActive();
|
|
97
|
-
});
|
|
98
|
-
return activeObservers.forEach(function(observer) {
|
|
99
|
-
return observer.broadcastActive();
|
|
100
|
-
}), activeObservers.length > 0;
|
|
101
|
-
}, ResizeObserverController2.prototype.connect_ = function() {
|
|
102
|
-
!isBrowser || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), mutationObserverSupported ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
|
|
103
|
-
attributes: !0,
|
|
104
|
-
childList: !0,
|
|
105
|
-
characterData: !0,
|
|
106
|
-
subtree: !0
|
|
107
|
-
})) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
|
|
108
|
-
}, ResizeObserverController2.prototype.disconnect_ = function() {
|
|
109
|
-
!isBrowser || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
|
|
110
|
-
}, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
|
|
111
|
-
var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
|
|
112
|
-
return !!~propertyName.indexOf(key);
|
|
113
|
-
});
|
|
114
|
-
isReflowProperty && this.refresh();
|
|
115
|
-
}, ResizeObserverController2.getInstance = function() {
|
|
116
|
-
return this.instance_ || (this.instance_ = new ResizeObserverController2()), this.instance_;
|
|
117
|
-
}, ResizeObserverController2.instance_ = null, ResizeObserverController2;
|
|
118
|
-
}()
|
|
119
|
-
), defineConfigurable = function(target, props) {
|
|
120
|
-
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
121
|
-
var key = _a[_i];
|
|
122
|
-
Object.defineProperty(target, key, {
|
|
123
|
-
value: props[key],
|
|
124
|
-
enumerable: !1,
|
|
125
|
-
writable: !1,
|
|
126
|
-
configurable: !0
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
return target;
|
|
130
|
-
}, getWindowOf = function(target) {
|
|
131
|
-
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
132
|
-
return ownerGlobal || global$1;
|
|
133
|
-
}, emptyRect = createRectInit(0, 0, 0, 0);
|
|
134
|
-
function toFloat(value) {
|
|
135
|
-
return parseFloat(value) || 0;
|
|
136
|
-
}
|
|
137
|
-
function getBordersSize(styles) {
|
|
138
|
-
for (var positions = [], _i = 1; _i < arguments.length; _i++)
|
|
139
|
-
positions[_i - 1] = arguments[_i];
|
|
140
|
-
return positions.reduce(function(size, position) {
|
|
141
|
-
var value = styles["border-" + position + "-width"];
|
|
142
|
-
return size + toFloat(value);
|
|
143
|
-
}, 0);
|
|
144
|
-
}
|
|
145
|
-
function getPaddings(styles) {
|
|
146
|
-
for (var positions = ["top", "right", "bottom", "left"], paddings = {}, _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
147
|
-
var position = positions_1[_i], value = styles["padding-" + position];
|
|
148
|
-
paddings[position] = toFloat(value);
|
|
149
|
-
}
|
|
150
|
-
return paddings;
|
|
151
|
-
}
|
|
152
|
-
function getSVGContentRect(target) {
|
|
153
|
-
var bbox = target.getBBox();
|
|
154
|
-
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
155
|
-
}
|
|
156
|
-
function getHTMLElementContentRect(target) {
|
|
157
|
-
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
158
|
-
if (!clientWidth && !clientHeight)
|
|
159
|
-
return emptyRect;
|
|
160
|
-
var styles = getWindowOf(target).getComputedStyle(target), paddings = getPaddings(styles), horizPad = paddings.left + paddings.right, vertPad = paddings.top + paddings.bottom, width = toFloat(styles.width), height = toFloat(styles.height);
|
|
161
|
-
if (styles.boxSizing === "border-box" && (Math.round(width + horizPad) !== clientWidth && (width -= getBordersSize(styles, "left", "right") + horizPad), Math.round(height + vertPad) !== clientHeight && (height -= getBordersSize(styles, "top", "bottom") + vertPad)), !isDocumentElement(target)) {
|
|
162
|
-
var vertScrollbar = Math.round(width + horizPad) - clientWidth, horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
163
|
-
Math.abs(vertScrollbar) !== 1 && (width -= vertScrollbar), Math.abs(horizScrollbar) !== 1 && (height -= horizScrollbar);
|
|
164
|
-
}
|
|
165
|
-
return createRectInit(paddings.left, paddings.top, width, height);
|
|
166
|
-
}
|
|
167
|
-
var isSVGGraphicsElement = function() {
|
|
168
|
-
return typeof SVGGraphicsElement < "u" ? function(target) {
|
|
169
|
-
return target instanceof getWindowOf(target).SVGGraphicsElement;
|
|
170
|
-
} : function(target) {
|
|
171
|
-
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox == "function";
|
|
172
|
-
};
|
|
173
|
-
}();
|
|
174
|
-
function isDocumentElement(target) {
|
|
175
|
-
return target === getWindowOf(target).document.documentElement;
|
|
176
|
-
}
|
|
177
|
-
function getContentRect(target) {
|
|
178
|
-
return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
|
|
179
|
-
}
|
|
180
|
-
function createReadOnlyRect(_a) {
|
|
181
|
-
var x = _a.x, y = _a.y, width = _a.width, height = _a.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
|
|
182
|
-
return defineConfigurable(rect, {
|
|
183
|
-
x,
|
|
184
|
-
y,
|
|
185
|
-
width,
|
|
186
|
-
height,
|
|
187
|
-
top: y,
|
|
188
|
-
right: x + width,
|
|
189
|
-
bottom: height + y,
|
|
190
|
-
left: x
|
|
191
|
-
}), rect;
|
|
192
|
-
}
|
|
193
|
-
function createRectInit(x, y, width, height) {
|
|
194
|
-
return { x, y, width, height };
|
|
195
|
-
}
|
|
196
|
-
var ResizeObservation = (
|
|
197
|
-
/** @class */
|
|
198
|
-
function() {
|
|
199
|
-
function ResizeObservation2(target) {
|
|
200
|
-
this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = createRectInit(0, 0, 0, 0), this.target = target;
|
|
20
|
+
}, rejected = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.throw(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
201
25
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return this.contentRect_ = rect, rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
|
|
205
|
-
}, ResizeObservation2.prototype.broadcastRect = function() {
|
|
206
|
-
var rect = this.contentRect_;
|
|
207
|
-
return this.broadcastWidth = rect.width, this.broadcastHeight = rect.height, rect;
|
|
208
|
-
}, ResizeObservation2;
|
|
209
|
-
}()
|
|
210
|
-
), ResizeObserverEntry = (
|
|
211
|
-
/** @class */
|
|
212
|
-
function() {
|
|
213
|
-
function ResizeObserverEntry2(target, rectInit) {
|
|
214
|
-
var contentRect = createReadOnlyRect(rectInit);
|
|
215
|
-
defineConfigurable(this, { target, contentRect });
|
|
216
|
-
}
|
|
217
|
-
return ResizeObserverEntry2;
|
|
218
|
-
}()
|
|
219
|
-
), ResizeObserverSPI = (
|
|
220
|
-
/** @class */
|
|
221
|
-
function() {
|
|
222
|
-
function ResizeObserverSPI2(callback, controller, callbackCtx) {
|
|
223
|
-
if (this.activeObservations_ = [], this.observations_ = new MapShim(), typeof callback != "function")
|
|
224
|
-
throw new TypeError("The callback provided as parameter 1 is not a function.");
|
|
225
|
-
this.callback_ = callback, this.controller_ = controller, this.callbackCtx_ = callbackCtx;
|
|
226
|
-
}
|
|
227
|
-
return ResizeObserverSPI2.prototype.observe = function(target) {
|
|
228
|
-
if (!arguments.length)
|
|
229
|
-
throw new TypeError("1 argument required, but only 0 present.");
|
|
230
|
-
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
231
|
-
if (!(target instanceof getWindowOf(target).Element))
|
|
232
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
233
|
-
var observations = this.observations_;
|
|
234
|
-
observations.has(target) || (observations.set(target, new ResizeObservation(target)), this.controller_.addObserver(this), this.controller_.refresh());
|
|
235
|
-
}
|
|
236
|
-
}, ResizeObserverSPI2.prototype.unobserve = function(target) {
|
|
237
|
-
if (!arguments.length)
|
|
238
|
-
throw new TypeError("1 argument required, but only 0 present.");
|
|
239
|
-
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
240
|
-
if (!(target instanceof getWindowOf(target).Element))
|
|
241
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
242
|
-
var observations = this.observations_;
|
|
243
|
-
observations.has(target) && (observations.delete(target), observations.size || this.controller_.removeObserver(this));
|
|
244
|
-
}
|
|
245
|
-
}, ResizeObserverSPI2.prototype.disconnect = function() {
|
|
246
|
-
this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
|
|
247
|
-
}, ResizeObserverSPI2.prototype.gatherActive = function() {
|
|
248
|
-
var _this = this;
|
|
249
|
-
this.clearActive(), this.observations_.forEach(function(observation) {
|
|
250
|
-
observation.isActive() && _this.activeObservations_.push(observation);
|
|
251
|
-
});
|
|
252
|
-
}, ResizeObserverSPI2.prototype.broadcastActive = function() {
|
|
253
|
-
if (this.hasActive()) {
|
|
254
|
-
var ctx = this.callbackCtx_, entries = this.activeObservations_.map(function(observation) {
|
|
255
|
-
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
256
|
-
});
|
|
257
|
-
this.callback_.call(ctx, entries, ctx), this.clearActive();
|
|
258
|
-
}
|
|
259
|
-
}, ResizeObserverSPI2.prototype.clearActive = function() {
|
|
260
|
-
this.activeObservations_.splice(0);
|
|
261
|
-
}, ResizeObserverSPI2.prototype.hasActive = function() {
|
|
262
|
-
return this.activeObservations_.length > 0;
|
|
263
|
-
}, ResizeObserverSPI2;
|
|
264
|
-
}()
|
|
265
|
-
), observers = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new MapShim(), ResizeObserver = (
|
|
266
|
-
/** @class */
|
|
267
|
-
function() {
|
|
268
|
-
function ResizeObserver2(callback) {
|
|
269
|
-
if (!(this instanceof ResizeObserver2))
|
|
270
|
-
throw new TypeError("Cannot call a class as a function.");
|
|
271
|
-
if (!arguments.length)
|
|
272
|
-
throw new TypeError("1 argument required, but only 0 present.");
|
|
273
|
-
var controller = ResizeObserverController.getInstance(), observer = new ResizeObserverSPI(callback, controller, this);
|
|
274
|
-
observers.set(this, observer);
|
|
275
|
-
}
|
|
276
|
-
return ResizeObserver2;
|
|
277
|
-
}()
|
|
278
|
-
);
|
|
279
|
-
[
|
|
280
|
-
"observe",
|
|
281
|
-
"unobserve",
|
|
282
|
-
"disconnect"
|
|
283
|
-
].forEach(function(method) {
|
|
284
|
-
ResizeObserver.prototype[method] = function() {
|
|
285
|
-
var _a;
|
|
286
|
-
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
287
|
-
};
|
|
26
|
+
}, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
27
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
288
28
|
});
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const listeners = entry.target.__resizeListeners__ || [];
|
|
295
|
-
listeners.length && listeners.forEach((fn) => {
|
|
296
|
-
fn();
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}, addResizeListener = (element, fn) => {
|
|
300
|
-
isServer || (element.__resizeListeners__ || (element.__resizeListeners__ = [], element.__ro__ = new index(resizeHandler), element.__ro__.observe(element)), element.__resizeListeners__.push(fn));
|
|
301
|
-
}, removeResizeListener = (element, fn) => {
|
|
302
|
-
!element || !element.__resizeListeners__ || (element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1), element.__resizeListeners__.length || element.__ro__.disconnect());
|
|
303
|
-
};
|
|
29
|
+
import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
|
|
30
|
+
import { addResizeListener, removeResizeListener } from "@web-utils/integrations/resize";
|
|
31
|
+
import { cloneDeep } from "@web-utils/integrations/lodash";
|
|
32
|
+
import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
|
|
33
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
|
|
304
34
|
var render = function() {
|
|
305
35
|
var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
|
|
306
36
|
return _c("div", {
|
|
@@ -799,45 +529,51 @@ const __vue2_script = {
|
|
|
799
529
|
resize() {
|
|
800
530
|
isVerticalScrollbarVisible(this.$refs.treeWrapper) ? this.right = 4 + scrollbarWidth : this.right = 4;
|
|
801
531
|
},
|
|
802
|
-
|
|
803
|
-
|
|
532
|
+
showContextMenu(event, data, node) {
|
|
533
|
+
return __async(this, null, function* () {
|
|
534
|
+
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));
|
|
535
|
+
});
|
|
804
536
|
},
|
|
805
537
|
hideContextMenu() {
|
|
806
538
|
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
807
539
|
},
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
540
|
+
tryFetch() {
|
|
541
|
+
return __async(this, null, function* () {
|
|
542
|
+
var _a, _b;
|
|
543
|
+
if (this.lazy === !1 && this.fetchApi) {
|
|
544
|
+
const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, {});
|
|
545
|
+
if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
|
|
546
|
+
const data = cloneDeep(this.customRootNode);
|
|
547
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
|
|
548
|
+
} else if (isFunction(this.customRootNode)) {
|
|
549
|
+
const data = this.customRootNode(res.data);
|
|
550
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
|
|
551
|
+
} else
|
|
552
|
+
this.treeData = res.data;
|
|
553
|
+
}
|
|
554
|
+
});
|
|
821
555
|
},
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
556
|
+
loadNode(node, resolve) {
|
|
557
|
+
return __async(this, null, function* () {
|
|
558
|
+
var _a, _b, _c, _d;
|
|
559
|
+
if (node.level === 0) {
|
|
560
|
+
const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, node);
|
|
561
|
+
if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
|
|
562
|
+
const data = cloneDeep(this.customRootNode);
|
|
563
|
+
data[this.treeProps.children || "children"] = res.data, resolve([data]);
|
|
564
|
+
} else if (isFunction(this.customRootNode)) {
|
|
565
|
+
const data = this.customRootNode(res.data);
|
|
566
|
+
data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
|
|
567
|
+
} else
|
|
568
|
+
resolve(res.data);
|
|
569
|
+
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]);
|
|
570
|
+
} else {
|
|
571
|
+
if (node.leaf || node.data.isTempNode)
|
|
572
|
+
return resolve([]);
|
|
573
|
+
const res = yield this.fetchApi(node.data.id, node);
|
|
574
|
+
resolve(res.data), yield this.$nextTick(), this.$emit("node-loaded", res.data);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
841
577
|
},
|
|
842
578
|
clear() {
|
|
843
579
|
this.cancelEdit(), this.removeNewNode();
|
|
@@ -851,67 +587,68 @@ const __vue2_script = {
|
|
|
851
587
|
cancelEdit() {
|
|
852
588
|
this.editData && (isUndefined(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
853
589
|
},
|
|
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
|
-
|
|
590
|
+
editNode(node, data) {
|
|
591
|
+
return __async(this, null, function* () {
|
|
592
|
+
!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), {
|
|
593
|
+
inputValue: data[this.treeProps.label],
|
|
594
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
595
|
+
if (action === "confirm") {
|
|
596
|
+
try {
|
|
597
|
+
instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, yield this.onConfirm(this.curNode, this.curData), done();
|
|
598
|
+
} catch (e) {
|
|
599
|
+
instance.confirmButtonText = "确定";
|
|
600
|
+
}
|
|
601
|
+
instance.confirmButtonLoading = !1;
|
|
602
|
+
} else
|
|
603
|
+
done();
|
|
604
|
+
})
|
|
605
|
+
})).catch((_) => _);
|
|
606
|
+
});
|
|
607
|
+
},
|
|
608
|
+
appendRootNode() {
|
|
609
|
+
return __async(this, null, function* () {
|
|
610
|
+
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), {
|
|
611
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
612
|
+
if (action === "confirm") {
|
|
613
|
+
try {
|
|
614
|
+
this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
|
|
615
|
+
const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
|
|
616
|
+
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();
|
|
617
|
+
} catch (e) {
|
|
618
|
+
instance.confirmButtonText = "确定";
|
|
619
|
+
}
|
|
620
|
+
instance.confirmButtonLoading = !1;
|
|
621
|
+
} else
|
|
622
|
+
done();
|
|
623
|
+
})
|
|
624
|
+
})).catch((_) => _);
|
|
625
|
+
});
|
|
888
626
|
},
|
|
889
627
|
appendChildNode(node) {
|
|
890
628
|
this.text = "";
|
|
891
629
|
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) => {
|
|
630
|
+
node.expand(() => __async(this, null, function* () {
|
|
631
|
+
!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), {
|
|
632
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
896
633
|
if (action === "confirm") {
|
|
897
634
|
try {
|
|
898
635
|
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 {
|
|
636
|
+
const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
|
|
637
|
+
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();
|
|
638
|
+
} catch (e) {
|
|
902
639
|
instance.confirmButtonText = "确定";
|
|
903
640
|
}
|
|
904
641
|
instance.confirmButtonLoading = !1;
|
|
905
642
|
} else
|
|
906
643
|
done();
|
|
907
|
-
}
|
|
908
|
-
}).catch((_) => _);
|
|
909
|
-
});
|
|
644
|
+
})
|
|
645
|
+
})).catch((_) => _);
|
|
646
|
+
}));
|
|
910
647
|
},
|
|
911
648
|
appendChildNodeWithData(node, parentId, label) {
|
|
912
649
|
this.text = "";
|
|
913
650
|
const expanded = node.expanded;
|
|
914
|
-
node.expand(
|
|
651
|
+
node.expand(() => __async(this, null, function* () {
|
|
915
652
|
this.clear(), this.newChild = {
|
|
916
653
|
id: -1,
|
|
917
654
|
parentId,
|
|
@@ -919,24 +656,30 @@ const __vue2_script = {
|
|
|
919
656
|
edit: !1,
|
|
920
657
|
isTempNode: !0,
|
|
921
658
|
hasChildren: !1
|
|
922
|
-
}, this.$refs.tree.append(this.newChild, node),
|
|
923
|
-
});
|
|
659
|
+
}, this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded);
|
|
660
|
+
}));
|
|
924
661
|
},
|
|
925
662
|
appendPeerNode(node) {
|
|
926
663
|
node.parent && node.parent.level !== 0 ? this.appendChildNode(node.parent) : this.appendRootNode();
|
|
927
664
|
},
|
|
928
|
-
|
|
929
|
-
this
|
|
665
|
+
addRootNode(data) {
|
|
666
|
+
return __async(this, null, function* () {
|
|
667
|
+
this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
|
|
668
|
+
});
|
|
930
669
|
},
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
this
|
|
934
|
-
|
|
670
|
+
addChildNode(data) {
|
|
671
|
+
return __async(this, null, function* () {
|
|
672
|
+
this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => __async(this, null, function* () {
|
|
673
|
+
this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode);
|
|
674
|
+
})) : yield this.addRootNode(data);
|
|
675
|
+
});
|
|
935
676
|
},
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
this
|
|
939
|
-
|
|
677
|
+
addPeerNode(data) {
|
|
678
|
+
return __async(this, null, function* () {
|
|
679
|
+
this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => __async(this, null, function* () {
|
|
680
|
+
this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
|
|
681
|
+
})) : yield this.addRootNode(data);
|
|
682
|
+
});
|
|
940
683
|
},
|
|
941
684
|
updateNode(data) {
|
|
942
685
|
const node = this.$refs.tree.getNode(data);
|
|
@@ -955,60 +698,66 @@ const __vue2_script = {
|
|
|
955
698
|
hasChildren: !1
|
|
956
699
|
}, this.$emit("create-new-node", this.newChild);
|
|
957
700
|
},
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
701
|
+
removeNodeModal(node) {
|
|
702
|
+
return __async(this, null, function* () {
|
|
703
|
+
yield this.$confirm(
|
|
704
|
+
`你确定要删除${this.label}[<span class="break-word" style="color: orange">${node.data[this.treeProps.label]}</span>]吗?`,
|
|
705
|
+
"系统提示",
|
|
706
|
+
{
|
|
707
|
+
type: "warning",
|
|
708
|
+
modal: !0,
|
|
709
|
+
dangerouslyUseHTMLString: !0,
|
|
710
|
+
iconClass: "el-icon-question",
|
|
711
|
+
closeOnClickModal: !1,
|
|
712
|
+
confirmButtonClass: "el-button--danger",
|
|
713
|
+
cancelButtonClass: "el-button--primary is-plain",
|
|
714
|
+
beforeClose: (action, instance, done) => __async(this, null, function* () {
|
|
715
|
+
if (action === "confirm") {
|
|
716
|
+
try {
|
|
717
|
+
instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
|
|
718
|
+
const parentNode = node.parent, res = yield this.deleteApi(node.data.id);
|
|
719
|
+
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
|
|
720
|
+
} catch (_) {
|
|
721
|
+
}
|
|
722
|
+
instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
|
|
723
|
+
} else
|
|
724
|
+
done();
|
|
725
|
+
})
|
|
981
726
|
}
|
|
727
|
+
).catch((_) => _);
|
|
728
|
+
});
|
|
729
|
+
},
|
|
730
|
+
removeNode(node) {
|
|
731
|
+
return __async(this, null, function* () {
|
|
732
|
+
try {
|
|
733
|
+
const parentNode = node.parent;
|
|
734
|
+
if (this.deleteApi) {
|
|
735
|
+
const res = yield this.deleteApi(node.data.id);
|
|
736
|
+
res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
|
|
737
|
+
} else
|
|
738
|
+
this.$refs.tree.remove(node);
|
|
739
|
+
} catch (e) {
|
|
982
740
|
}
|
|
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
|
-
}
|
|
741
|
+
});
|
|
995
742
|
},
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
this.
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
743
|
+
onConfirm(node, data) {
|
|
744
|
+
return __async(this, null, function* () {
|
|
745
|
+
if (data[this.treeProps.label] === this.text || !isNotEmpty(this.text)) {
|
|
746
|
+
this.clear();
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
|
|
750
|
+
try {
|
|
751
|
+
if (this.loading = !0, data.id === -1) {
|
|
752
|
+
const res = yield this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
|
|
753
|
+
assignReactiveProperties(data, __spreadProps(__spreadValues({}, res.data), { isTempNode: !1 })), this.$emit("node-added", data, old, node), this.registerNode(node);
|
|
754
|
+
} else
|
|
755
|
+
yield this.updateApi(__spreadProps(__spreadValues({}, data), { [this.treeProps.label]: this.text }));
|
|
756
|
+
data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
|
|
757
|
+
} catch (e) {
|
|
758
|
+
}
|
|
759
|
+
data.loading = !1, this.loading = !1;
|
|
760
|
+
});
|
|
1012
761
|
},
|
|
1013
762
|
onCancel(node, data) {
|
|
1014
763
|
data.id === -1 ? this.$refs.tree.remove(node) : data.edit = !1, this.text = "";
|
|
@@ -1019,14 +768,18 @@ const __vue2_script = {
|
|
|
1019
768
|
getCurrentNode() {
|
|
1020
769
|
return this.$refs.tree.getCurrentNode();
|
|
1021
770
|
},
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
771
|
+
locateView() {
|
|
772
|
+
return __async(this, null, function* () {
|
|
773
|
+
yield this.$nextTick();
|
|
774
|
+
const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
|
|
775
|
+
el && el.scrollIntoView();
|
|
776
|
+
});
|
|
1026
777
|
},
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
778
|
+
scrollIntoView(expanded) {
|
|
779
|
+
return __async(this, null, function* () {
|
|
780
|
+
var _a, _b;
|
|
781
|
+
yield this.$nextTick(), expanded || (yield delay(300)), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
|
|
782
|
+
});
|
|
1030
783
|
},
|
|
1031
784
|
inputKeyup(event, node, data) {
|
|
1032
785
|
event.keyCode === 13 && this.onConfirm(node, data), event.keyCode === 27 && this.clear();
|
|
@@ -1062,8 +815,10 @@ const __vue2_script = {
|
|
|
1062
815
|
registerNode(node) {
|
|
1063
816
|
node.store.registerNode(node), delete node.store.nodesMap[-1];
|
|
1064
817
|
},
|
|
1065
|
-
|
|
1066
|
-
this
|
|
818
|
+
reloadTree() {
|
|
819
|
+
return __async(this, null, function* () {
|
|
820
|
+
this.lazy ? this.treeKey = Date.now() : yield this.tryFetch();
|
|
821
|
+
});
|
|
1067
822
|
}
|
|
1068
823
|
}
|
|
1069
824
|
}, __cssModules = {};
|