@minilo/ui 0.0.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.
Files changed (165) hide show
  1. package/README.md +44 -0
  2. package/minilo/dist/index.css +1 -0
  3. package/minilo/dist/index.full.js +7054 -0
  4. package/minilo/dist/index.full.min.js +2 -0
  5. package/minilo/dist/index.full.min.js.map +1 -0
  6. package/minilo/dist/index.full.min.mjs +2 -0
  7. package/minilo/dist/index.full.min.mjs.map +1 -0
  8. package/minilo/dist/index.full.mjs +7041 -0
  9. package/minilo/es/components/button/index.d.ts +47 -0
  10. package/minilo/es/components/button/index.mjs +6 -0
  11. package/minilo/es/components/button/index.vue.d.ts +29 -0
  12. package/minilo/es/components/button/index.vue.mjs +5 -0
  13. package/minilo/es/components/button/index.vue2.mjs +67 -0
  14. package/minilo/es/components/button/type.d.ts +10 -0
  15. package/minilo/es/components/button/type.mjs +1 -0
  16. package/minilo/es/components/chart/index.d.ts +49 -0
  17. package/minilo/es/components/chart/index.mjs +6 -0
  18. package/minilo/es/components/chart/index.vue.d.ts +33 -0
  19. package/minilo/es/components/chart/index.vue.mjs +5 -0
  20. package/minilo/es/components/chart/index.vue2.mjs +124 -0
  21. package/minilo/es/components/chart/type.d.ts +7 -0
  22. package/minilo/es/components/chart/type.mjs +1 -0
  23. package/minilo/es/components/detail/index.d.ts +37 -0
  24. package/minilo/es/components/detail/index.mjs +6 -0
  25. package/minilo/es/components/detail/index.vue.d.ts +23 -0
  26. package/minilo/es/components/detail/index.vue.mjs +5 -0
  27. package/minilo/es/components/detail/index.vue2.mjs +194 -0
  28. package/minilo/es/components/detail/renderLabel.vue.d.ts +8 -0
  29. package/minilo/es/components/detail/renderLabel.vue.mjs +5 -0
  30. package/minilo/es/components/detail/renderLabel.vue2.mjs +23 -0
  31. package/minilo/es/components/detail/renderTooltip.vue.d.ts +8 -0
  32. package/minilo/es/components/detail/renderTooltip.vue.mjs +5 -0
  33. package/minilo/es/components/detail/renderTooltip.vue2.mjs +23 -0
  34. package/minilo/es/components/detail/type.d.ts +27 -0
  35. package/minilo/es/components/detail/type.mjs +1 -0
  36. package/minilo/es/components/index.d.ts +7 -0
  37. package/minilo/es/components/index.mjs +7 -0
  38. package/minilo/es/components/number-range-input/index.d.ts +41 -0
  39. package/minilo/es/components/number-range-input/index.mjs +6 -0
  40. package/minilo/es/components/number-range-input/index.vue.d.ts +33 -0
  41. package/minilo/es/components/number-range-input/index.vue.mjs +5 -0
  42. package/minilo/es/components/number-range-input/index.vue2.mjs +150 -0
  43. package/minilo/es/components/number-range-input/props.d.ts +10 -0
  44. package/minilo/es/components/number-range-input/props.mjs +1 -0
  45. package/minilo/es/components/search/index.d.ts +586 -0
  46. package/minilo/es/components/search/index.mjs +6 -0
  47. package/minilo/es/components/search/index.vue.d.ts +750 -0
  48. package/minilo/es/components/search/index.vue.mjs +5 -0
  49. package/minilo/es/components/search/index.vue2.mjs +298 -0
  50. package/minilo/es/components/search/props.d.ts +107 -0
  51. package/minilo/es/components/search/props.mjs +55 -0
  52. package/minilo/es/components/search-table/index.d.ts +274 -0
  53. package/minilo/es/components/search-table/index.mjs +6 -0
  54. package/minilo/es/components/search-table/index.vue.d.ts +173 -0
  55. package/minilo/es/components/search-table/index.vue.mjs +5 -0
  56. package/minilo/es/components/search-table/index.vue2.mjs +195 -0
  57. package/minilo/es/components/search-table/props.d.ts +69 -0
  58. package/minilo/es/components/search-table/props.mjs +69 -0
  59. package/minilo/es/components/search-table/render.d.ts +11 -0
  60. package/minilo/es/components/search-table/render.mjs +19 -0
  61. package/minilo/es/components/virtual-list/index.d.ts +59 -0
  62. package/minilo/es/components/virtual-list/index.mjs +6 -0
  63. package/minilo/es/components/virtual-list/index.vue.d.ts +39 -0
  64. package/minilo/es/components/virtual-list/index.vue.mjs +5 -0
  65. package/minilo/es/components/virtual-list/index.vue2.mjs +421 -0
  66. package/minilo/es/components/virtual-list/type.d.ts +20 -0
  67. package/minilo/es/components/virtual-list/type.mjs +1 -0
  68. package/minilo/es/index.d.ts +1087 -0
  69. package/minilo/es/node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.mjs +25 -0
  70. package/minilo/es/node_modules/.pnpm/@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/core/index.mjs +73 -0
  71. package/minilo/es/node_modules/.pnpm/@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/shared/index.mjs +76 -0
  72. package/minilo/es/packages/utils/dist/func/common.mjs +14 -0
  73. package/minilo/es/packages/utils/dist/request/index.mjs +110 -0
  74. package/minilo/es/resolver/index.d.ts +8 -0
  75. package/minilo/es/resolver/index.mjs +26 -0
  76. package/minilo/es/utils/index.d.ts +28 -0
  77. package/minilo/es/utils/index.mjs +30 -0
  78. package/minilo/lib/components/button/index.d.ts +47 -0
  79. package/minilo/lib/components/button/index.js +11 -0
  80. package/minilo/lib/components/button/index.vue.d.ts +29 -0
  81. package/minilo/lib/components/button/index.vue.js +9 -0
  82. package/minilo/lib/components/button/index.vue2.js +71 -0
  83. package/minilo/lib/components/button/type.d.ts +10 -0
  84. package/minilo/lib/components/button/type.js +2 -0
  85. package/minilo/lib/components/chart/index.d.ts +49 -0
  86. package/minilo/lib/components/chart/index.js +11 -0
  87. package/minilo/lib/components/chart/index.vue.d.ts +33 -0
  88. package/minilo/lib/components/chart/index.vue.js +9 -0
  89. package/minilo/lib/components/chart/index.vue2.js +128 -0
  90. package/minilo/lib/components/chart/type.d.ts +7 -0
  91. package/minilo/lib/components/chart/type.js +2 -0
  92. package/minilo/lib/components/detail/index.d.ts +37 -0
  93. package/minilo/lib/components/detail/index.js +11 -0
  94. package/minilo/lib/components/detail/index.vue.d.ts +23 -0
  95. package/minilo/lib/components/detail/index.vue.js +9 -0
  96. package/minilo/lib/components/detail/index.vue2.js +198 -0
  97. package/minilo/lib/components/detail/renderLabel.vue.d.ts +8 -0
  98. package/minilo/lib/components/detail/renderLabel.vue.js +9 -0
  99. package/minilo/lib/components/detail/renderLabel.vue2.js +27 -0
  100. package/minilo/lib/components/detail/renderTooltip.vue.d.ts +8 -0
  101. package/minilo/lib/components/detail/renderTooltip.vue.js +9 -0
  102. package/minilo/lib/components/detail/renderTooltip.vue2.js +27 -0
  103. package/minilo/lib/components/detail/type.d.ts +27 -0
  104. package/minilo/lib/components/detail/type.js +2 -0
  105. package/minilo/lib/components/index.d.ts +7 -0
  106. package/minilo/lib/components/index.js +19 -0
  107. package/minilo/lib/components/number-range-input/index.d.ts +41 -0
  108. package/minilo/lib/components/number-range-input/index.js +11 -0
  109. package/minilo/lib/components/number-range-input/index.vue.d.ts +33 -0
  110. package/minilo/lib/components/number-range-input/index.vue.js +9 -0
  111. package/minilo/lib/components/number-range-input/index.vue2.js +154 -0
  112. package/minilo/lib/components/number-range-input/props.d.ts +10 -0
  113. package/minilo/lib/components/number-range-input/props.js +2 -0
  114. package/minilo/lib/components/search/index.d.ts +586 -0
  115. package/minilo/lib/components/search/index.js +11 -0
  116. package/minilo/lib/components/search/index.vue.d.ts +750 -0
  117. package/minilo/lib/components/search/index.vue.js +9 -0
  118. package/minilo/lib/components/search/index.vue2.js +302 -0
  119. package/minilo/lib/components/search/props.d.ts +107 -0
  120. package/minilo/lib/components/search/props.js +58 -0
  121. package/minilo/lib/components/search-table/index.d.ts +274 -0
  122. package/minilo/lib/components/search-table/index.js +11 -0
  123. package/minilo/lib/components/search-table/index.vue.d.ts +173 -0
  124. package/minilo/lib/components/search-table/index.vue.js +9 -0
  125. package/minilo/lib/components/search-table/index.vue2.js +199 -0
  126. package/minilo/lib/components/search-table/props.d.ts +69 -0
  127. package/minilo/lib/components/search-table/props.js +72 -0
  128. package/minilo/lib/components/search-table/render.d.ts +11 -0
  129. package/minilo/lib/components/search-table/render.js +23 -0
  130. package/minilo/lib/components/virtual-list/index.d.ts +59 -0
  131. package/minilo/lib/components/virtual-list/index.js +11 -0
  132. package/minilo/lib/components/virtual-list/index.vue.d.ts +39 -0
  133. package/minilo/lib/components/virtual-list/index.vue.js +9 -0
  134. package/minilo/lib/components/virtual-list/index.vue2.js +425 -0
  135. package/minilo/lib/components/virtual-list/type.d.ts +20 -0
  136. package/minilo/lib/components/virtual-list/type.js +2 -0
  137. package/minilo/lib/index.d.ts +1087 -0
  138. package/minilo/lib/node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js +27 -0
  139. package/minilo/lib/node_modules/.pnpm/@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/core/index.js +84 -0
  140. package/minilo/lib/node_modules/.pnpm/@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/shared/index.js +83 -0
  141. package/minilo/lib/packages/utils/dist/func/common.js +16 -0
  142. package/minilo/lib/packages/utils/dist/request/index.js +120 -0
  143. package/minilo/lib/resolver/index.d.ts +8 -0
  144. package/minilo/lib/resolver/index.js +28 -0
  145. package/minilo/lib/utils/index.d.ts +28 -0
  146. package/minilo/lib/utils/index.js +34 -0
  147. package/minilo/theme-chalk/index.css +1 -0
  148. package/minilo/theme-chalk/ml-button.css +1 -0
  149. package/minilo/theme-chalk/ml-chart.css +1 -0
  150. package/minilo/theme-chalk/ml-detail.css +1 -0
  151. package/minilo/theme-chalk/ml-number-range-input.css +1 -0
  152. package/minilo/theme-chalk/ml-search-table.css +1 -0
  153. package/minilo/theme-chalk/ml-search.css +1 -0
  154. package/minilo/theme-chalk/ml-virtual-list.css +1 -0
  155. package/minilo/theme-chalk/src/button.scss +22 -0
  156. package/minilo/theme-chalk/src/chart.scss +11 -0
  157. package/minilo/theme-chalk/src/default/variable.scss +1 -0
  158. package/minilo/theme-chalk/src/detail.scss +9 -0
  159. package/minilo/theme-chalk/src/index.scss +12 -0
  160. package/minilo/theme-chalk/src/mixins/mixin.scss +273 -0
  161. package/minilo/theme-chalk/src/number-range-input.scss +9 -0
  162. package/minilo/theme-chalk/src/search-table.scss +47 -0
  163. package/minilo/theme-chalk/src/search.scss +20 -0
  164. package/minilo/theme-chalk/src/virtual-list.scss +49 -0
  165. package/package.json +107 -0
@@ -0,0 +1,274 @@
1
+ export declare const MlSearchTable: {
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
+ methodType: {
4
+ type: () => import('./props').RequestMethodType;
5
+ default: string;
6
+ };
7
+ url: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ responseDataField: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ responseTotalField: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ headers: {
20
+ type: ObjectConstructor;
21
+ default: () => {};
22
+ };
23
+ showPagination: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ paramsHandler: {
28
+ type: FunctionConstructor;
29
+ default: null;
30
+ };
31
+ render: {
32
+ type: FunctionConstructor;
33
+ default: null;
34
+ };
35
+ searchProps: {
36
+ type: ObjectConstructor;
37
+ default: () => void;
38
+ };
39
+ tableProps: {
40
+ type: ObjectConstructor;
41
+ default: () => {
42
+ border: boolean;
43
+ };
44
+ };
45
+ columns: {
46
+ type: {
47
+ (arrayLength: number): any[];
48
+ (...items: any[]): any[];
49
+ new (arrayLength: number): any[];
50
+ new (...items: any[]): any[];
51
+ isArray(arg: any): arg is any[];
52
+ readonly prototype: any[];
53
+ from<T>(arrayLike: ArrayLike<T>): T[];
54
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
55
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
56
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
57
+ of<T>(...items: T[]): T[];
58
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
59
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
60
+ readonly [Symbol.species]: ArrayConstructor;
61
+ };
62
+ default: () => never[];
63
+ };
64
+ search: {
65
+ type: import('vue').PropType<import('../search/props').SearchModel>;
66
+ };
67
+ }>> & Readonly<{
68
+ onReset?: ((...args: any[]) => any) | undefined;
69
+ "onUpdate:search"?: ((value: import('../search/props').SearchModel) => any) | undefined;
70
+ }>, {
71
+ handleSearch: (reset?: boolean) => Promise<void>;
72
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
73
+ reset: (...args: any[]) => void;
74
+ "update:search": (value: import('../search/props').SearchModel) => void;
75
+ }, import('vue').PublicProps, {
76
+ url: string;
77
+ render: Function;
78
+ methodType: import('./props').RequestMethodType;
79
+ responseDataField: string;
80
+ responseTotalField: string;
81
+ headers: Record<string, any>;
82
+ showPagination: boolean;
83
+ paramsHandler: Function;
84
+ searchProps: Record<string, any>;
85
+ tableProps: Record<string, any>;
86
+ columns: any[];
87
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
88
+ P: {};
89
+ B: {};
90
+ D: {};
91
+ C: {};
92
+ M: {};
93
+ Defaults: {};
94
+ }, Readonly<import('vue').ExtractPropTypes<{
95
+ methodType: {
96
+ type: () => import('./props').RequestMethodType;
97
+ default: string;
98
+ };
99
+ url: {
100
+ type: StringConstructor;
101
+ default: string;
102
+ };
103
+ responseDataField: {
104
+ type: StringConstructor;
105
+ default: string;
106
+ };
107
+ responseTotalField: {
108
+ type: StringConstructor;
109
+ default: string;
110
+ };
111
+ headers: {
112
+ type: ObjectConstructor;
113
+ default: () => {};
114
+ };
115
+ showPagination: {
116
+ type: BooleanConstructor;
117
+ default: boolean;
118
+ };
119
+ paramsHandler: {
120
+ type: FunctionConstructor;
121
+ default: null;
122
+ };
123
+ render: {
124
+ type: FunctionConstructor;
125
+ default: null;
126
+ };
127
+ searchProps: {
128
+ type: ObjectConstructor;
129
+ default: () => void;
130
+ };
131
+ tableProps: {
132
+ type: ObjectConstructor;
133
+ default: () => {
134
+ border: boolean;
135
+ };
136
+ };
137
+ columns: {
138
+ type: {
139
+ (arrayLength: number): any[];
140
+ (...items: any[]): any[];
141
+ new (arrayLength: number): any[];
142
+ new (...items: any[]): any[];
143
+ isArray(arg: any): arg is any[];
144
+ readonly prototype: any[];
145
+ from<T>(arrayLike: ArrayLike<T>): T[];
146
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
147
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
148
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
149
+ of<T>(...items: T[]): T[];
150
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
151
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
152
+ readonly [Symbol.species]: ArrayConstructor;
153
+ };
154
+ default: () => never[];
155
+ };
156
+ search: {
157
+ type: import('vue').PropType<import('../search/props').SearchModel>;
158
+ };
159
+ }>> & Readonly<{
160
+ onReset?: ((...args: any[]) => any) | undefined;
161
+ "onUpdate:search"?: ((value: import('../search/props').SearchModel) => any) | undefined;
162
+ }>, {
163
+ handleSearch: (reset?: boolean) => Promise<void>;
164
+ }, {}, {}, {}, {
165
+ url: string;
166
+ render: Function;
167
+ methodType: import('./props').RequestMethodType;
168
+ responseDataField: string;
169
+ responseTotalField: string;
170
+ headers: Record<string, any>;
171
+ showPagination: boolean;
172
+ paramsHandler: Function;
173
+ searchProps: Record<string, any>;
174
+ tableProps: Record<string, any>;
175
+ columns: any[];
176
+ }>;
177
+ __isFragment?: never;
178
+ __isTeleport?: never;
179
+ __isSuspense?: never;
180
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
181
+ methodType: {
182
+ type: () => import('./props').RequestMethodType;
183
+ default: string;
184
+ };
185
+ url: {
186
+ type: StringConstructor;
187
+ default: string;
188
+ };
189
+ responseDataField: {
190
+ type: StringConstructor;
191
+ default: string;
192
+ };
193
+ responseTotalField: {
194
+ type: StringConstructor;
195
+ default: string;
196
+ };
197
+ headers: {
198
+ type: ObjectConstructor;
199
+ default: () => {};
200
+ };
201
+ showPagination: {
202
+ type: BooleanConstructor;
203
+ default: boolean;
204
+ };
205
+ paramsHandler: {
206
+ type: FunctionConstructor;
207
+ default: null;
208
+ };
209
+ render: {
210
+ type: FunctionConstructor;
211
+ default: null;
212
+ };
213
+ searchProps: {
214
+ type: ObjectConstructor;
215
+ default: () => void;
216
+ };
217
+ tableProps: {
218
+ type: ObjectConstructor;
219
+ default: () => {
220
+ border: boolean;
221
+ };
222
+ };
223
+ columns: {
224
+ type: {
225
+ (arrayLength: number): any[];
226
+ (...items: any[]): any[];
227
+ new (arrayLength: number): any[];
228
+ new (...items: any[]): any[];
229
+ isArray(arg: any): arg is any[];
230
+ readonly prototype: any[];
231
+ from<T>(arrayLike: ArrayLike<T>): T[];
232
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
233
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
234
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
235
+ of<T>(...items: T[]): T[];
236
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
237
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
238
+ readonly [Symbol.species]: ArrayConstructor;
239
+ };
240
+ default: () => never[];
241
+ };
242
+ search: {
243
+ type: import('vue').PropType<import('../search/props').SearchModel>;
244
+ };
245
+ }>> & Readonly<{
246
+ onReset?: ((...args: any[]) => any) | undefined;
247
+ "onUpdate:search"?: ((value: import('../search/props').SearchModel) => any) | undefined;
248
+ }>, {
249
+ handleSearch: (reset?: boolean) => Promise<void>;
250
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
251
+ reset: (...args: any[]) => void;
252
+ "update:search": (value: import('../search/props').SearchModel) => void;
253
+ }, string, {
254
+ url: string;
255
+ render: Function;
256
+ methodType: import('./props').RequestMethodType;
257
+ responseDataField: string;
258
+ responseTotalField: string;
259
+ headers: Record<string, any>;
260
+ showPagination: boolean;
261
+ paramsHandler: Function;
262
+ searchProps: Record<string, any>;
263
+ tableProps: Record<string, any>;
264
+ columns: any[];
265
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
266
+ $slots: Partial<Record<any, (_: {}) => any>> & Partial<Record<any, (_: {
267
+ index: any;
268
+ row: any;
269
+ }) => any>> & {
270
+ prefix?(_: {}): any;
271
+ suffix?(_: {}): any;
272
+ };
273
+ });
274
+ export default MlSearchTable;
@@ -0,0 +1,6 @@
1
+ import { withInstall } from '../../utils/index.mjs';
2
+ import _sfc_main from './index.vue2.mjs';
3
+
4
+ const MlSearchTable = withInstall(_sfc_main);
5
+
6
+ export { MlSearchTable, MlSearchTable as default };
@@ -0,0 +1,173 @@
1
+ import { RequestMethodType } from './props';
2
+ import { SearchModel } from '../search/props';
3
+ declare function __VLS_template(): {
4
+ attrs: Partial<{}>;
5
+ slots: Partial<Record<any, (_: {}) => any>> & Partial<Record<any, (_: {
6
+ index: any;
7
+ row: any;
8
+ }) => any>> & {
9
+ prefix?(_: {}): any;
10
+ suffix?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
17
+ methodType: {
18
+ type: () => RequestMethodType;
19
+ default: string;
20
+ };
21
+ url: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ responseDataField: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ responseTotalField: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ headers: {
34
+ type: ObjectConstructor;
35
+ default: () => {};
36
+ };
37
+ showPagination: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ paramsHandler: {
42
+ type: FunctionConstructor;
43
+ default: null;
44
+ };
45
+ render: {
46
+ type: FunctionConstructor;
47
+ default: null;
48
+ };
49
+ searchProps: {
50
+ type: ObjectConstructor;
51
+ default: () => void;
52
+ };
53
+ tableProps: {
54
+ type: ObjectConstructor;
55
+ default: () => {
56
+ border: boolean;
57
+ };
58
+ };
59
+ columns: {
60
+ type: {
61
+ (arrayLength: number): any[];
62
+ (...items: any[]): any[];
63
+ new (arrayLength: number): any[];
64
+ new (...items: any[]): any[];
65
+ isArray(arg: any): arg is any[];
66
+ readonly prototype: any[];
67
+ from<T>(arrayLike: ArrayLike<T>): T[];
68
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
69
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
70
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
71
+ of<T>(...items: T[]): T[];
72
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
73
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
74
+ readonly [Symbol.species]: ArrayConstructor;
75
+ };
76
+ default: () => never[];
77
+ };
78
+ search: {
79
+ type: import('vue').PropType<SearchModel>;
80
+ };
81
+ }>, {
82
+ handleSearch: (reset?: boolean) => Promise<void>;
83
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
84
+ reset: (...args: any[]) => void;
85
+ "update:search": (value: SearchModel) => void;
86
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
87
+ methodType: {
88
+ type: () => RequestMethodType;
89
+ default: string;
90
+ };
91
+ url: {
92
+ type: StringConstructor;
93
+ default: string;
94
+ };
95
+ responseDataField: {
96
+ type: StringConstructor;
97
+ default: string;
98
+ };
99
+ responseTotalField: {
100
+ type: StringConstructor;
101
+ default: string;
102
+ };
103
+ headers: {
104
+ type: ObjectConstructor;
105
+ default: () => {};
106
+ };
107
+ showPagination: {
108
+ type: BooleanConstructor;
109
+ default: boolean;
110
+ };
111
+ paramsHandler: {
112
+ type: FunctionConstructor;
113
+ default: null;
114
+ };
115
+ render: {
116
+ type: FunctionConstructor;
117
+ default: null;
118
+ };
119
+ searchProps: {
120
+ type: ObjectConstructor;
121
+ default: () => void;
122
+ };
123
+ tableProps: {
124
+ type: ObjectConstructor;
125
+ default: () => {
126
+ border: boolean;
127
+ };
128
+ };
129
+ columns: {
130
+ type: {
131
+ (arrayLength: number): any[];
132
+ (...items: any[]): any[];
133
+ new (arrayLength: number): any[];
134
+ new (...items: any[]): any[];
135
+ isArray(arg: any): arg is any[];
136
+ readonly prototype: any[];
137
+ from<T>(arrayLike: ArrayLike<T>): T[];
138
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
139
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
140
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
141
+ of<T>(...items: T[]): T[];
142
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
143
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
144
+ readonly [Symbol.species]: ArrayConstructor;
145
+ };
146
+ default: () => never[];
147
+ };
148
+ search: {
149
+ type: import('vue').PropType<SearchModel>;
150
+ };
151
+ }>> & Readonly<{
152
+ onReset?: ((...args: any[]) => any) | undefined;
153
+ "onUpdate:search"?: ((value: SearchModel) => any) | undefined;
154
+ }>, {
155
+ url: string;
156
+ render: Function;
157
+ methodType: RequestMethodType;
158
+ responseDataField: string;
159
+ responseTotalField: string;
160
+ headers: Record<string, any>;
161
+ showPagination: boolean;
162
+ paramsHandler: Function;
163
+ searchProps: Record<string, any>;
164
+ tableProps: Record<string, any>;
165
+ columns: any[];
166
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
167
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
168
+ export default _default;
169
+ type __VLS_WithTemplateSlots<T, S> = T & {
170
+ new (): {
171
+ $slots: S;
172
+ };
173
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,195 @@
1
+ import { defineComponent, mergeModels, useModel, useAttrs, ref, onMounted, resolveDirective, createElementBlock, openBlock, normalizeClass, unref, createVNode, renderSlot, withDirectives, createElementVNode, mergeProps, createSlots, renderList, withCtx, createBlock, toHandlers, Fragment, createCommentVNode } from 'vue';
2
+ import _sfc_main$1 from '../search/index.vue2.mjs';
3
+ import { searchTableProps, RequestMethodType } from './props.mjs';
4
+ import { ElTable, ElTableColumn, ElPagination } from 'element-plus';
5
+ import Render from './render.mjs';
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';
9
+
10
+ var _sfc_main = /* @__PURE__ */ defineComponent({
11
+ ...{
12
+ name: "MlSearchTable",
13
+ inheritAttrs: false
14
+ },
15
+ __name: "index",
16
+ props: /* @__PURE__ */ mergeModels(searchTableProps, {
17
+ "search": { type: Object },
18
+ "searchModifiers": {}
19
+ }),
20
+ emits: /* @__PURE__ */ mergeModels(["reset"], ["update:search"]),
21
+ setup(__props, { expose: __expose, emit: __emit }) {
22
+ const searchModel = useModel(__props, "search");
23
+ const props = __props;
24
+ const attrs = useAttrs();
25
+ const emit = __emit;
26
+ const axios = initRequestInstance({
27
+ baseURL: "",
28
+ headers: props.headers
29
+ });
30
+ const data = ref([]);
31
+ const loading = ref(false);
32
+ const pagination = ref({
33
+ currentPage: 1,
34
+ pageSize: 20,
35
+ total: 100
36
+ });
37
+ const handleSearch = async (reset2 = true) => {
38
+ try {
39
+ if (reset2) {
40
+ pagination.value.currentPage = 1;
41
+ }
42
+ const defaultParams = {
43
+ ...searchModel.value
44
+ };
45
+ if (props.showPagination) {
46
+ Object.assign(defaultParams, {
47
+ pageSize: pagination.value.pageSize,
48
+ currentPage: pagination.value.currentPage
49
+ });
50
+ }
51
+ const params = props.paramsHandler ? props.paramsHandler(defaultParams) : defaultParams;
52
+ const requestParams = [RequestMethodType.GET, RequestMethodType.DELETE].includes(
53
+ props.methodType
54
+ ) ? { params } : params;
55
+ loading.value = true;
56
+ const res = await axios[props.methodType](
57
+ props.url,
58
+ requestParams
59
+ );
60
+ data.value = getNestedValue(res, props.responseDataField);
61
+ if (props.showPagination) {
62
+ pagination.value.total = getNestedValue(res, props.responseTotalField);
63
+ }
64
+ } catch (error) {
65
+ console.log(error);
66
+ } finally {
67
+ loading.value = false;
68
+ }
69
+ };
70
+ const submit = () => {
71
+ handleSearch();
72
+ };
73
+ const reset = () => {
74
+ emit("reset");
75
+ handleSearch();
76
+ };
77
+ onMounted(() => {
78
+ handleSearch();
79
+ });
80
+ __expose({
81
+ handleSearch
82
+ });
83
+ const tableListeners = Object.keys(attrs).reduce((listeners, key) => {
84
+ if (key.startsWith("on")) {
85
+ listeners[key] = attrs[key];
86
+ }
87
+ return listeners;
88
+ }, {});
89
+ return (_ctx, _cache) => {
90
+ const _directive_loading = resolveDirective("loading");
91
+ return openBlock(), createElementBlock(
92
+ "div",
93
+ {
94
+ class: normalizeClass(unref(bem)("search-table"))
95
+ },
96
+ [
97
+ createVNode(_sfc_main$1, mergeProps({
98
+ onSubmit: submit,
99
+ onReset: reset,
100
+ modelValue: searchModel.value,
101
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchModel.value = $event)
102
+ }, _ctx.searchProps), createSlots({
103
+ _: 2
104
+ /* DYNAMIC */
105
+ }, [
106
+ renderList(_ctx.searchProps.slots, (item) => {
107
+ return {
108
+ name: item.prop,
109
+ fn: withCtx(() => [
110
+ renderSlot(_ctx.$slots, item.prop)
111
+ ])
112
+ };
113
+ })
114
+ ]), 1040, ["modelValue"]),
115
+ renderSlot(_ctx.$slots, "prefix"),
116
+ withDirectives((openBlock(), createBlock(unref(ElTable), mergeProps(toHandlers(unref(tableListeners)), {
117
+ class: unref(bem)("search-table", "content")
118
+ }, _ctx.tableProps, {
119
+ border: true,
120
+ data: data.value
121
+ }), {
122
+ default: withCtx(() => [
123
+ (openBlock(true), createElementBlock(
124
+ Fragment,
125
+ null,
126
+ renderList(_ctx.columns, (item, index) => {
127
+ return openBlock(), createBlock(
128
+ unref(ElTableColumn),
129
+ mergeProps({ key: index }, { ref_for: true }, item),
130
+ {
131
+ default: withCtx((scope) => [
132
+ item.slotName ? renderSlot(_ctx.$slots, item.slotName, {
133
+ key: 0,
134
+ index: scope.$index,
135
+ row: scope.row
136
+ }) : createCommentVNode("v-if", true),
137
+ item.render ? (openBlock(), createBlock(unref(Render), {
138
+ key: 1,
139
+ scope,
140
+ render: item.render
141
+ }, null, 8, ["scope", "render"])) : createCommentVNode("v-if", true)
142
+ ]),
143
+ _: 2
144
+ /* DYNAMIC */
145
+ },
146
+ 1040
147
+ /* FULL_PROPS, DYNAMIC_SLOTS */
148
+ );
149
+ }),
150
+ 128
151
+ /* KEYED_FRAGMENT */
152
+ ))
153
+ ]),
154
+ _: 3
155
+ /* FORWARDED */
156
+ }, 16, ["class", "data"])), [
157
+ [
158
+ _directive_loading,
159
+ loading.value,
160
+ void 0,
161
+ { lock: true }
162
+ ]
163
+ ]),
164
+ createElementVNode(
165
+ "div",
166
+ {
167
+ class: normalizeClass(unref(bem)("search-table", "pagination"))
168
+ },
169
+ [
170
+ _ctx.showPagination ? (openBlock(), createBlock(unref(ElPagination), {
171
+ key: 0,
172
+ onChange: _cache[1] || (_cache[1] = ($event) => handleSearch(false)),
173
+ style: { "margin-top": "10px" },
174
+ background: "",
175
+ layout: "total, sizes, prev, pager, next, jumper",
176
+ "page-size": pagination.value.pageSize,
177
+ "onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => pagination.value.pageSize = $event),
178
+ "current-page": pagination.value.currentPage,
179
+ "onUpdate:currentPage": _cache[3] || (_cache[3] = ($event) => pagination.value.currentPage = $event),
180
+ total: pagination.value.total
181
+ }, null, 8, ["page-size", "current-page", "total"])) : createCommentVNode("v-if", true)
182
+ ],
183
+ 2
184
+ /* CLASS */
185
+ ),
186
+ renderSlot(_ctx.$slots, "suffix")
187
+ ],
188
+ 2
189
+ /* CLASS */
190
+ );
191
+ };
192
+ }
193
+ });
194
+
195
+ export { _sfc_main as default };