@dazhicheng/ui 1.6.6 → 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.
Files changed (105) 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/form-render/expandable.js +31 -32
  4. package/dist/components/tt-form/src/useFormContext.js +1 -1
  5. package/dist/components/tt-icon/index.vue.js +2 -2
  6. package/dist/components/tt-loading/src/loading.vue.js +2 -2
  7. package/dist/components/tt-modal/src/utils/resolve-modal-target.js +1 -3
  8. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
  9. package/dist/components/tt-table/index.d.ts +3 -15
  10. package/dist/components/tt-table/index.js +5 -4
  11. package/dist/components/tt-table/src/Table.vue.d.ts +1 -1
  12. package/dist/components/tt-table/src/Table.vue.js +3 -3
  13. package/dist/components/tt-table/src/TableForm.vue.d.ts +0 -9
  14. package/dist/components/tt-table/src/TableForm.vue.js +175 -167
  15. package/dist/components/tt-table/src/components/TableAction.vue.d.ts +2 -12
  16. package/dist/components/tt-table/src/components/TableAction.vue.js +78 -175
  17. package/dist/components/tt-table/src/hooks/useGridProps.js +64 -60
  18. package/dist/components/tt-table/src/hooks/useTableData.js +77 -74
  19. package/dist/components/tt-table/src/hooks/useTableForm.js +22 -23
  20. package/dist/components/tt-table/src/props.d.ts +0 -5
  21. package/dist/components/tt-table/src/props.js +22 -31
  22. package/dist/components/tt-table/src/types/table.d.ts +2 -1
  23. package/dist/components/tt-table/src/types/tableForm.d.ts +0 -2
  24. package/dist/components/tt-table/src/utils/table-api.d.ts +2 -1
  25. package/dist/components/tt-table/src/utils/table-api.js +3 -2
  26. package/dist/components/tt-table/src/utils/table-form-api.js +14 -15
  27. package/dist/components/tt-vtable/index.js +54 -0
  28. package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +188 -0
  29. package/dist/components/tt-vtable/src/components/TtVTable.vue.js +227 -0
  30. package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +4 -0
  31. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +32 -0
  32. package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +121 -0
  33. package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +4 -0
  34. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +64 -0
  35. package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +97 -0
  36. package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +4 -0
  37. package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +53 -0
  38. package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +52 -0
  39. package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +4 -0
  40. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +35 -0
  41. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +50 -0
  42. package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +4 -0
  43. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +63 -0
  44. package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +126 -0
  45. package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +4 -0
  46. package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +133 -0
  47. package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +4 -0
  48. package/dist/components/tt-vtable/src/composables/useVTable.d.ts +41 -0
  49. package/dist/components/tt-vtable/src/composables/useVTable.js +25 -0
  50. package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +13 -0
  51. package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +92 -0
  52. package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +13 -0
  53. package/dist/components/tt-vtable/src/composables/useVTableRender.js +13 -0
  54. package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +10 -0
  55. package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +63 -0
  56. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +37 -0
  57. package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +133 -0
  58. package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +8 -0
  59. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +23 -0
  60. package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +70 -0
  61. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +38 -0
  62. package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +41 -0
  63. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +45 -0
  64. package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +73 -0
  65. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +25 -0
  66. package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +25 -0
  67. package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +29 -0
  68. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +36 -0
  69. package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +52 -0
  70. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +74 -0
  71. package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +232 -0
  72. package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +48 -0
  73. package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +102 -0
  74. package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +51 -0
  75. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +40 -0
  76. package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +51 -0
  77. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +38 -0
  78. package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +57 -0
  79. package/dist/components/tt-vtable/src/features/records/index.d.ts +3 -0
  80. package/dist/components/tt-vtable/src/features/records/record-index.d.ts +122 -0
  81. package/dist/components/tt-vtable/src/features/records/record-index.js +209 -0
  82. package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +41 -0
  83. package/dist/components/tt-vtable/src/features/records/useRecordSource.js +249 -0
  84. package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +65 -0
  85. package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +129 -0
  86. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +60 -0
  87. package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +125 -0
  88. package/dist/components/tt-vtable/src/public/index.d.ts +7 -0
  89. package/dist/components/tt-vtable/src/public/table-api.d.ts +215 -0
  90. package/dist/components/tt-vtable/src/public/table-column.d.ts +123 -0
  91. package/dist/components/tt-vtable/src/public/table-errors.d.ts +26 -0
  92. package/dist/components/tt-vtable/src/public/table-errors.js +26 -0
  93. package/dist/components/tt-vtable/src/public/table-events.d.ts +69 -0
  94. package/dist/components/tt-vtable/src/public/table-props.d.ts +216 -0
  95. package/dist/components/tt-vtable/src/public/table-slots.d.ts +37 -0
  96. package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +12 -0
  97. package/dist/components/tt-vtable/src/runtime/createVTableController.js +238 -0
  98. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +79 -0
  99. package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +380 -0
  100. package/dist/index.d.ts +1 -0
  101. package/dist/index.js +129 -115
  102. package/dist/packages/utils/src/is.js +46 -37
  103. package/dist/style.css +1 -1
  104. package/package.json +3 -1
  105. package/dist/assets/svg/action_more.svg.js +0 -4
@@ -0,0 +1,121 @@
1
+ import { defineComponent as x, useAttrs as N, useSlots as U, markRaw as W, shallowRef as u, computed as l, watch as p, createElementBlock as z, openBlock as E, createVNode as b, unref as d, createSlots as y, renderList as h, withCtx as R, renderSlot as w, normalizeProps as S, guardReactiveProps as v, mergeProps as L } from "vue";
2
+ import "axios";
3
+ import "element-plus";
4
+ import "dayjs";
5
+ import "numeral";
6
+ import "xe-utils";
7
+ import "dayjs/plugin/utc";
8
+ import "dayjs/plugin/timezone";
9
+ import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
10
+ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
11
+ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
12
+ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
13
+ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
14
+ import "lodash-es";
15
+ import "../../../tt-select/index.js";
16
+ import "../../../tt-checkbox/index.js";
17
+ import "../../../tt-radio-group/index.js";
18
+ import "../../../tt-panel-select/index.js";
19
+ import "../../../tt-upload/index.js";
20
+ import "../../../tt-api-component/index.js";
21
+ import "vee-validate";
22
+ import "../../../../utils/uppercaseInput.js";
23
+ import { useForm as D } from "../../../tt-form/src/useForm.js";
24
+ import "zod";
25
+ import "@vee-validate/zod";
26
+ import "@tanstack/vue-store";
27
+ import "es-toolkit/compat";
28
+ import "../../../tt-form/src/shared/zod-defaults.js";
29
+ import "../../../tt-nav-anchor/index.js";
30
+ 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";
31
+ import "vue-router";
32
+ import "../../../tt-icon/index.js";
33
+ import "../../../tt-form/src/components/Slot.js";
34
+ import "../../../tt-form-item-error-tooltip/index.js";
35
+ import "@vueuse/core";
36
+ /* empty css */
37
+ import "../../../tt-form/src/form/RenderContent.vue.js";
38
+ import "../../../tt-form/src/form-render/FormFieldContact.js";
39
+ /* empty css */
40
+ /* empty css */
41
+ import { createVTableController as G } from "../runtime/createVTableController.js";
42
+ import H from "./TtVTable.vue.js";
43
+ const I = { class: "tt-vtable-form" }, jt = /* @__PURE__ */ x({
44
+ name: "TtVTableForm",
45
+ inheritAttrs: !1,
46
+ __name: "TtVTableForm",
47
+ props: {
48
+ form: {},
49
+ table: {}
50
+ },
51
+ emits: ["ready"],
52
+ setup(_, { expose: A, emit: g }) {
53
+ const o = _, F = g, P = N(), c = U(), m = W(G()), a = u({ ...o.table.queryParams ?? {} }), i = u([...o.table.selectedRowKeys ?? []]), T = {
54
+ ...o.form,
55
+ handleSubmit: V,
56
+ handleReset: B
57
+ }, [K, s] = D(T), k = l(() => ({
58
+ ...o.table,
59
+ queryParams: a.value,
60
+ selectedRowKeys: i.value,
61
+ controller: m
62
+ })), q = l(() => Object.keys(c).filter((t) => t.startsWith("form-"))), C = l(() => Object.keys(c).filter((t) => !t.startsWith("form-"))), f = {
63
+ form: s,
64
+ table: m.tableApi
65
+ };
66
+ async function V(t) {
67
+ var r, e;
68
+ await ((e = (r = o.form).handleSubmit) == null ? void 0 : e.call(r, t)), a.value = { ...t }, m.tableApi.pagination.reset();
69
+ }
70
+ async function B(t) {
71
+ var r, e;
72
+ await ((e = (r = o.form).handleReset) == null ? void 0 : e.call(r, t)), a.value = { ...t }, m.tableApi.pagination.reset();
73
+ }
74
+ function O(t) {
75
+ return t.slice(5);
76
+ }
77
+ function $() {
78
+ F("ready", f);
79
+ }
80
+ function j(t) {
81
+ i.value = [...t];
82
+ }
83
+ return p(
84
+ () => o.table.queryParams,
85
+ (t) => {
86
+ a.value = { ...t ?? {} };
87
+ }
88
+ ), p(
89
+ () => o.form,
90
+ (t) => s.setState(t)
91
+ ), p(
92
+ () => o.table.selectedRowKeys,
93
+ (t) => {
94
+ i.value = [...t ?? []];
95
+ }
96
+ ), A({ formTableApi: f, formApi: s, tableApi: m.tableApi }), (t, r) => (E(), z("div", I, [
97
+ b(d(K), null, y({ _: 2 }, [
98
+ h(q.value, (e) => ({
99
+ name: O(e),
100
+ fn: R((n) => [
101
+ w(t.$slots, e, S(v(n || {})))
102
+ ])
103
+ }))
104
+ ]), 1024),
105
+ b(H, L({ ...k.value, ...d(P) }, {
106
+ onReady: $,
107
+ "onUpdate:selectedRowKeys": j
108
+ }), y({ _: 2 }, [
109
+ h(C.value, (e) => ({
110
+ name: e,
111
+ fn: R((n) => [
112
+ w(t.$slots, e, S(v(n || {})))
113
+ ])
114
+ }))
115
+ ]), 1040)
116
+ ]));
117
+ }
118
+ });
119
+ export {
120
+ jt as default
121
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TtVTableForm.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,64 @@
1
+ import { VNodeChild } from 'vue';
2
+ /** VTable 状态层属性。 */
3
+ interface VTableEmptyProps {
4
+ /** 是否显示加载状态。 */
5
+ loading?: boolean;
6
+ /** 加载提示。 */
7
+ loadingText?: string;
8
+ /** 空状态提示。 */
9
+ emptyText?: string;
10
+ /** 首次加载错误。 */
11
+ error?: Error | string;
12
+ /** 错误状态标题。 */
13
+ errorTitle?: string;
14
+ }
15
+ declare function __VLS_template(): {
16
+ attrs: Partial<{}>;
17
+ slots: Readonly<{
18
+ /** 自定义加载状态。 */
19
+ loading?: (scope: {
20
+ text: string;
21
+ }) => VNodeChild;
22
+ /** 自定义空状态。 */
23
+ empty?: (scope: {
24
+ text: string;
25
+ }) => VNodeChild;
26
+ /** 自定义错误状态。 */
27
+ error?: (scope: {
28
+ error: Error | string;
29
+ }) => VNodeChild;
30
+ }> & {
31
+ /** 自定义加载状态。 */
32
+ loading?: (scope: {
33
+ text: string;
34
+ }) => VNodeChild;
35
+ /** 自定义空状态。 */
36
+ empty?: (scope: {
37
+ text: string;
38
+ }) => VNodeChild;
39
+ /** 自定义错误状态。 */
40
+ error?: (scope: {
41
+ error: Error | string;
42
+ }) => VNodeChild;
43
+ };
44
+ refs: {};
45
+ rootEl: any;
46
+ };
47
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
48
+ declare const __VLS_component: import('vue').DefineComponent<VTableEmptyProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
49
+ retry: () => any;
50
+ }, string, import('vue').PublicProps, Readonly<VTableEmptyProps> & Readonly<{
51
+ onRetry?: (() => any) | undefined;
52
+ }>, {
53
+ loading: boolean;
54
+ loadingText: string;
55
+ emptyText: string;
56
+ errorTitle: string;
57
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
58
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
59
+ export default _default;
60
+ type __VLS_WithTemplateSlots<T, S> = T & {
61
+ new (): {
62
+ $slots: S;
63
+ };
64
+ };
@@ -0,0 +1,97 @@
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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableEmpty.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,53 @@
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
+ };
@@ -0,0 +1,52 @@
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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTablePagination.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,35 @@
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
+ };
@@ -0,0 +1,50 @@
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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableSelectionAlert.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,63 @@
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
+ };