@minilo/ui 0.0.6 → 0.0.7

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 (47) hide show
  1. package/minilo/dist/index.full.js +186 -214
  2. package/minilo/dist/index.full.min.js +1 -1
  3. package/minilo/dist/index.full.min.js.map +1 -1
  4. package/minilo/dist/index.full.min.mjs +1 -1
  5. package/minilo/dist/index.full.min.mjs.map +1 -1
  6. package/minilo/dist/index.full.mjs +186 -214
  7. package/minilo/es/components/image-upload-pro/index.vue2.mjs +2 -2
  8. package/minilo/es/components/search/index.vue2.mjs +0 -1
  9. package/minilo/es/components/search-table/index.vue.d.ts +16 -0
  10. package/minilo/es/components/search-table/index.vue2.mjs +6 -3
  11. package/minilo/es/components/tree-select/index.d.ts +4 -2
  12. package/minilo/es/components/tree-select/index.vue.d.ts +5 -2
  13. package/minilo/es/components/tree-select/index.vue2.mjs +8 -5
  14. package/minilo/es/components/tree-select-dialog/index.d.ts +2 -0
  15. package/minilo/es/components/tree-select-dialog/index.vue.d.ts +3 -0
  16. package/minilo/es/components/tree-select-dialog/index.vue2.mjs +14 -6
  17. package/minilo/es/components/tree-select-drawer/index.d.ts +2 -0
  18. package/minilo/es/components/tree-select-drawer/index.vue.d.ts +3 -0
  19. package/minilo/es/components/tree-select-drawer/index.vue2.mjs +14 -6
  20. package/minilo/es/components/virtual-list/index.vue2.mjs +3 -1
  21. package/minilo/es/packages/utils/dist/request/index.mjs +105 -0
  22. package/minilo/es/resolver/index.mjs +1 -4
  23. package/minilo/lib/components/image-upload-pro/index.vue2.js +2 -2
  24. package/minilo/lib/components/search/index.vue2.js +0 -1
  25. package/minilo/lib/components/search-table/index.vue.d.ts +16 -0
  26. package/minilo/lib/components/search-table/index.vue2.js +6 -3
  27. package/minilo/lib/components/tree-select/index.d.ts +4 -2
  28. package/minilo/lib/components/tree-select/index.vue.d.ts +5 -2
  29. package/minilo/lib/components/tree-select/index.vue2.js +7 -4
  30. package/minilo/lib/components/tree-select-dialog/index.d.ts +2 -0
  31. package/minilo/lib/components/tree-select-dialog/index.vue.d.ts +3 -0
  32. package/minilo/lib/components/tree-select-dialog/index.vue2.js +14 -6
  33. package/minilo/lib/components/tree-select-drawer/index.d.ts +2 -0
  34. package/minilo/lib/components/tree-select-drawer/index.vue.d.ts +3 -0
  35. package/minilo/lib/components/tree-select-drawer/index.vue2.js +14 -6
  36. package/minilo/lib/components/virtual-list/index.vue2.js +3 -1
  37. package/minilo/lib/packages/utils/dist/request/index.js +115 -0
  38. package/minilo/lib/resolver/index.js +1 -4
  39. package/package.json +2 -2
  40. package/minilo/es/components/search-table/index.d.ts +0 -274
  41. package/minilo/es/index.d.ts +0 -1724
  42. package/minilo/es/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 -110
  43. package/minilo/lib/components/search-table/index.d.ts +0 -274
  44. package/minilo/lib/index.d.ts +0 -1724
  45. package/minilo/lib/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 -120
  46. /package/minilo/es/{node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo → packages}/utils/dist/func/common.mjs +0 -0
  47. /package/minilo/lib/{node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo → packages}/utils/dist/func/common.js +0 -0
@@ -1,110 +0,0 @@
1
- import axios$1 from 'axios';
2
- export * from 'axios';
3
- import { ElMessage } from 'element-plus';
4
- import { defu } from 'defu';
5
-
6
- const initRequestInstance = (extendConfig = {}, interceptorsRequestFn = () => {
7
- }, interceptorsResponseFn = () => {
8
- }) => {
9
- const axiosConfig = defu({}, extendConfig, {
10
- baseURL: "/",
11
- // 从环境变量获取基础URL
12
- timeout: 1e4,
13
- // 超时时间
14
- headers: {
15
- "Content-Type": "application/json;charset=utf-8"
16
- }
17
- });
18
- const instance = axios$1.create(axiosConfig);
19
- instance.interceptors.request.use(
20
- (config) => {
21
- interceptorsRequestFn(config);
22
- addPendingRequest(config);
23
- return config;
24
- },
25
- (error) => {
26
- return Promise.reject(error);
27
- }
28
- );
29
- instance.interceptors.response.use(
30
- (response) => {
31
- interceptorsResponseFn(response);
32
- removePendingRequest(response.config);
33
- const data = response.data;
34
- console.log(data);
35
- if (data.code === 200) {
36
- return Promise.resolve({
37
- ...response,
38
- ...data,
39
- data: data.data
40
- });
41
- } else {
42
- ElMessage.error(data.msg || "\u8BF7\u6C42\u5931\u8D25");
43
- return Promise.reject(new Error(data.msg || "\u8BF7\u6C42\u5931\u8D25"));
44
- }
45
- },
46
- (error) => {
47
- console.log("\u8BF7\u6C42\u53D1\u751F\u9519\u8BEF>>>>>>>>>>>>>>>>>>\uFF1A", error);
48
- if (error.config) {
49
- removePendingRequest(error.config);
50
- }
51
- if (axios$1.isCancel(error)) {
52
- console.warn("\u8BF7\u6C42\u5DF2\u88AB\u53D6\u6D88:", error.message);
53
- return Promise.reject(new Error("\u8BF7\u6C42\u5DF2\u88AB\u53D6\u6D88"));
54
- }
55
- if (!window.navigator.onLine) {
56
- ElMessage.error("\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC");
57
- return Promise.reject(new Error("\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00"));
58
- }
59
- const { response } = error;
60
- if (response) {
61
- switch (response.status) {
62
- case 401:
63
- ElMessage.error("\u8EAB\u4EFD\u9A8C\u8BC1\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55");
64
- break;
65
- case 403:
66
- ElMessage.error("\u6CA1\u6709\u6743\u9650\u6267\u884C\u6B64\u64CD\u4F5C");
67
- break;
68
- case 404:
69
- ElMessage.error("\u8BF7\u6C42\u7684\u8D44\u6E90\u4E0D\u5B58\u5728");
70
- break;
71
- case 500:
72
- ElMessage.error("\u670D\u52A1\u5668\u5185\u90E8\u9519\u8BEF");
73
- break;
74
- default:
75
- ElMessage.error(`\u8BF7\u6C42\u9519\u8BEF: ${response.status}`);
76
- }
77
- } else {
78
- ElMessage.error("\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
79
- }
80
- return Promise.reject(error);
81
- }
82
- );
83
- return instance;
84
- };
85
- const pendingRequests = /* @__PURE__ */ new Map();
86
- const generateRequestKey = (config) => {
87
- const { method, url, params, data } = config;
88
- const paramsStr = params ? JSON.stringify(params) : "";
89
- const dataStr = data ? JSON.stringify(data) : "";
90
- return `${method}-${url}-${paramsStr}-${dataStr}`;
91
- };
92
- const addPendingRequest = (config) => {
93
- const requestKey = generateRequestKey(config);
94
- if (pendingRequests.has(requestKey)) {
95
- const cancelToken = pendingRequests.get(requestKey);
96
- cancelToken.cancel(`\u91CD\u590D\u8BF7\u6C42\u88AB\u53D6\u6D88: ${config.url}`);
97
- pendingRequests.delete(requestKey);
98
- }
99
- const source = axios$1.CancelToken.source();
100
- config.cancelToken = source.token;
101
- pendingRequests.set(requestKey, source);
102
- };
103
- const removePendingRequest = (config) => {
104
- const requestKey = generateRequestKey(config);
105
- if (pendingRequests.has(requestKey)) {
106
- pendingRequests.delete(requestKey);
107
- }
108
- };
109
-
110
- export { addPendingRequest, generateRequestKey, initRequestInstance, removePendingRequest };
@@ -1,274 +0,0 @@
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: any;
30
- };
31
- render: {
32
- type: FunctionConstructor;
33
- default: any;
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: () => any[];
63
- };
64
- search: {
65
- type: import('vue').PropType<import('../search/props').SearchModel>;
66
- };
67
- }>> & Readonly<{
68
- onReset?: (...args: any[]) => any;
69
- "onUpdate:search"?: (value: import('../search/props').SearchModel) => any;
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
- render: Function;
77
- url: string;
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: any;
122
- };
123
- render: {
124
- type: FunctionConstructor;
125
- default: any;
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: () => any[];
155
- };
156
- search: {
157
- type: import('vue').PropType<import('../search/props').SearchModel>;
158
- };
159
- }>> & Readonly<{
160
- onReset?: (...args: any[]) => any;
161
- "onUpdate:search"?: (value: import('../search/props').SearchModel) => any;
162
- }>, {
163
- handleSearch: (reset?: boolean) => Promise<void>;
164
- }, {}, {}, {}, {
165
- render: Function;
166
- url: string;
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: any;
208
- };
209
- render: {
210
- type: FunctionConstructor;
211
- default: any;
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: () => any[];
241
- };
242
- search: {
243
- type: import('vue').PropType<import('../search/props').SearchModel>;
244
- };
245
- }>> & Readonly<{
246
- onReset?: (...args: any[]) => any;
247
- "onUpdate:search"?: (value: import('../search/props').SearchModel) => any;
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
- render: Function;
255
- url: string;
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;