@dazhicheng/ui 1.6.7 → 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/tt-form/src/form-render/expandable.js +31 -32
- package/dist/components/tt-form/src/useFormContext.js +1 -1
- package/dist/components/tt-table/index.d.ts +3 -15
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/Table.vue.d.ts +1 -1
- package/dist/components/tt-table/src/Table.vue.js +3 -3
- package/dist/components/tt-table/src/TableForm.vue.js +168 -159
- package/dist/components/tt-table/src/components/TableAction.vue.d.ts +2 -12
- package/dist/components/tt-table/src/components/TableAction.vue.js +78 -175
- package/dist/components/tt-table/src/hooks/useGridProps.js +64 -60
- package/dist/components/tt-table/src/hooks/useTableData.js +77 -74
- package/dist/components/tt-table/src/types/table.d.ts +2 -1
- package/dist/components/tt-table/src/utils/table-api.d.ts +2 -1
- package/dist/components/tt-table/src/utils/table-api.js +3 -2
- package/dist/components/tt-vtable/index.js +54 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +188 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue.js +227 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +32 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +121 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +64 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +97 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +53 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +52 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +35 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +50 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +63 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +126 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +133 -0
- package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +4 -0
- package/dist/components/tt-vtable/src/composables/useVTable.d.ts +41 -0
- package/dist/components/tt-vtable/src/composables/useVTable.js +25 -0
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +13 -0
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +92 -0
- package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +13 -0
- package/dist/components/tt-vtable/src/composables/useVTableRender.js +13 -0
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +10 -0
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +63 -0
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +37 -0
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +133 -0
- package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +8 -0
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +23 -0
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +70 -0
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +38 -0
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +41 -0
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +45 -0
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +73 -0
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +25 -0
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +25 -0
- package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +29 -0
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +36 -0
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +52 -0
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +74 -0
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +232 -0
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +48 -0
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +102 -0
- package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +51 -0
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +40 -0
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +51 -0
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +38 -0
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +57 -0
- package/dist/components/tt-vtable/src/features/records/index.d.ts +3 -0
- package/dist/components/tt-vtable/src/features/records/record-index.d.ts +122 -0
- package/dist/components/tt-vtable/src/features/records/record-index.js +209 -0
- package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +41 -0
- package/dist/components/tt-vtable/src/features/records/useRecordSource.js +249 -0
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +65 -0
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +129 -0
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +60 -0
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +125 -0
- package/dist/components/tt-vtable/src/public/index.d.ts +7 -0
- package/dist/components/tt-vtable/src/public/table-api.d.ts +215 -0
- package/dist/components/tt-vtable/src/public/table-column.d.ts +123 -0
- package/dist/components/tt-vtable/src/public/table-errors.d.ts +26 -0
- package/dist/components/tt-vtable/src/public/table-errors.js +26 -0
- package/dist/components/tt-vtable/src/public/table-events.d.ts +69 -0
- package/dist/components/tt-vtable/src/public/table-props.d.ts +216 -0
- package/dist/components/tt-vtable/src/public/table-slots.d.ts +37 -0
- package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +12 -0
- package/dist/components/tt-vtable/src/runtime/createVTableController.js +238 -0
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +79 -0
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +380 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +129 -115
- package/dist/packages/utils/src/is.js +46 -37
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/dist/assets/svg/action_more.svg.js +0 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { shallowRef as g } from "vue";
|
|
2
|
+
import { changeVisactorCellValue as C, deleteVisactorRecords as h, updateVisactorRecords as I, addVisactorRecords as P, setVisactorRecords as b } from "./record-adapter.js";
|
|
3
|
+
function x(u) {
|
|
4
|
+
const a = g();
|
|
5
|
+
let n = !1;
|
|
6
|
+
a.value = u;
|
|
7
|
+
function o() {
|
|
8
|
+
return n ? void 0 : a.value;
|
|
9
|
+
}
|
|
10
|
+
function l(e) {
|
|
11
|
+
n || (a.value = e);
|
|
12
|
+
}
|
|
13
|
+
function r(e) {
|
|
14
|
+
a.value && b(a.value, e);
|
|
15
|
+
}
|
|
16
|
+
function i(e, t) {
|
|
17
|
+
a.value && P(a.value, e, t);
|
|
18
|
+
}
|
|
19
|
+
function c(e, t) {
|
|
20
|
+
a.value && I(a.value, e, t);
|
|
21
|
+
}
|
|
22
|
+
function s(e) {
|
|
23
|
+
a.value && h(a.value, e);
|
|
24
|
+
}
|
|
25
|
+
function d(e, t, m) {
|
|
26
|
+
return a.value ? C(a.value, e, t, m) : !1;
|
|
27
|
+
}
|
|
28
|
+
function f(e) {
|
|
29
|
+
return a.value ? a.value.updateOption(e) : Promise.resolve();
|
|
30
|
+
}
|
|
31
|
+
function v(e) {
|
|
32
|
+
var t;
|
|
33
|
+
(t = a.value) == null || t.updateColumns(e);
|
|
34
|
+
}
|
|
35
|
+
function p(e) {
|
|
36
|
+
var t;
|
|
37
|
+
(t = a.value) == null || t.updatePagination(e);
|
|
38
|
+
}
|
|
39
|
+
function R() {
|
|
40
|
+
var e;
|
|
41
|
+
(e = a.value) == null || e.renderWithRecreateCells();
|
|
42
|
+
}
|
|
43
|
+
function V() {
|
|
44
|
+
n || (n = !0, a.value = void 0);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
getInstance: o,
|
|
48
|
+
setInstance: l,
|
|
49
|
+
setRecords: r,
|
|
50
|
+
addRecords: i,
|
|
51
|
+
updateRecords: c,
|
|
52
|
+
deleteRecords: s,
|
|
53
|
+
changeCellValue: d,
|
|
54
|
+
updateOptions: f,
|
|
55
|
+
updateColumns: v,
|
|
56
|
+
updatePagination: p,
|
|
57
|
+
recalculate: R,
|
|
58
|
+
release: V
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
x as createVisactorTableEngine
|
|
63
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TYPES } from '@visactor/vtable';
|
|
2
|
+
import { TtVTableApi, TtVTableColumn, TtVTableRendererSlots, TtVTableRowKey } from '../../public';
|
|
3
|
+
/** 创建正文 Vue DOM 布局所需上下文。 */
|
|
4
|
+
export interface CreateVueCellLayoutOptions<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey> {
|
|
5
|
+
/** 当前语义列。 */
|
|
6
|
+
column: TtVTableColumn<Row, Key>;
|
|
7
|
+
/** 当前稳定公共 API。 */
|
|
8
|
+
tableApi: TtVTableApi<Row, Key>;
|
|
9
|
+
/** 当前组件可用的命名插槽。 */
|
|
10
|
+
rendererSlots: TtVTableRendererSlots<Row, Key>;
|
|
11
|
+
/** 从记录读取业务主键。 */
|
|
12
|
+
getRowKey: (record: Row) => Key;
|
|
13
|
+
}
|
|
14
|
+
/** 创建表头 Vue DOM 布局所需上下文。 */
|
|
15
|
+
export interface CreateVueHeaderLayoutOptions<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey> {
|
|
16
|
+
/** 当前语义列。 */
|
|
17
|
+
column: TtVTableColumn<Row, Key>;
|
|
18
|
+
/** 当前稳定公共 API。 */
|
|
19
|
+
tableApi: TtVTableApi<Row, Key>;
|
|
20
|
+
/** 当前组件可用的命名插槽。 */
|
|
21
|
+
rendererSlots: TtVTableRendererSlots<Row, Key>;
|
|
22
|
+
}
|
|
23
|
+
/** 官方 customLayout 返回值。 */
|
|
24
|
+
type VisactorCustomLayout = TYPES.ICustomLayoutFuc;
|
|
25
|
+
/**
|
|
26
|
+
* 创建正文 Vue DOM customLayout。
|
|
27
|
+
* @param options renderer、API、插槽与主键读取配置
|
|
28
|
+
* @returns 原生 VTable customLayout
|
|
29
|
+
*/
|
|
30
|
+
export declare function createVueCellLayout<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(options: CreateVueCellLayoutOptions<Row, Key>): VisactorCustomLayout;
|
|
31
|
+
/**
|
|
32
|
+
* 创建表头 Vue DOM headerCustomLayout。
|
|
33
|
+
* @param options renderer、API 与插槽配置
|
|
34
|
+
* @returns 原生 VTable headerCustomLayout
|
|
35
|
+
*/
|
|
36
|
+
export declare function createVueHeaderLayout<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(options: CreateVueHeaderLayoutOptions<Row, Key>): VisactorCustomLayout;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Group as V } from "@visactor/vue-vtable";
|
|
2
|
+
import { createCustomLayout as w } from "@visactor/vue-vtable/es/utils/customLayoutUtils";
|
|
3
|
+
import "axios";
|
|
4
|
+
import "element-plus";
|
|
5
|
+
import { isPromise as S, isObject as R, isFunction as u, isNumber as g, isDef as h } from "../../../../../packages/utils/src/is.js";
|
|
6
|
+
import { defineComponent as $, h as a, Fragment as k } from "vue";
|
|
7
|
+
import "dayjs";
|
|
8
|
+
import "numeral";
|
|
9
|
+
import "xe-utils";
|
|
10
|
+
import "dayjs/plugin/utc";
|
|
11
|
+
import "dayjs/plugin/timezone";
|
|
12
|
+
import "../../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
13
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
14
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
15
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
16
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
17
|
+
import "lodash-es";
|
|
18
|
+
import { createTtVTableError as p } from "../../public/table-errors.js";
|
|
19
|
+
const I = $({
|
|
20
|
+
name: "VTableVueRendererHost",
|
|
21
|
+
props: {
|
|
22
|
+
renderContent: { type: Function, required: !0 },
|
|
23
|
+
renderContext: { type: Object, required: !0 }
|
|
24
|
+
},
|
|
25
|
+
setup(e) {
|
|
26
|
+
return () => e.renderContent(e.renderContext);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function d(e, t) {
|
|
30
|
+
return a(I, {
|
|
31
|
+
renderContent: e,
|
|
32
|
+
renderContext: t
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function L(e) {
|
|
36
|
+
return `${g(e) ? "number" : "string"}:${encodeURIComponent(String(e))}`;
|
|
37
|
+
}
|
|
38
|
+
function b(e, t) {
|
|
39
|
+
if (!(u(e.render) || e.slot))
|
|
40
|
+
throw p("TT_VTABLE_RENDERER_INVALID", `列 ${t} 的 Vue renderer 必须配置 render 或 slot。`, {
|
|
41
|
+
columnKey: t
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function A(e, t) {
|
|
45
|
+
return a(k, { key: t }, [e]);
|
|
46
|
+
}
|
|
47
|
+
function f(e, t, r, l, o) {
|
|
48
|
+
const c = o.table, n = o.rect ?? c.getCellRect(o.col, o.row), m = A(e, t), i = a(V, {
|
|
49
|
+
width: n.width,
|
|
50
|
+
height: n.height,
|
|
51
|
+
clip: !0,
|
|
52
|
+
pickable: !1,
|
|
53
|
+
vue: {
|
|
54
|
+
id: t,
|
|
55
|
+
element: m,
|
|
56
|
+
pointerEvents: r
|
|
57
|
+
}
|
|
58
|
+
}), { rootComponent: s } = w(i, l, o);
|
|
59
|
+
return { rootContainer: s, renderDefault: !1, enableCellPadding: !1 };
|
|
60
|
+
}
|
|
61
|
+
function _(e, t, r, l) {
|
|
62
|
+
if (u(e.render)) return d(e.render, r);
|
|
63
|
+
const o = e.slot ? t[e.slot] : void 0;
|
|
64
|
+
if (!u(o))
|
|
65
|
+
throw p("TT_VTABLE_SLOT_MISSING", `列 ${l} 缺少命名插槽 ${e.slot ?? ""}。`, {
|
|
66
|
+
columnKey: l,
|
|
67
|
+
slot: e.slot
|
|
68
|
+
});
|
|
69
|
+
return d(o, r);
|
|
70
|
+
}
|
|
71
|
+
function E(e, t, r, l) {
|
|
72
|
+
if (u(e.render)) return d(e.render, r);
|
|
73
|
+
const o = e.slot ? t[e.slot] : void 0;
|
|
74
|
+
if (!u(o))
|
|
75
|
+
throw p("TT_VTABLE_SLOT_MISSING", `列 ${l} 缺少表头命名插槽 ${e.slot ?? ""}。`, {
|
|
76
|
+
columnKey: l,
|
|
77
|
+
slot: e.slot
|
|
78
|
+
});
|
|
79
|
+
return d(o, r);
|
|
80
|
+
}
|
|
81
|
+
function Y(e) {
|
|
82
|
+
const t = e.column.renderer;
|
|
83
|
+
return b(t, e.column.key), (r) => {
|
|
84
|
+
const l = r.table, o = l.getCellOriginRecord(r.col, r.row);
|
|
85
|
+
if (S(o) || !R(o))
|
|
86
|
+
return f(
|
|
87
|
+
void 0,
|
|
88
|
+
`${e.column.key}:pending:${r.col}:${r.row}`,
|
|
89
|
+
!1,
|
|
90
|
+
!1,
|
|
91
|
+
r
|
|
92
|
+
);
|
|
93
|
+
const c = o, n = e.getRowKey(c), m = l.getRecordShowIndexByCell(r.col, r.row), i = `${e.column.key}:${L(n)}`, s = {
|
|
94
|
+
record: c,
|
|
95
|
+
rowKey: n,
|
|
96
|
+
rowIndex: m,
|
|
97
|
+
column: e.column,
|
|
98
|
+
field: e.column.field,
|
|
99
|
+
value: r.value,
|
|
100
|
+
tableApi: e.tableApi,
|
|
101
|
+
setCellValue: (T) => {
|
|
102
|
+
h(e.column.field) && e.tableApi.records.setCellValue(n, e.column.field, T, "renderer");
|
|
103
|
+
},
|
|
104
|
+
nativeContext: {
|
|
105
|
+
col: r.col,
|
|
106
|
+
row: r.row,
|
|
107
|
+
table: l,
|
|
108
|
+
rect: r.rect
|
|
109
|
+
}
|
|
110
|
+
}, y = _(t, e.rendererSlots, s, e.column.key);
|
|
111
|
+
return f(y, i, !!t.interactive, !1, r);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function Z(e) {
|
|
115
|
+
const t = e.column.headerRenderer;
|
|
116
|
+
return b(t, e.column.key), (r) => {
|
|
117
|
+
const l = r.table, o = `${e.column.key}:header`, c = {
|
|
118
|
+
column: e.column,
|
|
119
|
+
tableApi: e.tableApi,
|
|
120
|
+
nativeContext: {
|
|
121
|
+
col: r.col,
|
|
122
|
+
row: r.row,
|
|
123
|
+
table: l,
|
|
124
|
+
rect: r.rect
|
|
125
|
+
}
|
|
126
|
+
}, n = E(t, e.rendererSlots, c, e.column.key);
|
|
127
|
+
return f(n, o, !!t.interactive, !0, r);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
Y as createVueCellLayout,
|
|
132
|
+
Z as createVueHeaderLayout
|
|
133
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** TtVTable 内部 VisActor 边界。 */
|
|
2
|
+
export * from './createListTable';
|
|
3
|
+
export * from './createVueCellLayout';
|
|
4
|
+
export * from './native-boundaries';
|
|
5
|
+
export * from './record-adapter';
|
|
6
|
+
export * from './toColumnDefinitions';
|
|
7
|
+
export * from './toListTableOptions';
|
|
8
|
+
export * from './types';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ListTable } from '@visactor/vtable';
|
|
2
|
+
import { TtVTableNativeEvents, TtVTableNativeOptions } from '../../public';
|
|
3
|
+
/** 运行时禁止业务覆盖的原生 options。 */
|
|
4
|
+
export declare const TT_VTABLE_RESERVED_NATIVE_OPTIONS: readonly ["columns", "pagination", "records"];
|
|
5
|
+
/** 运行时禁止业务监听的原生事件。 */
|
|
6
|
+
export declare const TT_VTABLE_RESERVED_NATIVE_EVENTS: readonly ["change_cell_value", "change_cell_values", "checkbox_state_change", "radio_state_change", "tree_hierarchy_state_change"];
|
|
7
|
+
/**
|
|
8
|
+
* 校验原生 options 没有覆盖封装层受控状态。
|
|
9
|
+
* @param nativeOptions 业务传入的原生 options
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateNativeOptions(nativeOptions?: TtVTableNativeOptions): void;
|
|
12
|
+
/**
|
|
13
|
+
* 校验业务没有通过 nativeEvents 订阅 feature 独占事件。
|
|
14
|
+
* @param nativeEvents 业务传入的原生事件
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateNativeEvents(nativeEvents?: TtVTableNativeEvents): void;
|
|
17
|
+
/**
|
|
18
|
+
* 绑定允许透传的原生事件,并返回幂等清理函数。
|
|
19
|
+
* @param table 原生 ListTable
|
|
20
|
+
* @param nativeEvents 业务原生事件集合
|
|
21
|
+
* @returns 事件清理函数
|
|
22
|
+
*/
|
|
23
|
+
export declare function bindNativeEvents(table: ListTable, nativeEvents?: TtVTableNativeEvents): () => void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import "axios";
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import { isObject as i, isFunction as T } from "../../../../../packages/utils/src/is.js";
|
|
4
|
+
import "vue";
|
|
5
|
+
import "dayjs";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
8
|
+
import "dayjs/plugin/utc";
|
|
9
|
+
import "dayjs/plugin/timezone";
|
|
10
|
+
import "../../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
11
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
+
import "lodash-es";
|
|
16
|
+
import { createTtVTableError as n } from "../../public/table-errors.js";
|
|
17
|
+
const _ = ["columns", "pagination", "records"], s = [
|
|
18
|
+
"change_cell_value",
|
|
19
|
+
"change_cell_values",
|
|
20
|
+
"checkbox_state_change",
|
|
21
|
+
"radio_state_change",
|
|
22
|
+
"tree_hierarchy_state_change"
|
|
23
|
+
];
|
|
24
|
+
function B(t) {
|
|
25
|
+
if (!t || !i(t)) return;
|
|
26
|
+
_.forEach((e) => {
|
|
27
|
+
if (e in t)
|
|
28
|
+
throw n("TT_VTABLE_NATIVE_OPTION_RESERVED", `nativeOptions.${e} 由 TtVTable 控制。`, {
|
|
29
|
+
optionKey: e
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
const r = t.customConfig;
|
|
33
|
+
if (i(r) && "createReactContainer" in r)
|
|
34
|
+
throw n(
|
|
35
|
+
"TT_VTABLE_NATIVE_OPTION_RESERVED",
|
|
36
|
+
"nativeOptions.customConfig.createReactContainer 由 TtVTable 控制。",
|
|
37
|
+
{ optionKey: "customConfig.createReactContainer" }
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function f(t) {
|
|
41
|
+
!t || !i(t) || s.forEach((r) => {
|
|
42
|
+
if (r in t)
|
|
43
|
+
throw n("TT_VTABLE_NATIVE_EVENT_RESERVED", `nativeEvents.${r} 由 TtVTable 内部处理。`, {
|
|
44
|
+
eventName: r
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function m(t, r, e) {
|
|
49
|
+
const o = e;
|
|
50
|
+
return t.on(r, o);
|
|
51
|
+
}
|
|
52
|
+
function D(t, r) {
|
|
53
|
+
f(r);
|
|
54
|
+
const e = [];
|
|
55
|
+
r && Object.keys(r).forEach((a) => {
|
|
56
|
+
const E = r[a];
|
|
57
|
+
T(E) && e.push(m(t, a, E));
|
|
58
|
+
});
|
|
59
|
+
let o = !1;
|
|
60
|
+
return () => {
|
|
61
|
+
o || (o = !0, e.forEach((c) => t.off(c)), e.length = 0);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
s as TT_VTABLE_RESERVED_NATIVE_EVENTS,
|
|
66
|
+
_ as TT_VTABLE_RESERVED_NATIVE_OPTIONS,
|
|
67
|
+
D as bindNativeEvents,
|
|
68
|
+
f as validateNativeEvents,
|
|
69
|
+
B as validateNativeOptions
|
|
70
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ListTable } from '@visactor/vtable';
|
|
2
|
+
import { TtVTableFieldPath } from '../../public';
|
|
3
|
+
import { VisactorRecordIndex } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* 使用原生 setRecords 全量替换工作列表。
|
|
6
|
+
* @param table 原生 ListTable
|
|
7
|
+
* @param records 运行时可变工作列表
|
|
8
|
+
*/
|
|
9
|
+
export declare function setVisactorRecords<Row extends Record<string, unknown>>(table: ListTable, records: Row[]): void;
|
|
10
|
+
/**
|
|
11
|
+
* 使用原生 addRecords 插入记录。
|
|
12
|
+
* @param table 原生 ListTable
|
|
13
|
+
* @param records 待插入记录
|
|
14
|
+
* @param recordIndex 根记录或树节点源索引
|
|
15
|
+
*/
|
|
16
|
+
export declare function addVisactorRecords<Row extends Record<string, unknown>>(table: ListTable, records: Row[], recordIndex?: VisactorRecordIndex): void;
|
|
17
|
+
/**
|
|
18
|
+
* 使用原生 updateRecords 一次更新多条记录。
|
|
19
|
+
* @param table 原生 ListTable
|
|
20
|
+
* @param records 更新后的记录
|
|
21
|
+
* @param recordIndexes 对应源索引
|
|
22
|
+
*/
|
|
23
|
+
export declare function updateVisactorRecords<Row extends Record<string, unknown>>(table: ListTable, records: Row[], recordIndexes: VisactorRecordIndex[]): void;
|
|
24
|
+
/**
|
|
25
|
+
* 使用原生 deleteRecords 删除多条记录。
|
|
26
|
+
* @param table 原生 ListTable
|
|
27
|
+
* @param recordIndexes 待删除源索引
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteVisactorRecords(table: ListTable, recordIndexes: VisactorRecordIndex[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* 使用原生 changeCellValue 刷新一个可见单元格。
|
|
32
|
+
* @param table 原生 ListTable
|
|
33
|
+
* @param recordIndex 根记录或树节点源索引
|
|
34
|
+
* @param field 字段路径
|
|
35
|
+
* @param value 最新运行时值
|
|
36
|
+
* @returns 是否命中一个可见单元格
|
|
37
|
+
*/
|
|
38
|
+
export declare function changeVisactorCellValue(table: ListTable, recordIndex: VisactorRecordIndex, field: TtVTableFieldPath, value: unknown): boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "axios";
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import { isNumber as c, isArray as l } from "../../../../../packages/utils/src/is.js";
|
|
4
|
+
import "vue";
|
|
5
|
+
import "dayjs";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
8
|
+
import "dayjs/plugin/utc";
|
|
9
|
+
import "dayjs/plugin/timezone";
|
|
10
|
+
import "../../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
11
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
|
+
import "../../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
+
import "lodash-es";
|
|
16
|
+
function y(e, r) {
|
|
17
|
+
e.setRecords(r);
|
|
18
|
+
}
|
|
19
|
+
function B(e, r, o) {
|
|
20
|
+
e.addRecords(r, o, !1);
|
|
21
|
+
}
|
|
22
|
+
function F(e, r, o) {
|
|
23
|
+
e.updateRecords(r, o, !1);
|
|
24
|
+
}
|
|
25
|
+
function I(e, r) {
|
|
26
|
+
const o = r.filter(c), i = r.filter(l);
|
|
27
|
+
i.length && e.deleteRecords(i, !1), o.length && e.deleteRecords(o, !1);
|
|
28
|
+
}
|
|
29
|
+
function N(e, r, o, i) {
|
|
30
|
+
const t = e.getCellAddrByFieldRecord(o, r);
|
|
31
|
+
if (!t || t.col < 0 || t.row < 0) return !1;
|
|
32
|
+
const s = i;
|
|
33
|
+
return e.changeCellValue(t.col, t.row, s, !1, !1, !0), !0;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
B as addVisactorRecords,
|
|
37
|
+
N as changeVisactorCellValue,
|
|
38
|
+
I as deleteVisactorRecords,
|
|
39
|
+
y as setVisactorRecords,
|
|
40
|
+
F as updateVisactorRecords
|
|
41
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ColumnDefine } from '@visactor/vtable';
|
|
2
|
+
import { TtVTableApi, TtVTableColumn, TtVTableRendererSlots, TtVTableRowKey } from '../../public';
|
|
3
|
+
/** 列转换所需的稳定运行时依赖。 */
|
|
4
|
+
export interface ToColumnDefinitionsOptions<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey> {
|
|
5
|
+
/** 当前稳定公共 API。 */
|
|
6
|
+
tableApi: TtVTableApi<Row, Key>;
|
|
7
|
+
/** 当前组件可用的 Vue renderer 插槽。 */
|
|
8
|
+
rendererSlots: TtVTableRendererSlots<Row, Key>;
|
|
9
|
+
/** 从记录读取业务主键。 */
|
|
10
|
+
getRowKey: (record: Row) => Key;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 按左冻结、普通、右冻结顺序规范顶层列。
|
|
14
|
+
* @param columns 业务语义列
|
|
15
|
+
* @returns 保持各分组相对顺序的顶层列
|
|
16
|
+
*/
|
|
17
|
+
export declare function toFrozenColumnOrder<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(columns: readonly TtVTableColumn<Row, Key>[]): TtVTableColumn<Row, Key>[];
|
|
18
|
+
/**
|
|
19
|
+
* 校验整棵列树的 column.key 唯一且非空。
|
|
20
|
+
* @param columns 业务语义列
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateColumnKeys<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(columns: readonly TtVTableColumn<Row, Key>[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* 把语义列树转换为原生 VTable 列。
|
|
25
|
+
* @param columns 业务语义列
|
|
26
|
+
* @param options 稳定运行时依赖
|
|
27
|
+
* @param shouldValidate 是否校验整棵列树
|
|
28
|
+
* @returns 原生列集合
|
|
29
|
+
*/
|
|
30
|
+
export declare function toColumnDefinitions<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(columns: readonly TtVTableColumn<Row, Key>[], options: ToColumnDefinitionsOptions<Row, Key>, shouldValidate?: boolean): ColumnDefine[];
|
|
31
|
+
/**
|
|
32
|
+
* 计算当前顶层左、右冻结列数量。
|
|
33
|
+
* @param columns 已按冻结位置排序的顶层列
|
|
34
|
+
* @returns 左、右冻结列数量
|
|
35
|
+
*/
|
|
36
|
+
export declare function getFrozenColumnCounts<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(columns: readonly TtVTableColumn<Row, Key>[]): {
|
|
37
|
+
frozenColCount: number;
|
|
38
|
+
rightFrozenColCount: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 汇总列级 Vue DOM 缓存建议值。
|
|
42
|
+
* @param columns 业务语义列
|
|
43
|
+
* @returns 所有有效列级缓存上限之和
|
|
44
|
+
*/
|
|
45
|
+
export declare function getColumnDomCacheCount<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(columns: readonly TtVTableColumn<Row, Key>[]): number | undefined;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createTtVTableError as C } from "../../public/table-errors.js";
|
|
2
|
+
import { createVueHeaderLayout as d, createVueCellLayout as h } from "./createVueCellLayout.js";
|
|
3
|
+
function y(e) {
|
|
4
|
+
const r = e.filter((o) => o.frozen === !0 || o.frozen === "left"), t = e.filter((o) => !o.frozen), n = e.filter((o) => o.frozen === "right");
|
|
5
|
+
return [...r, ...t, ...n];
|
|
6
|
+
}
|
|
7
|
+
function c(e) {
|
|
8
|
+
const r = /* @__PURE__ */ new Set();
|
|
9
|
+
function t(n) {
|
|
10
|
+
n.forEach((o) => {
|
|
11
|
+
var i;
|
|
12
|
+
if (!o.key || r.has(o.key))
|
|
13
|
+
throw C(
|
|
14
|
+
"TT_VTABLE_DUPLICATE_COLUMN_KEY",
|
|
15
|
+
`column.key ${o.key || "<empty>"} 无效或重复。`,
|
|
16
|
+
{
|
|
17
|
+
columnKey: o.key
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
r.add(o.key), (i = o.columns) != null && i.length && t(o.columns);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
t(e);
|
|
24
|
+
}
|
|
25
|
+
function m(e, r) {
|
|
26
|
+
var a;
|
|
27
|
+
const t = e.native ?? {}, n = (a = e.columns) != null && a.length ? g(y(e.columns), r, !1) : void 0, o = "customLayout" in t ? t.customLayout : void 0, i = "headerCustomLayout" in t ? t.headerCustomLayout : void 0;
|
|
28
|
+
return {
|
|
29
|
+
...t,
|
|
30
|
+
key: e.key,
|
|
31
|
+
field: e.field,
|
|
32
|
+
title: e.title,
|
|
33
|
+
width: e.width,
|
|
34
|
+
minWidth: e.minWidth,
|
|
35
|
+
maxWidth: e.maxWidth,
|
|
36
|
+
style: e.align ? { textAlign: e.align, ...t.style ?? {} } : t.style,
|
|
37
|
+
hide: e.visible === !1,
|
|
38
|
+
tree: e.tree,
|
|
39
|
+
columns: n,
|
|
40
|
+
customLayout: e.renderer ? h({
|
|
41
|
+
column: e,
|
|
42
|
+
tableApi: r.tableApi,
|
|
43
|
+
rendererSlots: r.rendererSlots,
|
|
44
|
+
getRowKey: r.getRowKey
|
|
45
|
+
}) : o,
|
|
46
|
+
headerCustomLayout: e.headerRenderer ? d({ column: e, tableApi: r.tableApi, rendererSlots: r.rendererSlots }) : i
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function g(e, r, t = !0) {
|
|
50
|
+
return t && c(e), e.map((n) => m(n, r));
|
|
51
|
+
}
|
|
52
|
+
function z(e) {
|
|
53
|
+
const r = e.filter((n) => n.frozen === !0 || n.frozen === "left").length, t = e.filter((n) => n.frozen === "right").length;
|
|
54
|
+
return { frozenColCount: r, rightFrozenColCount: t };
|
|
55
|
+
}
|
|
56
|
+
function b(e) {
|
|
57
|
+
let r = 0, t = !1;
|
|
58
|
+
function n(o) {
|
|
59
|
+
o.forEach((i) => {
|
|
60
|
+
var u, f, l;
|
|
61
|
+
const s = (u = i.renderer) == null ? void 0 : u.maxCacheCount, a = (f = i.headerRenderer) == null ? void 0 : f.maxCacheCount;
|
|
62
|
+
Number.isFinite(s) && s > 0 && (r += Math.floor(s), t = !0), Number.isFinite(a) && a > 0 && (r += Math.floor(a), t = !0), (l = i.columns) != null && l.length && n(i.columns);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return n(e), t ? r : void 0;
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
b as getColumnDomCacheCount,
|
|
69
|
+
z as getFrozenColumnCounts,
|
|
70
|
+
g as toColumnDefinitions,
|
|
71
|
+
y as toFrozenColumnOrder,
|
|
72
|
+
c as validateColumnKeys
|
|
73
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ListTableConstructorOptions } from '@visactor/vtable';
|
|
2
|
+
import { TtVTableApi, TtVTableColumn, TtVTableNativeOptions, TtVTableRendererSlots, TtVTableRenderingOptions, TtVTableRowKey } from '../../public';
|
|
3
|
+
/** 创建 ListTable options 所需的受控输入。 */
|
|
4
|
+
export interface ToListTableOptionsInput<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey> {
|
|
5
|
+
/** 当前语义列。 */
|
|
6
|
+
columns: readonly TtVTableColumn<Row, Key>[];
|
|
7
|
+
/** 当前稳定公共 API。 */
|
|
8
|
+
tableApi: TtVTableApi<Row, Key>;
|
|
9
|
+
/** 当前组件可用的 Vue renderer 插槽。 */
|
|
10
|
+
rendererSlots: TtVTableRendererSlots<Row, Key>;
|
|
11
|
+
/** 从记录读取业务主键。 */
|
|
12
|
+
getRowKey: (record: Row) => Key;
|
|
13
|
+
/** 安全原生 options。 */
|
|
14
|
+
nativeOptions?: TtVTableNativeOptions;
|
|
15
|
+
/** Vue DOM 渲染配置。 */
|
|
16
|
+
rendering?: TtVTableRenderingOptions;
|
|
17
|
+
/** 当前 Vue appContext 读取函数。 */
|
|
18
|
+
getVueUserAppContext?: () => unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 创建不携带业务 records 的稳定 ListTable options。
|
|
22
|
+
* @param input 语义列、API、插槽与安全原生配置
|
|
23
|
+
* @returns 可交给官方 Vue ListTable 的 options
|
|
24
|
+
*/
|
|
25
|
+
export declare function toListTableOptions<Row extends Record<string, unknown>, Key extends TtVTableRowKey>(input: ToListTableOptionsInput<Row, Key>): ListTableConstructorOptions;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { validateNativeOptions as a } from "./native-boundaries.js";
|
|
2
|
+
import { toFrozenColumnOrder as i, getFrozenColumnCounts as c, getColumnDomCacheCount as l, toColumnDefinitions as u } from "./toColumnDefinitions.js";
|
|
3
|
+
function v(o) {
|
|
4
|
+
var t, n;
|
|
5
|
+
a(o.nativeOptions);
|
|
6
|
+
const e = i(o.columns), r = c(e), s = ((t = o.rendering) == null ? void 0 : t.maxDomCacheCount) ?? l(e) ?? 100, C = {
|
|
7
|
+
...((n = o.nativeOptions) == null ? void 0 : n.customConfig) ?? {},
|
|
8
|
+
createReactContainer: !0,
|
|
9
|
+
maxDomCacheCount: s,
|
|
10
|
+
getVueUserAppContext: o.getVueUserAppContext
|
|
11
|
+
}, m = u(e, {
|
|
12
|
+
tableApi: o.tableApi,
|
|
13
|
+
rendererSlots: o.rendererSlots,
|
|
14
|
+
getRowKey: o.getRowKey
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
...o.nativeOptions,
|
|
18
|
+
...r,
|
|
19
|
+
columns: m,
|
|
20
|
+
customConfig: C
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
v as toListTableOptions
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ColumnDefine, ListTable, ListTableConstructorOptions, TYPES } from '@visactor/vtable';
|
|
2
|
+
import { TtVTableFieldPath } from '../../public';
|
|
3
|
+
/** VTable 用于定位根记录或树节点的源索引。 */
|
|
4
|
+
export type VisactorRecordIndex = number | number[];
|
|
5
|
+
/** VisActor 实例与封装层之间的受控适配器。 */
|
|
6
|
+
export interface VisactorTableEngine<Row extends Record<string, unknown>> {
|
|
7
|
+
/** 返回当前原生实例。 */
|
|
8
|
+
getInstance: () => ListTable | undefined;
|
|
9
|
+
/** 使用新的运行时根列表全量替换记录。 */
|
|
10
|
+
setRecords: (records: Row[]) => void;
|
|
11
|
+
/** 在指定源索引前追加或插入记录。 */
|
|
12
|
+
addRecords: (records: Row[], recordIndex?: VisactorRecordIndex) => void;
|
|
13
|
+
/** 一次更新多条根记录或树节点。 */
|
|
14
|
+
updateRecords: (records: Row[], recordIndexes: VisactorRecordIndex[]) => void;
|
|
15
|
+
/** 按源索引删除多条根记录或树节点。 */
|
|
16
|
+
deleteRecords: (recordIndexes: VisactorRecordIndex[]) => void;
|
|
17
|
+
/** 精确刷新一个单元格,无法映射到可见坐标时返回 false。 */
|
|
18
|
+
changeCellValue: (recordIndex: VisactorRecordIndex, field: TtVTableFieldPath, value: unknown) => boolean;
|
|
19
|
+
/** 使用结构配置更新原生实例。 */
|
|
20
|
+
updateOptions: (options: ListTableConstructorOptions) => Promise<unknown>;
|
|
21
|
+
/** 使用原生增量接口替换列。 */
|
|
22
|
+
updateColumns: (columns: ColumnDefine[]) => void;
|
|
23
|
+
/** 使用原生分页接口更新本地分页。 */
|
|
24
|
+
updatePagination: (pagination: TYPES.IPagination) => void;
|
|
25
|
+
/** 重新计算当前布局。 */
|
|
26
|
+
recalculate: () => void;
|
|
27
|
+
/** 幂等释放适配器持有的引用。 */
|
|
28
|
+
release: () => void;
|
|
29
|
+
}
|
package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TtVTableColumn } from '../../public/table-column';
|
|
2
|
+
/** 封装层支持持久化的冻结列位置。 */
|
|
3
|
+
export type VTableColumnFrozen = NonNullable<TtVTableColumn["frozen"]>;
|
|
4
|
+
/** 一个语义列主键的持久化偏好。 */
|
|
5
|
+
export interface VTableColumnPreference {
|
|
6
|
+
/** 稳定语义列主键。 */
|
|
7
|
+
key: string;
|
|
8
|
+
/** 列是否可见。 */
|
|
9
|
+
visible: boolean;
|
|
10
|
+
/** 在同级列中从 0 开始的顺序。 */
|
|
11
|
+
order: number;
|
|
12
|
+
/** 可选数字列宽。 */
|
|
13
|
+
width?: number;
|
|
14
|
+
/** 可选冻结位置。 */
|
|
15
|
+
frozen?: VTableColumnFrozen;
|
|
16
|
+
}
|
|
17
|
+
/** 带版本的列偏好载荷。 */
|
|
18
|
+
export interface VTableColumnPreferenceSnapshot {
|
|
19
|
+
/** 用于后续迁移的 schema 版本。 */
|
|
20
|
+
schemaVersion: number;
|
|
21
|
+
/** 按语义列主键索引的偏好。 */
|
|
22
|
+
columns: readonly VTableColumnPreference[];
|
|
23
|
+
}
|
|
24
|
+
/** 本地或服务端列偏好的异步持久化边界。 */
|
|
25
|
+
export interface VTableColumnPreferenceStorage {
|
|
26
|
+
/** 读取已保存快照。 */
|
|
27
|
+
read: (key: string) => Promise<VTableColumnPreferenceSnapshot | undefined>;
|
|
28
|
+
/** 写入完整快照。 */
|
|
29
|
+
write: (key: string, snapshot: VTableColumnPreferenceSnapshot) => Promise<void>;
|
|
30
|
+
/** 删除已保存快照。 */
|
|
31
|
+
remove: (key: string) => Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/** 判断未知值是否为有效的带版本偏好快照。 */
|
|
34
|
+
export declare function isColumnPreferenceSnapshot(value: unknown): value is VTableColumnPreferenceSnapshot;
|
|
35
|
+
/** 创建 SSR 安全的默认 localStorage 偏好适配器。 */
|
|
36
|
+
export declare function createLocalColumnPreferenceStorage(): VTableColumnPreferenceStorage;
|