@oneflowui/ui 0.5.9 → 0.7.0

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