@dazhicheng/ui 1.6.10 → 1.6.11

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 (87) hide show
  1. package/dist/components/tt-area/TtArea.vue.js +1 -1
  2. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
  3. package/dist/components/tt-form/src/useFormContext.js +1 -1
  4. package/dist/components/tt-icon/index.vue.js +2 -2
  5. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  6. package/dist/components/tt-table/index.js +4 -5
  7. package/dist/components/tt-table/src/TableForm.vue.js +2 -3
  8. package/dist/hooks/useBasicDataOptions.js +110 -91
  9. package/dist/index.d.ts +0 -1
  10. package/dist/index.js +115 -129
  11. package/dist/packages/utils/src/is.js +37 -46
  12. package/dist/style.css +1 -1
  13. package/package.json +1 -3
  14. package/dist/components/tt-vtable/index.js +0 -54
  15. package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +0 -188
  16. package/dist/components/tt-vtable/src/components/TtVTable.vue.js +0 -227
  17. package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +0 -4
  18. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +0 -32
  19. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +0 -121
  20. package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +0 -4
  21. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +0 -64
  22. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +0 -97
  23. package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +0 -4
  24. package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +0 -53
  25. package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +0 -52
  26. package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +0 -4
  27. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +0 -35
  28. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +0 -50
  29. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +0 -4
  30. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +0 -63
  31. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +0 -126
  32. package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +0 -4
  33. package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +0 -133
  34. package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +0 -4
  35. package/dist/components/tt-vtable/src/composables/useVTable.d.ts +0 -41
  36. package/dist/components/tt-vtable/src/composables/useVTable.js +0 -25
  37. package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +0 -13
  38. package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +0 -92
  39. package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +0 -13
  40. package/dist/components/tt-vtable/src/composables/useVTableRender.js +0 -13
  41. package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +0 -10
  42. package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +0 -63
  43. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +0 -37
  44. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +0 -133
  45. package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +0 -8
  46. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +0 -23
  47. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +0 -70
  48. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +0 -38
  49. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +0 -41
  50. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +0 -45
  51. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +0 -73
  52. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +0 -25
  53. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +0 -25
  54. package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +0 -29
  55. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +0 -5
  56. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +0 -52
  57. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +0 -74
  58. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +0 -232
  59. package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +0 -48
  60. package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +0 -102
  61. package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +0 -51
  62. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +0 -40
  63. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +0 -51
  64. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +0 -38
  65. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +0 -57
  66. package/dist/components/tt-vtable/src/features/records/index.d.ts +0 -3
  67. package/dist/components/tt-vtable/src/features/records/record-index.d.ts +0 -122
  68. package/dist/components/tt-vtable/src/features/records/record-index.js +0 -209
  69. package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +0 -41
  70. package/dist/components/tt-vtable/src/features/records/useRecordSource.js +0 -249
  71. package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +0 -65
  72. package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +0 -129
  73. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +0 -60
  74. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +0 -125
  75. package/dist/components/tt-vtable/src/public/column-preferences.d.ts +0 -32
  76. package/dist/components/tt-vtable/src/public/index.d.ts +0 -8
  77. package/dist/components/tt-vtable/src/public/table-api.d.ts +0 -215
  78. package/dist/components/tt-vtable/src/public/table-column.d.ts +0 -123
  79. package/dist/components/tt-vtable/src/public/table-errors.d.ts +0 -26
  80. package/dist/components/tt-vtable/src/public/table-errors.js +0 -26
  81. package/dist/components/tt-vtable/src/public/table-events.d.ts +0 -69
  82. package/dist/components/tt-vtable/src/public/table-props.d.ts +0 -216
  83. package/dist/components/tt-vtable/src/public/table-slots.d.ts +0 -37
  84. package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +0 -12
  85. package/dist/components/tt-vtable/src/runtime/createVTableController.js +0 -238
  86. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +0 -79
  87. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +0 -380
@@ -1,97 +0,0 @@
1
- import { defineComponent as g, computed as y, createElementBlock as s, openBlock as a, renderSlot as l, createVNode as e, createElementVNode as o, unref as r, toDisplayString as n, withCtx as v } from "vue";
2
- import { TtButton as T } from "../../../tt-button/index.js";
3
- import { TtEmpty as b } from "../../../tt-empty/index.js";
4
- import { TtIcon as m } from "../../../tt-icon/index.js";
5
- import "axios";
6
- import "element-plus";
7
- import { isString as x, isError as h } from "../../../../packages/utils/src/is.js";
8
- import "dayjs";
9
- import "numeral";
10
- import "xe-utils";
11
- import "dayjs/plugin/utc";
12
- import "dayjs/plugin/timezone";
13
- import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
14
- import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
15
- import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
16
- import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
17
- import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
18
- import "lodash-es";
19
- const E = {
20
- key: 0,
21
- class: "tt-vtable-state",
22
- role: "status",
23
- "aria-live": "polite"
24
- }, k = { class: "tt-vtable-state__message" }, B = {
25
- key: 1,
26
- class: "tt-vtable-state",
27
- role: "alert"
28
- }, S = { class: "tt-vtable-state__title" }, V = { class: "tt-vtable-state__message" }, z = {
29
- key: 2,
30
- class: "tt-vtable-state",
31
- role: "status"
32
- }, P = /* @__PURE__ */ g({
33
- name: "VTableEmpty",
34
- __name: "VTableEmpty",
35
- props: {
36
- loading: { type: Boolean, default: !1 },
37
- loadingText: { default: "正在加载" },
38
- emptyText: { default: "暂无数据" },
39
- error: {},
40
- errorTitle: { default: "数据加载失败" }
41
- },
42
- emits: ["retry"],
43
- setup(c, { emit: d }) {
44
- const t = c, u = d, _ = y(() => x(t.error) ? t.error : h(t.error) ? String(t.error).replace(/^Error:\s*/, "") : "请稍后重试");
45
- function f() {
46
- u("retry");
47
- }
48
- return (i, p) => t.loading ? (a(), s("div", E, [
49
- l(i.$slots, "loading", {
50
- text: t.loadingText
51
- }, () => [
52
- e(r(m), {
53
- class: "tt-vtable-state__loading-icon",
54
- icon: "mdi:loading",
55
- size: 24
56
- }),
57
- o("span", k, n(t.loadingText), 1)
58
- ])
59
- ])) : t.error ? (a(), s("div", B, [
60
- l(i.$slots, "error", {
61
- error: t.error
62
- }, () => [
63
- e(r(m), {
64
- icon: "mdi:alert-circle-outline",
65
- size: 32,
66
- color: "var(--el-color-danger)"
67
- }),
68
- o("strong", S, n(t.errorTitle), 1),
69
- o("span", V, n(_.value), 1),
70
- e(r(T), {
71
- type: "primary",
72
- plain: "",
73
- "aria-label": "重新加载表格",
74
- onClick: f
75
- }, {
76
- default: v(() => [
77
- e(r(m), { icon: "mdi:refresh" }),
78
- p[0] || (p[0] = o("span", null, "重试", -1))
79
- ]),
80
- _: 1
81
- })
82
- ])
83
- ])) : (a(), s("div", z, [
84
- l(i.$slots, "empty", {
85
- text: t.emptyText
86
- }, () => [
87
- e(r(b), {
88
- description: t.emptyText,
89
- "image-size": 88
90
- }, null, 8, ["description"])
91
- ])
92
- ]));
93
- }
94
- });
95
- export {
96
- P as default
97
- };
@@ -1,4 +0,0 @@
1
- import f from "./VTableEmpty.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,53 +0,0 @@
1
- import { VNodeChild } from 'vue';
2
- /** VTable 分页组件属性。 */
3
- interface VTablePaginationProps {
4
- /** 当前从 1 开始的页码。 */
5
- page: number;
6
- /** 当前每页记录数。 */
7
- pageSize: number;
8
- /** 当前记录总数。 */
9
- total: number;
10
- /** 可选每页数量。 */
11
- pageSizes?: number[];
12
- /** Element Plus 分页布局。 */
13
- layout?: string;
14
- /** 是否禁用分页交互。 */
15
- disabled?: boolean;
16
- /** 是否使用背景按钮样式。 */
17
- background?: boolean;
18
- /** 单页时是否隐藏分页。 */
19
- hideOnSinglePage?: boolean;
20
- }
21
- declare function __VLS_template(): {
22
- attrs: Partial<{}>;
23
- slots: Readonly<{
24
- /** 分页区域前置内容。 */
25
- prefix?: () => VNodeChild;
26
- }> & {
27
- /** 分页区域前置内容。 */
28
- prefix?: () => VNodeChild;
29
- };
30
- refs: {};
31
- rootEl: HTMLDivElement;
32
- };
33
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
34
- declare const __VLS_component: import('vue').DefineComponent<VTablePaginationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
35
- "page-change": (page: number) => any;
36
- "page-size-change": (pageSize: number) => any;
37
- }, string, import('vue').PublicProps, Readonly<VTablePaginationProps> & Readonly<{
38
- "onPage-change"?: ((page: number) => any) | undefined;
39
- "onPage-size-change"?: ((pageSize: number) => any) | undefined;
40
- }>, {
41
- disabled: boolean;
42
- pageSizes: number[];
43
- background: boolean;
44
- layout: string;
45
- hideOnSinglePage: boolean;
46
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
47
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
48
- export default _default;
49
- type __VLS_WithTemplateSlots<T, S> = T & {
50
- new (): {
51
- $slots: S;
52
- };
53
- };
@@ -1,52 +0,0 @@
1
- import { defineComponent as s, createElementBlock as n, openBlock as o, createCommentVNode as r, createVNode as d, renderSlot as c, unref as u } from "vue";
2
- import { ElPagination as f } from "element-plus";
3
- const m = {
4
- class: "tt-vtable-pagination",
5
- "aria-label": "表格分页"
6
- }, b = {
7
- key: 0,
8
- class: "tt-vtable-pagination__prefix"
9
- }, S = /* @__PURE__ */ s({
10
- name: "VTablePagination",
11
- __name: "VTablePagination",
12
- props: {
13
- page: {},
14
- pageSize: {},
15
- total: {},
16
- pageSizes: { default: () => [20, 50, 100, 200] },
17
- layout: { default: "total, sizes, prev, pager, next, jumper" },
18
- disabled: { type: Boolean, default: !1 },
19
- background: { type: Boolean, default: !1 },
20
- hideOnSinglePage: { type: Boolean, default: !1 }
21
- },
22
- emits: ["page-change", "page-size-change"],
23
- setup(i, { emit: l }) {
24
- const e = i, t = l;
25
- function g(a) {
26
- t("page-change", a);
27
- }
28
- function p(a) {
29
- t("page-size-change", a);
30
- }
31
- return (a, h) => (o(), n("div", m, [
32
- a.$slots.prefix ? (o(), n("div", b, [
33
- c(a.$slots, "prefix")
34
- ])) : r("", !0),
35
- d(u(f), {
36
- background: e.background,
37
- "current-page": e.page,
38
- disabled: e.disabled,
39
- "hide-on-single-page": e.hideOnSinglePage,
40
- layout: e.layout,
41
- "page-size": e.pageSize,
42
- "page-sizes": e.pageSizes,
43
- total: e.total,
44
- "onUpdate:currentPage": g,
45
- "onUpdate:pageSize": p
46
- }, null, 8, ["background", "current-page", "disabled", "hide-on-single-page", "layout", "page-size", "page-sizes", "total"])
47
- ]));
48
- }
49
- });
50
- export {
51
- S as default
52
- };
@@ -1,4 +0,0 @@
1
- import f from "./VTablePagination.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,35 +0,0 @@
1
- import { VNodeChild } from 'vue';
2
- /** VTable 选择提示属性。 */
3
- interface VTableSelectionAlertProps {
4
- /** 已选主键总数。 */
5
- selectedCount: number;
6
- /** 当前已加载的已选记录数。 */
7
- loadedCount: number;
8
- /** 当前未加载的已选主键数。 */
9
- missingCount: number;
10
- }
11
- declare function __VLS_template(): {
12
- attrs: Partial<{}>;
13
- slots: Readonly<{
14
- /** 自定义选择摘要。 */
15
- default?: (scope: VTableSelectionAlertProps) => VNodeChild;
16
- }> & {
17
- /** 自定义选择摘要。 */
18
- default?: (scope: VTableSelectionAlertProps) => VNodeChild;
19
- };
20
- refs: {};
21
- rootEl: any;
22
- };
23
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
- declare const __VLS_component: import('vue').DefineComponent<VTableSelectionAlertProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
25
- clear: () => any;
26
- }, string, import('vue').PublicProps, Readonly<VTableSelectionAlertProps> & Readonly<{
27
- onClear?: (() => any) | undefined;
28
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
30
- export default _default;
31
- type __VLS_WithTemplateSlots<T, S> = T & {
32
- new (): {
33
- $slots: S;
34
- };
35
- };
@@ -1,50 +0,0 @@
1
- import { defineComponent as p, createElementBlock as n, createCommentVNode as l, openBlock as r, createVNode as a, renderSlot as C, unref as s, normalizeProps as f, guardReactiveProps as _, createElementVNode as k, toDisplayString as t, withCtx as v, createTextVNode as V } from "vue";
2
- import { TtButton as b } from "../../../tt-button/index.js";
3
- import { TtIcon as g } from "../../../tt-icon/index.js";
4
- const y = {
5
- key: 0,
6
- class: "tt-vtable-selection-alert",
7
- role: "status",
8
- "aria-live": "polite"
9
- }, T = {
10
- key: 0,
11
- class: "tt-vtable-selection-alert__secondary"
12
- }, h = /* @__PURE__ */ p({
13
- name: "VTableSelectionAlert",
14
- __name: "VTableSelectionAlert",
15
- props: {
16
- selectedCount: {},
17
- loadedCount: {},
18
- missingCount: {}
19
- },
20
- emits: ["clear"],
21
- setup(i, { emit: c }) {
22
- const e = i, m = c;
23
- function u() {
24
- m("clear");
25
- }
26
- return (d, o) => e.selectedCount > 0 ? (r(), n("div", y, [
27
- a(s(g), {
28
- icon: "mdi:check-circle-outline",
29
- color: "var(--el-color-primary)"
30
- }),
31
- C(d.$slots, "default", f(_(e)), () => [
32
- k("span", null, "已选择 " + t(e.selectedCount) + " 项", 1),
33
- e.missingCount > 0 ? (r(), n("span", T, " 当前加载 " + t(e.loadedCount) + " 项,跨页保留 " + t(e.missingCount) + " 项 ", 1)) : l("", !0)
34
- ]),
35
- a(s(b), {
36
- text: "",
37
- "aria-label": "清空表格选择",
38
- onClick: u
39
- }, {
40
- default: v(() => [...o[0] || (o[0] = [
41
- V("清空", -1)
42
- ])]),
43
- _: 1
44
- })
45
- ])) : l("", !0);
46
- }
47
- });
48
- export {
49
- h as default
50
- };
@@ -1,4 +0,0 @@
1
- import f from "./VTableSelectionAlert.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,63 +0,0 @@
1
- import { VNodeChild } from 'vue';
2
- /** 工具栏展示的一列设置。 */
3
- interface VTableToolbarColumn {
4
- /** 稳定语义列主键。 */
5
- key: string;
6
- /** 工具栏展示标题。 */
7
- title: string;
8
- /** 当前是否可见。 */
9
- visible: boolean;
10
- /** 列树嵌套深度。 */
11
- depth?: number;
12
- /** 是否禁止修改可见性。 */
13
- disabled?: boolean;
14
- }
15
- /** VTable 工具栏属性。 */
16
- interface VTableToolbarProps {
17
- /** 是否显示刷新命令。 */
18
- showRefresh?: boolean;
19
- /** 是否显示列设置命令。 */
20
- showColumnPreferences?: boolean;
21
- /** 是否正在刷新。 */
22
- refreshing?: boolean;
23
- /** 可配置列集合。 */
24
- columns?: readonly VTableToolbarColumn[];
25
- }
26
- declare function __VLS_template(): {
27
- attrs: Partial<{}>;
28
- slots: Readonly<{
29
- /** 工具栏左侧业务内容。 */
30
- left?: () => VNodeChild;
31
- /** 工具栏右侧业务内容。 */
32
- right?: () => VNodeChild;
33
- }> & {
34
- /** 工具栏左侧业务内容。 */
35
- left?: () => VNodeChild;
36
- /** 工具栏右侧业务内容。 */
37
- right?: () => VNodeChild;
38
- };
39
- refs: {};
40
- rootEl: HTMLDivElement;
41
- };
42
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
43
- declare const __VLS_component: import('vue').DefineComponent<VTableToolbarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
44
- refresh: () => any;
45
- "column-visibility-change": (key: string, visible: boolean) => any;
46
- "reset-columns": () => any;
47
- }, string, import('vue').PublicProps, Readonly<VTableToolbarProps> & Readonly<{
48
- onRefresh?: (() => any) | undefined;
49
- "onColumn-visibility-change"?: ((key: string, visible: boolean) => any) | undefined;
50
- "onReset-columns"?: (() => any) | undefined;
51
- }>, {
52
- columns: readonly VTableToolbarColumn[];
53
- showRefresh: boolean;
54
- showColumnPreferences: boolean;
55
- refreshing: boolean;
56
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
57
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
58
- export default _default;
59
- type __VLS_WithTemplateSlots<T, S> = T & {
60
- new (): {
61
- $slots: S;
62
- };
63
- };
@@ -1,126 +0,0 @@
1
- import { defineComponent as k, createElementBlock as d, openBlock as n, createElementVNode as o, renderSlot as f, createBlock as p, createCommentVNode as b, unref as t, withCtx as l, createVNode as r, Fragment as x, renderList as w, normalizeStyle as B, createTextVNode as T, toDisplayString as V } from "vue";
2
- import { TtButton as u } from "../../../tt-button/index.js";
3
- import { TtIcon as c } from "../../../tt-icon/index.js";
4
- import "axios";
5
- import { ElPopover as E, ElScrollbar as N, ElCheckbox as R } from "element-plus";
6
- import { isBoolean as S } from "../../../../packages/utils/src/is.js";
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
- const P = {
19
- class: "tt-vtable-toolbar",
20
- role: "toolbar",
21
- "aria-label": "表格工具栏"
22
- }, $ = { class: "tt-vtable-toolbar__section tt-vtable-toolbar__section--left" }, L = { class: "tt-vtable-toolbar__section tt-vtable-toolbar__section--right" }, z = { class: "tt-vtable-column-menu" }, D = { class: "tt-vtable-column-menu__footer" }, ee = /* @__PURE__ */ k({
23
- name: "VTableToolbar",
24
- __name: "VTableToolbar",
25
- props: {
26
- showRefresh: { type: Boolean, default: !0 },
27
- showColumnPreferences: { type: Boolean, default: !1 },
28
- refreshing: { type: Boolean, default: !1 },
29
- columns: { default: () => [] }
30
- },
31
- emits: ["refresh", "column-visibility-change", "reset-columns"],
32
- setup(_, { emit: h }) {
33
- const a = _, m = h;
34
- function v() {
35
- m("refresh");
36
- }
37
- function g(s, e) {
38
- S(e) && m("column-visibility-change", s, e);
39
- }
40
- function y() {
41
- m("reset-columns");
42
- }
43
- return (s, e) => (n(), d("div", P, [
44
- o("div", $, [
45
- f(s.$slots, "left")
46
- ]),
47
- o("div", L, [
48
- f(s.$slots, "right"),
49
- a.showRefresh ? (n(), p(t(u), {
50
- key: 0,
51
- text: "",
52
- loading: a.refreshing,
53
- "aria-label": "刷新表格",
54
- onClick: v
55
- }, {
56
- default: l(() => [
57
- r(t(c), { icon: "mdi:refresh" }),
58
- e[0] || (e[0] = o("span", null, "刷新", -1))
59
- ]),
60
- _: 1
61
- }, 8, ["loading"])) : b("", !0),
62
- a.showColumnPreferences ? (n(), p(t(E), {
63
- key: 1,
64
- placement: "bottom-end",
65
- width: 280,
66
- trigger: "click"
67
- }, {
68
- reference: l(() => [
69
- r(t(u), {
70
- text: "",
71
- "aria-label": "打开列设置"
72
- }, {
73
- default: l(() => [
74
- r(t(c), { icon: "mdi:view-column-outline" }),
75
- e[1] || (e[1] = o("span", null, "列设置", -1))
76
- ]),
77
- _: 1
78
- })
79
- ]),
80
- default: l(() => [
81
- o("div", z, [
82
- r(t(N), { "max-height": "320px" }, {
83
- default: l(() => [
84
- (n(!0), d(x, null, w(a.columns, (i) => (n(), d("div", {
85
- key: i.key,
86
- class: "tt-vtable-column-menu__row",
87
- style: B({ paddingLeft: `${12 + (i.depth ?? 0) * 16}px` })
88
- }, [
89
- r(t(R), {
90
- disabled: i.disabled,
91
- "model-value": i.visible,
92
- onChange: (C) => g(i.key, C)
93
- }, {
94
- default: l(() => [
95
- T(V(i.title), 1)
96
- ]),
97
- _: 2
98
- }, 1032, ["disabled", "model-value", "onChange"])
99
- ], 4))), 128))
100
- ]),
101
- _: 1
102
- }),
103
- o("div", D, [
104
- r(t(u), {
105
- text: "",
106
- "aria-label": "恢复默认列设置",
107
- onClick: y
108
- }, {
109
- default: l(() => [
110
- r(t(c), { icon: "mdi:restore" }),
111
- e[2] || (e[2] = o("span", null, "恢复默认", -1))
112
- ]),
113
- _: 1
114
- })
115
- ])
116
- ])
117
- ]),
118
- _: 1
119
- })) : b("", !0)
120
- ])
121
- ]));
122
- }
123
- });
124
- export {
125
- ee as default
126
- };
@@ -1,4 +0,0 @@
1
- import f from "./VTableToolbar.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,133 +0,0 @@
1
- import { defineComponent as F, getCurrentInstance as I, shallowRef as l, computed as B, watch as f, nextTick as b, onMounted as k, onBeforeUnmount as L, createElementBlock as K, openBlock as y, normalizeStyle as D, createBlock as M, createCommentVNode as U, unref as Z } from "vue";
2
- import "axios";
3
- import "element-plus";
4
- import { isNumber as m, isClient as $, isError as q } from "../../../../packages/utils/src/is.js";
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 { ListTable as H } from "@visactor/vue-vtable";
17
- import "../engine/visactor/createVueCellLayout.js";
18
- import { createTtVTableError as T } from "../public/table-errors.js";
19
- import { toFrozenColumnOrder as W, toColumnDefinitions as j, getFrozenColumnCounts as G } from "../engine/visactor/toColumnDefinitions.js";
20
- import { toListTableOptions as J } from "../engine/visactor/toListTableOptions.js";
21
- const ve = /* @__PURE__ */ F({
22
- name: "VTableViewport",
23
- __name: "VTableViewport",
24
- props: {
25
- columns: {},
26
- tableApi: {},
27
- rendererSlots: {},
28
- getRowKey: {},
29
- nativeOptions: {},
30
- rendering: {},
31
- width: { default: "100%" },
32
- height: { default: "auto" }
33
- },
34
- emits: ["ready", "release", "resize", "error"],
35
- setup(_, { emit: E }) {
36
- const e = _, s = E, c = I(), u = l(), i = l(), A = l(0), z = l(0), v = l(!1);
37
- let a, n = 0;
38
- const O = B(() => ({
39
- width: m(e.width) ? `${e.width}px` : e.width,
40
- height: m(e.height) ? `${e.height}px` : e.height
41
- }));
42
- function h() {
43
- return J({
44
- columns: e.columns,
45
- tableApi: e.tableApi,
46
- rendererSlots: e.rendererSlots,
47
- getRowKey: e.getRowKey,
48
- nativeOptions: e.nativeOptions,
49
- rendering: e.rendering,
50
- getVueUserAppContext: () => c == null ? void 0 : c.appContext
51
- });
52
- }
53
- const d = l(h());
54
- function w(t) {
55
- const o = q(t) ? t : new Error(String(t));
56
- s("error", o);
57
- }
58
- function g() {
59
- if (m(e.width) && e.width <= 0)
60
- throw T("TT_VTABLE_CONTAINER_SIZE_INVALID", "表格 width 必须大于 0。", {
61
- width: e.width
62
- });
63
- if (m(e.height) && e.height <= 0)
64
- throw T("TT_VTABLE_CONTAINER_SIZE_INVALID", "表格 height 必须大于 0。", {
65
- height: e.height
66
- });
67
- }
68
- function p() {
69
- const t = u.value;
70
- if (!t) return;
71
- const o = t.getBoundingClientRect();
72
- A.value = o.width, z.value = o.height, s("resize", o.width, o.height), o.width > 0 && o.height > 0 && (v.value = !0), !(!i.value || o.width <= 0 || o.height <= 0) && (n && cancelAnimationFrame(n), n = requestAnimationFrame(() => {
73
- var r;
74
- n = 0, (r = i.value) == null || r.resize();
75
- }));
76
- }
77
- function V(t) {
78
- i.value = t, s("ready", t), b(p);
79
- }
80
- function R(t) {
81
- w(t);
82
- }
83
- function S(t) {
84
- const o = W(t), r = i.value;
85
- if (!r) {
86
- d.value = h();
87
- return;
88
- }
89
- const x = j(o, {
90
- tableApi: e.tableApi,
91
- rendererSlots: e.rendererSlots,
92
- getRowKey: e.getRowKey
93
- }), C = G(o);
94
- r.updateColumns(x), r.setFrozenColCount(C.frozenColCount), r.rightFrozenColCount = C.rightFrozenColCount;
95
- }
96
- async function N() {
97
- const t = h(), o = i.value;
98
- if (!o) {
99
- d.value = t;
100
- return;
101
- }
102
- try {
103
- await o.updateOption(t);
104
- } catch (r) {
105
- w(r);
106
- }
107
- }
108
- return f(() => e.columns, S), f([() => e.nativeOptions, () => e.rendering], () => void N()), f([() => e.width, () => e.height], () => {
109
- g(), b(p);
110
- }), k(() => {
111
- g(), $ && (a = new ResizeObserver(p), u.value && a.observe(u.value), p());
112
- }), L(() => {
113
- a == null || a.disconnect(), a = void 0, n && cancelAnimationFrame(n), n = 0, i.value && s("release", i.value), i.value = void 0;
114
- }), (t, o) => (y(), K("div", {
115
- ref_key: "viewportElement",
116
- ref: u,
117
- class: "tt-vtable__viewport",
118
- style: D(O.value)
119
- }, [
120
- v.value ? (y(), M(Z(H), {
121
- key: 0,
122
- options: d.value,
123
- width: "100%",
124
- height: "100%",
125
- "on-ready": V,
126
- "on-error": R
127
- }, null, 8, ["options"])) : U("", !0)
128
- ], 4));
129
- }
130
- });
131
- export {
132
- ve as default
133
- };
@@ -1,4 +0,0 @@
1
- import f from "./VTableViewport.vue.js";
2
- export {
3
- f as default
4
- };