@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.
@@ -1,4 +1,4 @@
1
- import { FormItemGiProps, FormItemRule, FormProps, FormRules, GridProps } from 'naive-ui';
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?: FormItemGiProps & ClassStyle;
19
- render?: (params: PresetFormExpose<V>) => VNode | null;
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?: () => VNode;
13
- icon?: () => VNode;
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) => VNode;
20
- action?: () => VNode;
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?: () => VNode;
29
+ default?: () => RawChildren;
29
30
  };
30
31
  };
31
32
  'divider': {
32
33
  props?: DividerProps;
33
34
  slots?: {
34
- default?: () => VNode;
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
- }) => VNode;
48
+ }) => RawChildren;
48
49
  trigger?: (info: {
49
50
  activate: () => void;
50
51
  disabled: boolean;
51
- }) => VNode;
52
+ }) => RawChildren;
52
53
  };
53
54
  };
54
55
  'input': {
55
56
  props?: InputProps;
56
57
  slots?: {
57
- clearIcon?: () => VNode;
58
+ clearIcon?: () => RawChildren;
58
59
  count?: (props: {
59
60
  value: string;
60
- }) => VNode;
61
- passwordInvisibleIcon?: () => VNode;
62
- passwordVisibleIcon?: () => VNode;
63
- prefix?: () => VNode;
64
- separator?: () => VNode;
65
- suffix?: () => VNode;
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?: () => VNode;
72
- minusIcon?: () => VNode;
73
- prefix?: () => VNode;
74
- suffix?: () => VNode;
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?: () => VNode;
81
- prefixIcon?: () => VNode;
81
+ prefix?: () => RawChildren;
82
+ prefixIcon?: () => RawChildren;
82
83
  button?: (props: {
83
84
  value: string;
84
85
  loading: boolean;
85
- }) => VNode;
86
- buttonIcon?: () => VNode;
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?: () => VNode;
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
- }) => VNode;
103
+ }) => RawChildren;
103
104
  };
104
105
  };
105
106
  'select': {
106
107
  props?: SelectProps;
107
108
  slots?: {
108
- header?: () => VNode;
109
- action?: () => VNode;
110
- empty?: () => VNode;
111
- arrow?: () => VNode;
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?: () => VNode;
118
+ thumb?: () => RawChildren;
118
119
  };
119
120
  };
120
121
  'switch': {
121
122
  props?: SwitchProps;
122
123
  slots?: {
123
- checked?: () => VNode;
124
- checkedIcon?: () => VNode;
125
- icon?: () => VNode;
126
- unchecked?: () => VNode;
127
- uncheckedIcon?: () => VNode;
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?: () => VNode;
134
+ icon?: () => RawChildren;
134
135
  };
135
136
  };
136
137
  };