@oneflowui/ui 0.8.1 → 0.8.3

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 (107) hide show
  1. package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
  2. package/dist/components/Dashboard/charts/BarChart.vue2.js +9 -9
  3. package/dist/components/Dashboard/charts/NumberCard.vue.js +2 -2
  4. package/dist/components/Dashboard/charts/PieChart.vue.js +1 -1
  5. package/dist/components/Dashboard/charts/PieChart.vue2.js +3 -3
  6. package/dist/components/Dashboard/charts/TableChart.vue.js +2 -2
  7. package/dist/components/Dashboard/index.vue.js +2 -2
  8. package/dist/components/base/InfoCard.vue.js +1 -1
  9. package/dist/components/base/InfoCard.vue2.js +40 -40
  10. package/dist/components/base/StatisticCard.vue.js +3 -3
  11. package/dist/components/base/StatusSummary.vue.js +1 -1
  12. package/dist/components/base/StatusSummary.vue2.js +5 -5
  13. package/dist/components/database/DatabaseDetailPresenter.vue.d.ts +41 -0
  14. package/dist/components/database/DatabaseDetailPresenter.vue.js +76 -0
  15. package/dist/components/database/DatabaseDetailPresenter.vue2.js +4 -0
  16. package/dist/components/database/DatabaseDetailWorkspace.vue.d.ts +37 -0
  17. package/dist/components/database/DatabaseDetailWorkspace.vue.js +7 -0
  18. package/dist/components/database/DatabaseDetailWorkspace.vue2.js +103 -0
  19. package/dist/components/database/DatabaseView.vue.d.ts +13 -76
  20. package/dist/components/database/DatabaseView.vue.js +2 -2
  21. package/dist/components/database/DatabaseView.vue2.js +322 -921
  22. package/dist/components/database/DatabaseViewContent.vue.d.ts +74 -0
  23. package/dist/components/database/DatabaseViewContent.vue.js +79 -0
  24. package/dist/components/database/DatabaseViewContent.vue2.js +4 -0
  25. package/dist/components/database/DatabaseViewDetailHost.vue.d.ts +43 -0
  26. package/dist/components/database/DatabaseViewDetailHost.vue.js +59 -0
  27. package/dist/components/database/DatabaseViewDetailHost.vue2.js +4 -0
  28. package/dist/components/database/DatabaseViewShell.vue.d.ts +35 -0
  29. package/dist/components/database/DatabaseViewShell.vue.js +7 -0
  30. package/dist/components/database/DatabaseViewShell.vue2.js +71 -0
  31. package/dist/components/database/DatabaseViewToolbar.vue.d.ts +77 -0
  32. package/dist/components/database/DatabaseViewToolbar.vue.js +62 -0
  33. package/dist/components/database/DatabaseViewToolbar.vue2.js +4 -0
  34. package/dist/components/database/databaseViewUtils.d.ts +91 -0
  35. package/dist/components/database/databaseViewUtils.js +266 -0
  36. package/dist/components/database/index.d.ts +1 -1
  37. package/dist/components/kanban/KanbanColumn.vue.d.ts +2 -2
  38. package/dist/components/layout/AppLayout.vue.js +1 -1
  39. package/dist/components/layout/Navbar.vue.js +1 -1
  40. package/dist/components/layout/Sidebar.vue.js +2 -2
  41. package/dist/components/layout/StatusBar.vue.js +2 -2
  42. package/dist/components/overlay/Dialog.vue.d.ts +1 -1
  43. package/dist/components/table/ColumnHeaderMenu.vue.js +3 -3
  44. package/dist/components/table/DataTable.vue.d.ts +6 -17
  45. package/dist/components/table/DataTable.vue.js +2 -2
  46. package/dist/components/table/DataTable.vue2.js +781 -872
  47. package/dist/components/table/DataTableDesktopFixedRegion.vue.d.ts +56 -0
  48. package/dist/components/table/DataTableDesktopFixedRegion.vue.js +7 -0
  49. package/dist/components/table/DataTableDesktopFixedRegion.vue2.js +67 -0
  50. package/dist/components/table/DataTableDesktopFrame.vue.d.ts +127 -0
  51. package/dist/components/table/DataTableDesktopFrame.vue.js +7 -0
  52. package/dist/components/table/DataTableDesktopFrame.vue2.js +196 -0
  53. package/dist/components/table/DataTableDesktopScrollRegion.vue.d.ts +55 -0
  54. package/dist/components/table/DataTableDesktopScrollRegion.vue.js +7 -0
  55. package/dist/components/table/DataTableDesktopScrollRegion.vue2.js +66 -0
  56. package/dist/components/table/DataTableDesktopStandardRegion.vue.d.ts +54 -0
  57. package/dist/components/table/DataTableDesktopStandardRegion.vue.js +7 -0
  58. package/dist/components/table/DataTableDesktopStandardRegion.vue2.js +65 -0
  59. package/dist/components/table/DataTableDraftToolbar.vue.d.ts +11 -0
  60. package/dist/components/table/DataTableDraftToolbar.vue.js +7 -0
  61. package/dist/components/table/DataTableDraftToolbar.vue2.js +25 -0
  62. package/dist/components/table/DataTableMobilePanel.vue.d.ts +79 -0
  63. package/dist/components/table/DataTableMobilePanel.vue.js +60 -0
  64. package/dist/components/table/DataTableMobilePanel.vue2.js +4 -0
  65. package/dist/components/table/DataTableSelectionBar.vue.d.ts +11 -0
  66. package/dist/components/table/DataTableSelectionBar.vue.js +7 -0
  67. package/dist/components/table/DataTableSelectionBar.vue2.js +33 -0
  68. package/dist/components/table/DetailSheet.vue.js +1 -1
  69. package/dist/components/table/DetailSheet.vue2.js +160 -187
  70. package/dist/components/table/FieldTypePicker.vue.js +3 -3
  71. package/dist/components/table/MobileListView.vue.js +1 -1
  72. package/dist/components/table/TableColumnManager.vue.js +3 -3
  73. package/dist/components/table/TableDataRow.vue.js +4 -4
  74. package/dist/components/table/TableFilterPanel.vue.js +1 -1
  75. package/dist/components/table/TableGroupRow.vue.js +2 -2
  76. package/dist/components/table/TableHeaderRow.vue.js +3 -3
  77. package/dist/components/table/TableToolbar.vue.js +2 -2
  78. package/dist/components/table/TableToolbar.vue2.js +126 -138
  79. package/dist/components/table/dataTableUtils.d.ts +26 -0
  80. package/dist/components/table/dataTableUtils.js +60 -0
  81. package/dist/composables/databaseDetailWorkspaceUtils.d.ts +59 -0
  82. package/dist/composables/databaseDetailWorkspaceUtils.js +160 -0
  83. package/dist/composables/index.d.ts +5 -0
  84. package/dist/composables/useDataTableDetailSheet.d.ts +47 -0
  85. package/dist/composables/useDataTableDetailSheet.js +58 -0
  86. package/dist/composables/useDataTableLayout.d.ts +16 -0
  87. package/dist/composables/useDataTableLayout.js +38 -0
  88. package/dist/composables/useDataTableSelection.d.ts +41 -0
  89. package/dist/composables/useDataTableSelection.js +73 -0
  90. package/dist/composables/useDatabaseDetailWorkspace.d.ts +67 -0
  91. package/dist/composables/useDatabaseDetailWorkspace.js +150 -0
  92. package/dist/composables/useDatabaseView.d.ts +3 -137
  93. package/dist/composables/useDatabaseWorkspace.d.ts +31 -0
  94. package/dist/composables/useDatabaseWorkspace.js +89 -0
  95. package/dist/composables/useTableToolbarPanels.d.ts +19 -0
  96. package/dist/composables/useTableToolbarPanels.js +53 -0
  97. package/dist/contracts/database.d.ts +252 -0
  98. package/dist/index.d.ts +6 -0
  99. package/dist/index.js +261 -248
  100. package/dist/plugin.d.ts +2 -0
  101. package/dist/plugin.js +10 -261
  102. package/dist/registry/plugin-components.d.ts +291 -0
  103. package/dist/registry/plugin-components.js +114 -0
  104. package/dist/style.css +1 -1
  105. package/dist/types/data-table.d.ts +27 -0
  106. package/dist/types/data-table.js +29 -0
  107. package/package.json +1 -1
@@ -1,24 +1,25 @@
1
- import { defineComponent as Q, computed as T, ref as i, onMounted as W, onUnmounted as X, openBlock as o, createElementBlock as n, Fragment as V, renderList as L, normalizeClass as m, createBlock as C, resolveDynamicComponent as Y, unref as w, createCommentVNode as s, createElementVNode as a, toDisplayString as g, withModifiers as d, createVNode as b, Teleport as B, normalizeStyle as $, renderSlot as Z, nextTick as ee } from "vue";
2
- import { resolveIcon as te } from "../../utils/icon.js";
3
- import oe from "./TableFilterPanel.vue.js";
4
- import le from "./TableColumnManager.vue.js";
5
- import { ListFilter as ne, ArrowUpDown as re, Layers as se, Columns3 as ae, Search as ue } from "lucide-vue-next";
6
- const ie = { class: "of-table-toolbar" }, fe = {
1
+ import { defineComponent as Q, computed as S, ref as k, openBlock as o, createElementBlock as r, Fragment as B, renderList as $, normalizeClass as m, createBlock as y, resolveDynamicComponent as W, unref as n, createCommentVNode as s, createElementVNode as a, toDisplayString as p, withModifiers as d, createVNode as b, Teleport as w, normalizeStyle as C, renderSlot as X } from "vue";
2
+ import { resolveIcon as Y } from "../../utils/icon.js";
3
+ import Z from "./TableFilterPanel.vue.js";
4
+ import _ from "./TableColumnManager.vue.js";
5
+ import { ListFilter as h, ArrowUpDown as tt, Layers as et, Columns3 as ot, Search as lt } from "lucide-vue-next";
6
+ import { useTableToolbarPanels as nt } from "../../composables/useTableToolbarPanels.js";
7
+ const rt = { class: "of-table-toolbar" }, st = {
7
8
  key: 0,
8
9
  class: "of-table-toolbar__views"
9
- }, de = ["onClick"], be = {
10
+ }, at = ["onClick"], it = {
10
11
  key: 1,
11
12
  class: "of-table-toolbar__sep"
12
- }, ve = {
13
+ }, ut = {
13
14
  key: 0,
14
15
  class: "of-table-toolbar__badge"
15
- }, ce = { class: "of-table-toolbar__simple-panel" }, ye = ["onClick"], me = {
16
+ }, dt = { class: "of-table-toolbar__simple-panel" }, bt = ["onClick"], ft = {
16
17
  key: 0,
17
18
  class: "of-table-toolbar__sort-dir"
18
- }, we = { class: "of-table-toolbar__simple-panel" }, ke = ["onClick"], pe = {
19
+ }, vt = { class: "of-table-toolbar__simple-panel" }, mt = ["onClick"], yt = {
19
20
  key: 6,
20
21
  class: "of-table-toolbar__search"
21
- }, Ce = ["value"], Ve = /* @__PURE__ */ Q({
22
+ }, pt = ["value"], $t = /* @__PURE__ */ Q({
22
23
  __name: "TableToolbar",
23
24
  props: {
24
25
  currentView: { default: "table" },
@@ -39,220 +40,207 @@ const ie = { class: "of-table-toolbar" }, fe = {
39
40
  savedViews: { default: void 0 }
40
41
  },
41
42
  emits: ["update:currentView", "update:columns", "update:searchKeyword", "add-filter", "remove-filter", "update-filter", "clear-filters", "update:filterLogic", "sort", "group", "save-view", "load-view"],
42
- setup(l, { emit: N }) {
43
- const R = l, u = N, I = [
43
+ setup(l, { emit: F }) {
44
+ const g = l, i = F, U = [
44
45
  { value: "table", label: "表格", icon: "table-2" },
45
46
  { value: "kanban", label: "看板", icon: "columns-3" },
46
47
  { value: "timeline", label: "时间线", icon: "calendar" }
47
- ], j = T(() => R.viewTabs ?? I), k = i(!1), v = i(!1), c = i(!1), p = i(!1), D = i(null), G = i(null), A = i(null), z = i(null), F = i({}), P = i({}), U = i({}), E = i({});
48
- function q(r) {
49
- if (!r) return {};
50
- const e = r.getBoundingClientRect();
51
- return {
52
- top: `${e.bottom + 4}px`,
53
- left: `${e.left}px`
54
- };
55
- }
56
- function S(r) {
57
- r !== "filter" && (k.value = !1), r !== "sort" && (v.value = !1), r !== "group" && (c.value = !1), r !== "column" && (p.value = !1);
58
- const f = {
59
- filter: { show: k, btnRef: D, style: F },
60
- sort: { show: v, btnRef: G, style: P },
61
- group: { show: c, btnRef: A, style: U },
62
- column: { show: p, btnRef: z, style: E }
63
- }[r];
64
- f.show.value = !f.show.value, f.show.value && ee(() => {
65
- f.style.value = q(f.btnRef.value);
66
- });
67
- }
68
- function H() {
69
- k.value = !1, v.value = !1, c.value = !1, p.value = !1;
70
- }
71
- function h(r) {
72
- const e = r.target;
73
- !e.closest(".of-table-toolbar__btn-group") && !e.closest(".of-table-toolbar__dropdown") && H();
74
- }
75
- W(() => document.addEventListener("click", h, !0)), X(() => document.removeEventListener("click", h, !0));
76
- const J = T(() => R.columns.filter((r) => !r.hidden)), O = T(
77
- () => R.columns.filter(
78
- (r) => !r.hidden && (r.type === "status" || r.type === "string" || r.type === "priority")
48
+ ], K = S(() => g.viewTabs ?? U), T = k(null), V = k(null), R = k(null), D = k(null), {
49
+ showFilterPanel: E,
50
+ showSortPanel: N,
51
+ showGroupPanel: I,
52
+ showColumnPanel: M,
53
+ filterDropdownStyle: x,
54
+ sortDropdownStyle: j,
55
+ groupDropdownStyle: q,
56
+ columnDropdownStyle: H,
57
+ togglePanel: c,
58
+ closePanel: f
59
+ } = nt({
60
+ filter: T,
61
+ sort: V,
62
+ group: R,
63
+ column: D
64
+ }), J = S(() => g.columns.filter((u) => !u.hidden)), O = S(
65
+ () => g.columns.filter(
66
+ (u) => !u.hidden && (u.type === "status" || u.type === "string" || u.type === "priority")
79
67
  )
80
68
  );
81
- return (r, e) => {
82
- var f, x, K;
83
- return o(), n("div", ie, [
84
- l.showViewSwitch ? (o(), n("div", fe, [
85
- (o(!0), n(V, null, L(j.value, (t) => (o(), n("button", {
86
- key: t.value,
87
- class: m(["of-table-toolbar__view-tab", { "of-table-toolbar__view-tab--active": l.currentView === t.value }]),
88
- onClick: (y) => u("update:currentView", t.value)
69
+ return (u, t) => {
70
+ var G, L, P;
71
+ return o(), r("div", rt, [
72
+ l.showViewSwitch ? (o(), r("div", st, [
73
+ (o(!0), r(B, null, $(K.value, (e) => (o(), r("button", {
74
+ key: e.value,
75
+ class: m(["of-table-toolbar__view-tab", { "of-table-toolbar__view-tab--active": l.currentView === e.value }]),
76
+ onClick: (v) => i("update:currentView", e.value)
89
77
  }, [
90
- t.icon ? (o(), C(Y(w(te)(t.icon)), {
78
+ e.icon ? (o(), y(W(n(Y)(e.icon)), {
91
79
  key: 0,
92
80
  class: "of-table-toolbar__tab-icon"
93
81
  })) : s("", !0),
94
- a("span", null, g(t.label), 1)
95
- ], 10, de))), 128))
82
+ a("span", null, p(e.label), 1)
83
+ ], 10, at))), 128))
96
84
  ])) : s("", !0),
97
- l.showViewSwitch ? (o(), n("div", be)) : s("", !0),
98
- l.showFilter ? (o(), n("div", {
85
+ l.showViewSwitch ? (o(), r("div", it)) : s("", !0),
86
+ l.showFilter ? (o(), r("div", {
99
87
  key: 2,
100
88
  ref_key: "filterBtnRef",
101
- ref: D,
89
+ ref: T,
102
90
  class: "of-table-toolbar__btn-group"
103
91
  }, [
104
92
  a("button", {
105
93
  class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": l.filterActive }]),
106
- onClick: e[0] || (e[0] = d((t) => S("filter"), ["stop"]))
94
+ onClick: t[0] || (t[0] = d((e) => n(c)("filter"), ["stop"]))
107
95
  }, [
108
- b(w(ne), { size: 14 }),
109
- e[19] || (e[19] = a("span", null, "筛选", -1)),
110
- l.filterActive ? (o(), n("span", ve, g(((f = l.filterConditions) == null ? void 0 : f.length) ?? 0), 1)) : s("", !0)
96
+ b(n(h), { size: 14 }),
97
+ t[19] || (t[19] = a("span", null, "筛选", -1)),
98
+ l.filterActive ? (o(), r("span", ut, p(((G = l.filterConditions) == null ? void 0 : G.length) ?? 0), 1)) : s("", !0)
111
99
  ], 2),
112
- (o(), C(B, { to: "body" }, [
113
- k.value ? (o(), n("div", {
100
+ (o(), y(w, { to: "body" }, [
101
+ n(E) ? (o(), r("div", {
114
102
  key: 0,
115
103
  class: "of-table-toolbar__dropdown",
116
- style: $(F.value),
117
- onClick: e[7] || (e[7] = d(() => {
104
+ style: C(n(x)),
105
+ onClick: t[7] || (t[7] = d(() => {
118
106
  }, ["stop"]))
119
107
  }, [
120
- b(oe, {
108
+ b(Z, {
121
109
  conditions: l.filterConditions ?? [],
122
110
  columns: l.columns,
123
111
  logic: l.filterLogic ?? "and",
124
112
  visible: !0,
125
- onAddCondition: e[1] || (e[1] = (t) => u("add-filter")),
126
- onRemoveCondition: e[2] || (e[2] = (t) => u("remove-filter", t)),
127
- onUpdateCondition: e[3] || (e[3] = (t, y) => u("update-filter", t, y)),
128
- onClear: e[4] || (e[4] = (t) => u("clear-filters")),
129
- "onUpdate:logic": e[5] || (e[5] = (t) => u("update:filterLogic", t)),
130
- onClose: e[6] || (e[6] = (t) => k.value = !1)
113
+ onAddCondition: t[1] || (t[1] = (e) => i("add-filter")),
114
+ onRemoveCondition: t[2] || (t[2] = (e) => i("remove-filter", e)),
115
+ onUpdateCondition: t[3] || (t[3] = (e, v) => i("update-filter", e, v)),
116
+ onClear: t[4] || (t[4] = (e) => i("clear-filters")),
117
+ "onUpdate:logic": t[5] || (t[5] = (e) => i("update:filterLogic", e)),
118
+ onClose: t[6] || (t[6] = (e) => n(f)("filter"))
131
119
  }, null, 8, ["conditions", "columns", "logic"])
132
120
  ], 4)) : s("", !0)
133
121
  ]))
134
122
  ], 512)) : s("", !0),
135
- l.showSort ? (o(), n("div", {
123
+ l.showSort ? (o(), r("div", {
136
124
  key: 3,
137
125
  ref_key: "sortBtnRef",
138
- ref: G,
126
+ ref: V,
139
127
  class: "of-table-toolbar__btn-group"
140
128
  }, [
141
129
  a("button", {
142
- class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": (x = l.currentSort) == null ? void 0 : x.field }]),
143
- onClick: e[8] || (e[8] = d((t) => S("sort"), ["stop"]))
130
+ class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": (L = l.currentSort) == null ? void 0 : L.field }]),
131
+ onClick: t[8] || (t[8] = d((e) => n(c)("sort"), ["stop"]))
144
132
  }, [
145
- b(w(re), { size: 14 }),
146
- e[20] || (e[20] = a("span", null, "排序", -1))
133
+ b(n(tt), { size: 14 }),
134
+ t[20] || (t[20] = a("span", null, "排序", -1))
147
135
  ], 2),
148
- (o(), C(B, { to: "body" }, [
149
- v.value ? (o(), n("div", {
136
+ (o(), y(w, { to: "body" }, [
137
+ n(N) ? (o(), r("div", {
150
138
  key: 0,
151
139
  class: "of-table-toolbar__dropdown",
152
- style: $(P.value),
153
- onClick: e[10] || (e[10] = d(() => {
140
+ style: C(n(j)),
141
+ onClick: t[10] || (t[10] = d(() => {
154
142
  }, ["stop"]))
155
143
  }, [
156
- a("div", ce, [
157
- e[21] || (e[21] = a("div", { class: "of-table-toolbar__panel-title" }, "排序", -1)),
158
- (o(!0), n(V, null, L(J.value, (t) => {
159
- var y, _, M;
160
- return o(), n("button", {
161
- key: t.key,
162
- class: m(["of-table-toolbar__sort-item", { active: ((y = l.currentSort) == null ? void 0 : y.field) === t.key }]),
163
- onClick: (ge) => {
164
- u("sort", t.key), v.value = !1;
144
+ a("div", dt, [
145
+ t[21] || (t[21] = a("div", { class: "of-table-toolbar__panel-title" }, "排序", -1)),
146
+ (o(!0), r(B, null, $(J.value, (e) => {
147
+ var v, z, A;
148
+ return o(), r("button", {
149
+ key: e.key,
150
+ class: m(["of-table-toolbar__sort-item", { active: ((v = l.currentSort) == null ? void 0 : v.field) === e.key }]),
151
+ onClick: (ct) => {
152
+ i("sort", e.key), n(f)("sort");
165
153
  }
166
154
  }, [
167
- a("span", null, g(t.label), 1),
168
- ((_ = l.currentSort) == null ? void 0 : _.field) === t.key ? (o(), n("span", me, g(((M = l.currentSort) == null ? void 0 : M.order) === "asc" ? "↑" : "↓"), 1)) : s("", !0)
169
- ], 10, ye);
155
+ a("span", null, p(e.label), 1),
156
+ ((z = l.currentSort) == null ? void 0 : z.field) === e.key ? (o(), r("span", ft, p(((A = l.currentSort) == null ? void 0 : A.order) === "asc" ? "↑" : "↓"), 1)) : s("", !0)
157
+ ], 10, bt);
170
158
  }), 128)),
171
- (K = l.currentSort) != null && K.field ? (o(), n("button", {
159
+ (P = l.currentSort) != null && P.field ? (o(), r("button", {
172
160
  key: 0,
173
161
  class: "of-table-toolbar__clear-btn",
174
- onClick: e[9] || (e[9] = (t) => {
175
- u("sort", ""), v.value = !1;
162
+ onClick: t[9] || (t[9] = (e) => {
163
+ i("sort", ""), n(f)("sort");
176
164
  })
177
165
  }, " 清除排序 ")) : s("", !0)
178
166
  ])
179
167
  ], 4)) : s("", !0)
180
168
  ]))
181
169
  ], 512)) : s("", !0),
182
- l.showGroup ? (o(), n("div", {
170
+ l.showGroup ? (o(), r("div", {
183
171
  key: 4,
184
172
  ref_key: "groupBtnRef",
185
- ref: A,
173
+ ref: R,
186
174
  class: "of-table-toolbar__btn-group"
187
175
  }, [
188
176
  a("button", {
189
177
  class: m(["of-table-toolbar__btn", { "of-table-toolbar__btn--active": !!l.currentGroup }]),
190
- onClick: e[11] || (e[11] = d((t) => S("group"), ["stop"]))
178
+ onClick: t[11] || (t[11] = d((e) => n(c)("group"), ["stop"]))
191
179
  }, [
192
- b(w(se), { size: 14 }),
193
- e[22] || (e[22] = a("span", null, "分组", -1))
180
+ b(n(et), { size: 14 }),
181
+ t[22] || (t[22] = a("span", null, "分组", -1))
194
182
  ], 2),
195
- (o(), C(B, { to: "body" }, [
196
- c.value ? (o(), n("div", {
183
+ (o(), y(w, { to: "body" }, [
184
+ n(I) ? (o(), r("div", {
197
185
  key: 0,
198
186
  class: "of-table-toolbar__dropdown",
199
- style: $(U.value),
200
- onClick: e[13] || (e[13] = d(() => {
187
+ style: C(n(q)),
188
+ onClick: t[13] || (t[13] = d(() => {
201
189
  }, ["stop"]))
202
190
  }, [
203
- a("div", we, [
204
- e[23] || (e[23] = a("div", { class: "of-table-toolbar__panel-title" }, "分组", -1)),
205
- (o(!0), n(V, null, L(O.value, (t) => (o(), n("button", {
206
- key: t.key,
207
- class: m(["of-table-toolbar__sort-item", { active: l.currentGroup === t.key }]),
208
- onClick: (y) => {
209
- u("group", l.currentGroup === t.key ? null : t.key), c.value = !1;
191
+ a("div", vt, [
192
+ t[23] || (t[23] = a("div", { class: "of-table-toolbar__panel-title" }, "分组", -1)),
193
+ (o(!0), r(B, null, $(O.value, (e) => (o(), r("button", {
194
+ key: e.key,
195
+ class: m(["of-table-toolbar__sort-item", { active: l.currentGroup === e.key }]),
196
+ onClick: (v) => {
197
+ i("group", l.currentGroup === e.key ? null : e.key), n(f)("group");
210
198
  }
211
- }, g(t.label), 11, ke))), 128)),
212
- l.currentGroup ? (o(), n("button", {
199
+ }, p(e.label), 11, mt))), 128)),
200
+ l.currentGroup ? (o(), r("button", {
213
201
  key: 0,
214
202
  class: "of-table-toolbar__clear-btn",
215
- onClick: e[12] || (e[12] = (t) => {
216
- u("group", null), c.value = !1;
203
+ onClick: t[12] || (t[12] = (e) => {
204
+ i("group", null), n(f)("group");
217
205
  })
218
206
  }, " 取消分组 ")) : s("", !0)
219
207
  ])
220
208
  ], 4)) : s("", !0)
221
209
  ]))
222
210
  ], 512)) : s("", !0),
223
- l.showColumns ? (o(), n("div", {
211
+ l.showColumns ? (o(), r("div", {
224
212
  key: 5,
225
213
  ref_key: "columnBtnRef",
226
- ref: z,
214
+ ref: D,
227
215
  class: "of-table-toolbar__btn-group"
228
216
  }, [
229
217
  a("button", {
230
218
  class: "of-table-toolbar__btn",
231
- onClick: e[14] || (e[14] = d((t) => S("column"), ["stop"]))
219
+ onClick: t[14] || (t[14] = d((e) => n(c)("column"), ["stop"]))
232
220
  }, [
233
- b(w(ae), { size: 14 }),
234
- e[24] || (e[24] = a("span", null, "列", -1))
221
+ b(n(ot), { size: 14 }),
222
+ t[24] || (t[24] = a("span", null, "列", -1))
235
223
  ]),
236
- (o(), C(B, { to: "body" }, [
237
- p.value ? (o(), n("div", {
224
+ (o(), y(w, { to: "body" }, [
225
+ n(M) ? (o(), r("div", {
238
226
  key: 0,
239
227
  class: "of-table-toolbar__dropdown",
240
- style: $(E.value),
241
- onClick: e[17] || (e[17] = d(() => {
228
+ style: C(n(H)),
229
+ onClick: t[17] || (t[17] = d(() => {
242
230
  }, ["stop"]))
243
231
  }, [
244
- b(le, {
232
+ b(_, {
245
233
  columns: l.columns,
246
234
  visible: !0,
247
- "onUpdate:columns": e[15] || (e[15] = (t) => u("update:columns", t)),
248
- onClose: e[16] || (e[16] = (t) => p.value = !1)
235
+ "onUpdate:columns": t[15] || (t[15] = (e) => i("update:columns", e)),
236
+ onClose: t[16] || (t[16] = (e) => n(f)("column"))
249
237
  }, null, 8, ["columns"])
250
238
  ], 4)) : s("", !0)
251
239
  ]))
252
240
  ], 512)) : s("", !0),
253
- e[25] || (e[25] = a("div", { class: "of-table-toolbar__spacer" }, null, -1)),
254
- l.showSearch ? (o(), n("div", pe, [
255
- b(w(ue), {
241
+ t[25] || (t[25] = a("div", { class: "of-table-toolbar__spacer" }, null, -1)),
242
+ l.showSearch ? (o(), r("div", yt, [
243
+ b(n(lt), {
256
244
  size: 14,
257
245
  class: "of-table-toolbar__search-icon"
258
246
  }),
@@ -260,14 +248,14 @@ const ie = { class: "of-table-toolbar" }, fe = {
260
248
  class: "of-table-toolbar__search-input",
261
249
  placeholder: "搜索...",
262
250
  value: l.searchKeyword,
263
- onInput: e[18] || (e[18] = (t) => u("update:searchKeyword", t.target.value))
264
- }, null, 40, Ce)
251
+ onInput: t[18] || (t[18] = (e) => i("update:searchKeyword", e.target.value))
252
+ }, null, 40, pt)
265
253
  ])) : s("", !0),
266
- Z(r.$slots, "default", {}, void 0, !0)
254
+ X(u.$slots, "default", {}, void 0, !0)
267
255
  ]);
268
256
  };
269
257
  }
270
258
  });
271
259
  export {
272
- Ve as default
260
+ $t as default
273
261
  };
@@ -0,0 +1,26 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { Density, FieldType, TableColumn } from '../../types';
3
+ import { BulkActionContext, BulkActionItem, ResolvedBulkActionItem } from '../../types/data-table';
4
+ import { FieldDef as CellFieldDef } from './FieldCell.vue';
5
+ export declare function normalizeFieldType(type?: CellFieldDef["type"]): FieldType | undefined;
6
+ export declare function resolveRowId(row: Record<string, unknown>, rowKey: string): string;
7
+ export declare function resolveFieldDef(fieldDefs: CellFieldDef[] | undefined, colKey: string): CellFieldDef;
8
+ export declare function resolveFirstEditableFieldKey<T extends Record<string, unknown>>(params: {
9
+ row: T;
10
+ readonly: boolean;
11
+ columns: TableColumn[];
12
+ editableFieldKeys: string[];
13
+ }): string | null;
14
+ export declare function buildResolvedBulkActionItems<TRecord>(customItems: BulkActionItem[] | undefined, context: BulkActionContext<TRecord>): ResolvedBulkActionItem[];
15
+ export declare function getDensityCellPadding(density: Density): {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ export declare function buildDataRowStyle(rowHeight: number): CSSProperties;
20
+ export declare function buildBodyCellStyle(params: {
21
+ density: Density;
22
+ col: TableColumn;
23
+ resolvedWidth: number;
24
+ fillMinWidth: number;
25
+ }): CSSProperties;
26
+ export declare function buildGroupSpacerStyle(groupRowHeight: number): CSSProperties;
@@ -0,0 +1,60 @@
1
+ function f(n) {
2
+ return n === "multiselect" ? "multi_select" : n;
3
+ }
4
+ function x(n, e) {
5
+ const t = n[e];
6
+ return t != null ? String(t) : "";
7
+ }
8
+ function y(n, e) {
9
+ return (n == null ? void 0 : n.find((t) => t.id === e)) ?? {
10
+ id: e,
11
+ type: "text",
12
+ label: e
13
+ };
14
+ }
15
+ function h(n) {
16
+ const { row: e, readonly: t, columns: r, editableFieldKeys: l } = n;
17
+ if (t) return null;
18
+ for (const i of r)
19
+ if (!i.hidden && l.includes(i.key) && !(e[i.key] === void 0 && !(i.key in e)))
20
+ return i.key;
21
+ return null;
22
+ }
23
+ function c(n) {
24
+ return n === "compact" ? { x: 10, y: 6 } : n === "comfortable" ? { x: 14, y: 10 } : { x: 12, y: 8 };
25
+ }
26
+ function p(n) {
27
+ return {
28
+ minHeight: `${n}px`
29
+ };
30
+ }
31
+ function a(n) {
32
+ const { density: e, col: t, resolvedWidth: r, fillMinWidth: l } = n, { x: i, y: d } = c(e), o = {
33
+ padding: `${d}px ${i}px`
34
+ };
35
+ if (t.width === "fill") {
36
+ const u = `${t.minWidth ?? l}px`;
37
+ return { ...o, flex: `1 1 ${u}`, minWidth: u };
38
+ }
39
+ return typeof t.width == "number" ? { ...o, width: `${t.width}px`, flexShrink: "0", flexGrow: "0" } : {
40
+ ...o,
41
+ width: `${r}px`,
42
+ flexShrink: "0",
43
+ flexGrow: "0"
44
+ };
45
+ }
46
+ function s(n) {
47
+ return {
48
+ height: `${n}px`
49
+ };
50
+ }
51
+ export {
52
+ a as buildBodyCellStyle,
53
+ p as buildDataRowStyle,
54
+ s as buildGroupSpacerStyle,
55
+ c as getDensityCellPadding,
56
+ f as normalizeFieldType,
57
+ y as resolveFieldDef,
58
+ h as resolveFirstEditableFieldKey,
59
+ x as resolveRowId
60
+ };
@@ -0,0 +1,59 @@
1
+ import { DatabaseViewDetailPresentation, DatabaseViewResolvedDetailPresentation } from '../contracts/database';
2
+ import { CellValue, DataRecord, TableColumn, TableSchema } from '../types';
3
+ type DetailCellFieldType = "text" | "number" | "checkbox" | "select" | "multiselect" | "date" | "datetime" | "rating" | "url" | "email" | "currency" | "richtext" | "auto_number" | "creator" | "progress" | "relation" | "attachment" | "phone";
4
+ export interface DetailCellFieldDef {
5
+ id: string;
6
+ type: DetailCellFieldType;
7
+ label: string;
8
+ options?: {
9
+ label: string;
10
+ value: string;
11
+ color?: string;
12
+ }[];
13
+ max?: number;
14
+ readonly?: boolean;
15
+ }
16
+ export interface DatabaseWorkspaceModeOption {
17
+ value: DatabaseViewResolvedDetailPresentation;
18
+ label: string;
19
+ }
20
+ export interface DatabaseDetailPropertyItem {
21
+ key: string;
22
+ label: string;
23
+ field: DetailCellFieldDef | null;
24
+ value: CellValue | undefined;
25
+ fallbackText: string;
26
+ }
27
+ export declare function buildDetailColumns(schema?: TableSchema | null, records?: DataRecord[]): {
28
+ key: string;
29
+ label: string;
30
+ type: "string" | "number" | "date" | "status" | "priority" | undefined;
31
+ hidden: boolean;
32
+ width: number | undefined;
33
+ }[];
34
+ export declare function buildDetailFieldDefs(schema?: TableSchema | null, records?: DataRecord[]): {
35
+ id: string;
36
+ type: DetailCellFieldType;
37
+ label: string;
38
+ }[];
39
+ export declare function toDetailRow(record: DataRecord | null): Record<string, unknown> & {
40
+ id: string;
41
+ };
42
+ export declare function buildDetailWorkspaceTitle(record: DataRecord | null): string;
43
+ export declare function partitionDetailColumns(columns: TableColumn[], fieldDefs: DetailCellFieldDef[]): {
44
+ propertyColumns: TableColumn[];
45
+ contentColumns: TableColumn[];
46
+ };
47
+ export declare function buildDetailWorkspaceDescription(columns: TableColumn[], row: Record<string, unknown>): string;
48
+ export declare function buildDetailPropertyItems(options: {
49
+ columns: TableColumn[];
50
+ fieldDefs: DetailCellFieldDef[];
51
+ row: Record<string, unknown>;
52
+ }): DatabaseDetailPropertyItem[];
53
+ export declare function resolveDetailPresentation(options: {
54
+ requested: DatabaseViewDetailPresentation;
55
+ preferred: DatabaseViewResolvedDetailPresentation | null;
56
+ isMobileViewport: boolean;
57
+ }): DatabaseViewResolvedDetailPresentation;
58
+ export declare function buildWorkspaceModes(isMobileViewport: boolean): DatabaseWorkspaceModeOption[];
59
+ export {};