@dazhicheng/ui 1.6.10 → 1.6.12

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.
Files changed (86) hide show
  1. package/dist/components/tt-form/src/useFormContext.js +1 -1
  2. package/dist/components/tt-table/index.js +4 -5
  3. package/dist/components/tt-table/src/TableForm.vue.js +2 -3
  4. package/dist/hooks/useBasicDataOptions.js +111 -96
  5. package/dist/hooks/useDataPermissionOptions.js +83 -85
  6. package/dist/hooks/useOwnerRoutePath.d.ts +5 -0
  7. package/dist/hooks/useOwnerRoutePath.js +7 -0
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.js +115 -129
  10. package/dist/packages/utils/src/is.js +37 -46
  11. package/dist/style.css +1 -1
  12. package/package.json +1 -1
  13. package/dist/components/tt-vtable/index.js +0 -54
  14. package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +0 -188
  15. package/dist/components/tt-vtable/src/components/TtVTable.vue.js +0 -227
  16. package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +0 -4
  17. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +0 -32
  18. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +0 -121
  19. package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +0 -4
  20. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +0 -64
  21. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +0 -97
  22. package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +0 -4
  23. package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +0 -53
  24. package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +0 -52
  25. package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +0 -4
  26. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +0 -35
  27. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +0 -50
  28. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +0 -4
  29. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +0 -63
  30. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +0 -126
  31. package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +0 -4
  32. package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +0 -133
  33. package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +0 -4
  34. package/dist/components/tt-vtable/src/composables/useVTable.d.ts +0 -41
  35. package/dist/components/tt-vtable/src/composables/useVTable.js +0 -25
  36. package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +0 -13
  37. package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +0 -92
  38. package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +0 -13
  39. package/dist/components/tt-vtable/src/composables/useVTableRender.js +0 -13
  40. package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +0 -10
  41. package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +0 -63
  42. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +0 -37
  43. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +0 -133
  44. package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +0 -8
  45. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +0 -23
  46. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +0 -70
  47. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +0 -38
  48. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +0 -41
  49. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +0 -45
  50. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +0 -73
  51. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +0 -25
  52. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +0 -25
  53. package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +0 -29
  54. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +0 -5
  55. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +0 -52
  56. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +0 -74
  57. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +0 -232
  58. package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +0 -48
  59. package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +0 -102
  60. package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +0 -51
  61. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +0 -40
  62. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +0 -51
  63. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +0 -38
  64. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +0 -57
  65. package/dist/components/tt-vtable/src/features/records/index.d.ts +0 -3
  66. package/dist/components/tt-vtable/src/features/records/record-index.d.ts +0 -122
  67. package/dist/components/tt-vtable/src/features/records/record-index.js +0 -209
  68. package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +0 -41
  69. package/dist/components/tt-vtable/src/features/records/useRecordSource.js +0 -249
  70. package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +0 -65
  71. package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +0 -129
  72. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +0 -60
  73. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +0 -125
  74. package/dist/components/tt-vtable/src/public/column-preferences.d.ts +0 -32
  75. package/dist/components/tt-vtable/src/public/index.d.ts +0 -8
  76. package/dist/components/tt-vtable/src/public/table-api.d.ts +0 -215
  77. package/dist/components/tt-vtable/src/public/table-column.d.ts +0 -123
  78. package/dist/components/tt-vtable/src/public/table-errors.d.ts +0 -26
  79. package/dist/components/tt-vtable/src/public/table-errors.js +0 -26
  80. package/dist/components/tt-vtable/src/public/table-events.d.ts +0 -69
  81. package/dist/components/tt-vtable/src/public/table-props.d.ts +0 -216
  82. package/dist/components/tt-vtable/src/public/table-slots.d.ts +0 -37
  83. package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +0 -12
  84. package/dist/components/tt-vtable/src/runtime/createVTableController.js +0 -238
  85. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +0 -79
  86. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +0 -380
@@ -1,41 +0,0 @@
1
- import { MaybeRefOrGetter, Ref } from 'vue';
2
- import { TtVTableColumn, TtVTableFeatureOptions, TtVTableFetchRecords, TtVTableMutationMode, TtVTableNativeEvents, TtVTableNativeOptions, TtVTableRenderingOptions, TtVTableRowKey, TtVTableRowKeySource } from '../public';
3
- import { createVTableController } from '../runtime/createVTableController';
4
- /** useVTable 接受的 maybe-reactive 配置。 */
5
- export interface UseVTableOptions<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey, QueryParams extends Record<string, unknown> = Record<string, unknown>> {
6
- /** maybe-reactive 本地记录根快照。 */
7
- records?: MaybeRefOrGetter<readonly Row[]>;
8
- /** 远程记录请求函数,作为回调保持普通函数语义。 */
9
- fetchRecords?: TtVTableFetchRecords<Row, QueryParams>;
10
- /** maybe-reactive 语义列根。 */
11
- columns: MaybeRefOrGetter<readonly TtVTableColumn<Row, Key>[]>;
12
- /** 业务主键读取配置,函数值不会被 toValue 执行。 */
13
- rowKey: TtVTableRowKeySource<Row, Key>;
14
- /** maybe-reactive 查询参数根。 */
15
- queryParams?: MaybeRefOrGetter<QueryParams>;
16
- /** 可写选择主键 ref。 */
17
- selectedRowKeys?: Ref<Key[]>;
18
- /** maybe-reactive feature 配置根。 */
19
- features?: MaybeRefOrGetter<TtVTableFeatureOptions<Row, Key> | undefined>;
20
- /** 记录所有权策略。 */
21
- mutationMode?: TtVTableMutationMode;
22
- /** maybe-reactive Vue DOM 渲染配置。 */
23
- rendering?: MaybeRefOrGetter<TtVTableRenderingOptions | undefined>;
24
- /** maybe-reactive 原生 options 根。 */
25
- nativeOptions?: MaybeRefOrGetter<TtVTableNativeOptions | undefined>;
26
- /** maybe-reactive原生事件根。 */
27
- nativeEvents?: MaybeRefOrGetter<TtVTableNativeEvents | undefined>;
28
- /** maybe-reactive 表格宽度。 */
29
- width?: MaybeRefOrGetter<number | string | undefined>;
30
- /** maybe-reactive 表格高度。 */
31
- height?: MaybeRefOrGetter<number | string | undefined>;
32
- }
33
- /** useVTable 返回的标准绑定结果。 */
34
- export interface UseVTableResult<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey> {
35
- /** 可直接传给 TtVTable 的响应式绑定。 */
36
- tableBindings: Record<string, unknown>;
37
- /** 从 setup 开始保持引用稳定的公共 API。 */
38
- tableApi: ReturnType<typeof createVTableController<Row, Key>>["tableApi"];
39
- }
40
- /** 创建 maybe-reactive 表格绑定和稳定 tableApi。 */
41
- export declare function useVTable<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey, QueryParams extends Record<string, unknown> = Record<string, unknown>>(options: UseVTableOptions<Row, Key, QueryParams>): UseVTableResult<Row, Key>;
@@ -1,25 +0,0 @@
1
- import { markRaw as d, shallowRef as n, computed as r, toValue as t, reactive as i, isRef as u } from "vue";
2
- import { createVTableController as f } from "../runtime/createVTableController.js";
3
- function w(e) {
4
- const l = d(f()), a = e.selectedRowKeys ?? n([]), c = {
5
- rowKey: e.rowKey,
6
- mutationMode: e.mutationMode,
7
- controller: l,
8
- columns: r(() => t(e.columns)),
9
- queryParams: r(() => t(e.queryParams) ?? {}),
10
- features: r(() => t(e.features)),
11
- rendering: r(() => t(e.rendering)),
12
- nativeOptions: r(() => t(e.nativeOptions)),
13
- nativeEvents: r(() => t(e.nativeEvents)),
14
- width: r(() => t(e.width)),
15
- height: r(() => t(e.height)),
16
- selectedRowKeys: a,
17
- "onUpdate:selectedRowKeys": (s) => {
18
- u(a) && (a.value = s);
19
- }
20
- };
21
- return e.fetchRecords ? c.fetchRecords = e.fetchRecords : c.records = r(() => t(e.records) ?? []), { tableBindings: i(c), tableApi: l.tableApi };
22
- }
23
- export {
24
- w as useVTable
25
- };
@@ -1,13 +0,0 @@
1
- import { DefineSetupFnComponent, SlotsType } from 'vue';
2
- import { TtVTableFormApi, TtVTableFormProps } from '../features/form-integration/useVTableForm';
3
- import { TtVTableRowKey } from '../public';
4
- /** 表单表格渲染组件允许的插槽集合。 */
5
- type VTableFormRenderSlots = Record<string, (slotScope: Record<string, unknown>) => unknown>;
6
- /** useVTableFormRender 返回值。 */
7
- export type UseVTableFormRenderResult<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey, FormValues extends Record<string, unknown> = Record<string, unknown>> = [
8
- DefineSetupFnComponent<Partial<TtVTableFormProps<Row, Key, FormValues>>, Record<string, (...eventArguments: unknown[]) => unknown>, SlotsType<VTableFormRenderSlots>>,
9
- TtVTableFormApi<Row, Key>
10
- ];
11
- /** 创建带查询表单的动态表格组件与稳定组合 API。 */
12
- export declare function useVTableFormRender<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey, FormValues extends Record<string, unknown> = Record<string, unknown>>(options: TtVTableFormProps<Row, Key, FormValues>): UseVTableFormRenderResult<Row, Key, FormValues>;
13
- export {};
@@ -1,92 +0,0 @@
1
- import "axios";
2
- import "element-plus";
3
- import { isFunction as T } from "../../../../packages/utils/src/is.js";
4
- import { shallowRef as f, defineComponent as g, h as c } from "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 "../../../tt-select/index.js";
17
- import "../../../tt-checkbox/index.js";
18
- import "../../../tt-radio-group/index.js";
19
- import "../../../tt-panel-select/index.js";
20
- import "../../../tt-upload/index.js";
21
- import "../../../tt-api-component/index.js";
22
- import "vee-validate";
23
- import "../../../../utils/uppercaseInput.js";
24
- import { useForm as v } from "../../../tt-form/src/useForm.js";
25
- import "zod";
26
- import "@vee-validate/zod";
27
- import "@tanstack/vue-store";
28
- import "es-toolkit/compat";
29
- import "../../../tt-form/src/shared/zod-defaults.js";
30
- import "../../../tt-nav-anchor/index.js";
31
- import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
32
- import "vue-router";
33
- import "../../../tt-icon/index.js";
34
- import "../../../tt-form/src/components/Slot.js";
35
- import "../../../tt-form-item-error-tooltip/index.js";
36
- import "@vueuse/core";
37
- /* empty css */
38
- import "../../../tt-form/src/form/RenderContent.vue.js";
39
- import "../../../tt-form/src/form-render/FormFieldContact.js";
40
- /* empty css */
41
- /* empty css */
42
- import { useVTableRender as y } from "./useVTableRender.js";
43
- function dt(t) {
44
- const i = f({ ...t.table.queryParams ?? {} }), b = f([...t.table.selectedRowKeys ?? []]), a = t.form.handleSubmit, n = t.form.handleReset, l = {
45
- columns: t.table.columns,
46
- rowKey: t.table.rowKey,
47
- queryParams: i,
48
- selectedRowKeys: b,
49
- features: t.table.features,
50
- mutationMode: t.table.mutationMode,
51
- rendering: t.table.rendering,
52
- nativeOptions: t.table.nativeOptions,
53
- nativeEvents: t.table.nativeEvents,
54
- width: t.table.width,
55
- height: t.table.height
56
- };
57
- T(t.table.fetchRecords) ? l.fetchRecords = t.table.fetchRecords : l.records = t.table.records ?? [];
58
- const [d, p] = y(l);
59
- async function h(e) {
60
- await (a == null ? void 0 : a(e)), i.value = { ...e }, p.pagination.reset();
61
- }
62
- async function u(e) {
63
- await (n == null ? void 0 : n(e)), i.value = { ...e }, p.pagination.reset();
64
- }
65
- const [R, w] = v({
66
- ...t.form,
67
- handleSubmit: h,
68
- handleReset: u
69
- });
70
- function F(e) {
71
- const o = {}, m = {};
72
- return Object.entries(e).forEach(([r, s]) => {
73
- r.startsWith("form-") ? o[r.slice(5)] = s : m[r] = s;
74
- }), { formSlots: o, tableSlots: m };
75
- }
76
- return [g(
77
- (e, { attrs: o, slots: m }) => () => {
78
- const r = F(m);
79
- return c("div", { class: "tt-vtable-form" }, [
80
- c(R, {}, r.formSlots),
81
- c(d, o, r.tableSlots)
82
- ]);
83
- },
84
- { name: "TtVTableFormRender", inheritAttrs: !1 }
85
- ), {
86
- form: w,
87
- table: p
88
- }];
89
- }
90
- export {
91
- dt as useVTableFormRender
92
- };
@@ -1,13 +0,0 @@
1
- import { DefineSetupFnComponent, SlotsType } from 'vue';
2
- import { TtVTableProps, TtVTableRowKey, TtVTableSlots } from '../public';
3
- import { useVTable, UseVTableOptions } from './useVTable';
4
- /** 动态渲染组件允许的宽松事件签名。 */
5
- type VTableRenderEmits = Record<string, (...eventArguments: unknown[]) => unknown>;
6
- /** useVTableRender 返回值。 */
7
- export type UseVTableRenderResult<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey, QueryParams extends Record<string, unknown> = Record<string, unknown>> = [
8
- DefineSetupFnComponent<Partial<TtVTableProps<Row, Key, QueryParams>>, VTableRenderEmits, SlotsType<TtVTableSlots<Row, Key>>>,
9
- ReturnType<typeof useVTable<Row, Key, QueryParams>>["tableApi"]
10
- ];
11
- /** 创建可直接渲染的 TtVTable 组件和稳定 tableApi。 */
12
- export declare function useVTableRender<Row extends Record<string, unknown>, Key extends TtVTableRowKey = TtVTableRowKey, QueryParams extends Record<string, unknown> = Record<string, unknown>>(options: UseVTableOptions<Row, Key, QueryParams>): UseVTableRenderResult<Row, Key, QueryParams>;
13
- export {};
@@ -1,13 +0,0 @@
1
- import { defineComponent as a, h as m } from "vue";
2
- import l from "../components/TtVTable.vue.js";
3
- import { useVTable as s } from "./useVTable.js";
4
- function T(e) {
5
- const { tableBindings: n, tableApi: r } = s(e);
6
- return [a(
7
- (t, { attrs: o, slots: i }) => () => m(l, { ...n, ...t, ...o }, i),
8
- { name: "TtVTableRender", inheritAttrs: !1 }
9
- ), r];
10
- }
11
- export {
12
- T as useVTableRender
13
- };
@@ -1,10 +0,0 @@
1
- import { ListTable } from '@visactor/vtable';
2
- import { VisactorTableEngine } from './types';
3
- /**
4
- * 创建只持有浅层原生实例引用的 VisActor 适配器。
5
- * @param initialInstance 已经由官方 Vue ListTable 创建的实例
6
- * @returns 可供 runtime 使用的稳定适配器
7
- */
8
- export declare function createVisactorTableEngine<Row extends Record<string, unknown>>(initialInstance?: ListTable): VisactorTableEngine<Row> & {
9
- setInstance: (instance?: ListTable) => void;
10
- };
@@ -1,63 +0,0 @@
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
- };
@@ -1,37 +0,0 @@
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 {};
@@ -1,133 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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';
@@ -1,23 +0,0 @@
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;
@@ -1,70 +0,0 @@
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
- };
@@ -1,38 +0,0 @@
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;
@@ -1,41 +0,0 @@
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
- };