@oiij/naive-ui 0.0.50 → 0.0.51
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/components/data-table-plus/DataTablePlus.vue.d.ts +217 -28
- package/dist/components/data-table-plus/index.d.ts +14 -61
- package/dist/components/preset-form/PresetForm.vue.d.ts +48 -62
- package/dist/components/preset-form/_utils.d.ts +8 -2
- package/dist/components/preset-form/index.d.ts +14 -18
- package/dist/components/preset-input/index.d.ts +132 -22
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +21 -12
- package/dist/components/preset-picker/index.d.ts +4 -6
- package/dist/components/preset-select/PresetSelect.vue.d.ts +155 -22
- package/dist/components/preset-select/index.d.ts +12 -12
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +29 -36
- package/dist/components/remote-request/index.d.ts +5 -4
- package/dist/components.cjs +27 -27
- package/dist/components.js +2908 -3223
- package/dist/components.umd.cjs +27 -27
- package/dist/composables/useDataRequest.cjs +102 -0
- package/dist/composables/useDataRequest.d.cts +61 -0
- package/dist/composables/useDataRequest.d.ts +61 -0
- package/dist/composables/useDataRequest.js +101 -0
- package/dist/composables/useNaiveForm.cjs +6 -2
- package/dist/composables/useNaiveForm.d.cts +13 -11
- package/dist/composables/useNaiveForm.d.ts +13 -11
- package/dist/composables/useNaiveForm.js +6 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +4 -4
- package/dist/components/data-table-plus/FlexFilter.vue.d.ts +0 -24
- package/dist/components/data-table-plus/GridFilter.vue.d.ts +0 -24
- package/dist/components/preset-input/_utils.d.ts +0 -6
|
@@ -1,34 +1,144 @@
|
|
|
1
1
|
import { ButtonProps, CheckboxGroupProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, DynamicTagsProps, InputNumberProps, InputProps, RadioGroupProps, RadioProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerProps } from 'naive-ui';
|
|
2
|
+
import { VNode } from 'vue';
|
|
2
3
|
import { ClassStyle } from '../data-table-plus';
|
|
3
4
|
import { SearchInputProps } from '../search-input/index';
|
|
4
5
|
export { default as NPresetInput } from './PresetInput.vue';
|
|
5
6
|
export type PresetInputType = {
|
|
6
|
-
'button':
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
'button': {
|
|
8
|
+
props?: ButtonProps & {
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
slots?: {
|
|
12
|
+
default?: () => VNode;
|
|
13
|
+
icon?: () => VNode;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
'color-picker': {
|
|
17
|
+
props?: ColorPickerProps;
|
|
18
|
+
slots?: {
|
|
19
|
+
label?: (color: string | null) => VNode;
|
|
20
|
+
action?: () => VNode;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
'checkbox': {
|
|
24
|
+
props?: CheckboxGroupProps & {
|
|
25
|
+
options?: CheckboxProps[];
|
|
26
|
+
};
|
|
27
|
+
slots?: {
|
|
28
|
+
default?: () => VNode;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
'divider': {
|
|
32
|
+
props?: DividerProps;
|
|
33
|
+
slots?: {
|
|
34
|
+
default?: () => VNode;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
'date-picker': {
|
|
38
|
+
props?: DatePickerProps;
|
|
39
|
+
slots?: undefined;
|
|
40
|
+
};
|
|
41
|
+
'dynamic-tags': {
|
|
42
|
+
props?: DynamicTagsProps;
|
|
43
|
+
slots?: {
|
|
44
|
+
input?: (info: {
|
|
45
|
+
submit: (value: any) => void;
|
|
46
|
+
deactivate: () => void;
|
|
47
|
+
}) => VNode;
|
|
48
|
+
trigger?: (info: {
|
|
49
|
+
activate: () => void;
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
}) => VNode;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
'input': {
|
|
55
|
+
props?: InputProps;
|
|
56
|
+
slots?: {
|
|
57
|
+
clearIcon?: () => VNode;
|
|
58
|
+
count?: (props: {
|
|
59
|
+
value: string;
|
|
60
|
+
}) => VNode;
|
|
61
|
+
passwordInvisibleIcon?: () => VNode;
|
|
62
|
+
passwordVisibleIcon?: () => VNode;
|
|
63
|
+
prefix?: () => VNode;
|
|
64
|
+
separator?: () => VNode;
|
|
65
|
+
suffix?: () => VNode;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
'input-number': {
|
|
69
|
+
props?: InputNumberProps;
|
|
70
|
+
slots?: {
|
|
71
|
+
addIcon?: () => VNode;
|
|
72
|
+
minusIcon?: () => VNode;
|
|
73
|
+
prefix?: () => VNode;
|
|
74
|
+
suffix?: () => VNode;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
'search': {
|
|
78
|
+
props?: SearchInputProps;
|
|
79
|
+
slots?: {
|
|
80
|
+
prefix?: () => VNode;
|
|
81
|
+
prefixIcon?: () => VNode;
|
|
82
|
+
button?: (props: {
|
|
83
|
+
value: string;
|
|
84
|
+
loading: boolean;
|
|
85
|
+
}) => VNode;
|
|
86
|
+
buttonIcon?: () => VNode;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
'radio': {
|
|
90
|
+
props?: RadioGroupProps & {
|
|
91
|
+
options?: RadioProps[];
|
|
92
|
+
};
|
|
93
|
+
slots?: {
|
|
94
|
+
default?: () => VNode;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
'rate': {
|
|
98
|
+
props?: RateProps;
|
|
99
|
+
slots?: {
|
|
100
|
+
default?: (info: {
|
|
101
|
+
index: number;
|
|
102
|
+
}) => VNode;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
'select': {
|
|
106
|
+
props?: SelectProps;
|
|
107
|
+
slots?: {
|
|
108
|
+
header?: () => VNode;
|
|
109
|
+
action?: () => VNode;
|
|
110
|
+
empty?: () => VNode;
|
|
111
|
+
arrow?: () => VNode;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
'slider': {
|
|
115
|
+
props?: SliderProps;
|
|
116
|
+
slots?: {
|
|
117
|
+
thumb?: () => VNode;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
'switch': {
|
|
121
|
+
props?: SwitchProps;
|
|
122
|
+
slots?: {
|
|
123
|
+
checked?: () => VNode;
|
|
124
|
+
checkedIcon?: () => VNode;
|
|
125
|
+
icon?: () => VNode;
|
|
126
|
+
unchecked?: () => VNode;
|
|
127
|
+
uncheckedIcon?: () => VNode;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
'time-picker': {
|
|
131
|
+
props?: TimePickerProps;
|
|
132
|
+
slots?: {
|
|
133
|
+
icon?: () => VNode;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
27
136
|
};
|
|
28
137
|
export type PresetInputOptions = {
|
|
29
138
|
[K in keyof PresetInputType]: {
|
|
30
139
|
type?: K;
|
|
31
|
-
props?: PresetInputType[K] & ClassStyle;
|
|
140
|
+
props?: PresetInputType[K]['props'] & ClassStyle;
|
|
141
|
+
slots?: PresetInputType[K]['slots'];
|
|
32
142
|
};
|
|
33
143
|
}[keyof PresetInputType];
|
|
34
144
|
export type PresetInputProps<V> = {
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { DataTableColumns } from 'naive-ui';
|
|
2
|
+
import { DataObject } from '../../composables/index';
|
|
3
|
+
import { PresetPickerEmits, PresetPickerExpose, PresetPickerProps, PresetPickerValue } from './index';
|
|
4
|
+
declare const _default: <V extends PresetPickerValue, 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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
6
|
readonly onClose?: (() => any) | undefined;
|
|
6
7
|
readonly "onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
|
|
7
|
-
readonly onNegativeClick?: (() => any) | undefined;
|
|
8
|
-
readonly onPositiveClick?: (() => any) | undefined;
|
|
9
8
|
readonly onAfterEnter?: (() => any) | undefined;
|
|
10
9
|
readonly onAfterLeave?: (() => any) | undefined;
|
|
11
10
|
readonly onEsc?: (() => any) | undefined;
|
|
12
11
|
readonly onMaskClick?: (() => any) | undefined;
|
|
12
|
+
readonly onNegativeClick?: (() => any) | undefined;
|
|
13
|
+
readonly onPositiveClick?: (() => any) | undefined;
|
|
13
14
|
readonly "onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
14
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value" | "onUpdate:show" | "
|
|
15
|
-
expose(exposed: import('vue').ShallowUnwrapRef<
|
|
16
|
-
refs: PresetPickerExposeRefs<R>;
|
|
17
|
-
actions: PresetPickerExposeActions<R>;
|
|
18
|
-
}>): void;
|
|
15
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value" | "onUpdate:show" | "onAfterEnter" | "onAfterLeave" | "onClose" | "onEsc" | "onMaskClick" | "onNegativeClick" | "onPositiveClick"> & PresetPickerProps<V, R> & Partial<{}>> & import('vue').PublicProps;
|
|
16
|
+
expose(exposed: import('vue').ShallowUnwrapRef<PresetPickerExpose<R>>): void;
|
|
19
17
|
attrs: any;
|
|
20
18
|
slots: {
|
|
21
19
|
'button-icon'?(_: {}): any;
|
|
@@ -23,8 +21,19 @@ declare const _default: <V extends PresetPickerValue, R extends RObject>(__VLS_p
|
|
|
23
21
|
'clear-button'?(_: {}): any;
|
|
24
22
|
'clear-icon'?(_: {}): any;
|
|
25
23
|
default?(_: {
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
showModalFlag: boolean;
|
|
25
|
+
checkedRowKeys: (string | number)[];
|
|
26
|
+
checkedRows: R[];
|
|
27
|
+
columns: DataTableColumns<any>;
|
|
28
|
+
showModal: () => void;
|
|
29
|
+
updateCheckedRowKeysEffect: (keys: (string | number)[], rows: (R | undefined)[], meta: {
|
|
30
|
+
row: R | undefined;
|
|
31
|
+
action: "check" | "uncheck" | "checkAll" | "uncheckAll";
|
|
32
|
+
}, currentData: R[]) => void;
|
|
33
|
+
clickRowEffect: (row: R) => void;
|
|
34
|
+
clearValue: () => void;
|
|
35
|
+
setCheckedRowKeys: (keys: (string | number)[]) => void;
|
|
36
|
+
setCheckedRows: (rows: R[]) => void;
|
|
28
37
|
}): any;
|
|
29
38
|
'modal-action'?(_: {}): any;
|
|
30
39
|
'modal-header'?(_: {}): any;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { BadgeProps, ButtonProps, DataTableColumns, ModalProps } from 'naive-ui';
|
|
2
2
|
import { TableSelectionColumn } from 'naive-ui/es/data-table/src/interface';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
+
import { DataObject } from '../../composables/index';
|
|
4
5
|
import { ClassStyle } from '../data-table-plus';
|
|
5
|
-
import { RObject } from '../remote-request/index';
|
|
6
6
|
export { default as NPresetPicker } from './PresetPicker.vue';
|
|
7
7
|
export type PresetPickerValue = string | number | (string | number)[] | null;
|
|
8
|
-
export type
|
|
8
|
+
export type PresetPickerExpose<R extends DataObject = DataObject> = {
|
|
9
9
|
showModalFlag: Ref<boolean, boolean>;
|
|
10
10
|
checkedRowKeys: Ref<(string | number)[], (string | number)[]>;
|
|
11
11
|
checkedRows: Ref<R[], R[]>;
|
|
12
12
|
columns: DataTableColumns<any>;
|
|
13
|
-
};
|
|
14
|
-
export type PresetPickerExposeActions<R extends RObject = RObject> = {
|
|
15
13
|
showModal: () => void;
|
|
16
14
|
updateCheckedRowKeysEffect: (keys: (string | number)[], rows: (R | undefined)[], meta: {
|
|
17
15
|
row: R | undefined;
|
|
@@ -22,7 +20,7 @@ export type PresetPickerExposeActions<R extends RObject = RObject> = {
|
|
|
22
20
|
setCheckedRowKeys: (keys: (string | number)[]) => void;
|
|
23
21
|
setCheckedRows: (rows: R[]) => void;
|
|
24
22
|
};
|
|
25
|
-
export type PresetPickerProps<V extends PresetPickerValue, R extends
|
|
23
|
+
export type PresetPickerProps<V extends PresetPickerValue, R extends DataObject = DataObject> = {
|
|
26
24
|
value?: V;
|
|
27
25
|
fallbackLabel?: string | ((val: string | number) => string);
|
|
28
26
|
multiple?: boolean;
|
|
@@ -41,7 +39,7 @@ export type PresetPickerProps<V extends PresetPickerValue, R extends RObject = R
|
|
|
41
39
|
badgeProps?: BadgeProps & ClassStyle;
|
|
42
40
|
modalProps?: ModalProps & ClassStyle;
|
|
43
41
|
};
|
|
44
|
-
export type PresetPickerEmits<V extends PresetPickerValue, R extends
|
|
42
|
+
export type PresetPickerEmits<V extends PresetPickerValue, R extends DataObject = DataObject> = {
|
|
45
43
|
(e: 'update:value', val: V | null, raw: R | R[] | null): void;
|
|
46
44
|
(e: 'afterEnter'): void;
|
|
47
45
|
(e: 'afterLeave'): void;
|
|
@@ -1,42 +1,175 @@
|
|
|
1
|
-
import { SelectOption } from 'naive-ui';
|
|
2
|
-
import {
|
|
3
|
-
import { PresetSelectEmits,
|
|
4
|
-
declare const _default: <V extends PresetSelectValue, P extends
|
|
1
|
+
import { SelectInst, SelectOption } from 'naive-ui';
|
|
2
|
+
import { DataObject } from '../../composables/index';
|
|
3
|
+
import { PresetSelectEmits, PresetSelectExpose, PresetSelectProps, PresetSelectValue } from './index';
|
|
4
|
+
declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
|
-
readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
7
6
|
readonly onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
7
|
+
readonly onSearch?: ((value: string) => any) | undefined;
|
|
8
|
+
readonly onClear?: (() => any) | undefined;
|
|
9
|
+
readonly onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
10
|
+
readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
|
|
8
11
|
readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
9
12
|
readonly onScroll?: ((ev: Event) => any) | undefined;
|
|
10
|
-
readonly onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
|
-
readonly "onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
12
|
-
readonly onClear?: (() => any) | undefined;
|
|
13
|
-
readonly onSearch?: ((value: string) => any) | undefined;
|
|
14
13
|
readonly onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
15
14
|
readonly onBefore?: ((params: P[]) => any) | undefined;
|
|
15
|
+
readonly "onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
16
16
|
readonly "onUpdate:page"?: ((page: number) => any) | undefined;
|
|
17
17
|
readonly "onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
18
18
|
readonly onCreate?: ((label: string) => any) | undefined;
|
|
19
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "
|
|
20
|
-
expose(exposed: import('vue').ShallowUnwrapRef<
|
|
21
|
-
refs: PresetSelectExposeRefs<P, D, R>;
|
|
22
|
-
actions: PresetSelectExposeActions<P, D>;
|
|
23
|
-
}>): void;
|
|
19
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onBefore" | "onSuccess" | "onError" | "onFinally" | "onFocus" | "onBlur" | "onClear" | "onUpdate:value" | "onScroll" | "onUpdate:page" | "onUpdate:pageSize" | "onCreate" | "onSearch"> & PresetSelectProps<V, P, D, R> & Partial<{}>> & import('vue').PublicProps;
|
|
20
|
+
expose(exposed: import('vue').ShallowUnwrapRef<PresetSelectExpose<P, D, R>>): void;
|
|
24
21
|
attrs: any;
|
|
25
22
|
slots: {
|
|
26
23
|
header?(_: {
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
loading: boolean;
|
|
25
|
+
data: D | undefined;
|
|
26
|
+
error: Error | undefined;
|
|
27
|
+
params: [] | P[];
|
|
28
|
+
list: R[];
|
|
29
|
+
pagination: {
|
|
30
|
+
page: number;
|
|
31
|
+
pageSize: number;
|
|
32
|
+
itemCount: number;
|
|
33
|
+
} | {
|
|
34
|
+
page: number;
|
|
35
|
+
pageSize: number;
|
|
36
|
+
itemCount: number;
|
|
37
|
+
};
|
|
38
|
+
selectRef: SelectInst | null;
|
|
39
|
+
run: (...params: P[]) => void;
|
|
40
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
41
|
+
refresh: () => void;
|
|
42
|
+
refreshAsync: () => Promise<D>;
|
|
43
|
+
cancel: () => void;
|
|
44
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
45
|
+
setParams: (_params: Partial<P>) => void;
|
|
46
|
+
runParams: (_params: Partial<P>) => void;
|
|
47
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
48
|
+
onBefore: import('@vueuse/core').EventHookOn<[P[]]>;
|
|
49
|
+
onSuccess: import('@vueuse/core').EventHookOn<[D, P[]]>;
|
|
50
|
+
onError: import('@vueuse/core').EventHookOn<[Error, P[]]>;
|
|
51
|
+
onFinally: import('@vueuse/core').EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
29
52
|
}): any;
|
|
30
53
|
footer?(_: {
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
loading: boolean;
|
|
55
|
+
data: D | undefined;
|
|
56
|
+
error: Error | undefined;
|
|
57
|
+
params: [] | P[];
|
|
58
|
+
list: R[];
|
|
59
|
+
pagination: {
|
|
60
|
+
page: number;
|
|
61
|
+
pageSize: number;
|
|
62
|
+
itemCount: number;
|
|
63
|
+
} | {
|
|
64
|
+
page: number;
|
|
65
|
+
pageSize: number;
|
|
66
|
+
itemCount: number;
|
|
67
|
+
};
|
|
68
|
+
selectRef: SelectInst | null;
|
|
69
|
+
run: (...params: P[]) => void;
|
|
70
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
71
|
+
refresh: () => void;
|
|
72
|
+
refreshAsync: () => Promise<D>;
|
|
73
|
+
cancel: () => void;
|
|
74
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
75
|
+
setParams: (_params: Partial<P>) => void;
|
|
76
|
+
runParams: (_params: Partial<P>) => void;
|
|
77
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
78
|
+
onBefore: import('@vueuse/core').EventHookOn<[P[]]>;
|
|
79
|
+
onSuccess: import('@vueuse/core').EventHookOn<[D, P[]]>;
|
|
80
|
+
onError: import('@vueuse/core').EventHookOn<[Error, P[]]>;
|
|
81
|
+
onFinally: import('@vueuse/core').EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
33
82
|
}): any;
|
|
34
83
|
'footer-extra'?(_: {
|
|
35
|
-
|
|
36
|
-
|
|
84
|
+
loading: boolean;
|
|
85
|
+
data: D | undefined;
|
|
86
|
+
error: Error | undefined;
|
|
87
|
+
params: [] | P[];
|
|
88
|
+
list: R[];
|
|
89
|
+
pagination: {
|
|
90
|
+
page: number;
|
|
91
|
+
pageSize: number;
|
|
92
|
+
itemCount: number;
|
|
93
|
+
} | {
|
|
94
|
+
page: number;
|
|
95
|
+
pageSize: number;
|
|
96
|
+
itemCount: number;
|
|
97
|
+
};
|
|
98
|
+
selectRef: SelectInst | null;
|
|
99
|
+
run: (...params: P[]) => void;
|
|
100
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
101
|
+
refresh: () => void;
|
|
102
|
+
refreshAsync: () => Promise<D>;
|
|
103
|
+
cancel: () => void;
|
|
104
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
105
|
+
setParams: (_params: Partial<P>) => void;
|
|
106
|
+
runParams: (_params: Partial<P>) => void;
|
|
107
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
108
|
+
onBefore: import('@vueuse/core').EventHookOn<[P[]]>;
|
|
109
|
+
onSuccess: import('@vueuse/core').EventHookOn<[D, P[]]>;
|
|
110
|
+
onError: import('@vueuse/core').EventHookOn<[Error, P[]]>;
|
|
111
|
+
onFinally: import('@vueuse/core').EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
112
|
+
}): any;
|
|
113
|
+
empty?(_: {
|
|
114
|
+
loading: boolean;
|
|
115
|
+
data: D | undefined;
|
|
116
|
+
error: Error | undefined;
|
|
117
|
+
params: [] | P[];
|
|
118
|
+
list: R[];
|
|
119
|
+
pagination: {
|
|
120
|
+
page: number;
|
|
121
|
+
pageSize: number;
|
|
122
|
+
itemCount: number;
|
|
123
|
+
} | {
|
|
124
|
+
page: number;
|
|
125
|
+
pageSize: number;
|
|
126
|
+
itemCount: number;
|
|
127
|
+
};
|
|
128
|
+
selectRef: SelectInst | null;
|
|
129
|
+
run: (...params: P[]) => void;
|
|
130
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
131
|
+
refresh: () => void;
|
|
132
|
+
refreshAsync: () => Promise<D>;
|
|
133
|
+
cancel: () => void;
|
|
134
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
135
|
+
setParams: (_params: Partial<P>) => void;
|
|
136
|
+
runParams: (_params: Partial<P>) => void;
|
|
137
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
138
|
+
onBefore: import('@vueuse/core').EventHookOn<[P[]]>;
|
|
139
|
+
onSuccess: import('@vueuse/core').EventHookOn<[D, P[]]>;
|
|
140
|
+
onError: import('@vueuse/core').EventHookOn<[Error, P[]]>;
|
|
141
|
+
onFinally: import('@vueuse/core').EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
142
|
+
}): any;
|
|
143
|
+
arrow?(_: {
|
|
144
|
+
loading: boolean;
|
|
145
|
+
data: D | undefined;
|
|
146
|
+
error: Error | undefined;
|
|
147
|
+
params: [] | P[];
|
|
148
|
+
list: R[];
|
|
149
|
+
pagination: {
|
|
150
|
+
page: number;
|
|
151
|
+
pageSize: number;
|
|
152
|
+
itemCount: number;
|
|
153
|
+
} | {
|
|
154
|
+
page: number;
|
|
155
|
+
pageSize: number;
|
|
156
|
+
itemCount: number;
|
|
157
|
+
};
|
|
158
|
+
selectRef: SelectInst | null;
|
|
159
|
+
run: (...params: P[]) => void;
|
|
160
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
161
|
+
refresh: () => void;
|
|
162
|
+
refreshAsync: () => Promise<D>;
|
|
163
|
+
cancel: () => void;
|
|
164
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
165
|
+
setParams: (_params: Partial<P>) => void;
|
|
166
|
+
runParams: (_params: Partial<P>) => void;
|
|
167
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
168
|
+
onBefore: import('@vueuse/core').EventHookOn<[P[]]>;
|
|
169
|
+
onSuccess: import('@vueuse/core').EventHookOn<[D, P[]]>;
|
|
170
|
+
onError: import('@vueuse/core').EventHookOn<[Error, P[]]>;
|
|
171
|
+
onFinally: import('@vueuse/core').EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
37
172
|
}): any;
|
|
38
|
-
empty?(_: {}): any;
|
|
39
|
-
arrow?(_: {}): any;
|
|
40
173
|
};
|
|
41
174
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
42
175
|
}>) => import('vue').VNode & {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { PaginationProps, SelectGroupOption, SelectInst, SelectOption, SelectProps } from 'naive-ui';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from '../../composables/index';
|
|
3
4
|
import { ClassStyle } from '../data-table-plus';
|
|
4
|
-
import {
|
|
5
|
-
import { RemoteRequestEmits, RemoteRequestProps, RObject } from '../remote-request/index';
|
|
5
|
+
import { RemoteRequestEmits, RemoteRequestProps } from '../remote-request/index';
|
|
6
6
|
export { default as NPresetSelect } from './PresetSelect.vue';
|
|
7
7
|
export type ArrayAwareType<V, T> = V extends null ? null : (V extends any[] ? T[] : T) | null;
|
|
8
|
-
export type OptionFormat<R extends
|
|
8
|
+
export type OptionFormat<R extends DataObject = DataObject> = (row: R) => SelectOption | SelectGroupOption | false | undefined | null;
|
|
9
9
|
export type PresetSelectValue = string | number | (string | number)[] | null;
|
|
10
|
-
export type PresetSelectFields =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export type PresetSelectFields = DataRequestFields & {
|
|
11
|
+
label?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
rowKey?: string;
|
|
14
|
+
search?: string;
|
|
15
|
+
children?: string;
|
|
15
16
|
};
|
|
16
|
-
export type
|
|
17
|
+
export type PresetSelectExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R> & {
|
|
17
18
|
selectRef: Readonly<ShallowRef<SelectInst | null>>;
|
|
18
19
|
};
|
|
19
|
-
export type
|
|
20
|
-
export type PresetSelectProps<V extends PresetSelectValue, P extends RObject = RObject, D extends RObject = RObject, R extends RObject = RObject> = RemoteRequestProps<P, D> & {
|
|
20
|
+
export type PresetSelectProps<V extends PresetSelectValue, P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestProps<P, D> & {
|
|
21
21
|
value?: V;
|
|
22
22
|
fallbackLabel?: string | ((val: string | number) => SelectOption);
|
|
23
23
|
multiple?: boolean;
|
|
@@ -29,7 +29,7 @@ export type PresetSelectProps<V extends PresetSelectValue, P extends RObject = R
|
|
|
29
29
|
selectProps?: SelectProps & ClassStyle;
|
|
30
30
|
pagination?: Omit<PaginationProps, 'page' | 'pageSize'> & ClassStyle | boolean;
|
|
31
31
|
};
|
|
32
|
-
export type PresetSelectEmits<V extends PresetSelectValue, P extends
|
|
32
|
+
export type PresetSelectEmits<V extends PresetSelectValue, P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestEmits<P, D> & {
|
|
33
33
|
(e: 'blur', ev: FocusEvent): void;
|
|
34
34
|
(e: 'clear'): void;
|
|
35
35
|
(e: 'create', label: string): SelectOption;
|
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DataObject } from '../../composables/index';
|
|
2
|
+
import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestProps } from './index';
|
|
3
|
+
declare const _default: <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_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
5
|
readonly onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
5
6
|
readonly onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
6
7
|
readonly onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
7
8
|
readonly onBefore?: ((params: P[]) => any) | undefined;
|
|
8
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "
|
|
9
|
-
expose(exposed: import('vue').ShallowUnwrapRef<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onBefore" | "onSuccess" | "onError" | "onFinally"> & RemoteRequestProps<P, D> & Partial<{}>> & import('vue').PublicProps;
|
|
10
|
+
expose(exposed: import('vue').ShallowUnwrapRef<RemoteRequestExpose<P, D, R>>): void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: {
|
|
13
|
+
default?(_: {
|
|
14
|
+
loading: boolean;
|
|
15
|
+
data: D | undefined;
|
|
16
|
+
error: Error | undefined;
|
|
17
|
+
params: [] | P[];
|
|
18
|
+
list: R[];
|
|
19
|
+
pagination: {
|
|
20
|
+
page: number;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
itemCount: number;
|
|
23
|
+
} | {
|
|
24
|
+
page: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
itemCount: number;
|
|
27
|
+
};
|
|
17
28
|
run: (...params: P[]) => void;
|
|
18
29
|
runAsync: (...params: P[]) => Promise<D>;
|
|
19
30
|
refresh: () => void;
|
|
20
31
|
refreshAsync: () => Promise<D>;
|
|
21
32
|
cancel: () => void;
|
|
22
33
|
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
default?(_: {
|
|
31
|
-
refs: {
|
|
32
|
-
loading: Readonly<import('vue').Ref<boolean, boolean>>;
|
|
33
|
-
data: Readonly<import('vue').Ref<D | undefined, D | undefined>>;
|
|
34
|
-
error: Readonly<import('vue').Ref<Error | undefined, Error | undefined>>;
|
|
35
|
-
params: Readonly<import('vue').Ref<[] | P[], [] | P[]>>;
|
|
36
|
-
};
|
|
37
|
-
actions: {
|
|
38
|
-
run: (...params: P[]) => void;
|
|
39
|
-
runAsync: (...params: P[]) => Promise<D>;
|
|
40
|
-
refresh: () => void;
|
|
41
|
-
refreshAsync: () => Promise<D>;
|
|
42
|
-
cancel: () => void;
|
|
43
|
-
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
44
|
-
setParam: (_params: Partial<P>) => void;
|
|
45
|
-
runParam: (_params: Partial<P>) => void;
|
|
46
|
-
runParamAsync: (_params: Partial<P>) => Promise<D>;
|
|
47
|
-
};
|
|
34
|
+
setParams: (_params: Partial<P>) => void;
|
|
35
|
+
runParams: (_params: Partial<P>) => void;
|
|
36
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
37
|
+
onBefore: import('@vueuse/core').EventHookOn<[P[]]>;
|
|
38
|
+
onSuccess: import('@vueuse/core').EventHookOn<[D, P[]]>;
|
|
39
|
+
onError: import('@vueuse/core').EventHookOn<[Error, P[]]>;
|
|
40
|
+
onFinally: import('@vueuse/core').EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
48
41
|
}): any;
|
|
49
42
|
};
|
|
50
43
|
emit: RemoteRequestEmits<P, D>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UseRequestOptions, UseRequestPlugin } from 'vue-hooks-plus/es/useRequest/types';
|
|
2
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from '../../composables/index';
|
|
2
3
|
export { default as NRemoteRequest } from './RemoteRequest.vue';
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type RemoteRequestProps<P extends
|
|
4
|
+
export type RemoteRequestFields = DataRequestFields & {};
|
|
5
|
+
export type RemoteRequestExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R>;
|
|
6
|
+
export type RemoteRequestProps<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
6
7
|
api: (...args: P[]) => Promise<D>;
|
|
7
8
|
defaultParams?: Partial<P>;
|
|
8
9
|
manual?: boolean;
|
|
@@ -10,7 +11,7 @@ export type RemoteRequestProps<P extends RObject = RObject, D extends RObject =
|
|
|
10
11
|
requestOptions?: UseRequestOptions<D, P[]>;
|
|
11
12
|
requestPlugins?: UseRequestPlugin<D, P[]>[];
|
|
12
13
|
};
|
|
13
|
-
export type RemoteRequestEmits<P extends
|
|
14
|
+
export type RemoteRequestEmits<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
14
15
|
(e: 'before', params: P[]): void;
|
|
15
16
|
(e: 'success', data: D, params: P[]): void;
|
|
16
17
|
(e: 'error', err: Error, params: P[]): void;
|