ele-admin-plus 1.2.2-beta.1 → 1.2.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ele-app/components/form-item-rest.js +3 -3
- package/es/ele-cropper/components/cropper-tools.js +1 -1
- package/es/ele-cropper/style/index.scss +10 -1
- package/es/ele-menus/components/item-title.js +4 -3
- package/es/ele-menus/types.d.ts +2 -0
- package/es/ele-split-panel/index.d.ts +2 -0
- package/es/ele-split-panel/index.js +8 -8
- package/es/ele-split-panel/props.d.ts +3 -1
- package/es/ele-split-panel/props.js +3 -1
- package/es/ele-tabs/style/index.scss +1 -2
- package/es/utils/hook.d.ts +16 -0
- package/es/utils/hook.js +57 -3
- package/lib/ele-app/components/form-item-rest.cjs +2 -2
- package/lib/ele-cropper/components/cropper-tools.cjs +1 -1
- package/lib/ele-cropper/style/index.scss +10 -1
- package/lib/ele-menus/components/item-title.cjs +4 -3
- package/lib/ele-menus/types.d.ts +2 -0
- package/lib/ele-split-panel/index.cjs +8 -8
- package/lib/ele-split-panel/index.d.ts +2 -0
- package/lib/ele-split-panel/props.cjs +3 -1
- package/lib/ele-split-panel/props.d.ts +3 -1
- package/lib/ele-tabs/style/index.scss +1 -2
- package/lib/utils/hook.cjs +56 -2
- package/lib/utils/hook.d.ts +16 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent } from "vue";
|
|
2
|
+
import { useFormItemRest } from "../../utils/hook";
|
|
3
3
|
const formItemRest = defineComponent({
|
|
4
4
|
name: "FormItemRest",
|
|
5
5
|
setup(_props, { slots }) {
|
|
6
|
-
|
|
6
|
+
useFormItemRest();
|
|
7
7
|
return () => {
|
|
8
8
|
var _a;
|
|
9
9
|
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
@@ -168,7 +168,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
168
168
|
accept: _ctx.accept,
|
|
169
169
|
showFileList: false,
|
|
170
170
|
beforeUpload: _ctx.handleUpload,
|
|
171
|
-
|
|
171
|
+
class: "ele-cropper-tool-upload"
|
|
172
172
|
}, {
|
|
173
173
|
default: withCtx(() => [
|
|
174
174
|
createVNode(_component_ElButton, {
|
|
@@ -68,12 +68,21 @@
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.ele-cropper-tool-item {
|
|
71
|
-
margin: 10px
|
|
71
|
+
margin: 10px 10px 0 0;
|
|
72
72
|
vertical-align: top;
|
|
73
73
|
|
|
74
74
|
&:last-child {
|
|
75
75
|
margin-right: 0;
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
& > .ele-cropper-tool-upload {
|
|
79
|
+
float: left;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ele-cropper-tool-upload {
|
|
83
|
+
line-height: 0;
|
|
84
|
+
display: inline-block;
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
.ele-cropper-tool {
|
|
@@ -52,7 +52,7 @@ const _hoisted_1 = {
|
|
|
52
52
|
key: 0,
|
|
53
53
|
class: "ele-menu-title"
|
|
54
54
|
};
|
|
55
|
-
const _hoisted_2 = ["href"];
|
|
55
|
+
const _hoisted_2 = ["href", "target"];
|
|
56
56
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
57
57
|
const _component_ElIcon = resolveComponent("ElIcon");
|
|
58
58
|
const _component_ElBadge = resolveComponent("ElBadge");
|
|
@@ -89,15 +89,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
89
89
|
_ctx.isExternalLink(_ctx.item.path) ? (openBlock(), createElementBlock("a", {
|
|
90
90
|
key: 0,
|
|
91
91
|
href: _ctx.item.path,
|
|
92
|
-
target: "_blank",
|
|
92
|
+
target: _ctx.item.pathTarget || "_blank",
|
|
93
93
|
class: "ele-menu-link",
|
|
94
94
|
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
95
95
|
}, ["stop"]))
|
|
96
96
|
}, null, 8, _hoisted_2)) : _ctx.item.path ? (openBlock(), createBlock(_component_RouterLink, {
|
|
97
97
|
key: 1,
|
|
98
98
|
to: _ctx.item.path,
|
|
99
|
+
target: _ctx.item.pathTarget,
|
|
99
100
|
class: "ele-menu-link"
|
|
100
|
-
}, null, 8, ["to"])) : createCommentVNode("", true)
|
|
101
|
+
}, null, 8, ["to", "target"])) : createCommentVNode("", true)
|
|
101
102
|
], 64)) : createCommentVNode("", true)
|
|
102
103
|
], 32)
|
|
103
104
|
], 64);
|
package/es/ele-menus/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6
6
|
maxSize: NumberConstructor;
|
|
7
7
|
space: StringConstructor;
|
|
8
8
|
customStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
9
|
+
customWrapStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
9
10
|
bodyStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
10
11
|
allowCollapse: BooleanConstructor;
|
|
11
12
|
collapseStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
@@ -37,6 +38,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
37
38
|
maxSize: NumberConstructor;
|
|
38
39
|
space: StringConstructor;
|
|
39
40
|
customStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
41
|
+
customWrapStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
40
42
|
bodyStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
41
43
|
allowCollapse: BooleanConstructor;
|
|
42
44
|
collapseStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
@@ -122,11 +122,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
122
122
|
}
|
|
123
123
|
return target;
|
|
124
124
|
};
|
|
125
|
-
const _hoisted_1 = {
|
|
126
|
-
ref: "wrapRef",
|
|
127
|
-
class: "ele-split-panel-wrap"
|
|
128
|
-
};
|
|
129
|
-
const _hoisted_2 = { class: "ele-split-panel-space" };
|
|
125
|
+
const _hoisted_1 = { class: "ele-split-panel-space" };
|
|
130
126
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
127
|
const _component_ArrowUp = resolveComponent("ArrowUp");
|
|
132
128
|
const _component_ArrowLeft = resolveComponent("ArrowLeft");
|
|
@@ -149,7 +145,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
149
145
|
})
|
|
150
146
|
}, {
|
|
151
147
|
default: withCtx(() => [
|
|
152
|
-
createElementVNode("div",
|
|
148
|
+
createElementVNode("div", {
|
|
149
|
+
ref: "wrapRef",
|
|
150
|
+
class: "ele-split-panel-wrap",
|
|
151
|
+
style: normalizeStyle(_ctx.customWrapStyle)
|
|
152
|
+
}, [
|
|
153
153
|
createElementVNode("div", {
|
|
154
154
|
ref: "sideRef",
|
|
155
155
|
class: "ele-split-panel-side",
|
|
@@ -157,14 +157,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
157
157
|
}, [
|
|
158
158
|
renderSlot(_ctx.$slots, "default")
|
|
159
159
|
], 4),
|
|
160
|
-
createElementVNode("div",
|
|
160
|
+
createElementVNode("div", _hoisted_1, [
|
|
161
161
|
_ctx.resizable ? (openBlock(), createElementBlock("div", {
|
|
162
162
|
key: 0,
|
|
163
163
|
class: "ele-split-resize-line",
|
|
164
164
|
onMousedown: _cache[0] || (_cache[0] = (...args) => _ctx.handleResize && _ctx.handleResize(...args))
|
|
165
165
|
}, null, 32)) : createCommentVNode("", true)
|
|
166
166
|
])
|
|
167
|
-
],
|
|
167
|
+
], 4),
|
|
168
168
|
createElementVNode("div", {
|
|
169
169
|
class: "ele-split-panel-body",
|
|
170
170
|
style: normalizeStyle(_ctx.bodyStyle)
|
|
@@ -13,8 +13,10 @@ export declare const splitPanelProps: {
|
|
|
13
13
|
maxSize: NumberConstructor;
|
|
14
14
|
/** 间距 */
|
|
15
15
|
space: StringConstructor;
|
|
16
|
-
/**
|
|
16
|
+
/** 自定义边栏样式 */
|
|
17
17
|
customStyle: PropType<StyleValue>;
|
|
18
|
+
/** 自定义边栏容器样式 */
|
|
19
|
+
customWrapStyle: PropType<StyleValue>;
|
|
18
20
|
/** 自定义内容样式 */
|
|
19
21
|
bodyStyle: PropType<StyleValue>;
|
|
20
22
|
/** 是否可折叠 */
|
|
@@ -1043,8 +1043,6 @@
|
|
|
1043
1043
|
/* 内部表格高度铺满 */
|
|
1044
1044
|
.ele-tabs.is-flex-table {
|
|
1045
1045
|
flex: 1;
|
|
1046
|
-
display: flex;
|
|
1047
|
-
flex-direction: column;
|
|
1048
1046
|
overflow: auto;
|
|
1049
1047
|
|
|
1050
1048
|
& > .el-tabs__content {
|
|
@@ -1056,6 +1054,7 @@
|
|
|
1056
1054
|
display: flex;
|
|
1057
1055
|
flex-direction: column;
|
|
1058
1056
|
box-sizing: border-box;
|
|
1057
|
+
overflow: auto;
|
|
1059
1058
|
|
|
1060
1059
|
& > .ele-pro-table {
|
|
1061
1060
|
flex: 1;
|
package/es/utils/hook.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
+
import { default as SortableJs } from 'sortablejs';
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 重置组件表单验证
|
|
6
|
+
*/
|
|
7
|
+
export declare function useFormItemRest(): void;
|
|
3
8
|
/**
|
|
4
9
|
* useTimer 返回结果
|
|
5
10
|
*/
|
|
@@ -111,3 +116,14 @@ export declare function useMoveEvent(option?: UseTouchEventOption<MoveEvent>): {
|
|
|
111
116
|
handleMousedown: (e: MouseEvent) => void;
|
|
112
117
|
handleTouchstart: (e: TouchEvent) => void;
|
|
113
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* 拖拽排序
|
|
121
|
+
* @param getEl 获取容器方法
|
|
122
|
+
* @param getData 获取数据方法
|
|
123
|
+
* @param updateData 更新数据方法
|
|
124
|
+
* @param options 自定义参数
|
|
125
|
+
*/
|
|
126
|
+
export declare function useSortable<T>(getEl: () => HTMLElement | undefined | null, getData: () => T[] | undefined | null, updateData: (data: T[]) => void, options?: SortableJs.Options): {
|
|
127
|
+
initSortable: () => void;
|
|
128
|
+
destroySortable: () => void;
|
|
129
|
+
};
|
package/es/utils/hook.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { ref, onBeforeUnmount } from "vue";
|
|
1
|
+
import { provide, ref, onBeforeUnmount, onMounted } from "vue";
|
|
2
|
+
import { formItemContextKey } from "element-plus";
|
|
3
|
+
import SortableJs from "sortablejs";
|
|
4
|
+
function useFormItemRest() {
|
|
5
|
+
provide(formItemContextKey, null);
|
|
6
|
+
}
|
|
2
7
|
function useTimer(ms, cb) {
|
|
3
8
|
let timer = null;
|
|
4
9
|
const waiting = ref(false);
|
|
@@ -31,10 +36,18 @@ function useMediaQuery(query, onChange) {
|
|
|
31
36
|
};
|
|
32
37
|
const startWatch = () => {
|
|
33
38
|
stopWatch();
|
|
34
|
-
|
|
39
|
+
if ("addEventListener" in mediaQuery) {
|
|
40
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
41
|
+
} else {
|
|
42
|
+
mediaQuery.addListener(handleChange);
|
|
43
|
+
}
|
|
35
44
|
};
|
|
36
45
|
const stopWatch = () => {
|
|
37
|
-
|
|
46
|
+
if ("removeEventListener" in mediaQuery) {
|
|
47
|
+
mediaQuery.removeEventListener("change", handleChange);
|
|
48
|
+
} else {
|
|
49
|
+
mediaQuery.removeListener(handleChange);
|
|
50
|
+
}
|
|
38
51
|
handleChange();
|
|
39
52
|
};
|
|
40
53
|
onBeforeUnmount(() => {
|
|
@@ -253,11 +266,52 @@ function useMoveEvent(option) {
|
|
|
253
266
|
handleTouchstart
|
|
254
267
|
};
|
|
255
268
|
}
|
|
269
|
+
function useSortable(getEl, getData, updateData, options) {
|
|
270
|
+
let sortableIns = null;
|
|
271
|
+
const destroySortable = () => {
|
|
272
|
+
if (sortableIns != null) {
|
|
273
|
+
sortableIns.destroy();
|
|
274
|
+
}
|
|
275
|
+
sortableIns = null;
|
|
276
|
+
};
|
|
277
|
+
const initSortable = () => {
|
|
278
|
+
destroySortable();
|
|
279
|
+
const el = getEl();
|
|
280
|
+
if (el == null) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
sortableIns = new SortableJs(el, {
|
|
284
|
+
onUpdate: ({ oldDraggableIndex, newDraggableIndex }) => {
|
|
285
|
+
if (typeof oldDraggableIndex === "number" && typeof newDraggableIndex === "number") {
|
|
286
|
+
const data = [...getData() || []];
|
|
287
|
+
data.splice(
|
|
288
|
+
newDraggableIndex,
|
|
289
|
+
0,
|
|
290
|
+
data.splice(oldDraggableIndex, 1)[0]
|
|
291
|
+
);
|
|
292
|
+
updateData(data);
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
setData: () => {
|
|
296
|
+
},
|
|
297
|
+
...options || {}
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
onMounted(() => {
|
|
301
|
+
initSortable();
|
|
302
|
+
});
|
|
303
|
+
onBeforeUnmount(() => {
|
|
304
|
+
destroySortable();
|
|
305
|
+
});
|
|
306
|
+
return { initSortable, destroySortable };
|
|
307
|
+
}
|
|
256
308
|
export {
|
|
257
309
|
useCollapseAnim,
|
|
310
|
+
useFormItemRest,
|
|
258
311
|
useMediaQuery,
|
|
259
312
|
useMousewheel,
|
|
260
313
|
useMoveEvent,
|
|
314
|
+
useSortable,
|
|
261
315
|
useTimer,
|
|
262
316
|
useTouchEvent,
|
|
263
317
|
useWindowListener
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const
|
|
3
|
+
const hook = require("../../utils/hook");
|
|
4
4
|
const formItemRest = vue.defineComponent({
|
|
5
5
|
name: "FormItemRest",
|
|
6
6
|
setup(_props, { slots }) {
|
|
7
|
-
|
|
7
|
+
hook.useFormItemRest();
|
|
8
8
|
return () => {
|
|
9
9
|
var _a;
|
|
10
10
|
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
@@ -169,7 +169,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
169
169
|
accept: _ctx.accept,
|
|
170
170
|
showFileList: false,
|
|
171
171
|
beforeUpload: _ctx.handleUpload,
|
|
172
|
-
|
|
172
|
+
class: "ele-cropper-tool-upload"
|
|
173
173
|
}, {
|
|
174
174
|
default: vue.withCtx(() => [
|
|
175
175
|
vue.createVNode(_component_ElButton, {
|
|
@@ -68,12 +68,21 @@
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.ele-cropper-tool-item {
|
|
71
|
-
margin: 10px
|
|
71
|
+
margin: 10px 10px 0 0;
|
|
72
72
|
vertical-align: top;
|
|
73
73
|
|
|
74
74
|
&:last-child {
|
|
75
75
|
margin-right: 0;
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
& > .ele-cropper-tool-upload {
|
|
79
|
+
float: left;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ele-cropper-tool-upload {
|
|
83
|
+
line-height: 0;
|
|
84
|
+
display: inline-block;
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
.ele-cropper-tool {
|
|
@@ -53,7 +53,7 @@ const _hoisted_1 = {
|
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "ele-menu-title"
|
|
55
55
|
};
|
|
56
|
-
const _hoisted_2 = ["href"];
|
|
56
|
+
const _hoisted_2 = ["href", "target"];
|
|
57
57
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
58
58
|
const _component_ElIcon = vue.resolveComponent("ElIcon");
|
|
59
59
|
const _component_ElBadge = vue.resolveComponent("ElBadge");
|
|
@@ -90,15 +90,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
90
90
|
_ctx.isExternalLink(_ctx.item.path) ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
91
91
|
key: 0,
|
|
92
92
|
href: _ctx.item.path,
|
|
93
|
-
target: "_blank",
|
|
93
|
+
target: _ctx.item.pathTarget || "_blank",
|
|
94
94
|
class: "ele-menu-link",
|
|
95
95
|
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
96
96
|
}, ["stop"]))
|
|
97
97
|
}, null, 8, _hoisted_2)) : _ctx.item.path ? (vue.openBlock(), vue.createBlock(_component_RouterLink, {
|
|
98
98
|
key: 1,
|
|
99
99
|
to: _ctx.item.path,
|
|
100
|
+
target: _ctx.item.pathTarget,
|
|
100
101
|
class: "ele-menu-link"
|
|
101
|
-
}, null, 8, ["to"])) : vue.createCommentVNode("", true)
|
|
102
|
+
}, null, 8, ["to", "target"])) : vue.createCommentVNode("", true)
|
|
102
103
|
], 64)) : vue.createCommentVNode("", true)
|
|
103
104
|
], 32)
|
|
104
105
|
], 64);
|
package/lib/ele-menus/types.d.ts
CHANGED
|
@@ -123,11 +123,7 @@ const _export_sfc = (sfc, props2) => {
|
|
|
123
123
|
}
|
|
124
124
|
return target;
|
|
125
125
|
};
|
|
126
|
-
const _hoisted_1 = {
|
|
127
|
-
ref: "wrapRef",
|
|
128
|
-
class: "ele-split-panel-wrap"
|
|
129
|
-
};
|
|
130
|
-
const _hoisted_2 = { class: "ele-split-panel-space" };
|
|
126
|
+
const _hoisted_1 = { class: "ele-split-panel-space" };
|
|
131
127
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
132
128
|
const _component_ArrowUp = vue.resolveComponent("ArrowUp");
|
|
133
129
|
const _component_ArrowLeft = vue.resolveComponent("ArrowLeft");
|
|
@@ -150,7 +146,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
150
146
|
})
|
|
151
147
|
}, {
|
|
152
148
|
default: vue.withCtx(() => [
|
|
153
|
-
vue.createElementVNode("div",
|
|
149
|
+
vue.createElementVNode("div", {
|
|
150
|
+
ref: "wrapRef",
|
|
151
|
+
class: "ele-split-panel-wrap",
|
|
152
|
+
style: vue.normalizeStyle(_ctx.customWrapStyle)
|
|
153
|
+
}, [
|
|
154
154
|
vue.createElementVNode("div", {
|
|
155
155
|
ref: "sideRef",
|
|
156
156
|
class: "ele-split-panel-side",
|
|
@@ -158,14 +158,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
158
158
|
}, [
|
|
159
159
|
vue.renderSlot(_ctx.$slots, "default")
|
|
160
160
|
], 4),
|
|
161
|
-
vue.createElementVNode("div",
|
|
161
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
162
162
|
_ctx.resizable ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
163
163
|
key: 0,
|
|
164
164
|
class: "ele-split-resize-line",
|
|
165
165
|
onMousedown: _cache[0] || (_cache[0] = (...args) => _ctx.handleResize && _ctx.handleResize(...args))
|
|
166
166
|
}, null, 32)) : vue.createCommentVNode("", true)
|
|
167
167
|
])
|
|
168
|
-
],
|
|
168
|
+
], 4),
|
|
169
169
|
vue.createElementVNode("div", {
|
|
170
170
|
class: "ele-split-panel-body",
|
|
171
171
|
style: vue.normalizeStyle(_ctx.bodyStyle)
|
|
@@ -6,6 +6,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6
6
|
maxSize: NumberConstructor;
|
|
7
7
|
space: StringConstructor;
|
|
8
8
|
customStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
9
|
+
customWrapStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
9
10
|
bodyStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
10
11
|
allowCollapse: BooleanConstructor;
|
|
11
12
|
collapseStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
@@ -37,6 +38,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
37
38
|
maxSize: NumberConstructor;
|
|
38
39
|
space: StringConstructor;
|
|
39
40
|
customStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
41
|
+
customWrapStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
40
42
|
bodyStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
41
43
|
allowCollapse: BooleanConstructor;
|
|
42
44
|
collapseStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
|
|
@@ -13,8 +13,10 @@ export declare const splitPanelProps: {
|
|
|
13
13
|
maxSize: NumberConstructor;
|
|
14
14
|
/** 间距 */
|
|
15
15
|
space: StringConstructor;
|
|
16
|
-
/**
|
|
16
|
+
/** 自定义边栏样式 */
|
|
17
17
|
customStyle: PropType<StyleValue>;
|
|
18
|
+
/** 自定义边栏容器样式 */
|
|
19
|
+
customWrapStyle: PropType<StyleValue>;
|
|
18
20
|
/** 自定义内容样式 */
|
|
19
21
|
bodyStyle: PropType<StyleValue>;
|
|
20
22
|
/** 是否可折叠 */
|
|
@@ -1043,8 +1043,6 @@
|
|
|
1043
1043
|
/* 内部表格高度铺满 */
|
|
1044
1044
|
.ele-tabs.is-flex-table {
|
|
1045
1045
|
flex: 1;
|
|
1046
|
-
display: flex;
|
|
1047
|
-
flex-direction: column;
|
|
1048
1046
|
overflow: auto;
|
|
1049
1047
|
|
|
1050
1048
|
& > .el-tabs__content {
|
|
@@ -1056,6 +1054,7 @@
|
|
|
1056
1054
|
display: flex;
|
|
1057
1055
|
flex-direction: column;
|
|
1058
1056
|
box-sizing: border-box;
|
|
1057
|
+
overflow: auto;
|
|
1059
1058
|
|
|
1060
1059
|
& > .ele-pro-table {
|
|
1061
1060
|
flex: 1;
|
package/lib/utils/hook.cjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
+
const elementPlus = require("element-plus");
|
|
5
|
+
const SortableJs = require("sortablejs");
|
|
6
|
+
function useFormItemRest() {
|
|
7
|
+
vue.provide(elementPlus.formItemContextKey, null);
|
|
8
|
+
}
|
|
4
9
|
function useTimer(ms, cb) {
|
|
5
10
|
let timer = null;
|
|
6
11
|
const waiting = vue.ref(false);
|
|
@@ -33,10 +38,18 @@ function useMediaQuery(query, onChange) {
|
|
|
33
38
|
};
|
|
34
39
|
const startWatch = () => {
|
|
35
40
|
stopWatch();
|
|
36
|
-
|
|
41
|
+
if ("addEventListener" in mediaQuery) {
|
|
42
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
43
|
+
} else {
|
|
44
|
+
mediaQuery.addListener(handleChange);
|
|
45
|
+
}
|
|
37
46
|
};
|
|
38
47
|
const stopWatch = () => {
|
|
39
|
-
|
|
48
|
+
if ("removeEventListener" in mediaQuery) {
|
|
49
|
+
mediaQuery.removeEventListener("change", handleChange);
|
|
50
|
+
} else {
|
|
51
|
+
mediaQuery.removeListener(handleChange);
|
|
52
|
+
}
|
|
40
53
|
handleChange();
|
|
41
54
|
};
|
|
42
55
|
vue.onBeforeUnmount(() => {
|
|
@@ -255,10 +268,51 @@ function useMoveEvent(option) {
|
|
|
255
268
|
handleTouchstart
|
|
256
269
|
};
|
|
257
270
|
}
|
|
271
|
+
function useSortable(getEl, getData, updateData, options) {
|
|
272
|
+
let sortableIns = null;
|
|
273
|
+
const destroySortable = () => {
|
|
274
|
+
if (sortableIns != null) {
|
|
275
|
+
sortableIns.destroy();
|
|
276
|
+
}
|
|
277
|
+
sortableIns = null;
|
|
278
|
+
};
|
|
279
|
+
const initSortable = () => {
|
|
280
|
+
destroySortable();
|
|
281
|
+
const el = getEl();
|
|
282
|
+
if (el == null) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
sortableIns = new SortableJs(el, {
|
|
286
|
+
onUpdate: ({ oldDraggableIndex, newDraggableIndex }) => {
|
|
287
|
+
if (typeof oldDraggableIndex === "number" && typeof newDraggableIndex === "number") {
|
|
288
|
+
const data = [...getData() || []];
|
|
289
|
+
data.splice(
|
|
290
|
+
newDraggableIndex,
|
|
291
|
+
0,
|
|
292
|
+
data.splice(oldDraggableIndex, 1)[0]
|
|
293
|
+
);
|
|
294
|
+
updateData(data);
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
setData: () => {
|
|
298
|
+
},
|
|
299
|
+
...options || {}
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
vue.onMounted(() => {
|
|
303
|
+
initSortable();
|
|
304
|
+
});
|
|
305
|
+
vue.onBeforeUnmount(() => {
|
|
306
|
+
destroySortable();
|
|
307
|
+
});
|
|
308
|
+
return { initSortable, destroySortable };
|
|
309
|
+
}
|
|
258
310
|
exports.useCollapseAnim = useCollapseAnim;
|
|
311
|
+
exports.useFormItemRest = useFormItemRest;
|
|
259
312
|
exports.useMediaQuery = useMediaQuery;
|
|
260
313
|
exports.useMousewheel = useMousewheel;
|
|
261
314
|
exports.useMoveEvent = useMoveEvent;
|
|
315
|
+
exports.useSortable = useSortable;
|
|
262
316
|
exports.useTimer = useTimer;
|
|
263
317
|
exports.useTouchEvent = useTouchEvent;
|
|
264
318
|
exports.useWindowListener = useWindowListener;
|
package/lib/utils/hook.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
+
import { default as SortableJs } from 'sortablejs';
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 重置组件表单验证
|
|
6
|
+
*/
|
|
7
|
+
export declare function useFormItemRest(): void;
|
|
3
8
|
/**
|
|
4
9
|
* useTimer 返回结果
|
|
5
10
|
*/
|
|
@@ -111,3 +116,14 @@ export declare function useMoveEvent(option?: UseTouchEventOption<MoveEvent>): {
|
|
|
111
116
|
handleMousedown: (e: MouseEvent) => void;
|
|
112
117
|
handleTouchstart: (e: TouchEvent) => void;
|
|
113
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* 拖拽排序
|
|
121
|
+
* @param getEl 获取容器方法
|
|
122
|
+
* @param getData 获取数据方法
|
|
123
|
+
* @param updateData 更新数据方法
|
|
124
|
+
* @param options 自定义参数
|
|
125
|
+
*/
|
|
126
|
+
export declare function useSortable<T>(getEl: () => HTMLElement | undefined | null, getData: () => T[] | undefined | null, updateData: (data: T[]) => void, options?: SortableJs.Options): {
|
|
127
|
+
initSortable: () => void;
|
|
128
|
+
destroySortable: () => void;
|
|
129
|
+
};
|