@wfrog/vc-ui 1.5.3 → 1.6.1
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/es/chunk/CL65DvCP.mjs +25 -0
- package/dist/es/chunk/DRLHgORP.mjs +26 -0
- package/dist/es/chunk/Mq_fqKb4.mjs +41 -0
- package/dist/es/components/explorer-container/explorer-container.mjs +4 -4
- package/dist/es/components/explorer-container/index.css +7 -5
- package/dist/es/components/explorer-form/explorer-form.d.ts +2 -2
- package/dist/es/components/explorer-form/explorer-form.mjs +23 -10
- package/dist/es/components/explorer-form/explorer-form.vue.d.ts +5 -3
- package/dist/es/components/explorer-form/index.css +9 -7
- package/dist/es/components/explorer-list/explorer-list.d.ts +3 -1
- package/dist/es/components/explorer-list/explorer-list.mjs +65 -69
- package/dist/es/components/explorer-list/explorer-list.vue.d.ts +5 -1
- package/dist/es/components/explorer-list/index.css +15 -11
- package/dist/es/components/explorer-tree/explorer-tree.d.ts +3 -1
- package/dist/es/components/explorer-tree/explorer-tree.mjs +34 -42
- package/dist/es/components/explorer-tree/explorer-tree.vue.d.ts +5 -1
- package/dist/es/components/explorer-tree/index.css +18 -13
- package/dist/es/components/input/index.css +1 -1
- package/dist/es/components/input/input.d.ts +1 -0
- package/dist/es/components/input/input.mjs +6 -4
- package/dist/es/components/input/input.vue.d.ts +1 -0
- package/dist/es/components/tags/tags.mjs +3 -21
- package/dist/es/components/thousand-input/thousand-input.mjs +3 -35
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +8 -2
- package/dist/es/directives/cleave/index.mjs +4 -0
- package/dist/es/directives/focus/index.mjs +1 -0
- package/dist/es/directives/index.mjs +16 -0
- package/dist/es/directives/thousand/index.mjs +4 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.mjs +4 -1
- package/dist/global.d.ts +5 -0
- package/dist/index.css +50 -37
- package/package.json +10 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const vFocus = {
|
|
2
|
+
mounted: (el) => {
|
|
3
|
+
let input;
|
|
4
|
+
if (el.tagName === "input") {
|
|
5
|
+
input = el;
|
|
6
|
+
} else {
|
|
7
|
+
const elInput = el.getElementsByTagName("input");
|
|
8
|
+
if (elInput.length > 0) {
|
|
9
|
+
input = elInput[0];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
if (input) {
|
|
13
|
+
setTimeout(() => input.focus(), 0);
|
|
14
|
+
const len = input.value.length;
|
|
15
|
+
input.setSelectionRange(len, len);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const __vite_glob_0_1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
21
|
+
__proto__: null,
|
|
22
|
+
default: vFocus
|
|
23
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
24
|
+
|
|
25
|
+
export { __vite_glob_0_1 as _, vFocus as v };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { i as index } from './BaJ7k5Lg.mjs';
|
|
2
|
+
import 'vue';
|
|
3
|
+
import './D9iEroQw.mjs';
|
|
4
|
+
|
|
5
|
+
const cleave = {
|
|
6
|
+
mounted: async (el, binding) => {
|
|
7
|
+
const Cleave = await index.loadCdnSingle("cleave");
|
|
8
|
+
const [elInput] = el.getElementsByTagName("input");
|
|
9
|
+
elInput.cleave = new Cleave(elInput, binding.value || {});
|
|
10
|
+
},
|
|
11
|
+
updated: (el) => {
|
|
12
|
+
const event = new Event("input", { bubbles: true });
|
|
13
|
+
const [elInput] = el.getElementsByTagName("input");
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
elInput.value = elInput.cleave.properties.result;
|
|
16
|
+
elInput.dispatchEvent(event);
|
|
17
|
+
}, 100);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const __vite_glob_0_0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
default: cleave
|
|
24
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
25
|
+
|
|
26
|
+
export { __vite_glob_0_0 as _, cleave as c };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { i as index } from './BaJ7k5Lg.mjs';
|
|
2
|
+
import 'vue';
|
|
3
|
+
import './D9iEroQw.mjs';
|
|
4
|
+
|
|
5
|
+
const thousand = {
|
|
6
|
+
mounted: async (el, binding) => {
|
|
7
|
+
const elInput = el.getElementsByTagName("input")[binding.value?.elInputIndex || 0] || el.getElementsByTagName("input")[0];
|
|
8
|
+
elInput.style.textAlign = "right";
|
|
9
|
+
elInput.style.fontFamily = "Pathway Gothic One";
|
|
10
|
+
const disabled = elInput.disabled;
|
|
11
|
+
elInput.disabled = true;
|
|
12
|
+
const Cleave = await index.loadCdnSingle("cleave");
|
|
13
|
+
const option = { decimalScale: 2, integerScale: 0, prefix: "", ...binding.value };
|
|
14
|
+
elInput.cleave = new Cleave(elInput, {
|
|
15
|
+
numeral: true,
|
|
16
|
+
numeralThousandsGroupStyle: "thousand",
|
|
17
|
+
numeralDecimalScale: option.decimalScale,
|
|
18
|
+
numeralIntegerScale: option.integerScale,
|
|
19
|
+
prefix: option.prefix
|
|
20
|
+
});
|
|
21
|
+
elInput.value = elInput.cleave?.properties?.result || "";
|
|
22
|
+
elInput.disabled = disabled;
|
|
23
|
+
},
|
|
24
|
+
updated: (el, binding) => {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
const event = new Event("input", { bubbles: true });
|
|
27
|
+
const elInput = el.getElementsByTagName("input")[binding.value?.elInputIndex || 0] || el.getElementsByTagName("input")[0];
|
|
28
|
+
elInput.dispatchEvent(event);
|
|
29
|
+
if (elInput.cleave) {
|
|
30
|
+
elInput.value = elInput.cleave?.properties?.result || "";
|
|
31
|
+
}
|
|
32
|
+
}, 0);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const __vite_glob_0_2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
37
|
+
__proto__: null,
|
|
38
|
+
default: thousand
|
|
39
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
40
|
+
|
|
41
|
+
export { __vite_glob_0_2 as _, thousand as t };
|
|
@@ -54,12 +54,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
/* unplugin-vue-components disabled */const header = "
|
|
58
|
-
const icon = "
|
|
57
|
+
/* unplugin-vue-components disabled */const header = "_header_4odhg_8";
|
|
58
|
+
const icon = "_icon_4odhg_26";
|
|
59
59
|
const style0 = {
|
|
60
|
-
"explorer-container": "_explorer-
|
|
60
|
+
"explorer-container": "_explorer-container_4odhg_1",
|
|
61
61
|
header: header,
|
|
62
|
-
"header-container": "_header-
|
|
62
|
+
"header-container": "_header-container_4odhg_22",
|
|
63
63
|
icon: icon
|
|
64
64
|
};
|
|
65
65
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* source: src/components/explorer-container/explorer-container.vue */
|
|
2
|
-
._explorer-
|
|
2
|
+
._explorer-container_4odhg_1 {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
flex-grow: 1;
|
|
6
6
|
height: 100px;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
8
|
+
._header_4odhg_8 {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: space-between;
|
|
@@ -18,9 +18,11 @@
|
|
|
18
18
|
flex-wrap: wrap;
|
|
19
19
|
row-gap: 8px;
|
|
20
20
|
}
|
|
21
|
-
._header-
|
|
22
|
-
font-size:
|
|
21
|
+
._header-container_4odhg_22 {
|
|
22
|
+
font-size: var(--el-font-size-medium);
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
._icon_4odhg_26 {
|
|
25
25
|
margin-right: 4px;
|
|
26
|
+
font-size: 1.1em;
|
|
27
|
+
transform: translateY(1px);
|
|
26
28
|
}
|
|
@@ -12,8 +12,8 @@ export interface IExplorerFormProps {
|
|
|
12
12
|
autoInitial?: boolean;
|
|
13
13
|
defaultEditing?: boolean;
|
|
14
14
|
labelPosition?: FormProps['labelPosition'];
|
|
15
|
-
onCancel?: () => void | Promise<void
|
|
16
|
-
onSave?: (data: Record<string, any>) => void | Promise<void
|
|
15
|
+
onCancel?: () => void | Promise<void> | Promise<() => void | Promise<void>>;
|
|
16
|
+
onSave?: (data: Record<string, any>) => void | Promise<void> | Promise<() => void | Promise<void>>;
|
|
17
17
|
}
|
|
18
18
|
export interface IExplorerFormEmits {
|
|
19
19
|
(e: 'clickEdit'): void;
|
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
} }
|
|
26
26
|
},
|
|
27
27
|
emits: ["clickEdit"],
|
|
28
|
-
setup(__props, { emit: __emit }) {
|
|
28
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
29
29
|
const props = __props;
|
|
30
30
|
const emits = __emit;
|
|
31
31
|
const isEditing = ref(false);
|
|
@@ -37,17 +37,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
}
|
|
38
38
|
async function handleCancel() {
|
|
39
39
|
formRef.value.resetFields();
|
|
40
|
-
await props.onCancel();
|
|
40
|
+
const cb = await props.onCancel();
|
|
41
41
|
isEditing.value = false;
|
|
42
|
+
typeof cb === "function" && await cb();
|
|
42
43
|
}
|
|
43
44
|
async function handleSave() {
|
|
44
45
|
const valid = await formRef.value.validate();
|
|
45
46
|
if (!valid) {
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
let cb = null;
|
|
50
|
+
try {
|
|
51
|
+
loading.value = true;
|
|
52
|
+
cb = await props.onSave(props.form.fields);
|
|
53
|
+
formRef.value?.setInitialValues(props.form.fields);
|
|
54
|
+
isEditing.value = false;
|
|
55
|
+
} finally {
|
|
56
|
+
loading.value = false;
|
|
57
|
+
}
|
|
58
|
+
typeof cb === "function" && await cb();
|
|
51
59
|
}
|
|
52
60
|
const editingWatch = watch(() => props.defaultEditing, (val) => {
|
|
53
61
|
isEditing.value = val;
|
|
@@ -58,6 +66,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
66
|
const initialValuesWatch = watch(() => props.initialValues, () => {
|
|
59
67
|
props.initialValues && formRef.value?.setInitialValues(props.initialValues);
|
|
60
68
|
}, { immediate: true, deep: true });
|
|
69
|
+
__expose({
|
|
70
|
+
toggleIsEditing: (val) => {
|
|
71
|
+
isEditing.value = val ?? !isEditing.value;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
61
74
|
onBeforeUnmount(() => {
|
|
62
75
|
initialValuesWatch.stop();
|
|
63
76
|
autoInitialWatch.stop();
|
|
@@ -148,13 +161,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
161
|
}
|
|
149
162
|
});
|
|
150
163
|
|
|
151
|
-
/* unplugin-vue-components disabled */const header = "
|
|
152
|
-
const icon = "
|
|
153
|
-
const actions = "
|
|
164
|
+
/* unplugin-vue-components disabled */const header = "_header_19l5u_8";
|
|
165
|
+
const icon = "_icon_19l5u_25";
|
|
166
|
+
const actions = "_actions_19l5u_31";
|
|
154
167
|
const style0 = {
|
|
155
|
-
"explorer-form": "_explorer-
|
|
168
|
+
"explorer-form": "_explorer-form_19l5u_1",
|
|
156
169
|
header: header,
|
|
157
|
-
"header-container": "_header-
|
|
170
|
+
"header-container": "_header-container_19l5u_21",
|
|
158
171
|
icon: icon,
|
|
159
172
|
actions: actions
|
|
160
173
|
};
|
|
@@ -192,14 +192,16 @@ declare function __VLS_template(): {
|
|
|
192
192
|
rootEl: HTMLDivElement;
|
|
193
193
|
};
|
|
194
194
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
195
|
-
declare const __VLS_component: import('vue').DefineComponent<IExplorerFormProps, {
|
|
195
|
+
declare const __VLS_component: import('vue').DefineComponent<IExplorerFormProps, {
|
|
196
|
+
toggleIsEditing: (val?: boolean) => void;
|
|
197
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
196
198
|
clickEdit: () => any;
|
|
197
199
|
}, string, import('vue').PublicProps, Readonly<IExplorerFormProps> & Readonly<{
|
|
198
200
|
onClickEdit?: (() => any) | undefined;
|
|
199
201
|
}>, {
|
|
200
202
|
icon: string;
|
|
201
|
-
onCancel: () => void | Promise<void
|
|
202
|
-
onSave: (data: Record<string, any>) => void | Promise<void
|
|
203
|
+
onCancel: () => void | Promise<void> | Promise<() => void | Promise<void>>;
|
|
204
|
+
onSave: (data: Record<string, any>) => void | Promise<void> | Promise<() => void | Promise<void>>;
|
|
203
205
|
labelPosition: import('element-plus').FormProps["labelPosition"];
|
|
204
206
|
autoInitial: boolean;
|
|
205
207
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* source: src/components/explorer-form/explorer-form.vue */
|
|
2
|
-
._explorer-
|
|
2
|
+
._explorer-form_19l5u_1 {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
flex-grow: 1;
|
|
6
6
|
height: 100px;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
8
|
+
._header_19l5u_8 {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: space-between;
|
|
@@ -17,17 +17,19 @@
|
|
|
17
17
|
flex-wrap: wrap;
|
|
18
18
|
row-gap: 8px;
|
|
19
19
|
}
|
|
20
|
-
._header-
|
|
21
|
-
font-size:
|
|
20
|
+
._header-container_19l5u_21 {
|
|
21
|
+
font-size: var(--el-font-size-medium);
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
._icon_19l5u_25 {
|
|
24
24
|
margin-right: 4px;
|
|
25
|
+
font-size: 1.1em;
|
|
26
|
+
transform: translateY(1px);
|
|
25
27
|
}
|
|
26
|
-
.
|
|
28
|
+
._actions_19l5u_31 {
|
|
27
29
|
display: flex;
|
|
28
30
|
align-items: center;
|
|
29
31
|
gap: 8px;
|
|
30
32
|
}
|
|
31
|
-
.
|
|
33
|
+
._actions_19l5u_31 .el-button {
|
|
32
34
|
margin-left: 0 !important;
|
|
33
35
|
}
|
|
@@ -7,7 +7,7 @@ export interface IExplorerListItem<T = any> {
|
|
|
7
7
|
}
|
|
8
8
|
export interface IExplorerListProps {
|
|
9
9
|
data?: IExplorerListItem[];
|
|
10
|
-
actions?: ('create' | 'modify' | 'remove')[];
|
|
10
|
+
actions?: ('create' | 'modify' | 'remove' | 'up' | 'down' | 'action')[];
|
|
11
11
|
filterMethod?: (keyword: string, item: IExplorerListItem) => boolean;
|
|
12
12
|
emptyText?: string;
|
|
13
13
|
loading?: boolean;
|
|
@@ -20,4 +20,6 @@ export interface IExplorerListEmits {
|
|
|
20
20
|
(e: 'create', value: string | number, item: IExplorerListItem): void;
|
|
21
21
|
(e: 'modify', value: string | number, item: IExplorerListItem): void;
|
|
22
22
|
(e: 'remove', value: string | number, item: IExplorerListItem): void;
|
|
23
|
+
(e: 'up', value: string | number, node: Node): void;
|
|
24
|
+
(e: 'down', value: string | number, node: Node): void;
|
|
23
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
import '../../chunk/By7FMB3I.mjs';
|
|
3
|
-
import { defineComponent, ref, computed, createBlock, openBlock, withCtx, createElementBlock, createCommentVNode, Fragment, renderList, unref, normalizeClass,
|
|
3
|
+
import { defineComponent, ref, computed, createBlock, openBlock, withCtx, withDirectives, createElementBlock, createCommentVNode, createElementVNode, Fragment, renderList, unref, normalizeClass, renderSlot, createTextVNode, toDisplayString, mergeProps, vShow, createVNode } from 'vue';
|
|
4
4
|
import { Loading } from '@element-plus/icons-vue';
|
|
5
5
|
import { C as Component$3 } from '../button/button.mjs';
|
|
6
6
|
import { i as injectExplorerPanelState } from '../explorer-panel/explorer-panel2.mjs';
|
|
@@ -24,12 +24,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
return { msg: `确定要删除 ${item.label} 吗?` };
|
|
25
25
|
} }
|
|
26
26
|
},
|
|
27
|
-
emits: ["itemClick", "create", "modify", "remove"],
|
|
27
|
+
emits: ["itemClick", "create", "modify", "remove", "up", "down"],
|
|
28
28
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
29
29
|
const props = __props;
|
|
30
30
|
const emits = __emit;
|
|
31
31
|
const { filterKeyword } = injectExplorerPanelState();
|
|
32
32
|
const actived = ref();
|
|
33
|
+
const actionsMapping = {
|
|
34
|
+
create: { title: "新增", type: "primary", icon: "Plus" },
|
|
35
|
+
modify: { title: "修改", type: "primary", icon: "Edit" },
|
|
36
|
+
remove: { title: "删除", type: "danger", icon: "Delete" },
|
|
37
|
+
up: { title: "上移", type: "success", icon: "Top" },
|
|
38
|
+
down: { title: "下移", type: "success", icon: "Bottom" }
|
|
39
|
+
};
|
|
33
40
|
const filterMethod = props.filterMethod || ((keyword, item) => {
|
|
34
41
|
return item.label.toLowerCase().includes(keyword.toLowerCase());
|
|
35
42
|
});
|
|
@@ -53,67 +60,56 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
53
60
|
const _component_ElIcon = ElIcon;
|
|
54
61
|
return openBlock(), createBlock(Component$1, { always: "" }, {
|
|
55
62
|
default: withCtx(() => [
|
|
56
|
-
(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
createElementVNode("div", {
|
|
63
|
-
class: normalizeClass(_ctx.$style.label)
|
|
64
|
-
}, [
|
|
65
|
-
renderSlot(_ctx.$slots, "default", {
|
|
66
|
-
data: item,
|
|
67
|
-
index
|
|
68
|
-
}, () => [
|
|
69
|
-
item.icon ? (openBlock(), createBlock(Component$2, {
|
|
70
|
-
key: 0,
|
|
71
|
-
name: item.icon,
|
|
72
|
-
class: normalizeClass(_ctx.$style.icon)
|
|
73
|
-
}, null, 8, ["name", "class"])) : createCommentVNode("", true),
|
|
74
|
-
createTextVNode(toDisplayString(item.label), 1)
|
|
75
|
-
])
|
|
76
|
-
], 2),
|
|
77
|
-
__props.actions.length ? (openBlock(), createElementBlock("div", {
|
|
78
|
-
key: 0,
|
|
79
|
-
class: normalizeClass(_ctx.$style.actions)
|
|
63
|
+
withDirectives(createElementVNode("div", null, [
|
|
64
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(myData), (item, index) => {
|
|
65
|
+
return openBlock(), createElementBlock("div", {
|
|
66
|
+
key: item.value,
|
|
67
|
+
class: normalizeClass([_ctx.$style.item, { [_ctx.$style.active]: unref(actived) === item.value }]),
|
|
68
|
+
onClick: (e) => handleClick(item, e)
|
|
80
69
|
}, [
|
|
81
|
-
|
|
70
|
+
createElementVNode("div", {
|
|
71
|
+
class: normalizeClass(_ctx.$style.label)
|
|
72
|
+
}, [
|
|
73
|
+
renderSlot(_ctx.$slots, "default", {
|
|
74
|
+
data: item,
|
|
75
|
+
index
|
|
76
|
+
}, () => [
|
|
77
|
+
item.icon ? (openBlock(), createBlock(Component$2, {
|
|
78
|
+
key: 0,
|
|
79
|
+
name: item.icon,
|
|
80
|
+
class: normalizeClass(_ctx.$style.icon)
|
|
81
|
+
}, null, 8, ["name", "class"])) : createCommentVNode("", true),
|
|
82
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
83
|
+
])
|
|
84
|
+
], 2),
|
|
85
|
+
__props.actions.length ? (openBlock(), createElementBlock("div", {
|
|
82
86
|
key: 0,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
confirm: __props.confirmParams(item),
|
|
110
|
-
stop: "",
|
|
111
|
-
class: normalizeClass(_ctx.$style.remove),
|
|
112
|
-
onClick: ($event) => emits("remove", item.value, item)
|
|
113
|
-
}, null, 8, ["confirm", "class", "onClick"])) : createCommentVNode("", true)
|
|
114
|
-
], 2)) : createCommentVNode("", true)
|
|
115
|
-
], 10, _hoisted_1);
|
|
116
|
-
}), 128)),
|
|
87
|
+
class: normalizeClass(_ctx.$style.actions)
|
|
88
|
+
}, [
|
|
89
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (action) => {
|
|
90
|
+
return openBlock(), createElementBlock(Fragment, { key: action }, [
|
|
91
|
+
action === "action" ? renderSlot(_ctx.$slots, "action", {
|
|
92
|
+
key: 0,
|
|
93
|
+
data: item,
|
|
94
|
+
index
|
|
95
|
+
}) : (openBlock(), createBlock(Component$3, mergeProps({
|
|
96
|
+
key: 1,
|
|
97
|
+
ref_for: true
|
|
98
|
+
}, actionsMapping[action], {
|
|
99
|
+
confirm: action === "remove" ? __props.confirmParams(item) : void 0,
|
|
100
|
+
link: "",
|
|
101
|
+
icon: { type: "el", name: actionsMapping[action].icon },
|
|
102
|
+
stop: "",
|
|
103
|
+
onClick: ($event) => emits(action, item.value, item)
|
|
104
|
+
}), null, 16, ["confirm", "icon", "onClick"]))
|
|
105
|
+
], 64);
|
|
106
|
+
}), 128))
|
|
107
|
+
], 2)) : createCommentVNode("", true)
|
|
108
|
+
], 10, _hoisted_1);
|
|
109
|
+
}), 128))
|
|
110
|
+
], 512), [
|
|
111
|
+
[vShow, !__props.loading]
|
|
112
|
+
]),
|
|
117
113
|
unref(isEmpty) && !__props.loading ? (openBlock(), createElementBlock("div", {
|
|
118
114
|
key: 0,
|
|
119
115
|
class: normalizeClass(_ctx.$style.empty)
|
|
@@ -137,14 +133,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
137
133
|
}
|
|
138
134
|
});
|
|
139
135
|
|
|
140
|
-
/* unplugin-vue-components disabled */const item = "
|
|
141
|
-
const actions = "
|
|
142
|
-
const active = "
|
|
143
|
-
const label = "
|
|
144
|
-
const icon = "
|
|
145
|
-
const remove = "
|
|
146
|
-
const empty = "
|
|
147
|
-
const loading = "
|
|
136
|
+
/* unplugin-vue-components disabled */const item = "_item_1xqvz_1";
|
|
137
|
+
const actions = "_actions_1xqvz_16";
|
|
138
|
+
const active = "_active_1xqvz_20";
|
|
139
|
+
const label = "_label_1xqvz_25";
|
|
140
|
+
const icon = "_icon_1xqvz_31";
|
|
141
|
+
const remove = "_remove_1xqvz_48";
|
|
142
|
+
const empty = "_empty_1xqvz_52";
|
|
143
|
+
const loading = "_loading_1xqvz_53";
|
|
148
144
|
const style0 = {
|
|
149
145
|
item: item,
|
|
150
146
|
actions: actions,
|
|
@@ -21,18 +21,22 @@ declare const __VLS_component: import('vue').DefineComponent<IExplorerListProps,
|
|
|
21
21
|
create: (value: string | number, item: IExplorerListItem<any>) => any;
|
|
22
22
|
modify: (value: string | number, item: IExplorerListItem<any>) => any;
|
|
23
23
|
remove: (value: string | number, item: IExplorerListItem<any>) => any;
|
|
24
|
+
up: (value: string | number, node: Node) => any;
|
|
25
|
+
down: (value: string | number, node: Node) => any;
|
|
24
26
|
itemClick: (value: string | number, item: IExplorerListItem<any>, event: MouseEvent) => any;
|
|
25
27
|
}, string, import('vue').PublicProps, Readonly<IExplorerListProps> & Readonly<{
|
|
26
28
|
onCreate?: ((value: string | number, item: IExplorerListItem<any>) => any) | undefined;
|
|
27
29
|
onModify?: ((value: string | number, item: IExplorerListItem<any>) => any) | undefined;
|
|
28
30
|
onRemove?: ((value: string | number, item: IExplorerListItem<any>) => any) | undefined;
|
|
31
|
+
onUp?: ((value: string | number, node: Node) => any) | undefined;
|
|
32
|
+
onDown?: ((value: string | number, node: Node) => any) | undefined;
|
|
29
33
|
onItemClick?: ((value: string | number, item: IExplorerListItem<any>, event: MouseEvent) => any) | undefined;
|
|
30
34
|
}>, {
|
|
31
35
|
data: IExplorerListItem[];
|
|
32
36
|
loadingText: string;
|
|
33
37
|
emptyText: string;
|
|
34
38
|
highlightCurrent: boolean;
|
|
35
|
-
actions: ("create" | "modify" | "remove")[];
|
|
39
|
+
actions: ("create" | "modify" | "remove" | "up" | "down" | "action")[];
|
|
36
40
|
confirmParams: (item: IExplorerListItem) => import('../button/button').IButtonProps["confirm"];
|
|
37
41
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
42
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* source: src/components/explorer-list/explorer-list.vue */
|
|
2
|
-
.
|
|
2
|
+
._item_1xqvz_1 {
|
|
3
3
|
padding: 4px 8px;
|
|
4
4
|
cursor: pointer;
|
|
5
5
|
display: flex;
|
|
@@ -11,38 +11,42 @@
|
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
line-height: 1;
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
._item_1xqvz_1:hover {
|
|
15
15
|
background-color: var(--el-color-primary-light-9);
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
._item_1xqvz_1:hover ._actions_1xqvz_16 {
|
|
18
18
|
display: inline-flex;
|
|
19
19
|
align-items: flex-start;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
._item_1xqvz_1._active_1xqvz_20 {
|
|
22
22
|
color: var(--el-color-primary);
|
|
23
23
|
background-color: var(--el-color-primary-light-9);
|
|
24
24
|
}
|
|
25
|
-
.
|
|
25
|
+
._label_1xqvz_25 {
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
text-overflow: ellipsis;
|
|
28
28
|
white-space: nowrap;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
._icon_1xqvz_31 {
|
|
31
31
|
margin-right: 4px;
|
|
32
32
|
}
|
|
33
|
-
.
|
|
33
|
+
._actions_1xqvz_16 {
|
|
34
34
|
display: none;
|
|
35
35
|
column-gap: 4px;
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
._actions_1xqvz_16 > button {
|
|
38
38
|
margin-left: 0 !important;
|
|
39
39
|
font-size: 1.2em;
|
|
40
|
+
border: 1px solid var(--el-border-color-light) !important;
|
|
40
41
|
}
|
|
41
|
-
.
|
|
42
|
+
._actions_1xqvz_16 > button:hover {
|
|
43
|
+
border-color: var(--el-border-color-dark) !important;
|
|
44
|
+
}
|
|
45
|
+
._remove_1xqvz_48 {
|
|
42
46
|
transform: translateY(-1px);
|
|
43
47
|
}
|
|
44
|
-
.
|
|
45
|
-
.
|
|
48
|
+
._empty_1xqvz_52,
|
|
49
|
+
._loading_1xqvz_53 {
|
|
46
50
|
padding: 4px 8px;
|
|
47
51
|
display: flex;
|
|
48
52
|
align-items: center;
|
|
@@ -4,7 +4,7 @@ import { ComponentInternalInstance } from 'vue';
|
|
|
4
4
|
import { IButtonProps } from '../button/button';
|
|
5
5
|
export interface IExplorerTreeProps {
|
|
6
6
|
data?: TreeComponentProps['data'];
|
|
7
|
-
actions?: ('create' | 'modify' | 'remove')[];
|
|
7
|
+
actions?: ('create' | 'modify' | 'remove' | 'up' | 'down' | 'action')[];
|
|
8
8
|
treeProps?: TreeComponentProps;
|
|
9
9
|
emptyText?: string;
|
|
10
10
|
defaultExpandAll?: boolean;
|
|
@@ -19,4 +19,6 @@ export interface IExplorerTreeEmits {
|
|
|
19
19
|
(e: 'create', value: string | number, node: Node): void;
|
|
20
20
|
(e: 'modify', value: string | number, node: Node): void;
|
|
21
21
|
(e: 'remove', value: string | number, node: Node): void;
|
|
22
|
+
(e: 'up', value: string | number, node: Node): void;
|
|
23
|
+
(e: 'down', value: string | number, node: Node): void;
|
|
22
24
|
}
|