@minilo/ui 0.0.1 → 0.0.3
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/minilo/dist/index.css +1 -1
- package/minilo/dist/index.full.js +2570 -111
- package/minilo/dist/index.full.min.js +7 -1
- package/minilo/dist/index.full.min.js.map +1 -1
- package/minilo/dist/index.full.min.mjs +7 -1
- package/minilo/dist/index.full.min.mjs.map +1 -1
- package/minilo/dist/index.full.mjs +2565 -113
- package/minilo/es/components/button/index.d.ts +4 -4
- package/minilo/es/components/button/index.vue.d.ts +2 -2
- package/minilo/es/components/chart/index.d.ts +4 -4
- package/minilo/es/components/chart/index.vue.d.ts +2 -2
- package/minilo/es/components/chart/index.vue2.mjs +2 -2
- package/minilo/es/components/detail/index.vue2.mjs +1 -1
- package/minilo/es/components/image-upload-pro/index.d.ts +146 -0
- package/minilo/es/components/image-upload-pro/index.mjs +7 -0
- package/minilo/es/components/image-upload-pro/index.vue.d.ts +146 -0
- package/minilo/es/components/image-upload-pro/index.vue.mjs +5 -0
- package/minilo/es/components/image-upload-pro/index.vue2.mjs +667 -0
- package/minilo/es/components/image-upload-pro/type.d.ts +146 -0
- package/minilo/es/components/image-upload-pro/type.mjs +81 -0
- package/minilo/es/components/index.d.ts +4 -0
- package/minilo/es/components/index.mjs +7 -0
- package/minilo/es/components/number-range-input/index.d.ts +3 -3
- package/minilo/es/components/number-range-input/index.vue.d.ts +1 -1
- package/minilo/es/components/search/index.d.ts +26 -26
- package/minilo/es/components/search/index.vue.d.ts +23 -23
- package/minilo/es/components/search/props.d.ts +2 -2
- package/minilo/es/components/search-table/index.d.ts +18 -18
- package/minilo/es/components/search-table/index.vue.d.ts +9 -9
- package/minilo/es/components/search-table/index.vue2.mjs +2 -2
- package/minilo/es/components/search-table/props.d.ts +3 -3
- package/minilo/es/components/tree-select/index.d.ts +32 -0
- package/minilo/es/components/tree-select/index.mjs +6 -0
- package/minilo/es/components/tree-select/index.vue.d.ts +20 -0
- package/minilo/es/components/tree-select/index.vue.mjs +5 -0
- package/minilo/es/components/tree-select/index.vue2.mjs +226 -0
- package/minilo/es/components/tree-select/type.d.ts +34 -0
- package/minilo/es/components/tree-select/type.mjs +1 -0
- package/minilo/es/components/tree-select-dialog/index.d.ts +60 -0
- package/minilo/es/components/tree-select-dialog/index.mjs +7 -0
- package/minilo/es/components/tree-select-dialog/index.vue.d.ts +23 -0
- package/minilo/es/components/tree-select-dialog/index.vue.mjs +5 -0
- package/minilo/es/components/tree-select-dialog/index.vue2.mjs +135 -0
- package/minilo/es/components/tree-select-dialog/type.d.ts +9 -0
- package/minilo/es/components/tree-select-dialog/type.mjs +24 -0
- package/minilo/es/components/tree-select-drawer/index.d.ts +64 -0
- package/minilo/es/components/tree-select-drawer/index.mjs +7 -0
- package/minilo/es/components/tree-select-drawer/index.vue.d.ts +23 -0
- package/minilo/es/components/tree-select-drawer/index.vue.mjs +5 -0
- package/minilo/es/components/tree-select-drawer/index.vue2.mjs +140 -0
- package/minilo/es/components/tree-select-drawer/type.d.ts +10 -0
- package/minilo/es/components/tree-select-drawer/type.mjs +20 -0
- package/minilo/es/components/virtual-list/index.d.ts +4 -4
- package/minilo/es/components/virtual-list/index.vue.d.ts +2 -2
- package/minilo/es/index.d.ts +393 -61
- package/minilo/es/node_modules/.pnpm/{@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_ → @element-plus_icons-vue@2.3.1_vue@3.5.26_typescript@5.9.3_}/node_modules/@element-plus/icons-vue/dist/index.mjs +17 -1
- package/minilo/es/node_modules/.pnpm/{@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_core@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/core/index.mjs +2 -2
- package/minilo/es/resolver/index.d.ts +1 -1
- package/minilo/lib/components/button/index.d.ts +4 -4
- package/minilo/lib/components/button/index.vue.d.ts +2 -2
- package/minilo/lib/components/chart/index.d.ts +4 -4
- package/minilo/lib/components/chart/index.vue.d.ts +2 -2
- package/minilo/lib/components/chart/index.vue2.js +2 -2
- package/minilo/lib/components/detail/index.vue2.js +1 -1
- package/minilo/lib/components/image-upload-pro/index.d.ts +146 -0
- package/minilo/lib/components/image-upload-pro/index.js +13 -0
- package/minilo/lib/components/image-upload-pro/index.vue.d.ts +146 -0
- package/minilo/lib/components/image-upload-pro/index.vue.js +9 -0
- package/minilo/lib/components/image-upload-pro/index.vue2.js +671 -0
- package/minilo/lib/components/image-upload-pro/type.d.ts +146 -0
- package/minilo/lib/components/image-upload-pro/type.js +83 -0
- package/minilo/lib/components/index.d.ts +4 -0
- package/minilo/lib/components/index.js +14 -0
- package/minilo/lib/components/number-range-input/index.d.ts +3 -3
- package/minilo/lib/components/number-range-input/index.vue.d.ts +1 -1
- package/minilo/lib/components/search/index.d.ts +26 -26
- package/minilo/lib/components/search/index.vue.d.ts +23 -23
- package/minilo/lib/components/search/props.d.ts +2 -2
- package/minilo/lib/components/search-table/index.d.ts +18 -18
- package/minilo/lib/components/search-table/index.vue.d.ts +9 -9
- package/minilo/lib/components/search-table/index.vue2.js +2 -2
- package/minilo/lib/components/search-table/props.d.ts +3 -3
- package/minilo/lib/components/tree-select/index.d.ts +32 -0
- package/minilo/lib/components/tree-select/index.js +11 -0
- package/minilo/lib/components/tree-select/index.vue.d.ts +20 -0
- package/minilo/lib/components/tree-select/index.vue.js +9 -0
- package/minilo/lib/components/tree-select/index.vue2.js +230 -0
- package/minilo/lib/components/tree-select/type.d.ts +34 -0
- package/minilo/lib/components/tree-select/type.js +2 -0
- package/minilo/lib/components/tree-select-dialog/index.d.ts +60 -0
- package/minilo/lib/components/tree-select-dialog/index.js +13 -0
- package/minilo/lib/components/tree-select-dialog/index.vue.d.ts +23 -0
- package/minilo/lib/components/tree-select-dialog/index.vue.js +9 -0
- package/minilo/lib/components/tree-select-dialog/index.vue2.js +139 -0
- package/minilo/lib/components/tree-select-dialog/type.d.ts +9 -0
- package/minilo/lib/components/tree-select-dialog/type.js +26 -0
- package/minilo/lib/components/tree-select-drawer/index.d.ts +64 -0
- package/minilo/lib/components/tree-select-drawer/index.js +13 -0
- package/minilo/lib/components/tree-select-drawer/index.vue.d.ts +23 -0
- package/minilo/lib/components/tree-select-drawer/index.vue.js +9 -0
- package/minilo/lib/components/tree-select-drawer/index.vue2.js +144 -0
- package/minilo/lib/components/tree-select-drawer/type.d.ts +10 -0
- package/minilo/lib/components/tree-select-drawer/type.js +22 -0
- package/minilo/lib/components/virtual-list/index.d.ts +4 -4
- package/minilo/lib/components/virtual-list/index.vue.d.ts +2 -2
- package/minilo/lib/index.d.ts +393 -61
- package/minilo/lib/node_modules/.pnpm/{@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_ → @element-plus_icons-vue@2.3.1_vue@3.5.26_typescript@5.9.3_}/node_modules/@element-plus/icons-vue/dist/index.js +17 -0
- package/minilo/lib/node_modules/.pnpm/{@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_core@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/core/index.js +1 -1
- package/minilo/lib/resolver/index.d.ts +1 -1
- package/minilo/theme-chalk/index.css +1 -1
- package/minilo/theme-chalk/ml-image-upload-pro.css +1 -0
- package/minilo/theme-chalk/ml-tree-select-dialog.css +0 -0
- package/minilo/theme-chalk/ml-tree-select-drawer.css +0 -0
- package/minilo/theme-chalk/ml-tree-select.css +1 -0
- package/minilo/theme-chalk/src/image-upload-pro.scss +70 -0
- package/minilo/theme-chalk/src/index.scss +2 -0
- package/minilo/theme-chalk/src/tree-select-dialog.scss +0 -0
- package/minilo/theme-chalk/src/tree-select-drawer.scss +0 -0
- package/minilo/theme-chalk/src/tree-select.scss +47 -0
- package/package.json +19 -6
- /package/minilo/es/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/func/common.mjs +0 -0
- /package/minilo/es/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/request/index.mjs +0 -0
- /package/minilo/es/node_modules/.pnpm/{@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_shared@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/shared/index.mjs +0 -0
- /package/minilo/lib/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/func/common.js +0 -0
- /package/minilo/lib/{packages → node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo}/utils/dist/request/index.js +0 -0
- /package/minilo/lib/node_modules/.pnpm/{@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_ → @vueuse_shared@13.9.0_vue@3.5.26_typescript@5.9.3_}/node_modules/@vueuse/shared/index.js +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { defineComponent, mergeModels, useModel, useAttrs, computed, ref, watch, resolveComponent, createBlock, openBlock, mergeProps, unref, withCtx, createVNode, toHandlers } from 'vue';
|
|
2
|
+
import { MlTreeSelect } from '../tree-select/index.mjs';
|
|
3
|
+
import { dialogPropKeys } from './type.mjs';
|
|
4
|
+
import { bem } from '../../utils/index.mjs';
|
|
5
|
+
|
|
6
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "MlTreeSelectDialog"
|
|
9
|
+
},
|
|
10
|
+
__name: "index",
|
|
11
|
+
props: /* @__PURE__ */ mergeModels({
|
|
12
|
+
treeData: { type: Array, required: true },
|
|
13
|
+
treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
|
|
14
|
+
multiple: { type: Boolean, required: false, default: false },
|
|
15
|
+
defaultExpandAll: { type: Boolean, required: false, default: true },
|
|
16
|
+
defaultSelectedKeys: { type: Array, required: false, default: () => [] },
|
|
17
|
+
nodeKey: { type: String, required: false, default: "id" },
|
|
18
|
+
showSearch: { type: Boolean, required: false, default: true },
|
|
19
|
+
expandOnClickNode: { type: Boolean, required: false },
|
|
20
|
+
placeholder: { type: String, required: false },
|
|
21
|
+
title: { type: String, required: false, default: "\u6811\u5F62\u9009\u62E9" },
|
|
22
|
+
width: { type: String, required: false, default: "500px" },
|
|
23
|
+
appendToBody: { type: Boolean, required: false },
|
|
24
|
+
appendTo: { type: null, required: false },
|
|
25
|
+
beforeClose: { type: Function, required: false },
|
|
26
|
+
destroyOnClose: { type: Boolean, required: false },
|
|
27
|
+
closeOnClickModal: { type: Boolean, required: false },
|
|
28
|
+
closeOnPressEscape: { type: Boolean, required: false },
|
|
29
|
+
lockScroll: { type: Boolean, required: false },
|
|
30
|
+
modal: { type: Boolean, required: false },
|
|
31
|
+
openDelay: { type: Number, required: false },
|
|
32
|
+
closeDelay: { type: Number, required: false },
|
|
33
|
+
top: { type: String, required: false },
|
|
34
|
+
modelValue: { type: Boolean, required: false },
|
|
35
|
+
modalClass: { type: String, required: false },
|
|
36
|
+
headerClass: { type: String, required: false },
|
|
37
|
+
bodyClass: { type: String, required: false },
|
|
38
|
+
footerClass: { type: String, required: false },
|
|
39
|
+
zIndex: { type: Number, required: false },
|
|
40
|
+
trapFocus: { type: Boolean, required: false },
|
|
41
|
+
headerAriaLevel: { type: String, required: false },
|
|
42
|
+
center: { type: Boolean, required: false },
|
|
43
|
+
alignCenter: { type: Boolean, required: false },
|
|
44
|
+
closeIcon: { type: null, required: false },
|
|
45
|
+
draggable: { type: Boolean, required: false },
|
|
46
|
+
overflow: { type: Boolean, required: false },
|
|
47
|
+
fullscreen: { type: Boolean, required: false },
|
|
48
|
+
showClose: { type: Boolean, required: false },
|
|
49
|
+
ariaLevel: { type: String, required: false }
|
|
50
|
+
}, {
|
|
51
|
+
"modelValue": { type: Boolean, ...{ default: false } },
|
|
52
|
+
"modelModifiers": {}
|
|
53
|
+
}),
|
|
54
|
+
emits: /* @__PURE__ */ mergeModels(["confirm", "close", "input"], ["update:modelValue"]),
|
|
55
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
56
|
+
const visible = useModel(__props, "modelValue");
|
|
57
|
+
const props = __props;
|
|
58
|
+
const emit = __emit;
|
|
59
|
+
const attrs = useAttrs();
|
|
60
|
+
const dialogAttrs = computed(() => {
|
|
61
|
+
const result = {
|
|
62
|
+
title: props.title,
|
|
63
|
+
width: props.width
|
|
64
|
+
};
|
|
65
|
+
Object.keys(attrs).forEach((key) => {
|
|
66
|
+
if (dialogPropKeys.includes(key)) {
|
|
67
|
+
result[key] = attrs[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return result;
|
|
71
|
+
});
|
|
72
|
+
const treeSelectAttrs = computed(() => {
|
|
73
|
+
const result = {
|
|
74
|
+
treeData: props.treeData,
|
|
75
|
+
treeProps: props.treeProps,
|
|
76
|
+
multiple: props.multiple,
|
|
77
|
+
defaultExpandAll: props.defaultExpandAll,
|
|
78
|
+
defaultSelectedKeys: props.defaultSelectedKeys,
|
|
79
|
+
nodeKey: props.nodeKey,
|
|
80
|
+
showSearch: props.showSearch
|
|
81
|
+
};
|
|
82
|
+
Object.keys(attrs).forEach((key) => {
|
|
83
|
+
if (!dialogPropKeys.includes(key) && !key.startsWith("on")) {
|
|
84
|
+
result[key] = attrs[key];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return result;
|
|
88
|
+
});
|
|
89
|
+
const treeSelectRef = ref();
|
|
90
|
+
watch(visible, (val) => {
|
|
91
|
+
if (!val && treeSelectRef.value) {
|
|
92
|
+
treeSelectRef.value.reset();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const handleBeforeClose = () => {
|
|
96
|
+
visible.value = false;
|
|
97
|
+
};
|
|
98
|
+
const handleConfirm = (selectedData) => {
|
|
99
|
+
emit("confirm", selectedData);
|
|
100
|
+
visible.value = false;
|
|
101
|
+
};
|
|
102
|
+
const handleCancel = () => {
|
|
103
|
+
visible.value = false;
|
|
104
|
+
};
|
|
105
|
+
__expose({
|
|
106
|
+
input: (value) => emit("input", value)
|
|
107
|
+
});
|
|
108
|
+
return (_ctx, _cache) => {
|
|
109
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
110
|
+
return openBlock(), createBlock(_component_el_dialog, mergeProps({
|
|
111
|
+
modelValue: visible.value,
|
|
112
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
|
|
113
|
+
}, dialogAttrs.value, {
|
|
114
|
+
class: unref(bem)("tree-select-dialog"),
|
|
115
|
+
"before-close": handleBeforeClose,
|
|
116
|
+
onClose: _cache[1] || (_cache[1] = ($event) => emit("close"))
|
|
117
|
+
}), {
|
|
118
|
+
default: withCtx(() => [
|
|
119
|
+
createVNode(unref(MlTreeSelect), mergeProps({
|
|
120
|
+
ref_key: "treeSelectRef",
|
|
121
|
+
ref: treeSelectRef,
|
|
122
|
+
"tree-data": props.treeData
|
|
123
|
+
}, treeSelectAttrs.value, toHandlers(_ctx.$attrs), {
|
|
124
|
+
onConfirm: handleConfirm,
|
|
125
|
+
onCancel: handleCancel
|
|
126
|
+
}), null, 16, ["tree-data"])
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
/* STABLE */
|
|
130
|
+
}, 16, ["modelValue", "class"]);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TreeSelectProps } from '../tree-select/type';
|
|
2
|
+
import { DialogProps } from 'element-plus';
|
|
3
|
+
export interface DialogContainerProps extends Partial<DialogProps> {
|
|
4
|
+
title?: string;
|
|
5
|
+
width?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TreeSelectDialogProps<T = any> extends TreeSelectProps<T>, DialogContainerProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const dialogPropKeys: string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const dialogPropKeys = [
|
|
2
|
+
"title",
|
|
3
|
+
"width",
|
|
4
|
+
"fullscreen",
|
|
5
|
+
"top",
|
|
6
|
+
"modal",
|
|
7
|
+
"modalClass",
|
|
8
|
+
"appendToBody",
|
|
9
|
+
"appendTo",
|
|
10
|
+
"lockScroll",
|
|
11
|
+
"closeOnClickModal",
|
|
12
|
+
"closeOnPressEscape",
|
|
13
|
+
"showClose",
|
|
14
|
+
"draggable",
|
|
15
|
+
"overflow",
|
|
16
|
+
"center",
|
|
17
|
+
"alignCenter",
|
|
18
|
+
"destroyOnClose",
|
|
19
|
+
"closeIcon",
|
|
20
|
+
"zIndex",
|
|
21
|
+
"headerAriaLevel"
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export { dialogPropKeys };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const MlTreeSelectDrawer: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
2
|
+
slots: {};
|
|
3
|
+
attrs: any;
|
|
4
|
+
emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "close") => void)) & ((evt: "update:modelValue", value: boolean) => void);
|
|
5
|
+
}, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
|
+
props: {
|
|
7
|
+
readonly onInput?: (value: string) => any;
|
|
8
|
+
readonly "onUpdate:modelValue"?: (value: boolean) => any;
|
|
9
|
+
readonly onClose?: () => any;
|
|
10
|
+
readonly onConfirm?: (selectedData: T | T[]) => any;
|
|
11
|
+
modelValue?: boolean;
|
|
12
|
+
treeData: T[];
|
|
13
|
+
treeProps?: Record<string, any>;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
defaultExpandAll?: boolean;
|
|
16
|
+
defaultSelectedKeys?: any[];
|
|
17
|
+
nodeKey?: string;
|
|
18
|
+
showSearch?: boolean;
|
|
19
|
+
expandOnClickNode?: boolean;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
size?: string | number;
|
|
23
|
+
direction?: "rtl" | "ltr" | "ttb" | "btt";
|
|
24
|
+
readonly overflow?: boolean;
|
|
25
|
+
readonly center?: boolean;
|
|
26
|
+
readonly appendTo?: string | HTMLElement;
|
|
27
|
+
readonly showClose?: boolean;
|
|
28
|
+
readonly draggable?: boolean;
|
|
29
|
+
readonly appendToBody?: boolean;
|
|
30
|
+
readonly destroyOnClose?: boolean;
|
|
31
|
+
readonly closeOnClickModal?: boolean;
|
|
32
|
+
readonly closeOnPressEscape?: boolean;
|
|
33
|
+
readonly lockScroll?: boolean;
|
|
34
|
+
readonly modal?: boolean;
|
|
35
|
+
readonly openDelay?: number;
|
|
36
|
+
readonly closeDelay?: number;
|
|
37
|
+
readonly trapFocus?: boolean;
|
|
38
|
+
readonly headerAriaLevel?: string;
|
|
39
|
+
readonly alignCenter?: boolean;
|
|
40
|
+
readonly fullscreen?: boolean;
|
|
41
|
+
readonly ariaLevel?: string;
|
|
42
|
+
readonly withHeader?: boolean;
|
|
43
|
+
readonly modalFade?: boolean;
|
|
44
|
+
readonly top?: string;
|
|
45
|
+
readonly width?: string | number;
|
|
46
|
+
readonly zIndex?: number;
|
|
47
|
+
readonly beforeClose?: import('element-plus').DialogBeforeCloseFn;
|
|
48
|
+
readonly modalClass?: string;
|
|
49
|
+
readonly headerClass?: string;
|
|
50
|
+
readonly bodyClass?: string;
|
|
51
|
+
readonly footerClass?: string;
|
|
52
|
+
readonly closeIcon?: unknown;
|
|
53
|
+
} & import('vue').PublicProps;
|
|
54
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
55
|
+
input: (value: string) => void;
|
|
56
|
+
}>): void;
|
|
57
|
+
attrs: any;
|
|
58
|
+
slots: {};
|
|
59
|
+
emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "close") => void)) & ((evt: "update:modelValue", value: boolean) => void);
|
|
60
|
+
}>) => import('vue').VNode & {
|
|
61
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
62
|
+
};
|
|
63
|
+
export default MlTreeSelectDrawer;
|
|
64
|
+
export * from './type';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TreeSelectDrawerProps } from './type';
|
|
2
|
+
declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onInput?: (value: string) => any;
|
|
5
|
+
readonly "onUpdate:modelValue"?: (value: boolean) => any;
|
|
6
|
+
readonly onConfirm?: (selectedData: T | T[]) => any;
|
|
7
|
+
readonly onClose?: () => any;
|
|
8
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onInput" | "onUpdate:modelValue" | "onClose" | "onConfirm"> & ({
|
|
9
|
+
modelValue?: boolean;
|
|
10
|
+
} & TreeSelectDrawerProps<T>) & Partial<{}>> & import('vue').PublicProps;
|
|
11
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
12
|
+
input: (value: string) => void;
|
|
13
|
+
}>): void;
|
|
14
|
+
attrs: any;
|
|
15
|
+
slots: {};
|
|
16
|
+
emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "close") => void)) & ((evt: "update:modelValue", value: boolean) => void);
|
|
17
|
+
}>) => import('vue').VNode & {
|
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_PrettifyLocal<T> = {
|
|
22
|
+
[K in keyof T]: T[K];
|
|
23
|
+
} & {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent, mergeModels, useModel, useAttrs, computed, ref, watch, resolveComponent, createBlock, openBlock, mergeProps, unref, withCtx, createVNode, toHandlers } from 'vue';
|
|
2
|
+
import { drawerPropKeys } from './type.mjs';
|
|
3
|
+
import _sfc_main$1 from '../tree-select/index.vue2.mjs';
|
|
4
|
+
import { bem } from '../../utils/index.mjs';
|
|
5
|
+
|
|
6
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "MlTreeSelectDrawer"
|
|
9
|
+
},
|
|
10
|
+
__name: "index",
|
|
11
|
+
props: /* @__PURE__ */ mergeModels({
|
|
12
|
+
treeData: { type: Array, required: true },
|
|
13
|
+
treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
|
|
14
|
+
multiple: { type: Boolean, required: false, default: false },
|
|
15
|
+
defaultExpandAll: { type: Boolean, required: false, default: true },
|
|
16
|
+
defaultSelectedKeys: { type: Array, required: false, default: () => [] },
|
|
17
|
+
nodeKey: { type: String, required: false, default: "id" },
|
|
18
|
+
showSearch: { type: Boolean, required: false, default: true },
|
|
19
|
+
expandOnClickNode: { type: Boolean, required: false },
|
|
20
|
+
placeholder: { type: String, required: false },
|
|
21
|
+
title: { type: String, required: false, default: "\u6811\u5F62\u9009\u62E9" },
|
|
22
|
+
size: { type: [String, Number], required: false, default: "400px" },
|
|
23
|
+
direction: { type: String, required: false, default: "rtl" },
|
|
24
|
+
withHeader: { type: Boolean, required: false },
|
|
25
|
+
modalFade: { type: Boolean, required: false },
|
|
26
|
+
headerAriaLevel: { type: String, required: false },
|
|
27
|
+
appendToBody: { type: Boolean, required: false },
|
|
28
|
+
appendTo: { type: null, required: false },
|
|
29
|
+
beforeClose: { type: Function, required: false },
|
|
30
|
+
destroyOnClose: { type: Boolean, required: false },
|
|
31
|
+
closeOnClickModal: { type: Boolean, required: false },
|
|
32
|
+
closeOnPressEscape: { type: Boolean, required: false },
|
|
33
|
+
lockScroll: { type: Boolean, required: false },
|
|
34
|
+
modal: { type: Boolean, required: false },
|
|
35
|
+
openDelay: { type: Number, required: false },
|
|
36
|
+
closeDelay: { type: Number, required: false },
|
|
37
|
+
top: { type: String, required: false },
|
|
38
|
+
modelValue: { type: Boolean, required: false },
|
|
39
|
+
modalClass: { type: String, required: false },
|
|
40
|
+
headerClass: { type: String, required: false },
|
|
41
|
+
bodyClass: { type: String, required: false },
|
|
42
|
+
footerClass: { type: String, required: false },
|
|
43
|
+
width: { type: null, required: false },
|
|
44
|
+
zIndex: { type: Number, required: false },
|
|
45
|
+
trapFocus: { type: Boolean, required: false },
|
|
46
|
+
center: { type: Boolean, required: false },
|
|
47
|
+
alignCenter: { type: Boolean, required: false },
|
|
48
|
+
closeIcon: { type: null, required: false },
|
|
49
|
+
draggable: { type: Boolean, required: false },
|
|
50
|
+
overflow: { type: Boolean, required: false },
|
|
51
|
+
fullscreen: { type: Boolean, required: false },
|
|
52
|
+
showClose: { type: Boolean, required: false },
|
|
53
|
+
ariaLevel: { type: String, required: false }
|
|
54
|
+
}, {
|
|
55
|
+
"modelValue": { type: Boolean, ...{ default: false } },
|
|
56
|
+
"modelModifiers": {}
|
|
57
|
+
}),
|
|
58
|
+
emits: /* @__PURE__ */ mergeModels(["confirm", "close", "input"], ["update:modelValue"]),
|
|
59
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
60
|
+
const visible = useModel(__props, "modelValue");
|
|
61
|
+
const props = __props;
|
|
62
|
+
const emit = __emit;
|
|
63
|
+
const attrs = useAttrs();
|
|
64
|
+
const drawerAttrs = computed(() => {
|
|
65
|
+
const result = {
|
|
66
|
+
title: props.title,
|
|
67
|
+
size: props.size,
|
|
68
|
+
direction: props.direction
|
|
69
|
+
};
|
|
70
|
+
Object.keys(attrs).forEach((key) => {
|
|
71
|
+
if (drawerPropKeys.includes(key)) {
|
|
72
|
+
result[key] = attrs[key];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return result;
|
|
76
|
+
});
|
|
77
|
+
const treeSelectAttrs = computed(() => {
|
|
78
|
+
const result = {
|
|
79
|
+
treeProps: props.treeProps,
|
|
80
|
+
multiple: props.multiple,
|
|
81
|
+
defaultExpandAll: props.defaultExpandAll,
|
|
82
|
+
defaultSelectedKeys: props.defaultSelectedKeys,
|
|
83
|
+
nodeKey: props.nodeKey,
|
|
84
|
+
showSearch: props.showSearch
|
|
85
|
+
};
|
|
86
|
+
Object.keys(attrs).forEach((key) => {
|
|
87
|
+
if (!drawerPropKeys.includes(key) && !key.startsWith("on")) {
|
|
88
|
+
result[key] = attrs[key];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return result;
|
|
92
|
+
});
|
|
93
|
+
const treeSelectRef = ref();
|
|
94
|
+
watch(visible, (val) => {
|
|
95
|
+
if (!val && treeSelectRef.value) {
|
|
96
|
+
treeSelectRef.value.reset();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
const handleBeforeClose = (done) => {
|
|
100
|
+
visible.value = false;
|
|
101
|
+
done();
|
|
102
|
+
};
|
|
103
|
+
const handleConfirm = (selectedData) => {
|
|
104
|
+
emit("confirm", selectedData);
|
|
105
|
+
visible.value = false;
|
|
106
|
+
};
|
|
107
|
+
const handleCancel = () => {
|
|
108
|
+
visible.value = false;
|
|
109
|
+
};
|
|
110
|
+
__expose({
|
|
111
|
+
input: (value) => emit("input", value)
|
|
112
|
+
});
|
|
113
|
+
return (_ctx, _cache) => {
|
|
114
|
+
const _component_el_drawer = resolveComponent("el-drawer");
|
|
115
|
+
return openBlock(), createBlock(_component_el_drawer, mergeProps({
|
|
116
|
+
modelValue: visible.value,
|
|
117
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
|
|
118
|
+
}, drawerAttrs.value, {
|
|
119
|
+
class: unref(bem)("tree-select-drawer"),
|
|
120
|
+
"before-close": handleBeforeClose,
|
|
121
|
+
onClose: _cache[1] || (_cache[1] = ($event) => emit("close"))
|
|
122
|
+
}), {
|
|
123
|
+
default: withCtx(() => [
|
|
124
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
125
|
+
ref_key: "treeSelectRef",
|
|
126
|
+
ref: treeSelectRef,
|
|
127
|
+
"tree-data": __props.treeData
|
|
128
|
+
}, treeSelectAttrs.value, toHandlers(_ctx.$attrs), {
|
|
129
|
+
onConfirm: handleConfirm,
|
|
130
|
+
onCancel: handleCancel
|
|
131
|
+
}), null, 16, ["tree-data"])
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
/* STABLE */
|
|
135
|
+
}, 16, ["modelValue", "class"]);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TreeSelectProps } from '../tree-select/type';
|
|
2
|
+
import { DrawerProps } from 'element-plus';
|
|
3
|
+
export interface DrawerContainerProps extends Partial<DrawerProps> {
|
|
4
|
+
title?: string;
|
|
5
|
+
size?: string | number;
|
|
6
|
+
direction?: 'rtl' | 'ltr' | 'ttb' | 'btt';
|
|
7
|
+
}
|
|
8
|
+
export interface TreeSelectDrawerProps<T = any> extends TreeSelectProps<T>, DrawerContainerProps {
|
|
9
|
+
}
|
|
10
|
+
export declare const drawerPropKeys: string[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const drawerPropKeys = [
|
|
2
|
+
"title",
|
|
3
|
+
"size",
|
|
4
|
+
"direction",
|
|
5
|
+
"appendToBody",
|
|
6
|
+
"appendTo",
|
|
7
|
+
"modal",
|
|
8
|
+
"modalClass",
|
|
9
|
+
"lockScroll",
|
|
10
|
+
"closeOnClickModal",
|
|
11
|
+
"closeOnPressEscape",
|
|
12
|
+
"showClose",
|
|
13
|
+
"withHeader",
|
|
14
|
+
"openDelay",
|
|
15
|
+
"closeDelay",
|
|
16
|
+
"destroyOnClose",
|
|
17
|
+
"zIndex"
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
export { drawerPropKeys };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const MlVirtualList: {
|
|
2
2
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').MlVirtualListProps> & Readonly<{
|
|
3
|
-
"onLoad-more"?: (
|
|
3
|
+
"onLoad-more"?: () => any;
|
|
4
4
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
5
5
|
"load-more": () => any;
|
|
6
6
|
}, import('vue').PublicProps, {
|
|
@@ -11,7 +11,7 @@ export declare const MlVirtualList: {
|
|
|
11
11
|
preLoadCount: number;
|
|
12
12
|
threshold: number;
|
|
13
13
|
dataSource: any[];
|
|
14
|
-
},
|
|
14
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
15
15
|
containerRef: HTMLDivElement;
|
|
16
16
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
17
17
|
P: {};
|
|
@@ -21,7 +21,7 @@ export declare const MlVirtualList: {
|
|
|
21
21
|
M: {};
|
|
22
22
|
Defaults: {};
|
|
23
23
|
}, Readonly<import('./type').MlVirtualListProps> & Readonly<{
|
|
24
|
-
"onLoad-more"?: (
|
|
24
|
+
"onLoad-more"?: () => any;
|
|
25
25
|
}>, {}, {}, {}, {}, {
|
|
26
26
|
height: number;
|
|
27
27
|
itemHeight: number;
|
|
@@ -35,7 +35,7 @@ export declare const MlVirtualList: {
|
|
|
35
35
|
__isTeleport?: never;
|
|
36
36
|
__isSuspense?: never;
|
|
37
37
|
} & import('vue').ComponentOptionsBase<Readonly<import('./type').MlVirtualListProps> & Readonly<{
|
|
38
|
-
"onLoad-more"?: (
|
|
38
|
+
"onLoad-more"?: () => any;
|
|
39
39
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
40
40
|
"load-more": () => any;
|
|
41
41
|
}, string, {
|
|
@@ -18,7 +18,7 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
18
18
|
declare const __VLS_component: import('vue').DefineComponent<MlVirtualListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
19
19
|
"load-more": () => any;
|
|
20
20
|
}, string, import('vue').PublicProps, Readonly<MlVirtualListProps> & Readonly<{
|
|
21
|
-
"onLoad-more"?: (
|
|
21
|
+
"onLoad-more"?: () => any;
|
|
22
22
|
}>, {
|
|
23
23
|
height: number;
|
|
24
24
|
itemHeight: number;
|
|
@@ -27,7 +27,7 @@ declare const __VLS_component: import('vue').DefineComponent<MlVirtualListProps,
|
|
|
27
27
|
preLoadCount: number;
|
|
28
28
|
threshold: number;
|
|
29
29
|
dataSource: any[];
|
|
30
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
31
31
|
containerRef: HTMLDivElement;
|
|
32
32
|
}, HTMLDivElement>;
|
|
33
33
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|