@minilo/ui 0.0.2 → 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.
Files changed (126) hide show
  1. package/minilo/dist/index.css +1 -1
  2. package/minilo/dist/index.full.js +2570 -111
  3. package/minilo/dist/index.full.min.js +7 -1
  4. package/minilo/dist/index.full.min.js.map +1 -1
  5. package/minilo/dist/index.full.min.mjs +7 -1
  6. package/minilo/dist/index.full.min.mjs.map +1 -1
  7. package/minilo/dist/index.full.mjs +2565 -113
  8. package/minilo/es/components/button/index.d.ts +4 -4
  9. package/minilo/es/components/button/index.vue.d.ts +2 -2
  10. package/minilo/es/components/chart/index.d.ts +4 -4
  11. package/minilo/es/components/chart/index.vue.d.ts +2 -2
  12. package/minilo/es/components/chart/index.vue2.mjs +2 -2
  13. package/minilo/es/components/detail/index.vue2.mjs +1 -1
  14. package/minilo/es/components/image-upload-pro/index.d.ts +146 -0
  15. package/minilo/es/components/image-upload-pro/index.mjs +7 -0
  16. package/minilo/es/components/image-upload-pro/index.vue.d.ts +146 -0
  17. package/minilo/es/components/image-upload-pro/index.vue.mjs +5 -0
  18. package/minilo/es/components/image-upload-pro/index.vue2.mjs +667 -0
  19. package/minilo/es/components/image-upload-pro/type.d.ts +146 -0
  20. package/minilo/es/components/image-upload-pro/type.mjs +81 -0
  21. package/minilo/es/components/index.d.ts +4 -0
  22. package/minilo/es/components/index.mjs +7 -0
  23. package/minilo/es/components/number-range-input/index.d.ts +3 -3
  24. package/minilo/es/components/number-range-input/index.vue.d.ts +1 -1
  25. package/minilo/es/components/search/index.d.ts +26 -26
  26. package/minilo/es/components/search/index.vue.d.ts +23 -23
  27. package/minilo/es/components/search/props.d.ts +2 -2
  28. package/minilo/es/components/search-table/index.d.ts +18 -18
  29. package/minilo/es/components/search-table/index.vue.d.ts +9 -9
  30. package/minilo/es/components/search-table/index.vue2.mjs +2 -2
  31. package/minilo/es/components/search-table/props.d.ts +3 -3
  32. package/minilo/es/components/tree-select/index.d.ts +32 -0
  33. package/minilo/es/components/tree-select/index.mjs +6 -0
  34. package/minilo/es/components/tree-select/index.vue.d.ts +20 -0
  35. package/minilo/es/components/tree-select/index.vue.mjs +5 -0
  36. package/minilo/es/components/tree-select/index.vue2.mjs +226 -0
  37. package/minilo/es/components/tree-select/type.d.ts +34 -0
  38. package/minilo/es/components/tree-select/type.mjs +1 -0
  39. package/minilo/es/components/tree-select-dialog/index.d.ts +60 -0
  40. package/minilo/es/components/tree-select-dialog/index.mjs +7 -0
  41. package/minilo/es/components/tree-select-dialog/index.vue.d.ts +23 -0
  42. package/minilo/es/components/tree-select-dialog/index.vue.mjs +5 -0
  43. package/minilo/es/components/tree-select-dialog/index.vue2.mjs +135 -0
  44. package/minilo/es/components/tree-select-dialog/type.d.ts +9 -0
  45. package/minilo/es/components/tree-select-dialog/type.mjs +24 -0
  46. package/minilo/es/components/tree-select-drawer/index.d.ts +64 -0
  47. package/minilo/es/components/tree-select-drawer/index.mjs +7 -0
  48. package/minilo/es/components/tree-select-drawer/index.vue.d.ts +23 -0
  49. package/minilo/es/components/tree-select-drawer/index.vue.mjs +5 -0
  50. package/minilo/es/components/tree-select-drawer/index.vue2.mjs +140 -0
  51. package/minilo/es/components/tree-select-drawer/type.d.ts +10 -0
  52. package/minilo/es/components/tree-select-drawer/type.mjs +20 -0
  53. package/minilo/es/components/virtual-list/index.d.ts +4 -4
  54. package/minilo/es/components/virtual-list/index.vue.d.ts +2 -2
  55. package/minilo/es/index.d.ts +393 -61
  56. 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
  57. 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
  58. package/minilo/es/resolver/index.d.ts +1 -1
  59. package/minilo/lib/components/button/index.d.ts +4 -4
  60. package/minilo/lib/components/button/index.vue.d.ts +2 -2
  61. package/minilo/lib/components/chart/index.d.ts +4 -4
  62. package/minilo/lib/components/chart/index.vue.d.ts +2 -2
  63. package/minilo/lib/components/chart/index.vue2.js +2 -2
  64. package/minilo/lib/components/detail/index.vue2.js +1 -1
  65. package/minilo/lib/components/image-upload-pro/index.d.ts +146 -0
  66. package/minilo/lib/components/image-upload-pro/index.js +13 -0
  67. package/minilo/lib/components/image-upload-pro/index.vue.d.ts +146 -0
  68. package/minilo/lib/components/image-upload-pro/index.vue.js +9 -0
  69. package/minilo/lib/components/image-upload-pro/index.vue2.js +671 -0
  70. package/minilo/lib/components/image-upload-pro/type.d.ts +146 -0
  71. package/minilo/lib/components/image-upload-pro/type.js +83 -0
  72. package/minilo/lib/components/index.d.ts +4 -0
  73. package/minilo/lib/components/index.js +14 -0
  74. package/minilo/lib/components/number-range-input/index.d.ts +3 -3
  75. package/minilo/lib/components/number-range-input/index.vue.d.ts +1 -1
  76. package/minilo/lib/components/search/index.d.ts +26 -26
  77. package/minilo/lib/components/search/index.vue.d.ts +23 -23
  78. package/minilo/lib/components/search/props.d.ts +2 -2
  79. package/minilo/lib/components/search-table/index.d.ts +18 -18
  80. package/minilo/lib/components/search-table/index.vue.d.ts +9 -9
  81. package/minilo/lib/components/search-table/index.vue2.js +2 -2
  82. package/minilo/lib/components/search-table/props.d.ts +3 -3
  83. package/minilo/lib/components/tree-select/index.d.ts +32 -0
  84. package/minilo/lib/components/tree-select/index.js +11 -0
  85. package/minilo/lib/components/tree-select/index.vue.d.ts +20 -0
  86. package/minilo/lib/components/tree-select/index.vue.js +9 -0
  87. package/minilo/lib/components/tree-select/index.vue2.js +230 -0
  88. package/minilo/lib/components/tree-select/type.d.ts +34 -0
  89. package/minilo/lib/components/tree-select/type.js +2 -0
  90. package/minilo/lib/components/tree-select-dialog/index.d.ts +60 -0
  91. package/minilo/lib/components/tree-select-dialog/index.js +13 -0
  92. package/minilo/lib/components/tree-select-dialog/index.vue.d.ts +23 -0
  93. package/minilo/lib/components/tree-select-dialog/index.vue.js +9 -0
  94. package/minilo/lib/components/tree-select-dialog/index.vue2.js +139 -0
  95. package/minilo/lib/components/tree-select-dialog/type.d.ts +9 -0
  96. package/minilo/lib/components/tree-select-dialog/type.js +26 -0
  97. package/minilo/lib/components/tree-select-drawer/index.d.ts +64 -0
  98. package/minilo/lib/components/tree-select-drawer/index.js +13 -0
  99. package/minilo/lib/components/tree-select-drawer/index.vue.d.ts +23 -0
  100. package/minilo/lib/components/tree-select-drawer/index.vue.js +9 -0
  101. package/minilo/lib/components/tree-select-drawer/index.vue2.js +144 -0
  102. package/minilo/lib/components/tree-select-drawer/type.d.ts +10 -0
  103. package/minilo/lib/components/tree-select-drawer/type.js +22 -0
  104. package/minilo/lib/components/virtual-list/index.d.ts +4 -4
  105. package/minilo/lib/components/virtual-list/index.vue.d.ts +2 -2
  106. package/minilo/lib/index.d.ts +393 -61
  107. 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
  108. 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
  109. package/minilo/lib/resolver/index.d.ts +1 -1
  110. package/minilo/theme-chalk/index.css +1 -1
  111. package/minilo/theme-chalk/ml-image-upload-pro.css +1 -0
  112. package/minilo/theme-chalk/ml-tree-select-dialog.css +0 -0
  113. package/minilo/theme-chalk/ml-tree-select-drawer.css +0 -0
  114. package/minilo/theme-chalk/ml-tree-select.css +1 -0
  115. package/minilo/theme-chalk/src/image-upload-pro.scss +70 -0
  116. package/minilo/theme-chalk/src/index.scss +2 -0
  117. package/minilo/theme-chalk/src/tree-select-dialog.scss +0 -0
  118. package/minilo/theme-chalk/src/tree-select-drawer.scss +0 -0
  119. package/minilo/theme-chalk/src/tree-select.scss +47 -0
  120. package/package.json +18 -5
  121. /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
  122. /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
  123. /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
  124. /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
  125. /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
  126. /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
@@ -26,11 +26,11 @@ export declare const MlSearchTable: {
26
26
  };
27
27
  paramsHandler: {
28
28
  type: FunctionConstructor;
29
- default: null;
29
+ default: any;
30
30
  };
31
31
  render: {
32
32
  type: FunctionConstructor;
33
- default: null;
33
+ default: any;
34
34
  };
35
35
  searchProps: {
36
36
  type: ObjectConstructor;
@@ -59,22 +59,22 @@ export declare const MlSearchTable: {
59
59
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
60
60
  readonly [Symbol.species]: ArrayConstructor;
61
61
  };
62
- default: () => never[];
62
+ default: () => any[];
63
63
  };
64
64
  search: {
65
65
  type: import('vue').PropType<import('../search/props').SearchModel>;
66
66
  };
67
67
  }>> & Readonly<{
68
- onReset?: ((...args: any[]) => any) | undefined;
69
- "onUpdate:search"?: ((value: import('../search/props').SearchModel) => any) | undefined;
68
+ onReset?: (...args: any[]) => any;
69
+ "onUpdate:search"?: (value: import('../search/props').SearchModel) => any;
70
70
  }>, {
71
71
  handleSearch: (reset?: boolean) => Promise<void>;
72
72
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
73
73
  reset: (...args: any[]) => void;
74
74
  "update:search": (value: import('../search/props').SearchModel) => void;
75
75
  }, import('vue').PublicProps, {
76
- url: string;
77
76
  render: Function;
77
+ url: string;
78
78
  methodType: import('./props').RequestMethodType;
79
79
  responseDataField: string;
80
80
  responseTotalField: string;
@@ -118,11 +118,11 @@ export declare const MlSearchTable: {
118
118
  };
119
119
  paramsHandler: {
120
120
  type: FunctionConstructor;
121
- default: null;
121
+ default: any;
122
122
  };
123
123
  render: {
124
124
  type: FunctionConstructor;
125
- default: null;
125
+ default: any;
126
126
  };
127
127
  searchProps: {
128
128
  type: ObjectConstructor;
@@ -151,19 +151,19 @@ export declare const MlSearchTable: {
151
151
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
152
152
  readonly [Symbol.species]: ArrayConstructor;
153
153
  };
154
- default: () => never[];
154
+ default: () => any[];
155
155
  };
156
156
  search: {
157
157
  type: import('vue').PropType<import('../search/props').SearchModel>;
158
158
  };
159
159
  }>> & Readonly<{
160
- onReset?: ((...args: any[]) => any) | undefined;
161
- "onUpdate:search"?: ((value: import('../search/props').SearchModel) => any) | undefined;
160
+ onReset?: (...args: any[]) => any;
161
+ "onUpdate:search"?: (value: import('../search/props').SearchModel) => any;
162
162
  }>, {
163
163
  handleSearch: (reset?: boolean) => Promise<void>;
164
164
  }, {}, {}, {}, {
165
- url: string;
166
165
  render: Function;
166
+ url: string;
167
167
  methodType: import('./props').RequestMethodType;
168
168
  responseDataField: string;
169
169
  responseTotalField: string;
@@ -204,11 +204,11 @@ export declare const MlSearchTable: {
204
204
  };
205
205
  paramsHandler: {
206
206
  type: FunctionConstructor;
207
- default: null;
207
+ default: any;
208
208
  };
209
209
  render: {
210
210
  type: FunctionConstructor;
211
- default: null;
211
+ default: any;
212
212
  };
213
213
  searchProps: {
214
214
  type: ObjectConstructor;
@@ -237,22 +237,22 @@ export declare const MlSearchTable: {
237
237
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
238
238
  readonly [Symbol.species]: ArrayConstructor;
239
239
  };
240
- default: () => never[];
240
+ default: () => any[];
241
241
  };
242
242
  search: {
243
243
  type: import('vue').PropType<import('../search/props').SearchModel>;
244
244
  };
245
245
  }>> & Readonly<{
246
- onReset?: ((...args: any[]) => any) | undefined;
247
- "onUpdate:search"?: ((value: import('../search/props').SearchModel) => any) | undefined;
246
+ onReset?: (...args: any[]) => any;
247
+ "onUpdate:search"?: (value: import('../search/props').SearchModel) => any;
248
248
  }>, {
249
249
  handleSearch: (reset?: boolean) => Promise<void>;
250
250
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
251
251
  reset: (...args: any[]) => void;
252
252
  "update:search": (value: import('../search/props').SearchModel) => void;
253
253
  }, string, {
254
- url: string;
255
254
  render: Function;
255
+ url: string;
256
256
  methodType: import('./props').RequestMethodType;
257
257
  responseDataField: string;
258
258
  responseTotalField: string;
@@ -40,11 +40,11 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
40
40
  };
41
41
  paramsHandler: {
42
42
  type: FunctionConstructor;
43
- default: null;
43
+ default: any;
44
44
  };
45
45
  render: {
46
46
  type: FunctionConstructor;
47
- default: null;
47
+ default: any;
48
48
  };
49
49
  searchProps: {
50
50
  type: ObjectConstructor;
@@ -73,7 +73,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
73
73
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
74
74
  readonly [Symbol.species]: ArrayConstructor;
75
75
  };
76
- default: () => never[];
76
+ default: () => any[];
77
77
  };
78
78
  search: {
79
79
  type: import('vue').PropType<SearchModel>;
@@ -110,11 +110,11 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
110
110
  };
111
111
  paramsHandler: {
112
112
  type: FunctionConstructor;
113
- default: null;
113
+ default: any;
114
114
  };
115
115
  render: {
116
116
  type: FunctionConstructor;
117
- default: null;
117
+ default: any;
118
118
  };
119
119
  searchProps: {
120
120
  type: ObjectConstructor;
@@ -143,17 +143,17 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
143
143
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
144
144
  readonly [Symbol.species]: ArrayConstructor;
145
145
  };
146
- default: () => never[];
146
+ default: () => any[];
147
147
  };
148
148
  search: {
149
149
  type: import('vue').PropType<SearchModel>;
150
150
  };
151
151
  }>> & Readonly<{
152
- onReset?: ((...args: any[]) => any) | undefined;
153
- "onUpdate:search"?: ((value: SearchModel) => any) | undefined;
152
+ onReset?: (...args: any[]) => any;
153
+ "onUpdate:search"?: (value: SearchModel) => any;
154
154
  }>, {
155
- url: string;
156
155
  render: Function;
156
+ url: string;
157
157
  methodType: RequestMethodType;
158
158
  responseDataField: string;
159
159
  responseTotalField: string;
@@ -4,8 +4,8 @@ import { searchTableProps, RequestMethodType } from './props.mjs';
4
4
  import { ElTable, ElTableColumn, ElPagination } from 'element-plus';
5
5
  import Render from './render.mjs';
6
6
  import { bem } from '../../utils/index.mjs';
7
- import { initRequestInstance } from '../../packages/utils/dist/request/index.mjs';
8
- import { getNestedValue } from '../../packages/utils/dist/func/common.mjs';
7
+ import { initRequestInstance } from '../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.mjs';
8
+ import { getNestedValue } from '../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/func/common.mjs';
9
9
 
10
10
  var _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  ...{
@@ -31,11 +31,11 @@ export declare const searchTableProps: {
31
31
  };
32
32
  paramsHandler: {
33
33
  type: FunctionConstructor;
34
- default: null;
34
+ default: any;
35
35
  };
36
36
  render: {
37
37
  type: FunctionConstructor;
38
- default: null;
38
+ default: any;
39
39
  };
40
40
  searchProps: {
41
41
  type: ObjectConstructor;
@@ -64,6 +64,6 @@ export declare const searchTableProps: {
64
64
  fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
65
65
  readonly [Symbol.species]: ArrayConstructor;
66
66
  };
67
- default: () => never[];
67
+ default: () => any[];
68
68
  };
69
69
  };
@@ -0,0 +1,32 @@
1
+ export declare const MlTreeSelect: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
2
+ slots: {
3
+ footer?(_: {}): any;
4
+ };
5
+ attrs: any;
6
+ emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
7
+ }, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
+ props: {
9
+ readonly onInput?: (value: string) => any;
10
+ readonly onConfirm?: (selectedData: T | T[]) => any;
11
+ readonly onCancel?: () => any;
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
+ } & import('vue').PublicProps;
22
+ expose(exposed: import('vue').ShallowUnwrapRef<import('./type').TreeSelectExpose>): void;
23
+ attrs: any;
24
+ slots: {
25
+ footer?(_: {}): any;
26
+ };
27
+ emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
28
+ }>) => import('vue').VNode & {
29
+ __ctx?: Awaited<typeof __VLS_setup>;
30
+ };
31
+ export default MlTreeSelect;
32
+ export * from './type';
@@ -0,0 +1,6 @@
1
+ import { withInstall } from '../../utils/index.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+
4
+ const MlTreeSelect = withInstall(_sfc_main);
5
+
6
+ export { MlTreeSelect, MlTreeSelect as default };
@@ -0,0 +1,20 @@
1
+ import { TreeSelectProps, TreeSelectExpose } 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 onConfirm?: (selectedData: T | T[]) => any;
6
+ readonly onCancel?: () => any;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onInput" | "onConfirm" | "onCancel"> & TreeSelectProps<T> & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<TreeSelectExpose>): void;
9
+ attrs: any;
10
+ slots: {
11
+ footer?(_: {}): any;
12
+ };
13
+ emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
14
+ }>) => import('vue').VNode & {
15
+ __ctx?: Awaited<typeof __VLS_setup>;
16
+ };
17
+ export default _default;
18
+ type __VLS_PrettifyLocal<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,226 @@
1
+ import { defineComponent, ref, watch, computed, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createBlock, createElementVNode, createVNode, mergeProps, toHandlers, renderSlot, withCtx, createTextVNode, nextTick } from 'vue';
2
+ import { ElTree, ElMessage } from 'element-plus';
3
+ import { Search as search_default } from '../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.26_typescript@5.9.3_/node_modules/@element-plus/icons-vue/dist/index.mjs';
4
+ import { bem } from '../../utils/index.mjs';
5
+
6
+ var _sfc_main = /* @__PURE__ */ defineComponent({
7
+ ...{
8
+ name: "MlTreeSelect"
9
+ },
10
+ __name: "index",
11
+ props: {
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, default: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22" }
21
+ },
22
+ emits: ["confirm", "cancel", "input"],
23
+ setup(__props, { expose: __expose, emit: __emit }) {
24
+ const props = __props;
25
+ const emit = __emit;
26
+ const searchKeyword = ref("");
27
+ const treeRef = ref();
28
+ const selectedKeys = ref([]);
29
+ const selectedData = ref(props.multiple ? [] : {});
30
+ const initSelection = () => {
31
+ selectedKeys.value = [...props.defaultSelectedKeys];
32
+ nextTick(() => {
33
+ if (treeRef.value) {
34
+ if (props.multiple) {
35
+ treeRef.value.setCheckedKeys(props.defaultSelectedKeys);
36
+ } else {
37
+ treeRef.value.setCurrentKey(props.defaultSelectedKeys[0]);
38
+ }
39
+ }
40
+ });
41
+ };
42
+ watch(
43
+ () => props.defaultSelectedKeys,
44
+ () => {
45
+ initSelection();
46
+ },
47
+ { immediate: true }
48
+ );
49
+ const filteredTreeData = computed(() => {
50
+ if (!searchKeyword.value) return props.treeData;
51
+ const filterNode = (nodes) => {
52
+ return nodes.map((node) => {
53
+ const children = filterNode(node[props.treeProps.children || "children"] || []);
54
+ const isMatch = node[props.treeProps.label || "label"].includes(
55
+ searchKeyword.value
56
+ );
57
+ if (isMatch || children.length > 0) {
58
+ return { ...node, [props.treeProps.children || "children"]: children };
59
+ }
60
+ return null;
61
+ }).filter(Boolean);
62
+ };
63
+ return filterNode(props.treeData);
64
+ });
65
+ const handleCheckChange = (data, checked) => {
66
+ const nodeKeyField = props.nodeKey;
67
+ if (checked) {
68
+ selectedKeys.value.push(data[nodeKeyField]);
69
+ if (Array.isArray(selectedData.value)) {
70
+ selectedData.value.push(data);
71
+ }
72
+ } else {
73
+ selectedKeys.value = selectedKeys.value.filter((key) => key !== data[nodeKeyField]);
74
+ if (Array.isArray(selectedData.value)) {
75
+ selectedData.value = selectedData.value.filter(
76
+ (item) => item[nodeKeyField] !== data[nodeKeyField]
77
+ );
78
+ }
79
+ }
80
+ };
81
+ const handleNodeClick = (data) => {
82
+ if (!props.multiple) {
83
+ const nodeKeyField = props.nodeKey;
84
+ selectedKeys.value = [data[nodeKeyField]];
85
+ selectedData.value = data;
86
+ }
87
+ };
88
+ const reset = () => {
89
+ searchKeyword.value = "";
90
+ selectedKeys.value = [];
91
+ selectedData.value = props.multiple ? [] : {};
92
+ if (treeRef.value) {
93
+ if (props.multiple) {
94
+ treeRef.value.setCheckedKeys([]);
95
+ } else {
96
+ treeRef.value.setCurrentKey(void 0);
97
+ }
98
+ }
99
+ };
100
+ const getSelectedData = () => selectedData.value;
101
+ const getSelectedKeys = () => selectedKeys.value;
102
+ const handleConfirm = () => {
103
+ if (selectedKeys.value.length === 0) {
104
+ ElMessage.warning("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u8282\u70B9");
105
+ return;
106
+ }
107
+ emit("confirm", selectedData.value);
108
+ };
109
+ const handleCancel = () => {
110
+ emit("cancel");
111
+ };
112
+ __expose({
113
+ reset,
114
+ getSelectedData,
115
+ getSelectedKeys,
116
+ // el-tree 方法透传
117
+ getCheckedNodes: () => treeRef.value?.getCheckedNodes() || [],
118
+ getCheckedKeys: () => treeRef.value?.getCheckedKeys() || [],
119
+ getHalfCheckedNodes: () => treeRef.value?.getHalfCheckedNodes() || [],
120
+ getHalfCheckedKeys: () => treeRef.value?.getHalfCheckedKeys() || [],
121
+ getCurrentKey: () => treeRef.value?.getCurrentKey() ?? void 0,
122
+ getCurrentNode: () => treeRef.value?.getCurrentNode(),
123
+ setCheckedKeys: (keys) => treeRef.value?.setCheckedKeys(keys),
124
+ setCheckedNodes: (nodes) => treeRef.value?.setCheckedNodes(nodes),
125
+ setCurrentKey: (key) => treeRef.value?.setCurrentKey(key),
126
+ setCurrentNode: (node) => treeRef.value?.setCurrentNode(node),
127
+ getNode: (key) => treeRef.value?.getNode(key),
128
+ filter: (value) => treeRef.value?.filter(value),
129
+ updateKeyChildren: (key, children) => treeRef.value?.updateKeyChildren(key, children),
130
+ remove: (node) => treeRef.value?.remove(node),
131
+ append: (data, parentNode) => treeRef.value?.append(data, parentNode),
132
+ insertBefore: (data, refNode) => treeRef.value?.insertBefore(data, refNode),
133
+ insertAfter: (data, refNode) => treeRef.value?.insertAfter(data, refNode),
134
+ //
135
+ input: (value) => emit("input", value)
136
+ });
137
+ return (_ctx, _cache) => {
138
+ const _component_el_input = resolveComponent("el-input");
139
+ const _component_el_button = resolveComponent("el-button");
140
+ return openBlock(), createElementBlock(
141
+ "div",
142
+ {
143
+ class: normalizeClass(unref(bem)("tree-select"))
144
+ },
145
+ [
146
+ createCommentVNode(" \u641C\u7D22\u6846 "),
147
+ __props.showSearch ? (openBlock(), createBlock(_component_el_input, {
148
+ key: 0,
149
+ modelValue: searchKeyword.value,
150
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKeyword.value = $event),
151
+ placeholder: __props.placeholder,
152
+ clearable: "",
153
+ "prefix-icon": unref(search_default),
154
+ class: normalizeClass(unref(bem)("tree-select", "search")),
155
+ onInput: _cache[1] || (_cache[1] = (value) => emit("input", value))
156
+ }, null, 8, ["modelValue", "placeholder", "prefix-icon", "class"])) : createCommentVNode("v-if", true),
157
+ createCommentVNode(" \u6811\u5F62\u9009\u62E9 "),
158
+ createElementVNode(
159
+ "div",
160
+ {
161
+ class: normalizeClass(unref(bem)("tree-select", "tree"))
162
+ },
163
+ [
164
+ createVNode(unref(ElTree), mergeProps({
165
+ ref_key: "treeRef",
166
+ ref: treeRef,
167
+ data: filteredTreeData.value,
168
+ props: __props.treeProps,
169
+ "show-checkbox": __props.multiple,
170
+ "default-expand-all": __props.defaultExpandAll,
171
+ "expand-on-click-node": __props.expandOnClickNode,
172
+ "node-key": __props.nodeKey,
173
+ onCheckChange: handleCheckChange,
174
+ onNodeClick: handleNodeClick
175
+ }, _ctx.$attrs, toHandlers(_ctx.$attrs)), null, 16, ["data", "props", "show-checkbox", "default-expand-all", "expand-on-click-node", "node-key"])
176
+ ],
177
+ 2
178
+ /* CLASS */
179
+ ),
180
+ createCommentVNode(" \u5E95\u90E8\u6309\u94AE\u63D2\u69FD "),
181
+ createElementVNode(
182
+ "div",
183
+ {
184
+ class: normalizeClass(unref(bem)("tree-select", "footer"))
185
+ },
186
+ [
187
+ renderSlot(_ctx.$slots, "footer", {}, () => [
188
+ createVNode(_component_el_button, { onClick: handleCancel }, {
189
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
190
+ createTextVNode(
191
+ "\u53D6\u6D88",
192
+ -1
193
+ /* CACHED */
194
+ )
195
+ ])]),
196
+ _: 1
197
+ /* STABLE */
198
+ }),
199
+ createVNode(_component_el_button, {
200
+ type: "primary",
201
+ onClick: handleConfirm
202
+ }, {
203
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
204
+ createTextVNode(
205
+ "\u786E\u5B9A",
206
+ -1
207
+ /* CACHED */
208
+ )
209
+ ])]),
210
+ _: 1
211
+ /* STABLE */
212
+ })
213
+ ])
214
+ ],
215
+ 2
216
+ /* CLASS */
217
+ )
218
+ ],
219
+ 2
220
+ /* CLASS */
221
+ );
222
+ };
223
+ }
224
+ });
225
+
226
+ export { _sfc_main as default };
@@ -0,0 +1,34 @@
1
+ export interface TreeSelectProps<T = any> {
2
+ treeData: T[];
3
+ treeProps?: Record<string, any>;
4
+ multiple?: boolean;
5
+ defaultExpandAll?: boolean;
6
+ defaultSelectedKeys?: any[];
7
+ nodeKey?: string;
8
+ showSearch?: boolean;
9
+ expandOnClickNode?: boolean;
10
+ placeholder?: string;
11
+ }
12
+ export interface TreeSelectExpose {
13
+ reset: () => void;
14
+ getSelectedData: () => any;
15
+ getSelectedKeys: () => any[];
16
+ getCheckedNodes: () => any[];
17
+ getCheckedKeys: () => any[];
18
+ getHalfCheckedNodes: () => any[];
19
+ getHalfCheckedKeys: () => any[];
20
+ getCurrentKey: () => string | number | undefined;
21
+ getCurrentNode: () => any;
22
+ setCheckedKeys: (keys: any[]) => void;
23
+ setCheckedNodes: (nodes: any[]) => void;
24
+ setCurrentKey: (key: string | number | undefined) => void;
25
+ setCurrentNode: (node: any) => void;
26
+ getNode: (key: string | number) => any;
27
+ filter: (value: string) => void;
28
+ updateKeyChildren: (key: string | number, children: any[]) => void;
29
+ remove: (node: any) => void;
30
+ append: (data: any, parentNode?: any) => void;
31
+ insertBefore: (data: any, refNode: any) => void;
32
+ insertAfter: (data: any, refNode: any) => void;
33
+ input: (value: string) => void;
34
+ }
@@ -0,0 +1,60 @@
1
+ export declare const MlTreeSelectDialog: <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
+ width?: string;
23
+ readonly overflow?: boolean;
24
+ readonly center?: boolean;
25
+ readonly appendTo?: string | HTMLElement;
26
+ readonly showClose?: boolean;
27
+ readonly draggable?: boolean;
28
+ readonly appendToBody?: boolean;
29
+ readonly destroyOnClose?: boolean;
30
+ readonly closeOnClickModal?: boolean;
31
+ readonly closeOnPressEscape?: boolean;
32
+ readonly lockScroll?: boolean;
33
+ readonly modal?: boolean;
34
+ readonly openDelay?: number;
35
+ readonly closeDelay?: number;
36
+ readonly trapFocus?: boolean;
37
+ readonly headerAriaLevel?: string;
38
+ readonly alignCenter?: boolean;
39
+ readonly fullscreen?: boolean;
40
+ readonly ariaLevel?: string;
41
+ readonly top?: string;
42
+ readonly zIndex?: number;
43
+ readonly beforeClose?: import('element-plus').DialogBeforeCloseFn;
44
+ readonly modalClass?: string;
45
+ readonly headerClass?: string;
46
+ readonly bodyClass?: string;
47
+ readonly footerClass?: string;
48
+ readonly closeIcon?: unknown;
49
+ } & import('vue').PublicProps;
50
+ expose(exposed: import('vue').ShallowUnwrapRef<{
51
+ input: (value: string) => void;
52
+ }>): void;
53
+ attrs: any;
54
+ slots: {};
55
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "close") => void)) & ((evt: "update:modelValue", value: boolean) => void);
56
+ }>) => import('vue').VNode & {
57
+ __ctx?: Awaited<typeof __VLS_setup>;
58
+ };
59
+ export default MlTreeSelectDialog;
60
+ export * from './type';
@@ -0,0 +1,7 @@
1
+ import { withInstall } from '../../utils/index.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+ export { dialogPropKeys } from './type.mjs';
4
+
5
+ const MlTreeSelectDialog = withInstall(_sfc_main);
6
+
7
+ export { MlTreeSelectDialog, MlTreeSelectDialog as default };
@@ -0,0 +1,23 @@
1
+ import { TreeSelectDialogProps } 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
+ } & TreeSelectDialogProps<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,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };