@oneflowui/ui 0.5.6 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +11 -0
  2. package/dist/components/ContextMenu/index.vue.js +2 -2
  3. package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
  4. package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
  5. package/dist/components/Dashboard/index.vue.d.ts +3 -2
  6. package/dist/components/Dashboard/index.vue.js +2 -2
  7. package/dist/components/ai/AiSender.vue.js +2 -2
  8. package/dist/components/ai/AiSender.vue2.js +8 -7
  9. package/dist/components/auxiliary/ColorPanel.vue.js +2 -2
  10. package/dist/components/auxiliary/ColorPanel.vue2.js +25 -23
  11. package/dist/components/auxiliary/FileUpload.vue.js +2 -2
  12. package/dist/components/auxiliary/FileUpload.vue2.js +1 -0
  13. package/dist/components/auxiliary/PersonPanel.vue.js +1 -1
  14. package/dist/components/auxiliary/PersonPanel.vue2.js +2 -1
  15. package/dist/components/base/Accordion.vue.js +1 -1
  16. package/dist/components/base/Avatar.vue.d.ts +3 -0
  17. package/dist/components/base/Avatar.vue.js +4 -4
  18. package/dist/components/base/Avatar.vue2.js +8 -8
  19. package/dist/components/base/Badge.vue.d.ts +2 -0
  20. package/dist/components/base/Badge.vue.js +2 -2
  21. package/dist/components/base/Badge.vue2.js +2 -2
  22. package/dist/components/base/ButtonGroup.vue.js +2 -2
  23. package/dist/components/base/ButtonGroup.vue2.js +2 -2
  24. package/dist/components/base/ChainItem.vue.d.ts +6 -0
  25. package/dist/components/base/ChainItem.vue.js +2 -2
  26. package/dist/components/base/ChainItem.vue2.js +17 -17
  27. package/dist/components/base/DropdownMenu.vue.js +2 -2
  28. package/dist/components/base/DropdownMenu.vue2.js +22 -20
  29. package/dist/components/base/EmptyState.vue.js +2 -2
  30. package/dist/components/base/EmptyState.vue2.js +2 -2
  31. package/dist/components/base/InfoCard.vue.d.ts +9 -0
  32. package/dist/components/base/InfoCard.vue.js +2 -2
  33. package/dist/components/base/InfoCard.vue2.js +65 -57
  34. package/dist/components/base/MonitorItem.vue.js +2 -2
  35. package/dist/components/base/MonitorItem.vue2.js +33 -25
  36. package/dist/components/base/PersonaCard.vue.d.ts +5 -0
  37. package/dist/components/base/PersonaCard.vue.js +3 -3
  38. package/dist/components/base/PersonaCard.vue2.js +56 -50
  39. package/dist/components/base/ProgressBar.vue.d.ts +1 -0
  40. package/dist/components/base/ProgressBar.vue.js +2 -2
  41. package/dist/components/base/ProgressBar.vue2.js +10 -10
  42. package/dist/components/base/RangeSlider.vue.d.ts +15 -0
  43. package/dist/components/base/RangeSlider.vue.js +1 -1
  44. package/dist/components/base/RangeSlider.vue2.js +22 -15
  45. package/dist/components/base/RefTag.vue.d.ts +4 -0
  46. package/dist/components/base/RefTag.vue.js +3 -3
  47. package/dist/components/base/RefTag.vue2.js +14 -14
  48. package/dist/components/base/SearchHighlight.vue.js +1 -1
  49. package/dist/components/base/SectionBlock.vue.js +2 -2
  50. package/dist/components/base/SectionBlock.vue2.js +54 -48
  51. package/dist/components/base/SelectBadge.vue.d.ts +5 -0
  52. package/dist/components/base/SelectBadge.vue.js +3 -3
  53. package/dist/components/base/SelectBadge.vue2.js +36 -28
  54. package/dist/components/base/StatisticCard.vue.js +1 -1
  55. package/dist/components/base/StatusIndicator.vue.js +2 -2
  56. package/dist/components/base/StatusIndicator.vue2.js +2 -2
  57. package/dist/components/base/StatusSummary.vue.js +2 -2
  58. package/dist/components/base/Stepper.vue.js +2 -2
  59. package/dist/components/base/Switch.vue.js +2 -2
  60. package/dist/components/base/ToolbarBtn.vue.js +2 -2
  61. package/dist/components/base/ViewModeGroup.vue.js +1 -1
  62. package/dist/components/base/ViewModeGroup.vue2.js +3 -3
  63. package/dist/components/base/ViewSwitcher.vue.js +1 -1
  64. package/dist/components/base/ViewSwitcher.vue2.js +3 -3
  65. package/dist/components/base/ViewTab.vue.js +1 -1
  66. package/dist/components/base/ViewTab.vue2.js +5 -6
  67. package/dist/components/breadcrumb/Breadcrumb.vue.js +2 -2
  68. package/dist/components/breadcrumb/BreadcrumbItem.vue.js +2 -2
  69. package/dist/components/database/DatabaseView.vue.d.ts +6 -1
  70. package/dist/components/database/DatabaseView.vue.js +2 -2
  71. package/dist/components/database/DatabaseView.vue2.js +438 -293
  72. package/dist/components/detail/PropPanel.vue.js +2 -2
  73. package/dist/components/detail/PropPanel.vue2.js +34 -30
  74. package/dist/components/detail/PropRow.vue.d.ts +6 -0
  75. package/dist/components/detail/PropRow.vue.js +2 -2
  76. package/dist/components/detail/PropRow.vue2.js +24 -24
  77. package/dist/components/editor/BlockQuote.vue.d.ts +2 -1
  78. package/dist/components/editor/BlockQuote.vue.js +1 -1
  79. package/dist/components/editor/BlockQuote.vue2.js +43 -29
  80. package/dist/components/editor/ContentBlock.vue.d.ts +4 -2
  81. package/dist/components/editor/ContentBlock.vue.js +2 -2
  82. package/dist/components/editor/ContentBlock.vue2.js +54 -33
  83. package/dist/components/editor/RichTextEditor.vue.js +2 -2
  84. package/dist/components/editor/RichTextEditor.vue2.js +10 -14
  85. package/dist/components/field/FieldAttachment.vue.js +2 -2
  86. package/dist/components/field/FieldAttachment.vue2.js +30 -32
  87. package/dist/components/field/FieldAutoNumber.vue.js +2 -2
  88. package/dist/components/field/FieldCheckbox.vue.js +2 -2
  89. package/dist/components/field/FieldCheckbox.vue2.js +13 -11
  90. package/dist/components/field/FieldCreator.vue.js +2 -2
  91. package/dist/components/field/FieldCurrency.vue.js +2 -2
  92. package/dist/components/field/FieldCurrency.vue2.js +15 -14
  93. package/dist/components/field/FieldDate.vue.js +1 -1
  94. package/dist/components/field/FieldDate.vue2.js +14 -16
  95. package/dist/components/field/FieldDatetime.vue.js +1 -1
  96. package/dist/components/field/FieldDatetime.vue2.js +12 -11
  97. package/dist/components/field/FieldEmail.vue.js +2 -2
  98. package/dist/components/field/FieldEmail.vue2.js +14 -13
  99. package/dist/components/field/FieldMarkdownPreview.vue.js +2 -2
  100. package/dist/components/field/FieldMultiSelect.vue.d.ts +2 -2
  101. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  102. package/dist/components/field/FieldMultiSelect.vue2.js +80 -75
  103. package/dist/components/field/FieldNumber.vue.js +3 -3
  104. package/dist/components/field/FieldNumber.vue2.js +19 -18
  105. package/dist/components/field/FieldPhone.vue.js +2 -2
  106. package/dist/components/field/FieldPhone.vue2.js +12 -11
  107. package/dist/components/field/FieldProgress.vue.js +1 -1
  108. package/dist/components/field/FieldProgress.vue2.js +18 -17
  109. package/dist/components/field/FieldRating.vue.js +2 -2
  110. package/dist/components/field/FieldRating.vue2.js +22 -16
  111. package/dist/components/field/FieldRelation.vue.js +1 -1
  112. package/dist/components/field/FieldRelation.vue2.js +25 -22
  113. package/dist/components/field/FieldRichText.vue.js +1 -1
  114. package/dist/components/field/FieldRichText.vue2.js +10 -7
  115. package/dist/components/field/FieldSelect.vue.js +2 -2
  116. package/dist/components/field/FieldSelect.vue2.js +81 -63
  117. package/dist/components/field/FieldText.vue.js +2 -2
  118. package/dist/components/field/FieldText.vue2.js +17 -16
  119. package/dist/components/field/FieldUrl.vue.js +2 -2
  120. package/dist/components/field/FieldUrl.vue2.js +17 -16
  121. package/dist/components/form/FormDesigner.vue.js +2 -2
  122. package/dist/components/form/FormDesigner.vue2.js +83 -78
  123. package/dist/components/gallery/GalleryCard.vue.d.ts +1 -1
  124. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  125. package/dist/components/gallery/GalleryCard.vue2.js +2 -1
  126. package/dist/components/kanban/KanbanCard.vue.d.ts +3 -1
  127. package/dist/components/kanban/KanbanCard.vue.js +1 -1
  128. package/dist/components/kanban/KanbanCard.vue2.js +15 -14
  129. package/dist/components/kanban/KanbanColumn.vue.d.ts +2 -0
  130. package/dist/components/kanban/KanbanColumn.vue.js +2 -2
  131. package/dist/components/kanban/KanbanColumn.vue2.js +9 -9
  132. package/dist/components/kanban/QuickAddRow.vue.js +2 -2
  133. package/dist/components/kanban/QuickAddRow.vue2.js +15 -14
  134. package/dist/components/layout/Navbar.vue.js +3 -3
  135. package/dist/components/layout/Navbar.vue2.js +5 -4
  136. package/dist/components/layout/Sidebar.vue.js +2 -2
  137. package/dist/components/layout/Sidebar.vue2.js +1 -1
  138. package/dist/components/mermaid/MermaidChart.vue.js +2 -2
  139. package/dist/components/mermaid/MermaidChart.vue2.js +17 -17
  140. package/dist/components/overlay/Dialog.vue.d.ts +1 -0
  141. package/dist/components/overlay/Dialog.vue.js +1 -1
  142. package/dist/components/overlay/Dialog.vue2.js +9 -9
  143. package/dist/components/overlay/Drawer.vue.d.ts +2 -1
  144. package/dist/components/overlay/Drawer.vue.js +2 -2
  145. package/dist/components/overlay/Drawer.vue2.js +35 -29
  146. package/dist/components/overlay/Modal.vue.d.ts +2 -1
  147. package/dist/components/overlay/Modal.vue.js +1 -1
  148. package/dist/components/overlay/Modal.vue2.js +34 -28
  149. package/dist/components/overlay/SidePanel.vue.d.ts +1 -0
  150. package/dist/components/overlay/SidePanel.vue.js +1 -1
  151. package/dist/components/overlay/SidePanel.vue2.js +6 -6
  152. package/dist/components/split/SplitPane.vue.js +2 -2
  153. package/dist/components/split/SplitPane.vue2.js +11 -9
  154. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +4 -2
  155. package/dist/components/table/ColumnHeaderMenu.vue.js +1 -1
  156. package/dist/components/table/ColumnHeaderMenu.vue2.js +42 -36
  157. package/dist/components/table/DataTable.vue.d.ts +9 -6
  158. package/dist/components/table/DataTable.vue.js +2 -2
  159. package/dist/components/table/DataTable.vue2.js +643 -521
  160. package/dist/components/table/DetailSheet.vue.d.ts +2 -0
  161. package/dist/components/table/DetailSheet.vue.js +2 -2
  162. package/dist/components/table/DetailSheet.vue2.js +154 -70
  163. package/dist/components/table/FieldCell.vue.d.ts +2 -1
  164. package/dist/components/table/FieldCell.vue.js +1 -1
  165. package/dist/components/table/FieldCell.vue2.js +57 -48
  166. package/dist/components/table/FieldTypePicker.vue.d.ts +1 -0
  167. package/dist/components/table/FieldTypePicker.vue.js +4 -4
  168. package/dist/components/table/FieldTypePicker.vue2.js +1 -1
  169. package/dist/components/table/MobileListView.vue.d.ts +3 -2
  170. package/dist/components/table/MobileListView.vue.js +2 -2
  171. package/dist/components/table/MobileListView.vue2.js +57 -50
  172. package/dist/components/table/TableColumnManager.vue.js +1 -1
  173. package/dist/components/table/TableColumnManager.vue2.js +29 -28
  174. package/dist/components/table/TableDataRow.vue.d.ts +5 -1
  175. package/dist/components/table/TableDataRow.vue.js +3 -3
  176. package/dist/components/table/TableDataRow.vue2.js +102 -63
  177. package/dist/components/table/TableFilterPanel.vue.js +2 -2
  178. package/dist/components/table/TableFilterPanel.vue2.js +3 -0
  179. package/dist/components/table/TableGroupRow.vue.d.ts +2 -0
  180. package/dist/components/table/TableGroupRow.vue.js +2 -2
  181. package/dist/components/table/TableGroupRow.vue2.js +35 -30
  182. package/dist/components/table/TableHeaderRow.vue.d.ts +3 -1
  183. package/dist/components/table/TableHeaderRow.vue.js +1 -1
  184. package/dist/components/table/TableHeaderRow.vue2.js +111 -58
  185. package/dist/components/table/TableToolbar.vue.js +1 -1
  186. package/dist/components/table/TableToolbar.vue2.js +2 -2
  187. package/dist/components/tabs/TabPanel.vue.js +4 -4
  188. package/dist/components/tabs/TabPanel.vue2.js +1 -1
  189. package/dist/components/tabs/Tabs.vue.js +2 -2
  190. package/dist/components/tabs/Tabs.vue2.js +2 -2
  191. package/dist/components/timeline/GanttRow.vue.d.ts +2 -0
  192. package/dist/components/timeline/GanttRow.vue.js +2 -2
  193. package/dist/components/timeline/GanttRow.vue2.js +68 -52
  194. package/dist/components/timeline/GanttTimeline.vue.d.ts +6 -0
  195. package/dist/components/timeline/GanttTimeline.vue.js +2 -2
  196. package/dist/components/timeline/GanttTimeline.vue2.js +24 -24
  197. package/dist/composables/useColumnResize.d.ts +4 -1
  198. package/dist/composables/useColumnResize.js +114 -45
  199. package/dist/composables/useKeyboardNavigation.d.ts +1 -1
  200. package/dist/composables/useRowDrag.d.ts +7 -5
  201. package/dist/composables/useRowDrag.js +24 -24
  202. package/dist/composables/useSupabaseProvider.d.ts +8 -1
  203. package/dist/composables/useTableData.d.ts +5 -3
  204. package/dist/composables/useTableGroup.d.ts +2 -2
  205. package/dist/composables/useViewPersistence.d.ts +32 -3
  206. package/dist/composables/useVirtualList.d.ts +1 -0
  207. package/dist/composables/useVirtualList.js +94 -81
  208. package/dist/plugin.js +103 -102
  209. package/dist/style.css +1 -1
  210. package/dist/types/index.d.ts +2 -1
  211. package/dist/utils/echarts.d.ts +1 -0
  212. package/dist/utils/supabaseSchema.d.ts +12 -0
  213. package/package.json +1 -1
@@ -1,99 +1,106 @@
1
- import { defineComponent as E, computed as v, ref as k, openBlock as o, createElementBlock as a, Fragment as g, renderList as C, createElementVNode as X, normalizeStyle as M, renderSlot as S, createTextVNode as A, toDisplayString as d, createCommentVNode as i } from "vue";
2
- import { mergeColorMap as L, DEFAULT_STATUS_MAP as N, resolveBadge as Y } from "../../composables/useBadge.js";
3
- const D = { class: "of-mobile-list" }, F = ["onClick", "onTouchstart"], U = {
1
+ import { defineComponent as D, computed as v, ref as _, openBlock as a, createElementBlock as n, Fragment as g, renderList as C, createElementVNode as X, normalizeStyle as T, renderSlot as M, createTextVNode as A, toDisplayString as d, createCommentVNode as c } from "vue";
2
+ import { mergeColorMap as K, DEFAULT_STATUS_MAP as L, resolveBadge as N } from "../../composables/useBadge.js";
3
+ const Y = { class: "of-mobile-list" }, w = ["onClick", "onKeydown", "onTouchstart"], F = {
4
4
  key: 0,
5
5
  class: "of-mobile-card__title"
6
- }, z = {
6
+ }, U = {
7
7
  key: 1,
8
8
  class: "of-mobile-card__meta"
9
- }, I = {
9
+ }, z = {
10
10
  key: 1,
11
11
  class: "of-mobile-card__tag"
12
- }, O = {
12
+ }, I = {
13
13
  key: 0,
14
14
  class: "of-mobile-card__action-delete"
15
- }, j = /* @__PURE__ */ E({
15
+ }, R = /* @__PURE__ */ D({
16
16
  __name: "MobileListView",
17
17
  props: {
18
18
  rows: {},
19
19
  columns: {},
20
20
  selectable: { type: Boolean, default: !1 },
21
21
  addable: { type: Boolean, default: !0 },
22
- statusColorMap: {},
22
+ statusColorMap: { default: void 0 },
23
23
  readonly: { type: Boolean, default: !1 }
24
24
  },
25
25
  emits: ["row-click", "add-row"],
26
- setup(r, { emit: T }) {
27
- const m = r, y = T, B = v(() => L(N, m.statusColorMap)), f = v(() => m.columns[0]), h = v(() => m.columns.slice(1, 4));
28
- function u(t, n) {
29
- const e = t[n.key];
26
+ setup(i, { emit: S }) {
27
+ const m = i, f = S, B = v(() => K(L, m.statusColorMap)), y = v(() => m.columns[0]), h = v(() => m.columns.slice(1, 4));
28
+ function u(t, o) {
29
+ const e = t[o.key];
30
30
  return e != null ? String(e) : "";
31
31
  }
32
- function p(t) {
33
- return Y(t, B.value);
32
+ function b(t) {
33
+ return N(t, B.value);
34
34
  }
35
- let b = 0, _ = 0;
36
- const c = k(null), s = k(0);
37
- function V(t, n) {
38
- b = t.touches[0].clientX, _ = t.touches[0].clientY, c.value = n, s.value = 0;
35
+ let p = 0, k = 0;
36
+ const r = _(null), s = _(0);
37
+ function x(t, o) {
38
+ p = t.touches[0].clientX, k = t.touches[0].clientY, r.value = o, s.value = 0;
39
39
  }
40
- function $(t) {
41
- if (!c.value) return;
42
- const n = t.touches[0].clientX - b, e = t.touches[0].clientY - _;
43
- if (Math.abs(e) > Math.abs(n)) {
44
- c.value = null;
40
+ function E(t) {
41
+ if (!r.value) return;
42
+ const o = t.touches[0].clientX - p, e = t.touches[0].clientY - k;
43
+ if (Math.abs(e) > Math.abs(o)) {
44
+ r.value = null;
45
45
  return;
46
46
  }
47
- s.value = Math.max(-80, Math.min(0, n));
47
+ s.value = Math.max(-80, Math.min(0, o));
48
+ }
49
+ function V() {
50
+ s.value < -40 ? s.value = -80 : (s.value = 0, r.value = null);
48
51
  }
49
- function x() {
50
- s.value < -40 ? s.value = -80 : (s.value = 0, c.value = null);
52
+ function $(t, o) {
53
+ t.target === t.currentTarget && (t.key !== "Enter" && t.key !== " " || (t.preventDefault(), f("row-click", o)));
51
54
  }
52
- return (t, n) => (o(), a("div", D, [
53
- (o(!0), a(g, null, C(r.rows, (e) => (o(), a("div", {
55
+ return (t, o) => (a(), n("div", Y, [
56
+ (a(!0), n(g, null, C(i.rows, (e) => (a(), n("div", {
54
57
  key: e.id,
55
58
  class: "of-mobile-card-wrapper"
56
59
  }, [
57
60
  X("div", {
58
61
  class: "of-mobile-card",
59
- style: M({ transform: c.value === e.id ? `translateX(${s.value}px)` : "" }),
60
- onClick: (l) => y("row-click", e),
61
- onTouchstart: (l) => V(l, e.id),
62
- onTouchmove: $,
63
- onTouchend: x
62
+ role: "button",
63
+ tabindex: "0",
64
+ style: T({ transform: r.value === e.id ? `translateX(${s.value}px)` : "" }),
65
+ onClick: (l) => f("row-click", e),
66
+ onKeydown: (l) => $(l, e),
67
+ onTouchstart: (l) => x(l, e.id),
68
+ onTouchmove: E,
69
+ onTouchend: V
64
70
  }, [
65
- f.value ? (o(), a("div", U, [
66
- S(t.$slots, "cell", {
71
+ y.value ? (a(), n("div", F, [
72
+ M(t.$slots, "cell", {
67
73
  row: e,
68
- col: f.value
74
+ col: y.value
69
75
  }, () => [
70
- A(d(u(e, f.value) || "—"), 1)
76
+ A(d(u(e, y.value) || "—"), 1)
71
77
  ], !0)
72
- ])) : i("", !0),
73
- h.value.length > 0 ? (o(), a("div", z, [
74
- (o(!0), a(g, null, C(h.value, (l) => S(t.$slots, "cell", {
78
+ ])) : c("", !0),
79
+ h.value.length > 0 ? (a(), n("div", U, [
80
+ (a(!0), n(g, null, C(h.value, (l) => M(t.$slots, "cell", {
75
81
  key: l.key,
76
82
  row: e,
77
83
  col: l
78
84
  }, () => [
79
- l.key === "status" && u(e, l) ? (o(), a("span", {
85
+ l.key === "status" && u(e, l) ? (a(), n("span", {
80
86
  key: 0,
81
87
  class: "of-mobile-card__badge",
82
- style: M(p(u(e, l)).style)
83
- }, d(p(u(e, l)).label), 5)) : u(e, l) ? (o(), a("span", I, d(l.label) + ": " + d(u(e, l)), 1)) : i("", !0)
88
+ style: T(b(u(e, l)).style)
89
+ }, d(b(u(e, l)).label), 5)) : u(e, l) ? (a(), n("span", z, d(l.label) + ": " + d(u(e, l)), 1)) : c("", !0)
84
90
  ], !0)), 128))
85
- ])) : i("", !0)
86
- ], 44, F),
87
- c.value === e.id && s.value < -40 ? (o(), a("div", O, " 删除 ")) : i("", !0)
91
+ ])) : c("", !0)
92
+ ], 44, w),
93
+ r.value === e.id && s.value < -40 ? (a(), n("div", I, " 删除 ")) : c("", !0)
88
94
  ]))), 128)),
89
- r.addable && !r.readonly ? (o(), a("button", {
95
+ i.addable && !i.readonly ? (a(), n("button", {
90
96
  key: 0,
97
+ type: "button",
91
98
  class: "of-mobile-add-btn",
92
- onClick: n[0] || (n[0] = (e) => y("add-row"))
93
- }, " + 新增记录 ")) : i("", !0)
99
+ onClick: o[0] || (o[0] = (e) => f("add-row"))
100
+ }, " + 新增记录 ")) : c("", !0)
94
101
  ]));
95
102
  }
96
103
  });
97
104
  export {
98
- j as default
105
+ R as default
99
106
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableColumnManager.vue2.js";
2
2
  /* empty css */
3
3
  import a from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-785143ae"]]);
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-bade90c0"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as b, ref as k, watch as C, openBlock as r, createElementBlock as d, createElementVNode as n, createVNode as l, unref as s, createTextVNode as u, withCtx as V, Fragment as y, renderList as E, normalizeClass as x, toDisplayString as z, createCommentVNode as w } from "vue";
2
- import { X as N, Eye as B, EyeOff as D, GripVertical as A } from "lucide-vue-next";
3
- import { VueDraggable as T } from "vue-draggable-plus";
4
- const U = {
1
+ import { defineComponent as v, ref as k, watch as C, openBlock as r, createElementBlock as d, createElementVNode as n, createVNode as l, unref as s, createTextVNode as u, withCtx as V, Fragment as y, renderList as E, normalizeClass as x, toDisplayString as z, createCommentVNode as w } from "vue";
2
+ import { X as N, Eye as B, EyeOff as D, GripVertical as $ } from "lucide-vue-next";
3
+ import { VueDraggable as A } from "vue-draggable-plus";
4
+ const T = {
5
5
  key: 0,
6
6
  class: "of-col-manager"
7
- }, $ = { class: "of-col-manager__header" }, F = { class: "of-col-manager__actions" }, G = { class: "of-col-manager__drag" }, L = ["checked", "onChange"], j = /* @__PURE__ */ b({
7
+ }, U = { class: "of-col-manager__header" }, F = { class: "of-col-manager__actions" }, G = { class: "of-col-manager__drag" }, L = ["aria-label", "checked", "onChange"], j = /* @__PURE__ */ v({
8
8
  __name: "TableColumnManager",
9
9
  props: {
10
10
  columns: {},
@@ -15,35 +15,35 @@ const U = {
15
15
  const _ = c, m = f, t = k([]);
16
16
  C(
17
17
  () => _.columns,
18
- (o) => {
19
- t.value = o.map((e) => ({ ...e }));
18
+ (a) => {
19
+ t.value = a.map((e) => ({ ...e }));
20
20
  },
21
21
  { immediate: !0, deep: !0 }
22
22
  );
23
23
  function i() {
24
24
  m(
25
25
  "update:columns",
26
- t.value.map((o) => ({ ...o }))
26
+ t.value.map((a) => ({ ...a }))
27
27
  );
28
28
  }
29
- function g(o) {
30
- o.hidden = !o.hidden, i();
29
+ function g(a) {
30
+ a.hidden = !a.hidden, i();
31
31
  }
32
32
  function p() {
33
- t.value.forEach((o) => o.hidden = !1), i();
33
+ t.value.forEach((a) => a.hidden = !1), i();
34
34
  }
35
- function h() {
36
- t.value.forEach((o) => o.hidden = !0), i();
35
+ function b() {
36
+ t.value.forEach((a) => a.hidden = !0), i();
37
37
  }
38
- function v() {
38
+ function h() {
39
39
  i();
40
40
  }
41
- return (o, e) => c.visible ? (r(), d("div", U, [
42
- n("div", $, [
41
+ return (a, e) => c.visible ? (r(), d("div", T, [
42
+ n("div", U, [
43
43
  e[2] || (e[2] = n("span", { class: "of-col-manager__title" }, "管理列", -1)),
44
44
  n("button", {
45
45
  class: "of-col-manager__close",
46
- onClick: e[0] || (e[0] = (a) => m("close"))
46
+ onClick: e[0] || (e[0] = (o) => m("close"))
47
47
  }, [
48
48
  l(s(N), { size: 14 })
49
49
  ])
@@ -58,36 +58,37 @@ const U = {
58
58
  ]),
59
59
  n("button", {
60
60
  class: "of-col-manager__action-btn",
61
- onClick: h
61
+ onClick: b
62
62
  }, [
63
63
  l(s(D), { size: 12 }),
64
64
  e[4] || (e[4] = u(" 隐藏全部 ", -1))
65
65
  ])
66
66
  ]),
67
- l(s(T), {
67
+ l(s(A), {
68
68
  modelValue: t.value,
69
- "onUpdate:modelValue": e[1] || (e[1] = (a) => t.value = a),
69
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => t.value = o),
70
70
  handle: ".of-col-manager__drag",
71
71
  animation: 150,
72
- onEnd: v
72
+ onEnd: h
73
73
  }, {
74
74
  default: V(() => [
75
- (r(!0), d(y, null, E(t.value, (a) => (r(), d("div", {
76
- key: a.key,
75
+ (r(!0), d(y, null, E(t.value, (o) => (r(), d("div", {
76
+ key: o.key,
77
77
  class: "of-col-manager__row"
78
78
  }, [
79
79
  n("span", G, [
80
- l(s(A), { size: 14 })
80
+ l(s($), { size: 14 })
81
81
  ]),
82
82
  n("input", {
83
83
  type: "checkbox",
84
84
  class: "of-col-manager__checkbox",
85
- checked: !a.hidden,
86
- onChange: (M) => g(a)
85
+ "aria-label": `显示列 ${o.label}`,
86
+ checked: !o.hidden,
87
+ onChange: (M) => g(o)
87
88
  }, null, 40, L),
88
89
  n("span", {
89
- class: x(["of-col-manager__label", { dimmed: a.hidden }])
90
- }, z(a.label), 3)
90
+ class: x(["of-col-manager__label", { dimmed: o.hidden }])
91
+ }, z(o.label), 3)
91
92
  ]))), 128))
92
93
  ]),
93
94
  _: 1
@@ -1,4 +1,4 @@
1
- import { TableColumn, ColorMap } from '../../types';
1
+ import { TableColumn, ColorMap, Density } from '../../types';
2
2
  type TableRow = Record<string, unknown> & {
3
3
  id: string;
4
4
  };
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  selected?: boolean;
9
9
  selectable?: boolean;
10
10
  columns: TableColumn[];
11
+ density?: Density;
11
12
  /**
12
13
  * 优先级颜色映射,与内置默认映射合并(传入优先)
13
14
  */
@@ -36,9 +37,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
36
37
  onSelect?: ((id: string) => any) | undefined;
37
38
  onClick?: ((row: TableRow) => any) | undefined;
38
39
  }>, {
40
+ density: Density;
39
41
  selectable: boolean;
40
42
  rowKey: string;
41
43
  selected: boolean;
44
+ priorityColorMap: ColorMap;
45
+ statusColorMap: ColorMap;
42
46
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
43
47
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
44
48
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./TableDataRow.vue2.js";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5ce5f86"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-4ecab060"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as S, computed as m, openBlock as n, createElementBlock as s, normalizeClass as $, withModifiers as B, createElementVNode as D, createCommentVNode as T, Fragment as p, renderList as A, normalizeStyle as d, renderSlot as P, toDisplayString as a } from "vue";
2
- import { mergeColorMap as w, DEFAULT_PRIORITY_MAP as R, DEFAULT_STATUS_MAP as _, resolveBadge as h } from "../../composables/useBadge.js";
3
- const E = ["aria-selected"], N = ["checked"], V = {
1
+ import { defineComponent as B, computed as d, openBlock as o, createElementBlock as n, normalizeStyle as c, normalizeClass as Y, withModifiers as E, createElementVNode as g, createCommentVNode as R, Fragment as b, renderList as W, renderSlot as _, toDisplayString as r } from "vue";
2
+ import { mergeColorMap as v, DEFAULT_PRIORITY_MAP as H, DEFAULT_STATUS_MAP as N, resolveBadge as x } from "../../composables/useBadge.js";
3
+ const I = ["aria-selected"], K = ["for"], L = ["id", "checked"], U = {
4
4
  key: 0,
5
5
  class: "of-badge of-badge--role"
6
- }, F = {
6
+ }, V = {
7
7
  key: 1,
8
8
  class: "of-td-empty"
9
- }, I = {
9
+ }, X = {
10
10
  key: 3,
11
11
  class: "of-td-text"
12
- }, L = {
12
+ }, F = {
13
13
  key: 4,
14
14
  class: "of-td-id"
15
- }, U = {
15
+ }, z = {
16
16
  key: 5,
17
17
  class: "of-td-title"
18
- }, z = {
18
+ }, O = {
19
19
  key: 6,
20
20
  class: "of-td-text"
21
- }, G = /* @__PURE__ */ S({
21
+ }, q = /* @__PURE__ */ B({
22
22
  __name: "TableDataRow",
23
23
  props: {
24
24
  row: {},
@@ -26,94 +26,133 @@ const E = ["aria-selected"], N = ["checked"], V = {
26
26
  selected: { type: Boolean, default: !1 },
27
27
  selectable: { type: Boolean, default: !0 },
28
28
  columns: {},
29
- priorityColorMap: {},
30
- statusColorMap: {}
29
+ density: { default: "standard" },
30
+ priorityColorMap: { default: void 0 },
31
+ statusColorMap: { default: void 0 }
31
32
  },
32
33
  emits: ["select", "click"],
33
- setup(l, { emit: b }) {
34
- const i = l, u = b;
35
- function C(e) {
34
+ setup(i, { emit: M }) {
35
+ const s = i, y = M, C = {
36
+ compact: {
37
+ rowHeight: 36,
38
+ cellPaddingX: 10,
39
+ cellPaddingY: 6,
40
+ fillMinWidth: 180
41
+ },
42
+ standard: {
43
+ rowHeight: 44,
44
+ cellPaddingX: 12,
45
+ cellPaddingY: 8,
46
+ fillMinWidth: 220
47
+ },
48
+ comfortable: {
49
+ rowHeight: 52,
50
+ cellPaddingX: 14,
51
+ cellPaddingY: 10,
52
+ fillMinWidth: 240
53
+ }
54
+ }, u = d(() => C[s.density]), P = d(() => ({
55
+ minHeight: `${u.value.rowHeight}px`
56
+ })), k = d(() => ({
57
+ padding: `${u.value.cellPaddingY}px ${u.value.cellPaddingX}px`
58
+ }));
59
+ function S(e) {
60
+ const l = k.value;
36
61
  if (e.width === "fill") {
37
- const o = `${e.minWidth ?? 220}px`;
38
- return { flex: `1 1 ${o}`, minWidth: o };
62
+ const t = `${e.minWidth ?? u.value.fillMinWidth}px`;
63
+ return { ...l, flex: `1 1 ${t}`, minWidth: t };
39
64
  }
40
- return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
65
+ return { ...l, width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
41
66
  }
42
- const v = m(
43
- () => w(R, i.priorityColorMap)
44
- ), x = m(() => w(_, i.statusColorMap));
45
- function c(e) {
46
- return h(e, v.value);
67
+ const $ = d(
68
+ () => v(H, s.priorityColorMap)
69
+ ), D = d(() => v(N, s.statusColorMap));
70
+ function p(e) {
71
+ return x(e, $.value);
47
72
  }
48
- function f(e) {
49
- return h(e, x.value);
73
+ function m(e) {
74
+ return x(e, D.value);
50
75
  }
51
- function M(e) {
76
+ function T(e) {
52
77
  if (!e) return "-";
53
- const o = new Date(e);
54
- return isNaN(o.getTime()) ? e : `${o.getMonth() + 1}/${o.getDate()}`;
78
+ const l = new Date(e);
79
+ return isNaN(l.getTime()) ? e : `${l.getMonth() + 1}/${l.getDate()}`;
55
80
  }
56
- function y(e) {
57
- return i.row[e.key];
81
+ function w(e) {
82
+ return s.row[e.key];
58
83
  }
59
- function k(e) {
60
- const o = y(e);
61
- return o != null ? String(o) : "-";
84
+ function h(e) {
85
+ const l = w(e);
86
+ return l != null ? String(l) : "-";
62
87
  }
63
- function r(e) {
64
- const o = y(e);
65
- return typeof o == "string" ? o : "";
88
+ function a(e) {
89
+ const l = w(e);
90
+ return typeof l == "string" ? l : "";
66
91
  }
67
- function g() {
68
- const e = i.row[i.rowKey];
92
+ function f() {
93
+ const e = s.row[s.rowKey];
69
94
  return e != null ? String(e) : "";
70
95
  }
71
- return (e, o) => (n(), s("div", {
72
- class: $(["of-table-row", { "of-table-row--selected": l.selected }]),
96
+ function A(e) {
97
+ e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), y("click", s.row)));
98
+ }
99
+ return (e, l) => (o(), n("div", {
100
+ class: Y(["of-table-row", { "of-table-row--selected": i.selected }]),
73
101
  role: "row",
74
- "aria-selected": l.selected || void 0,
75
- onClick: o[2] || (o[2] = (t) => u("click", l.row))
102
+ tabindex: "0",
103
+ "aria-selected": i.selected || void 0,
104
+ style: c(P.value),
105
+ onClick: l[2] || (l[2] = (t) => y("click", i.row)),
106
+ onKeydown: A
76
107
  }, [
77
- l.selectable ? (n(), s("div", {
108
+ i.selectable ? (o(), n("div", {
78
109
  key: 0,
79
110
  class: "of-td of-td-checkbox",
80
111
  role: "gridcell",
81
- onClick: o[1] || (o[1] = B(() => {
112
+ style: c(k.value),
113
+ onClick: l[1] || (l[1] = E(() => {
82
114
  }, ["stop"]))
83
115
  }, [
84
- D("input", {
85
- type: "checkbox",
86
- class: "of-checkbox",
87
- checked: l.selected,
88
- onChange: o[0] || (o[0] = (t) => u("select", g()))
89
- }, null, 40, N)
90
- ])) : T("", !0),
91
- (n(!0), s(p, null, A(l.columns, (t) => (n(), s("div", {
116
+ g("label", {
117
+ class: "of-checkbox-label",
118
+ for: `of-table-row-checkbox-${f()}`
119
+ }, [
120
+ g("input", {
121
+ id: `of-table-row-checkbox-${f()}`,
122
+ type: "checkbox",
123
+ class: "of-checkbox",
124
+ checked: i.selected,
125
+ onChange: l[0] || (l[0] = (t) => y("select", f()))
126
+ }, null, 40, L),
127
+ l[3] || (l[3] = g("span", { class: "of-sr-only" }, "选择当前行", -1))
128
+ ], 8, K)
129
+ ], 4)) : R("", !0),
130
+ (o(!0), n(b, null, W(i.columns, (t) => (o(), n("div", {
92
131
  key: t.key,
93
132
  class: "of-td",
94
133
  role: "gridcell",
95
- style: d(C(t))
134
+ style: c(S(t))
96
135
  }, [
97
- P(e.$slots, "cell", {
98
- row: l.row,
136
+ _(e.$slots, "cell", {
137
+ row: i.row,
99
138
  col: t
100
139
  }, () => [
101
- t.key === "status" ? (n(), s("span", {
140
+ t.key === "status" ? (o(), n("span", {
102
141
  key: 0,
103
142
  class: "of-badge",
104
- style: d(f(r(t)).style)
105
- }, a(f(r(t)).label), 5)) : t.key === "priority" ? (n(), s("span", {
143
+ style: c(m(a(t)).style)
144
+ }, r(m(a(t)).label), 5)) : t.key === "priority" ? (o(), n("span", {
106
145
  key: 1,
107
146
  class: "of-badge",
108
- style: d(c(r(t)).style)
109
- }, a(c(r(t)).label), 5)) : t.key === "role" ? (n(), s(p, { key: 2 }, [
110
- r(t) ? (n(), s("span", V, a(r(t)), 1)) : (n(), s("span", F, "-"))
111
- ], 64)) : t.key === "updatedAt" ? (n(), s("span", I, a(M(r(t))), 1)) : t.key === "id" ? (n(), s("span", L, a(g()), 1)) : t.key === "title" ? (n(), s("span", U, a(k(t)), 1)) : (n(), s("span", z, a(k(t)), 1))
147
+ style: c(p(a(t)).style)
148
+ }, r(p(a(t)).label), 5)) : t.key === "role" ? (o(), n(b, { key: 2 }, [
149
+ a(t) ? (o(), n("span", U, r(a(t)), 1)) : (o(), n("span", V, "-"))
150
+ ], 64)) : t.key === "updatedAt" ? (o(), n("span", X, r(T(a(t))), 1)) : t.key === "id" ? (o(), n("span", F, r(f()), 1)) : t.key === "title" ? (o(), n("span", z, r(h(t)), 1)) : (o(), n("span", O, r(h(t)), 1))
112
151
  ], !0)
113
152
  ], 4))), 128))
114
- ], 10, E));
153
+ ], 46, I));
115
154
  }
116
155
  });
117
156
  export {
118
- G as default
157
+ q as default
119
158
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableFilterPanel.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-30556b88"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3e9c57c5"]]);
5
5
  export {
6
- m as default
6
+ c as default
7
7
  };
@@ -85,6 +85,7 @@ const x = {
85
85
  ])),
86
86
  i("select", {
87
87
  class: "of-filter-condition__select of-filter-condition__select--field",
88
+ "aria-label": "筛选字段",
88
89
  value: l.field,
89
90
  onChange: (t) => a("update-condition", l.id, { field: t.target.value })
90
91
  }, [
@@ -95,6 +96,7 @@ const x = {
95
96
  ], 40, w),
96
97
  i("select", {
97
98
  class: "of-filter-condition__select",
99
+ "aria-label": "筛选条件",
98
100
  value: l.operator,
99
101
  onChange: (t) => a("update-condition", l.id, {
100
102
  operator: t.target.value
@@ -108,6 +110,7 @@ const x = {
108
110
  h(l.operator) ? (o(), n("span", L)) : (o(), n("input", {
109
111
  key: 2,
110
112
  class: "of-filter-condition__input",
113
+ "aria-label": "筛选值",
111
114
  value: l.value,
112
115
  placeholder: "输入值...",
113
116
  onInput: (t) => a("update-condition", l.id, { value: t.target.value })
@@ -17,6 +17,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
17
17
  }>, {
18
18
  collapsed: boolean;
19
19
  selectable: boolean;
20
+ colorMap: ColorMap;
20
21
  level: number;
22
+ aggregations: Record<string, number>;
21
23
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
22
24
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./TableGroupRow.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-52c60c99"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-42db94c3"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };