x-next 0.0.0-alpha.52 → 0.0.0-alpha.54

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 (54) hide show
  1. package/README.md +39 -28
  2. package/dist/_hooks/use-cursor.d.ts +2 -0
  3. package/dist/_hooks/use-form-item.d.ts +16 -0
  4. package/dist/_utils/get-value-by-path.d.ts +5 -0
  5. package/dist/_utils/keycode.d.ts +36 -0
  6. package/dist/_utils/pick.d.ts +1 -0
  7. package/dist/_utils/responsive-observe.d.ts +24 -0
  8. package/dist/components/form/Form.vue.d.ts +313 -0
  9. package/dist/components/form/FormItem.vue.d.ts +2218 -0
  10. package/dist/components/form/context.d.ts +49 -0
  11. package/dist/components/form/form-item-label.vue.d.ts +1435 -0
  12. package/dist/components/form/form-item-message.vue.d.ts +24 -0
  13. package/dist/components/form/index.d.ts +4189 -0
  14. package/dist/components/form/interface.d.ts +185 -0
  15. package/dist/components/form/utils.d.ts +9 -0
  16. package/dist/components/form/validateMessages.d.ts +46 -0
  17. package/dist/components/grid/Col.vue.d.ts +188 -0
  18. package/dist/components/grid/Grid.vue.d.ts +108 -0
  19. package/dist/components/grid/GridItem.vue.d.ts +78 -0
  20. package/dist/components/grid/Row.vue.d.ts +102 -0
  21. package/dist/components/grid/context.d.ts +19 -0
  22. package/dist/components/grid/hook/use-responsive-state.d.ts +3 -0
  23. package/dist/components/grid/hook/use-responsive-value.d.ts +24 -0
  24. package/dist/components/grid/index.d.ts +562 -0
  25. package/dist/components/grid/interface.d.ts +80 -0
  26. package/dist/components/grid/utils/index.d.ts +11 -0
  27. package/dist/components/index.d.ts +4 -0
  28. package/dist/components/input/Input.d.ts +233 -161
  29. package/dist/components/input/InputGroup.vue.d.ts +9 -0
  30. package/dist/components/input/InputPassword.vue.d.ts +337 -0
  31. package/dist/components/input/InputSearch.d.ts +123 -0
  32. package/dist/components/input/index.d.ts +927 -270
  33. package/dist/components/network/Network.vue.d.ts +54 -0
  34. package/dist/components/network/index.d.ts +97 -0
  35. package/dist/components/network/props.d.ts +4 -0
  36. package/dist/components/network/utils.d.ts +25 -0
  37. package/dist/icons/_self/eye-invisible.d.ts +50 -0
  38. package/dist/icons/_self/eye.d.ts +50 -0
  39. package/dist/icons/_self/question-message.d.ts +50 -0
  40. package/dist/icons/_self/search.d.ts +50 -0
  41. package/dist/index.es.js +6123 -3249
  42. package/dist/index.umd.js +1 -1
  43. package/dist/serviceability/network.d.ts +9 -0
  44. package/dist/style.css +1 -1
  45. package/dist/types.d.ts +11 -0
  46. package/package.json +4 -2
  47. package/volar.d.ts +11 -0
  48. package/dist/components/form/constants.d.ts +0 -4
  49. package/dist/components/form/form-item.d.ts +0 -31
  50. package/dist/components/form/form.d.ts +0 -39
  51. package/dist/components/form/hooks.d.ts +0 -4
  52. package/dist/components/form/types.d.ts +0 -31
  53. package/dist/components/input/props.d.ts +0 -95
  54. package/dist/components/input/utils.d.ts +0 -6
@@ -1,220 +1,292 @@
1
+ import { PropType } from 'vue';
2
+ import { Size } from '../../_utils/constant';
1
3
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- autocomplete: {
3
- type: import('vue').PropType<"off" | "on">;
4
- default: string;
5
- };
6
- name: {
4
+ /**
5
+ * @zh 绑定值
6
+ * @en Value
7
+ */
8
+ modelValue: StringConstructor;
9
+ /**
10
+ * @zh 默认值(非受控状态)
11
+ * @en Default value (uncontrolled state)
12
+ */
13
+ defaultValue: {
7
14
  type: StringConstructor;
8
15
  default: string;
9
16
  };
10
- readonly: {
11
- type: BooleanConstructor;
12
- default: boolean;
17
+ /**
18
+ * @zh 输入框大小
19
+ * @en Input size
20
+ * @values 'mini','small','medium','large'
21
+ * @defaultValue 'medium'
22
+ */
23
+ size: {
24
+ type: PropType<Size>;
13
25
  };
14
- autofocus: {
26
+ /**
27
+ * @zh 是否允许清空输入框
28
+ * @en Whether to allow the input to be cleared
29
+ */
30
+ allowClear: {
15
31
  type: BooleanConstructor;
16
32
  default: boolean;
17
33
  };
18
- form: {
19
- type: StringConstructor;
20
- default: undefined;
21
- };
22
- modelValue: {
23
- type: (NumberConstructor | StringConstructor)[];
24
- default: undefined;
25
- };
26
- type: {
27
- type: import('vue').PropType<"text" | "textarea">;
28
- default: string;
29
- };
30
- placeholder: {
31
- type: StringConstructor;
32
- default: string;
33
- };
34
+ /**
35
+ * @zh 是否禁用
36
+ * @en Whether to disable
37
+ */
34
38
  disabled: {
35
39
  type: BooleanConstructor;
36
40
  default: boolean;
37
41
  };
38
- size: {
39
- type: import('vue').PropType<"small" | "large" | "default">;
40
- default: string;
41
- };
42
- showPassword: {
42
+ /**
43
+ * @zh 是否为只读状态
44
+ * @en Whether it is read-only
45
+ */
46
+ readonly: {
43
47
  type: BooleanConstructor;
44
48
  default: boolean;
45
49
  };
46
- resize: {
50
+ /**
51
+ * @zh 是否为错误状态
52
+ * @en Whether it is an error state
53
+ */
54
+ error: {
47
55
  type: BooleanConstructor;
48
56
  default: boolean;
49
57
  };
50
- prefixIcon: {
51
- type: StringConstructor;
52
- default: string;
53
- };
54
- suffixIcon: {
55
- type: StringConstructor;
56
- default: string;
57
- };
58
- autosize: {
59
- type: import('vue').PropType<boolean | {
60
- minRows: number;
61
- maxRows: number;
58
+ /**
59
+ * @zh 提示文字
60
+ * @en Prompt text
61
+ */
62
+ placeholder: StringConstructor;
63
+ /**
64
+ * @zh 输入值的最大长度,errorOnly 属性在 2.12.0 版本添加
65
+ * @en Enter the maximum length of the value, the errorOnly attribute was added in version 2.12.0
66
+ */
67
+ maxLength: {
68
+ type: PropType<number | {
69
+ length: number;
70
+ errorOnly?: boolean;
62
71
  }>;
63
- default: boolean;
64
- };
65
- formatter: {
66
- type: FunctionConstructor;
67
- default: undefined;
68
- };
69
- validateEvent: {
70
- type: BooleanConstructor;
71
- default: boolean;
72
- };
73
- clearable: {
74
- type: BooleanConstructor;
75
- default: boolean;
76
- };
77
- card: {
78
- type: BooleanConstructor;
79
- default: boolean;
80
- };
81
- maxlength: {
82
- type: (NumberConstructor | StringConstructor)[];
83
- default: undefined;
72
+ default: number;
84
73
  };
74
+ /**
75
+ * @zh 是否显示字数统计
76
+ * @en Whether to display word count
77
+ */
85
78
  showWordLimit: {
86
79
  type: BooleanConstructor;
87
80
  default: boolean;
88
81
  };
89
- valueType: {
90
- type: import('vue').PropType<"string" | "number">;
91
- default: string;
92
- };
93
- }>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "clear" | "focus" | "blur" | "change" | "update:modelValue" | "pressEnter")[], "input" | "clear" | "focus" | "blur" | "change" | "update:modelValue" | "pressEnter", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
94
- autocomplete: {
95
- type: import('vue').PropType<"off" | "on">;
96
- default: string;
97
- };
98
- name: {
99
- type: StringConstructor;
100
- default: string;
101
- };
102
- readonly: {
103
- type: BooleanConstructor;
104
- default: boolean;
105
- };
106
- autofocus: {
107
- type: BooleanConstructor;
108
- default: boolean;
109
- };
110
- form: {
111
- type: StringConstructor;
112
- default: undefined;
113
- };
114
- modelValue: {
115
- type: (NumberConstructor | StringConstructor)[];
116
- default: undefined;
82
+ /**
83
+ * @zh 字符长度的计算方法
84
+ * @en Calculation method of word length
85
+ */
86
+ wordLength: {
87
+ type: PropType<(value: string) => number>;
88
+ };
89
+ /**
90
+ * @zh 字符截取方法,同 wordLength 一起使用
91
+ * @en Character interception method, used together with wordLength
92
+ * @version 2.12.0
93
+ */
94
+ wordSlice: {
95
+ type: PropType<(value: string, maxLength: number) => string>;
96
+ };
97
+ /**
98
+ * @zh 内部 input 元素的属性
99
+ * @en Attributes of inner input elements
100
+ * @version 2.27.0
101
+ */
102
+ inputAttrs: {
103
+ type: ObjectConstructor;
117
104
  };
118
105
  type: {
119
- type: import('vue').PropType<"text" | "textarea">;
106
+ type: PropType<"text" | "password">;
120
107
  default: string;
121
108
  };
122
- placeholder: {
109
+ }>, {
110
+ inputRef: import('vue').Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
111
+ render: () => any;
112
+ }, {}, {}, {
113
+ /**
114
+ * @zh 使输入框获取焦点
115
+ * @en Make the input box focus
116
+ * @public
117
+ */
118
+ focus(): void;
119
+ /**
120
+ * @zh 使输入框失去焦点
121
+ * @en Make the input box lose focus
122
+ * @public
123
+ */
124
+ blur(): void;
125
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
126
+ 'update:modelValue': (value: string) => true;
127
+ /**
128
+ * @zh 用户输入时触发
129
+ * @en Triggered when the user enters
130
+ * @param {string} value
131
+ * @param {Event} ev
132
+ */
133
+ input: (value: string, ev: Event) => true;
134
+ /**
135
+ * @zh 仅在输入框失焦或按下回车时触发
136
+ * @en Only triggered when the input box is out of focus or when you press Enter
137
+ * @param {string} value
138
+ * @param {Event} ev
139
+ */
140
+ change: (value: string, ev: Event) => true;
141
+ /**
142
+ * @zh 用户按下回车时触发
143
+ * @en Triggered when the user presses enter
144
+ * @param {KeyboardEvent} ev
145
+ */
146
+ pressEnter: (ev: KeyboardEvent) => true;
147
+ /**
148
+ * @zh 用户点击清除按钮时触发
149
+ * @en Triggered when the user clicks the clear button
150
+ * @param {MouseEvent} ev
151
+ */
152
+ clear: (ev: MouseEvent) => true;
153
+ /**
154
+ * @zh 输入框获取焦点时触发
155
+ * @en Triggered when the input box gets focus
156
+ * @param {FocusEvent} ev
157
+ */
158
+ focus: (ev: FocusEvent) => true;
159
+ /**
160
+ * @zh 输入框失去焦点时触发
161
+ * @en Triggered when the input box loses focus
162
+ * @param {FocusEvent} ev
163
+ */
164
+ blur: (ev: FocusEvent) => true;
165
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
166
+ /**
167
+ * @zh 绑定值
168
+ * @en Value
169
+ */
170
+ modelValue: StringConstructor;
171
+ /**
172
+ * @zh 默认值(非受控状态)
173
+ * @en Default value (uncontrolled state)
174
+ */
175
+ defaultValue: {
123
176
  type: StringConstructor;
124
177
  default: string;
125
178
  };
126
- disabled: {
127
- type: BooleanConstructor;
128
- default: boolean;
129
- };
179
+ /**
180
+ * @zh 输入框大小
181
+ * @en Input size
182
+ * @values 'mini','small','medium','large'
183
+ * @defaultValue 'medium'
184
+ */
130
185
  size: {
131
- type: import('vue').PropType<"small" | "large" | "default">;
132
- default: string;
186
+ type: PropType<Size>;
133
187
  };
134
- showPassword: {
188
+ /**
189
+ * @zh 是否允许清空输入框
190
+ * @en Whether to allow the input to be cleared
191
+ */
192
+ allowClear: {
135
193
  type: BooleanConstructor;
136
194
  default: boolean;
137
195
  };
138
- resize: {
139
- type: BooleanConstructor;
140
- default: boolean;
141
- };
142
- prefixIcon: {
143
- type: StringConstructor;
144
- default: string;
145
- };
146
- suffixIcon: {
147
- type: StringConstructor;
148
- default: string;
149
- };
150
- autosize: {
151
- type: import('vue').PropType<boolean | {
152
- minRows: number;
153
- maxRows: number;
154
- }>;
155
- default: boolean;
156
- };
157
- formatter: {
158
- type: FunctionConstructor;
159
- default: undefined;
160
- };
161
- validateEvent: {
196
+ /**
197
+ * @zh 是否禁用
198
+ * @en Whether to disable
199
+ */
200
+ disabled: {
162
201
  type: BooleanConstructor;
163
202
  default: boolean;
164
203
  };
165
- clearable: {
204
+ /**
205
+ * @zh 是否为只读状态
206
+ * @en Whether it is read-only
207
+ */
208
+ readonly: {
166
209
  type: BooleanConstructor;
167
210
  default: boolean;
168
211
  };
169
- card: {
212
+ /**
213
+ * @zh 是否为错误状态
214
+ * @en Whether it is an error state
215
+ */
216
+ error: {
170
217
  type: BooleanConstructor;
171
218
  default: boolean;
172
219
  };
173
- maxlength: {
174
- type: (NumberConstructor | StringConstructor)[];
175
- default: undefined;
220
+ /**
221
+ * @zh 提示文字
222
+ * @en Prompt text
223
+ */
224
+ placeholder: StringConstructor;
225
+ /**
226
+ * @zh 输入值的最大长度,errorOnly 属性在 2.12.0 版本添加
227
+ * @en Enter the maximum length of the value, the errorOnly attribute was added in version 2.12.0
228
+ */
229
+ maxLength: {
230
+ type: PropType<number | {
231
+ length: number;
232
+ errorOnly?: boolean;
233
+ }>;
234
+ default: number;
176
235
  };
236
+ /**
237
+ * @zh 是否显示字数统计
238
+ * @en Whether to display word count
239
+ */
177
240
  showWordLimit: {
178
241
  type: BooleanConstructor;
179
242
  default: boolean;
180
243
  };
181
- valueType: {
182
- type: import('vue').PropType<"string" | "number">;
244
+ /**
245
+ * @zh 字符长度的计算方法
246
+ * @en Calculation method of word length
247
+ */
248
+ wordLength: {
249
+ type: PropType<(value: string) => number>;
250
+ };
251
+ /**
252
+ * @zh 字符截取方法,同 wordLength 一起使用
253
+ * @en Character interception method, used together with wordLength
254
+ * @version 2.12.0
255
+ */
256
+ wordSlice: {
257
+ type: PropType<(value: string, maxLength: number) => string>;
258
+ };
259
+ /**
260
+ * @zh 内部 input 元素的属性
261
+ * @en Attributes of inner input elements
262
+ * @version 2.27.0
263
+ */
264
+ inputAttrs: {
265
+ type: ObjectConstructor;
266
+ };
267
+ type: {
268
+ type: PropType<"text" | "password">;
183
269
  default: string;
184
270
  };
185
271
  }>> & Readonly<{
186
- onFocus?: ((...args: any[]) => any) | undefined;
187
- onBlur?: ((...args: any[]) => any) | undefined;
188
- onChange?: ((...args: any[]) => any) | undefined;
189
- onInput?: ((...args: any[]) => any) | undefined;
190
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
191
- onClear?: ((...args: any[]) => any) | undefined;
192
- onPressEnter?: ((...args: any[]) => any) | undefined;
272
+ onInput?: ((value: string, ev: Event) => any) | undefined;
273
+ onClear?: ((ev: MouseEvent) => any) | undefined;
274
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
275
+ onBlur?: ((ev: FocusEvent) => any) | undefined;
276
+ onChange?: ((value: string, ev: Event) => any) | undefined;
277
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
278
+ onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
193
279
  }>, {
194
- size: "small" | "large" | "default";
195
- type: "text" | "textarea";
196
- name: string;
197
- form: string;
280
+ type: "text" | "password";
198
281
  disabled: boolean;
199
- autocomplete: "off" | "on";
200
- autofocus: boolean;
201
- maxlength: string | number;
282
+ error: boolean;
202
283
  readonly: boolean;
203
- resize: boolean;
204
- modelValue: string | number;
205
- card: boolean;
206
- placeholder: string;
207
- showPassword: boolean;
208
- prefixIcon: string;
209
- suffixIcon: string;
210
- autosize: boolean | {
211
- minRows: number;
212
- maxRows: number;
213
- };
214
- formatter: Function;
215
- validateEvent: boolean;
216
- clearable: boolean;
284
+ defaultValue: string;
285
+ maxLength: number | {
286
+ length: number;
287
+ errorOnly?: boolean;
288
+ };
289
+ allowClear: boolean;
217
290
  showWordLimit: boolean;
218
- valueType: "string" | "number";
219
291
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
220
292
  export default _default;
@@ -0,0 +1,9 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ className: {
3
+ block: string;
4
+ element: (className: string) => string;
5
+ modifier: (className: string) => string;
6
+ is: (className: string) => string;
7
+ };
8
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
9
+ export default _default;