@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,62 +1,67 @@
1
- import { defineComponent as w, computed as c, openBlock as l, createElementBlock as a, normalizeStyle as p, createElementVNode as g, createCommentVNode as d, normalizeClass as k, createTextVNode as x, toDisplayString as s, Fragment as h, renderList as B } from "vue";
1
+ import { defineComponent as k, computed as c, openBlock as a, createElementBlock as r, normalizeStyle as d, createElementVNode as g, createCommentVNode as p, normalizeClass as x, createTextVNode as h, toDisplayString as u, Fragment as B, renderList as K } from "vue";
2
2
  import { resolveBadge as C } from "../../composables/useBadge.js";
3
- const N = {
3
+ const N = ["aria-expanded"], T = {
4
4
  class: "of-table-group-row__cell",
5
5
  role: "gridcell"
6
- }, K = {
6
+ }, D = {
7
7
  key: 0,
8
8
  class: "of-table-group-row__checkbox-spacer"
9
- }, L = {
9
+ }, E = {
10
10
  key: 2,
11
11
  class: "of-table-group-row__label"
12
- }, M = { class: "of-table-group-row__count" }, V = /* @__PURE__ */ w({
13
- name: "TableGroupRow",
12
+ }, L = { class: "of-table-group-row__count" }, V = /* @__PURE__ */ k({
14
13
  __name: "TableGroupRow",
15
14
  props: {
16
15
  groupKey: {},
17
16
  count: {},
18
17
  collapsed: { type: Boolean, default: !1 },
19
- colorMap: {},
18
+ colorMap: { default: void 0 },
20
19
  selectable: { type: Boolean, default: !0 },
21
20
  level: { default: 0 },
22
- aggregations: {}
21
+ aggregations: { default: void 0 }
23
22
  },
24
23
  emits: ["toggle"],
25
- setup(n, { emit: i }) {
26
- const o = n, b = i, r = c(() => o.colorMap ? C(o.groupKey, o.colorMap) : null), m = c(() => o.groupKey || "(空)"), f = c(() => o.level * 16), _ = c(() => o.aggregations ? Object.entries(o.aggregations).map(([u, t]) => {
27
- const [, e] = u.split(":"), y = e === "sum" ? "总计" : e === "avg" ? "平均" : e === "min" ? "最小" : e === "max" ? "最大" : "计数", v = typeof t == "number" && !Number.isInteger(t) ? t.toFixed(2) : String(t);
28
- return { key: u, label: y, value: v };
24
+ setup(n, { emit: f }) {
25
+ const t = n, i = f, s = c(() => t.colorMap ? C(t.groupKey, t.colorMap) : null), b = c(() => t.groupKey || "(空)"), m = c(() => t.level * 16), _ = c(() => t.aggregations ? Object.entries(t.aggregations).map(([e, l]) => {
26
+ const [, o] = e.split(":"), v = o === "sum" ? "总计" : o === "avg" ? "平均" : o === "min" ? "最小" : o === "max" ? "最大" : "计数", w = typeof l == "number" && !Number.isInteger(l) ? l.toFixed(2) : String(l);
27
+ return { key: e, label: v, value: w };
29
28
  }) : []);
30
- return (u, t) => (l(), a("div", {
29
+ function y(e) {
30
+ e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), i("toggle")));
31
+ }
32
+ return (e, l) => (a(), r("div", {
31
33
  class: "of-table-group-row",
32
34
  role: "row",
33
- onClick: t[0] || (t[0] = (e) => b("toggle")),
34
- style: p({ paddingLeft: `${12 + f.value}px` })
35
+ tabindex: "0",
36
+ "aria-expanded": !n.collapsed,
37
+ style: d({ paddingLeft: `${12 + m.value}px` }),
38
+ onClick: l[0] || (l[0] = (o) => i("toggle")),
39
+ onKeydown: y
35
40
  }, [
36
- g("div", N, [
37
- n.selectable ? (l(), a("div", K)) : d("", !0),
41
+ g("div", T, [
42
+ n.selectable ? (a(), r("div", D)) : p("", !0),
38
43
  g("span", {
39
- class: k(["of-table-group-row__chevron", { "of-table-group-row__chevron--collapsed": n.collapsed }])
44
+ class: x(["of-table-group-row__chevron", { "of-table-group-row__chevron--collapsed": n.collapsed }])
40
45
  }, "▼", 2),
41
- r.value ? (l(), a("span", {
46
+ s.value ? (a(), r("span", {
42
47
  key: 1,
43
48
  class: "of-table-group-row__badge",
44
- style: p(r.value.style)
49
+ style: d(s.value.style)
45
50
  }, [
46
- r.value.dot ? (l(), a("span", {
51
+ s.value.dot ? (a(), r("span", {
47
52
  key: 0,
48
53
  class: "of-table-group-row__badge-dot",
49
- style: p({ background: r.value.dot })
50
- }, null, 4)) : d("", !0),
51
- x(" " + s(r.value.label), 1)
52
- ], 4)) : (l(), a("span", L, s(m.value), 1)),
53
- g("span", M, "(" + s(n.count) + ")", 1),
54
- (l(!0), a(h, null, B(_.value, (e) => (l(), a("span", {
55
- key: e.key,
54
+ style: d({ background: s.value.dot })
55
+ }, null, 4)) : p("", !0),
56
+ h(" " + u(s.value.label), 1)
57
+ ], 4)) : (a(), r("span", E, u(b.value), 1)),
58
+ g("span", L, "(" + u(n.count) + ")", 1),
59
+ (a(!0), r(B, null, K(_.value, (o) => (a(), r("span", {
60
+ key: o.key,
56
61
  class: "of-table-group-row__agg"
57
- }, s(e.label) + ": " + s(e.value), 1))), 128))
62
+ }, u(o.label) + ": " + u(o.value), 1))), 128))
58
63
  ])
59
- ], 4));
64
+ ], 44, N));
60
65
  }
61
66
  });
62
67
  export {
@@ -1,4 +1,4 @@
1
- import { TableColumn } from '../../types';
1
+ import { Density, TableColumn } from '../../types';
2
2
  type __VLS_Props = {
3
3
  columns: TableColumn[];
4
4
  selectable?: boolean;
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  enableResize?: boolean;
10
10
  enableFieldMenu?: boolean;
11
11
  enableAddField?: boolean;
12
+ density?: Density;
12
13
  };
13
14
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  sort: (key: string) => any;
@@ -27,6 +28,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
27
28
  "onHeader-dblclick"?: ((colKey: string) => any) | undefined;
28
29
  "onAdd-field"?: (() => any) | undefined;
29
30
  }>, {
31
+ density: Density;
30
32
  selectable: boolean;
31
33
  sortKey: string;
32
34
  sortOrder: "asc" | "desc";
@@ -1,7 +1,7 @@
1
1
  import o from "./TableHeaderRow.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-cbab1336"]]);
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-9b7b027a"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,14 +1,9 @@
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 = {
4
- class: "of-table-header",
5
- role: "row"
6
- }, F = {
7
- key: 0,
8
- class: "of-th of-th-checkbox",
9
- role: "columnheader",
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({
1
+ import { defineComponent as M, computed as u, openBlock as a, createElementBlock as i, normalizeStyle as f, createElementVNode as r, createCommentVNode as k, Fragment as B, renderList as P, withModifiers as c, normalizeClass as W, toDisplayString as D, createBlock as b, unref as h, createVNode as K } from "vue";
2
+ import { ChevronUp as H, ChevronDown as m, Plus as F } from "lucide-vue-next";
3
+ const Y = {
4
+ class: "of-th-checkbox__label",
5
+ for: "of-table-select-all-checkbox"
6
+ }, O = ["checked", "indeterminate"], E = ["aria-sort", "onClick", "onKeydown", "onContextmenu", "onDblclick"], N = { class: "of-th-label" }, R = { class: "of-th-sort-icon" }, T = ["onMousedown", "onDblclick"], V = /* @__PURE__ */ M({
12
7
  __name: "TableHeaderRow",
13
8
  props: {
14
9
  columns: {},
@@ -19,79 +14,137 @@ const D = {
19
14
  indeterminate: { type: Boolean, default: !1 },
20
15
  enableResize: { type: Boolean, default: !1 },
21
16
  enableFieldMenu: { type: Boolean, default: !1 },
22
- enableAddField: { type: Boolean, default: !1 }
17
+ enableAddField: { type: Boolean, default: !1 },
18
+ density: { default: "standard" }
23
19
  },
24
20
  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 };
21
+ setup(t, { emit: x }) {
22
+ const g = t, o = x, v = {
23
+ compact: {
24
+ headerHeight: 32,
25
+ cellPaddingX: 10,
26
+ cellPaddingY: 6,
27
+ addColumnWidth: 32,
28
+ fillMinWidth: 180
29
+ },
30
+ standard: {
31
+ headerHeight: 36,
32
+ cellPaddingX: 12,
33
+ cellPaddingY: 8,
34
+ addColumnWidth: 36,
35
+ fillMinWidth: 220
36
+ },
37
+ comfortable: {
38
+ headerHeight: 40,
39
+ cellPaddingX: 14,
40
+ cellPaddingY: 10,
41
+ addColumnWidth: 40,
42
+ fillMinWidth: 240
31
43
  }
32
- return { width: `${n.width}px`, flexShrink: "0", flexGrow: "0" };
44
+ }, s = u(() => v[g.density]), C = u(() => ({
45
+ minHeight: `${s.value.headerHeight}px`
46
+ })), y = u(() => ({
47
+ padding: `${s.value.cellPaddingY}px ${s.value.cellPaddingX}px`
48
+ })), w = u(() => ({
49
+ ...y.value,
50
+ width: `${s.value.addColumnWidth}px`,
51
+ flexShrink: "0",
52
+ flexGrow: "0"
53
+ }));
54
+ function z(l) {
55
+ const n = y.value;
56
+ if (l.width === "fill") {
57
+ const e = `${l.minWidth ?? s.value.fillMinWidth}px`;
58
+ return { ...n, flex: `1 1 ${e}`, minWidth: e };
59
+ }
60
+ return { ...n, width: `${l.width}px`, flexShrink: "0", flexGrow: "0" };
61
+ }
62
+ function p(l) {
63
+ o("sort", l);
33
64
  }
34
- function m(n) {
35
- a("sort", n);
65
+ function S(l, n) {
66
+ l.target === l.currentTarget && (l.key !== "Enter" && l.key !== " " || (l.preventDefault(), o("sort", n)));
36
67
  }
37
- function b(n, l) {
38
- n.stopPropagation(), a("resize-start", n, l);
68
+ function $(l, n) {
69
+ l.stopPropagation(), o("resize-start", l, n);
39
70
  }
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)
49
- ])) : f("", !0),
50
- (o(!0), s(x, null, z(e.columns, (t) => (o(), s("div", {
51
- key: t.key,
71
+ return (l, n) => (a(), i("div", {
72
+ class: "of-table-header",
73
+ role: "row",
74
+ style: f(C.value)
75
+ }, [
76
+ t.selectable ? (a(), i("div", {
77
+ key: 0,
78
+ class: "of-th of-th-checkbox",
52
79
  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"])
80
+ "aria-label": "选择全部行",
81
+ style: f(y.value)
59
82
  }, [
60
- c("span", O, B(t.label), 1),
61
- c("span", R, [
62
- e.sortKey === t.key && e.sortOrder === "asc" ? (o(), u(d($), {
83
+ r("label", Y, [
84
+ r("input", {
85
+ id: "of-table-select-all-checkbox",
86
+ type: "checkbox",
87
+ class: "of-checkbox",
88
+ checked: t.allSelected,
89
+ indeterminate: t.indeterminate,
90
+ onChange: n[0] || (n[0] = (e) => o("select-all"))
91
+ }, null, 40, O),
92
+ n[3] || (n[3] = r("span", { class: "of-sr-only" }, "选择全部行", -1))
93
+ ])
94
+ ], 4)) : k("", !0),
95
+ (a(!0), i(B, null, P(t.columns, (e) => (a(), i("div", {
96
+ key: e.key,
97
+ role: "columnheader",
98
+ tabindex: "0",
99
+ class: W(["of-th", { "of-th--sortable": !0, "of-th--active": t.sortKey === e.key }]),
100
+ style: f(z(e)),
101
+ "aria-sort": t.sortKey === e.key ? t.sortOrder === "asc" ? "ascending" : "descending" : "none",
102
+ onClick: (d) => p(e.key),
103
+ onKeydown: (d) => S(d, e.key),
104
+ onContextmenu: c((d) => t.enableFieldMenu && o("header-contextmenu", d, e.key), ["prevent"]),
105
+ onDblclick: c((d) => t.enableFieldMenu && o("header-dblclick", e.key), ["stop"])
106
+ }, [
107
+ r("span", N, D(e.label), 1),
108
+ r("span", R, [
109
+ t.sortKey === e.key && t.sortOrder === "asc" ? (a(), b(h(H), {
63
110
  key: 0,
64
111
  size: 12,
65
112
  class: "of-sort-icon-active"
66
- })) : e.sortKey === t.key && e.sortOrder === "desc" ? (o(), u(d(h), {
113
+ })) : t.sortKey === e.key && t.sortOrder === "desc" ? (a(), b(h(m), {
67
114
  key: 1,
68
115
  size: 12,
69
116
  class: "of-sort-icon-active"
70
- })) : (o(), u(d(h), {
117
+ })) : (a(), b(h(m), {
71
118
  key: 2,
72
119
  size: 12,
73
120
  class: "of-sort-icon-idle"
74
121
  }))
75
122
  ]),
76
- e.enableResize ? (o(), s("div", {
123
+ t.enableResize ? (a(), i("button", {
77
124
  key: 0,
125
+ type: "button",
78
126
  class: "of-th-resizer",
79
- onMousedown: (i) => b(i, t.key),
80
- onDblclick: r((i) => a("resize-dblclick", t.key), ["stop"])
81
- }, null, 40, N)) : f("", !0)
82
- ], 46, K))), 128)),
83
- e.enableAddField ? (o(), s("div", {
127
+ "aria-label": "调整列宽",
128
+ onClick: n[1] || (n[1] = c(() => {
129
+ }, ["stop"])),
130
+ onMousedown: (d) => $(d, e.key),
131
+ onDblclick: c((d) => o("resize-dblclick", e.key), ["stop"])
132
+ }, null, 40, T)) : k("", !0)
133
+ ], 46, E))), 128)),
134
+ t.enableAddField ? (a(), i("button", {
84
135
  key: 1,
136
+ type: "button",
85
137
  class: "of-th of-th-add",
86
- role: "columnheader",
138
+ tabindex: "0",
87
139
  "aria-label": "添加字段",
88
- onClick: l[1] || (l[1] = r((t) => a("add-field"), ["stop"]))
140
+ style: f(w.value),
141
+ onClick: n[2] || (n[2] = c((e) => o("add-field"), ["stop"]))
89
142
  }, [
90
- S(d(g), { size: 14 })
91
- ])) : f("", !0)
92
- ]));
143
+ K(h(F), { size: 14 })
144
+ ], 4)) : k("", !0)
145
+ ], 4));
93
146
  }
94
147
  });
95
148
  export {
96
- E as default
149
+ V as default
97
150
  };
@@ -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;