@aspire-ui/element-component-pro 1.0.6 → 1.0.8
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/README.md +22 -0
- package/dist/ProForm/FormattedNumberInput.vue.d.ts +55 -0
- package/dist/ProForm/ProForm.vue.d.ts +7 -0
- package/dist/ProForm/ProFormItem.vue.d.ts +2 -0
- package/dist/ProForm/index.d.ts +2 -1
- package/dist/element-component-pro.es.js +966 -759
- package/dist/element-component-pro.es.js.map +1 -1
- package/dist/element-component-pro.umd.js +2 -2
- package/dist/element-component-pro.umd.js.map +1 -1
- package/dist/index.d.ts +130 -50
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +13 -2
- package/dist/utils/formattedNumber.d.ts +16 -0
- package/dist/utils/tooltip.d.ts +4 -0
- package/package.json +2 -1
- package/src/ProDescriptions/ProDescriptions.vue +24 -6
- package/src/ProForm/FormattedNumberInput.vue +122 -0
- package/src/ProForm/ProForm.vue +3 -1
- package/src/ProForm/ProFormItem.vue +155 -123
- package/src/ProForm/index.ts +2 -1
- package/src/ProTable/TableAction.vue +2 -5
- package/src/index.ts +5 -2
- package/src/types/index.ts +9 -1
- package/src/utils/formattedNumber.ts +118 -0
- package/src/utils/tooltip.ts +56 -0
- package/src/vite-env.d.ts +5 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|------|------|
|
|
15
15
|
| ProTable | 增强表格,集成搜索、工具栏、分页 |
|
|
16
16
|
| ProForm | Schema 驱动的表单,支持栅格布局 |
|
|
17
|
+
| FormattedNumberInput | 千分位数字输入(`component: 'formatted-number'` 所用组件,可单独按需引入) |
|
|
17
18
|
| ProCard | 卡片容器 |
|
|
18
19
|
| ProDescriptions | 详情描述列表 |
|
|
19
20
|
|
|
@@ -311,14 +312,35 @@ const handleSubmit = (values) => {
|
|
|
311
312
|
- **dynamicDisabled**: 动态禁用
|
|
312
313
|
- **dynamicRules**: 动态校验规则
|
|
313
314
|
- **labelWidth**: 支持字段级标签宽度,覆盖表单级 `labelWidth`
|
|
315
|
+
- **tooltip**: 支持字段 value 的悬浮提示,可直接显示当前值或动态文案
|
|
314
316
|
- **v-model**: 支持 `modelValue` 双向绑定,`initialValues` 仅补齐缺失字段
|
|
315
317
|
- **useForm + v-model**: 编程式 `setFieldsValue/resetFields` 与受控 `modelValue` 保持同步
|
|
316
318
|
- **componentProps**: 支持函数,可获取 formModel、formActionType
|
|
317
319
|
|
|
320
|
+
```ts
|
|
321
|
+
{
|
|
322
|
+
field: 'name',
|
|
323
|
+
label: '姓名',
|
|
324
|
+
component: 'input',
|
|
325
|
+
tooltip: true,
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
{
|
|
329
|
+
field: 'status',
|
|
330
|
+
label: '状态',
|
|
331
|
+
component: 'select',
|
|
332
|
+
tooltip: ({ values }) => values.name ? `当前姓名:${values.name}` : '请选择状态',
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
更多说明见 `docs/ProForm.md`。
|
|
337
|
+
|
|
318
338
|
## ProDescriptions
|
|
319
339
|
|
|
320
340
|
参考 [Vben Admin Description](https://doc.vvbin.cn/components/desc.html#usage),用于详情页信息展示,支持 `schema` 驱动、响应式列数、折叠以及 `useDescription` 编程式更新。
|
|
321
341
|
|
|
342
|
+
- **tooltip**: 支持字段 value 的悬浮提示,适合长文本、数组值和对象值预览
|
|
343
|
+
|
|
322
344
|
```vue
|
|
323
345
|
<template>
|
|
324
346
|
<ProDescriptions
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FormattedNumberRounding } from '../utils/formattedNumber';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
value?: unknown;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** 整数部分允许的最大位数,默认 5 */
|
|
8
|
+
integerDigits?: number;
|
|
9
|
+
/** 小数保留位数,默认 6 */
|
|
10
|
+
decimalPlaces?: number;
|
|
11
|
+
/** 进位方式,默认四舍五入 */
|
|
12
|
+
rounding?: FormattedNumberRounding;
|
|
13
|
+
}>, {
|
|
14
|
+
integerDigits: number;
|
|
15
|
+
decimalPlaces: number;
|
|
16
|
+
rounding: string;
|
|
17
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
input: (value: unknown) => void;
|
|
19
|
+
}, string, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
20
|
+
value?: unknown;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** 整数部分允许的最大位数,默认 5 */
|
|
24
|
+
integerDigits?: number;
|
|
25
|
+
/** 小数保留位数,默认 6 */
|
|
26
|
+
decimalPlaces?: number;
|
|
27
|
+
/** 进位方式,默认四舍五入 */
|
|
28
|
+
rounding?: FormattedNumberRounding;
|
|
29
|
+
}>, {
|
|
30
|
+
integerDigits: number;
|
|
31
|
+
decimalPlaces: number;
|
|
32
|
+
rounding: string;
|
|
33
|
+
}>>>, {
|
|
34
|
+
integerDigits: number;
|
|
35
|
+
decimalPlaces: number;
|
|
36
|
+
rounding: FormattedNumberRounding;
|
|
37
|
+
}>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
40
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
41
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
42
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
43
|
+
} : {
|
|
44
|
+
type: import('vue').PropType<T[K]>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type __VLS_WithDefaults<P, D> = {
|
|
49
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
50
|
+
default: D[K];
|
|
51
|
+
}> : P[K];
|
|
52
|
+
};
|
|
53
|
+
type __VLS_Prettify<T> = {
|
|
54
|
+
[K in keyof T]: T[K];
|
|
55
|
+
} & {};
|
|
@@ -6,6 +6,7 @@ declare function __VLS_template(): Partial<Record<string, (_: {
|
|
|
6
6
|
field: string;
|
|
7
7
|
label: string;
|
|
8
8
|
labelWidth?: string | undefined;
|
|
9
|
+
colon?: boolean | undefined;
|
|
9
10
|
component?: (import('..').ProFormBuiltInComponent | import('..').ProFormCustomComponent) | undefined;
|
|
10
11
|
componentProps?: (Record<string, unknown> | ((params: import('..').RenderCallbackParams & {
|
|
11
12
|
formActionType?: FormActionType;
|
|
@@ -35,6 +36,7 @@ declare function __VLS_template(): Partial<Record<string, (_: {
|
|
|
35
36
|
dependencies?: string[] | undefined;
|
|
36
37
|
helpMessage?: string | string[] | undefined;
|
|
37
38
|
helpComponentProps?: Record<string, unknown> | undefined;
|
|
39
|
+
tooltip?: (boolean | string | Record<string, unknown> | ((params: import('..').RenderCallbackParams) => boolean | string | Record<string, unknown>)) | undefined;
|
|
38
40
|
};
|
|
39
41
|
field: string;
|
|
40
42
|
values: Record<string, unknown>;
|
|
@@ -53,6 +55,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
53
55
|
initialValues?: Record<string, unknown>;
|
|
54
56
|
labelWidth?: string;
|
|
55
57
|
labelPosition?: "left" | "right" | "top";
|
|
58
|
+
colon?: boolean;
|
|
56
59
|
gutter?: number;
|
|
57
60
|
size?: "medium" | "small" | "large";
|
|
58
61
|
disabled?: boolean;
|
|
@@ -79,6 +82,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
79
82
|
}>, {
|
|
80
83
|
labelWidth: string;
|
|
81
84
|
labelPosition: string;
|
|
85
|
+
colon: boolean;
|
|
82
86
|
gutter: number;
|
|
83
87
|
size: string;
|
|
84
88
|
autoSetPlaceholder: boolean;
|
|
@@ -131,6 +135,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
131
135
|
initialValues?: Record<string, unknown>;
|
|
132
136
|
labelWidth?: string;
|
|
133
137
|
labelPosition?: "left" | "right" | "top";
|
|
138
|
+
colon?: boolean;
|
|
134
139
|
gutter?: number;
|
|
135
140
|
size?: "medium" | "small" | "large";
|
|
136
141
|
disabled?: boolean;
|
|
@@ -157,6 +162,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
157
162
|
}>, {
|
|
158
163
|
labelWidth: string;
|
|
159
164
|
labelPosition: string;
|
|
165
|
+
colon: boolean;
|
|
160
166
|
gutter: number;
|
|
161
167
|
size: string;
|
|
162
168
|
autoSetPlaceholder: boolean;
|
|
@@ -196,6 +202,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
196
202
|
resetButtonIcon: string;
|
|
197
203
|
showAdvancedButton: boolean;
|
|
198
204
|
actionColOptions: ColEx;
|
|
205
|
+
colon: boolean;
|
|
199
206
|
labelWidth: string;
|
|
200
207
|
labelPosition: "left" | "right" | "top";
|
|
201
208
|
gutter: number;
|
|
@@ -13,6 +13,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
|
|
|
13
13
|
formModel: Record<string, unknown>;
|
|
14
14
|
formDisabled?: boolean;
|
|
15
15
|
autoPlaceholder?: boolean;
|
|
16
|
+
colon?: boolean;
|
|
16
17
|
formActionType?: import('../types').FormActionType;
|
|
17
18
|
onFieldChange?: (field: string, value: unknown) => void;
|
|
18
19
|
/** 自定义组件映射(由 ProForm 传入) */
|
|
@@ -22,6 +23,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
|
|
|
22
23
|
formModel: Record<string, unknown>;
|
|
23
24
|
formDisabled?: boolean;
|
|
24
25
|
autoPlaceholder?: boolean;
|
|
26
|
+
colon?: boolean;
|
|
25
27
|
formActionType?: import('../types').FormActionType;
|
|
26
28
|
onFieldChange?: (field: string, value: unknown) => void;
|
|
27
29
|
/** 自定义组件映射(由 ProForm 传入) */
|
package/dist/ProForm/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as ProForm } from './ProForm.vue';
|
|
2
2
|
import { default as ProFormItem } from './ProFormItem.vue';
|
|
3
3
|
import { default as FormActions } from './FormActions.vue';
|
|
4
|
+
import { default as FormattedNumberInput } from './FormattedNumberInput.vue';
|
|
4
5
|
import { useForm } from './useForm';
|
|
5
6
|
|
|
6
|
-
export { ProForm, ProFormItem, FormActions, useForm };
|
|
7
|
+
export { ProForm, ProFormItem, FormActions, FormattedNumberInput, useForm };
|
|
7
8
|
export default ProForm;
|