@veltra/desktop 1.7.12 → 1.7.13
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/dist/components/batch-edit/helper.d.ts +1 -2
- package/dist/components/condition-editor/core/evaluator.d.ts +4 -5
- package/dist/components/contextmenu/api.d.ts +1 -2
- package/dist/components/contextmenu/di.d.ts +2 -3
- package/dist/components/loading/directive.d.ts +1 -2
- package/dist/components/message/message.d.ts +1 -2
- package/dist/components/message-confirm/message-confirm.d.ts +1 -2
- package/dist/components/notification/notification.d.ts +1 -2
- package/dist/components/table/node/col.js +19 -0
- package/dist/components/table/node/col.js.map +1 -1
- package/dist/components/table/table-cell.js +2 -0
- package/dist/components/table/table-cell.js.map +1 -1
- package/dist/components/table/table-foot.js +2 -0
- package/dist/components/table/table-foot.js.map +1 -1
- package/dist/components/table/table-head.js +1 -0
- package/dist/components/table/table-head.js.map +1 -1
- package/dist/components/table/table-row.js +2 -0
- package/dist/components/table/table-row.js.map +1 -1
- package/dist/components/table/use-columns.d.ts +1 -2
- package/dist/index.d.ts +2 -2
- package/dist/install.d.ts +3 -3
- package/dist/types/action.d.ts +7 -8
- package/dist/types/animation.d.ts +4 -5
- package/dist/types/auto-complete.d.ts +4 -5
- package/dist/types/badge.d.ts +4 -5
- package/dist/types/batch-edit.d.ts +9 -10
- package/dist/types/breadcrumb.d.ts +6 -7
- package/dist/types/button.d.ts +5 -6
- package/dist/types/calendar.d.ts +7 -8
- package/dist/types/card.d.ts +7 -8
- package/dist/types/cascade.d.ts +6 -7
- package/dist/types/check-tag.d.ts +4 -5
- package/dist/types/checkbox-group.d.ts +3 -4
- package/dist/types/checkbox.d.ts +5 -6
- package/dist/types/code-editor.d.ts +5 -6
- package/dist/types/collapse.d.ts +6 -7
- package/dist/types/condition-editor.d.ts +11 -12
- package/dist/types/contextmenu.d.ts +5 -6
- package/dist/types/css-transition.d.ts +4 -5
- package/dist/types/date-panel.d.ts +3 -4
- package/dist/types/date-picker.d.ts +5 -6
- package/dist/types/date-range-picker.d.ts +6 -7
- package/dist/types/dialog.d.ts +5 -6
- package/dist/types/drawer.d.ts +6 -7
- package/dist/types/dropdown.d.ts +4 -5
- package/dist/types/dual-nav.d.ts +6 -7
- package/dist/types/empty.d.ts +4 -5
- package/dist/types/expression-editor.d.ts +6 -7
- package/dist/types/file-picker.d.ts +4 -5
- package/dist/types/file-viewer.d.ts +6 -7
- package/dist/types/float-button.d.ts +5 -6
- package/dist/types/form-item.d.ts +3 -4
- package/dist/types/form.d.ts +4 -5
- package/dist/types/gantt-chart.d.ts +4 -5
- package/dist/types/grid-input.d.ts +4 -5
- package/dist/types/grid.d.ts +7 -8
- package/dist/types/group-input.d.ts +4 -5
- package/dist/types/group-nav.d.ts +3 -4
- package/dist/types/icon.d.ts +3 -4
- package/dist/types/image-cropper.d.ts +9 -10
- package/dist/types/index.d.ts +2 -2
- package/dist/types/input.d.ts +4 -5
- package/dist/types/layout.d.ts +4 -5
- package/dist/types/list.d.ts +4 -5
- package/dist/types/loading.d.ts +5 -6
- package/dist/types/message-confirm.d.ts +8 -9
- package/dist/types/message.d.ts +8 -9
- package/dist/types/multi-auto-complete.d.ts +4 -5
- package/dist/types/multi-select.d.ts +4 -5
- package/dist/types/multi-tree-select.d.ts +4 -5
- package/dist/types/nav.d.ts +5 -6
- package/dist/types/node-render.d.ts +2 -3
- package/dist/types/notification.d.ts +8 -9
- package/dist/types/number-input.d.ts +3 -4
- package/dist/types/number-range-input.d.ts +4 -5
- package/dist/types/number.d.ts +3 -4
- package/dist/types/paginator.d.ts +4 -5
- package/dist/types/palette.d.ts +7 -8
- package/dist/types/password-input.d.ts +4 -5
- package/dist/types/pop-confirm.d.ts +4 -5
- package/dist/types/pop.d.ts +4 -5
- package/dist/types/progress-nodes.d.ts +4 -5
- package/dist/types/progress.d.ts +4 -5
- package/dist/types/quick-batch-edit.d.ts +4 -5
- package/dist/types/radio-group.d.ts +4 -5
- package/dist/types/radio.d.ts +4 -5
- package/dist/types/rich-text-editor.d.ts +6 -7
- package/dist/types/scroll.d.ts +5 -6
- package/dist/types/segment.d.ts +5 -6
- package/dist/types/select.d.ts +4 -5
- package/dist/types/slider.d.ts +4 -5
- package/dist/types/steps.d.ts +5 -6
- package/dist/types/switch.d.ts +4 -5
- package/dist/types/table-editor.d.ts +4 -5
- package/dist/types/table.d.ts +23 -13
- package/dist/types/tabs.d.ts +13 -14
- package/dist/types/tag.d.ts +3 -4
- package/dist/types/text-editor.d.ts +5 -6
- package/dist/types/text.d.ts +4 -5
- package/dist/types/textarea.d.ts +4 -5
- package/dist/types/theme.d.ts +3 -4
- package/dist/types/tip.d.ts +6 -7
- package/dist/types/tree-select.d.ts +4 -5
- package/dist/types/tree.d.ts +6 -6
- package/dist/types/watermark.d.ts +4 -5
- package/package.json +5 -5
- package/src/components/table/__test__/column-style.test.ts +67 -0
- package/src/components/table/node/col.ts +30 -1
- package/src/components/table/table-cell.vue +7 -2
- package/src/components/table/table-foot.vue +2 -0
- package/src/components/table/table-head.tsx +1 -0
- package/src/components/table/table-row.tsx +2 -0
- package/src/types/table.ts +12 -0
|
@@ -6,7 +6,6 @@ import "../../types/index.js";
|
|
|
6
6
|
* @param columns 列
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
declare function defineBatchEditColumns(columns: BatchEditColumn[]): BatchEditColumn[];
|
|
9
|
+
export declare function defineBatchEditColumns(columns: BatchEditColumn[]): BatchEditColumn[];
|
|
10
10
|
//#endregion
|
|
11
|
-
export { defineBatchEditColumns };
|
|
12
11
|
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf } from "../../../types/condition-editor.js";
|
|
2
2
|
import "../../../types/index.js";
|
|
3
3
|
//#region src/components/condition-editor/core/evaluator.d.ts
|
|
4
|
-
interface EvaluateOptions {
|
|
4
|
+
export interface EvaluateOptions {
|
|
5
5
|
/** 字段定义 —— 提供后按字段类型做类型感知比较 */
|
|
6
6
|
fields?: ConditionField[];
|
|
7
7
|
/** 上下文数据,用于解析 `kind: 'variable'` 引用 */
|
|
@@ -15,9 +15,8 @@ interface EvaluateOptions {
|
|
|
15
15
|
* - 不完整的叶子(field/operator 缺失、或缺少所需值且 operator 需要值)按 `false` 计
|
|
16
16
|
* - 同组内 AND/OR 按 **从左到右、等优先级** 求值;需要更高优先级请用子分组
|
|
17
17
|
*/
|
|
18
|
-
declare function evaluate(expression: ConditionExpression, options?: EvaluateOptions): boolean;
|
|
19
|
-
declare function createEmptyGroup(): ConditionGroup;
|
|
20
|
-
declare function createEmptyLeaf(): ConditionLeaf;
|
|
18
|
+
export declare function evaluate(expression: ConditionExpression, options?: EvaluateOptions): boolean;
|
|
19
|
+
export declare function createEmptyGroup(): ConditionGroup;
|
|
20
|
+
export declare function createEmptyLeaf(): ConditionLeaf;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { EvaluateOptions, createEmptyGroup, createEmptyLeaf, evaluate };
|
|
23
22
|
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ContextmenuProps } from "../../types/contextmenu.js";
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
//#region src/components/contextmenu/api.d.ts
|
|
4
|
-
declare const contextmenu: {
|
|
4
|
+
export declare const contextmenu: {
|
|
5
5
|
pop(options: ContextmenuProps): void;
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
8
|
-
export { contextmenu };
|
|
9
8
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ComputedRef, InjectionKey } from "vue";
|
|
2
2
|
import { BEM } from "@veltra/utils";
|
|
3
3
|
//#region src/components/contextmenu/di.d.ts
|
|
4
|
-
declare const ContextmenuRootDIKey: InjectionKey<{
|
|
4
|
+
export declare const ContextmenuRootDIKey: InjectionKey<{
|
|
5
5
|
cls: BEM<'contextmenu'>;
|
|
6
6
|
onItemClickStart: () => void;
|
|
7
7
|
onItemClickEnd: () => void;
|
|
8
8
|
}>;
|
|
9
|
-
declare const ContextmenuPanelDIKey: InjectionKey<{
|
|
9
|
+
export declare const ContextmenuPanelDIKey: InjectionKey<{
|
|
10
10
|
showIconColumn: ComputedRef<boolean>;
|
|
11
11
|
showArrowColumn: ComputedRef<boolean>;
|
|
12
12
|
}>;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { ContextmenuPanelDIKey, ContextmenuRootDIKey };
|
|
15
14
|
//# sourceMappingURL=di.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ObjectDirective } from "vue";
|
|
2
2
|
//#region src/components/loading/directive.d.ts
|
|
3
|
-
declare const vLoading: ObjectDirective<HTMLElement>;
|
|
3
|
+
export declare const vLoading: ObjectDirective<HTMLElement>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { vLoading };
|
|
6
5
|
//# sourceMappingURL=directive.d.ts.map
|
|
@@ -2,7 +2,6 @@ import { Message } from "../../types/message.js";
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
//#region src/components/message/message.d.ts
|
|
4
4
|
/** --- 导出 API --- */
|
|
5
|
-
declare const message: Message;
|
|
5
|
+
export declare const message: Message;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { message };
|
|
8
7
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -2,7 +2,6 @@ import { MessageConfirm } from "../../types/message-confirm.js";
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
//#region src/components/message-confirm/message-confirm.d.ts
|
|
4
4
|
/** --- 导出 API --- */
|
|
5
|
-
declare const messageConfirm: MessageConfirm;
|
|
5
|
+
export declare const messageConfirm: MessageConfirm;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { messageConfirm };
|
|
8
7
|
//# sourceMappingURL=message-confirm.d.ts.map
|
|
@@ -2,7 +2,6 @@ import { Notification } from "../../types/notification.js";
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
//#region src/components/notification/notification.d.ts
|
|
4
4
|
/** --- 导出 API --- */
|
|
5
|
-
declare const notification: Notification;
|
|
5
|
+
export declare const notification: Notification;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { notification };
|
|
8
7
|
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { isReactive, reactive, shallowReactive } from "vue";
|
|
2
|
+
import { withUnit } from "@veltra/utils";
|
|
2
3
|
import { TreeNode } from "@cat-kit/core";
|
|
3
4
|
//#region src/components/table/node/col.ts
|
|
5
|
+
function normalizeColumnStyle(style) {
|
|
6
|
+
if (!style) return void 0;
|
|
7
|
+
const result = {};
|
|
8
|
+
if (style.color !== void 0) result.color = style.color;
|
|
9
|
+
if (style.fontSize !== void 0) {
|
|
10
|
+
const fontSize = withUnit(style.fontSize, "px");
|
|
11
|
+
if (fontSize !== void 0) result.fontSize = fontSize;
|
|
12
|
+
}
|
|
13
|
+
return Object.keys(result).length ? result : void 0;
|
|
14
|
+
}
|
|
4
15
|
var ColumnNode = class extends TreeNode {
|
|
5
16
|
/** 叶子节点数量 */
|
|
6
17
|
leafs;
|
|
@@ -35,6 +46,14 @@ var ColumnNode = class extends TreeNode {
|
|
|
35
46
|
set headerAlign(val) {
|
|
36
47
|
this.data.headerAlign = val;
|
|
37
48
|
}
|
|
49
|
+
/** 表体/表尾单元格样式 */
|
|
50
|
+
get cellStyle() {
|
|
51
|
+
return normalizeColumnStyle(this.data.style);
|
|
52
|
+
}
|
|
53
|
+
/** 表头单元格样式 */
|
|
54
|
+
get headerCellStyle() {
|
|
55
|
+
return normalizeColumnStyle(this.data.headerStyle ?? this.data.style);
|
|
56
|
+
}
|
|
38
57
|
/** 宽度 */
|
|
39
58
|
get width() {
|
|
40
59
|
const width = this.data.width ?? this.derived.allocatedWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"col.js","names":[],"sources":["../../../../src/components/table/node/col.ts"],"sourcesContent":["import { TreeNode } from '@cat-kit/core'\nimport { isReactive, reactive, shallowReactive } from 'vue'\n\nimport type { TableColumn, TableColumnAlign } from '../../../types'\n\nexport class ColumnNode extends TreeNode<TableColumn, ColumnNode> {\n declare children?: ColumnNode[] | undefined\n declare parent?: ColumnNode\n /** 叶子节点数量 */\n leafs?: number\n\n nextNode: ColumnNode | null = null\n\n /** 列key */\n get key(): string {\n return this.data.key\n }\n set key(val) {\n this.data.key = val\n }\n /** 列名 */\n get name(): string {\n return this.data.name\n }\n set name(val) {\n this.data.name = val\n }\n\n /**\n * 列对齐方式\n * @default 'left'\n */\n get align(): TableColumnAlign {\n return this.data.align ?? 'left'\n }\n set align(val) {\n this.data.align = val\n }\n\n get headerAlign(): TableColumnAlign {\n return this.data.headerAlign ?? this.align\n }\n set headerAlign(val) {\n this.data.headerAlign = val\n }\n\n /** 宽度 */\n get width(): number | undefined {\n const width = this.data.width ?? this.derived.allocatedWidth\n if (!width || (this.minWidth && width && width < this.minWidth)) {\n return this.minWidth\n }\n return width\n }\n set width(val) {\n if (this.minWidth && val && val < this.minWidth) {\n val = this.minWidth\n }\n this.data.width = val\n // 显式宽度(配置/拖拽)优先于分配宽度,旧的分配结果直接作废\n this.derived.allocatedWidth = undefined\n }\n\n /**\n * 列宽分配算法写入的宽度。\n * 与用户列配置 `data.width` 隔离:分配结果不回写列配置对象,\n * 避免列森林重建(重挂载 / v-if / columns 引用变化)时把上一次的\n * 分配残留误判为显式 width,导致列宽被永久锁定、容器变窄后出现滚动条。\n */\n get allocatedWidth(): number | undefined {\n return this.derived.allocatedWidth\n }\n set allocatedWidth(val: number | undefined) {\n this.derived.allocatedWidth = val\n }\n /** 最小宽度 */\n get minWidth(): number | undefined {\n const minWidth = this.data.minWidth\n if (!minWidth && this.isLeaf) {\n return 100\n }\n return minWidth\n }\n set minWidth(val) {\n this.data.minWidth = val\n }\n\n /** 列固定方向 */\n get fixed(): 'left' | 'right' | undefined {\n if (this.depth > 0) return\n return this.data.fixed\n }\n set fixed(val) {\n this.data.fixed = val\n }\n\n /** 是否是左侧的最后一个固定列 */\n get isLastFixed(): boolean {\n return this.data.isLastFixed ?? false\n }\n\n /** 是否是右侧的第一个固定列 */\n get isFirstFixed(): boolean {\n return this.data.isFirstFixed ?? false\n }\n\n /** 是否是可调整宽度的列 */\n get resizable(): boolean {\n return this.data.resizable ?? true\n }\n\n /**\n * 是否在列配置上显式指定了 width,或经表头拖拽锁定。\n * 此类列不参与剩余宽度的均分。\n */\n explicitWidth: boolean\n\n style: Record<string, number> = reactive({})\n\n /** 派生状态(响应式),与用户列配置 data 隔离 */\n private readonly derived = shallowReactive<{ allocatedWidth?: number }>({\n allocatedWidth: undefined\n })\n\n constructor(val: TableColumn, index: number, depth: number, parent?: ColumnNode) {\n super(isReactive(val) ? val : shallowReactive(val), index, depth, parent)\n this.explicitWidth = val.width !== undefined\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"col.js","names":[],"sources":["../../../../src/components/table/node/col.ts"],"sourcesContent":["import { TreeNode } from '@cat-kit/core'\nimport { withUnit } from '@veltra/utils'\nimport { isReactive, reactive, shallowReactive } from 'vue'\n\nimport type { TableColumn, TableColumnAlign, TableColumnStyle } from '../../../types'\n\nfunction normalizeColumnStyle(style?: TableColumnStyle): Record<string, string> | undefined {\n if (!style) return undefined\n\n const result: Record<string, string> = {}\n\n if (style.color !== undefined) {\n result.color = style.color\n }\n if (style.fontSize !== undefined) {\n const fontSize = withUnit(style.fontSize, 'px')\n if (fontSize !== undefined) {\n result.fontSize = fontSize\n }\n }\n\n return Object.keys(result).length ? result : undefined\n}\n\nexport class ColumnNode extends TreeNode<TableColumn, ColumnNode> {\n declare children?: ColumnNode[] | undefined\n declare parent?: ColumnNode\n /** 叶子节点数量 */\n leafs?: number\n\n nextNode: ColumnNode | null = null\n\n /** 列key */\n get key(): string {\n return this.data.key\n }\n set key(val) {\n this.data.key = val\n }\n /** 列名 */\n get name(): string {\n return this.data.name\n }\n set name(val) {\n this.data.name = val\n }\n\n /**\n * 列对齐方式\n * @default 'left'\n */\n get align(): TableColumnAlign {\n return this.data.align ?? 'left'\n }\n set align(val) {\n this.data.align = val\n }\n\n get headerAlign(): TableColumnAlign {\n return this.data.headerAlign ?? this.align\n }\n set headerAlign(val) {\n this.data.headerAlign = val\n }\n\n /** 表体/表尾单元格样式 */\n get cellStyle(): Record<string, string> | undefined {\n return normalizeColumnStyle(this.data.style)\n }\n\n /** 表头单元格样式 */\n get headerCellStyle(): Record<string, string> | undefined {\n return normalizeColumnStyle(this.data.headerStyle ?? this.data.style)\n }\n\n /** 宽度 */\n get width(): number | undefined {\n const width = this.data.width ?? this.derived.allocatedWidth\n if (!width || (this.minWidth && width && width < this.minWidth)) {\n return this.minWidth\n }\n return width\n }\n set width(val) {\n if (this.minWidth && val && val < this.minWidth) {\n val = this.minWidth\n }\n this.data.width = val\n // 显式宽度(配置/拖拽)优先于分配宽度,旧的分配结果直接作废\n this.derived.allocatedWidth = undefined\n }\n\n /**\n * 列宽分配算法写入的宽度。\n * 与用户列配置 `data.width` 隔离:分配结果不回写列配置对象,\n * 避免列森林重建(重挂载 / v-if / columns 引用变化)时把上一次的\n * 分配残留误判为显式 width,导致列宽被永久锁定、容器变窄后出现滚动条。\n */\n get allocatedWidth(): number | undefined {\n return this.derived.allocatedWidth\n }\n set allocatedWidth(val: number | undefined) {\n this.derived.allocatedWidth = val\n }\n /** 最小宽度 */\n get minWidth(): number | undefined {\n const minWidth = this.data.minWidth\n if (!minWidth && this.isLeaf) {\n return 100\n }\n return minWidth\n }\n set minWidth(val) {\n this.data.minWidth = val\n }\n\n /** 列固定方向 */\n get fixed(): 'left' | 'right' | undefined {\n if (this.depth > 0) return\n return this.data.fixed\n }\n set fixed(val) {\n this.data.fixed = val\n }\n\n /** 是否是左侧的最后一个固定列 */\n get isLastFixed(): boolean {\n return this.data.isLastFixed ?? false\n }\n\n /** 是否是右侧的第一个固定列 */\n get isFirstFixed(): boolean {\n return this.data.isFirstFixed ?? false\n }\n\n /** 是否是可调整宽度的列 */\n get resizable(): boolean {\n return this.data.resizable ?? true\n }\n\n /**\n * 是否在列配置上显式指定了 width,或经表头拖拽锁定。\n * 此类列不参与剩余宽度的均分。\n */\n explicitWidth: boolean\n\n style: Record<string, number> = reactive({})\n\n /** 派生状态(响应式),与用户列配置 data 隔离 */\n private readonly derived = shallowReactive<{ allocatedWidth?: number }>({\n allocatedWidth: undefined\n })\n\n constructor(val: TableColumn, index: number, depth: number, parent?: ColumnNode) {\n super(isReactive(val) ? val : shallowReactive(val), index, depth, parent)\n this.explicitWidth = val.width !== undefined\n }\n}\n"],"mappings":";;;;AAMA,SAAS,qBAAqB,OAA8D;CAC1F,IAAI,CAAC,OAAO,OAAO,KAAA;CAEnB,MAAM,SAAiC,CAAC;CAExC,IAAI,MAAM,UAAU,KAAA,GAClB,OAAO,QAAQ,MAAM;CAEvB,IAAI,MAAM,aAAa,KAAA,GAAW;EAChC,MAAM,WAAW,SAAS,MAAM,UAAU,IAAI;EAC9C,IAAI,aAAa,KAAA,GACf,OAAO,WAAW;CAEtB;CAEA,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,SAAS,KAAA;AAC/C;AAEA,IAAa,aAAb,cAAgC,SAAkC;;CAIhE;CAEA,WAA8B;;CAG9B,IAAI,MAAc;EAChB,OAAO,KAAK,KAAK;CACnB;CACA,IAAI,IAAI,KAAK;EACX,KAAK,KAAK,MAAM;CAClB;;CAEA,IAAI,OAAe;EACjB,OAAO,KAAK,KAAK;CACnB;CACA,IAAI,KAAK,KAAK;EACZ,KAAK,KAAK,OAAO;CACnB;;;;;CAMA,IAAI,QAA0B;EAC5B,OAAO,KAAK,KAAK,SAAS;CAC5B;CACA,IAAI,MAAM,KAAK;EACb,KAAK,KAAK,QAAQ;CACpB;CAEA,IAAI,cAAgC;EAClC,OAAO,KAAK,KAAK,eAAe,KAAK;CACvC;CACA,IAAI,YAAY,KAAK;EACnB,KAAK,KAAK,cAAc;CAC1B;;CAGA,IAAI,YAAgD;EAClD,OAAO,qBAAqB,KAAK,KAAK,KAAK;CAC7C;;CAGA,IAAI,kBAAsD;EACxD,OAAO,qBAAqB,KAAK,KAAK,eAAe,KAAK,KAAK,KAAK;CACtE;;CAGA,IAAI,QAA4B;EAC9B,MAAM,QAAQ,KAAK,KAAK,SAAS,KAAK,QAAQ;EAC9C,IAAI,CAAC,SAAU,KAAK,YAAY,SAAS,QAAQ,KAAK,UACpD,OAAO,KAAK;EAEd,OAAO;CACT;CACA,IAAI,MAAM,KAAK;EACb,IAAI,KAAK,YAAY,OAAO,MAAM,KAAK,UACrC,MAAM,KAAK;EAEb,KAAK,KAAK,QAAQ;EAElB,KAAK,QAAQ,iBAAiB,KAAA;CAChC;;;;;;;CAQA,IAAI,iBAAqC;EACvC,OAAO,KAAK,QAAQ;CACtB;CACA,IAAI,eAAe,KAAyB;EAC1C,KAAK,QAAQ,iBAAiB;CAChC;;CAEA,IAAI,WAA+B;EACjC,MAAM,WAAW,KAAK,KAAK;EAC3B,IAAI,CAAC,YAAY,KAAK,QACpB,OAAO;EAET,OAAO;CACT;CACA,IAAI,SAAS,KAAK;EAChB,KAAK,KAAK,WAAW;CACvB;;CAGA,IAAI,QAAsC;EACxC,IAAI,KAAK,QAAQ,GAAG;EACpB,OAAO,KAAK,KAAK;CACnB;CACA,IAAI,MAAM,KAAK;EACb,KAAK,KAAK,QAAQ;CACpB;;CAGA,IAAI,cAAuB;EACzB,OAAO,KAAK,KAAK,eAAe;CAClC;;CAGA,IAAI,eAAwB;EAC1B,OAAO,KAAK,KAAK,gBAAgB;CACnC;;CAGA,IAAI,YAAqB;EACvB,OAAO,KAAK,KAAK,aAAa;CAChC;;;;;CAMA;CAEA,QAAgC,SAAS,CAAC,CAAC;;CAG3C,UAA2B,gBAA6C,EACtE,gBAAgB,KAAA,EAClB,CAAC;CAED,YAAY,KAAkB,OAAe,OAAe,QAAqB;EAC/E,MAAM,WAAW,GAAG,IAAI,MAAM,gBAAgB,GAAG,GAAG,OAAO,OAAO,MAAM;EACxE,KAAK,gBAAgB,IAAI,UAAU,KAAA;CACrC;AACF"}
|
|
@@ -9,6 +9,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
9
9
|
cellClass: {},
|
|
10
10
|
left: {},
|
|
11
11
|
right: {},
|
|
12
|
+
cellStyle: {},
|
|
12
13
|
rowspan: {},
|
|
13
14
|
colspan: {}
|
|
14
15
|
},
|
|
@@ -22,6 +23,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
22
23
|
* 这里变成「完全受控」的纯渲染单元。
|
|
23
24
|
*/
|
|
24
25
|
const style = computed(() => ({
|
|
26
|
+
...__props.cellStyle,
|
|
25
27
|
left: withUnit(__props.left, "px"),
|
|
26
28
|
right: withUnit(__props.right, "px")
|
|
27
29
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-cell.js","names":[],"sources":["../../../src/components/table/table-cell.vue"],"sourcesContent":["<template>\n <td\n :class=\"cellClass\"\n :style=\"style\"\n :rowspan=\"rowspan\"\n :colspan=\"colspan\"\n v-if=\"rowspan !== 0 && colspan !== 0\"\n >\n <slot />\n </td>\n</template>\n\n<script lang=\"ts\" setup>\nimport { withUnit } from '@veltra/utils'\nimport { computed } from 'vue'\n\ndefineOptions({ name: 'UTableCell' })\n\n/**\n * B2: TableCell 去 inject 化。\n *\n * 原先每个可见单元格都会执行 `inject(TableDIKey)` 并在模板中调用 `getCellClass(column)`,\n * 在 30 列场景下每次滚动每行产生 30 次 inject / 30 次类名拼接。\n * 父组件 `TableRow` 已经持有注入上下文,直接把 `cellClass` 传下来即可;\n * 这里变成「完全受控」的纯渲染单元。\n */\nconst { left, right } = defineProps<{\n cellClass: string\n left?: number\n right?: number\n rowspan?: number\n colspan?: number\n}>()\n\nconst style = computed(() => ({
|
|
1
|
+
{"version":3,"file":"table-cell.js","names":[],"sources":["../../../src/components/table/table-cell.vue"],"sourcesContent":["<template>\n <td\n :class=\"cellClass\"\n :style=\"style\"\n :rowspan=\"rowspan\"\n :colspan=\"colspan\"\n v-if=\"rowspan !== 0 && colspan !== 0\"\n >\n <slot />\n </td>\n</template>\n\n<script lang=\"ts\" setup>\nimport { withUnit } from '@veltra/utils'\nimport { computed } from 'vue'\n\ndefineOptions({ name: 'UTableCell' })\n\n/**\n * B2: TableCell 去 inject 化。\n *\n * 原先每个可见单元格都会执行 `inject(TableDIKey)` 并在模板中调用 `getCellClass(column)`,\n * 在 30 列场景下每次滚动每行产生 30 次 inject / 30 次类名拼接。\n * 父组件 `TableRow` 已经持有注入上下文,直接把 `cellClass` 传下来即可;\n * 这里变成「完全受控」的纯渲染单元。\n */\nconst { left, right, cellStyle } = defineProps<{\n cellClass: string\n left?: number\n right?: number\n cellStyle?: Record<string, string>\n rowspan?: number\n colspan?: number\n}>()\n\nconst style = computed(() => ({\n ...cellStyle,\n left: withUnit(left, 'px'),\n right: withUnit(right, 'px')\n}))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAmCA,MAAM,QAAQ,gBAAgB;GAC5B,GAAG,QAAA;GACH,MAAM,SAAS,QAAA,MAAM,IAAI;GACzB,OAAO,SAAS,QAAA,OAAO,IAAI;EAC7B,EAAE;;GAjCQ,OAAA,QAAA,YAAO,KAAU,QAAA,YAAO,KALhC,UAAA,GAAA,mBAQK,MAAA;;IAPF,OAAK,eAAE,QAAA,SAAS;IAChB,OAAK,eAAE,MAAA,KAAK;IACZ,SAAS,QAAA;IACT,SAAS,QAAA;GAGV,GAAA,CAAA,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,IAAA,UAAA,KAAA,mBAAA,QAAA,IAAA"}
|
|
@@ -53,6 +53,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
53
53
|
key: 0,
|
|
54
54
|
class: normalizeClass(unref(getCellClass)(unref(leafColumns)[0])),
|
|
55
55
|
style: normalizeStyle({
|
|
56
|
+
...unref(leafColumns)[0].cellStyle,
|
|
56
57
|
right: unref(withUnit)(unref(leafColumns)[0].style.right, "px"),
|
|
57
58
|
left: unref(withUnit)(unref(leafColumns)[0].style.left, "px")
|
|
58
59
|
})
|
|
@@ -61,6 +62,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
61
62
|
class: normalizeClass(unref(getCellClass)(column)),
|
|
62
63
|
key: column.key,
|
|
63
64
|
style: normalizeStyle({
|
|
65
|
+
...column.cellStyle,
|
|
64
66
|
right: unref(withUnit)(column.style.right, "px"),
|
|
65
67
|
left: unref(withUnit)(column.style.left, "px")
|
|
66
68
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-foot.js","names":[],"sources":["../../../src/components/table/table-foot.vue"],"sourcesContent":["<template>\n <tfoot v-if=\"tableSlots.foot || showSummary\" :class=\"cls.e('foot')\">\n <tr v-if=\"showSummary\">\n <td\n v-if=\"leafColumns[0]\"\n :class=\"getCellClass(leafColumns[0])\"\n :style=\"{\n right: withUnit(leafColumns[0].style.right, 'px'),\n left: withUnit(leafColumns[0].style.left, 'px')\n }\"\n >\n 合计:\n </td>\n <td\n v-for=\"column of leafColumns.slice(1)\"\n :class=\"getCellClass(column)\"\n :key=\"column.key\"\n :style=\"{\n right: withUnit(column.style.right, 'px'),\n left: withUnit(column.style.left, 'px')\n }\"\n >\n <u-node-render :content=\"getColumnSummaryNode(column)\" />\n </td>\n </tr>\n <slot />\n </tfoot>\n</template>\n\n<script lang=\"ts\" setup>\nimport { $n } from '@cat-kit/core'\nimport { withUnit, type RenderReturn } from '@veltra/utils'\nimport { computed, inject } from 'vue'\n\nimport { UNodeRender } from '../node-render'\nimport { TableDIKey } from './di'\nimport type { ColumnNode } from './node/col'\n\ndefineOptions({ name: 'UTableFoot' })\n\nconst { cls, columnConfig, rows, checkedRows, tableSlots, getCellClass } = inject(TableDIKey)!\n\nconst { leafColumns } = columnConfig\n\nconst showSummary = computed(() => {\n return leafColumns.value.some((col) => !!col.data.summary)\n})\n\nfunction computeSummary(key: string) {\n let sum = 0\n let i = 0\n\n while (i < rows.value.length) {\n sum = $n.plus(sum, rows.value[i]!.data[key] ?? 0)\n if (isNaN(sum)) return sum\n i++\n }\n\n return sum\n}\n\nconst summaryRow = computed<Record<string, any>>(() => {\n return leafColumns.value.reduce((acc, column) => {\n if (column.data.summary) {\n acc[column.key] = computeSummary(column.key)\n }\n return acc\n }, {})\n})\n\nfunction getColumnSummaryNode(column: ColumnNode): RenderReturn {\n const { summary } = column.data\n\n if (!summary) return null\n\n let total = summaryRow.value[column.key]\n\n if (typeof summary === 'function') {\n return summary({ total, rows: rows.value, checkedRows: checkedRows.value, column })\n }\n return total\n}\n\ndefineExpose({\n getSummaryRow(): Record<string, any> {\n return summaryRow.value\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"table-foot.js","names":[],"sources":["../../../src/components/table/table-foot.vue"],"sourcesContent":["<template>\n <tfoot v-if=\"tableSlots.foot || showSummary\" :class=\"cls.e('foot')\">\n <tr v-if=\"showSummary\">\n <td\n v-if=\"leafColumns[0]\"\n :class=\"getCellClass(leafColumns[0])\"\n :style=\"{\n ...leafColumns[0].cellStyle,\n right: withUnit(leafColumns[0].style.right, 'px'),\n left: withUnit(leafColumns[0].style.left, 'px')\n }\"\n >\n 合计:\n </td>\n <td\n v-for=\"column of leafColumns.slice(1)\"\n :class=\"getCellClass(column)\"\n :key=\"column.key\"\n :style=\"{\n ...column.cellStyle,\n right: withUnit(column.style.right, 'px'),\n left: withUnit(column.style.left, 'px')\n }\"\n >\n <u-node-render :content=\"getColumnSummaryNode(column)\" />\n </td>\n </tr>\n <slot />\n </tfoot>\n</template>\n\n<script lang=\"ts\" setup>\nimport { $n } from '@cat-kit/core'\nimport { withUnit, type RenderReturn } from '@veltra/utils'\nimport { computed, inject } from 'vue'\n\nimport { UNodeRender } from '../node-render'\nimport { TableDIKey } from './di'\nimport type { ColumnNode } from './node/col'\n\ndefineOptions({ name: 'UTableFoot' })\n\nconst { cls, columnConfig, rows, checkedRows, tableSlots, getCellClass } = inject(TableDIKey)!\n\nconst { leafColumns } = columnConfig\n\nconst showSummary = computed(() => {\n return leafColumns.value.some((col) => !!col.data.summary)\n})\n\nfunction computeSummary(key: string) {\n let sum = 0\n let i = 0\n\n while (i < rows.value.length) {\n sum = $n.plus(sum, rows.value[i]!.data[key] ?? 0)\n if (isNaN(sum)) return sum\n i++\n }\n\n return sum\n}\n\nconst summaryRow = computed<Record<string, any>>(() => {\n return leafColumns.value.reduce((acc, column) => {\n if (column.data.summary) {\n acc[column.key] = computeSummary(column.key)\n }\n return acc\n }, {})\n})\n\nfunction getColumnSummaryNode(column: ColumnNode): RenderReturn {\n const { summary } = column.data\n\n if (!summary) return null\n\n let total = summaryRow.value[column.key]\n\n if (typeof summary === 'function') {\n return summary({ total, rows: rows.value, checkedRows: checkedRows.value, column })\n }\n return total\n}\n\ndefineExpose({\n getSummaryRow(): Record<string, any> {\n return summaryRow.value\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;EA0CA,MAAM,EAAE,KAAK,cAAc,MAAM,aAAa,YAAY,iBAAiB,OAAO,UAAU;EAE5F,MAAM,EAAE,gBAAgB;EAExB,MAAM,cAAc,eAAe;GACjC,OAAO,YAAY,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,KAAK,OAAO;EAC3D,CAAC;EAED,SAAS,eAAe,KAAa;GACnC,IAAI,MAAM;GACV,IAAI,IAAI;GAER,OAAO,IAAI,KAAK,MAAM,QAAQ;IAC5B,MAAM,GAAG,KAAK,KAAK,KAAK,MAAM,EAAE,CAAE,KAAK,QAAQ,CAAC;IAChD,IAAI,MAAM,GAAG,GAAG,OAAO;IACvB;GACF;GAEA,OAAO;EACT;EAEA,MAAM,aAAa,eAAoC;GACrD,OAAO,YAAY,MAAM,QAAQ,KAAK,WAAW;IAC/C,IAAI,OAAO,KAAK,SACd,IAAI,OAAO,OAAO,eAAe,OAAO,GAAG;IAE7C,OAAO;GACT,GAAG,CAAC,CAAC;EACP,CAAC;EAED,SAAS,qBAAqB,QAAkC;GAC9D,MAAM,EAAE,YAAY,OAAO;GAE3B,IAAI,CAAC,SAAS,OAAO;GAErB,IAAI,QAAQ,WAAW,MAAM,OAAO;GAEpC,IAAI,OAAO,YAAY,YACrB,OAAO,QAAQ;IAAE;IAAO,MAAM,KAAK;IAAO,aAAa,YAAY;IAAO;GAAO,CAAC;GAEpF,OAAO;EACT;EAEA,SAAa,EACX,gBAAqC;GACnC,OAAO,WAAW;EACpB,EACF,CAAC;;GAxFc,OAAA,MAAA,UAAA,CAAU,CAAC,QAAQ,YAAA,SAAhC,UAAA,GAAA,mBA2BQ,SAAA;;IA3BsC,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,MAAA,CAAA;GAC9C,GAAA,CAAA,YAAA,SAAV,UAAA,GAAA,mBAwBK,MAAA,YAAA,CAtBK,MAAA,WAAA,CAAW,CAAA,MADnB,UAAA,GAAA,mBAUK,MAAA;;IARF,OAAK,eAAE,MAAA,YAAA,CAAY,CAAC,MAAA,WAAA,CAAW,CAAA,EAAA,CAAA;IAC/B,OAAK,eAAA;KAAiB,GAAA,MAAA,WAAA,CAAW,CAAA,EAAA,CAAI;KAA4B,OAAA,MAAA,QAAA,CAAQ,CAAC,MAAA,WAAA,CAAW,CAAA,EAAA,CAAI,MAAM,OAAK,IAAA;KAAyB,MAAA,MAAA,QAAA,CAAQ,CAAC,MAAA,WAAA,CAAW,CAAA,EAAA,CAAI,MAAM,MAAI,IAAA;;GAKjK,GAAA,SAED,CAAA,KAAA,mBAAA,QAAA,IAAA,IACA,UAAA,IAAA,GAAA,mBAWK,UAAA,MAAA,WAVc,MAAA,WAAA,CAAW,CAAC,MAAK,CAAA,IAA3B,WAAM;IADf,OAAA,UAAA,GAAA,mBAWK,MAAA;KATF,OAAK,eAAE,MAAA,YAAA,CAAY,CAAC,MAAM,CAAA;KAC1B,KAAK,OAAO;KACZ,OAAK,eAAA;MAAiB,GAAA,OAAO;MAA4B,OAAA,MAAA,QAAA,CAAQ,CAAC,OAAO,MAAM,OAAK,IAAA;MAAyB,MAAA,MAAA,QAAA,CAAQ,CAAC,OAAO,MAAM,MAAI,IAAA;;IAMxI,GAAA,CAAA,YAAyD,MAAA,UAAA,GAAA,EAAzC,SAAS,qBAAqB,MAAM,EAAA,GAAA,MAAA,GAAA,CAAA,SAAA,CAAA,CAAA,GAAA,CAAA;GAGxD,CAAA,GAAA,GAAA,EAAA,CAAA,KAAA,mBAAA,QAAA,IAAA,GAAA,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,QAAA,IAAA"}
|
|
@@ -18,6 +18,7 @@ const TableHead = defineComponent({
|
|
|
18
18
|
"colspan": column.leafs,
|
|
19
19
|
"rowspan": column.children?.length ? void 0 : headers.value.length - headerIndex,
|
|
20
20
|
"style": {
|
|
21
|
+
...column.headerCellStyle,
|
|
21
22
|
left: withUnit(column.style.left, "px"),
|
|
22
23
|
right: withUnit(column.style.right, "px")
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-head.js","names":[],"sources":["../../../src/components/table/table-head.tsx"],"sourcesContent":["import { bem, withUnit } from '@veltra/utils'\nimport { defineComponent, inject, type DefineComponent } from 'vue'\n\nimport { TableDIKey, TableResizeKey } from './di'\n\nconst TableHead: DefineComponent = defineComponent({\n name: 'TableHead',\n setup() {\n const { cls, columnConfig, getHeaderSlotsNode, getHeaderCellClass } = inject(TableDIKey)!\n const { headers } = columnConfig\n const handleCls = cls.e('resize-handle')\n\n const { handleResizeMousedown, headerRef } = inject(TableResizeKey)!\n\n return () => (\n <thead\n class={[cls.e('head'), bem.is('multistage', headers.value.length > 1)]}\n ref={headerRef}\n >\n {headers.value.map((header, headerIndex) => (\n <tr>\n {header.map((column) => (\n <th\n class={getHeaderCellClass(column)}\n key={column.key}\n colspan={column.leafs}\n rowspan={column.children?.length ? undefined : headers.value.length - headerIndex}\n style={{\n left: withUnit(column.style.left, 'px'),\n right: withUnit(column.style.right, 'px')\n }}\n >\n {getHeaderSlotsNode({ column })}\n\n {column.isLeaf && column.resizable ? (\n <span\n class={handleCls}\n onMousedown={(e) => handleResizeMousedown(e, column)}\n ></span>\n ) : null}\n </th>\n ))}\n </tr>\n ))}\n </thead>\n )\n }\n})\n\nexport default TableHead\n"],"mappings":";;;;AAKA,MAAM,YAA6B,gBAAgB;CACjD,MAAM;CACN,QAAQ;EACN,MAAM,EAAE,KAAK,cAAc,oBAAoB,uBAAuB,OAAO,UAAU;EACvF,MAAM,EAAE,YAAY;EACpB,MAAM,YAAY,IAAI,EAAE,eAAe;EAEvC,MAAM,EAAE,uBAAuB,cAAc,OAAO,cAAc;EAElE,aAAO,YAAA,SAAA;GAAA,SAEI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,QAAQ,MAAM,SAAS,CAAC,CAAC;GAAC,OACjE;EAAS,GAAA,CAEb,QAAQ,MAAM,KAAK,QAAQ,gBAAW,YAAA,MAAA,MAAA,CAElC,OAAO,KAAK,WAAM,YAAA,MAAA;GAAA,SAER,mBAAmB,MAAM;GAAC,OAC5B,OAAO;GAAG,WACN,OAAO;GAAK,WACZ,OAAO,UAAU,SAAS,KAAA,IAAY,QAAQ,MAAM,SAAS;GAAW,SAC1E;IACL,MAAM,SAAS,OAAO,MAAM,MAAM,IAAI;IACtC,OAAO,SAAS,OAAO,MAAM,OAAO,IAAI;GAC1C;EAAC,GAAA,CAEA,mBAAmB,EAAE,OAAO,CAAC,GAE7B,OAAO,UAAU,OAAO,YAAS,YAAA,QAAA;GAAA,SAEvB;GAAS,gBACF,MAAM,sBAAsB,GAAG,MAAM;EAAC,GAAA,IAAA,IAEpD,IAAI,CAAA,CAEX,CAAC,CAAA,CAEL,CAAC,CAAA;CAGR;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"table-head.js","names":[],"sources":["../../../src/components/table/table-head.tsx"],"sourcesContent":["import { bem, withUnit } from '@veltra/utils'\nimport { defineComponent, inject, type DefineComponent } from 'vue'\n\nimport { TableDIKey, TableResizeKey } from './di'\n\nconst TableHead: DefineComponent = defineComponent({\n name: 'TableHead',\n setup() {\n const { cls, columnConfig, getHeaderSlotsNode, getHeaderCellClass } = inject(TableDIKey)!\n const { headers } = columnConfig\n const handleCls = cls.e('resize-handle')\n\n const { handleResizeMousedown, headerRef } = inject(TableResizeKey)!\n\n return () => (\n <thead\n class={[cls.e('head'), bem.is('multistage', headers.value.length > 1)]}\n ref={headerRef}\n >\n {headers.value.map((header, headerIndex) => (\n <tr>\n {header.map((column) => (\n <th\n class={getHeaderCellClass(column)}\n key={column.key}\n colspan={column.leafs}\n rowspan={column.children?.length ? undefined : headers.value.length - headerIndex}\n style={{\n ...column.headerCellStyle,\n left: withUnit(column.style.left, 'px'),\n right: withUnit(column.style.right, 'px')\n }}\n >\n {getHeaderSlotsNode({ column })}\n\n {column.isLeaf && column.resizable ? (\n <span\n class={handleCls}\n onMousedown={(e) => handleResizeMousedown(e, column)}\n ></span>\n ) : null}\n </th>\n ))}\n </tr>\n ))}\n </thead>\n )\n }\n})\n\nexport default TableHead\n"],"mappings":";;;;AAKA,MAAM,YAA6B,gBAAgB;CACjD,MAAM;CACN,QAAQ;EACN,MAAM,EAAE,KAAK,cAAc,oBAAoB,uBAAuB,OAAO,UAAU;EACvF,MAAM,EAAE,YAAY;EACpB,MAAM,YAAY,IAAI,EAAE,eAAe;EAEvC,MAAM,EAAE,uBAAuB,cAAc,OAAO,cAAc;EAElE,aAAO,YAAA,SAAA;GAAA,SAEI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,QAAQ,MAAM,SAAS,CAAC,CAAC;GAAC,OACjE;EAAS,GAAA,CAEb,QAAQ,MAAM,KAAK,QAAQ,gBAAW,YAAA,MAAA,MAAA,CAElC,OAAO,KAAK,WAAM,YAAA,MAAA;GAAA,SAER,mBAAmB,MAAM;GAAC,OAC5B,OAAO;GAAG,WACN,OAAO;GAAK,WACZ,OAAO,UAAU,SAAS,KAAA,IAAY,QAAQ,MAAM,SAAS;GAAW,SAC1E;IACL,GAAG,OAAO;IACV,MAAM,SAAS,OAAO,MAAM,MAAM,IAAI;IACtC,OAAO,SAAS,OAAO,MAAM,OAAO,IAAI;GAC1C;EAAC,GAAA,CAEA,mBAAmB,EAAE,OAAO,CAAC,GAE7B,OAAO,UAAU,OAAO,YAAS,YAAA,QAAA;GAAA,SAEvB;GAAS,gBACF,MAAM,sBAAsB,GAAG,MAAM;EAAC,GAAA,IAAA,IAEpD,IAAI,CAAA,CAEX,CAAC,CAAA,CAEL,CAAC,CAAA;CAGR;AACF,CAAC"}
|
|
@@ -76,6 +76,7 @@ const UTableRow = defineComponent({
|
|
|
76
76
|
"cellClass": getCellClass(_expandColumn),
|
|
77
77
|
"left": _expandColumn.style.left,
|
|
78
78
|
"right": _expandColumn.style.right,
|
|
79
|
+
"cellStyle": _expandColumn.cellStyle,
|
|
79
80
|
"key": row.uid + _expandColumn.key
|
|
80
81
|
}, tableProps.mergeCell?.(expandCtx)), { default: () => [!row.isLeaf || tableProps.expandable && !row.isExpandRow ? createVNode(_sfc_main$1, {
|
|
81
82
|
"text": true,
|
|
@@ -110,6 +111,7 @@ const UTableRow = defineComponent({
|
|
|
110
111
|
"cellClass": getCellClass(column),
|
|
111
112
|
"left": column.style.left,
|
|
112
113
|
"right": column.style.right,
|
|
114
|
+
"cellStyle": column.cellStyle,
|
|
113
115
|
"key": row.uid + column.key,
|
|
114
116
|
"onClick": (e) => handleCellClick(row, column, e)
|
|
115
117
|
}, cellSpan), _isSlot(cellNode) ? cellNode : { default: () => [cellNode] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-row.js","names":[],"sources":["../../../src/components/table/table-row.tsx"],"sourcesContent":["import { ArrowRight } from '@veltra/icons/normal'\nimport { defineComponent, type DefineComponent } from 'vue'\nimport { inject, onUnmounted } from 'vue'\nimport type { JSX } from 'vue/jsx-runtime'\n\nimport type { TableRow as ITableRow } from '../../types'\nimport { UButton } from '../button'\nimport { UIcon } from '../icon'\nimport { TableDIKey } from './di'\nimport UTabelCell from './table-cell.vue'\n\n/**\n * A3:行修饰类组合静态查找表。\n *\n * 位模式:bit2 = isCurrent, bit1 = checked, bit0 = expanded。\n * 与 `bem.is('...')` 对于 `'current' | 'checked' | 'expanded'` 的输出完全等价,\n * 直接从 index 读字符串,消除每行渲染期间的字符串拼接和 3 次 bem.is 调用。\n *\n * 放在模块顶层使所有 TableRow 实例共享一份引用(不会随 setup 重建)。\n */\nconst ROW_MOD_CLASS: readonly string[] = [\n '',\n 'is-expanded',\n 'is-checked',\n 'is-checked is-expanded',\n 'is-current',\n 'is-current is-expanded',\n 'is-current is-checked',\n 'is-current is-checked is-expanded'\n] as const\n\nfunction rowModCls(row: ITableRow): string {\n const i = (row.isCurrent ? 4 : 0) | (row.checked ? 2 : 0) | (row.expanded ? 1 : 0)\n return ROW_MOD_CLASS[i]!\n}\n\nexport const UTableRow: DefineComponent<{ row: ITableRow; index: number }> = defineComponent({\n name: 'TableRow',\n\n props: {\n row: { type: Object as () => ITableRow, required: true },\n index: { type: Number, required: true }\n },\n\n setup(props) {\n const {\n cls,\n columnConfig,\n getColumnSlotsNode,\n toggleTreeRowExpand,\n getCellCtx,\n handleRowClick,\n handleCellClick,\n tableProps,\n measureElement,\n getCellClass\n } = inject(TableDIKey)!\n\n // A1:把 cls.e('row') / cls.e('expand-toggle') 等静态字符串提升到 setup 一次性计算,\n // 避免每次 render 重新走 `cls.e` 拼接。\n const rowBaseCls = cls.e('row')\n const expandToggleCls = cls.e('expand-toggle')\n const expandSpaceCls = cls.e('expand-space')\n\n // A2:measureRef 按 index 缓存闭包。\n // 行虚拟化下,同一 TableRow 实例的 props.index 大多稳定,但在虚拟化重排或展开行切换时\n // 仍会发生变化;把 (index) → refFn 缓存起来,既保证引用稳定(利于 Vue 的 ref diff),\n // 又避免在未来可能的\"同实例跨 index 复用\"情形下重复分配闭包。\n const measureRefCache = new Map<number, (el: unknown) => void>()\n const getMeasureRef = (index: number): ((el: unknown) => void) => {\n let ref = measureRefCache.get(index)\n if (ref === undefined) {\n ref = (el: unknown) => {\n measureElement(index, el as Element | null)\n }\n measureRefCache.set(index, ref)\n }\n return ref\n }\n onUnmounted(() => {\n measureRefCache.clear()\n })\n\n const { columns, expandColumn } = columnConfig\n\n return () => {\n const { row } = props\n const _expandColumn = expandColumn.value\n\n let expandCell: JSX.Element | null = null\n if (_expandColumn) {\n const expandCtx = getCellCtx(row, _expandColumn)\n const cellSpan = tableProps.mergeCell?.(expandCtx)\n\n if (!cellSpan || (cellSpan.colspan && cellSpan.rowspan)) {\n const marginLeft = tableProps.tree ? row.depth * 14 : 0\n expandCell = (\n <UTabelCell\n cellClass={getCellClass(_expandColumn)}\n left={_expandColumn.style.left}\n right={_expandColumn.style.right}\n key={row.uid + _expandColumn.key}\n {...tableProps.mergeCell?.(expandCtx)}\n >\n {!row.isLeaf || (tableProps.expandable && !row.isExpandRow) ? (\n <UButton\n text\n class={expandToggleCls}\n type='primary'\n size='small'\n circle\n onClick={(e) => {\n e.stopPropagation()\n toggleTreeRowExpand(row)\n }}\n style={`margin-left: ${marginLeft}px`}\n >\n <UIcon>\n <ArrowRight />\n </UIcon>\n </UButton>\n ) : (\n <i class={expandSpaceCls} style={`margin-left: ${marginLeft}px`}></i>\n )}\n\n {getColumnSlotsNode(expandCtx)}\n </UTabelCell>\n )\n }\n }\n\n // A3:行 class 由 base + 3-bit 组合查找产出,避免 Vue 的 class 数组归一化开销。\n const mod = rowModCls(row)\n const rowCls = mod ? rowBaseCls + ' ' + mod : rowBaseCls\n\n return (\n <tr\n class={rowCls}\n onClick={(e) => handleRowClick(row, e)}\n ref={getMeasureRef(props.index)}\n key={row.uid}\n >\n {expandCell}\n\n {columns.value.map((column) => {\n const cellCtx = getCellCtx(row, column)\n const cellSpan = tableProps.mergeCell?.(cellCtx)\n if (cellSpan && (!cellSpan.colspan || !cellSpan.rowspan)) {\n return null\n }\n\n const cellNode = getColumnSlotsNode(cellCtx)\n\n return (\n <UTabelCell\n cellClass={getCellClass(column)}\n left={column.style.left}\n right={column.style.right}\n key={row.uid + column.key}\n // @ts-ignore\n onClick={(e) => handleCellClick(row, column, e)}\n {...cellSpan}\n >\n {cellNode}\n </UTabelCell>\n )\n })}\n </tr>\n )\n }\n }\n})\n\nexport const UExpandTableRow = defineComponent({\n name: 'ExpandTableRow',\n props: {\n row: { type: Object as () => ITableRow, required: true },\n index: { type: Number, required: true }\n },\n setup(props) {\n const { getExpandRowSlotsNode, cls, measureElement, columnConfig } = inject(TableDIKey)!\n const { leafColumns } = columnConfig\n\n const rowBaseCls = cls.e('row')\n const cellCls = cls.e('cell')\n\n const measureRef = (el: unknown) => {\n measureElement(props.index, el as Element | null)\n }\n\n return () => {\n const { row } = props\n const node = getExpandRowSlotsNode({\n row,\n index: row.index,\n columns: leafColumns.value,\n rowData: row.data\n })\n return (\n <tr class={rowBaseCls} ref={measureRef}>\n <td colspan={leafColumns.value.length} class={cellCls}>\n {node}\n </td>\n </tr>\n )\n }\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AASA,MAAM,gBAAmC;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAmC;AAGrC,SAAS,UAAU,KAAwB;CACzC,MAAM,KAAK,IAAI,YAAY,IAAI,MAAM,IAAI,UAAU,IAAI,MAAM,IAAI,WAAW,IAAI;CAChF,OAAO,cAAc;AACvB;AAEA,MAAa,YAAgE,gBAAgB;CAC3F,MAAM;CAEN,OAAO;EACL,KAAK;GAAE,MAAM;GAA2B,UAAU;EAAK;EACvD,OAAO;GAAE,MAAM;GAAQ,UAAU;EAAK;CACxC;CAEA,MAAM,OAAO;EACX,MAAM,EACJ,KACA,cACA,oBACA,qBACA,YACA,gBACA,iBACA,YACA,gBACA,iBACE,OAAO,UAAU;EAIrB,MAAM,aAAa,IAAI,EAAE,KAAK;EAC9B,MAAM,kBAAkB,IAAI,EAAE,eAAe;EAC7C,MAAM,iBAAiB,IAAI,EAAE,cAAc;EAM3C,MAAM,kCAAkB,IAAI,IAAmC;EAC/D,MAAM,iBAAiB,UAA2C;GAChE,IAAI,MAAM,gBAAgB,IAAI,KAAK;GACnC,IAAI,QAAQ,KAAA,GAAW;IACrB,OAAO,OAAgB;KACrB,eAAe,OAAO,EAAoB;IAC5C;IACA,gBAAgB,IAAI,OAAO,GAAG;GAChC;GACA,OAAO;EACT;EACA,kBAAkB;GAChB,gBAAgB,MAAM;EACxB,CAAC;EAED,MAAM,EAAE,SAAS,iBAAiB;EAElC,aAAa;GACX,MAAM,EAAE,QAAQ;GAChB,MAAM,gBAAgB,aAAa;GAEnC,IAAI,aAAiC;GACrC,IAAI,eAAe;IACjB,MAAM,YAAY,WAAW,KAAK,aAAa;IAC/C,MAAM,WAAW,WAAW,YAAY,SAAS;IAEjD,IAAI,CAAC,YAAa,SAAS,WAAW,SAAS,SAAU;KACvD,MAAM,aAAa,WAAW,OAAO,IAAI,QAAQ,KAAK;KACtD,aAAU,YAAA,aAAA,WAAA;MAAA,aAEK,aAAa,aAAa;MAAC,QAChC,cAAc,MAAM;MAAI,SACvB,cAAc,MAAM;MAAK,
|
|
1
|
+
{"version":3,"file":"table-row.js","names":[],"sources":["../../../src/components/table/table-row.tsx"],"sourcesContent":["import { ArrowRight } from '@veltra/icons/normal'\nimport { defineComponent, type DefineComponent } from 'vue'\nimport { inject, onUnmounted } from 'vue'\nimport type { JSX } from 'vue/jsx-runtime'\n\nimport type { TableRow as ITableRow } from '../../types'\nimport { UButton } from '../button'\nimport { UIcon } from '../icon'\nimport { TableDIKey } from './di'\nimport UTabelCell from './table-cell.vue'\n\n/**\n * A3:行修饰类组合静态查找表。\n *\n * 位模式:bit2 = isCurrent, bit1 = checked, bit0 = expanded。\n * 与 `bem.is('...')` 对于 `'current' | 'checked' | 'expanded'` 的输出完全等价,\n * 直接从 index 读字符串,消除每行渲染期间的字符串拼接和 3 次 bem.is 调用。\n *\n * 放在模块顶层使所有 TableRow 实例共享一份引用(不会随 setup 重建)。\n */\nconst ROW_MOD_CLASS: readonly string[] = [\n '',\n 'is-expanded',\n 'is-checked',\n 'is-checked is-expanded',\n 'is-current',\n 'is-current is-expanded',\n 'is-current is-checked',\n 'is-current is-checked is-expanded'\n] as const\n\nfunction rowModCls(row: ITableRow): string {\n const i = (row.isCurrent ? 4 : 0) | (row.checked ? 2 : 0) | (row.expanded ? 1 : 0)\n return ROW_MOD_CLASS[i]!\n}\n\nexport const UTableRow: DefineComponent<{ row: ITableRow; index: number }> = defineComponent({\n name: 'TableRow',\n\n props: {\n row: { type: Object as () => ITableRow, required: true },\n index: { type: Number, required: true }\n },\n\n setup(props) {\n const {\n cls,\n columnConfig,\n getColumnSlotsNode,\n toggleTreeRowExpand,\n getCellCtx,\n handleRowClick,\n handleCellClick,\n tableProps,\n measureElement,\n getCellClass\n } = inject(TableDIKey)!\n\n // A1:把 cls.e('row') / cls.e('expand-toggle') 等静态字符串提升到 setup 一次性计算,\n // 避免每次 render 重新走 `cls.e` 拼接。\n const rowBaseCls = cls.e('row')\n const expandToggleCls = cls.e('expand-toggle')\n const expandSpaceCls = cls.e('expand-space')\n\n // A2:measureRef 按 index 缓存闭包。\n // 行虚拟化下,同一 TableRow 实例的 props.index 大多稳定,但在虚拟化重排或展开行切换时\n // 仍会发生变化;把 (index) → refFn 缓存起来,既保证引用稳定(利于 Vue 的 ref diff),\n // 又避免在未来可能的\"同实例跨 index 复用\"情形下重复分配闭包。\n const measureRefCache = new Map<number, (el: unknown) => void>()\n const getMeasureRef = (index: number): ((el: unknown) => void) => {\n let ref = measureRefCache.get(index)\n if (ref === undefined) {\n ref = (el: unknown) => {\n measureElement(index, el as Element | null)\n }\n measureRefCache.set(index, ref)\n }\n return ref\n }\n onUnmounted(() => {\n measureRefCache.clear()\n })\n\n const { columns, expandColumn } = columnConfig\n\n return () => {\n const { row } = props\n const _expandColumn = expandColumn.value\n\n let expandCell: JSX.Element | null = null\n if (_expandColumn) {\n const expandCtx = getCellCtx(row, _expandColumn)\n const cellSpan = tableProps.mergeCell?.(expandCtx)\n\n if (!cellSpan || (cellSpan.colspan && cellSpan.rowspan)) {\n const marginLeft = tableProps.tree ? row.depth * 14 : 0\n expandCell = (\n <UTabelCell\n cellClass={getCellClass(_expandColumn)}\n left={_expandColumn.style.left}\n right={_expandColumn.style.right}\n cellStyle={_expandColumn.cellStyle}\n key={row.uid + _expandColumn.key}\n {...tableProps.mergeCell?.(expandCtx)}\n >\n {!row.isLeaf || (tableProps.expandable && !row.isExpandRow) ? (\n <UButton\n text\n class={expandToggleCls}\n type='primary'\n size='small'\n circle\n onClick={(e) => {\n e.stopPropagation()\n toggleTreeRowExpand(row)\n }}\n style={`margin-left: ${marginLeft}px`}\n >\n <UIcon>\n <ArrowRight />\n </UIcon>\n </UButton>\n ) : (\n <i class={expandSpaceCls} style={`margin-left: ${marginLeft}px`}></i>\n )}\n\n {getColumnSlotsNode(expandCtx)}\n </UTabelCell>\n )\n }\n }\n\n // A3:行 class 由 base + 3-bit 组合查找产出,避免 Vue 的 class 数组归一化开销。\n const mod = rowModCls(row)\n const rowCls = mod ? rowBaseCls + ' ' + mod : rowBaseCls\n\n return (\n <tr\n class={rowCls}\n onClick={(e) => handleRowClick(row, e)}\n ref={getMeasureRef(props.index)}\n key={row.uid}\n >\n {expandCell}\n\n {columns.value.map((column) => {\n const cellCtx = getCellCtx(row, column)\n const cellSpan = tableProps.mergeCell?.(cellCtx)\n if (cellSpan && (!cellSpan.colspan || !cellSpan.rowspan)) {\n return null\n }\n\n const cellNode = getColumnSlotsNode(cellCtx)\n\n return (\n <UTabelCell\n cellClass={getCellClass(column)}\n left={column.style.left}\n right={column.style.right}\n cellStyle={column.cellStyle}\n key={row.uid + column.key}\n // @ts-ignore\n onClick={(e) => handleCellClick(row, column, e)}\n {...cellSpan}\n >\n {cellNode}\n </UTabelCell>\n )\n })}\n </tr>\n )\n }\n }\n})\n\nexport const UExpandTableRow = defineComponent({\n name: 'ExpandTableRow',\n props: {\n row: { type: Object as () => ITableRow, required: true },\n index: { type: Number, required: true }\n },\n setup(props) {\n const { getExpandRowSlotsNode, cls, measureElement, columnConfig } = inject(TableDIKey)!\n const { leafColumns } = columnConfig\n\n const rowBaseCls = cls.e('row')\n const cellCls = cls.e('cell')\n\n const measureRef = (el: unknown) => {\n measureElement(props.index, el as Element | null)\n }\n\n return () => {\n const { row } = props\n const node = getExpandRowSlotsNode({\n row,\n index: row.index,\n columns: leafColumns.value,\n rowData: row.data\n })\n return (\n <tr class={rowBaseCls} ref={measureRef}>\n <td colspan={leafColumns.value.length} class={cellCls}>\n {node}\n </td>\n </tr>\n )\n }\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AASA,MAAM,gBAAmC;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAmC;AAGrC,SAAS,UAAU,KAAwB;CACzC,MAAM,KAAK,IAAI,YAAY,IAAI,MAAM,IAAI,UAAU,IAAI,MAAM,IAAI,WAAW,IAAI;CAChF,OAAO,cAAc;AACvB;AAEA,MAAa,YAAgE,gBAAgB;CAC3F,MAAM;CAEN,OAAO;EACL,KAAK;GAAE,MAAM;GAA2B,UAAU;EAAK;EACvD,OAAO;GAAE,MAAM;GAAQ,UAAU;EAAK;CACxC;CAEA,MAAM,OAAO;EACX,MAAM,EACJ,KACA,cACA,oBACA,qBACA,YACA,gBACA,iBACA,YACA,gBACA,iBACE,OAAO,UAAU;EAIrB,MAAM,aAAa,IAAI,EAAE,KAAK;EAC9B,MAAM,kBAAkB,IAAI,EAAE,eAAe;EAC7C,MAAM,iBAAiB,IAAI,EAAE,cAAc;EAM3C,MAAM,kCAAkB,IAAI,IAAmC;EAC/D,MAAM,iBAAiB,UAA2C;GAChE,IAAI,MAAM,gBAAgB,IAAI,KAAK;GACnC,IAAI,QAAQ,KAAA,GAAW;IACrB,OAAO,OAAgB;KACrB,eAAe,OAAO,EAAoB;IAC5C;IACA,gBAAgB,IAAI,OAAO,GAAG;GAChC;GACA,OAAO;EACT;EACA,kBAAkB;GAChB,gBAAgB,MAAM;EACxB,CAAC;EAED,MAAM,EAAE,SAAS,iBAAiB;EAElC,aAAa;GACX,MAAM,EAAE,QAAQ;GAChB,MAAM,gBAAgB,aAAa;GAEnC,IAAI,aAAiC;GACrC,IAAI,eAAe;IACjB,MAAM,YAAY,WAAW,KAAK,aAAa;IAC/C,MAAM,WAAW,WAAW,YAAY,SAAS;IAEjD,IAAI,CAAC,YAAa,SAAS,WAAW,SAAS,SAAU;KACvD,MAAM,aAAa,WAAW,OAAO,IAAI,QAAQ,KAAK;KACtD,aAAU,YAAA,aAAA,WAAA;MAAA,aAEK,aAAa,aAAa;MAAC,QAChC,cAAc,MAAM;MAAI,SACvB,cAAc,MAAM;MAAK,aACrB,cAAc;MAAS,OAC7B,IAAI,MAAM,cAAc;KAAG,GAC5B,WAAW,YAAY,SAAS,CAAC,GAAA,EAAA,eAAA,CAEpC,CAAC,IAAI,UAAW,WAAW,cAAc,CAAC,IAAI,cAAY,YAAA,aAAA;MAAA,QAAA;MAAA,SAGhD;MAAe,QAAA;MAAA,QAAA;MAAA,UAAA;MAAA,YAIZ,MAAM;OACd,EAAE,gBAAgB;OAClB,oBAAoB,GAAG;MACzB;MAAC,SACM,gBAAgB,WAAU;KAAI,GAAA,EAAA,eAAA,CAAA,YAAA,WAAA,MAAA,EAAA,eAAA,CAAA,YAAA,YAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,IAAA,YAAA,KAAA;MAAA,SAO7B;MAAc,SAAS,gBAAgB,WAAU;KAAI,GAAA,IAAA,GAGhE,mBAAmB,SAAS,CAAC,EAAA,CAAA;IAGpC;GACF;GAGA,MAAM,MAAM,UAAU,GAAG;GACzB,MAAM,SAAS,MAAM,aAAa,MAAM,MAAM;GAE9C,OAAA,YAAA,MAAA;IAAA,SAEW;IAAM,YACH,MAAM,eAAe,KAAK,CAAC;IAAC,OACjC,cAAc,MAAM,KAAK;IAAC,OAC1B,IAAI;GAAG,GAAA,CAEX,YAEA,QAAQ,MAAM,KAAK,WAAW;IAC7B,MAAM,UAAU,WAAW,KAAK,MAAM;IACtC,MAAM,WAAW,WAAW,YAAY,OAAO;IAC/C,IAAI,aAAa,CAAC,SAAS,WAAW,CAAC,SAAS,UAC9C,OAAO;IAGT,MAAM,WAAW,mBAAmB,OAAO;IAE3C,OAAA,YAAA,aAAA,WAAA;KAAA,aAEe,aAAa,MAAM;KAAC,QACzB,OAAO,MAAM;KAAI,SAChB,OAAO,MAAM;KAAK,aACd,OAAO;KAAS,OACtB,IAAI,MAAM,OAAO;KAAG,YAEf,MAAM,gBAAgB,KAAK,QAAQ,CAAC;IAAC,GAC3C,QAAQ,GAAA,QAEX,QAAQ,IAAR,WAAQ,EAAA,eAAA,CAAR,QAAQ,EAAA,CAAA;GAGf,CAAC,CAAC,CAAA;EAGR;CACF;AACF,CAAC;AAED,MAAa,kBAAkB,gBAAgB;CAC7C,MAAM;CACN,OAAO;EACL,KAAK;GAAE,MAAM;GAA2B,UAAU;EAAK;EACvD,OAAO;GAAE,MAAM;GAAQ,UAAU;EAAK;CACxC;CACA,MAAM,OAAO;EACX,MAAM,EAAE,uBAAuB,KAAK,gBAAgB,iBAAiB,OAAO,UAAU;EACtF,MAAM,EAAE,gBAAgB;EAExB,MAAM,aAAa,IAAI,EAAE,KAAK;EAC9B,MAAM,UAAU,IAAI,EAAE,MAAM;EAE5B,MAAM,cAAc,OAAgB;GAClC,eAAe,MAAM,OAAO,EAAoB;EAClD;EAEA,aAAa;GACX,MAAM,EAAE,QAAQ;GAChB,MAAM,OAAO,sBAAsB;IACjC;IACA,OAAO,IAAI;IACX,SAAS,YAAY;IACrB,SAAS,IAAI;GACf,CAAC;GACD,OAAA,YAAA,MAAA;IAAA,SACa;IAAU,OAAO;GAAU,GAAA,CAAA,YAAA,MAAA;IAAA,WACvB,YAAY,MAAM;IAAM,SAAS;GAAO,GAAA,CAClD,IAAI,CAAA,CAAA,CAAA;EAIb;CACF;AACF,CAAC"}
|
|
@@ -8,7 +8,6 @@ import { BEM } from "@veltra/utils";
|
|
|
8
8
|
* 定义表格列
|
|
9
9
|
* @param columns 表格列
|
|
10
10
|
*/
|
|
11
|
-
declare function defineTableColumns(columns: TableColumn[], commonProps?: Partial<Pick<TableColumn, 'align' | 'minWidth'>>): TableColumn[];
|
|
11
|
+
export declare function defineTableColumns(columns: TableColumn[], commonProps?: Partial<Pick<TableColumn, 'align' | 'minWidth'>>): TableColumn[];
|
|
12
12
|
//#endregion
|
|
13
|
-
export { defineTableColumns };
|
|
14
13
|
//# sourceMappingURL=use-columns.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ import { ButtonEmits, ButtonExposed, ButtonProps, ButtonType, _ButtonExposed } f
|
|
|
114
114
|
import { DatePanelEmits, DatePanelProps, PanelType } from "./types/date-panel.js";
|
|
115
115
|
import { DialogEmits, DialogExposed, DialogProps, DialogTransition, _DialogExposed } from "./types/dialog.js";
|
|
116
116
|
import { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, _ActionExposed, _ActionGroupExposed } from "./types/action.js";
|
|
117
|
-
import { TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, _TableExposed } from "./types/table.js";
|
|
117
|
+
import { TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableColumnStyle, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, _TableExposed } from "./types/table.js";
|
|
118
118
|
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditFormStatus, BatchEditProps, BatchEditSlots, BatchEditStates, _BatchEditExposed } from "./types/batch-edit.js";
|
|
119
119
|
import { BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, _BreadcrumbExposed } from "./types/breadcrumb.js";
|
|
120
120
|
import { ListEmits, ListExposed, ListProps, _ListExposed } from "./types/list.js";
|
|
@@ -185,4 +185,4 @@ import { defineBatchEditColumns } from "./components/batch-edit/helper.js";
|
|
|
185
185
|
import { defineTableColumns } from "./components/table/use-columns.js";
|
|
186
186
|
import "./components/index.js";
|
|
187
187
|
export * from "@veltra/utils";
|
|
188
|
-
export { type ActionEmits, type ActionExposed, type ActionGroupExposed, type ActionGroupProps, type ActionProps, type AnimationEmits, type AnimationExposed, type AnimationProps, type AutoCompleteEmits, type AutoCompleteExposed, type AutoCompleteProps, type BadgeEmits, type BadgeExposed, type BadgeProps, type BarType, type BatchEditColumn, type BatchEditEmits, type BatchEditExposed, type BatchEditFeature, type BatchEditFormStatus, type BatchEditProps, type BatchEditSlots, type BatchEditStates, type BreadcrumbEmits, type BreadcrumbExposed, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSlotScope, type BreakCols, type Breakpoint, type ButtonEmits, type ButtonExposed, type ButtonProps, type ButtonType, type CalendarDay, type CalendarEmits, type CalendarExposed, type CalendarMonth, type CalendarProps, type CalendarYear, type CardActionProps, type CardContentProps, type CardCoverProps, type CardEmits, type CardExposed, type CardProps, type CascadeEmits, type CascadeExposed, type CascadeNode, type CascadeProps, type CheckTagEmits, type CheckTagExposed, type CheckTagProps, type CheckboxButtonEmits, type CheckboxButtonProps, type CheckboxEmits, type CheckboxExposed, type CheckboxGroupEmits, type CheckboxGroupExposed, type CheckboxGroupProps, type CheckboxProps, type CodeEditorEmits, type CodeEditorExposed, type CodeEditorLang, type CodeEditorProps, type CollapseEmits, type CollapseItemEmits, type CollapseItemProps, type CollapseModelValue, type CollapseProps, type CollapseValue, type ConditionConnector, type ConditionEditorEmits, type ConditionEditorExposed, type ConditionEditorProps, type EvaluateOptions as ConditionEvaluateOptions, type ConditionExpression, type ConditionField, type ConditionGroup, type ConditionLeaf, type ConditionNode, type ConditionValue, type ContextmenuEmits, type ContextmenuExposed, type ContextmenuItem, ContextmenuPanelDIKey, type ContextmenuProps, ContextmenuRootDIKey, type CssTransitionEmits, type CssTransitionExposed, type CssTransitionProps, type DatePanelEmits, type DatePanelProps, type DatePickerDataType, type DatePickerEmits, type DatePickerExposed, type DatePickerProps, type DateRangePickerDataType, type DateRangePickerEmits, type DateRangePickerExposed, type DateRangePickerProps, type DateRangeValue, type DialogEmits, type DialogExposed, type DialogProps, type DialogTransition, type DrawerDirection, type DrawerEmits, type DrawerExposed, type DrawerMode, type DrawerProps, type DropdownEmits, type DropdownExposed, type DropdownProps, type DualNavEmits, type DualNavExposed, type DualNavProps, type DualNavRailVariant, type DualNavRootItem, type EmptyEmits, type EmptyExposed, type EmptyProps, type ExpressionEditorEmits, type ExpressionEditorExposed, type ExpressionEditorProps, type ExpressionSelectableLevels, type FileViewerEmits, type FileViewerExposed, type FileViewerItem, type FileViewerKind, type FileViewerProps, type FloatButtonEmits, type FloatButtonExposed, type FloatButtonItem, type FloatButtonProps, type FormEmits, type FormExposed, type FormItemEmits, type FormItemExposed, type FormItemProps, type FormProps, type GanttChartEmits, type GanttChartExposed, type GanttChartProps, type GridEmits, type GridExposed, type GridInputEmits, type GridInputExposed, type GridInputProps, type GridItemProps, type GridProps, type GroupInputEmits, type GroupInputExposed, type GroupInputProps, type GroupNavEmits, type GroupNavGroup, type GroupNavProps, type IconEmits, type IconExposed, type IconProps, type ImageCropperChangePayload, type ImageCropperCropTransform, type ImageCropperEmits, type ImageCropperExposed, type ImageCropperProps, type ImageCropperResult, type ImageCropperResultOptions, type ImageCropperSelection, type InputEmits, type InputExposed, type InputProps, type LayoutEmits, type LayoutExposed, type LayoutProps, type ListEmits, type ListExposed, type ListProps, type LoadingEmits, type LoadingExposed, type LoadingProps, type LoadingType, type Message, type MessageConfirm, type MessageConfirmAction, type MessageConfirmEmits, type MessageConfirmExposed, type MessageConfirmInstance, type MessageConfirmOptions, type MessageConfirmProps, type MessageEmits, type MessageExposed, type MessageInstance, type MessageOptions, type MessageProps, type MessageType, type MultiAutoCompleteEmits, type MultiAutoCompleteExposed, type MultiAutoCompleteProps, type MultiSelectEmits, type MultiSelectExposed, type MultiSelectProps, type MultiTreeSelectEmits, type MultiTreeSelectExposed, type MultiTreeSelectProps, type NavEmits, type NavExposed, type NavItem, type NavProps, type NodeRenderExposed, type NodeRenderProps, type Notification, type NotificationEmits, type NotificationExposed, type NotificationInstance, type NotificationOptions, type NotificationPosition, type NotificationProps, type NumberEmits, type NumberExposed, type NumberInputEmits, type NumberInputExposed, type NumberInputProps, type NumberProps, type NumberRangeInputEmits, type NumberRangeInputExposed, type NumberRangeInputProps, type NumberRangeTuple, type PaginatorEmits, type PaginatorExposed, type PaginatorProps, type PaletteColorType, type PaletteEmits, type PaletteExposed, type PaletteHSV, type PaletteProps, type PaletteRGB, type PanelItem, type PanelType, type PasswordInputEmits, type PasswordInputExposed, type PasswordInputProps, type PopConfirmEmits, type PopConfirmExposed, type PopConfirmProps, type PopEmits, type PopExposed, type PopProps, type ProgressEmits, type ProgressExposed, type ProgressNodesEmits, type ProgressNodesExposed, type ProgressNodesProps, type ProgressProps, type QuickBatchEditEmits, type QuickBatchEditExposed, type QuickBatchEditProps, type RadioEmits, type RadioExposed, type RadioGroupEmits, type RadioGroupExposed, type RadioGroupProps, type RadioProps, type RichTextEditorEmits, type RichTextEditorExposed, type RichTextEditorProps, type RichTextFormat, type ScrollEmits, type ScrollExposed, type ScrollPosition, type ScrollProps, type SegmentEmits, type SegmentExposed, type SegmentItem, type SegmentProps, type SelectEmits, type SelectExposed, type SelectProps, type SliderEmits, type SliderExposed, type SliderProps, type StepsEmits, type StepsExposed, type StepsProps, type StepsSlotScope, type SwitchEmits, type SwitchExposed, type SwitchProps, type TabItem, type TableColumn, type TableColumnAlign, type TableColumnNode, type TableColumnRenderContext, type TableColumnSlotsScope, type TableEditorEmits, type TableEditorExposed, type TableEditorProps, type TableEmits, type TableExposed, type TableProps, type TableRow, type TableRowSlotsScope, type TableSummaryContext, type TabsEmits, type TabsExposed, type TabsHorizontalEmits, type TabsHorizontalExposed, type TabsHorizontalProps, type TabsProps, type TabsVerticalEmits, type TabsVerticalExposed, type TabsVerticalProps, type TagEmits, type TagExposed, type TagProps, type TextEditorEmits, type TextEditorExposed, type TextEditorProps, type TextEmits, type TextExposed, type TextProps, type TextareaEmits, type TextareaExposed, type TextareaProps, type ThemeExposed, type ThemeProps, type TipAlign, type TipDirection, type TipEmits, type TipExposed, type TipProps, type ToolbarItem, type TreeEmit, type TreeExposed, type TreeNode, type TreeNodeProps, type TreeProps, type TreeSelectEmits, type TreeSelectExposed, type TreeSelectProps, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, _sfc_main$42 as UImageCropper, input_default as UInput, _sfc_main$43 as UKbd, _sfc_main$44 as ULayout, _sfc_main$45 as UList, _sfc_main$46 as UListItem, _sfc_main$47 as ULoading, _sfc_main$48 as UMessage, _sfc_main$49 as UMessageConfirm, _sfc_main$50 as UMultiSelect, _sfc_main$51 as UMultiTreeSelect, _sfc_main$52 as UNav, _sfc_main$53 as UNavItem, _sfc_main$54 as UNavSub, NodeRender as UNodeRender, _sfc_main$55 as UNotification, _sfc_main$56 as UNumber, _sfc_main$57 as UNumberInput, _sfc_main$58 as UNumberRangeInput, _sfc_main$59 as UPaginator, _sfc_main$60 as UPalette, _sfc_main$61 as UPasswordInput, _sfc_main$62 as UPopConfirm, _sfc_main$63 as UProgress, _sfc_main$64 as UProgressNodes, _sfc_main$65 as URadio, _sfc_main$66 as URadioGroup, _sfc_main$67 as URichTextEditor, _sfc_main$68 as UScroll, _sfc_main$69 as USegment, _sfc_main$70 as USelect, _sfc_main$71 as USlider, _sfc_main$72 as USteps, _sfc_main$73 as USwitch, _sfc_main$74 as UTable, _sfc_main$75 as UTableEditor, _sfc_main$76 as UTabs, _sfc_main$77 as UTabsHorizontal, _sfc_main$78 as UTabsVertical, _sfc_main$79 as UTag, _sfc_main$80 as UText, _sfc_main$81 as UTextarea, _sfc_main$82 as UTheme, _sfc_main$83 as UTip, _sfc_main$84 as UTree, _sfc_main$85 as UTreeSelect, _sfc_main$86 as UWatermark, type UploaderEmits, type UploaderExposed, type UploaderProps, type VariableItem, type WatermarkEmits, type WatermarkExposed, type WatermarkProps, type _ActionExposed, type _ActionGroupExposed, type _AnimationExposed, type _AutoCompleteExposed, type _BadgeExposed, type _BatchEditExposed, type _BreadcrumbExposed, type _ButtonExposed, type _CalendarExposed, type _CardExposed, type _CascadeExposed, type _CheckTagExposed, type _CodeEditorExposed, type _ConditionEditorExposed, type _ContextmenuExposed, type _CssTransitionExposed, type _DatePickerExposed, type _DateRangePickerExposed, type _DialogExposed, type _DrawerExposed, type _DropdownExposed, type _DualNavExposed, type _EmptyExposed, type _ExpressionEditorExposed, type _FileViewerExposed, type _FloatButtonExposed, type _FormExposed, type _GanttChartExposed, type _GridExposed, type _GridInputExposed, type _GroupInputExposed, type _ImageCropperExposed, type _InputExposed, type _LayoutExposed, type _ListExposed, type _LoadingExposed, type _MessageConfirmExposed, type _MessageExposed, type _MultiAutoCompleteExposed, type _MultiSelectExposed, type _MultiTreeSelectExposed, type _NavExposed, type _NotificationExposed, type _PaginatorExposed, type _PaletteExposed, type _PasswordInputExposed, type _PopConfirmExposed, type _PopExposed, type _ProgressExposed, type _ProgressNodesExposed, type _QuickBatchEditExposed, type _RadioExposed, type _RadioGroupExposed, type _RichTextEditorExposed, type _ScrollExposed, type _SegmentExposed, type _SelectExposed, type _SliderExposed, type _StepsExposed, type _SwitchExposed, type _TableEditorExposed, type _TableExposed, type _TabsExposed, type _TabsHorizontalExposed, type _TabsVerticalExposed, type _TextEditorExposed, type _TextExposed, type _TextareaExposed, type _ThemeExposed, type _TipExposed, type _TreeExposed, type _TreeSelectExposed, type _UploaderExposed, type _WatermarkExposed, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
|
|
188
|
+
export { type ActionEmits, type ActionExposed, type ActionGroupExposed, type ActionGroupProps, type ActionProps, type AnimationEmits, type AnimationExposed, type AnimationProps, type AutoCompleteEmits, type AutoCompleteExposed, type AutoCompleteProps, type BadgeEmits, type BadgeExposed, type BadgeProps, type BarType, type BatchEditColumn, type BatchEditEmits, type BatchEditExposed, type BatchEditFeature, type BatchEditFormStatus, type BatchEditProps, type BatchEditSlots, type BatchEditStates, type BreadcrumbEmits, type BreadcrumbExposed, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSlotScope, type BreakCols, type Breakpoint, type ButtonEmits, type ButtonExposed, type ButtonProps, type ButtonType, type CalendarDay, type CalendarEmits, type CalendarExposed, type CalendarMonth, type CalendarProps, type CalendarYear, type CardActionProps, type CardContentProps, type CardCoverProps, type CardEmits, type CardExposed, type CardProps, type CascadeEmits, type CascadeExposed, type CascadeNode, type CascadeProps, type CheckTagEmits, type CheckTagExposed, type CheckTagProps, type CheckboxButtonEmits, type CheckboxButtonProps, type CheckboxEmits, type CheckboxExposed, type CheckboxGroupEmits, type CheckboxGroupExposed, type CheckboxGroupProps, type CheckboxProps, type CodeEditorEmits, type CodeEditorExposed, type CodeEditorLang, type CodeEditorProps, type CollapseEmits, type CollapseItemEmits, type CollapseItemProps, type CollapseModelValue, type CollapseProps, type CollapseValue, type ConditionConnector, type ConditionEditorEmits, type ConditionEditorExposed, type ConditionEditorProps, type EvaluateOptions as ConditionEvaluateOptions, type ConditionExpression, type ConditionField, type ConditionGroup, type ConditionLeaf, type ConditionNode, type ConditionValue, type ContextmenuEmits, type ContextmenuExposed, type ContextmenuItem, ContextmenuPanelDIKey, type ContextmenuProps, ContextmenuRootDIKey, type CssTransitionEmits, type CssTransitionExposed, type CssTransitionProps, type DatePanelEmits, type DatePanelProps, type DatePickerDataType, type DatePickerEmits, type DatePickerExposed, type DatePickerProps, type DateRangePickerDataType, type DateRangePickerEmits, type DateRangePickerExposed, type DateRangePickerProps, type DateRangeValue, type DialogEmits, type DialogExposed, type DialogProps, type DialogTransition, type DrawerDirection, type DrawerEmits, type DrawerExposed, type DrawerMode, type DrawerProps, type DropdownEmits, type DropdownExposed, type DropdownProps, type DualNavEmits, type DualNavExposed, type DualNavProps, type DualNavRailVariant, type DualNavRootItem, type EmptyEmits, type EmptyExposed, type EmptyProps, type ExpressionEditorEmits, type ExpressionEditorExposed, type ExpressionEditorProps, type ExpressionSelectableLevels, type FileViewerEmits, type FileViewerExposed, type FileViewerItem, type FileViewerKind, type FileViewerProps, type FloatButtonEmits, type FloatButtonExposed, type FloatButtonItem, type FloatButtonProps, type FormEmits, type FormExposed, type FormItemEmits, type FormItemExposed, type FormItemProps, type FormProps, type GanttChartEmits, type GanttChartExposed, type GanttChartProps, type GridEmits, type GridExposed, type GridInputEmits, type GridInputExposed, type GridInputProps, type GridItemProps, type GridProps, type GroupInputEmits, type GroupInputExposed, type GroupInputProps, type GroupNavEmits, type GroupNavGroup, type GroupNavProps, type IconEmits, type IconExposed, type IconProps, type ImageCropperChangePayload, type ImageCropperCropTransform, type ImageCropperEmits, type ImageCropperExposed, type ImageCropperProps, type ImageCropperResult, type ImageCropperResultOptions, type ImageCropperSelection, type InputEmits, type InputExposed, type InputProps, type LayoutEmits, type LayoutExposed, type LayoutProps, type ListEmits, type ListExposed, type ListProps, type LoadingEmits, type LoadingExposed, type LoadingProps, type LoadingType, type Message, type MessageConfirm, type MessageConfirmAction, type MessageConfirmEmits, type MessageConfirmExposed, type MessageConfirmInstance, type MessageConfirmOptions, type MessageConfirmProps, type MessageEmits, type MessageExposed, type MessageInstance, type MessageOptions, type MessageProps, type MessageType, type MultiAutoCompleteEmits, type MultiAutoCompleteExposed, type MultiAutoCompleteProps, type MultiSelectEmits, type MultiSelectExposed, type MultiSelectProps, type MultiTreeSelectEmits, type MultiTreeSelectExposed, type MultiTreeSelectProps, type NavEmits, type NavExposed, type NavItem, type NavProps, type NodeRenderExposed, type NodeRenderProps, type Notification, type NotificationEmits, type NotificationExposed, type NotificationInstance, type NotificationOptions, type NotificationPosition, type NotificationProps, type NumberEmits, type NumberExposed, type NumberInputEmits, type NumberInputExposed, type NumberInputProps, type NumberProps, type NumberRangeInputEmits, type NumberRangeInputExposed, type NumberRangeInputProps, type NumberRangeTuple, type PaginatorEmits, type PaginatorExposed, type PaginatorProps, type PaletteColorType, type PaletteEmits, type PaletteExposed, type PaletteHSV, type PaletteProps, type PaletteRGB, type PanelItem, type PanelType, type PasswordInputEmits, type PasswordInputExposed, type PasswordInputProps, type PopConfirmEmits, type PopConfirmExposed, type PopConfirmProps, type PopEmits, type PopExposed, type PopProps, type ProgressEmits, type ProgressExposed, type ProgressNodesEmits, type ProgressNodesExposed, type ProgressNodesProps, type ProgressProps, type QuickBatchEditEmits, type QuickBatchEditExposed, type QuickBatchEditProps, type RadioEmits, type RadioExposed, type RadioGroupEmits, type RadioGroupExposed, type RadioGroupProps, type RadioProps, type RichTextEditorEmits, type RichTextEditorExposed, type RichTextEditorProps, type RichTextFormat, type ScrollEmits, type ScrollExposed, type ScrollPosition, type ScrollProps, type SegmentEmits, type SegmentExposed, type SegmentItem, type SegmentProps, type SelectEmits, type SelectExposed, type SelectProps, type SliderEmits, type SliderExposed, type SliderProps, type StepsEmits, type StepsExposed, type StepsProps, type StepsSlotScope, type SwitchEmits, type SwitchExposed, type SwitchProps, type TabItem, type TableColumn, type TableColumnAlign, type TableColumnNode, type TableColumnRenderContext, type TableColumnSlotsScope, type TableColumnStyle, type TableEditorEmits, type TableEditorExposed, type TableEditorProps, type TableEmits, type TableExposed, type TableProps, type TableRow, type TableRowSlotsScope, type TableSummaryContext, type TabsEmits, type TabsExposed, type TabsHorizontalEmits, type TabsHorizontalExposed, type TabsHorizontalProps, type TabsProps, type TabsVerticalEmits, type TabsVerticalExposed, type TabsVerticalProps, type TagEmits, type TagExposed, type TagProps, type TextEditorEmits, type TextEditorExposed, type TextEditorProps, type TextEmits, type TextExposed, type TextProps, type TextareaEmits, type TextareaExposed, type TextareaProps, type ThemeExposed, type ThemeProps, type TipAlign, type TipDirection, type TipEmits, type TipExposed, type TipProps, type ToolbarItem, type TreeEmit, type TreeExposed, type TreeNode, type TreeNodeProps, type TreeProps, type TreeSelectEmits, type TreeSelectExposed, type TreeSelectProps, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, _sfc_main$42 as UImageCropper, input_default as UInput, _sfc_main$43 as UKbd, _sfc_main$44 as ULayout, _sfc_main$45 as UList, _sfc_main$46 as UListItem, _sfc_main$47 as ULoading, _sfc_main$48 as UMessage, _sfc_main$49 as UMessageConfirm, _sfc_main$50 as UMultiSelect, _sfc_main$51 as UMultiTreeSelect, _sfc_main$52 as UNav, _sfc_main$53 as UNavItem, _sfc_main$54 as UNavSub, NodeRender as UNodeRender, _sfc_main$55 as UNotification, _sfc_main$56 as UNumber, _sfc_main$57 as UNumberInput, _sfc_main$58 as UNumberRangeInput, _sfc_main$59 as UPaginator, _sfc_main$60 as UPalette, _sfc_main$61 as UPasswordInput, _sfc_main$62 as UPopConfirm, _sfc_main$63 as UProgress, _sfc_main$64 as UProgressNodes, _sfc_main$65 as URadio, _sfc_main$66 as URadioGroup, _sfc_main$67 as URichTextEditor, _sfc_main$68 as UScroll, _sfc_main$69 as USegment, _sfc_main$70 as USelect, _sfc_main$71 as USlider, _sfc_main$72 as USteps, _sfc_main$73 as USwitch, _sfc_main$74 as UTable, _sfc_main$75 as UTableEditor, _sfc_main$76 as UTabs, _sfc_main$77 as UTabsHorizontal, _sfc_main$78 as UTabsVertical, _sfc_main$79 as UTag, _sfc_main$80 as UText, _sfc_main$81 as UTextarea, _sfc_main$82 as UTheme, _sfc_main$83 as UTip, _sfc_main$84 as UTree, _sfc_main$85 as UTreeSelect, _sfc_main$86 as UWatermark, type UploaderEmits, type UploaderExposed, type UploaderProps, type VariableItem, type WatermarkEmits, type WatermarkExposed, type WatermarkProps, type _ActionExposed, type _ActionGroupExposed, type _AnimationExposed, type _AutoCompleteExposed, type _BadgeExposed, type _BatchEditExposed, type _BreadcrumbExposed, type _ButtonExposed, type _CalendarExposed, type _CardExposed, type _CascadeExposed, type _CheckTagExposed, type _CodeEditorExposed, type _ConditionEditorExposed, type _ContextmenuExposed, type _CssTransitionExposed, type _DatePickerExposed, type _DateRangePickerExposed, type _DialogExposed, type _DrawerExposed, type _DropdownExposed, type _DualNavExposed, type _EmptyExposed, type _ExpressionEditorExposed, type _FileViewerExposed, type _FloatButtonExposed, type _FormExposed, type _GanttChartExposed, type _GridExposed, type _GridInputExposed, type _GroupInputExposed, type _ImageCropperExposed, type _InputExposed, type _LayoutExposed, type _ListExposed, type _LoadingExposed, type _MessageConfirmExposed, type _MessageExposed, type _MultiAutoCompleteExposed, type _MultiSelectExposed, type _MultiTreeSelectExposed, type _NavExposed, type _NotificationExposed, type _PaginatorExposed, type _PaletteExposed, type _PasswordInputExposed, type _PopConfirmExposed, type _PopExposed, type _ProgressExposed, type _ProgressNodesExposed, type _QuickBatchEditExposed, type _RadioExposed, type _RadioGroupExposed, type _RichTextEditorExposed, type _ScrollExposed, type _SegmentExposed, type _SelectExposed, type _SliderExposed, type _StepsExposed, type _SwitchExposed, type _TableEditorExposed, type _TableExposed, type _TabsExposed, type _TabsHorizontalExposed, type _TabsVerticalExposed, type _TextEditorExposed, type _TextExposed, type _TextareaExposed, type _ThemeExposed, type _TipExposed, type _TreeExposed, type _TreeSelectExposed, type _UploaderExposed, type _WatermarkExposed, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
|
package/dist/install.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./style.js";
|
|
2
2
|
import { App, Plugin } from "vue";
|
|
3
3
|
//#region src/install.d.ts
|
|
4
|
-
declare function install(app: App): void;
|
|
5
|
-
declare const UltraUI: Plugin;
|
|
4
|
+
export declare function install(app: App): void;
|
|
5
|
+
export declare const UltraUI: Plugin;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { UltraUI
|
|
7
|
+
export { UltraUI as default };
|
|
8
8
|
//# sourceMappingURL=install.d.ts.map
|
package/dist/types/action.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ButtonProps } from "./button.js";
|
|
|
2
2
|
import { ColorType, DeconstructValue } from "@veltra/utils";
|
|
3
3
|
//#region src/types/action.d.ts
|
|
4
4
|
/** 操作组件属性 */
|
|
5
|
-
interface ActionProps extends ButtonProps {
|
|
5
|
+
export interface ActionProps extends ButtonProps {
|
|
6
6
|
/**
|
|
7
7
|
* 是否需要确认:true 时点击只弹确认气泡(UPopConfirm),点气泡里的「确认」才触发 `run`
|
|
8
8
|
* @default false
|
|
@@ -17,7 +17,7 @@ interface ActionProps extends ButtonProps {
|
|
|
17
17
|
inDropdown?: boolean;
|
|
18
18
|
}
|
|
19
19
|
/** 操作组组件属性 */
|
|
20
|
-
interface ActionGroupProps {
|
|
20
|
+
export interface ActionGroupProps {
|
|
21
21
|
/** 是否加载中 */
|
|
22
22
|
loading?: boolean;
|
|
23
23
|
/**
|
|
@@ -47,17 +47,16 @@ interface ActionGroupProps {
|
|
|
47
47
|
type?: ColorType;
|
|
48
48
|
}
|
|
49
49
|
/** 操作组件定义的事件 */
|
|
50
|
-
interface ActionEmits {
|
|
50
|
+
export interface ActionEmits {
|
|
51
51
|
(e: 'run'): void;
|
|
52
52
|
}
|
|
53
53
|
/** 操作组件暴露的属性和方法(组件内部使用) */
|
|
54
|
-
interface _ActionExposed {}
|
|
55
|
-
interface _ActionGroupExposed {
|
|
54
|
+
export interface _ActionExposed {}
|
|
55
|
+
export interface _ActionGroupExposed {
|
|
56
56
|
closeTip: () => void;
|
|
57
57
|
}
|
|
58
58
|
/** 操作组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
59
|
-
type ActionExposed = DeconstructValue<_ActionExposed>;
|
|
60
|
-
type ActionGroupExposed = DeconstructValue<_ActionGroupExposed>;
|
|
59
|
+
export type ActionExposed = DeconstructValue<_ActionExposed>;
|
|
60
|
+
export type ActionGroupExposed = DeconstructValue<_ActionGroupExposed>;
|
|
61
61
|
//#endregion
|
|
62
|
-
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, _ActionExposed, _ActionGroupExposed };
|
|
63
62
|
//# sourceMappingURL=action.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeconstructValue } from "@veltra/utils";
|
|
2
2
|
//#region src/types/animation.d.ts
|
|
3
3
|
/** 动画组件属性 */
|
|
4
|
-
interface AnimationProps {
|
|
4
|
+
export interface AnimationProps {
|
|
5
5
|
/**
|
|
6
6
|
* 标签元素
|
|
7
7
|
* @default 'div'
|
|
@@ -10,13 +10,12 @@ interface AnimationProps {
|
|
|
10
10
|
inView?: Record<string, any>;
|
|
11
11
|
}
|
|
12
12
|
/** 动画组件定义的事件 */
|
|
13
|
-
interface AnimationEmits {
|
|
13
|
+
export interface AnimationEmits {
|
|
14
14
|
(e: 'update:modelValue', value: string): void;
|
|
15
15
|
}
|
|
16
16
|
/** 动画组件暴露的属性和方法(组件内部使用) */
|
|
17
|
-
interface _AnimationExposed {}
|
|
17
|
+
export interface _AnimationExposed {}
|
|
18
18
|
/** 动画组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
19
|
-
type AnimationExposed = DeconstructValue<_AnimationExposed>;
|
|
19
|
+
export type AnimationExposed = DeconstructValue<_AnimationExposed>;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { AnimationEmits, AnimationExposed, AnimationProps, _AnimationExposed };
|
|
22
21
|
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeconstructValue, FormComponentProps } from "@veltra/utils";
|
|
2
2
|
//#region src/types/auto-complete.d.ts
|
|
3
3
|
/** 自动补全组件组件属性 */
|
|
4
|
-
interface AutoCompleteProps extends FormComponentProps {
|
|
4
|
+
export interface AutoCompleteProps extends FormComponentProps {
|
|
5
5
|
modelValue?: string;
|
|
6
6
|
/** 占位符 */
|
|
7
7
|
placeholder?: string;
|
|
@@ -13,17 +13,16 @@ interface AutoCompleteProps extends FormComponentProps {
|
|
|
13
13
|
allowCustom?: boolean;
|
|
14
14
|
}
|
|
15
15
|
/** 自动补全组件组件定义的事件 */
|
|
16
|
-
interface AutoCompleteEmits {
|
|
16
|
+
export interface AutoCompleteEmits {
|
|
17
17
|
(e: 'update:modelValue', value: string): void;
|
|
18
18
|
(e: 'select', value: string): void;
|
|
19
19
|
}
|
|
20
20
|
/** 自动补全组件组件暴露的属性和方法(组件内部使用) */
|
|
21
|
-
interface _AutoCompleteExposed {
|
|
21
|
+
export interface _AutoCompleteExposed {
|
|
22
22
|
open: () => void;
|
|
23
23
|
close: () => void;
|
|
24
24
|
}
|
|
25
25
|
/** 自动补全组件组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
26
|
-
type AutoCompleteExposed = DeconstructValue<_AutoCompleteExposed>;
|
|
26
|
+
export type AutoCompleteExposed = DeconstructValue<_AutoCompleteExposed>;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, _AutoCompleteExposed };
|
|
29
28
|
//# sourceMappingURL=auto-complete.d.ts.map
|
package/dist/types/badge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColorType, ComponentProps, DeconstructValue } from "@veltra/utils";
|
|
2
2
|
//#region src/types/badge.d.ts
|
|
3
3
|
/** 徽章组件属性 */
|
|
4
|
-
interface BadgeProps extends ComponentProps {
|
|
4
|
+
export interface BadgeProps extends ComponentProps {
|
|
5
5
|
/** 显示值 */
|
|
6
6
|
value?: number | string;
|
|
7
7
|
/** 类别 */
|
|
@@ -16,13 +16,12 @@ interface BadgeProps extends ComponentProps {
|
|
|
16
16
|
dot?: boolean;
|
|
17
17
|
}
|
|
18
18
|
/** 徽章组件定义的事件 */
|
|
19
|
-
interface BadgeEmits {
|
|
19
|
+
export interface BadgeEmits {
|
|
20
20
|
(e: 'update:modelValue', value: string): void;
|
|
21
21
|
}
|
|
22
22
|
/** 徽章组件暴露的属性和方法(组件内部使用) */
|
|
23
|
-
interface _BadgeExposed {}
|
|
23
|
+
export interface _BadgeExposed {}
|
|
24
24
|
/** 徽章组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
25
|
-
type BadgeExposed = DeconstructValue<_BadgeExposed>;
|
|
25
|
+
export type BadgeExposed = DeconstructValue<_BadgeExposed>;
|
|
26
26
|
//#endregion
|
|
27
|
-
export { BadgeEmits, BadgeExposed, BadgeProps, _BadgeExposed };
|
|
28
27
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -3,11 +3,11 @@ import { TableColumn, TableColumnSlotsScope, TableEmits, TableProps, TableRow }
|
|
|
3
3
|
import { DeconstructValue } from "@veltra/utils";
|
|
4
4
|
//#region src/types/batch-edit.d.ts
|
|
5
5
|
/** 批量编辑列 */
|
|
6
|
-
interface BatchEditColumn extends TableColumn {}
|
|
7
|
-
type BatchEditFeature = 'create' | 'update' | 'delete' | 'view' | 'createChild';
|
|
8
|
-
type BatchEditFormStatus = 'hidden';
|
|
6
|
+
export interface BatchEditColumn extends TableColumn {}
|
|
7
|
+
export type BatchEditFeature = 'create' | 'update' | 'delete' | 'view' | 'createChild';
|
|
8
|
+
export type BatchEditFormStatus = 'hidden';
|
|
9
9
|
/** 批量编辑状态 */
|
|
10
|
-
interface BatchEditStates {
|
|
10
|
+
export interface BatchEditStates {
|
|
11
11
|
/** 层级 */
|
|
12
12
|
depth: number;
|
|
13
13
|
/** 表单可见性 */
|
|
@@ -24,7 +24,7 @@ interface BatchEditStates {
|
|
|
24
24
|
indexPath: number[];
|
|
25
25
|
}
|
|
26
26
|
/** 批量编辑组件属性 */
|
|
27
|
-
interface BatchEditProps extends TableProps {
|
|
27
|
+
export interface BatchEditProps extends TableProps {
|
|
28
28
|
/**
|
|
29
29
|
* 表单数据
|
|
30
30
|
* @description 与右侧 UForm 绑定的 reactive 对象
|
|
@@ -98,7 +98,7 @@ interface BatchEditProps extends TableProps {
|
|
|
98
98
|
actionsProps?: Partial<Record<BatchEditFeature, ActionProps>>;
|
|
99
99
|
}
|
|
100
100
|
/** 批量编辑组件定义的事件 */
|
|
101
|
-
interface BatchEditEmits extends TableEmits {
|
|
101
|
+
export interface BatchEditEmits extends TableEmits {
|
|
102
102
|
/** 更新数据 */
|
|
103
103
|
(e: 'update:data', value: Record<string, any>[]): void;
|
|
104
104
|
/** 点击底部「新增一行」 */
|
|
@@ -110,7 +110,7 @@ interface BatchEditEmits extends TableEmits {
|
|
|
110
110
|
/** 点击「添加子级」,参数为父级行 */
|
|
111
111
|
(e: 'create-child', row: TableRow): void;
|
|
112
112
|
}
|
|
113
|
-
type BatchEditSlots = {
|
|
113
|
+
export type BatchEditSlots = {
|
|
114
114
|
form?: (props: {
|
|
115
115
|
/** 当前编辑的层级 */
|
|
116
116
|
depth?: number;
|
|
@@ -130,9 +130,8 @@ type BatchEditSlots = {
|
|
|
130
130
|
[key: `column:${string}`]: (props: TableColumnSlotsScope) => any;
|
|
131
131
|
}>;
|
|
132
132
|
/** 批量编辑组件暴露的属性和方法(组件内部使用) */
|
|
133
|
-
interface _BatchEditExposed {}
|
|
133
|
+
export interface _BatchEditExposed {}
|
|
134
134
|
/** 批量编辑组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
135
|
-
type BatchEditExposed = DeconstructValue<_BatchEditExposed>;
|
|
135
|
+
export type BatchEditExposed = DeconstructValue<_BatchEditExposed>;
|
|
136
136
|
//#endregion
|
|
137
|
-
export { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditFormStatus, BatchEditProps, BatchEditSlots, BatchEditStates, _BatchEditExposed };
|
|
138
137
|
//# sourceMappingURL=batch-edit.d.ts.map
|