@oiij/naive-ui 0.0.64 → 0.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_/plugin-vue/export-helper.js +9 -0
- package/dist/components/_utils/cssr-bem.js +7 -0
- package/dist/components/_utils/prismjs.js +16 -0
- package/dist/components/bubble/Bubble.js +67 -0
- package/dist/components/bubble/Bubble.vue.d.ts +51 -46
- package/dist/components/bubble/bubble.cssr.js +23 -0
- package/dist/components/bubble/index.d.ts +19 -15
- package/dist/components/config-providers/ConfigProviders.js +78 -0
- package/dist/components/config-providers/ConfigProviders.vue.d.ts +37 -33
- package/dist/components/config-providers/index.d.ts +28 -24
- package/dist/components/copy-button/CopyButton.js +50 -0
- package/dist/components/copy-button/CopyButton.vue.d.ts +36 -30
- package/dist/components/copy-button/index.d.ts +13 -9
- package/dist/components/data-table-plus/DataTablePlus.js +374 -0
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +365 -351
- package/dist/components/data-table-plus/index.d.ts +54 -48
- package/dist/components/full-loading/FullLoading.js +70 -0
- package/dist/components/full-loading/FullLoading.vue.d.ts +36 -32
- package/dist/components/full-loading/full-loading.cssr.js +22 -0
- package/dist/components/full-loading/index.d.ts +16 -12
- package/dist/components/icons/MageArrowUp.js +29 -0
- package/dist/components/icons/MageCopyFill.js +21 -0
- package/dist/components/icons/MageMultiplyCircleFill.js +21 -0
- package/dist/components/icons/MageSearch.js +25 -0
- package/dist/components/index.d.ts +31 -15
- package/dist/components/preset-form/PresetForm.js +176 -0
- package/dist/components/preset-form/PresetForm.vue.d.ts +82 -72
- package/dist/components/preset-form/_utils.js +16 -0
- package/dist/components/preset-form/index.d.ts +34 -29
- package/dist/components/preset-input/PresetInput.js +87 -0
- package/dist/components/preset-input/PresetInput.vue.d.ts +20 -15
- package/dist/components/preset-input/index.d.ts +147 -145
- package/dist/components/preset-picker/PresetPicker.js +209 -0
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +62 -49
- package/dist/components/preset-picker/index.d.ts +55 -49
- package/dist/components/preset-select/PresetSelect.js +274 -0
- package/dist/components/preset-select/PresetSelect.vue.d.ts +190 -180
- package/dist/components/preset-select/index.d.ts +44 -38
- package/dist/components/remote-request/RemoteRequest.js +90 -0
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +55 -49
- package/dist/components/remote-request/index.d.ts +23 -17
- package/dist/components/search-input/SearchInput.js +85 -0
- package/dist/components/search-input/SearchInput.vue.d.ts +48 -2332
- package/dist/components/search-input/index.d.ts +16 -12
- package/dist/components/toggle-editor/ToggleEditor.js +44 -0
- package/dist/components/toggle-editor/ToggleEditor.vue.d.ts +18 -1157
- package/dist/components/toggle-editor/index.d.ts +1 -1
- package/dist/components/tooltip-button/TooltipButton.js +31 -0
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +33 -28
- package/dist/components/tooltip-button/index.d.ts +11 -7
- package/dist/components/transition/BaseTransition.js +30 -0
- package/dist/components/transition/BaseTransition.vue.d.ts +23 -21
- package/dist/components/transition/index.d.ts +10 -6
- package/dist/components/transition/transition.cssr.js +20 -0
- package/dist/components/type-writer/TypeWriter.js +72 -0
- package/dist/components/type-writer/TypeWriter.vue.d.ts +34 -29
- package/dist/components/type-writer/index.d.ts +12 -8
- package/dist/components/type-writer/type-writer.cssr.js +27 -0
- package/dist/components.d.ts +33 -1
- package/dist/components.js +18 -7893
- package/dist/composables/{index.d.mts → index.d.ts} +3 -3
- package/dist/composables/{useNaiveForm.d.mts → useNaiveForm.d.ts} +1 -1
- package/dist/composables/{useNaiveTheme.d.mts → useNaiveTheme.d.ts} +1 -1
- package/dist/composables/{useNaiveTheme.mjs → useNaiveTheme.js} +1 -1
- package/dist/{index.d.mts → index.d.ts} +4 -4
- package/dist/index.js +5 -0
- package/package.json +11 -10
- package/dist/components/_utils/cssr-bem.d.ts +0 -1
- package/dist/components/_utils/index.d.ts +0 -2
- package/dist/components/_utils/prismjs.d.ts +0 -1
- package/dist/components/bubble/bubble.cssr.d.ts +0 -2
- package/dist/components/full-loading/full-loading.cssr.d.ts +0 -2
- package/dist/components/icons/MageArrowUp.vue.d.ts +0 -2
- package/dist/components/icons/MageCopyFill.vue.d.ts +0 -2
- package/dist/components/icons/MageMultiplyCircleFill.vue.d.ts +0 -2
- package/dist/components/icons/MageSearch.vue.d.ts +0 -2
- package/dist/components/preset-form/_utils.d.ts +0 -8
- package/dist/components/transition/transition.cssr.d.ts +0 -13
- package/dist/components/type-writer/type-writer.cssr.d.ts +0 -2
- package/dist/index.mjs +0 -5
- /package/dist/composables/{_helper.d.mts → _helper.d.ts} +0 -0
- /package/dist/composables/{_helper.mjs → _helper.js} +0 -0
- /package/dist/composables/{useDataRequest.d.mts → useDataRequest.d.ts} +0 -0
- /package/dist/composables/{useDataRequest.mjs → useDataRequest.js} +0 -0
- /package/dist/composables/{useNaiveForm.mjs → useNaiveForm.js} +0 -0
|
@@ -1,181 +1,191 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
1
|
+
import { DataObject } from "../../composables/useDataRequest.js";
|
|
2
|
+
import { PresetSelectEmits, PresetSelectExpose, PresetSelectProps, PresetSelectValue } from "./index.js";
|
|
3
|
+
import * as _vueuse_core41 from "@vueuse/core";
|
|
4
|
+
import * as vue82 from "vue";
|
|
5
|
+
import { SelectInst, SelectOption } from "naive-ui";
|
|
6
|
+
|
|
7
|
+
//#region src/components/preset-select/PresetSelect.vue.d.ts
|
|
8
|
+
declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
|
+
props: __VLS_PrettifyLocal<PresetSelectProps<V, P, D, R> & {
|
|
10
|
+
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
12
|
+
onClear?: (() => any) | undefined;
|
|
13
|
+
onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
14
|
+
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
15
|
+
onScroll?: ((ev: Event) => any) | undefined;
|
|
16
|
+
"onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
17
|
+
onSearch?: ((value: string) => any) | undefined;
|
|
18
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
19
|
+
onBefore?: ((params: P[]) => any) | undefined;
|
|
20
|
+
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
21
|
+
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
22
|
+
onCreate?: ((label: string) => any) | undefined;
|
|
23
|
+
}> & vue82.PublicProps & (typeof globalThis extends {
|
|
24
|
+
__VLS_PROPS_FALLBACK: infer P_1;
|
|
25
|
+
} ? P_1 : {});
|
|
26
|
+
expose: (exposed: vue82.ShallowUnwrapRef<PresetSelectExpose<P, D, R>>) => void;
|
|
27
|
+
attrs: any;
|
|
28
|
+
slots: {
|
|
29
|
+
header?: (props: {
|
|
30
|
+
loading: boolean;
|
|
31
|
+
data: D | undefined;
|
|
32
|
+
error: Error | undefined;
|
|
33
|
+
params: [] | P[];
|
|
34
|
+
list: R[];
|
|
35
|
+
pagination: {
|
|
36
|
+
page: number;
|
|
37
|
+
pageSize: number;
|
|
38
|
+
itemCount: number;
|
|
39
|
+
} | {
|
|
40
|
+
page: number;
|
|
41
|
+
pageSize: number;
|
|
42
|
+
itemCount: number;
|
|
43
|
+
};
|
|
44
|
+
selectRef: SelectInst | null;
|
|
45
|
+
run: (...params: P[]) => void;
|
|
46
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
47
|
+
refresh: () => void;
|
|
48
|
+
refreshAsync: () => Promise<D>;
|
|
49
|
+
cancel: () => void;
|
|
50
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
51
|
+
setParams: (_params: Partial<P>) => void;
|
|
52
|
+
runParams: (_params: Partial<P>) => void;
|
|
53
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
54
|
+
onBefore: _vueuse_core41.EventHookOn<[P[]]>;
|
|
55
|
+
onSuccess: _vueuse_core41.EventHookOn<[D, P[]]>;
|
|
56
|
+
onError: _vueuse_core41.EventHookOn<[Error, P[]]>;
|
|
57
|
+
onFinally: _vueuse_core41.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
58
|
+
}) => any;
|
|
59
|
+
} & {
|
|
60
|
+
footer?: (props: {
|
|
61
|
+
loading: boolean;
|
|
62
|
+
data: D | undefined;
|
|
63
|
+
error: Error | undefined;
|
|
64
|
+
params: [] | P[];
|
|
65
|
+
list: R[];
|
|
66
|
+
pagination: {
|
|
67
|
+
page: number;
|
|
68
|
+
pageSize: number;
|
|
69
|
+
itemCount: number;
|
|
70
|
+
} | {
|
|
71
|
+
page: number;
|
|
72
|
+
pageSize: number;
|
|
73
|
+
itemCount: number;
|
|
74
|
+
};
|
|
75
|
+
selectRef: SelectInst | null;
|
|
76
|
+
run: (...params: P[]) => void;
|
|
77
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
78
|
+
refresh: () => void;
|
|
79
|
+
refreshAsync: () => Promise<D>;
|
|
80
|
+
cancel: () => void;
|
|
81
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
82
|
+
setParams: (_params: Partial<P>) => void;
|
|
83
|
+
runParams: (_params: Partial<P>) => void;
|
|
84
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
85
|
+
onBefore: _vueuse_core41.EventHookOn<[P[]]>;
|
|
86
|
+
onSuccess: _vueuse_core41.EventHookOn<[D, P[]]>;
|
|
87
|
+
onError: _vueuse_core41.EventHookOn<[Error, P[]]>;
|
|
88
|
+
onFinally: _vueuse_core41.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
89
|
+
}) => any;
|
|
90
|
+
} & {
|
|
91
|
+
'footer-extra'?: (props: {
|
|
92
|
+
loading: boolean;
|
|
93
|
+
data: D | undefined;
|
|
94
|
+
error: Error | undefined;
|
|
95
|
+
params: [] | P[];
|
|
96
|
+
list: R[];
|
|
97
|
+
pagination: {
|
|
98
|
+
page: number;
|
|
99
|
+
pageSize: number;
|
|
100
|
+
itemCount: number;
|
|
101
|
+
} | {
|
|
102
|
+
page: number;
|
|
103
|
+
pageSize: number;
|
|
104
|
+
itemCount: number;
|
|
105
|
+
};
|
|
106
|
+
selectRef: SelectInst | null;
|
|
107
|
+
run: (...params: P[]) => void;
|
|
108
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
109
|
+
refresh: () => void;
|
|
110
|
+
refreshAsync: () => Promise<D>;
|
|
111
|
+
cancel: () => void;
|
|
112
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
113
|
+
setParams: (_params: Partial<P>) => void;
|
|
114
|
+
runParams: (_params: Partial<P>) => void;
|
|
115
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
116
|
+
onBefore: _vueuse_core41.EventHookOn<[P[]]>;
|
|
117
|
+
onSuccess: _vueuse_core41.EventHookOn<[D, P[]]>;
|
|
118
|
+
onError: _vueuse_core41.EventHookOn<[Error, P[]]>;
|
|
119
|
+
onFinally: _vueuse_core41.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
120
|
+
}) => any;
|
|
121
|
+
} & {
|
|
122
|
+
empty?: (props: {
|
|
123
|
+
loading: boolean;
|
|
124
|
+
data: D | undefined;
|
|
125
|
+
error: Error | undefined;
|
|
126
|
+
params: [] | P[];
|
|
127
|
+
list: R[];
|
|
128
|
+
pagination: {
|
|
129
|
+
page: number;
|
|
130
|
+
pageSize: number;
|
|
131
|
+
itemCount: number;
|
|
132
|
+
} | {
|
|
133
|
+
page: number;
|
|
134
|
+
pageSize: number;
|
|
135
|
+
itemCount: number;
|
|
136
|
+
};
|
|
137
|
+
selectRef: SelectInst | null;
|
|
138
|
+
run: (...params: P[]) => void;
|
|
139
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
140
|
+
refresh: () => void;
|
|
141
|
+
refreshAsync: () => Promise<D>;
|
|
142
|
+
cancel: () => void;
|
|
143
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
144
|
+
setParams: (_params: Partial<P>) => void;
|
|
145
|
+
runParams: (_params: Partial<P>) => void;
|
|
146
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
147
|
+
onBefore: _vueuse_core41.EventHookOn<[P[]]>;
|
|
148
|
+
onSuccess: _vueuse_core41.EventHookOn<[D, P[]]>;
|
|
149
|
+
onError: _vueuse_core41.EventHookOn<[Error, P[]]>;
|
|
150
|
+
onFinally: _vueuse_core41.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
151
|
+
}) => any;
|
|
152
|
+
} & {
|
|
153
|
+
arrow?: (props: {
|
|
154
|
+
loading: boolean;
|
|
155
|
+
data: D | undefined;
|
|
156
|
+
error: Error | undefined;
|
|
157
|
+
params: [] | P[];
|
|
158
|
+
list: R[];
|
|
159
|
+
pagination: {
|
|
160
|
+
page: number;
|
|
161
|
+
pageSize: number;
|
|
162
|
+
itemCount: number;
|
|
163
|
+
} | {
|
|
164
|
+
page: number;
|
|
165
|
+
pageSize: number;
|
|
166
|
+
itemCount: number;
|
|
167
|
+
};
|
|
168
|
+
selectRef: SelectInst | null;
|
|
169
|
+
run: (...params: P[]) => void;
|
|
170
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
171
|
+
refresh: () => void;
|
|
172
|
+
refreshAsync: () => Promise<D>;
|
|
173
|
+
cancel: () => void;
|
|
174
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
175
|
+
setParams: (_params: Partial<P>) => void;
|
|
176
|
+
runParams: (_params: Partial<P>) => void;
|
|
177
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
178
|
+
onBefore: _vueuse_core41.EventHookOn<[P[]]>;
|
|
179
|
+
onSuccess: _vueuse_core41.EventHookOn<[D, P[]]>;
|
|
180
|
+
onError: _vueuse_core41.EventHookOn<[Error, P[]]>;
|
|
181
|
+
onFinally: _vueuse_core41.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
182
|
+
}) => any;
|
|
183
|
+
};
|
|
184
|
+
emit: PresetSelectEmits<V, P, D, R>;
|
|
185
|
+
}>) => vue82.VNode & {
|
|
186
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
177
187
|
};
|
|
178
|
-
|
|
179
|
-
type __VLS_PrettifyLocal<T> = {
|
|
180
|
-
|
|
181
|
-
|
|
188
|
+
declare const _default: typeof __VLS_export;
|
|
189
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
190
|
+
//#endregion
|
|
191
|
+
export { _default };
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/useDataRequest.js";
|
|
2
|
+
import { RemoteRequestEmits, RemoteRequestProps } from "../remote-request/index.js";
|
|
3
|
+
import { ClassStyle } from "../data-table-plus/index.js";
|
|
4
|
+
import { _default } from "./PresetSelect.vue.js";
|
|
5
|
+
import { ShallowRef } from "vue";
|
|
6
|
+
import { PaginationProps, SelectGroupOption, SelectInst, SelectOption, SelectProps } from "naive-ui";
|
|
7
|
+
import { ComponentExposed } from "vue-component-type-helpers";
|
|
8
|
+
|
|
9
|
+
//#region src/components/preset-select/index.d.ts
|
|
10
|
+
type ArrayAwareType<V, T> = V extends null ? null : (V extends any[] ? T[] : T) | null;
|
|
11
|
+
type OptionFormat<R extends DataObject = DataObject> = (row: R) => SelectOption | SelectGroupOption | false | undefined | null;
|
|
12
|
+
type PresetSelectValue = string | number | (string | number)[] | null;
|
|
13
|
+
type PresetSelectFields = DataRequestFields & {
|
|
14
|
+
label?: string;
|
|
15
|
+
value?: string;
|
|
16
|
+
rowKey?: string;
|
|
17
|
+
search?: string;
|
|
18
|
+
children?: string;
|
|
16
19
|
};
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
type PresetSelectExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R> & {
|
|
21
|
+
selectRef: Readonly<ShallowRef<SelectInst | null>>;
|
|
19
22
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
type PresetSelectProps<V extends PresetSelectValue, P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestProps<P, D> & {
|
|
24
|
+
value?: V;
|
|
25
|
+
fallbackLabel?: string | ((val: string | number) => SelectOption);
|
|
26
|
+
multiple?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
clearable?: boolean;
|
|
29
|
+
debounce?: boolean | number;
|
|
30
|
+
optionFormat?: OptionFormat<R>;
|
|
31
|
+
fields?: PresetSelectFields;
|
|
32
|
+
selectProps?: SelectProps & ClassStyle;
|
|
33
|
+
pagination?: Omit<PaginationProps, 'page' | 'pageSize'> & ClassStyle | boolean;
|
|
31
34
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
type PresetSelectEmits<V extends PresetSelectValue, P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestEmits<P, D> & {
|
|
36
|
+
(e: 'blur', ev: FocusEvent): void;
|
|
37
|
+
(e: 'clear'): void;
|
|
38
|
+
(e: 'create', label: string): SelectOption;
|
|
39
|
+
(e: 'focus', ev: FocusEvent): void;
|
|
40
|
+
(e: 'scroll', ev: Event): void;
|
|
41
|
+
(e: 'search', value: string): void;
|
|
42
|
+
(e: 'update:value', val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null): void;
|
|
43
|
+
(e: 'update:page', page: number): void;
|
|
44
|
+
(e: 'update:pageSize', pageSize: number): void;
|
|
42
45
|
};
|
|
46
|
+
type PresetSelectInst = ComponentExposed<typeof _default>;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ArrayAwareType, OptionFormat, PresetSelectEmits, PresetSelectExpose, PresetSelectFields, PresetSelectInst, PresetSelectProps, PresetSelectValue };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useDataRequest } from "../../composables/useDataRequest.js";
|
|
2
|
+
import { computed, defineComponent, guardReactiveProps, normalizeProps, renderSlot, toValue } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/remote-request/RemoteRequest.vue
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "RemoteRequest",
|
|
7
|
+
props: {
|
|
8
|
+
api: { type: Function },
|
|
9
|
+
defaultParams: {},
|
|
10
|
+
manual: { type: Boolean },
|
|
11
|
+
fields: {},
|
|
12
|
+
requestOptions: {},
|
|
13
|
+
requestPlugins: {}
|
|
14
|
+
},
|
|
15
|
+
emits: [
|
|
16
|
+
"before",
|
|
17
|
+
"success",
|
|
18
|
+
"error",
|
|
19
|
+
"finally"
|
|
20
|
+
],
|
|
21
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
const _fields = {
|
|
24
|
+
page: "page",
|
|
25
|
+
pageSize: "pageSize",
|
|
26
|
+
list: "list",
|
|
27
|
+
count: "count",
|
|
28
|
+
...__props.fields
|
|
29
|
+
};
|
|
30
|
+
const { loading, data, error, params, list, pagination, run, runAsync, refresh, refreshAsync, cancel, mutate, setParams, runParams, runParamsAsync, onBefore, onSuccess, onError, onFinally } = useDataRequest(__props.api, {
|
|
31
|
+
defaultParams: __props.defaultParams,
|
|
32
|
+
fields: _fields,
|
|
33
|
+
manual: __props.manual,
|
|
34
|
+
requestOptions: __props.requestOptions,
|
|
35
|
+
requestPlugins: __props.requestPlugins
|
|
36
|
+
});
|
|
37
|
+
onBefore((params$1) => {
|
|
38
|
+
emit("before", params$1);
|
|
39
|
+
});
|
|
40
|
+
onSuccess((data$1, params$1) => {
|
|
41
|
+
emit("success", data$1, params$1);
|
|
42
|
+
});
|
|
43
|
+
onError((err, params$1) => {
|
|
44
|
+
emit("error", err, params$1);
|
|
45
|
+
});
|
|
46
|
+
onFinally((params$1, data$1, err) => {
|
|
47
|
+
emit("finally", params$1, data$1, err);
|
|
48
|
+
});
|
|
49
|
+
const expose = {
|
|
50
|
+
loading,
|
|
51
|
+
data,
|
|
52
|
+
error,
|
|
53
|
+
params,
|
|
54
|
+
list,
|
|
55
|
+
pagination,
|
|
56
|
+
run,
|
|
57
|
+
runAsync,
|
|
58
|
+
refresh,
|
|
59
|
+
refreshAsync,
|
|
60
|
+
cancel,
|
|
61
|
+
mutate,
|
|
62
|
+
setParams,
|
|
63
|
+
runParams,
|
|
64
|
+
runParamsAsync,
|
|
65
|
+
onBefore,
|
|
66
|
+
onSuccess,
|
|
67
|
+
onError,
|
|
68
|
+
onFinally
|
|
69
|
+
};
|
|
70
|
+
const templateBind = computed(() => {
|
|
71
|
+
return {
|
|
72
|
+
...expose,
|
|
73
|
+
loading: toValue(loading),
|
|
74
|
+
data: toValue(data),
|
|
75
|
+
error: toValue(error),
|
|
76
|
+
params: toValue(params),
|
|
77
|
+
list: toValue(list),
|
|
78
|
+
pagination: toValue(pagination)
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
__expose(expose);
|
|
82
|
+
return (_ctx, _cache) => {
|
|
83
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(templateBind.value)));
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var RemoteRequest_default = _sfc_main;
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { RemoteRequest_default as default };
|