@oiij/naive-ui 0.0.54 → 0.0.56
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/preset-form/index.d.ts +5 -3
- package/dist/components/preset-input/index.d.ts +38 -37
- package/dist/components.cjs +8 -8
- package/dist/components.js +999 -987
- package/dist/components.umd.cjs +9 -9
- package/dist/composables/useDataRequest.d.cts +1 -1
- package/dist/composables/useDataRequest.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormItemProps, FormItemRule, FormProps, FormRules, GridItemProps, GridProps } from 'naive-ui';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
3
|
import { DataObject } from '../../composables/useDataRequest';
|
|
4
4
|
import { NaiveFormClearRules, NaiveFormReturns, NaiveFormRules } from '../../composables/useNaiveForm';
|
|
@@ -15,8 +15,10 @@ export type PresetFormOptionItem<V extends DataObject = DataObject> = PresetInpu
|
|
|
15
15
|
span?: string | number | (() => string | number);
|
|
16
16
|
hidden?: boolean | (() => boolean);
|
|
17
17
|
rule?: FormRules | FormItemRule | FormItemRule[];
|
|
18
|
-
itemProps?:
|
|
19
|
-
render?: (params: PresetFormExpose<V>
|
|
18
|
+
itemProps?: FormItemProps & GridItemProps & ClassStyle;
|
|
19
|
+
render?: (params: PresetFormExpose<V> & {
|
|
20
|
+
overflow: boolean;
|
|
21
|
+
}) => VNode | null;
|
|
20
22
|
};
|
|
21
23
|
export type PresetFormOptions<V extends DataObject = DataObject> = PresetFormOptionItem<V>[];
|
|
22
24
|
export type PresetFormProps<V extends DataObject = DataObject> = {
|
|
@@ -1,23 +1,24 @@
|
|
|
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
|
+
import { VNode, VNodeArrayChildren } from 'vue';
|
|
3
3
|
import { ClassStyle } from '../data-table-plus/index';
|
|
4
4
|
import { SearchInputProps } from '../search-input/index';
|
|
5
5
|
export { default as NPresetInput } from './PresetInput.vue';
|
|
6
|
+
type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
6
7
|
export type PresetInputType = {
|
|
7
8
|
'button': {
|
|
8
9
|
props?: ButtonProps & {
|
|
9
10
|
label?: string;
|
|
10
11
|
};
|
|
11
12
|
slots?: {
|
|
12
|
-
default?: () =>
|
|
13
|
-
icon?: () =>
|
|
13
|
+
default?: () => RawChildren;
|
|
14
|
+
icon?: () => RawChildren;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
'color-picker': {
|
|
17
18
|
props?: ColorPickerProps;
|
|
18
19
|
slots?: {
|
|
19
|
-
label?: (color: string | null) =>
|
|
20
|
-
action?: () =>
|
|
20
|
+
label?: (color: string | null) => RawChildren;
|
|
21
|
+
action?: () => RawChildren;
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
'checkbox': {
|
|
@@ -25,13 +26,13 @@ export type PresetInputType = {
|
|
|
25
26
|
options?: CheckboxProps[];
|
|
26
27
|
};
|
|
27
28
|
slots?: {
|
|
28
|
-
default?: () =>
|
|
29
|
+
default?: () => RawChildren;
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
'divider': {
|
|
32
33
|
props?: DividerProps;
|
|
33
34
|
slots?: {
|
|
34
|
-
default?: () =>
|
|
35
|
+
default?: () => RawChildren;
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
38
|
'date-picker': {
|
|
@@ -44,46 +45,46 @@ export type PresetInputType = {
|
|
|
44
45
|
input?: (info: {
|
|
45
46
|
submit: (value: any) => void;
|
|
46
47
|
deactivate: () => void;
|
|
47
|
-
}) =>
|
|
48
|
+
}) => RawChildren;
|
|
48
49
|
trigger?: (info: {
|
|
49
50
|
activate: () => void;
|
|
50
51
|
disabled: boolean;
|
|
51
|
-
}) =>
|
|
52
|
+
}) => RawChildren;
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
55
|
'input': {
|
|
55
56
|
props?: InputProps;
|
|
56
57
|
slots?: {
|
|
57
|
-
clearIcon?: () =>
|
|
58
|
+
clearIcon?: () => RawChildren;
|
|
58
59
|
count?: (props: {
|
|
59
60
|
value: string;
|
|
60
|
-
}) =>
|
|
61
|
-
passwordInvisibleIcon?: () =>
|
|
62
|
-
passwordVisibleIcon?: () =>
|
|
63
|
-
prefix?: () =>
|
|
64
|
-
separator?: () =>
|
|
65
|
-
suffix?: () =>
|
|
61
|
+
}) => RawChildren;
|
|
62
|
+
passwordInvisibleIcon?: () => RawChildren;
|
|
63
|
+
passwordVisibleIcon?: () => RawChildren;
|
|
64
|
+
prefix?: () => RawChildren;
|
|
65
|
+
separator?: () => RawChildren;
|
|
66
|
+
suffix?: () => RawChildren;
|
|
66
67
|
};
|
|
67
68
|
};
|
|
68
69
|
'input-number': {
|
|
69
70
|
props?: InputNumberProps;
|
|
70
71
|
slots?: {
|
|
71
|
-
addIcon?: () =>
|
|
72
|
-
minusIcon?: () =>
|
|
73
|
-
prefix?: () =>
|
|
74
|
-
suffix?: () =>
|
|
72
|
+
addIcon?: () => RawChildren;
|
|
73
|
+
minusIcon?: () => RawChildren;
|
|
74
|
+
prefix?: () => RawChildren;
|
|
75
|
+
suffix?: () => RawChildren;
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
'search': {
|
|
78
79
|
props?: SearchInputProps;
|
|
79
80
|
slots?: {
|
|
80
|
-
prefix?: () =>
|
|
81
|
-
prefixIcon?: () =>
|
|
81
|
+
prefix?: () => RawChildren;
|
|
82
|
+
prefixIcon?: () => RawChildren;
|
|
82
83
|
button?: (props: {
|
|
83
84
|
value: string;
|
|
84
85
|
loading: boolean;
|
|
85
|
-
}) =>
|
|
86
|
-
buttonIcon?: () =>
|
|
86
|
+
}) => RawChildren;
|
|
87
|
+
buttonIcon?: () => RawChildren;
|
|
87
88
|
};
|
|
88
89
|
};
|
|
89
90
|
'radio': {
|
|
@@ -91,7 +92,7 @@ export type PresetInputType = {
|
|
|
91
92
|
options?: RadioProps[];
|
|
92
93
|
};
|
|
93
94
|
slots?: {
|
|
94
|
-
default?: () =>
|
|
95
|
+
default?: () => RawChildren;
|
|
95
96
|
};
|
|
96
97
|
};
|
|
97
98
|
'rate': {
|
|
@@ -99,38 +100,38 @@ export type PresetInputType = {
|
|
|
99
100
|
slots?: {
|
|
100
101
|
default?: (info: {
|
|
101
102
|
index: number;
|
|
102
|
-
}) =>
|
|
103
|
+
}) => RawChildren;
|
|
103
104
|
};
|
|
104
105
|
};
|
|
105
106
|
'select': {
|
|
106
107
|
props?: SelectProps;
|
|
107
108
|
slots?: {
|
|
108
|
-
header?: () =>
|
|
109
|
-
action?: () =>
|
|
110
|
-
empty?: () =>
|
|
111
|
-
arrow?: () =>
|
|
109
|
+
header?: () => RawChildren;
|
|
110
|
+
action?: () => RawChildren;
|
|
111
|
+
empty?: () => RawChildren;
|
|
112
|
+
arrow?: () => RawChildren;
|
|
112
113
|
};
|
|
113
114
|
};
|
|
114
115
|
'slider': {
|
|
115
116
|
props?: SliderProps;
|
|
116
117
|
slots?: {
|
|
117
|
-
thumb?: () =>
|
|
118
|
+
thumb?: () => RawChildren;
|
|
118
119
|
};
|
|
119
120
|
};
|
|
120
121
|
'switch': {
|
|
121
122
|
props?: SwitchProps;
|
|
122
123
|
slots?: {
|
|
123
|
-
checked?: () =>
|
|
124
|
-
checkedIcon?: () =>
|
|
125
|
-
icon?: () =>
|
|
126
|
-
unchecked?: () =>
|
|
127
|
-
uncheckedIcon?: () =>
|
|
124
|
+
checked?: () => RawChildren;
|
|
125
|
+
checkedIcon?: () => RawChildren;
|
|
126
|
+
icon?: () => RawChildren;
|
|
127
|
+
unchecked?: () => RawChildren;
|
|
128
|
+
uncheckedIcon?: () => RawChildren;
|
|
128
129
|
};
|
|
129
130
|
};
|
|
130
131
|
'time-picker': {
|
|
131
132
|
props?: TimePickerProps;
|
|
132
133
|
slots?: {
|
|
133
|
-
icon?: () =>
|
|
134
|
+
icon?: () => RawChildren;
|
|
134
135
|
};
|
|
135
136
|
};
|
|
136
137
|
};
|