kui-vue 6.2.2 → 6.3.0
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/ai/kui-components.json +1011 -452
- package/dist/index.js +2 -2
- package/es/index.js +6207 -4904
- package/es/locale/de.js +6 -2
- package/es/locale/el.js +6 -2
- package/es/locale/en.js +6 -2
- package/es/locale/fr.js +6 -2
- package/es/locale/it.js +6 -2
- package/es/locale/ja.js +6 -2
- package/es/locale/ko.js +6 -2
- package/es/locale/ru.js +6 -2
- package/es/locale/th.js +6 -2
- package/es/locale/uk.js +6 -2
- package/es/locale/vi.js +6 -2
- package/es/locale/zh-CN.js +6 -2
- package/es/locale/zh-TW.js +6 -2
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +2 -2
- package/lib/locale/el.cjs +2 -2
- package/lib/locale/en.cjs +2 -2
- package/lib/locale/fr.cjs +2 -2
- package/lib/locale/it.cjs +2 -2
- package/lib/locale/ja.cjs +2 -2
- package/lib/locale/ko.cjs +2 -2
- package/lib/locale/ru.cjs +2 -2
- package/lib/locale/th.cjs +2 -2
- package/lib/locale/uk.cjs +2 -2
- package/lib/locale/vi.cjs +2 -2
- package/lib/locale/zh-CN.cjs +2 -2
- package/lib/locale/zh-TW.cjs +2 -2
- package/package.json +4 -3
- package/style/base.css +2 -2
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/motion.css +1 -1
- package/style/theme.css +2 -2
- package/types/alert/index.d.ts +5 -5
- package/types/auto-complete/index.d.ts +52 -0
- package/types/badge/index.d.ts +7 -17
- package/types/button/button.d.ts +3 -4
- package/types/card/index.d.ts +5 -5
- package/types/cascader/index.d.ts +9 -0
- package/types/cascader/types.d.ts +5 -0
- package/types/check-card/check-card-group.d.ts +5 -9
- package/types/check-card/check-card.d.ts +5 -9
- package/types/check-card/context.d.ts +3 -3
- package/types/check-card/index.d.ts +1 -1
- package/types/check-card/types.d.ts +2 -3
- package/types/checkbox/checkbox-group.d.ts +5 -5
- package/types/checkbox/checkbox.d.ts +2 -2
- package/types/collapse/collapse.d.ts +5 -5
- package/types/color-picker/index.d.ts +27 -0
- package/types/components.d.ts +2 -2
- package/types/config/context.d.ts +102 -1
- package/types/const/types.d.ts +11 -1
- package/types/const/var.d.ts +6 -1
- package/types/date-picker/index.d.ts +18 -0
- package/types/drawer/index.d.ts +21 -8
- package/types/dropdown/dropdown-button.d.ts +23 -4
- package/types/dropdown/dropdown-context.d.ts +5 -0
- package/types/dropdown/dropdown.d.ts +16 -0
- package/types/dropdown/trigger.d.ts +3 -3
- package/types/feature-card/index.d.ts +5 -5
- package/types/feedback-panel/feedback-panel.d.ts +5 -5
- package/types/flame-wrap/engine.d.ts +18 -0
- package/types/form/context.d.ts +2 -0
- package/types/global.d.ts +256 -0
- package/types/image/image.d.ts +5 -5
- package/types/input/input-group.d.ts +2 -6
- package/types/input-number/index.d.ts +37 -7
- package/types/kanban/index.d.ts +5 -4
- package/types/list-panel/index.d.ts +5 -5
- package/types/locale/de.d.cts +4 -0
- package/types/locale/de.d.ts +4 -0
- package/types/locale/el.d.cts +4 -0
- package/types/locale/el.d.ts +4 -0
- package/types/locale/en.d.cts +4 -0
- package/types/locale/en.d.ts +4 -0
- package/types/locale/fr.d.cts +4 -0
- package/types/locale/fr.d.ts +4 -0
- package/types/locale/it.d.cts +4 -0
- package/types/locale/it.d.ts +4 -0
- package/types/locale/ja.d.cts +4 -0
- package/types/locale/ja.d.ts +4 -0
- package/types/locale/ko.d.cts +4 -0
- package/types/locale/ko.d.ts +4 -0
- package/types/locale/ru.d.cts +4 -0
- package/types/locale/ru.d.ts +4 -0
- package/types/locale/th.d.cts +4 -0
- package/types/locale/th.d.ts +4 -0
- package/types/locale/uk.d.cts +4 -0
- package/types/locale/uk.d.ts +4 -0
- package/types/locale/vi.d.cts +4 -0
- package/types/locale/vi.d.ts +4 -0
- package/types/locale/zh-CN.d.cts +4 -0
- package/types/locale/zh-CN.d.ts +4 -0
- package/types/locale/zh-TW.d.cts +4 -0
- package/types/locale/zh-TW.d.ts +4 -0
- package/types/mentions/index.d.ts +16 -0
- package/types/menu/menu-keyboard.d.ts +23 -0
- package/types/modal/index.d.ts +8 -2
- package/types/modal/modal.d.ts +27 -4
- package/types/modal/toast.d.ts +5 -5
- package/types/page/index.d.ts +5 -5
- package/types/popconfirm/index.d.ts +16 -0
- package/types/poptip/index.d.ts +16 -0
- package/types/popup/layers.d.ts +2 -0
- package/types/qrcode/index.d.ts +5 -5
- package/types/radio/radio-button.d.ts +4 -4
- package/types/radio/radio-group.d.ts +2 -2
- package/types/radio/radio.d.ts +5 -5
- package/types/ripple/engine.d.ts +18 -0
- package/types/select/select.d.ts +5 -0
- package/types/stat-card/stat-card.d.ts +24 -6
- package/types/stat-card/utils/countup.d.ts +3 -3
- package/types/stat-card/utils/stat-item-key.d.ts +11 -0
- package/types/table/index.d.ts +21 -5
- package/types/table/types.d.ts +17 -1
- package/types/table/utils.d.ts +76 -0
- package/types/tag/index.d.ts +5 -5
- package/types/tooltip/index.d.ts +16 -0
- package/types/transfer/index.d.ts +5 -4
- package/types/tree/index.d.ts +2 -2
- package/types/tree-select/index.d.ts +5 -0
- package/types/utils/color.d.ts +13 -0
- package/types/utils/overlay-order.d.ts +6 -0
- package/types/utils/overlay-stack.d.ts +13 -0
- package/types/utils/promise.d.ts +5 -0
- package/types/utils/vnode.d.ts +25 -0
- package/vetur/attributes.json +529 -225
- package/vetur/tags.json +76 -28
- package/vetur/web-types.json +668 -284
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType, VNodeChild } from "vue";
|
|
2
|
-
import type { BooleanType, SizeType, SurfaceShapeType } from "../const/types";
|
|
2
|
+
import type { BooleanType, SizeType, SurfaceShapeType, SurfaceThemeType } from "../const/types";
|
|
3
3
|
import type { StatNumberItem } from "./types";
|
|
4
4
|
declare const statCardProps: {
|
|
5
5
|
title: PropType<VNodeChild>;
|
|
@@ -19,7 +19,7 @@ declare const statCardProps: {
|
|
|
19
19
|
default: boolean;
|
|
20
20
|
};
|
|
21
21
|
theme: {
|
|
22
|
-
type: PropType<
|
|
22
|
+
type: PropType<SurfaceThemeType>;
|
|
23
23
|
default: string;
|
|
24
24
|
};
|
|
25
25
|
shape: {
|
|
@@ -30,6 +30,12 @@ declare const statCardProps: {
|
|
|
30
30
|
type: PropType<SizeType>;
|
|
31
31
|
default: string;
|
|
32
32
|
};
|
|
33
|
+
prefix: {
|
|
34
|
+
type: PropType<VNodeChild>;
|
|
35
|
+
};
|
|
36
|
+
suffix: {
|
|
37
|
+
type: PropType<VNodeChild>;
|
|
38
|
+
};
|
|
33
39
|
};
|
|
34
40
|
export type StatCardProps = ExtractPropTypes<typeof statCardProps>;
|
|
35
41
|
declare const StatCard: import("vue").DefineComponent<ExtractPropTypes<{
|
|
@@ -50,7 +56,7 @@ declare const StatCard: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
50
56
|
default: boolean;
|
|
51
57
|
};
|
|
52
58
|
theme: {
|
|
53
|
-
type: PropType<
|
|
59
|
+
type: PropType<SurfaceThemeType>;
|
|
54
60
|
default: string;
|
|
55
61
|
};
|
|
56
62
|
shape: {
|
|
@@ -61,6 +67,12 @@ declare const StatCard: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
61
67
|
type: PropType<SizeType>;
|
|
62
68
|
default: string;
|
|
63
69
|
};
|
|
70
|
+
prefix: {
|
|
71
|
+
type: PropType<VNodeChild>;
|
|
72
|
+
};
|
|
73
|
+
suffix: {
|
|
74
|
+
type: PropType<VNodeChild>;
|
|
75
|
+
};
|
|
64
76
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
65
77
|
title: PropType<VNodeChild>;
|
|
66
78
|
precision: {
|
|
@@ -79,7 +91,7 @@ declare const StatCard: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
79
91
|
default: boolean;
|
|
80
92
|
};
|
|
81
93
|
theme: {
|
|
82
|
-
type: PropType<
|
|
94
|
+
type: PropType<SurfaceThemeType>;
|
|
83
95
|
default: string;
|
|
84
96
|
};
|
|
85
97
|
shape: {
|
|
@@ -90,13 +102,19 @@ declare const StatCard: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
90
102
|
type: PropType<SizeType>;
|
|
91
103
|
default: string;
|
|
92
104
|
};
|
|
105
|
+
prefix: {
|
|
106
|
+
type: PropType<VNodeChild>;
|
|
107
|
+
};
|
|
108
|
+
suffix: {
|
|
109
|
+
type: PropType<VNodeChild>;
|
|
110
|
+
};
|
|
93
111
|
}>> & Readonly<{}>, {
|
|
94
112
|
size: SizeType;
|
|
95
|
-
|
|
113
|
+
items: StatNumberItem[];
|
|
114
|
+
theme: SurfaceThemeType;
|
|
96
115
|
shape: SurfaceShapeType;
|
|
97
116
|
bordered: boolean | undefined;
|
|
98
117
|
precision: number;
|
|
99
|
-
items: StatNumberItem[];
|
|
100
118
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
101
119
|
export default StatCard;
|
|
102
120
|
export type { StatNumberItem } from "./types";
|
|
@@ -30,7 +30,7 @@ export interface CountUpOptions {
|
|
|
30
30
|
/** Numeral glyph substitution */
|
|
31
31
|
numerals?: string[];
|
|
32
32
|
/** Callback called when animation completes */
|
|
33
|
-
onCompleteCallback?: (() => void) | null;
|
|
33
|
+
onCompleteCallback?: ((args?: unknown) => void) | null;
|
|
34
34
|
/** Callback called when animation starts */
|
|
35
35
|
onStartCallback?: (() => void) | null;
|
|
36
36
|
/** Plugin for alternate animations */
|
|
@@ -62,7 +62,7 @@ export declare class CountUp {
|
|
|
62
62
|
version: string;
|
|
63
63
|
private static observedElements;
|
|
64
64
|
private defaults;
|
|
65
|
-
private rAF
|
|
65
|
+
private rAF?;
|
|
66
66
|
private autoAnimateTimeout?;
|
|
67
67
|
private startTime;
|
|
68
68
|
private remaining;
|
|
@@ -96,7 +96,7 @@ export declare class CountUp {
|
|
|
96
96
|
*/
|
|
97
97
|
private determineDirectionAndSmartEasing;
|
|
98
98
|
/** Start the animation. Optionally pass a callback that fires on completion. */
|
|
99
|
-
start(callback?: () => void): void;
|
|
99
|
+
start(callback?: (args?: unknown) => void): void;
|
|
100
100
|
/** Toggle pause/resume on the animation. */
|
|
101
101
|
pauseResume(): void;
|
|
102
102
|
/** Reset to startVal so the animation can be run again. */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity of one `items` entry across renders.
|
|
3
|
+
*
|
|
4
|
+
* The `kui-item-` prefix keeps a keyless item's position out of the namespace of
|
|
5
|
+
* caller-supplied keys: without it `[{key: 1}, {}]` hands two different metrics the
|
|
6
|
+
* same key, which lets the diffing move a CountUp instance from one item to the
|
|
7
|
+
* other. This rule and these strings are identical in both builds.
|
|
8
|
+
*/
|
|
9
|
+
export declare function statItemKey(item: {
|
|
10
|
+
key?: string | number;
|
|
11
|
+
}, index: number): string;
|
package/types/table/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from "vue";
|
|
2
2
|
import type { BooleanType, SizeType, SurfaceShapeType } from "../const/types";
|
|
3
|
-
import type { Column, SortState, TableKey, TableRecord } from "./types";
|
|
3
|
+
import type { Column, SortState, TableEllipsisOptions, TableKey, TableRecord } from "./types";
|
|
4
4
|
declare const tableProps: {
|
|
5
5
|
data: {
|
|
6
6
|
type: PropType<TableRecord[]>;
|
|
@@ -10,6 +10,11 @@ declare const tableProps: {
|
|
|
10
10
|
type: PropType<Column[]>;
|
|
11
11
|
default: () => never[];
|
|
12
12
|
};
|
|
13
|
+
/** 一次给所有列打开省略号;列上的 `ellipsis` 优先,写 `false` 可以把这一列单独关掉 */
|
|
14
|
+
ellipsis: {
|
|
15
|
+
type: PropType<boolean | number | TableEllipsisOptions>;
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
13
18
|
hiddenColumnKeys: {
|
|
14
19
|
type: PropType<string[]>;
|
|
15
20
|
default: () => never[];
|
|
@@ -23,7 +28,7 @@ declare const tableProps: {
|
|
|
23
28
|
default: () => never[];
|
|
24
29
|
};
|
|
25
30
|
rowKey: {
|
|
26
|
-
type:
|
|
31
|
+
type: PropType<string | ((record: TableRecord) => TableKey)>;
|
|
27
32
|
default: string;
|
|
28
33
|
};
|
|
29
34
|
childrenColumnName: {
|
|
@@ -79,6 +84,11 @@ declare const Table: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
79
84
|
type: PropType<Column[]>;
|
|
80
85
|
default: () => never[];
|
|
81
86
|
};
|
|
87
|
+
/** 一次给所有列打开省略号;列上的 `ellipsis` 优先,写 `false` 可以把这一列单独关掉 */
|
|
88
|
+
ellipsis: {
|
|
89
|
+
type: PropType<boolean | number | TableEllipsisOptions>;
|
|
90
|
+
default: undefined;
|
|
91
|
+
};
|
|
82
92
|
hiddenColumnKeys: {
|
|
83
93
|
type: PropType<string[]>;
|
|
84
94
|
default: () => never[];
|
|
@@ -92,7 +102,7 @@ declare const Table: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
92
102
|
default: () => never[];
|
|
93
103
|
};
|
|
94
104
|
rowKey: {
|
|
95
|
-
type:
|
|
105
|
+
type: PropType<string | ((record: TableRecord) => TableKey)>;
|
|
96
106
|
default: string;
|
|
97
107
|
};
|
|
98
108
|
childrenColumnName: {
|
|
@@ -155,6 +165,11 @@ declare const Table: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
155
165
|
type: PropType<Column[]>;
|
|
156
166
|
default: () => never[];
|
|
157
167
|
};
|
|
168
|
+
/** 一次给所有列打开省略号;列上的 `ellipsis` 优先,写 `false` 可以把这一列单独关掉 */
|
|
169
|
+
ellipsis: {
|
|
170
|
+
type: PropType<boolean | number | TableEllipsisOptions>;
|
|
171
|
+
default: undefined;
|
|
172
|
+
};
|
|
158
173
|
hiddenColumnKeys: {
|
|
159
174
|
type: PropType<string[]>;
|
|
160
175
|
default: () => never[];
|
|
@@ -168,7 +183,7 @@ declare const Table: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
168
183
|
default: () => never[];
|
|
169
184
|
};
|
|
170
185
|
rowKey: {
|
|
171
|
-
type:
|
|
186
|
+
type: PropType<string | ((record: TableRecord) => TableKey)>;
|
|
172
187
|
default: string;
|
|
173
188
|
};
|
|
174
189
|
childrenColumnName: {
|
|
@@ -229,6 +244,7 @@ declare const Table: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
229
244
|
x?: number | string;
|
|
230
245
|
y?: number | string;
|
|
231
246
|
};
|
|
247
|
+
ellipsis: number | boolean | TableEllipsisOptions;
|
|
232
248
|
shape: SurfaceShapeType;
|
|
233
249
|
bordered: boolean | undefined;
|
|
234
250
|
itemHeight: number;
|
|
@@ -237,7 +253,7 @@ declare const Table: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
237
253
|
childrenColumnName: string;
|
|
238
254
|
disabledKeys: TableKey[];
|
|
239
255
|
hiddenColumnKeys: string[];
|
|
240
|
-
rowKey: string;
|
|
256
|
+
rowKey: string | ((record: TableRecord) => TableKey);
|
|
241
257
|
indentSize: number;
|
|
242
258
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
243
259
|
export default Table;
|
package/types/table/types.d.ts
CHANGED
|
@@ -5,13 +5,29 @@ export interface SortState {
|
|
|
5
5
|
key: string;
|
|
6
6
|
order: null | "desc" | "asc";
|
|
7
7
|
}
|
|
8
|
+
/** 单元格省略号的细节配置,与 kui-react 的 `TableEllipsisOptions` 同一套语义。 */
|
|
9
|
+
export interface TableEllipsisOptions {
|
|
10
|
+
/** 截断到第几行,默认 `1`(单行不换行) */
|
|
11
|
+
rows?: number;
|
|
12
|
+
/**
|
|
13
|
+
* 悬停提示。默认用被截断的那段文本;传内容换成指定的提示;`false` 关掉提示。
|
|
14
|
+
* 只有真的被截断才会弹,没截断的格子不会多出气泡。
|
|
15
|
+
*/
|
|
16
|
+
tooltip?: boolean | VNodeChild;
|
|
17
|
+
}
|
|
8
18
|
export interface Column {
|
|
9
19
|
key: string;
|
|
10
20
|
title: string;
|
|
11
21
|
width?: number;
|
|
12
22
|
fixed?: "left" | "right";
|
|
13
23
|
sorter?: boolean | ((state: SortState) => void);
|
|
14
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 内容超出列宽时显示省略号。`true` 单行、数字或 `rows` 是多行,`tooltip` 定制悬停提示。
|
|
26
|
+
* 表格级 `ellipsis` 打开时,这一列写 `false` 可以单独关掉。
|
|
27
|
+
*/
|
|
28
|
+
ellipsis?: boolean | number | TableEllipsisOptions;
|
|
29
|
+
/** 参数顺序与 kui-react 版 `Column.render` 一致:value, record, rowIndex, column。 */
|
|
30
|
+
render?: (value: unknown, record: TableRecord, rowIndex: number, col: Column) => VNodeChild;
|
|
15
31
|
colSpan?: number | ((record: TableRecord, index: number) => number);
|
|
16
32
|
rowSpan?: number | ((record: TableRecord, index: number) => number);
|
|
17
33
|
children?: Column[];
|
package/types/table/utils.d.ts
CHANGED
|
@@ -1,7 +1,52 @@
|
|
|
1
1
|
import type { Column, TableKey, TableRecord, TableTreeRow } from "./types";
|
|
2
2
|
export declare const flattenColumns: (columns: Column[]) => Column[];
|
|
3
3
|
export declare const countColumnLeaves: (column: Column) => number;
|
|
4
|
+
/**
|
|
5
|
+
* 按列 `key` 从记录里取单元格值,`rowKey` 与 `childrenColumnName` 的字段名也走这同一个读取器。
|
|
6
|
+
* kui-react 与 kui-vue 的 `components/table/utils.ts` 里是逐字节相同的副本,改一边必须同步另一边,
|
|
7
|
+
* 否则同一份数据在两个框架里会渲染出不同内容、排出不同顺序。
|
|
8
|
+
*
|
|
9
|
+
* 取值规则:
|
|
10
|
+
* - 整名优先:`key` 本身就是记录上的属性时直接取它,所以字段名自带点号(`{ "a.b": 1 }`)不会被误当成路径;
|
|
11
|
+
* - 整名没命中且 `key` 含点号时按 `.` 逐段下钻,任意一段走到非对象(含 `null`)就返回 `undefined`,
|
|
12
|
+
* 所以 `{ user: null }` 配 `key="user.name"` 渲染成空而不是抛错;数字段天然能取数组元素(`"tags.0"`);
|
|
13
|
+
* - `__proto__`/`constructor`/`prototype` 这三段一律取不到值,避免列名顺着原型链摸到全局对象。
|
|
14
|
+
*/
|
|
15
|
+
export declare const getRecordValue: <T extends object>(record: T, key: string) => unknown;
|
|
4
16
|
export declare const getTreeChildren: (record: TableRecord, childrenColumnName: string) => TableRecord[];
|
|
17
|
+
/**
|
|
18
|
+
* 分组表头父列上的 `fixed` 向下继承给整棵子树。kui-react 与 kui-vue 的
|
|
19
|
+
* `components/table/utils.ts` 里是逐字节相同的副本,改一边必须同步另一边,
|
|
20
|
+
* 否则同一份列配置在两个框架里会固定出不同的列。
|
|
21
|
+
*
|
|
22
|
+
* `colgroup` 与 sticky 偏移都只按叶子列累加,所以父列上写的 `fixed` 必须落到它的每个叶子列上,
|
|
23
|
+
* 「固定整组」这种配置才不会整体失效。叶子自己显式写的 `fixed` 优先,只在没写时补继承值;
|
|
24
|
+
* 一个方向都没继承到的列返回原来的对象引用,整棵子树都没变时连数组都复用同一个引用,
|
|
25
|
+
* 免得每次渲染都给列树新建对象,把 `visibleColumns → leaves → headerInfo` 的 memo 打回原形。
|
|
26
|
+
*/
|
|
27
|
+
export declare const inheritColumnFixed: <C extends {
|
|
28
|
+
fixed?: "left" | "right";
|
|
29
|
+
children?: C[];
|
|
30
|
+
}>(columns: C[], inherited?: "left" | "right") => C[];
|
|
31
|
+
/**
|
|
32
|
+
* 表头排序的共享比较器。kui-react 与 kui-vue 的 `components/table/utils.ts` 里是逐字节相同的副本,
|
|
33
|
+
* 改一边必须同步另一边,否则同一份数据在两个框架下会排出不同顺序。
|
|
34
|
+
*
|
|
35
|
+
* 规则:
|
|
36
|
+
* - 两侧都是 number(含 `Date` 之外的数值)时按数值比较,`NaN` 排在最前;
|
|
37
|
+
* - 其余情况(字符串、数字与字符串混排、布尔、`null`/`undefined`)统一转成字符串,
|
|
38
|
+
* 用带数字感知的字典序比较,所以 `"9"` 排在 `"10"` 前面,`null`/`undefined` 视作空串。
|
|
39
|
+
*/
|
|
40
|
+
export declare const compareSortValues: (first: unknown, second: unknown) => number;
|
|
41
|
+
export declare const getSyntheticRowKey: (record: object) => string;
|
|
42
|
+
/**
|
|
43
|
+
* 解析一行的 key,kui-react 与 kui-vue 行为一致:`rowKey` 可以是字段名,也可以是取值函数;
|
|
44
|
+
* 两者都拿不到 `string`/`number` 时回退到 `getSyntheticRowKey` 生成的兜底 key。
|
|
45
|
+
*
|
|
46
|
+
* 字段名走 `getRecordValue`,所以和列 `key` 一样支持 `"user.uid"` 这种点路径。
|
|
47
|
+
* 本函数与上面的 `getSyntheticRowKey` 在两个仓库里是逐字节相同的副本,改一边必须同步另一边。
|
|
48
|
+
*/
|
|
49
|
+
export declare const resolveRowKey: <T extends object>(record: T, rowKey: string | ((record: T) => TableKey)) => TableKey;
|
|
5
50
|
interface FlattenTreeOptions {
|
|
6
51
|
data: TableRecord[];
|
|
7
52
|
childrenColumnName: string;
|
|
@@ -10,4 +55,35 @@ interface FlattenTreeOptions {
|
|
|
10
55
|
sortRecords?: (records: TableRecord[]) => TableRecord[];
|
|
11
56
|
}
|
|
12
57
|
export declare const flattenTreeData: ({ data, childrenColumnName, expandedKeys, getKey, sortRecords, }: FlattenTreeOptions) => TableTreeRow[];
|
|
58
|
+
/**
|
|
59
|
+
* `expandAllRows` 期间 `data` 异步变化时,把“数据里新出现的父行”补进展开集合,
|
|
60
|
+
* 已经在数据里的行保持用户手动展开或折叠的结果。kui-react 与 kui-vue 的
|
|
61
|
+
* `components/table/utils.ts` 里是逐字节相同的副本,改一边必须同步另一边。
|
|
62
|
+
*
|
|
63
|
+
* `knownParentKeys` 是上一次看到的数据里的父行 key 集合,`nextParentKeys` 是本次的,
|
|
64
|
+
* 所以从数据里消失又回来的父行算“新出现”、会被重新展开,两仓都不记住它曾被折叠。
|
|
65
|
+
* `changed` 只回答“展开集合要不要加新 key”:调用方每轮都要把 `nextParentKeys` 记回去,
|
|
66
|
+
* 但不能无条件写回展开状态,否则 `data` 每轮都是新数组,渲染期同步状态会直接死循环。
|
|
67
|
+
*/
|
|
68
|
+
export declare const mergeExpandAllRows: (knownParentKeys: Set<TableKey>, nextParentKeys: Set<TableKey>, expandedKeys: Set<TableKey>) => {
|
|
69
|
+
keys: Set<TableKey>;
|
|
70
|
+
changed: boolean;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* 单元格省略号配置的归一:列上写了 `ellipsis` 就以列为准,没写才跟着表格级的 `ellipsis` 走,
|
|
74
|
+
* 所以表格级全开时某一列还能用 `ellipsis: false` 单独关掉。`true` 是单行,数字是行数,
|
|
75
|
+
* 对象可以另给 `rows` 与 `tooltip`。返回 `null` 表示这一列不截断。
|
|
76
|
+
* `tooltip` 在这里只当不透明值传下去,节点类型由各自的框架决定,因此两仓的
|
|
77
|
+
* `components/table/utils.ts` 里这一段是逐字节相同的副本,改一边必须同步另一边。
|
|
78
|
+
*/
|
|
79
|
+
export declare const resolveCellEllipsis: <TooltipValue>(columnValue: boolean | number | {
|
|
80
|
+
rows?: number;
|
|
81
|
+
tooltip?: TooltipValue | false;
|
|
82
|
+
} | undefined, tableValue: boolean | number | {
|
|
83
|
+
rows?: number;
|
|
84
|
+
tooltip?: TooltipValue | false;
|
|
85
|
+
} | undefined) => {
|
|
86
|
+
rows: number;
|
|
87
|
+
tooltip?: TooltipValue | false;
|
|
88
|
+
} | null;
|
|
13
89
|
export {};
|
package/types/tag/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType } from "vue";
|
|
2
|
-
import { type BooleanType, type ColorType, type ShapeType, type SizeType, type
|
|
2
|
+
import { type BooleanType, type ColorType, type ShapeType, type SizeType, type SurfaceThemeType } from "../const/types";
|
|
3
3
|
import { type IconType } from "../icon";
|
|
4
4
|
declare const tagProps: {
|
|
5
5
|
closeable: BooleanType;
|
|
@@ -12,7 +12,7 @@ declare const tagProps: {
|
|
|
12
12
|
default: string;
|
|
13
13
|
};
|
|
14
14
|
theme: {
|
|
15
|
-
type: PropType<
|
|
15
|
+
type: PropType<SurfaceThemeType>;
|
|
16
16
|
default: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -28,7 +28,7 @@ declare const Tag: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
28
28
|
default: string;
|
|
29
29
|
};
|
|
30
30
|
theme: {
|
|
31
|
-
type: PropType<
|
|
31
|
+
type: PropType<SurfaceThemeType>;
|
|
32
32
|
default: string;
|
|
33
33
|
};
|
|
34
34
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -45,7 +45,7 @@ declare const Tag: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
45
45
|
default: string;
|
|
46
46
|
};
|
|
47
47
|
theme: {
|
|
48
|
-
type: PropType<
|
|
48
|
+
type: PropType<SurfaceThemeType>;
|
|
49
49
|
default: string;
|
|
50
50
|
};
|
|
51
51
|
}>> & Readonly<{
|
|
@@ -53,6 +53,6 @@ declare const Tag: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
53
53
|
onAfterClose?: (() => any) | undefined;
|
|
54
54
|
}>, {
|
|
55
55
|
size: SizeType;
|
|
56
|
-
theme:
|
|
56
|
+
theme: SurfaceThemeType;
|
|
57
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
58
58
|
export default Tag;
|
package/types/tooltip/index.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ declare const tooltipProps: {
|
|
|
15
15
|
type: PropType<PlacementsType>;
|
|
16
16
|
default: string;
|
|
17
17
|
};
|
|
18
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
19
|
+
destroyOnClose: {
|
|
20
|
+
type: BooleanType;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
18
23
|
panelOnly: BooleanType;
|
|
19
24
|
};
|
|
20
25
|
export type TooltipProps = ExtractPropTypes<typeof tooltipProps>;
|
|
@@ -32,6 +37,11 @@ declare const Tooltip: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
32
37
|
type: PropType<PlacementsType>;
|
|
33
38
|
default: string;
|
|
34
39
|
};
|
|
40
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
41
|
+
destroyOnClose: {
|
|
42
|
+
type: BooleanType;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
35
45
|
panelOnly: BooleanType;
|
|
36
46
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
47
|
"update:show": (show: boolean) => boolean;
|
|
@@ -49,12 +59,18 @@ declare const Tooltip: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
49
59
|
type: PropType<PlacementsType>;
|
|
50
60
|
default: string;
|
|
51
61
|
};
|
|
62
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
63
|
+
destroyOnClose: {
|
|
64
|
+
type: BooleanType;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
52
67
|
panelOnly: BooleanType;
|
|
53
68
|
}>> & Readonly<{
|
|
54
69
|
"onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
55
70
|
}>, {
|
|
56
71
|
trigger: "manual" | "hover";
|
|
57
72
|
placement: PlacementsType;
|
|
73
|
+
destroyOnClose: boolean | undefined;
|
|
58
74
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
59
75
|
export declare const TooltipPanel: ForwardedComponent<typeof Tooltip>;
|
|
60
76
|
export default Tooltip;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType, type VNodeChild } from "vue";
|
|
2
|
+
import type { SurfaceThemeType } from "../const/types";
|
|
2
3
|
export type TransferKey = string | number;
|
|
3
4
|
export interface TransferItem {
|
|
4
5
|
key: TransferKey;
|
|
@@ -33,7 +34,7 @@ declare const transferProps: {
|
|
|
33
34
|
disabled: BooleanConstructor;
|
|
34
35
|
readonly: BooleanConstructor;
|
|
35
36
|
theme: {
|
|
36
|
-
type: PropType<
|
|
37
|
+
type: PropType<SurfaceThemeType>;
|
|
37
38
|
default: string;
|
|
38
39
|
};
|
|
39
40
|
filterOption: PropType<(keyword: string, item: TransferItem) => boolean>;
|
|
@@ -67,7 +68,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
67
68
|
disabled: BooleanConstructor;
|
|
68
69
|
readonly: BooleanConstructor;
|
|
69
70
|
theme: {
|
|
70
|
-
type: PropType<
|
|
71
|
+
type: PropType<SurfaceThemeType>;
|
|
71
72
|
default: string;
|
|
72
73
|
};
|
|
73
74
|
filterOption: PropType<(keyword: string, item: TransferItem) => boolean>;
|
|
@@ -104,7 +105,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
104
105
|
disabled: BooleanConstructor;
|
|
105
106
|
readonly: BooleanConstructor;
|
|
106
107
|
theme: {
|
|
107
|
-
type: PropType<
|
|
108
|
+
type: PropType<SurfaceThemeType>;
|
|
108
109
|
default: string;
|
|
109
110
|
};
|
|
110
111
|
filterOption: PropType<(keyword: string, item: TransferItem) => boolean>;
|
|
@@ -116,7 +117,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
116
117
|
onSelectChange?: ((sourceKeys: TransferKey[], targetKeys: TransferKey[]) => any) | undefined;
|
|
117
118
|
}>, {
|
|
118
119
|
disabled: boolean;
|
|
119
|
-
theme:
|
|
120
|
+
theme: SurfaceThemeType;
|
|
120
121
|
value: TransferKey[];
|
|
121
122
|
modelValue: TransferKey[];
|
|
122
123
|
readonly: boolean;
|
package/types/tree/index.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ declare const Tree: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
93
93
|
"update:selectedKeys": (keys: string[]) => boolean;
|
|
94
94
|
expand: (result: TreeExpandEvent) => boolean;
|
|
95
95
|
check: (node: TreeNode, checked: boolean, keys: string[]) => boolean;
|
|
96
|
-
select: (node: TreeNode) => boolean;
|
|
96
|
+
select: (node: TreeNode, keys: string[]) => boolean;
|
|
97
97
|
dragstart: (node: TreeNode, event: DragEvent) => boolean;
|
|
98
98
|
dragenter: (node: TreeNode, event: DragEvent) => boolean;
|
|
99
99
|
dragleave: (node: TreeNode, event: DragEvent) => boolean;
|
|
@@ -142,7 +142,7 @@ declare const Tree: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
142
142
|
loading: BooleanType;
|
|
143
143
|
fieldNames: PropType<TreeFieldNames>;
|
|
144
144
|
}>> & Readonly<{
|
|
145
|
-
onSelect?: ((node: TreeNode) => any) | undefined;
|
|
145
|
+
onSelect?: ((node: TreeNode, keys: string[]) => any) | undefined;
|
|
146
146
|
onDragend?: ((node: TreeNode, event: DragEvent) => any) | undefined;
|
|
147
147
|
onDragenter?: ((node: TreeNode, event: DragEvent) => any) | undefined;
|
|
148
148
|
onDragleave?: ((node: TreeNode, event: DragEvent) => any) | undefined;
|
|
@@ -13,6 +13,11 @@ declare const treeSelectProps: {
|
|
|
13
13
|
type: PropType<DropPlacementsType>;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
17
|
+
destroyOnClose: {
|
|
18
|
+
type: BooleanType;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
16
21
|
width: NumberConstructor;
|
|
17
22
|
maxTagCount: NumberConstructor;
|
|
18
23
|
modelValue: PropType<TreeSelectValue>;
|
package/types/utils/color.d.ts
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
1
|
export declare function isColor(value?: string): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* `color-mix(in srgb, <colour> <share>%, transparent)` written out as a plain colour.
|
|
4
|
+
*
|
|
5
|
+
* Mixing with `transparent` in srgb only scales the colour's own alpha, so the result is the same
|
|
6
|
+
* rgb triple at `share × alpha` — a value every engine can paint, including the Electron build on
|
|
7
|
+
* Windows 7, where `color-mix()` needs Chrome 111 and a declaration that uses it simply gets no
|
|
8
|
+
* value at all.
|
|
9
|
+
*
|
|
10
|
+
* `share` is the percentage the stylesheet would have written. Colours that only resolve in the
|
|
11
|
+
* browser (`currentColor`, `var(--token)`) and anything unparseable return `undefined`, so callers
|
|
12
|
+
* keep the shade their stylesheet baked instead of shipping a broken declaration.
|
|
13
|
+
*/
|
|
14
|
+
export declare function wash(value: string | undefined, share: number): string | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 遮罩层(Modal / Drawer)的打开顺序栈:Escape 只该关掉最上面那一层,
|
|
3
|
+
* 叠着开三个窗口时一次按键不能把它们全收掉。弹层(Popup)有自己的注册表,
|
|
4
|
+
* 但两边共用同一个顺序时钟,所以"我上面还有个下拉没关"也能判出来。
|
|
5
|
+
* 两个仓库这两个文件逐字符相同。
|
|
6
|
+
*/
|
|
7
|
+
export interface OverlayHandle {
|
|
8
|
+
/** 我是不是最上面那层:没有更晚打开的遮罩层,也没有更晚打开的弹层压着我 */
|
|
9
|
+
isTop: () => boolean;
|
|
10
|
+
/** 出栈;组件关闭或卸载时必须调,否则会一直挡住下面那层的 Escape */
|
|
11
|
+
release: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function pushOverlay(): OverlayHandle;
|
package/types/utils/vnode.d.ts
CHANGED
|
@@ -5,4 +5,29 @@ export declare function cloneNodes(vnode: VNode[], props: Record<string, unknown
|
|
|
5
5
|
export declare function getChildren(VNodes?: unknown[]): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}>[];
|
|
8
|
+
/**
|
|
9
|
+
* The appearance keys a group hands down as *inherited*, minus the ones the child already states.
|
|
10
|
+
*
|
|
11
|
+
* A control picks its own look with "what was written on me, else what I inherited" — `useFormAppearance`
|
|
12
|
+
* decides that by reading `hasOwnProperty` on the control's own vnode props. A group has no injection
|
|
13
|
+
* channel of its own here: handing a tier or a size down *is* writing it on the child's vnode, and
|
|
14
|
+
* `cloneVNode(child, props, true)` overwrites the child's own value, so an unconditional patch makes the
|
|
15
|
+
* group's value look like the child wrote it and silently outranks an explicit `theme` / `size` /
|
|
16
|
+
* `shape`. Dropping the keys the child wrote is what makes this side agree with the react build, where
|
|
17
|
+
* the item reads `props ?? group ?? provider`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const inheritableAppearance: (child: VNode, values: Record<string, unknown>) => Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Whether an optional content prop deserves its wrapper element.
|
|
22
|
+
*
|
|
23
|
+
* `null` and `undefined` are the documented way to omit a slot, but callers also
|
|
24
|
+
* pass `false` (a conditional like `isAdmin && <Icon />`) or an empty string, and
|
|
25
|
+
* the framework renders `false` as nothing while still mounting the wrapper —
|
|
26
|
+
* which keeps its padding, border and flex gap in the layout with nothing inside
|
|
27
|
+
* it. Numbers count as content, including `0`.
|
|
28
|
+
*
|
|
29
|
+
* Slot output arrives as VNodes, so the vnode rules below are where this differs
|
|
30
|
+
* from the React build; the value rules above are shared.
|
|
31
|
+
*/
|
|
32
|
+
export declare function hasRenderableContent(value: unknown): boolean;
|
|
8
33
|
export declare const toggleContainerScroll: (target: HTMLElement | null, lock: boolean) => void;
|