@oneflowui/ui 0.5.6 → 0.5.7

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 (203) hide show
  1. package/dist/components/ContextMenu/index.vue.js +2 -2
  2. package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
  3. package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
  4. package/dist/components/Dashboard/index.vue.d.ts +2 -1
  5. package/dist/components/Dashboard/index.vue.js +2 -2
  6. package/dist/components/ai/AiSender.vue.js +2 -2
  7. package/dist/components/ai/AiSender.vue2.js +8 -7
  8. package/dist/components/auxiliary/ColorPanel.vue.js +2 -2
  9. package/dist/components/auxiliary/ColorPanel.vue2.js +25 -23
  10. package/dist/components/auxiliary/FileUpload.vue.js +2 -2
  11. package/dist/components/auxiliary/FileUpload.vue2.js +1 -0
  12. package/dist/components/auxiliary/PersonPanel.vue.js +1 -1
  13. package/dist/components/auxiliary/PersonPanel.vue2.js +2 -1
  14. package/dist/components/base/Accordion.vue.js +1 -1
  15. package/dist/components/base/Avatar.vue.d.ts +3 -0
  16. package/dist/components/base/Avatar.vue.js +4 -4
  17. package/dist/components/base/Avatar.vue2.js +8 -8
  18. package/dist/components/base/Badge.vue.d.ts +2 -0
  19. package/dist/components/base/Badge.vue.js +2 -2
  20. package/dist/components/base/Badge.vue2.js +2 -2
  21. package/dist/components/base/ButtonGroup.vue.js +2 -2
  22. package/dist/components/base/ButtonGroup.vue2.js +2 -2
  23. package/dist/components/base/ChainItem.vue.d.ts +6 -0
  24. package/dist/components/base/ChainItem.vue.js +2 -2
  25. package/dist/components/base/ChainItem.vue2.js +17 -17
  26. package/dist/components/base/DropdownMenu.vue.js +2 -2
  27. package/dist/components/base/DropdownMenu.vue2.js +22 -20
  28. package/dist/components/base/EmptyState.vue.js +2 -2
  29. package/dist/components/base/EmptyState.vue2.js +2 -2
  30. package/dist/components/base/InfoCard.vue.d.ts +9 -0
  31. package/dist/components/base/InfoCard.vue.js +2 -2
  32. package/dist/components/base/InfoCard.vue2.js +65 -57
  33. package/dist/components/base/MonitorItem.vue.js +2 -2
  34. package/dist/components/base/MonitorItem.vue2.js +33 -25
  35. package/dist/components/base/PersonaCard.vue.d.ts +5 -0
  36. package/dist/components/base/PersonaCard.vue.js +3 -3
  37. package/dist/components/base/PersonaCard.vue2.js +56 -50
  38. package/dist/components/base/ProgressBar.vue.d.ts +1 -0
  39. package/dist/components/base/ProgressBar.vue.js +2 -2
  40. package/dist/components/base/ProgressBar.vue2.js +10 -10
  41. package/dist/components/base/RangeSlider.vue.d.ts +15 -0
  42. package/dist/components/base/RangeSlider.vue.js +1 -1
  43. package/dist/components/base/RangeSlider.vue2.js +22 -15
  44. package/dist/components/base/RefTag.vue.d.ts +4 -0
  45. package/dist/components/base/RefTag.vue.js +3 -3
  46. package/dist/components/base/RefTag.vue2.js +14 -14
  47. package/dist/components/base/SearchHighlight.vue.js +1 -1
  48. package/dist/components/base/SectionBlock.vue.js +2 -2
  49. package/dist/components/base/SectionBlock.vue2.js +54 -48
  50. package/dist/components/base/SelectBadge.vue.d.ts +5 -0
  51. package/dist/components/base/SelectBadge.vue.js +3 -3
  52. package/dist/components/base/SelectBadge.vue2.js +36 -28
  53. package/dist/components/base/StatisticCard.vue.js +1 -1
  54. package/dist/components/base/StatusIndicator.vue.js +2 -2
  55. package/dist/components/base/StatusIndicator.vue2.js +2 -2
  56. package/dist/components/base/StatusSummary.vue.js +2 -2
  57. package/dist/components/base/Stepper.vue.js +2 -2
  58. package/dist/components/base/Switch.vue.js +2 -2
  59. package/dist/components/base/ToolbarBtn.vue.js +2 -2
  60. package/dist/components/base/ViewModeGroup.vue.js +1 -1
  61. package/dist/components/base/ViewModeGroup.vue2.js +3 -3
  62. package/dist/components/base/ViewSwitcher.vue.js +1 -1
  63. package/dist/components/base/ViewSwitcher.vue2.js +3 -3
  64. package/dist/components/base/ViewTab.vue.js +1 -1
  65. package/dist/components/base/ViewTab.vue2.js +5 -6
  66. package/dist/components/breadcrumb/Breadcrumb.vue.js +2 -2
  67. package/dist/components/breadcrumb/BreadcrumbItem.vue.js +2 -2
  68. package/dist/components/detail/PropPanel.vue.js +2 -2
  69. package/dist/components/detail/PropPanel.vue2.js +34 -30
  70. package/dist/components/detail/PropRow.vue.d.ts +6 -0
  71. package/dist/components/detail/PropRow.vue.js +2 -2
  72. package/dist/components/detail/PropRow.vue2.js +24 -24
  73. package/dist/components/editor/BlockQuote.vue.d.ts +2 -1
  74. package/dist/components/editor/BlockQuote.vue.js +1 -1
  75. package/dist/components/editor/BlockQuote.vue2.js +43 -29
  76. package/dist/components/editor/ContentBlock.vue.d.ts +4 -2
  77. package/dist/components/editor/ContentBlock.vue.js +2 -2
  78. package/dist/components/editor/ContentBlock.vue2.js +54 -33
  79. package/dist/components/editor/RichTextEditor.vue.js +2 -2
  80. package/dist/components/editor/RichTextEditor.vue2.js +10 -14
  81. package/dist/components/field/FieldAttachment.vue.js +2 -2
  82. package/dist/components/field/FieldAttachment.vue2.js +30 -32
  83. package/dist/components/field/FieldAutoNumber.vue.js +2 -2
  84. package/dist/components/field/FieldCheckbox.vue.js +2 -2
  85. package/dist/components/field/FieldCheckbox.vue2.js +13 -11
  86. package/dist/components/field/FieldCreator.vue.js +2 -2
  87. package/dist/components/field/FieldCurrency.vue.js +2 -2
  88. package/dist/components/field/FieldCurrency.vue2.js +15 -14
  89. package/dist/components/field/FieldDate.vue.js +1 -1
  90. package/dist/components/field/FieldDate.vue2.js +14 -16
  91. package/dist/components/field/FieldDatetime.vue.js +1 -1
  92. package/dist/components/field/FieldDatetime.vue2.js +12 -11
  93. package/dist/components/field/FieldEmail.vue.js +2 -2
  94. package/dist/components/field/FieldEmail.vue2.js +14 -13
  95. package/dist/components/field/FieldMarkdownPreview.vue.js +2 -2
  96. package/dist/components/field/FieldMultiSelect.vue.d.ts +2 -2
  97. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  98. package/dist/components/field/FieldMultiSelect.vue2.js +80 -75
  99. package/dist/components/field/FieldNumber.vue.js +3 -3
  100. package/dist/components/field/FieldNumber.vue2.js +19 -18
  101. package/dist/components/field/FieldPhone.vue.js +2 -2
  102. package/dist/components/field/FieldPhone.vue2.js +12 -11
  103. package/dist/components/field/FieldProgress.vue.js +1 -1
  104. package/dist/components/field/FieldProgress.vue2.js +18 -17
  105. package/dist/components/field/FieldRating.vue.js +2 -2
  106. package/dist/components/field/FieldRating.vue2.js +22 -16
  107. package/dist/components/field/FieldRelation.vue.js +1 -1
  108. package/dist/components/field/FieldRelation.vue2.js +25 -22
  109. package/dist/components/field/FieldRichText.vue.js +1 -1
  110. package/dist/components/field/FieldRichText.vue2.js +10 -7
  111. package/dist/components/field/FieldSelect.vue.js +2 -2
  112. package/dist/components/field/FieldSelect.vue2.js +81 -63
  113. package/dist/components/field/FieldText.vue.js +2 -2
  114. package/dist/components/field/FieldText.vue2.js +17 -16
  115. package/dist/components/field/FieldUrl.vue.js +2 -2
  116. package/dist/components/field/FieldUrl.vue2.js +17 -16
  117. package/dist/components/form/FormDesigner.vue.js +2 -2
  118. package/dist/components/form/FormDesigner.vue2.js +83 -78
  119. package/dist/components/gallery/GalleryCard.vue.d.ts +1 -1
  120. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  121. package/dist/components/gallery/GalleryCard.vue2.js +2 -1
  122. package/dist/components/kanban/KanbanCard.vue.d.ts +3 -1
  123. package/dist/components/kanban/KanbanCard.vue.js +1 -1
  124. package/dist/components/kanban/KanbanCard.vue2.js +15 -14
  125. package/dist/components/kanban/KanbanColumn.vue.d.ts +2 -0
  126. package/dist/components/kanban/KanbanColumn.vue.js +2 -2
  127. package/dist/components/kanban/KanbanColumn.vue2.js +9 -9
  128. package/dist/components/kanban/QuickAddRow.vue.js +2 -2
  129. package/dist/components/kanban/QuickAddRow.vue2.js +15 -14
  130. package/dist/components/layout/Navbar.vue.js +3 -3
  131. package/dist/components/layout/Navbar.vue2.js +5 -4
  132. package/dist/components/layout/Sidebar.vue.js +2 -2
  133. package/dist/components/layout/Sidebar.vue2.js +1 -1
  134. package/dist/components/mermaid/MermaidChart.vue.js +2 -2
  135. package/dist/components/mermaid/MermaidChart.vue2.js +17 -17
  136. package/dist/components/overlay/Dialog.vue.d.ts +1 -0
  137. package/dist/components/overlay/Dialog.vue.js +1 -1
  138. package/dist/components/overlay/Dialog.vue2.js +9 -9
  139. package/dist/components/overlay/Drawer.vue.d.ts +1 -0
  140. package/dist/components/overlay/Drawer.vue.js +2 -2
  141. package/dist/components/overlay/Drawer.vue2.js +35 -29
  142. package/dist/components/overlay/Modal.vue.d.ts +1 -0
  143. package/dist/components/overlay/Modal.vue.js +1 -1
  144. package/dist/components/overlay/Modal.vue2.js +34 -28
  145. package/dist/components/overlay/SidePanel.vue.d.ts +1 -0
  146. package/dist/components/overlay/SidePanel.vue.js +1 -1
  147. package/dist/components/overlay/SidePanel.vue2.js +6 -6
  148. package/dist/components/split/SplitPane.vue.js +2 -2
  149. package/dist/components/split/SplitPane.vue2.js +11 -9
  150. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +2 -0
  151. package/dist/components/table/ColumnHeaderMenu.vue.js +1 -1
  152. package/dist/components/table/ColumnHeaderMenu.vue2.js +42 -36
  153. package/dist/components/table/DataTable.vue.d.ts +6 -5
  154. package/dist/components/table/DataTable.vue.js +2 -2
  155. package/dist/components/table/DataTable.vue2.js +527 -477
  156. package/dist/components/table/DetailSheet.vue.js +2 -2
  157. package/dist/components/table/DetailSheet.vue2.js +45 -40
  158. package/dist/components/table/FieldCell.vue.d.ts +2 -1
  159. package/dist/components/table/FieldCell.vue.js +1 -1
  160. package/dist/components/table/FieldCell.vue2.js +57 -48
  161. package/dist/components/table/FieldTypePicker.vue.d.ts +1 -0
  162. package/dist/components/table/FieldTypePicker.vue.js +4 -4
  163. package/dist/components/table/FieldTypePicker.vue2.js +1 -1
  164. package/dist/components/table/MobileListView.vue.d.ts +3 -2
  165. package/dist/components/table/MobileListView.vue.js +2 -2
  166. package/dist/components/table/MobileListView.vue2.js +57 -50
  167. package/dist/components/table/TableColumnManager.vue.js +1 -1
  168. package/dist/components/table/TableColumnManager.vue2.js +29 -28
  169. package/dist/components/table/TableDataRow.vue.d.ts +2 -0
  170. package/dist/components/table/TableDataRow.vue.js +4 -4
  171. package/dist/components/table/TableDataRow.vue2.js +70 -58
  172. package/dist/components/table/TableFilterPanel.vue.js +2 -2
  173. package/dist/components/table/TableFilterPanel.vue2.js +3 -0
  174. package/dist/components/table/TableGroupRow.vue.d.ts +2 -0
  175. package/dist/components/table/TableGroupRow.vue.js +2 -2
  176. package/dist/components/table/TableGroupRow.vue2.js +35 -30
  177. package/dist/components/table/TableHeaderRow.vue.js +3 -3
  178. package/dist/components/table/TableHeaderRow.vue2.js +63 -46
  179. package/dist/components/table/TableToolbar.vue.js +1 -1
  180. package/dist/components/table/TableToolbar.vue2.js +2 -2
  181. package/dist/components/tabs/TabPanel.vue.js +4 -4
  182. package/dist/components/tabs/TabPanel.vue2.js +1 -1
  183. package/dist/components/tabs/Tabs.vue.js +2 -2
  184. package/dist/components/tabs/Tabs.vue2.js +2 -2
  185. package/dist/components/timeline/GanttRow.vue.d.ts +2 -0
  186. package/dist/components/timeline/GanttRow.vue.js +2 -2
  187. package/dist/components/timeline/GanttRow.vue2.js +68 -52
  188. package/dist/components/timeline/GanttTimeline.vue.d.ts +6 -0
  189. package/dist/components/timeline/GanttTimeline.vue.js +2 -2
  190. package/dist/components/timeline/GanttTimeline.vue2.js +24 -24
  191. package/dist/composables/useKeyboardNavigation.d.ts +1 -1
  192. package/dist/composables/useRowDrag.d.ts +6 -4
  193. package/dist/composables/useRowDrag.js +24 -24
  194. package/dist/composables/useSupabaseProvider.d.ts +8 -1
  195. package/dist/composables/useTableData.d.ts +5 -3
  196. package/dist/composables/useTableGroup.d.ts +2 -2
  197. package/dist/composables/useViewPersistence.d.ts +32 -3
  198. package/dist/composables/useVirtualList.js +60 -59
  199. package/dist/plugin.js +103 -102
  200. package/dist/style.css +1 -1
  201. package/dist/utils/echarts.d.ts +1 -0
  202. package/dist/utils/supabaseSchema.d.ts +12 -0
  203. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { defineComponent as v, openBlock as o, createElementBlock as s, createElementVNode as c, createCommentVNode as f, Fragment as x, renderList as z, withModifiers as r, normalizeStyle as C, normalizeClass as w, toDisplayString as B, createBlock as u, unref as d, createVNode as S } from "vue";
2
- import { ChevronUp as $, ChevronDown as h, Plus as g } from "lucide-vue-next";
3
- const D = {
1
+ import { defineComponent as z, openBlock as o, createElementBlock as i, createElementVNode as r, createCommentVNode as f, Fragment as w, renderList as C, withModifiers as d, normalizeStyle as v, normalizeClass as B, toDisplayString as g, createBlock as u, unref as c, createVNode as D } from "vue";
2
+ import { ChevronUp as K, ChevronDown as k, Plus as S } from "lucide-vue-next";
3
+ const $ = {
4
4
  class: "of-table-header",
5
5
  role: "row"
6
6
  }, F = {
@@ -8,7 +8,10 @@ const D = {
8
8
  class: "of-th of-th-checkbox",
9
9
  role: "columnheader",
10
10
  "aria-label": "选择全部行"
11
- }, M = ["checked", "indeterminate"], K = ["aria-sort", "onClick", "onContextmenu", "onDblclick"], O = { class: "of-th-label" }, R = { class: "of-th-sort-icon" }, N = ["onMousedown", "onDblclick"], E = /* @__PURE__ */ v({
11
+ }, M = {
12
+ class: "of-th-checkbox__label",
13
+ for: "of-table-select-all-checkbox"
14
+ }, p = ["checked", "indeterminate"], O = ["aria-sort", "onClick", "onKeydown", "onContextmenu", "onDblclick"], R = { class: "of-th-label" }, E = { class: "of-th-sort-icon" }, N = ["onMousedown", "onDblclick"], H = /* @__PURE__ */ z({
12
15
  __name: "TableHeaderRow",
13
16
  props: {
14
17
  columns: {},
@@ -22,76 +25,90 @@ const D = {
22
25
  enableAddField: { type: Boolean, default: !1 }
23
26
  },
24
27
  emits: ["sort", "select-all", "resize-start", "resize-dblclick", "header-contextmenu", "header-dblclick", "add-field"],
25
- setup(e, { emit: k }) {
26
- const a = k;
27
- function y(n) {
28
- if (n.width === "fill") {
29
- const l = `${n.minWidth ?? 220}px`;
30
- return { flex: `1 1 ${l}`, minWidth: l };
28
+ setup(e, { emit: y }) {
29
+ const a = y;
30
+ function b(t) {
31
+ if (t.width === "fill") {
32
+ const n = `${t.minWidth ?? 220}px`;
33
+ return { flex: `1 1 ${n}`, minWidth: n };
31
34
  }
32
- return { width: `${n.width}px`, flexShrink: "0", flexGrow: "0" };
35
+ return { width: `${t.width}px`, flexShrink: "0", flexGrow: "0" };
33
36
  }
34
- function m(n) {
35
- a("sort", n);
37
+ function h(t) {
38
+ a("sort", t);
36
39
  }
37
- function b(n, l) {
38
- n.stopPropagation(), a("resize-start", n, l);
40
+ function m(t, n) {
41
+ t.target === t.currentTarget && (t.key !== "Enter" && t.key !== " " || (t.preventDefault(), a("sort", n)));
39
42
  }
40
- return (n, l) => (o(), s("div", D, [
41
- e.selectable ? (o(), s("div", F, [
42
- c("input", {
43
- type: "checkbox",
44
- class: "of-checkbox",
45
- checked: e.allSelected,
46
- indeterminate: e.indeterminate,
47
- onChange: l[0] || (l[0] = (t) => a("select-all"))
48
- }, null, 40, M)
43
+ function x(t, n) {
44
+ t.stopPropagation(), a("resize-start", t, n);
45
+ }
46
+ return (t, n) => (o(), i("div", $, [
47
+ e.selectable ? (o(), i("div", F, [
48
+ r("label", M, [
49
+ r("input", {
50
+ id: "of-table-select-all-checkbox",
51
+ type: "checkbox",
52
+ class: "of-checkbox",
53
+ checked: e.allSelected,
54
+ indeterminate: e.indeterminate,
55
+ onChange: n[0] || (n[0] = (l) => a("select-all"))
56
+ }, null, 40, p),
57
+ n[3] || (n[3] = r("span", { class: "of-sr-only" }, "选择全部行", -1))
58
+ ])
49
59
  ])) : f("", !0),
50
- (o(!0), s(x, null, z(e.columns, (t) => (o(), s("div", {
51
- key: t.key,
60
+ (o(!0), i(w, null, C(e.columns, (l) => (o(), i("div", {
61
+ key: l.key,
52
62
  role: "columnheader",
53
- class: w(["of-th", { "of-th--sortable": !0, "of-th--active": e.sortKey === t.key }]),
54
- style: C(y(t)),
55
- "aria-sort": e.sortKey === t.key ? e.sortOrder === "asc" ? "ascending" : "descending" : "none",
56
- onClick: (i) => m(t.key),
57
- onContextmenu: r((i) => e.enableFieldMenu && a("header-contextmenu", i, t.key), ["prevent"]),
58
- onDblclick: r((i) => e.enableFieldMenu && a("header-dblclick", t.key), ["stop"])
63
+ tabindex: "0",
64
+ class: B(["of-th", { "of-th--sortable": !0, "of-th--active": e.sortKey === l.key }]),
65
+ style: v(b(l)),
66
+ "aria-sort": e.sortKey === l.key ? e.sortOrder === "asc" ? "ascending" : "descending" : "none",
67
+ onClick: (s) => h(l.key),
68
+ onKeydown: (s) => m(s, l.key),
69
+ onContextmenu: d((s) => e.enableFieldMenu && a("header-contextmenu", s, l.key), ["prevent"]),
70
+ onDblclick: d((s) => e.enableFieldMenu && a("header-dblclick", l.key), ["stop"])
59
71
  }, [
60
- c("span", O, B(t.label), 1),
61
- c("span", R, [
62
- e.sortKey === t.key && e.sortOrder === "asc" ? (o(), u(d($), {
72
+ r("span", R, g(l.label), 1),
73
+ r("span", E, [
74
+ e.sortKey === l.key && e.sortOrder === "asc" ? (o(), u(c(K), {
63
75
  key: 0,
64
76
  size: 12,
65
77
  class: "of-sort-icon-active"
66
- })) : e.sortKey === t.key && e.sortOrder === "desc" ? (o(), u(d(h), {
78
+ })) : e.sortKey === l.key && e.sortOrder === "desc" ? (o(), u(c(k), {
67
79
  key: 1,
68
80
  size: 12,
69
81
  class: "of-sort-icon-active"
70
- })) : (o(), u(d(h), {
82
+ })) : (o(), u(c(k), {
71
83
  key: 2,
72
84
  size: 12,
73
85
  class: "of-sort-icon-idle"
74
86
  }))
75
87
  ]),
76
- e.enableResize ? (o(), s("div", {
88
+ e.enableResize ? (o(), i("button", {
77
89
  key: 0,
90
+ type: "button",
78
91
  class: "of-th-resizer",
79
- onMousedown: (i) => b(i, t.key),
80
- onDblclick: r((i) => a("resize-dblclick", t.key), ["stop"])
92
+ "aria-label": "调整列宽",
93
+ onClick: n[1] || (n[1] = d(() => {
94
+ }, ["stop"])),
95
+ onMousedown: (s) => x(s, l.key),
96
+ onDblclick: d((s) => a("resize-dblclick", l.key), ["stop"])
81
97
  }, null, 40, N)) : f("", !0)
82
- ], 46, K))), 128)),
83
- e.enableAddField ? (o(), s("div", {
98
+ ], 46, O))), 128)),
99
+ e.enableAddField ? (o(), i("button", {
84
100
  key: 1,
101
+ type: "button",
85
102
  class: "of-th of-th-add",
86
- role: "columnheader",
103
+ tabindex: "0",
87
104
  "aria-label": "添加字段",
88
- onClick: l[1] || (l[1] = r((t) => a("add-field"), ["stop"]))
105
+ onClick: n[2] || (n[2] = d((l) => a("add-field"), ["stop"]))
89
106
  }, [
90
- S(d(g), { size: 14 })
107
+ D(c(S), { size: 14 })
91
108
  ])) : f("", !0)
92
109
  ]));
93
110
  }
94
111
  });
95
112
  export {
96
- E as default
113
+ H as default
97
114
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableToolbar.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-02ad76f7"]]);
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-c3196e5a"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -40,11 +40,11 @@ const ie = { class: "of-table-toolbar" }, fe = {
40
40
  },
41
41
  emits: ["update:currentView", "update:columns", "update:searchKeyword", "add-filter", "remove-filter", "update-filter", "clear-filters", "update:filterLogic", "sort", "group", "save-view", "load-view"],
42
42
  setup(l, { emit: N }) {
43
- const I = [
43
+ const R = l, u = N, I = [
44
44
  { value: "table", label: "表格", icon: "table-2" },
45
45
  { value: "kanban", label: "看板", icon: "columns-3" },
46
46
  { value: "timeline", label: "时间线", icon: "calendar" }
47
- ], R = l, u = N, j = T(() => R.viewTabs ?? I), k = i(!1), v = i(!1), c = i(!1), p = i(!1), D = i(null), G = i(null), A = i(null), z = i(null), F = i({}), P = i({}), U = i({}), E = i({});
47
+ ], j = T(() => R.viewTabs ?? I), k = i(!1), v = i(!1), c = i(!1), p = i(!1), D = i(null), G = i(null), A = i(null), z = i(null), F = i({}), P = i({}), U = i({}), E = i({});
48
48
  function q(r) {
49
49
  if (!r) return {};
50
50
  const e = r.getBoundingClientRect();
@@ -1,7 +1,7 @@
1
- import o from "./TabPanel.vue2.js";
1
+ import a from "./TabPanel.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-5e40c39f"]]);
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-66a21a08"]]);
5
5
  export {
6
- f as default
6
+ p as default
7
7
  };
@@ -9,9 +9,9 @@ const f = ["id", "aria-labelledby", "hidden"], k = /* @__PURE__ */ o({
9
9
  const l = e, t = i("of-tabs-active"), a = d(() => (t == null ? void 0 : t.value) === l.name);
10
10
  return (n, b) => e.keepAlive || a.value ? c((r(), u("div", {
11
11
  key: 0,
12
+ id: `of-panel-${e.name}`,
12
13
  class: "of-tab-panel",
13
14
  role: "tabpanel",
14
- id: `of-panel-${e.name}`,
15
15
  "aria-labelledby": `of-tab-${e.name}`,
16
16
  hidden: e.keepAlive && !a.value ? !0 : void 0
17
17
  }, [
@@ -1,7 +1,7 @@
1
1
  import o from "./Tabs.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dd5210e5"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6c4531cc"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -4,7 +4,7 @@ const B = {
4
4
  class: "of-tabs__nav",
5
5
  role: "tablist",
6
6
  "aria-label": "tabs"
7
- }, E = ["disabled", "id", "aria-selected", "aria-controls", "aria-disabled", "tabindex", "onClick", "onKeydown"], I = { class: "of-tabs__tab-label" }, K = {
7
+ }, E = ["id", "disabled", "aria-selected", "aria-controls", "aria-disabled", "tabindex", "onClick", "onKeydown"], I = { class: "of-tabs__tab-label" }, K = {
8
8
  key: 1,
9
9
  class: "of-tabs__badge"
10
10
  }, L = { class: "of-tabs__content" }, F = /* @__PURE__ */ h({
@@ -53,6 +53,7 @@ const B = {
53
53
  }, [
54
54
  c("div", B, [
55
55
  (l(!0), r(D, null, x(i.tabs, (e) => (l(), r("button", {
56
+ id: `of-tab-${e.key}`,
56
57
  key: e.key,
57
58
  class: m(["of-tabs__tab", {
58
59
  "of-tabs__tab--active": o.value === e.key,
@@ -60,7 +61,6 @@ const B = {
60
61
  }]),
61
62
  disabled: e.disabled,
62
63
  role: "tab",
63
- id: `of-tab-${e.key}`,
64
64
  "aria-selected": o.value === e.key,
65
65
  "aria-controls": `of-panel-${e.key}`,
66
66
  "aria-disabled": e.disabled,
@@ -37,6 +37,8 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
37
37
  endDate: string;
38
38
  }) => any) | undefined;
39
39
  }>, {
40
+ priorityColorMap: ColorMap;
41
+ statusColorMap: ColorMap;
40
42
  readonly: boolean;
41
43
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
42
44
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./GanttRow.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-51311e43"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-27ccf798"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as W, ref as _, computed as r, openBlock as B, createElementBlock as T, createElementVNode as n, normalizeStyle as d, toDisplayString as y, normalizeClass as A } from "vue";
2
- import { resolveBadge as h, mergeColorMap as M, DEFAULT_PRIORITY_MAP as z, DEFAULT_STATUS_MAP as R } from "../../composables/useBadge.js";
3
- const U = { class: "gantt-row__label" }, X = { class: "gantt-row__title" }, F = { class: "gantt-row__bar-label" }, G = /* @__PURE__ */ W({
1
+ import { defineComponent as T, ref as b, computed as n, openBlock as A, createElementBlock as R, createElementVNode as r, normalizeStyle as l, toDisplayString as m, normalizeClass as _, withModifiers as z } from "vue";
2
+ import { resolveBadge as h, mergeColorMap as M, DEFAULT_PRIORITY_MAP as U, DEFAULT_STATUS_MAP as X } from "../../composables/useBadge.js";
3
+ const F = { class: "gantt-row__label" }, I = { class: "gantt-row__title" }, K = { class: "gantt-row__bar-label" }, N = /* @__PURE__ */ T({
4
4
  __name: "GanttRow",
5
5
  props: {
6
6
  item: {},
@@ -9,28 +9,28 @@ const U = { class: "gantt-row__label" }, X = { class: "gantt-row__title" }, F =
9
9
  durationDays: {},
10
10
  totalDays: {},
11
11
  readonly: { type: Boolean, default: !1 },
12
- priorityColorMap: {},
13
- statusColorMap: {}
12
+ priorityColorMap: { default: void 0 },
13
+ statusColorMap: { default: void 0 }
14
14
  },
15
15
  emits: ["click", "change"],
16
- setup(s, { emit: b }) {
17
- const t = s, u = b, l = _(!1), i = _(null);
18
- let g = 0, D = 0, c = 0;
19
- const C = r(() => t.totalDays * t.dayWidth), S = r(() => t.offsetDays * t.dayWidth), k = r(() => Math.max(t.durationDays, 1) * t.dayWidth), m = r(
16
+ setup(i, { emit: k }) {
17
+ const t = i, d = k, s = b(!1), u = b(null);
18
+ let g = 0, f = 0, c = 0;
19
+ const x = n(() => t.totalDays * t.dayWidth), C = n(() => t.offsetDays * t.dayWidth), S = n(() => Math.max(t.durationDays, 1) * t.dayWidth), y = n(
20
20
  () => h(
21
21
  t.item.priority || "",
22
- M(z, t.priorityColorMap)
22
+ M(U, t.priorityColorMap)
23
23
  )
24
- ), f = r(() => t.item.barColor ? { background: t.item.barColor, color: "var(--of-color-gray-800)" } : {
25
- background: m.value.style.background,
26
- color: m.value.style.color
27
- }), x = r(() => m.value.style), $ = r(() => {
24
+ ), D = n(() => t.item.barColor ? { background: t.item.barColor, color: "var(--of-color-gray-800)" } : {
25
+ background: y.value.style.background,
26
+ color: y.value.style.color
27
+ }), E = n(() => y.value.style), $ = n(() => {
28
28
  const e = h(
29
29
  t.item.status || "",
30
- M(R, t.statusColorMap)
30
+ M(X, t.statusColorMap)
31
31
  );
32
32
  return e.dot ?? e.style.color;
33
- }), E = r(() => {
33
+ }), L = n(() => {
34
34
  const e = (a) => {
35
35
  const o = /* @__PURE__ */ new Date(`${a}T00:00:00`);
36
36
  return `${String(o.getMonth() + 1).padStart(2, "0")}/${String(o.getDate()).padStart(2, "0")}`;
@@ -38,73 +38,89 @@ const U = { class: "gantt-row__label" }, X = { class: "gantt-row__title" }, F =
38
38
  return `${e(t.item.startDate)} - ${e(t.item.endDate)}`;
39
39
  });
40
40
  function v(e, a) {
41
- t.readonly || (e.preventDefault(), e.stopPropagation(), l.value = !0, i.value = a, g = e.clientX, D = t.offsetDays, c = t.durationDays, window.addEventListener("mousemove", p), window.addEventListener("mouseup", w));
41
+ t.readonly || (e.preventDefault(), e.stopPropagation(), s.value = !0, u.value = a, g = e.clientX, f = t.offsetDays, c = t.durationDays, window.addEventListener("mousemove", p), window.addEventListener("mouseup", w));
42
42
  }
43
43
  function p(e) {
44
- if (!l.value || !i.value) return;
44
+ if (!s.value || !u.value) return;
45
45
  const a = Math.round((e.clientX - g) / t.dayWidth);
46
- if (i.value === "move") {
47
- const P = Math.max(0, Math.min(D + a, t.totalDays - 1));
48
- u("change", {
46
+ if (u.value === "move") {
47
+ const B = Math.max(0, Math.min(f + a, t.totalDays - 1));
48
+ d("change", {
49
49
  id: t.item.id,
50
- offsetDays: P,
50
+ offsetDays: B,
51
51
  durationDays: c,
52
52
  startDate: t.item.startDate,
53
53
  endDate: t.item.endDate
54
54
  });
55
55
  return;
56
56
  }
57
- const o = Math.max(1, c + a), L = Math.max(1, t.totalDays - t.offsetDays);
58
- u("change", {
57
+ const o = Math.max(1, c + a), W = Math.max(1, t.totalDays - t.offsetDays);
58
+ d("change", {
59
59
  id: t.item.id,
60
60
  offsetDays: t.offsetDays,
61
- durationDays: Math.min(o, L),
61
+ durationDays: Math.min(o, W),
62
62
  startDate: t.item.startDate,
63
63
  endDate: t.item.endDate
64
64
  });
65
65
  }
66
66
  function w() {
67
- l.value = !1, i.value = null, window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", w);
67
+ s.value = !1, u.value = null, window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", w);
68
68
  }
69
- return (e, a) => (B(), T("div", {
69
+ function P(e) {
70
+ e.key !== "Enter" && e.key !== " " || (e.preventDefault(), d("click", t.item));
71
+ }
72
+ return (e, a) => (A(), R("div", {
70
73
  class: "gantt-row",
71
- onClick: a[2] || (a[2] = (o) => u("click", s.item))
74
+ role: "button",
75
+ tabindex: "0",
76
+ onClick: a[2] || (a[2] = (o) => d("click", i.item)),
77
+ onKeydown: P
72
78
  }, [
73
- n("div", U, [
74
- n("span", {
79
+ r("div", F, [
80
+ r("span", {
75
81
  class: "gantt-row__dot",
76
- style: d({ backgroundColor: $.value })
82
+ style: l({ backgroundColor: $.value })
77
83
  }, null, 4),
78
- n("span", X, y(s.item.title), 1),
79
- n("span", {
84
+ r("span", I, m(i.item.title), 1),
85
+ r("span", {
80
86
  class: "gantt-row__priority",
81
- style: d(x.value)
82
- }, y(s.item.priority), 5)
87
+ style: l(E.value)
88
+ }, m(i.item.priority), 5)
83
89
  ]),
84
- n("div", {
90
+ r("div", {
85
91
  class: "gantt-row__chart",
86
- style: d({ width: `${C.value}px` })
92
+ style: l({ width: `${x.value}px` })
87
93
  }, [
88
- n("div", {
89
- class: A(["gantt-row__bar", { "gantt-row__bar--dragging": l.value }]),
90
- style: d({
91
- left: `${S.value}px`,
92
- width: `${k.value}px`,
93
- backgroundColor: f.value.background,
94
- color: f.value.color
95
- }),
96
- onMousedown: a[1] || (a[1] = (o) => v(o, "move"))
94
+ r("div", {
95
+ class: _(["gantt-row__bar-shell", { "gantt-row__bar--dragging": s.value }]),
96
+ style: l({
97
+ left: `${C.value}px`,
98
+ width: `${S.value}px`
99
+ })
97
100
  }, [
98
- n("span", F, y(E.value), 1),
99
- n("span", {
101
+ r("button", {
102
+ type: "button",
103
+ class: _(["gantt-row__bar", { "gantt-row__bar--dragging": s.value }]),
104
+ style: l({
105
+ backgroundColor: D.value.background,
106
+ color: D.value.color
107
+ }),
108
+ "aria-label": "拖动时间条",
109
+ onMousedown: a[0] || (a[0] = (o) => v(o, "move"))
110
+ }, [
111
+ r("span", K, m(L.value), 1)
112
+ ], 38),
113
+ r("button", {
114
+ type: "button",
100
115
  class: "gantt-row__handle",
101
- onMousedown: a[0] || (a[0] = (o) => v(o, "resize-end"))
116
+ "aria-label": "调整结束时间",
117
+ onMousedown: a[1] || (a[1] = z((o) => v(o, "resize-end"), ["stop"]))
102
118
  }, null, 32)
103
- ], 38)
119
+ ], 6)
104
120
  ], 4)
105
- ]));
121
+ ], 32));
106
122
  }
107
123
  });
108
124
  export {
109
- G as default
125
+ N as default
110
126
  };
@@ -38,6 +38,12 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
38
38
  }) => any) | undefined;
39
39
  "onUpdate:records"?: ((records: DataRecord[]) => any) | undefined;
40
40
  }>, {
41
+ startDate: string;
42
+ items: GanttItem[];
43
+ data: Task[];
44
+ records: DataRecord[];
45
+ schema: TableSchema;
46
+ viewConfig: ViewConfig;
41
47
  startFieldId: string;
42
48
  endFieldId: string;
43
49
  labelFieldId: string;
@@ -1,7 +1,7 @@
1
1
  import t from "./GanttTimeline.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-87818263"]]);
4
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-2d350e85"]]);
5
5
  export {
6
- e as default
6
+ a as default
7
7
  };
@@ -7,15 +7,15 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
7
7
  }, f = 40, lt = /* @__PURE__ */ J({
8
8
  __name: "GanttTimeline",
9
9
  props: {
10
- records: {},
11
- schema: {},
12
- viewConfig: {},
10
+ records: { default: void 0 },
11
+ schema: { default: void 0 },
12
+ viewConfig: { default: void 0 },
13
13
  startFieldId: { default: "startDate" },
14
14
  endFieldId: { default: "endDate" },
15
15
  labelFieldId: { default: "title" },
16
- items: {},
17
- data: {},
18
- startDate: {},
16
+ items: { default: void 0 },
17
+ data: { default: void 0 },
18
+ startDate: { default: void 0 },
19
19
  days: { default: 30 }
20
20
  },
21
21
  emits: ["row-click", "record-change", "update:records"],
@@ -71,8 +71,8 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
71
71
  )), O = s(() => {
72
72
  var a, r;
73
73
  const e = [...m.value], t = (r = (a = n.viewConfig) == null ? void 0 : a.sorts) == null ? void 0 : r[0];
74
- return t && e.sort((d, v) => {
75
- const o = d[t.fieldId] ?? "", q = v[t.fieldId] ?? "", M = String(o).localeCompare(String(q));
74
+ return t && e.sort((o, g) => {
75
+ const d = o[t.fieldId] ?? "", q = g[t.fieldId] ?? "", M = String(d).localeCompare(String(q));
76
76
  return t.direction === "desc" ? -M : M;
77
77
  }), e;
78
78
  }), V = s(() => {
@@ -86,9 +86,9 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
86
86
  return p(n.startDate || x(), n.days - 1);
87
87
  const e = Math.max(...m.value.map((a) => i(a.endDate).getTime())), t = new Date(e);
88
88
  return t.setDate(t.getDate() + 1), h(t);
89
- }), D = s(() => n.startDate || V.value), g = s(() => n.startDate ? n.days : Math.max(n.days, y(D.value, Y.value) + 1)), N = s(() => {
89
+ }), D = s(() => n.startDate || V.value), v = s(() => n.startDate ? n.days : Math.max(n.days, y(D.value, Y.value) + 1)), N = s(() => {
90
90
  const e = [];
91
- for (let t = 0; t < g.value; t++)
91
+ for (let t = 0; t < v.value; t++)
92
92
  e.push(p(D.value, t));
93
93
  return e;
94
94
  }), u = K([]);
@@ -100,10 +100,10 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
100
100
  { immediate: !0 }
101
101
  );
102
102
  const C = s(() => {
103
- const e = D.value, t = g.value;
103
+ const e = D.value, t = v.value;
104
104
  return u.value.map((a) => {
105
- const r = Math.max(0, y(e, a.startDate)), d = Math.max(r, y(e, a.endDate)), v = Math.max(1, d - r + 1);
106
- return { row: a, offsetDays: Math.min(r, t - 1), durationDays: v };
105
+ const r = Math.max(0, y(e, a.startDate)), o = Math.max(r, y(e, a.endDate)), g = Math.max(1, o - r + 1);
106
+ return { row: a, offsetDays: Math.min(r, t - 1), durationDays: g };
107
107
  });
108
108
  }), $ = h(/* @__PURE__ */ new Date());
109
109
  function A(e) {
@@ -115,10 +115,10 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
115
115
  }
116
116
  const k = s(() => {
117
117
  const e = y(D.value, $);
118
- return e < 0 || e > g.value - 1 ? null : e * f + f / 2;
118
+ return e < 0 || e > v.value - 1 ? null : e * f + f / 2;
119
119
  });
120
120
  function j(e) {
121
- const t = u.value.findIndex((o) => o.id === e.id);
121
+ const t = u.value.findIndex((d) => d.id === e.id);
122
122
  if (t === -1) return;
123
123
  const a = p(D.value, e.offsetDays), r = p(a, e.durationDays - 1);
124
124
  u.value[t] = {
@@ -126,22 +126,22 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
126
126
  startDate: a,
127
127
  endDate: r
128
128
  };
129
- const d = u.value[t].sourceRecordId;
130
- if (!d) return;
129
+ const o = u.value[t].sourceRecordId;
130
+ if (!o) return;
131
131
  S("record-change", {
132
- recordId: d,
132
+ recordId: o,
133
133
  startDate: a,
134
134
  endDate: r
135
135
  });
136
- const v = F.value.map((o) => o.id !== d ? o : {
137
- ...o,
136
+ const g = F.value.map((d) => d.id !== o ? d : {
137
+ ...d,
138
138
  fields: {
139
- ...o.fields,
139
+ ...d.fields,
140
140
  [n.startFieldId]: a,
141
141
  [n.endFieldId]: r
142
142
  }
143
143
  });
144
- S("update:records", v);
144
+ S("update:records", g);
145
145
  }
146
146
  return (e, t) => (l(), c("div", {
147
147
  class: "gantt-timeline",
@@ -151,7 +151,7 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
151
151
  t[0] || (t[0] = I("div", { class: "gantt-timeline__header-label" }, "任务", -1)),
152
152
  I("div", {
153
153
  class: "gantt-timeline__header-dates",
154
- style: _({ width: `${g.value * f}px` })
154
+ style: _({ width: `${v.value * f}px` })
155
155
  }, [
156
156
  (l(!0), c(R, null, T(N.value, (a) => (l(), c("div", {
157
157
  key: a,
@@ -172,7 +172,7 @@ const at = { class: "gantt-timeline__header" }, nt = { class: "gantt-timeline__r
172
172
  "offset-days": a.offsetDays,
173
173
  "duration-days": a.durationDays,
174
174
  "day-width": f,
175
- "total-days": g.value,
175
+ "total-days": v.value,
176
176
  onChange: j,
177
177
  onClick: (r) => S("row-click", a.row)
178
178
  }, null, 8, ["item", "offset-days", "duration-days", "total-days", "onClick"]))), 128)),
@@ -5,7 +5,7 @@ export interface UseKeyboardNavigationOptions {
5
5
  columns: Ref<TableColumn[]>;
6
6
  rows: Ref<Array<{
7
7
  id: string;
8
- } & Record<string, any>>>;
8
+ } & Record<string, unknown>>>;
9
9
  containerRef: Ref<HTMLElement | null>;
10
10
  editingCell: Ref<EditingCell | null>;
11
11
  enabled: Ref<boolean>;
@@ -17,16 +17,18 @@ export interface RowGroupChangePayload {
17
17
  groupFieldId: string;
18
18
  newValue: unknown;
19
19
  }
20
- export declare function useRowDrag<T extends Record<string, any>>(options: UseRowDragOptions<T>): {
20
+ type RowDragItem<T> = T | GroupedListItem<T>;
21
+ export declare function useRowDrag<T extends Record<string, unknown>>(options: UseRowDragOptions<T>): {
21
22
  isDragging: Readonly<Ref<boolean, boolean>>;
22
23
  draggedRowId: Readonly<Ref<string | null, string | null>>;
23
24
  dropTargetId: Readonly<Ref<string | null, string | null>>;
24
25
  dropPosition: Readonly<Ref<"before" | "after" | "into-group", "before" | "after" | "into-group">>;
25
- handleDragStart: (e: DragEvent, item: GroupedListItem<T>) => void;
26
- handleDragOver: (e: DragEvent, targetItem: GroupedListItem<T>) => void;
27
- handleDrop: (e: DragEvent, targetItem: GroupedListItem<T>, callbacks: {
26
+ handleDragStart: (e: DragEvent, item: RowDragItem<T>) => void;
27
+ handleDragOver: (e: DragEvent, targetItem: RowDragItem<T>) => void;
28
+ handleDrop: (e: DragEvent, targetItem: RowDragItem<T>, callbacks: {
28
29
  onReorder?: (payload: RowReorderPayload) => void;
29
30
  onGroupChange?: (payload: RowGroupChangePayload) => void;
30
31
  }) => void;
31
32
  handleDragEnd: () => void;
32
33
  };
34
+ export {};