@aspire-ui/element-component-pro 1.0.12 → 1.0.14

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 CHANGED
@@ -13,6 +13,7 @@
13
13
  | 组件 | 说明 |
14
14
  |------|------|
15
15
  | ProTable | 增强表格,集成搜索、工具栏、分页 |
16
+ | ProTableForm | 对比表表单:固定行 + 友商动态行,指标列可千分位 |
16
17
  | ProForm | Schema 驱动的表单,支持栅格布局 |
17
18
  | FormattedNumberInput | 千分位数字输入(`component: 'formatted-number'` 所用组件,可单独按需引入) |
18
19
  | ProCard | 卡片容器 |
@@ -150,6 +150,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
150
150
  pageSize?: number;
151
151
  pageSizes?: number[];
152
152
  layout?: string;
153
+ small?: boolean;
154
+ background?: boolean;
153
155
  props?: Record<string, unknown>;
154
156
  } | Record<string, unknown>;
155
157
  tableSetting?: {
@@ -305,6 +307,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
305
307
  pageSize?: number;
306
308
  pageSizes?: number[];
307
309
  layout?: string;
310
+ small?: boolean;
311
+ background?: boolean;
308
312
  props?: Record<string, unknown>;
309
313
  } | Record<string, unknown>;
310
314
  tableSetting?: {
@@ -385,15 +389,17 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
385
389
  pageSize?: number;
386
390
  pageSizes?: number[];
387
391
  layout?: string;
392
+ small?: boolean;
393
+ background?: boolean;
388
394
  props?: Record<string, unknown>;
389
395
  } | Record<string, unknown>;
396
+ fetchSetting: FetchSetting;
390
397
  tableSetting: {
391
398
  redo?: boolean;
392
399
  size?: boolean;
393
400
  setting?: boolean;
394
401
  fullScreen?: boolean;
395
402
  };
396
- fetchSetting: FetchSetting;
397
403
  }>;
398
404
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
399
405
  export default _default;
@@ -88,6 +88,7 @@ export interface TreeProps {
88
88
  }
89
89
  /** ProTable Props */
90
90
  export interface ProTableProps {
91
+ [key: string]: unknown;
91
92
  columns?: ProColumn[];
92
93
  dataSource?: Record<string, unknown>[];
93
94
  api?: (params: Record<string, unknown>) => Promise<unknown>;
@@ -0,0 +1,164 @@
1
+ import { ProTableFormActionColumn, ProTableFormColumn, ProTableFormFixedRow } from './types';
2
+
3
+ /**
4
+ * Vue 2 默认 v-model 绑定 value + input;本组件使用 modelValue(与 Vue 3 一致),需显式声明 model。
5
+ */
6
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
+ modelValue?: Record<string, unknown>;
8
+ columns: ProTableFormColumn[];
9
+ fixedRows: ProTableFormFixedRow[];
10
+ competitorsKey?: string;
11
+ competitorNameKey?: string;
12
+ firstColumnTitle?: string;
13
+ competitorNamePlaceholder?: string;
14
+ metricPlaceholder?: string;
15
+ addCompetitorText?: string;
16
+ minCompetitors?: number;
17
+ rules?: Record<string, unknown>;
18
+ labelWidth?: string;
19
+ bordered?: boolean;
20
+ firstColMinWidth?: number;
21
+ actionWidth?: number;
22
+ showFirstColumn?: boolean;
23
+ showActionColumn?: boolean;
24
+ actionColumn?: ProTableFormActionColumn;
25
+ }>, {
26
+ modelValue: () => {};
27
+ competitorsKey: string;
28
+ competitorNameKey: string;
29
+ firstColumnTitle: string;
30
+ competitorNamePlaceholder: string;
31
+ metricPlaceholder: string;
32
+ addCompetitorText: string;
33
+ minCompetitors: number;
34
+ labelWidth: string;
35
+ bordered: boolean;
36
+ firstColMinWidth: number;
37
+ actionWidth: number;
38
+ showFirstColumn: boolean;
39
+ showActionColumn: boolean;
40
+ }>, {
41
+ validate: () => Promise<boolean>;
42
+ clearValidate: (propsArg?: string | string[]) => void;
43
+ addCompetitor: () => void;
44
+ removeCompetitor: (index: number) => void;
45
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
46
+ "update:modelValue": (v: Record<string, unknown>) => void;
47
+ }, string, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
48
+ modelValue?: Record<string, unknown>;
49
+ columns: ProTableFormColumn[];
50
+ fixedRows: ProTableFormFixedRow[];
51
+ competitorsKey?: string;
52
+ competitorNameKey?: string;
53
+ firstColumnTitle?: string;
54
+ competitorNamePlaceholder?: string;
55
+ metricPlaceholder?: string;
56
+ addCompetitorText?: string;
57
+ minCompetitors?: number;
58
+ rules?: Record<string, unknown>;
59
+ labelWidth?: string;
60
+ bordered?: boolean;
61
+ firstColMinWidth?: number;
62
+ actionWidth?: number;
63
+ showFirstColumn?: boolean;
64
+ showActionColumn?: boolean;
65
+ actionColumn?: ProTableFormActionColumn;
66
+ }>, {
67
+ modelValue: () => {};
68
+ competitorsKey: string;
69
+ competitorNameKey: string;
70
+ firstColumnTitle: string;
71
+ competitorNamePlaceholder: string;
72
+ metricPlaceholder: string;
73
+ addCompetitorText: string;
74
+ minCompetitors: number;
75
+ labelWidth: string;
76
+ bordered: boolean;
77
+ firstColMinWidth: number;
78
+ actionWidth: number;
79
+ showFirstColumn: boolean;
80
+ showActionColumn: boolean;
81
+ }>>>, {
82
+ bordered: boolean;
83
+ modelValue: Record<string, unknown>;
84
+ labelWidth: string;
85
+ competitorsKey: string;
86
+ competitorNameKey: string;
87
+ firstColumnTitle: string;
88
+ competitorNamePlaceholder: string;
89
+ metricPlaceholder: string;
90
+ addCompetitorText: string;
91
+ minCompetitors: number;
92
+ firstColMinWidth: number;
93
+ actionWidth: number;
94
+ showFirstColumn: boolean;
95
+ showActionColumn: boolean;
96
+ }>, Partial<Record<string, (_: {
97
+ column: ProTableFormColumn;
98
+ }) => any>> & Partial<Record<string, (_: {
99
+ column: ProTableFormColumn;
100
+ row: any;
101
+ value: unknown;
102
+ updateValue: (v: unknown) => void;
103
+ }) => any>> & Partial<Record<string, (_: {
104
+ column: ProTableFormColumn;
105
+ row: any;
106
+ value: unknown;
107
+ updateValue: (v: unknown) => void;
108
+ }) => any>> & {
109
+ firstColumnHeader?(_: {}): any;
110
+ firstColumn?(_: {
111
+ row: {
112
+ _type: "fixed";
113
+ rowKey: string;
114
+ rowLabel: string;
115
+ };
116
+ rowType: "fixed";
117
+ rowKey: string;
118
+ rowLabel: string;
119
+ rowIndex?: undefined;
120
+ value?: undefined;
121
+ updateValue?: undefined;
122
+ } | {
123
+ row: {
124
+ _type: "competitor";
125
+ _index: number;
126
+ };
127
+ rowType: "competitor";
128
+ rowIndex: number;
129
+ value: string;
130
+ updateValue: (v: string) => void;
131
+ rowKey?: undefined;
132
+ rowLabel?: undefined;
133
+ }): any;
134
+ actionHeader?(_: {}): any;
135
+ action?(_: {
136
+ row: any;
137
+ canDelete: boolean;
138
+ addCompetitor: () => void;
139
+ removeCompetitor: (index: number) => void;
140
+ }): any;
141
+ }>;
142
+ export default _default;
143
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
144
+ type __VLS_TypePropsToRuntimeProps<T> = {
145
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
146
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
147
+ } : {
148
+ type: import('vue').PropType<T[K]>;
149
+ required: true;
150
+ };
151
+ };
152
+ type __VLS_WithDefaults<P, D> = {
153
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
154
+ default: D[K];
155
+ }> : P[K];
156
+ };
157
+ type __VLS_Prettify<T> = {
158
+ [K in keyof T]: T[K];
159
+ } & {};
160
+ type __VLS_WithTemplateSlots<T, S> = T & {
161
+ new (): {
162
+ $scopedSlots: S;
163
+ };
164
+ };
@@ -0,0 +1,5 @@
1
+ import { default as ProTableForm } from './ProTableForm.vue';
2
+
3
+ export { ProTableForm };
4
+ export type { ProTableFormColumn, ProTableFormFixedRow, ProTableFormProps, ProTableFormActionColumn, } from './types';
5
+ export default ProTableForm;
@@ -0,0 +1,69 @@
1
+ /** 指标列(或含友商名称等任意 key) */
2
+ export interface ProTableFormColumn {
3
+ /** 对应 model 中对象字段名 */
4
+ key: string;
5
+ title: string;
6
+ required?: boolean;
7
+ /**
8
+ * 单元格渲染方式:
9
+ * - input / formatted-number:内置
10
+ * - slot:使用具名插槽 `cell-{slotName}` 完全自定义
11
+ */
12
+ component?: 'input' | 'formatted-number' | 'slot';
13
+ /**
14
+ * component 为 slot 时必填,对应插槽名为 `cell-{slotName}`(如 slotName: 'score' → #cell-score)
15
+ */
16
+ slotName?: string;
17
+ placeholder?: string;
18
+ width?: number;
19
+ minWidth?: number;
20
+ /**
21
+ * 透传给单元格组件。`component === 'formatted-number'` 时在此传入
22
+ * `integerDigits`、`decimalPlaces`、`rounding`、`inputLimit` 等(与 FormattedNumberInput / ProForm 一致)。
23
+ */
24
+ componentProps?: Record<string, unknown>;
25
+ /** 覆盖该列默认必填规则(与 Element 表单 rules 一致) */
26
+ rules?: unknown[];
27
+ }
28
+ /** 固定行(首列为文案,不可删) */
29
+ export interface ProTableFormFixedRow {
30
+ rowKey: string;
31
+ label: string;
32
+ }
33
+ /** 操作列配置(showActionColumn 为 true 时生效) */
34
+ export interface ProTableFormActionColumn {
35
+ width?: number;
36
+ minWidth?: number;
37
+ align?: 'left' | 'center' | 'right';
38
+ fixed?: boolean | 'left' | 'right';
39
+ /** 表头文案,使用默认「新增」按钮时显示在按钮左侧,可留空 */
40
+ title?: string;
41
+ }
42
+ export interface ProTableFormProps {
43
+ modelValue?: Record<string, unknown>;
44
+ columns: ProTableFormColumn[];
45
+ fixedRows: ProTableFormFixedRow[];
46
+ competitorsKey?: string;
47
+ /** 友商行「名称」字段,默认 name */
48
+ competitorNameKey?: string;
49
+ firstColumnTitle?: string;
50
+ competitorNamePlaceholder?: string;
51
+ metricPlaceholder?: string;
52
+ addCompetitorText?: string;
53
+ minCompetitors?: number;
54
+ rules?: Record<string, unknown>;
55
+ labelWidth?: string;
56
+ bordered?: boolean;
57
+ firstColMinWidth?: number;
58
+ /**
59
+ * 是否展示首列(维度/友商)。存在 fixedRows 时强制为 true。
60
+ * 无固定行且为 false 时隐藏首列,需在 columns 中自行配置名称等字段。
61
+ */
62
+ showFirstColumn?: boolean;
63
+ /** 是否展示操作列,默认 true */
64
+ showActionColumn?: boolean;
65
+ /** 操作列宽度(showActionColumn 时) */
66
+ actionWidth?: number;
67
+ /** 操作列详细配置 */
68
+ actionColumn?: ProTableFormActionColumn;
69
+ }