@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,55 +1,50 @@
1
- import { defineComponent as fo, defineAsyncComponent as Fe, computed as f, ref as z, onMounted as co, onBeforeUnmount as vo, toRef as x, watch as Ae, unref as n, openBlock as r, createElementBlock as i, Fragment as b, createVNode as j, normalizeStyle as y, normalizeClass as C, createSlots as bo, withCtx as Te, renderSlot as P, normalizeProps as yo, guardReactiveProps as go, createBlock as w, createCommentVNode as D, createElementVNode as c, toDisplayString as R, renderList as h, mergeProps as Y, withModifiers as I, Teleport as ko } from "vue";
2
- import ze from "./TableHeaderRow.vue.js";
3
- import dl from "./TableDataRow.vue.js";
1
+ import { defineComponent as so, defineAsyncComponent as Qe, computed as k, ref as W, toRef as w, watch as Ue, unref as n, openBlock as r, createBlock as v, createSlots as io, withCtx as $, renderSlot as H, normalizeProps as uo, guardReactiveProps as co, createElementBlock as s, normalizeStyle as g, normalizeClass as F, createVNode as N, createElementVNode as h, Fragment as y, renderList as m, mergeProps as G, withModifiers as z, toDisplayString as B, createCommentVNode as M, Teleport as fo } from "vue";
2
+ import Ce from "./TableHeaderRow.vue.js";
3
+ import Ze from "./TableDataRow.vue.js";
4
4
  import de from "./TableGroupRow.vue.js";
5
- import wo from "./NewRowBtn.vue.js";
6
- import ho from "./MobileListView.vue.js";
5
+ import yo from "./NewRowBtn.vue.js";
6
+ import vo from "./DataTableDraftToolbar.vue.js";
7
+ import bo from "./DataTableMobilePanel.vue.js";
8
+ import go from "./DataTableDesktopFrame.vue.js";
7
9
  import V from "./FieldCell.vue.js";
8
- import { useInlineEdit as po } from "../../composables/useInlineEdit.js";
9
- import { useVirtualList as mo } from "../../composables/useVirtualList.js";
10
- import { useTable as Co } from "../../composables/useTable.js";
10
+ import { normalizeFieldType as _e, resolveRowId as ko, resolveFieldDef as wo, buildDataRowStyle as ho, buildBodyCellStyle as mo, buildGroupSpacerStyle as po, resolveFirstEditableFieldKey as Co } from "./dataTableUtils.js";
11
+ import { useInlineEdit as Do } from "../../composables/useInlineEdit.js";
12
+ import { useVirtualList as So } from "../../composables/useVirtualList.js";
13
+ import { useTable as Ro } from "../../composables/useTable.js";
11
14
  import { useTableGroup as xo } from "../../composables/useTableGroup.js";
12
- import { useTableData as Do } from "../../composables/useTableData.js";
13
- import { useTableColumns as Ro } from "../../composables/useTableColumns.js";
14
- import { useColumnResize as $o } from "../../composables/useColumnResize.js";
15
- import { useKeyboardNavigation as So } from "../../composables/useKeyboardNavigation.js";
16
- import { useBreakpoint as Mo } from "../../composables/useBreakpoint.js";
17
- import { useFixedColumns as Fo } from "../../composables/useFixedColumns.js";
18
- import { useRowDrag as Ao } from "../../composables/useRowDrag.js";
19
- import { useDraftRows as To } from "../../composables/useDraftRows.js";
20
- const zo = {
21
- key: 0,
22
- class: "of-data-table-selection-bar",
23
- "data-role": "selection-bar"
24
- }, Ho = { class: "of-data-table-selection-bar__summary" }, Ko = { class: "of-data-table-selection-bar__count" }, Bo = { class: "of-data-table-selection-bar__actions" }, Io = ["disabled", "onClick"], Po = {
25
- key: 1,
26
- class: "of-data-table-body",
27
- style: { position: "relative" }
28
- }, Eo = { class: "of-data-table-fixed-body" }, Wo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], _o = ["for"], Lo = ["id", "checked", "onChange"], Go = {
15
+ import { useTableData as $o } from "../../composables/useTableData.js";
16
+ import { useTableColumns as Fo } from "../../composables/useTableColumns.js";
17
+ import { useColumnResize as Mo } from "../../composables/useColumnResize.js";
18
+ import { useKeyboardNavigation as Ao } from "../../composables/useKeyboardNavigation.js";
19
+ import { useBreakpoint as To } from "../../composables/useBreakpoint.js";
20
+ import { useFixedColumns as Ko } from "../../composables/useFixedColumns.js";
21
+ import { useRowDrag as zo } from "../../composables/useRowDrag.js";
22
+ import { useDraftRows as Bo } from "../../composables/useDraftRows.js";
23
+ import { useDataTableLayout as Ho } from "../../composables/useDataTableLayout.js";
24
+ import { useDataTableSelection as Io } from "../../composables/useDataTableSelection.js";
25
+ import { useDataTableDetailSheet as Eo } from "../../composables/useDataTableDetailSheet.js";
26
+ const Po = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Lo = ["for"], Wo = ["id", "checked", "onChange"], Go = {
29
27
  key: 1,
30
28
  class: "of-td-text"
31
- }, Yo = ["disabled", "onClick"], Vo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Oo = ["for"], Xo = ["id", "checked", "onChange"], No = {
29
+ }, Vo = ["disabled", "onClick"], No = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Oo = ["for"], Yo = ["id", "checked", "onChange"], jo = {
32
30
  key: 1,
33
31
  class: "of-td-text"
34
- }, jo = ["disabled", "onClick"], Uo = { class: "of-data-table-scroll-body" }, qo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Jo = {
32
+ }, Xo = ["disabled", "onClick"], qo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Jo = {
35
33
  key: 1,
36
34
  class: "of-td-text"
37
- }, Qo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Zo = {
35
+ }, Qo = ["onMouseenter", "onFocusin", "onClick", "onKeydown"], Uo = {
38
36
  key: 1,
39
37
  class: "of-td-text"
40
- }, et = {
38
+ }, Zo = {
41
39
  key: 1,
42
40
  class: "of-td-text"
43
- }, lt = {
41
+ }, _o = {
44
42
  key: 1,
45
43
  class: "of-td-text"
46
- }, ot = {
47
- key: 4,
48
- class: "of-data-table-draft-toolbar"
49
- }, tt = { class: "of-data-table-draft-count" }, nt = {
44
+ }, en = {
50
45
  key: 0,
51
46
  class: "of-add-field-overlay"
52
- }, at = { class: "of-add-field-popup" }, $t = /* @__PURE__ */ fo({
47
+ }, ln = { class: "of-add-field-popup" }, Mn = /* @__PURE__ */ so({
53
48
  __name: "DataTable",
54
49
  props: {
55
50
  tasks: { default: () => [] },
@@ -83,1032 +78,946 @@ const zo = {
83
78
  containerResponsive: { type: Boolean, default: !0 }
84
79
  },
85
80
  emits: ["row-click", "row-click-record", "add-row", "selection-change", "cell-edit", "column-resize", "active-cell-change", "row-reorder", "row-group-change", "draft-commit", "draft-discard", "drafts-commit-all", "paste", "row-delete", "schema-add-field", "schema-rename-field", "schema-change-field-type", "schema-hide-field", "schema-delete-field", "schema-duplicate-field", "bulk-action"],
86
- setup(u, { emit: ul }) {
87
- const s = u, v = ul, fl = Fe(() => import("./ColumnHeaderMenu.vue.js")), cl = Fe(() => import("./FieldTypePicker.vue.js")), vl = Fe(() => import("./DetailSheet.vue.js")), bl = {
88
- compact: {
89
- headerHeight: 32,
90
- rowHeight: 36,
91
- groupRowHeight: 32,
92
- mobileCardPaddingX: 12,
93
- mobileCardPaddingY: 10,
94
- fillMinWidth: 180
95
- },
96
- standard: {
97
- headerHeight: 36,
98
- rowHeight: 44,
99
- groupRowHeight: 36,
100
- mobileCardPaddingX: 16,
101
- mobileCardPaddingY: 12,
102
- fillMinWidth: 220
103
- },
104
- comfortable: {
105
- headerHeight: 40,
106
- rowHeight: 52,
107
- groupRowHeight: 40,
108
- mobileCardPaddingX: 18,
109
- mobileCardPaddingY: 14,
110
- fillMinWidth: 240
111
- }
112
- }, O = f(() => s.density ?? "standard"), $ = z(0);
113
- let E = null;
114
- function yl() {
115
- var e;
116
- $.value = ((e = _.value) == null ? void 0 : e.clientWidth) ?? 0;
117
- }
118
- co(() => {
119
- yl(), !(typeof ResizeObserver > "u" || !_.value) && (E = new ResizeObserver((e) => {
120
- const l = e[0];
121
- l && ($.value = l.contentRect.width);
122
- }), E.observe(_.value));
123
- }), vo(() => {
124
- E == null || E.disconnect(), E = null;
125
- });
126
- const F = f(() => !s.containerResponsive || ue.value ? O.value : $.value > 0 && $.value <= 860 ? "compact" : $.value > 0 && $.value <= 1080 && O.value === "comfortable" ? "standard" : O.value), p = f(() => bl[F.value]), He = f(() => `of-data-table--${F.value}`), gl = f(() => $.value > 0 && $.value <= 860 ? "of-data-table--container-tight" : $.value > 0 && $.value <= 1080 ? "of-data-table--container-medium" : "of-data-table--container-wide"), Ke = f(() => ({
127
- "--of-data-table-group-row-height": `${p.value.groupRowHeight}px`,
128
- "--of-data-table-mobile-card-padding-x": `${p.value.mobileCardPaddingX}px`,
129
- "--of-data-table-mobile-card-padding-y": `${p.value.mobileCardPaddingY}px`,
130
- "--of-data-table-new-row-padding-x": `${p.value.mobileCardPaddingX}px`,
131
- "--of-data-table-new-row-padding-y": `${p.value.mobileCardPaddingY}px`,
132
- "--of-data-table-fill-min-width": `${p.value.fillMinWidth}px`
133
- })), { isMobile: ue } = Mo(), U = z(!1), fe = z(null), Be = f(
134
- () => fe.value
135
- ), kl = f(
136
- () => (s.fieldDefs ?? []).filter((e) => !e.readonly).map((e) => e.id)
81
+ setup(u, { emit: el }) {
82
+ const i = u, c = el, ll = Qe(() => import("./ColumnHeaderMenu.vue.js")), ol = Qe(() => import("./FieldTypePicker.vue.js")), nl = k(() => i.density ?? "standard"), { isMobile: ue } = To(), O = W(null), Y = W(null), De = W(null), {
83
+ containerDensity: A,
84
+ densityMetrics: I,
85
+ densityClass: Se,
86
+ containerWidthClass: tl,
87
+ densityStyle: Re
88
+ } = Ho({
89
+ tableContainerRef: Y,
90
+ density: nl,
91
+ containerResponsive: k(() => i.containerResponsive ?? !0),
92
+ isMobile: ue
93
+ }), {
94
+ detailSheetVisible: al,
95
+ detailSheetTableRow: rl,
96
+ handleRowClick: sl,
97
+ handleMobileRowClick: il,
98
+ buildDetailSavePayloads: dl,
99
+ closeDetailSheet: ul
100
+ } = Eo(), cl = k(
101
+ () => (i.fieldDefs ?? []).filter((e) => !e.readonly).map((e) => e.id)
137
102
  );
138
- function Ie(e) {
139
- if (s.readonly) return null;
140
- for (const l of A.value)
141
- if (!l.hidden && kl.value.includes(l.key) && !(e[l.key] === void 0 && !(l.key in e)))
142
- return l.key;
143
- return null;
103
+ function xe(e) {
104
+ return Co({
105
+ row: e,
106
+ readonly: i.readonly,
107
+ columns: D.value,
108
+ editableFieldKeys: cl.value
109
+ });
144
110
  }
145
- function q(e) {
146
- const l = [
111
+ function j(e) {
112
+ const o = [
147
113
  {
148
114
  key: "detail",
149
115
  label: "详情",
150
- onClick: () => S(e)
116
+ onClick: () => p(e)
151
117
  }
152
- ], o = Ie(e);
153
- return o && l.push({
118
+ ], l = xe(e);
119
+ return l && o.push({
154
120
  key: "edit",
155
121
  label: "编辑",
156
- onClick: () => Pe(e, o)
157
- }), l;
122
+ onClick: () => $e(e, l)
123
+ }), o;
158
124
  }
159
- function Pe(e, l) {
160
- const o = d(e), t = l ?? Ie(e);
125
+ function $e(e, o) {
126
+ const l = d(e), t = o ?? xe(e);
161
127
  if (!t) {
162
- S(e);
128
+ p(e);
163
129
  return;
164
130
  }
165
- J.activate(o, t), s.enableKeyboard && pe(o, t);
131
+ X.activate(l, t), i.enableKeyboard && ve(l, t);
166
132
  }
167
- function Ee(e, l) {
168
- if (l === "detail") {
169
- S(e);
133
+ function Fe(e, o) {
134
+ if (o === "detail") {
135
+ p(e);
170
136
  return;
171
137
  }
172
- l === "edit" && Pe(e);
173
- }
174
- const J = po(), { commit: wl, editingCell: hl } = J, { rows: ce } = Do({
175
- tasks: x(s, "tasks"),
176
- records: x(s, "records")
177
- }), { columns: We } = Ro({
178
- columns: x(s, "columns"),
179
- schema: x(s, "schema"),
180
- view: x(s, "view")
138
+ o === "edit" && $e(e);
139
+ }
140
+ const X = Do(), { commit: fl, editingCell: yl } = X, { rows: ce } = $o({
141
+ tasks: w(i, "tasks"),
142
+ records: w(i, "records")
143
+ }), { columns: Me } = Fo({
144
+ columns: w(i, "columns"),
145
+ schema: w(i, "schema"),
146
+ view: w(i, "view")
181
147
  }), {
182
- startResize: pl,
183
- columnWidthOverrides: ml,
184
- showResizeIndicator: Cl,
185
- resizeIndicatorX: xl,
186
- autoFitColumn: Dl,
187
- resolvedWidth: _e
188
- } = $o({
189
- columns: We,
148
+ startResize: vl,
149
+ columnWidthOverrides: bl,
150
+ showResizeIndicator: gl,
151
+ resizeIndicatorX: kl,
152
+ autoFitColumn: wl,
153
+ resolvedWidth: Ae
154
+ } = Mo({
155
+ columns: Me,
190
156
  rows: ce,
191
- density: F,
192
- onResize: (e, l) => v("column-resize", { colKey: e, width: l })
193
- }), A = f(() => {
194
- const e = ml.value;
195
- return We.value.map((l) => {
196
- const o = e.get(l.key);
197
- return o !== void 0 ? { ...l, width: o } : l.width === "fill" ? {
198
- ...l,
199
- minWidth: l.minWidth ?? p.value.fillMinWidth
200
- } : typeof l.width == "number" ? l : { ...l, width: _e(l.key) };
157
+ density: A,
158
+ onResize: (e, o) => c("column-resize", { colKey: e, width: o })
159
+ }), D = k(() => {
160
+ const e = bl.value;
161
+ return Me.value.map((o) => {
162
+ const l = e.get(o.key);
163
+ return l !== void 0 ? { ...o, width: l } : o.width === "fill" ? {
164
+ ...o,
165
+ minWidth: o.minWidth ?? I.value.fillMinWidth
166
+ } : typeof o.width == "number" ? o : { ...o, width: Ae(o.key) };
201
167
  });
202
168
  }), {
203
- data: X,
204
- sort: W,
205
- toggleSort: Q,
206
- selectedRows: m,
207
- clearSelection: Rl,
208
- toggleSelectAll: $l,
209
- toggleRowSelection: Sl,
210
- isAllSelected: ve,
211
- setData: Ml
212
- } = Co({
169
+ data: fe,
170
+ sort: E,
171
+ toggleSort: q,
172
+ selectedRows: S,
173
+ clearSelection: hl,
174
+ toggleSelectAll: ml,
175
+ toggleRowSelection: pl,
176
+ isAllSelected: Te,
177
+ setData: Cl
178
+ } = Ro({
213
179
  data: ce.value,
214
180
  pageSize: 999999
215
181
  });
216
- Ae(ce, (e) => Ml(e), { deep: !1 });
217
- const { groupedItems: H, collapsedGroups: Fl, toggleGroup: Z, isGroupHeader: K } = xo({
218
- data: X,
219
- groupBy: x(s, "groupBy"),
220
- groups: x(s, "groups"),
221
- aggregations: x(s, "aggregations")
222
- }), ee = z(null), _ = z(null), Le = z(null), Al = f(() => {
182
+ Ue(ce, (e) => Cl(e), { deep: !1 });
183
+ const { groupedItems: T, collapsedGroups: Dl, toggleGroup: J, isGroupHeader: K } = xo({
184
+ data: fe,
185
+ groupBy: w(i, "groupBy"),
186
+ groups: w(i, "groups"),
187
+ aggregations: w(i, "aggregations")
188
+ }), Sl = k(() => {
223
189
  var e;
224
- return (((e = s.fixedColumns) == null ? void 0 : e.length) ?? 0) > 0;
225
- }), Ge = z(0), Tl = f(() => Ge.value > 0), {
226
- fixedColumns: be,
227
- scrollableColumns: ye,
228
- fixedWidth: Ye,
229
- handleScroll: zl,
230
- handleFixedScroll: Ve,
231
- syncHover: k,
232
- isRowHovered: le
233
- } = Fo({
234
- columns: A,
235
- fixedColumnKeys: f(() => s.fixedColumns ?? []),
236
- scrollContainerRef: ee,
237
- fixedContainerRef: Le
238
- }), ge = f(() => s.virtual !== void 0 ? s.virtual : H.value.length >= s.virtualThreshold), { visibleItems: ke, totalHeight: we, offsetY: he, scrollToIndex: Hl, observeRow: Kl } = mo({
239
- items: H,
190
+ return (((e = i.fixedColumns) == null ? void 0 : e.length) ?? 0) > 0;
191
+ }), Ke = W(0), Rl = k(() => Ke.value > 0), {
192
+ fixedColumns: Q,
193
+ scrollableColumns: U,
194
+ fixedWidth: xl,
195
+ handleScroll: $l,
196
+ handleFixedScroll: Fl,
197
+ syncHover: b,
198
+ isRowHovered: Z
199
+ } = Ko({
200
+ columns: D,
201
+ fixedColumnKeys: k(() => i.fixedColumns ?? []),
202
+ scrollContainerRef: O,
203
+ fixedContainerRef: De
204
+ }), _ = k(() => i.virtual !== void 0 ? i.virtual : T.value.length >= i.virtualThreshold), { visibleItems: ye, totalHeight: ee, offsetY: le, scrollToIndex: Ml, observeRow: Al } = So({
205
+ items: T,
240
206
  itemHeight: (e) => {
241
- const l = H.value[e];
242
- return K(l) ? p.value.groupRowHeight : p.value.rowHeight;
207
+ const o = T.value[e];
208
+ return K(o) ? I.value.groupRowHeight : I.value.rowHeight;
243
209
  },
244
210
  overscan: 5,
245
- containerRef: ee,
246
- invalidateKey: F,
211
+ containerRef: O,
212
+ invalidateKey: A,
247
213
  measureRow: !0
248
- }), Oe = f(() => H.value.filter((e) => !K(e))), { activeCell: Xe, selectedRange: Bl, setActiveCell: pe, handleKeyDown: Il } = So({
249
- columns: A,
250
- rows: Oe,
251
- containerRef: _,
252
- editingCell: hl,
253
- enabled: f(() => s.enableKeyboard),
254
- onActivateEdit: (e, l) => J.activate(e, l),
255
- onCancelEdit: () => J.cancel(),
256
- onScrollToRow: (e) => Hl(e),
257
- getCellValue: (e, l) => {
258
- const o = Oe.value.find((a) => a.id === e);
259
- if (!o) return "";
260
- const t = o[l];
214
+ }), ze = k(() => T.value.filter((e) => !K(e))), { activeCell: Be, selectedRange: Tl, setActiveCell: ve, handleKeyDown: Kl } = Ao({
215
+ columns: D,
216
+ rows: ze,
217
+ containerRef: Y,
218
+ editingCell: yl,
219
+ enabled: k(() => i.enableKeyboard),
220
+ onActivateEdit: (e, o) => X.activate(e, o),
221
+ onCancelEdit: () => X.cancel(),
222
+ onScrollToRow: (e) => Ml(e),
223
+ getCellValue: (e, o) => {
224
+ const l = ze.value.find((a) => a.id === e);
225
+ if (!l) return "";
226
+ const t = l[o];
261
227
  return t != null ? String(t) : "";
262
228
  },
263
- onPaste: (e, l, o) => {
264
- v("paste", { startRowId: e, startColKey: l, data: o });
229
+ onPaste: (e, o, l) => {
230
+ c("paste", { startRowId: e, startColKey: o, data: l });
265
231
  }
266
232
  });
267
- Ae(Xe, (e) => v("active-cell-change", e ?? null));
233
+ Ue(Be, (e) => c("active-cell-change", e ?? null));
268
234
  const {
269
- isDragging: Pl,
270
- draggedRowId: El,
271
- dropTargetId: me,
272
- dropPosition: Ne,
273
- handleDragStart: Wl,
274
- handleDragOver: _l,
275
- handleDrop: Ll,
276
- handleDragEnd: je
277
- } = Ao({
278
- processedItems: H,
279
- enableCrossGroupDrag: f(() => s.enableCrossGroupDrag),
280
- groupFieldId: x(s, "groupBy")
235
+ isDragging: zl,
236
+ draggedRowId: Bl,
237
+ dropTargetId: be,
238
+ dropPosition: He,
239
+ handleDragStart: Hl,
240
+ handleDragOver: Il,
241
+ handleDrop: El,
242
+ handleDragEnd: Ie
243
+ } = zo({
244
+ processedItems: T,
245
+ enableCrossGroupDrag: k(() => i.enableCrossGroupDrag),
246
+ groupFieldId: w(i, "groupBy")
281
247
  });
282
- function Ue(e, l) {
283
- s.enableRowDrag && Wl(e, l);
248
+ function Ee(e, o) {
249
+ i.enableRowDrag && Hl(e, o);
284
250
  }
285
- function qe(e, l) {
286
- s.enableRowDrag && _l(e, l);
251
+ function Pe(e, o) {
252
+ i.enableRowDrag && Il(e, o);
287
253
  }
288
- function Je(e, l) {
289
- s.enableRowDrag && Ll(e, l, {
290
- onReorder: (o) => v("row-reorder", o),
291
- onGroupChange: (o) => v("row-group-change", o)
254
+ function Le(e, o) {
255
+ i.enableRowDrag && El(e, o, {
256
+ onReorder: (l) => c("row-reorder", l),
257
+ onGroupChange: (l) => c("row-group-change", l)
292
258
  });
293
259
  }
294
260
  const {
295
- drafts: Qe,
296
- addDraft: Gl,
297
- commitAll: Yl,
298
- discardAll: Vl
299
- } = To({
300
- schema: x(s, "schema"),
301
- groupFieldId: x(s, "groupBy")
302
- }), Ol = f(() => Qe.value.size > 0);
303
- function Xl() {
304
- s.schema ? Gl() : v("add-row");
261
+ drafts: We,
262
+ addDraft: Pl,
263
+ commitAll: Ll,
264
+ discardAll: Wl
265
+ } = Bo({
266
+ schema: w(i, "schema"),
267
+ groupFieldId: w(i, "groupBy")
268
+ }), Gl = k(() => We.value.size > 0);
269
+ function Vl() {
270
+ i.schema ? Pl() : c("add-row");
305
271
  }
306
272
  function Nl() {
307
- const e = Yl();
308
- e.length > 0 && v("drafts-commit-all", { records: e });
309
- }
310
- function jl() {
311
- Vl();
273
+ const e = Ll();
274
+ e.length > 0 && c("drafts-commit-all", { records: e });
312
275
  }
313
- const T = z({ visible: !1, colKey: "", colLabel: "", x: 0, y: 0 }), oe = z(!1);
314
- function Ze(e) {
315
- return e === "multiselect" ? "multi_select" : e;
276
+ function Ol() {
277
+ Wl();
316
278
  }
317
- function Ce(e, l) {
279
+ const R = W({ visible: !1, colKey: "", colLabel: "", x: 0, y: 0 }), oe = W(!1);
280
+ function ge(e, o) {
318
281
  var a;
319
- const o = A.value.find((g) => g.key === l), t = (a = s.fieldDefs) == null ? void 0 : a.find((g) => g.id === l);
320
- T.value = {
282
+ const l = D.value.find((f) => f.key === o), t = (a = i.fieldDefs) == null ? void 0 : a.find((f) => f.id === o);
283
+ R.value = {
321
284
  visible: !0,
322
- colKey: l,
323
- colLabel: (o == null ? void 0 : o.label) ?? l,
324
- fieldType: Ze(t == null ? void 0 : t.type),
285
+ colKey: o,
286
+ colLabel: (l == null ? void 0 : l.label) ?? o,
287
+ fieldType: _e(t == null ? void 0 : t.type),
325
288
  x: e.clientX,
326
289
  y: e.clientY
327
290
  };
328
291
  }
329
- function xe(e) {
330
- var o, t;
331
- const l = A.value.find((a) => a.key === e);
332
- T.value = {
292
+ function ke(e) {
293
+ var l, t;
294
+ const o = D.value.find((a) => a.key === e);
295
+ R.value = {
333
296
  visible: !0,
334
297
  colKey: e,
335
- colLabel: (l == null ? void 0 : l.label) ?? e,
336
- fieldType: Ze((t = (o = s.fieldDefs) == null ? void 0 : o.find((a) => a.id === e)) == null ? void 0 : t.type),
298
+ colLabel: (o == null ? void 0 : o.label) ?? e,
299
+ fieldType: _e((t = (l = i.fieldDefs) == null ? void 0 : l.find((a) => a.id === e)) == null ? void 0 : t.type),
337
300
  x: 200,
338
301
  y: 100
339
302
  };
340
303
  }
341
- function Ul(e, l) {
342
- v("schema-rename-field", { fieldId: e, newName: l });
304
+ function Yl(e, o) {
305
+ c("schema-rename-field", { fieldId: e, newName: o });
343
306
  }
344
- function ql(e, l) {
345
- v("schema-change-field-type", { fieldId: e, newType: l });
307
+ function jl(e, o) {
308
+ c("schema-change-field-type", { fieldId: e, newType: o });
346
309
  }
347
- function Jl(e) {
348
- v("schema-hide-field", e);
310
+ function Xl(e) {
311
+ c("schema-hide-field", e);
349
312
  }
350
- function Ql(e) {
351
- v("schema-delete-field", e);
313
+ function ql(e) {
314
+ c("schema-delete-field", e);
352
315
  }
353
- function Zl(e) {
354
- v("schema-duplicate-field", e);
316
+ function Jl(e) {
317
+ c("schema-duplicate-field", e);
355
318
  }
356
- function De() {
319
+ function we() {
357
320
  oe.value = !0;
358
321
  }
359
- function eo(e) {
360
- v("schema-add-field", e), oe.value = !1;
361
- }
362
- const B = f(() => s.readonly ? !1 : s.selectable), el = f(() => s.readonly ? !1 : s.addable), lo = f(() => Array.from(m.value)), ll = f(() => m.value.size > 0 && !ve.value), Re = f(
363
- () => X.value.filter((e) => m.value.has(d(e)))
364
- ), N = f(() => ({
365
- selectionCount: Re.value.length,
366
- rowIds: Re.value.map((e) => d(e)),
367
- rows: [...Re.value]
368
- })), oo = f(
369
- () => s.showSelectionBar && B.value && m.value.size > 0
370
- ), to = f(() => [...[
371
- {
372
- key: "clear-selection",
373
- label: "清空选择",
374
- clearSelectionAfter: !0
375
- }
376
- ], ...s.bulkActionItems ?? []].filter((l) => typeof l.visible == "function" ? l.visible(N.value) : l.visible ?? !0).map((l) => ({
377
- ...l,
378
- resolvedLabel: typeof l.label == "function" ? l.label(N.value) : l.label,
379
- resolvedDisabled: typeof l.disabled == "function" ? l.disabled(N.value) : l.disabled ?? !1
380
- })));
381
- function ol() {
382
- $l(X.value);
383
- }
384
- function te(e) {
385
- const l = X.value.find((o) => o[s.rowKey] === e);
386
- l && Sl(l, 0);
387
- }
388
- function no(e) {
389
- v("bulk-action", {
390
- actionKey: e.key,
391
- rowIds: N.value.rowIds,
392
- rows: N.value.rows
393
- }), (e.clearSelectionAfter || e.key === "clear-selection") && Rl();
394
- }
395
- Ae(lo, (e) => v("selection-change", e), { immediate: !1 });
322
+ function Ql(e) {
323
+ c("schema-add-field", e), oe.value = !1;
324
+ }
325
+ const x = k(() => i.readonly ? !1 : i.selectable), Ge = k(() => i.readonly ? !1 : i.addable), { indeterminate: Ve, hasSelectionBar: Ul, resolvedBulkActionItems: Zl, handleSelectAll: Ne, handleSelect: ne, handleBulkAction: _l } = Io({
326
+ rows: fe,
327
+ selectedRows: S,
328
+ rowKey: w(i, "rowKey"),
329
+ selectable: x,
330
+ bulkActionItems: w(i, "bulkActionItems"),
331
+ showSelectionBar: w(i, "showSelectionBar"),
332
+ emitSelectionChange: (e) => c("selection-change", e),
333
+ toggleSelectAll: ml,
334
+ toggleRowSelection: (e, o = 0) => pl(e, o),
335
+ clearSelection: hl,
336
+ emitBulkAction: (e) => c("bulk-action", e)
337
+ });
396
338
  function d(e) {
397
- const l = e[s.rowKey];
398
- return l != null ? String(l) : "";
339
+ return ko(e, i.rowKey);
399
340
  }
400
- function L(e) {
401
- var l;
402
- return ((l = s.fieldDefs) == null ? void 0 : l.find((o) => o.id === e)) ?? {
403
- id: e,
404
- type: "text",
405
- label: e
406
- };
341
+ function P(e) {
342
+ return wo(i.fieldDefs, e);
407
343
  }
408
- function G(e, l, o) {
409
- wl(e, l, o), v("cell-edit", { rowId: e, fieldId: l, value: o });
344
+ function L(e, o, l) {
345
+ fl(e, o, l), c("cell-edit", { rowId: e, fieldId: o, value: l });
410
346
  }
411
- function S(e) {
412
- if (ue.value) {
413
- fe.value = e, U.value = !0;
414
- return;
415
- }
416
- const l = e.__record;
417
- if (l) {
418
- v("row-click-record", l), v("row-click", l);
347
+ function p(e) {
348
+ const o = sl({
349
+ row: e,
350
+ isMobile: ue.value
351
+ });
352
+ if (o.type === "emit-record") {
353
+ c("row-click-record", o.row), c("row-click", o.row);
419
354
  return;
420
355
  }
421
- v("row-click", e);
356
+ o.type === "emit-row" && c("row-click", o.row);
422
357
  }
423
- function ne(e, l) {
424
- e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), S(l)));
358
+ function te(e, o) {
359
+ e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), p(o)));
425
360
  }
426
- function M(e, l) {
427
- return e[l];
361
+ function C(e, o) {
362
+ return e[o];
428
363
  }
429
- function ao(e) {
364
+ function eo(e) {
430
365
  if (!e) return null;
431
366
  if (e instanceof HTMLElement) return e;
432
- const l = e.$el;
433
- return l instanceof HTMLElement ? l : null;
367
+ const o = e.$el;
368
+ return o instanceof HTMLElement ? o : null;
434
369
  }
435
- function ae(e, l) {
436
- Kl(ao(e), l);
370
+ function ae(e, o) {
371
+ Al(eo(e), o);
437
372
  }
438
- function $e(e, l) {
439
- pl(e, l);
373
+ function he(e, o) {
374
+ vl(e, o);
440
375
  }
441
- function Se(e) {
442
- Dl(e, _.value);
376
+ function me(e) {
377
+ wl(e, Y.value);
443
378
  }
444
- function ro() {
445
- return O.value === "compact" ? { x: 10, y: 6 } : O.value === "comfortable" ? { x: 14, y: 10 } : { x: 12, y: 8 };
446
- }
447
- function tl() {
448
- return {
449
- minHeight: `${p.value.rowHeight}px`
450
- };
379
+ function Oe() {
380
+ return ho(I.value.rowHeight);
451
381
  }
452
382
  function re(e) {
453
- const { x: l, y: o } = ro(), t = {
454
- padding: `${o}px ${l}px`
455
- };
456
- if (e.width === "fill") {
457
- const a = `${e.minWidth ?? p.value.fillMinWidth}px`;
458
- return { ...t, flex: `1 1 ${a}`, minWidth: a };
459
- }
460
- return typeof e.width == "number" ? { ...t, width: `${e.width}px`, flexShrink: "0", flexGrow: "0" } : {
461
- ...t,
462
- width: `${_e(e.key)}px`,
463
- flexShrink: "0",
464
- flexGrow: "0"
465
- };
383
+ return mo({
384
+ density: A.value,
385
+ col: e,
386
+ resolvedWidth: Ae(e.key),
387
+ fillMinWidth: I.value.fillMinWidth
388
+ });
466
389
  }
467
- function nl() {
468
- return {
469
- height: `${p.value.groupRowHeight}px`
470
- };
390
+ function Ye() {
391
+ return po(I.value.groupRowHeight);
471
392
  }
472
- function io(e) {
473
- zl(e);
474
- const l = e.target;
475
- Ge.value = l.scrollLeft;
393
+ function lo(e) {
394
+ $l(e);
395
+ const o = e.target;
396
+ Ke.value = o.scrollLeft;
476
397
  }
477
- function ie(e) {
398
+ function oo(e) {
399
+ De.value = e;
400
+ }
401
+ function no(e) {
402
+ O.value = e;
403
+ }
404
+ function to(e) {
405
+ O.value = e;
406
+ }
407
+ function se(e) {
478
408
  return {
479
409
  groupKey: e.__groupKey,
480
410
  count: e.__groupCount,
481
- collapsed: Fl.value.has(
411
+ collapsed: Dl.value.has(
482
412
  e.__groupPath ? e.__groupPath.join("/") : e.__groupKey
483
413
  ),
484
- colorMap: s.groupColorMap,
485
- selectable: B.value,
414
+ colorMap: i.groupColorMap,
415
+ selectable: x.value,
486
416
  level: e.__groupLevel ?? 0,
487
417
  aggregations: e.__aggregations
488
418
  };
489
419
  }
490
- function se(e) {
420
+ function ie(e) {
491
421
  return e.__groupPath ? e.__groupPath.join("/") : e.__groupKey;
492
422
  }
493
- function al(e) {
423
+ function je(e) {
494
424
  return {
495
425
  row: e,
496
- rowKey: s.rowKey,
497
- selected: m.value.has(d(e)),
498
- selectable: B.value,
499
- columns: A.value,
500
- priorityColorMap: s.priorityColorMap,
501
- statusColorMap: s.statusColorMap
426
+ rowKey: i.rowKey,
427
+ selected: S.value.has(d(e)),
428
+ selectable: x.value,
429
+ columns: D.value,
430
+ priorityColorMap: i.priorityColorMap,
431
+ statusColorMap: i.statusColorMap
502
432
  };
503
433
  }
504
- function rl(e, l) {
505
- const o = Xe.value;
506
- return o !== null && o.rowId === e && o.colKey === l;
434
+ function Xe(e, o) {
435
+ const l = Be.value;
436
+ return l !== null && l.rowId === e && l.colKey === o;
507
437
  }
508
- function il(e, l) {
509
- return Bl.value.some((o) => o.rowId === e && o.colKey === l);
438
+ function qe(e, o) {
439
+ return Tl.value.some((l) => l.rowId === e && l.colKey === o);
510
440
  }
511
- function sl(e) {
512
- const l = d(e);
441
+ function Je(e) {
442
+ const o = d(e);
513
443
  return {
514
- "of-row-dragging": Pl.value && El.value === l,
515
- "of-row-drop-target": me.value === l,
516
- "of-row-drop-before": me.value === l && Ne.value === "before",
517
- "of-row-drop-after": me.value === l && Ne.value === "after"
444
+ "of-row-dragging": zl.value && Bl.value === o,
445
+ "of-row-drop-target": be.value === o,
446
+ "of-row-drop-before": be.value === o && He.value === "before",
447
+ "of-row-drop-after": be.value === o && He.value === "after"
518
448
  };
519
449
  }
520
- function so(e) {
521
- fe.value = e, U.value = !0;
522
- }
523
- function uo(e) {
524
- for (const [l, o] of Object.entries(e.fields))
525
- v("cell-edit", { rowId: e.rowId, fieldId: l, value: o });
526
- }
527
- return (e, l) => n(ue) ? (r(), i(b, { key: 0 }, [
528
- j(ho, {
529
- rows: n(X),
530
- columns: A.value,
531
- selectable: B.value,
532
- addable: el.value,
533
- "status-color-map": u.statusColorMap,
534
- readonly: u.readonly,
535
- class: C(He.value),
536
- style: y(Ke.value),
537
- onRowClick: l[0] || (l[0] = (o) => so(o)),
538
- onAddRow: l[1] || (l[1] = (o) => v("add-row"))
539
- }, bo({ _: 2 }, [
540
- e.$slots.cell ? {
541
- name: "cell",
542
- fn: Te((o) => [
543
- P(e.$slots, "cell", yo(go(o)), void 0, !0)
544
- ]),
545
- key: "0"
546
- } : void 0
547
- ]), 1032, ["rows", "columns", "selectable", "addable", "status-color-map", "readonly", "class", "style"]),
548
- Be.value ? (r(), w(n(vl), {
549
- key: 0,
550
- row: Be.value,
551
- columns: A.value,
552
- "field-defs": u.fieldDefs,
553
- visible: U.value,
554
- onClose: l[2] || (l[2] = (o) => U.value = !1),
555
- onSave: uo,
556
- onDelete: l[3] || (l[3] = (o) => v("row-delete", o)),
557
- onCellEdit: l[4] || (l[4] = (o) => v("cell-edit", o))
558
- }, null, 8, ["row", "columns", "field-defs", "visible"])) : D("", !0)
559
- ], 64)) : (r(), i("div", {
450
+ function ao(e) {
451
+ il(e);
452
+ }
453
+ function ro(e) {
454
+ for (const o of dl(e))
455
+ c("cell-edit", o);
456
+ }
457
+ return (e, o) => n(ue) ? (r(), v(bo, {
458
+ key: 0,
459
+ rows: n(fe),
460
+ columns: D.value,
461
+ "field-defs": u.fieldDefs,
462
+ selectable: x.value,
463
+ addable: Ge.value,
464
+ "status-color-map": u.statusColorMap,
465
+ readonly: u.readonly,
466
+ "density-class": n(Se),
467
+ "density-style": n(Re),
468
+ "detail-visible": n(al),
469
+ "detail-row": n(rl),
470
+ onRowClick: o[0] || (o[0] = (l) => ao(l)),
471
+ onAddRow: o[1] || (o[1] = (l) => c("add-row")),
472
+ onCloseDetail: n(ul),
473
+ onDetailSave: ro,
474
+ onRowDelete: o[2] || (o[2] = (l) => c("row-delete", l)),
475
+ onCellEdit: o[3] || (o[3] = (l) => c("cell-edit", l))
476
+ }, io({ _: 2 }, [
477
+ e.$slots.cell ? {
478
+ name: "cell",
479
+ fn: $((l) => [
480
+ H(e.$slots, "cell", uo(co(l)), void 0, !0)
481
+ ]),
482
+ key: "0"
483
+ } : void 0
484
+ ]), 1032, ["rows", "columns", "field-defs", "selectable", "addable", "status-color-map", "readonly", "density-class", "density-style", "detail-visible", "detail-row", "onCloseDetail"])) : (r(), s("div", {
560
485
  key: 1,
561
486
  ref_key: "tableContainerRef",
562
- ref: _,
563
- class: C(["of-data-table", [He.value, gl.value]]),
564
- style: y(Ke.value),
487
+ ref: Y,
488
+ class: F(["of-data-table", [n(Se), n(tl)]]),
489
+ style: g(n(Re)),
565
490
  role: "grid",
566
491
  tabindex: "0",
567
- onKeydown: l[21] || (l[21] = (o) => u.enableKeyboard ? n(Il)(o) : void 0)
492
+ onKeydown: o[19] || (o[19] = (l) => u.enableKeyboard ? n(Kl)(l) : void 0)
568
493
  }, [
569
- oo.value ? (r(), i("div", zo, [
570
- c("div", Ho, [
571
- c("span", Ko, R(n(m).size), 1),
572
- l[22] || (l[22] = c("span", { class: "of-data-table-selection-bar__text" }, "条记录已选中", -1))
573
- ]),
574
- c("div", Bo, [
575
- (r(!0), i(b, null, h(to.value, (o) => (r(), i("button", {
576
- key: o.key,
577
- type: "button",
578
- class: C(["of-data-table-selection-bar__btn", { "of-data-table-selection-bar__btn--danger": o.variant === "danger" }]),
579
- disabled: o.resolvedDisabled,
580
- onClick: (t) => no(o)
581
- }, R(o.resolvedLabel), 11, Io))), 128))
582
- ])
583
- ])) : D("", !0),
584
- Al.value ? (r(), i("div", Po, [
585
- c("div", {
586
- ref_key: "fixedContainerRef",
587
- ref: Le,
588
- class: C(["of-data-table-fixed-region", { "of-fixed-shadow": Tl.value }]),
589
- style: y({ width: n(Ye) + "px" }),
590
- onScroll: l[13] || (l[13] = //@ts-ignore
591
- (...o) => n(Ve) && n(Ve)(...o))
592
- }, [
593
- j(ze, {
594
- columns: n(be),
595
- selectable: B.value,
596
- "sort-key": n(W).field ?? "",
597
- "sort-order": n(W).order ?? "asc",
598
- "all-selected": n(ve),
599
- indeterminate: ll.value,
494
+ N(go, {
495
+ "has-fixed-columns": Sl.value,
496
+ "show-selection-bar": n(Ul),
497
+ "selection-count": n(S).size,
498
+ "selection-items": n(Zl),
499
+ "fixed-width": n(xl),
500
+ "show-fixed-shadow": Rl.value,
501
+ columns: D.value,
502
+ "fixed-columns": n(Q),
503
+ "scrollable-columns": n(U),
504
+ selectable: x.value,
505
+ "show-row-actions": u.showRowActions,
506
+ "use-virtual": _.value,
507
+ "total-height": n(ee),
508
+ "offset-y": n(le),
509
+ "set-fixed-region-ref": oo,
510
+ "set-scroll-region-ref": no,
511
+ "set-standard-scroll-ref": to,
512
+ onSelectionAction: n(_l),
513
+ onFixedScroll: n(Fl),
514
+ onScroll: lo
515
+ }, {
516
+ "fixed-header": $(() => [
517
+ N(Ce, {
518
+ columns: n(Q),
519
+ selectable: x.value,
520
+ "sort-key": n(E).field ?? "",
521
+ "sort-order": n(E).order ?? "asc",
522
+ "all-selected": n(Te),
523
+ indeterminate: n(Ve),
600
524
  "enable-resize": u.enableResize,
601
525
  "enable-field-menu": u.enableFieldManagement,
602
526
  "enable-add-field": u.enableFieldManagement,
603
- density: F.value,
604
- onSort: n(Q),
605
- onSelectAll: ol,
606
- onResizeStart: $e,
607
- onResizeDblclick: Se,
608
- onHeaderContextmenu: Ce,
609
- onHeaderDblclick: xe,
610
- onAddField: De
611
- }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort"]),
612
- c("div", Eo, [
613
- ge.value ? (r(), i("div", {
614
- key: 0,
615
- style: y({ height: n(we) + "px", position: "relative" })
527
+ density: n(A),
528
+ onSort: n(q),
529
+ onSelectAll: n(Ne),
530
+ onResizeStart: he,
531
+ onResizeDblclick: me,
532
+ onHeaderContextmenu: ge,
533
+ onHeaderDblclick: ke,
534
+ onAddField: we
535
+ }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort", "onSelectAll"])
536
+ ]),
537
+ "fixed-body": $(() => [
538
+ _.value ? (r(), s("div", {
539
+ key: 0,
540
+ style: g({ height: n(ee) + "px", position: "relative" })
541
+ }, [
542
+ h("div", {
543
+ style: g({ transform: `translateY(${n(le)}px)` })
616
544
  }, [
617
- c("div", {
618
- style: y({ transform: `translateY(${n(he)}px)` })
545
+ (r(!0), s(y, null, m(n(ye), ({ data: l, index: t }) => (r(), s(y, {
546
+ key: l.id
619
547
  }, [
620
- (r(!0), i(b, null, h(n(ke), ({ data: o, index: t }) => (r(), i(b, {
621
- key: o.id
548
+ n(K)(l) ? (r(), v(de, G({
549
+ key: 0,
550
+ ref_for: !0,
551
+ ref: (a) => ae(a, t)
552
+ }, { ref_for: !0 }, se(l), {
553
+ onToggle: (a) => n(J)(ie(l))
554
+ }), null, 16, ["onToggle"])) : (r(), s("div", {
555
+ key: 1,
556
+ ref_for: !0,
557
+ ref: (a) => ae(a, t),
558
+ class: F(["of-table-row", {
559
+ "of-table-row--selected": n(S).has(d(l)),
560
+ "of-table-row--hover": n(Z)(d(l))
561
+ }]),
562
+ role: "row",
563
+ tabindex: "0",
564
+ style: g(Oe()),
565
+ onMouseenter: (a) => n(b)(d(l)),
566
+ onMouseleave: o[6] || (o[6] = (a) => n(b)(null)),
567
+ onFocusin: (a) => n(b)(d(l)),
568
+ onFocusout: o[7] || (o[7] = (a) => n(b)(null)),
569
+ onClick: (a) => p(l),
570
+ onKeydown: (a) => te(a, l)
622
571
  }, [
623
- n(K)(o) ? (r(), w(de, Y({
572
+ x.value ? (r(), s("div", {
624
573
  key: 0,
625
- ref_for: !0,
626
- ref: (a) => ae(a, t)
627
- }, { ref_for: !0 }, ie(o), {
628
- onToggle: (a) => n(Z)(se(o))
629
- }), null, 16, ["onToggle"])) : (r(), i("div", {
630
- key: 1,
631
- ref_for: !0,
632
- ref: (a) => ae(a, t),
633
- class: C(["of-table-row", {
634
- "of-table-row--selected": n(m).has(d(o)),
635
- "of-table-row--hover": n(le)(d(o))
636
- }]),
637
- role: "row",
638
- tabindex: "0",
639
- style: y(tl()),
640
- onMouseenter: (a) => n(k)(d(o)),
641
- onMouseleave: l[7] || (l[7] = (a) => n(k)(null)),
642
- onFocusin: (a) => n(k)(d(o)),
643
- onFocusout: l[8] || (l[8] = (a) => n(k)(null)),
644
- onClick: (a) => S(o),
645
- onKeydown: (a) => ne(a, o)
574
+ class: "of-td of-td-checkbox",
575
+ role: "gridcell",
576
+ onClick: o[4] || (o[4] = z(() => {
577
+ }, ["stop"]))
646
578
  }, [
647
- B.value ? (r(), i("div", {
648
- key: 0,
649
- class: "of-td of-td-checkbox",
650
- role: "gridcell",
651
- onClick: l[5] || (l[5] = I(() => {
652
- }, ["stop"]))
579
+ h("label", {
580
+ class: "of-checkbox-label",
581
+ for: `fixed-row-select-${d(l)}`
653
582
  }, [
654
- c("label", {
655
- class: "of-checkbox-label",
656
- for: `fixed-row-select-${d(o)}`
657
- }, [
658
- c("input", {
659
- id: `fixed-row-select-${d(o)}`,
660
- type: "checkbox",
661
- class: "of-checkbox",
662
- checked: n(m).has(d(o)),
663
- onChange: (a) => te(d(o))
664
- }, null, 40, Lo),
665
- l[23] || (l[23] = c("span", { class: "of-sr-only" }, "选择当前行", -1))
666
- ], 8, _o)
667
- ])) : D("", !0),
668
- (r(!0), i(b, null, h(n(be), (a) => (r(), i("div", {
583
+ h("input", {
584
+ id: `fixed-row-select-${d(l)}`,
585
+ type: "checkbox",
586
+ class: "of-checkbox",
587
+ checked: n(S).has(d(l)),
588
+ onChange: (a) => n(ne)(d(l))
589
+ }, null, 40, Wo),
590
+ o[20] || (o[20] = h("span", { class: "of-sr-only" }, "选择当前行", -1))
591
+ ], 8, Lo)
592
+ ])) : M("", !0),
593
+ (r(!0), s(y, null, m(n(Q), (a) => (r(), s("div", {
594
+ key: a.key,
595
+ class: "of-td",
596
+ role: "gridcell",
597
+ style: g(re(a))
598
+ }, [
599
+ H(e.$slots, "cell", {
600
+ row: l,
601
+ col: a
602
+ }, () => {
603
+ var f;
604
+ return [
605
+ (f = u.fieldDefs) != null && f.length ? (r(), v(V, {
606
+ key: 0,
607
+ "row-id": d(l),
608
+ field: P(a.key),
609
+ value: C(l, a.key),
610
+ onCommit: L
611
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", Go, B(C(l, a.key) ?? "-"), 1))
612
+ ];
613
+ }, !0)
614
+ ], 4))), 128)),
615
+ u.showRowActions ? (r(), s("div", {
616
+ key: 1,
617
+ class: "of-table-row__actions",
618
+ "aria-label": "行快捷操作",
619
+ onClick: o[5] || (o[5] = z(() => {
620
+ }, ["stop"]))
621
+ }, [
622
+ (r(!0), s(y, null, m(j(l), (a) => (r(), s("button", {
669
623
  key: a.key,
670
- class: "of-td",
671
- role: "gridcell",
672
- style: y(re(a))
673
- }, [
674
- P(e.$slots, "cell", {
675
- row: o,
676
- col: a
677
- }, () => {
678
- var g;
679
- return [
680
- (g = u.fieldDefs) != null && g.length ? (r(), w(V, {
681
- key: 0,
682
- "row-id": d(o),
683
- field: L(a.key),
684
- value: M(o, a.key),
685
- onCommit: G
686
- }, null, 8, ["row-id", "field", "value"])) : (r(), i("span", Go, R(M(o, a.key) ?? "-"), 1))
687
- ];
688
- }, !0)
689
- ], 4))), 128)),
690
- u.showRowActions ? (r(), i("div", {
691
- key: 1,
692
- class: "of-table-row__actions",
693
- "aria-label": "行快捷操作",
694
- onClick: l[6] || (l[6] = I(() => {
695
- }, ["stop"]))
624
+ type: "button",
625
+ class: F(["of-table-row__action-btn", { "of-table-row__action-btn--danger": a.variant === "danger" }]),
626
+ disabled: a.disabled,
627
+ onClick: z((f) => Fe(l, a.key), ["stop"])
696
628
  }, [
697
- (r(!0), i(b, null, h(q(o), (a) => (r(), i("button", {
698
- key: a.key,
699
- type: "button",
700
- class: C(["of-table-row__action-btn", {
701
- "of-table-row__action-btn--danger": a.variant === "danger"
702
- }]),
703
- disabled: a.disabled,
704
- onClick: I((g) => Ee(o, a.key), ["stop"])
705
- }, [
706
- c("span", null, R(a.label), 1)
707
- ], 10, Yo))), 128))
708
- ])) : D("", !0)
709
- ], 46, Wo))
710
- ], 64))), 128))
711
- ], 4)
712
- ], 4)) : (r(!0), i(b, { key: 1 }, h(n(H), (o) => (r(), i(b, {
713
- key: o.id
629
+ h("span", null, B(a.label), 1)
630
+ ], 10, Vo))), 128))
631
+ ])) : M("", !0)
632
+ ], 46, Po))
633
+ ], 64))), 128))
634
+ ], 4)
635
+ ], 4)) : (r(!0), s(y, { key: 1 }, m(n(T), (l) => (r(), s(y, {
636
+ key: l.id
637
+ }, [
638
+ n(K)(l) ? (r(), v(de, G({
639
+ key: 0,
640
+ ref_for: !0
641
+ }, se(l), {
642
+ onToggle: (t) => n(J)(ie(l))
643
+ }), null, 16, ["onToggle"])) : (r(), s("div", {
644
+ key: 1,
645
+ class: F(["of-table-row", {
646
+ "of-table-row--selected": n(S).has(d(l)),
647
+ "of-table-row--hover": n(Z)(d(l))
648
+ }]),
649
+ role: "row",
650
+ tabindex: "0",
651
+ style: g(Oe()),
652
+ onMouseenter: (t) => n(b)(d(l)),
653
+ onMouseleave: o[10] || (o[10] = (t) => n(b)(null)),
654
+ onFocusin: (t) => n(b)(d(l)),
655
+ onFocusout: o[11] || (o[11] = (t) => n(b)(null)),
656
+ onClick: (t) => p(l),
657
+ onKeydown: (t) => te(t, l)
714
658
  }, [
715
- n(K)(o) ? (r(), w(de, Y({
659
+ x.value ? (r(), s("div", {
716
660
  key: 0,
717
- ref_for: !0
718
- }, ie(o), {
719
- onToggle: (t) => n(Z)(se(o))
720
- }), null, 16, ["onToggle"])) : (r(), i("div", {
721
- key: 1,
722
- class: C(["of-table-row", {
723
- "of-table-row--selected": n(m).has(d(o)),
724
- "of-table-row--hover": n(le)(d(o))
725
- }]),
726
- role: "row",
727
- tabindex: "0",
728
- style: y(tl()),
729
- onMouseenter: (t) => n(k)(d(o)),
730
- onMouseleave: l[11] || (l[11] = (t) => n(k)(null)),
731
- onFocusin: (t) => n(k)(d(o)),
732
- onFocusout: l[12] || (l[12] = (t) => n(k)(null)),
733
- onClick: (t) => S(o),
734
- onKeydown: (t) => ne(t, o)
661
+ class: "of-td of-td-checkbox",
662
+ role: "gridcell",
663
+ onClick: o[8] || (o[8] = z(() => {
664
+ }, ["stop"]))
735
665
  }, [
736
- B.value ? (r(), i("div", {
737
- key: 0,
738
- class: "of-td of-td-checkbox",
739
- role: "gridcell",
740
- onClick: l[9] || (l[9] = I(() => {
741
- }, ["stop"]))
666
+ h("label", {
667
+ class: "of-checkbox-label",
668
+ for: `row-select-${d(l)}`
742
669
  }, [
743
- c("label", {
744
- class: "of-checkbox-label",
745
- for: `row-select-${d(o)}`
746
- }, [
747
- c("input", {
748
- id: `row-select-${d(o)}`,
749
- type: "checkbox",
750
- class: "of-checkbox",
751
- checked: n(m).has(d(o)),
752
- onChange: (t) => te(d(o))
753
- }, null, 40, Xo),
754
- l[24] || (l[24] = c("span", { class: "of-sr-only" }, "选择当前行", -1))
755
- ], 8, Oo)
756
- ])) : D("", !0),
757
- (r(!0), i(b, null, h(n(be), (t) => (r(), i("div", {
670
+ h("input", {
671
+ id: `row-select-${d(l)}`,
672
+ type: "checkbox",
673
+ class: "of-checkbox",
674
+ checked: n(S).has(d(l)),
675
+ onChange: (t) => n(ne)(d(l))
676
+ }, null, 40, Yo),
677
+ o[21] || (o[21] = h("span", { class: "of-sr-only" }, "选择当前行", -1))
678
+ ], 8, Oo)
679
+ ])) : M("", !0),
680
+ (r(!0), s(y, null, m(n(Q), (t) => (r(), s("div", {
681
+ key: t.key,
682
+ class: "of-td",
683
+ role: "gridcell",
684
+ style: g(re(t))
685
+ }, [
686
+ H(e.$slots, "cell", {
687
+ row: l,
688
+ col: t
689
+ }, () => {
690
+ var a;
691
+ return [
692
+ (a = u.fieldDefs) != null && a.length ? (r(), v(V, {
693
+ key: 0,
694
+ "row-id": d(l),
695
+ field: P(t.key),
696
+ value: C(l, t.key),
697
+ onCommit: L
698
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", jo, B(C(l, t.key) ?? "-"), 1))
699
+ ];
700
+ }, !0)
701
+ ], 4))), 128)),
702
+ u.showRowActions ? (r(), s("div", {
703
+ key: 1,
704
+ class: "of-table-row__actions",
705
+ "aria-label": "行快捷操作",
706
+ onClick: o[9] || (o[9] = z(() => {
707
+ }, ["stop"]))
708
+ }, [
709
+ (r(!0), s(y, null, m(j(l), (t) => (r(), s("button", {
758
710
  key: t.key,
759
- class: "of-td",
760
- role: "gridcell",
761
- style: y(re(t))
762
- }, [
763
- P(e.$slots, "cell", {
764
- row: o,
765
- col: t
766
- }, () => {
767
- var a;
768
- return [
769
- (a = u.fieldDefs) != null && a.length ? (r(), w(V, {
770
- key: 0,
771
- "row-id": d(o),
772
- field: L(t.key),
773
- value: M(o, t.key),
774
- onCommit: G
775
- }, null, 8, ["row-id", "field", "value"])) : (r(), i("span", No, R(M(o, t.key) ?? "-"), 1))
776
- ];
777
- }, !0)
778
- ], 4))), 128)),
779
- u.showRowActions ? (r(), i("div", {
780
- key: 1,
781
- class: "of-table-row__actions",
782
- "aria-label": "行快捷操作",
783
- onClick: l[10] || (l[10] = I(() => {
784
- }, ["stop"]))
711
+ type: "button",
712
+ class: F(["of-table-row__action-btn", { "of-table-row__action-btn--danger": t.variant === "danger" }]),
713
+ disabled: t.disabled,
714
+ onClick: z((a) => Fe(l, t.key), ["stop"])
785
715
  }, [
786
- (r(!0), i(b, null, h(q(o), (t) => (r(), i("button", {
787
- key: t.key,
788
- type: "button",
789
- class: C(["of-table-row__action-btn", { "of-table-row__action-btn--danger": t.variant === "danger" }]),
790
- disabled: t.disabled,
791
- onClick: I((a) => Ee(o, t.key), ["stop"])
792
- }, [
793
- c("span", null, R(t.label), 1)
794
- ], 10, jo))), 128))
795
- ])) : D("", !0)
796
- ], 46, Vo))
797
- ], 64))), 128))
798
- ])
799
- ], 38),
800
- c("div", {
801
- ref_key: "scrollContainerRef",
802
- ref: ee,
803
- class: "of-data-table-scroll-region",
804
- style: y({ marginLeft: n(Ye) + "px" }),
805
- onScroll: io
806
- }, [
807
- j(ze, {
808
- columns: n(ye),
716
+ h("span", null, B(t.label), 1)
717
+ ], 10, Xo))), 128))
718
+ ])) : M("", !0)
719
+ ], 46, No))
720
+ ], 64))), 128))
721
+ ]),
722
+ "scroll-header": $(() => [
723
+ N(Ce, {
724
+ columns: n(U),
809
725
  selectable: !1,
810
- "sort-key": n(W).field ?? "",
811
- "sort-order": n(W).order ?? "asc",
726
+ "sort-key": n(E).field ?? "",
727
+ "sort-order": n(E).order ?? "asc",
812
728
  "enable-resize": u.enableResize,
813
729
  "enable-field-menu": u.enableFieldManagement,
814
730
  "enable-add-field": u.enableFieldManagement,
815
- density: F.value,
816
- onSort: n(Q),
817
- onResizeStart: $e,
818
- onResizeDblclick: Se,
819
- onHeaderContextmenu: Ce,
820
- onHeaderDblclick: xe,
821
- onAddField: De
822
- }, null, 8, ["columns", "sort-key", "sort-order", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort"]),
823
- c("div", Uo, [
824
- ge.value ? (r(), i("div", {
825
- key: 0,
826
- style: y({ height: n(we) + "px", position: "relative" })
731
+ density: n(A),
732
+ onSort: n(q),
733
+ onResizeStart: he,
734
+ onResizeDblclick: me,
735
+ onHeaderContextmenu: ge,
736
+ onHeaderDblclick: ke,
737
+ onAddField: we
738
+ }, null, 8, ["columns", "sort-key", "sort-order", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort"])
739
+ ]),
740
+ "scroll-body": $(() => [
741
+ _.value ? (r(), s("div", {
742
+ key: 0,
743
+ style: g({ height: n(ee) + "px", position: "relative" })
744
+ }, [
745
+ h("div", {
746
+ style: g({ transform: `translateY(${n(le)}px)` })
827
747
  }, [
828
- c("div", {
829
- style: y({ transform: `translateY(${n(he)}px)` })
748
+ (r(!0), s(y, null, m(n(ye), ({ data: l }) => (r(), s(y, {
749
+ key: l.id
830
750
  }, [
831
- (r(!0), i(b, null, h(n(ke), ({ data: o }) => (r(), i(b, {
832
- key: o.id
751
+ n(K)(l) ? (r(), s("div", {
752
+ key: 0,
753
+ style: g(Ye())
754
+ }, null, 4)) : (r(), s("div", {
755
+ key: 1,
756
+ class: F(["of-table-row", {
757
+ "of-table-row--selected": n(S).has(d(l)),
758
+ "of-table-row--hover": n(Z)(d(l))
759
+ }]),
760
+ role: "row",
761
+ tabindex: "0",
762
+ onMouseenter: (t) => n(b)(d(l)),
763
+ onMouseleave: o[12] || (o[12] = (t) => n(b)(null)),
764
+ onFocusin: (t) => n(b)(d(l)),
765
+ onFocusout: o[13] || (o[13] = (t) => n(b)(null)),
766
+ onClick: (t) => p(l),
767
+ onKeydown: (t) => te(t, l)
833
768
  }, [
834
- n(K)(o) ? (r(), i("div", {
835
- key: 0,
836
- style: y(nl())
837
- }, null, 4)) : (r(), i("div", {
838
- key: 1,
839
- class: C(["of-table-row", {
840
- "of-table-row--selected": n(m).has(d(o)),
841
- "of-table-row--hover": n(le)(d(o))
842
- }]),
843
- role: "row",
844
- tabindex: "0",
845
- onMouseenter: (t) => n(k)(d(o)),
846
- onMouseleave: l[14] || (l[14] = (t) => n(k)(null)),
847
- onFocusin: (t) => n(k)(d(o)),
848
- onFocusout: l[15] || (l[15] = (t) => n(k)(null)),
849
- onClick: (t) => S(o),
850
- onKeydown: (t) => ne(t, o)
769
+ (r(!0), s(y, null, m(n(U), (t) => (r(), s("div", {
770
+ key: t.key,
771
+ class: "of-td",
772
+ role: "gridcell",
773
+ style: g(re(t))
851
774
  }, [
852
- (r(!0), i(b, null, h(n(ye), (t) => (r(), i("div", {
853
- key: t.key,
854
- class: "of-td",
855
- role: "gridcell",
856
- style: y(re(t))
857
- }, [
858
- P(e.$slots, "cell", {
859
- row: o,
860
- col: t
861
- }, () => {
862
- var a;
863
- return [
864
- (a = u.fieldDefs) != null && a.length ? (r(), w(V, {
865
- key: 0,
866
- "row-id": d(o),
867
- field: L(t.key),
868
- value: M(o, t.key),
869
- onCommit: G
870
- }, null, 8, ["row-id", "field", "value"])) : (r(), i("span", Jo, R(M(o, t.key) ?? "-"), 1))
871
- ];
872
- }, !0)
873
- ], 4))), 128))
874
- ], 42, qo))
875
- ], 64))), 128))
876
- ], 4)
877
- ], 4)) : (r(!0), i(b, { key: 1 }, h(n(H), (o) => (r(), i(b, {
878
- key: o.id
775
+ H(e.$slots, "cell", {
776
+ row: l,
777
+ col: t
778
+ }, () => {
779
+ var a;
780
+ return [
781
+ (a = u.fieldDefs) != null && a.length ? (r(), v(V, {
782
+ key: 0,
783
+ "row-id": d(l),
784
+ field: P(t.key),
785
+ value: C(l, t.key),
786
+ onCommit: L
787
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", Jo, B(C(l, t.key) ?? "-"), 1))
788
+ ];
789
+ }, !0)
790
+ ], 4))), 128))
791
+ ], 42, qo))
792
+ ], 64))), 128))
793
+ ], 4)
794
+ ], 4)) : (r(!0), s(y, { key: 1 }, m(n(T), (l) => (r(), s(y, {
795
+ key: l.id
796
+ }, [
797
+ n(K)(l) ? (r(), s("div", {
798
+ key: 0,
799
+ style: g(Ye())
800
+ }, null, 4)) : (r(), s("div", {
801
+ key: 1,
802
+ class: F(["of-table-row", {
803
+ "of-table-row--selected": n(S).has(d(l)),
804
+ "of-table-row--hover": n(Z)(d(l))
805
+ }]),
806
+ role: "row",
807
+ tabindex: "0",
808
+ onMouseenter: (t) => n(b)(d(l)),
809
+ onMouseleave: o[14] || (o[14] = (t) => n(b)(null)),
810
+ onFocusin: (t) => n(b)(d(l)),
811
+ onFocusout: o[15] || (o[15] = (t) => n(b)(null)),
812
+ onClick: (t) => p(l),
813
+ onKeydown: (t) => te(t, l)
879
814
  }, [
880
- n(K)(o) ? (r(), i("div", {
881
- key: 0,
882
- style: y(nl())
883
- }, null, 4)) : (r(), i("div", {
884
- key: 1,
885
- class: C(["of-table-row", {
886
- "of-table-row--selected": n(m).has(d(o)),
887
- "of-table-row--hover": n(le)(d(o))
888
- }]),
889
- role: "row",
890
- tabindex: "0",
891
- onMouseenter: (t) => n(k)(d(o)),
892
- onMouseleave: l[16] || (l[16] = (t) => n(k)(null)),
893
- onFocusin: (t) => n(k)(d(o)),
894
- onFocusout: l[17] || (l[17] = (t) => n(k)(null)),
895
- onClick: (t) => S(o),
896
- onKeydown: (t) => ne(t, o)
815
+ (r(!0), s(y, null, m(n(U), (t) => (r(), s("div", {
816
+ key: t.key,
817
+ class: "of-td",
818
+ role: "gridcell",
819
+ style: g(re(t))
897
820
  }, [
898
- (r(!0), i(b, null, h(n(ye), (t) => (r(), i("div", {
899
- key: t.key,
900
- class: "of-td",
901
- role: "gridcell",
902
- style: y(re(t))
903
- }, [
904
- P(e.$slots, "cell", {
905
- row: o,
906
- col: t
907
- }, () => {
908
- var a;
909
- return [
910
- (a = u.fieldDefs) != null && a.length ? (r(), w(V, {
911
- key: 0,
912
- "row-id": d(o),
913
- field: L(t.key),
914
- value: M(o, t.key),
915
- onCommit: G
916
- }, null, 8, ["row-id", "field", "value"])) : (r(), i("span", Zo, R(M(o, t.key) ?? "-"), 1))
917
- ];
918
- }, !0)
919
- ], 4))), 128))
920
- ], 42, Qo))
921
- ], 64))), 128))
922
- ])
923
- ], 36)
924
- ])) : (r(), i(b, { key: 2 }, [
925
- j(ze, {
926
- columns: A.value,
927
- selectable: B.value,
928
- "sort-key": n(W).field ?? "",
929
- "sort-order": n(W).order ?? "asc",
930
- "all-selected": n(ve),
931
- indeterminate: ll.value,
932
- "enable-resize": u.enableResize,
933
- "enable-field-menu": u.enableFieldManagement,
934
- "enable-add-field": u.enableFieldManagement,
935
- density: F.value,
936
- onSort: n(Q),
937
- onSelectAll: ol,
938
- onResizeStart: $e,
939
- onResizeDblclick: Se,
940
- onHeaderContextmenu: Ce,
941
- onHeaderDblclick: xe,
942
- onAddField: De
943
- }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort"]),
944
- c("div", {
945
- ref_key: "scrollContainerRef",
946
- ref: ee,
947
- class: "of-data-table-scroll-container"
948
- }, [
949
- ge.value ? (r(), i("div", {
821
+ H(e.$slots, "cell", {
822
+ row: l,
823
+ col: t
824
+ }, () => {
825
+ var a;
826
+ return [
827
+ (a = u.fieldDefs) != null && a.length ? (r(), v(V, {
828
+ key: 0,
829
+ "row-id": d(l),
830
+ field: P(t.key),
831
+ value: C(l, t.key),
832
+ onCommit: L
833
+ }, null, 8, ["row-id", "field", "value"])) : (r(), s("span", Uo, B(C(l, t.key) ?? "-"), 1))
834
+ ];
835
+ }, !0)
836
+ ], 4))), 128))
837
+ ], 42, Qo))
838
+ ], 64))), 128))
839
+ ]),
840
+ "standard-header": $(() => [
841
+ N(Ce, {
842
+ columns: D.value,
843
+ selectable: x.value,
844
+ "sort-key": n(E).field ?? "",
845
+ "sort-order": n(E).order ?? "asc",
846
+ "all-selected": n(Te),
847
+ indeterminate: n(Ve),
848
+ "enable-resize": u.enableResize,
849
+ "enable-field-menu": u.enableFieldManagement,
850
+ "enable-add-field": u.enableFieldManagement,
851
+ density: n(A),
852
+ onSort: n(q),
853
+ onSelectAll: n(Ne),
854
+ onResizeStart: he,
855
+ onResizeDblclick: me,
856
+ onHeaderContextmenu: ge,
857
+ onHeaderDblclick: ke,
858
+ onAddField: we
859
+ }, null, 8, ["columns", "selectable", "sort-key", "sort-order", "all-selected", "indeterminate", "enable-resize", "enable-field-menu", "enable-add-field", "density", "onSort", "onSelectAll"])
860
+ ]),
861
+ "standard-body": $(() => [
862
+ _.value ? (r(), s("div", {
950
863
  key: 0,
951
- style: y({ height: n(we) + "px", position: "relative" })
864
+ style: g({ height: n(ee) + "px", position: "relative" })
952
865
  }, [
953
- c("div", {
954
- style: y({ transform: `translateY(${n(he)}px)` })
866
+ h("div", {
867
+ style: g({ transform: `translateY(${n(le)}px)` })
955
868
  }, [
956
- (r(!0), i(b, null, h(n(ke), ({ data: o, index: t }) => (r(), i(b, {
957
- key: o.id
869
+ (r(!0), s(y, null, m(n(ye), ({ data: l, index: t }) => (r(), s(y, {
870
+ key: l.id
958
871
  }, [
959
- n(K)(o) ? (r(), w(de, Y({
872
+ n(K)(l) ? (r(), v(de, G({
960
873
  key: 0,
961
874
  ref_for: !0,
962
875
  ref: (a) => ae(a, t)
963
- }, { ref_for: !0 }, ie(o), {
964
- onToggle: (a) => n(Z)(se(o))
965
- }), null, 16, ["onToggle"])) : (r(), w(dl, Y({
876
+ }, { ref_for: !0 }, se(l), {
877
+ onToggle: (a) => n(J)(ie(l))
878
+ }), null, 16, ["onToggle"])) : (r(), v(Ze, G({
966
879
  key: 1,
967
880
  ref_for: !0,
968
881
  ref: (a) => ae(a, t)
969
- }, { ref_for: !0 }, al(o), {
970
- density: F.value,
882
+ }, { ref_for: !0 }, je(l), {
883
+ density: n(A),
971
884
  "show-row-actions": u.showRowActions,
972
- "row-action-items": q(o),
885
+ "row-action-items": j(l),
973
886
  draggable: u.enableRowDrag,
974
- class: sl(o),
975
- onSelect: te,
976
- onClick: (a) => S(o),
977
- onDragstart: (a) => Ue(a, o),
978
- onDragover: (a) => qe(a, o),
979
- onDrop: (a) => Je(a, o),
980
- onDragend: n(je)
887
+ class: Je(l),
888
+ onSelect: n(ne),
889
+ onClick: (a) => p(l),
890
+ onDragstart: (a) => Ee(a, l),
891
+ onDragover: (a) => Pe(a, l),
892
+ onDrop: (a) => Le(a, l),
893
+ onDragend: n(Ie)
981
894
  }), {
982
- cell: Te(({ row: a, col: g }) => [
983
- P(e.$slots, "cell", {
895
+ cell: $(({ row: a, col: f }) => [
896
+ H(e.$slots, "cell", {
984
897
  row: a,
985
- col: g
898
+ col: f
986
899
  }, () => {
987
- var Me;
900
+ var pe;
988
901
  return [
989
- (Me = u.fieldDefs) != null && Me.length ? (r(), w(V, {
902
+ (pe = u.fieldDefs) != null && pe.length ? (r(), v(V, {
990
903
  key: 0,
991
904
  "row-id": d(a),
992
- field: L(g.key),
993
- value: a[g.key],
994
- class: C({
995
- "of-cell--active": rl(d(a), g.key),
996
- "of-cell--selected": il(d(a), g.key)
905
+ field: P(f.key),
906
+ value: a[f.key],
907
+ class: F({
908
+ "of-cell--active": Xe(d(a), f.key),
909
+ "of-cell--selected": qe(d(a), f.key)
997
910
  }),
998
- onCommit: G,
999
- onClick: I((rt) => u.enableKeyboard && n(pe)(d(a), g.key), ["stop"])
1000
- }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), i("span", et, R(M(a, g.key) ?? "-"), 1))
911
+ onCommit: L,
912
+ onClick: z((on) => u.enableKeyboard && n(ve)(d(a), f.key), ["stop"])
913
+ }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), s("span", Zo, B(C(a, f.key) ?? "-"), 1))
1001
914
  ];
1002
915
  }, !0)
1003
916
  ]),
1004
917
  _: 3
1005
- }, 16, ["density", "show-row-actions", "row-action-items", "draggable", "class", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
918
+ }, 16, ["density", "show-row-actions", "row-action-items", "draggable", "class", "onSelect", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
1006
919
  ], 64))), 128))
1007
920
  ], 4)
1008
- ], 4)) : (r(!0), i(b, { key: 1 }, h(n(H), (o) => (r(), i(b, {
1009
- key: o.id
921
+ ], 4)) : (r(!0), s(y, { key: 1 }, m(n(T), (l) => (r(), s(y, {
922
+ key: l.id
1010
923
  }, [
1011
- n(K)(o) ? (r(), w(de, Y({
924
+ n(K)(l) ? (r(), v(de, G({
1012
925
  key: 0,
1013
926
  ref_for: !0
1014
- }, ie(o), {
1015
- onToggle: (t) => n(Z)(se(o))
1016
- }), null, 16, ["onToggle"])) : (r(), w(dl, Y({
927
+ }, se(l), {
928
+ onToggle: (t) => n(J)(ie(l))
929
+ }), null, 16, ["onToggle"])) : (r(), v(Ze, G({
1017
930
  key: 1,
1018
931
  ref_for: !0
1019
- }, al(o), {
1020
- density: F.value,
932
+ }, je(l), {
933
+ density: n(A),
1021
934
  "show-row-actions": u.showRowActions,
1022
- "row-action-items": q(o),
935
+ "row-action-items": j(l),
1023
936
  draggable: u.enableRowDrag,
1024
- class: sl(o),
1025
- onSelect: te,
1026
- onClick: (t) => S(o),
1027
- onDragstart: (t) => Ue(t, o),
1028
- onDragover: (t) => qe(t, o),
1029
- onDrop: (t) => Je(t, o),
1030
- onDragend: n(je)
937
+ class: Je(l),
938
+ onSelect: n(ne),
939
+ onClick: (t) => p(l),
940
+ onDragstart: (t) => Ee(t, l),
941
+ onDragover: (t) => Pe(t, l),
942
+ onDrop: (t) => Le(t, l),
943
+ onDragend: n(Ie)
1031
944
  }), {
1032
- cell: Te(({ row: t, col: a }) => [
1033
- P(e.$slots, "cell", {
945
+ cell: $(({ row: t, col: a }) => [
946
+ H(e.$slots, "cell", {
1034
947
  row: t,
1035
948
  col: a
1036
949
  }, () => {
1037
- var g;
950
+ var f;
1038
951
  return [
1039
- (g = u.fieldDefs) != null && g.length ? (r(), w(V, {
952
+ (f = u.fieldDefs) != null && f.length ? (r(), v(V, {
1040
953
  key: 0,
1041
954
  "row-id": d(t),
1042
- field: L(a.key),
955
+ field: P(a.key),
1043
956
  value: t[a.key],
1044
- class: C({
1045
- "of-cell--active": rl(d(t), a.key),
1046
- "of-cell--selected": il(d(t), a.key)
957
+ class: F({
958
+ "of-cell--active": Xe(d(t), a.key),
959
+ "of-cell--selected": qe(d(t), a.key)
1047
960
  }),
1048
- onCommit: G,
1049
- onClick: I((Me) => u.enableKeyboard && n(pe)(d(t), a.key), ["stop"])
1050
- }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), i("span", lt, R(M(t, a.key) ?? "-"), 1))
961
+ onCommit: L,
962
+ onClick: z((pe) => u.enableKeyboard && n(ve)(d(t), a.key), ["stop"])
963
+ }, null, 8, ["row-id", "field", "value", "class", "onClick"])) : (r(), s("span", _o, B(C(t, a.key) ?? "-"), 1))
1051
964
  ];
1052
965
  }, !0)
1053
966
  ]),
1054
967
  _: 3
1055
- }, 16, ["density", "show-row-actions", "row-action-items", "draggable", "class", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
968
+ }, 16, ["density", "show-row-actions", "row-action-items", "draggable", "class", "onSelect", "onClick", "onDragstart", "onDragover", "onDrop", "onDragend"]))
1056
969
  ], 64))), 128))
1057
- ], 512)
1058
- ], 64)),
1059
- n(Cl) ? (r(), i("div", {
1060
- key: 3,
970
+ ]),
971
+ _: 3
972
+ }, 8, ["has-fixed-columns", "show-selection-bar", "selection-count", "selection-items", "fixed-width", "show-fixed-shadow", "columns", "fixed-columns", "scrollable-columns", "selectable", "show-row-actions", "use-virtual", "total-height", "offset-y", "onSelectionAction", "onFixedScroll"]),
973
+ n(gl) ? (r(), s("div", {
974
+ key: 0,
1061
975
  class: "of-resize-indicator",
1062
- style: y({ left: n(xl) + "px" })
1063
- }, null, 4)) : D("", !0),
1064
- Ol.value ? (r(), i("div", ot, [
1065
- c("span", tt, R(n(Qe).size) + " 条草稿", 1),
1066
- c("button", {
1067
- class: "of-data-table-draft-btn of-data-table-draft-btn--commit",
1068
- onClick: Nl
1069
- }, " 全部提交 "),
1070
- c("button", {
1071
- class: "of-data-table-draft-btn of-data-table-draft-btn--discard",
1072
- onClick: jl
1073
- }, " 全部放弃 ")
1074
- ])) : D("", !0),
1075
- el.value ? (r(), w(wo, {
1076
- key: 5,
1077
- onClick: Xl
1078
- })) : D("", !0),
1079
- u.enableFieldManagement ? (r(), w(n(fl), {
1080
- key: 6,
1081
- visible: T.value.visible,
1082
- "col-key": T.value.colKey,
1083
- "col-label": T.value.colLabel,
1084
- "field-type": T.value.fieldType,
1085
- x: T.value.x,
1086
- y: T.value.y,
1087
- onClose: l[18] || (l[18] = (o) => T.value.visible = !1),
1088
- onRename: Ul,
1089
- onChangeType: ql,
1090
- onSort: l[19] || (l[19] = (o, t) => n(Q)(o)),
1091
- onHide: Jl,
1092
- onDelete: Ql,
1093
- onDuplicate: Zl
1094
- }, null, 8, ["visible", "col-key", "col-label", "field-type", "x", "y"])) : D("", !0),
1095
- (r(), w(ko, { to: "body" }, [
1096
- oe.value ? (r(), i("div", nt, [
1097
- c("button", {
976
+ style: g({ left: n(kl) + "px" })
977
+ }, null, 4)) : M("", !0),
978
+ Gl.value ? (r(), v(vo, {
979
+ key: 1,
980
+ "draft-count": n(We).size,
981
+ onCommitAll: Nl,
982
+ onDiscardAll: Ol
983
+ }, null, 8, ["draft-count"])) : M("", !0),
984
+ Ge.value ? (r(), v(yo, {
985
+ key: 2,
986
+ onClick: Vl
987
+ })) : M("", !0),
988
+ u.enableFieldManagement ? (r(), v(n(ll), {
989
+ key: 3,
990
+ visible: R.value.visible,
991
+ "col-key": R.value.colKey,
992
+ "col-label": R.value.colLabel,
993
+ "field-type": R.value.fieldType,
994
+ x: R.value.x,
995
+ y: R.value.y,
996
+ onClose: o[16] || (o[16] = (l) => R.value.visible = !1),
997
+ onRename: Yl,
998
+ onChangeType: jl,
999
+ onSort: o[17] || (o[17] = (l, t) => n(q)(l)),
1000
+ onHide: Xl,
1001
+ onDelete: ql,
1002
+ onDuplicate: Jl
1003
+ }, null, 8, ["visible", "col-key", "col-label", "field-type", "x", "y"])) : M("", !0),
1004
+ (r(), v(fo, { to: "body" }, [
1005
+ oe.value ? (r(), s("div", en, [
1006
+ h("button", {
1098
1007
  type: "button",
1099
1008
  class: "of-add-field-overlay__backdrop",
1100
1009
  tabindex: "-1",
1101
1010
  "aria-hidden": "true",
1102
- onClick: l[20] || (l[20] = (o) => oe.value = !1)
1011
+ onClick: o[18] || (o[18] = (l) => oe.value = !1)
1103
1012
  }),
1104
- c("div", at, [
1105
- j(n(cl), { onSelect: eo })
1013
+ h("div", ln, [
1014
+ N(n(ol), { onSelect: Ql })
1106
1015
  ])
1107
- ])) : D("", !0)
1016
+ ])) : M("", !0)
1108
1017
  ]))
1109
1018
  ], 38));
1110
1019
  }
1111
1020
  });
1112
1021
  export {
1113
- $t as default
1022
+ Mn as default
1114
1023
  };