morningfast-plus 1.0.20 → 1.0.21
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/components/components.css +1 -1
- package/components/index.cjs +2 -2
- package/components/index.d.ts +1 -0
- package/components/index.mjs +2 -2
- package/components/product-select/index.d.ts +9 -0
- package/components/product-select/src/instance.d.ts +0 -0
- package/components/product-select/src/product-select.d.ts +106 -0
- package/components/product-select/src/product-select.vue.d.ts +137 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SFCWithInstall } from '../install';
|
|
2
|
+
import { default as ProductSelect } from './src/product-select.vue';
|
|
3
|
+
/**
|
|
4
|
+
* @file ProductSelect 产品选择器组件
|
|
5
|
+
* @module /packages/components/product-select
|
|
6
|
+
*/
|
|
7
|
+
export declare const MpProductSelect: SFCWithInstall<typeof ProductSelect>;
|
|
8
|
+
export default MpProductSelect;
|
|
9
|
+
export * from './src/product-select';
|
|
File without changes
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
/** 透传给 ElTooltip 的配置(与组件内默认属性浅合并,每格仍强制使用当前单元格文案作为 content) */
|
|
3
|
+
export type MpProductSelectTooltipProps = Record<string, unknown>;
|
|
4
|
+
/** 列表项一行展示的字段配置 */
|
|
5
|
+
export interface MpProductSelectField {
|
|
6
|
+
/** 对应 `items` 中取值的属性名 */
|
|
7
|
+
key: string;
|
|
8
|
+
/** 左侧标签文案 */
|
|
9
|
+
label: string;
|
|
10
|
+
/** 单字段覆盖 `tooltipProps`(浅合并) */
|
|
11
|
+
tooltipProps?: MpProductSelectTooltipProps;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 每条卡片内嵌的行数据(常见于接口直接返回 key-value 列表)
|
|
15
|
+
* - `label` 与 `key` 二选一作为左侧文案;接口常用 `key` 表示「名称、编码」等标签
|
|
16
|
+
*/
|
|
17
|
+
export interface MpProductSelectItemRow {
|
|
18
|
+
label?: string;
|
|
19
|
+
key?: string;
|
|
20
|
+
value: unknown;
|
|
21
|
+
tooltipProps?: MpProductSelectTooltipProps;
|
|
22
|
+
}
|
|
23
|
+
export type MpProductSelectItem = Record<string, unknown>;
|
|
24
|
+
export declare const MpProductSelectProps: {
|
|
25
|
+
items: {
|
|
26
|
+
type: PropType<MpProductSelectItem[]>;
|
|
27
|
+
default: () => never[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 左侧信息区列配置(与 `itemRowsKey` 二选一)
|
|
31
|
+
* 有 `itemRowsKey` 时以每条 `items` 上的数组为准,可不再传 `fields`
|
|
32
|
+
*/
|
|
33
|
+
fields: {
|
|
34
|
+
type: PropType<MpProductSelectField[]>;
|
|
35
|
+
default: () => never[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 每条 `items` 上存放「行列表」的属性名,如 `message`、`rows`
|
|
39
|
+
* 数组项形如 `{ key: '名称', value: 'xxx' }` 或 `{ label: '名称', value: 'xxx' }`
|
|
40
|
+
*/
|
|
41
|
+
itemRowsKey: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
/** 图片地址字段名,不传则不展示图片列 */
|
|
46
|
+
imageKey: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
/** 勾选与 `v-model` 绑定的唯一键字段 */
|
|
51
|
+
rowKey: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
/** 是否启用勾选(关闭后不展示全选与各卡片复选框,且无法通过 UI 改选中项) */
|
|
56
|
+
selectable: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
/** 是否展示顶部「全选」(仅当 `selectable` 为 true 时生效) */
|
|
61
|
+
showSelectAll: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
selectAllText: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
emptyText: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* 值区域最大宽度,避免过长文本撑破布局;支持数字(px)或任意 CSS 宽度
|
|
75
|
+
* @default min(100%, 160px)
|
|
76
|
+
*/
|
|
77
|
+
valueMaxWidth: {
|
|
78
|
+
type: PropType<string | number>;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
/** 统一配置各字段值上的 ElTooltip(可被字段级 `tooltipProps` 覆盖) */
|
|
82
|
+
tooltipProps: {
|
|
83
|
+
type: PropType<MpProductSelectTooltipProps>;
|
|
84
|
+
default: () => {};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Tooltip 气泡层默认最大宽度(写入 `popperStyle.maxWidth`,可被 `tooltipProps.popperStyle` 覆盖)
|
|
88
|
+
* @default min(90vw, 320px)
|
|
89
|
+
*/
|
|
90
|
+
tooltipPopperMaxWidth: {
|
|
91
|
+
type: PropType<string | number>;
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Tooltip 层级,需高于布局侧栏等(如 MppLayout 侧栏 z-index: 5000)
|
|
96
|
+
*/
|
|
97
|
+
tooltipZIndex: {
|
|
98
|
+
type: NumberConstructor;
|
|
99
|
+
default: number;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export declare const MpProductSelectEmits: {
|
|
103
|
+
change: (_keys: (string | number)[], _selectedItems: MpProductSelectItem[]) => boolean;
|
|
104
|
+
/** 选中项变化(与 `change` 同步触发,便于在模板用 `@selection-change` 监听) */
|
|
105
|
+
'selection-change': (_keys: (string | number)[], _selectedItems: MpProductSelectItem[]) => boolean;
|
|
106
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { MpProductSelectField, MpProductSelectItem } from './product-select';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
items: {
|
|
4
|
+
type: import('vue').PropType<MpProductSelectItem[]>;
|
|
5
|
+
default: () => never[];
|
|
6
|
+
};
|
|
7
|
+
fields: {
|
|
8
|
+
type: import('vue').PropType<MpProductSelectField[]>;
|
|
9
|
+
default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
itemRowsKey: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
imageKey: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
rowKey: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
selectable: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
showSelectAll: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
selectAllText: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
emptyText: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
valueMaxWidth: {
|
|
40
|
+
type: import('vue').PropType<string | number>;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
tooltipProps: {
|
|
44
|
+
type: import('vue').PropType<import('./product-select').MpProductSelectTooltipProps>;
|
|
45
|
+
default: () => {};
|
|
46
|
+
};
|
|
47
|
+
tooltipPopperMaxWidth: {
|
|
48
|
+
type: import('vue').PropType<string | number>;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
tooltipZIndex: {
|
|
52
|
+
type: NumberConstructor;
|
|
53
|
+
default: number;
|
|
54
|
+
};
|
|
55
|
+
modelValue: {
|
|
56
|
+
type: import('vue').PropType<(string | number)[]>;
|
|
57
|
+
};
|
|
58
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
59
|
+
change: (_keys: (string | number)[], _selectedItems: MpProductSelectItem[]) => void;
|
|
60
|
+
"selection-change": (_keys: (string | number)[], _selectedItems: MpProductSelectItem[]) => void;
|
|
61
|
+
"update:modelValue": (value: (string | number)[]) => void;
|
|
62
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
63
|
+
items: {
|
|
64
|
+
type: import('vue').PropType<MpProductSelectItem[]>;
|
|
65
|
+
default: () => never[];
|
|
66
|
+
};
|
|
67
|
+
fields: {
|
|
68
|
+
type: import('vue').PropType<MpProductSelectField[]>;
|
|
69
|
+
default: () => never[];
|
|
70
|
+
};
|
|
71
|
+
itemRowsKey: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
imageKey: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
rowKey: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
selectable: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
87
|
+
showSelectAll: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
default: boolean;
|
|
90
|
+
};
|
|
91
|
+
selectAllText: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
emptyText: {
|
|
96
|
+
type: StringConstructor;
|
|
97
|
+
default: string;
|
|
98
|
+
};
|
|
99
|
+
valueMaxWidth: {
|
|
100
|
+
type: import('vue').PropType<string | number>;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
tooltipProps: {
|
|
104
|
+
type: import('vue').PropType<import('./product-select').MpProductSelectTooltipProps>;
|
|
105
|
+
default: () => {};
|
|
106
|
+
};
|
|
107
|
+
tooltipPopperMaxWidth: {
|
|
108
|
+
type: import('vue').PropType<string | number>;
|
|
109
|
+
default: string;
|
|
110
|
+
};
|
|
111
|
+
tooltipZIndex: {
|
|
112
|
+
type: NumberConstructor;
|
|
113
|
+
default: number;
|
|
114
|
+
};
|
|
115
|
+
modelValue: {
|
|
116
|
+
type: import('vue').PropType<(string | number)[]>;
|
|
117
|
+
};
|
|
118
|
+
}>> & Readonly<{
|
|
119
|
+
onChange?: ((_keys: (string | number)[], _selectedItems: MpProductSelectItem[]) => any) | undefined;
|
|
120
|
+
"onUpdate:modelValue"?: ((value: (string | number)[]) => any) | undefined;
|
|
121
|
+
"onSelection-change"?: ((_keys: (string | number)[], _selectedItems: MpProductSelectItem[]) => any) | undefined;
|
|
122
|
+
}>, {
|
|
123
|
+
fields: MpProductSelectField[];
|
|
124
|
+
items: MpProductSelectItem[];
|
|
125
|
+
emptyText: string;
|
|
126
|
+
rowKey: string;
|
|
127
|
+
selectable: boolean;
|
|
128
|
+
itemRowsKey: string;
|
|
129
|
+
imageKey: string;
|
|
130
|
+
showSelectAll: boolean;
|
|
131
|
+
selectAllText: string;
|
|
132
|
+
valueMaxWidth: string | number;
|
|
133
|
+
tooltipProps: import('./product-select').MpProductSelectTooltipProps;
|
|
134
|
+
tooltipPopperMaxWidth: string | number;
|
|
135
|
+
tooltipZIndex: number;
|
|
136
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
137
|
+
export default _default;
|