@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,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)),
@@ -1,7 +1,10 @@
1
1
  import { Ref } from 'vue';
2
- import { TableColumn } from '../types';
2
+ import { Density, TableColumn } from '../types';
3
3
  export interface UseColumnResizeOptions {
4
4
  columns: Ref<TableColumn[]>;
5
+ rows?: Ref<ReadonlyArray<Record<string, unknown>>>;
6
+ density?: Ref<Density>;
7
+ sampleSize?: number;
5
8
  /** Minimum column width in px (default 60) */
6
9
  minWidth?: number;
7
10
  /** Called on every mousemove during resize */
@@ -1,58 +1,127 @@
1
- import { ref as o, onUnmounted as b, readonly as a } from "vue";
2
- function E(u) {
3
- const d = u.minWidth ?? 60, m = o(!1), v = o(null), i = o(/* @__PURE__ */ new Map()), f = o(0), h = o(!1);
4
- let n = null, y = "", W = "";
5
- function X(e) {
1
+ import { ref as g, onUnmounted as E, readonly as M } from "vue";
2
+ const z = {
3
+ compact: {
4
+ fillMinWidth: 180,
5
+ basePadding: 18,
6
+ labelPadding: 22,
7
+ autoFitPadding: 18,
8
+ clampMax: 360
9
+ },
10
+ standard: {
11
+ fillMinWidth: 220,
12
+ basePadding: 24,
13
+ labelPadding: 26,
14
+ autoFitPadding: 24,
15
+ clampMax: 420
16
+ },
17
+ comfortable: {
18
+ fillMinWidth: 240,
19
+ basePadding: 28,
20
+ labelPadding: 30,
21
+ autoFitPadding: 30,
22
+ clampMax: 480
23
+ }
24
+ }, F = {
25
+ string: 180,
26
+ number: 110,
27
+ date: 140,
28
+ status: 124,
29
+ priority: 124
30
+ };
31
+ function S(t) {
32
+ return t ?? "standard";
33
+ }
34
+ function k(t) {
35
+ if (t == null) return "";
36
+ if (typeof t == "string") return t;
37
+ if (typeof t == "number" || typeof t == "boolean" || typeof t == "bigint")
38
+ return String(t);
39
+ if (t instanceof Date) return t.toISOString();
40
+ if (Array.isArray(t)) return t.map((a) => k(a)).join(", ");
41
+ if (typeof t == "object")
42
+ try {
43
+ return JSON.stringify(t);
44
+ } catch {
45
+ return String(t);
46
+ }
47
+ return String(t);
48
+ }
49
+ function w(t) {
50
+ let a = 0;
51
+ for (const s of t)
52
+ a += s.charCodeAt(0) <= 127 ? 7 : 14;
53
+ return a;
54
+ }
55
+ function D(t, a, s, m) {
56
+ const i = z[s], h = t.type ? F[t.type] : 168, y = w(t.label) + i.labelPadding, r = a.slice(0, Math.max(1, m));
57
+ let c = 0;
58
+ for (const p of r) {
59
+ const f = k(p[t.key]);
60
+ f && (c = Math.max(c, w(f) + i.basePadding));
61
+ }
62
+ const W = t.key === "id" ? 120 : t.key === "title" ? 220 : t.key === "description" ? 260 : 0, b = Math.max(h, y, c, W, i.fillMinWidth);
63
+ return Math.min(Math.max(b, i.fillMinWidth), i.clampMax);
64
+ }
65
+ function T(t) {
66
+ const a = t.minWidth ?? 60, s = g(!1), m = g(null), i = g(/* @__PURE__ */ new Map()), h = g(0), y = g(!1);
67
+ let r = null, c = "", W = "";
68
+ function b(e) {
69
+ var u, d;
6
70
  if (i.value.has(e))
7
71
  return i.value.get(e);
8
- const t = u.columns.value.find((s) => s.key === e);
9
- return !t || t.width === "fill" ? 200 : t.width ?? 200;
72
+ const n = t.columns.value.find((x) => x.key === e), l = S((u = t.density) == null ? void 0 : u.value), o = z[l];
73
+ return n ? n.width === "fill" ? n.minWidth ?? o.fillMinWidth : typeof n.width == "number" ? n.width : D(
74
+ n,
75
+ ((d = t.rows) == null ? void 0 : d.value) ?? [],
76
+ l,
77
+ t.sampleSize ?? 8
78
+ ) : o.fillMinWidth;
10
79
  }
11
- function w(e) {
12
- var r;
13
- if (!n) return;
14
- const t = e.clientX - n.startX, s = Math.max(d, n.initialWidth + t), l = new Map(i.value);
15
- l.set(n.colKey, s), i.value = l, f.value = e.clientX, (r = u.onResize) == null || r.call(u, n.colKey, s);
80
+ function p(e) {
81
+ var u;
82
+ if (!r) return;
83
+ const n = e.clientX - r.startX, l = Math.max(a, r.initialWidth + n), o = new Map(i.value);
84
+ o.set(r.colKey, l), i.value = o, h.value = e.clientX, (u = t.onResize) == null || u.call(t, r.colKey, l);
16
85
  }
17
- function z() {
18
- n && (document.body.style.cursor = y, document.body.style.userSelect = W, document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", z), m.value = !1, v.value = null, h.value = !1, n = null);
86
+ function f() {
87
+ r && (document.body.style.cursor = c, document.body.style.userSelect = W, document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f), s.value = !1, m.value = null, y.value = !1, r = null);
19
88
  }
20
- function R(e, t) {
21
- e.preventDefault(), e.stopPropagation(), n = {
22
- colKey: t,
89
+ function I(e, n) {
90
+ e.preventDefault(), e.stopPropagation(), r = {
91
+ colKey: n,
23
92
  startX: e.clientX,
24
- initialWidth: X(t)
25
- }, m.value = !0, v.value = t, f.value = e.clientX, h.value = !0, y = document.body.style.cursor, W = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", w), document.addEventListener("mouseup", z);
26
- }
27
- function g(e) {
28
- return X(e);
29
- }
30
- function C(e, t) {
31
- var r;
32
- if (!t) return;
33
- const s = t.querySelectorAll(`[data-col-key="${e}"]`);
34
- let l = d;
35
- if (s.forEach((c) => {
36
- const M = c.firstElementChild;
37
- M && (l = Math.max(l, M.scrollWidth + 24));
38
- }), l > d) {
39
- const c = new Map(i.value);
40
- c.set(e, l), i.value = c, (r = u.onResize) == null || r.call(u, e, l);
93
+ initialWidth: b(n)
94
+ }, s.value = !0, m.value = n, h.value = e.clientX, y.value = !0, c = document.body.style.cursor, W = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", p), document.addEventListener("mouseup", f);
95
+ }
96
+ function X(e) {
97
+ return b(e);
98
+ }
99
+ function R(e, n) {
100
+ var x, C;
101
+ if (!n) return;
102
+ const l = S((x = t.density) == null ? void 0 : x.value), o = z[l].autoFitPadding, u = n.querySelectorAll(`[data-col-key="${e}"]`);
103
+ let d = a;
104
+ if (u.forEach((v) => {
105
+ const P = v.firstElementChild;
106
+ P && (d = Math.max(d, P.scrollWidth + o));
107
+ }), d > a) {
108
+ const v = new Map(i.value);
109
+ v.set(e, d), i.value = v, (C = t.onResize) == null || C.call(t, e, d);
41
110
  }
42
111
  }
43
- return b(() => {
44
- n && z();
112
+ return E(() => {
113
+ r && f();
45
114
  }), {
46
- startResize: R,
47
- isResizing: a(m),
48
- resizingColumn: a(v),
49
- columnWidthOverrides: a(i),
50
- resolvedWidth: g,
51
- autoFitColumn: C,
52
- resizeIndicatorX: a(f),
53
- showResizeIndicator: a(h)
115
+ startResize: I,
116
+ isResizing: M(s),
117
+ resizingColumn: M(m),
118
+ columnWidthOverrides: M(i),
119
+ resolvedWidth: X,
120
+ autoFitColumn: R,
121
+ resizeIndicatorX: M(h),
122
+ showResizeIndicator: M(y)
54
123
  };
55
124
  }
56
125
  export {
57
- E as useColumnResize
126
+ T as useColumnResize
58
127
  };
@@ -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
- 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: {
25
+ dropPosition: Readonly<Ref<"after" | "before" | "into-group", "after" | "before" | "into-group">>;
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 {};
@@ -1,11 +1,11 @@
1
1
  import { ref as c, readonly as D } from "vue";
2
- function y(i) {
2
+ function x(i) {
3
3
  const I = c(!1), u = c(null), g = c(null), s = c("before");
4
- let v = null;
4
+ let p = null;
5
5
  function f(e) {
6
- return (e == null ? void 0 : e.__type) === "group-header";
6
+ return typeof e == "object" && e !== null && "__type" in e && e.__type === "group-header";
7
7
  }
8
- function d(e) {
8
+ function l(e) {
9
9
  return String(e.id ?? "");
10
10
  }
11
11
  function T(e, r) {
@@ -13,61 +13,61 @@ function y(i) {
13
13
  e.preventDefault();
14
14
  return;
15
15
  }
16
- v = r, u.value = d(r), I.value = !0, e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", u.value));
16
+ p = r, u.value = l(r), I.value = !0, e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", u.value));
17
17
  }
18
18
  function R(e, r) {
19
- var l;
20
- if (e.preventDefault(), !v) return;
19
+ var d;
20
+ if (e.preventDefault(), !p) return;
21
21
  if (e.dataTransfer && (e.dataTransfer.dropEffect = "move"), f(r)) {
22
- (l = i.enableCrossGroupDrag) != null && l.value && (g.value = r.id, s.value = "into-group");
22
+ (d = i.enableCrossGroupDrag) != null && d.value && (g.value = r.id, s.value = "into-group");
23
23
  return;
24
24
  }
25
25
  const n = e.currentTarget;
26
26
  if (!n) return;
27
- const t = n.getBoundingClientRect(), p = e.clientY - t.top < t.height / 2;
28
- g.value = d(r), s.value = p ? "before" : "after";
27
+ const t = n.getBoundingClientRect(), v = e.clientY - t.top < t.height / 2;
28
+ g.value = l(r), s.value = v ? "before" : "after";
29
29
  }
30
- function C(e, r, n) {
31
- var o, p, l, w;
32
- if (e.preventDefault(), !v || !u.value) {
30
+ function _(e, r, n) {
31
+ var o, v, d, w;
32
+ if (e.preventDefault(), !p || !u.value) {
33
33
  h();
34
34
  return;
35
35
  }
36
36
  const t = u.value;
37
37
  if (f(r)) {
38
38
  const a = (o = i.groupFieldId) == null ? void 0 : o.value;
39
- a && ((p = i.enableCrossGroupDrag) != null && p.value) && ((l = n.onGroupChange) == null || l.call(n, {
39
+ a && ((v = i.enableCrossGroupDrag) != null && v.value) && ((d = n.onGroupChange) == null || d.call(n, {
40
40
  rowId: t,
41
41
  groupFieldId: a,
42
42
  newValue: r.__groupKey
43
43
  }));
44
44
  } else {
45
- const a = d(r);
45
+ const a = l(r);
46
46
  t !== a && ((w = n.onReorder) == null || w.call(n, {
47
47
  rowId: t,
48
- beforeRowId: s.value === "before" ? a : _(a)
48
+ beforeRowId: s.value === "before" ? a : C(a)
49
49
  }));
50
50
  }
51
51
  h();
52
52
  }
53
- function G() {
53
+ function y() {
54
54
  h();
55
55
  }
56
- function _(e) {
56
+ function C(e) {
57
57
  const r = i.processedItems.value;
58
58
  for (let n = 0; n < r.length; n++) {
59
59
  const t = r[n];
60
- if (!f(t) && d(t) === e) {
60
+ if (!f(t) && l(t) === e) {
61
61
  for (let o = n + 1; o < r.length; o++)
62
62
  if (!f(r[o]))
63
- return d(r[o]);
63
+ return l(r[o]);
64
64
  return null;
65
65
  }
66
66
  }
67
67
  return null;
68
68
  }
69
69
  function h() {
70
- I.value = !1, u.value = null, g.value = null, v = null;
70
+ I.value = !1, u.value = null, g.value = null, p = null;
71
71
  }
72
72
  return {
73
73
  isDragging: D(I),
@@ -76,10 +76,10 @@ function y(i) {
76
76
  dropPosition: D(s),
77
77
  handleDragStart: T,
78
78
  handleDragOver: R,
79
- handleDrop: C,
80
- handleDragEnd: G
79
+ handleDrop: _,
80
+ handleDragEnd: y
81
81
  };
82
82
  }
83
83
  export {
84
- y as useRowDrag
84
+ x as useRowDrag
85
85
  };
@@ -27,7 +27,14 @@ export interface SupabaseFilterBuilder {
27
27
  type?: "plain" | "phrase" | "websearch";
28
28
  }): SupabaseFilterBuilder;
29
29
  or(filters: string): SupabaseFilterBuilder;
30
- then<T>(onfulfilled?: (value: any) => T): Promise<T>;
30
+ then<TResult1 = SupabaseQueryResult>(onfulfilled?: ((value: SupabaseQueryResult) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult1 | PromiseLike<TResult1>) | null): Promise<TResult1>;
31
+ }
32
+ export interface SupabaseQueryResult {
33
+ data: Record<string, unknown>[] | null;
34
+ error: {
35
+ message: string;
36
+ } | null;
37
+ count: number | null;
31
38
  }
32
39
  export interface UseSupabaseProviderOptions {
33
40
  /** Supabase client instance (pass your createClient() result) */
@@ -4,14 +4,16 @@ export interface UseTableDataOptions {
4
4
  tasks?: Ref<Task[] | undefined>;
5
5
  records?: Ref<DataRecord[] | undefined>;
6
6
  }
7
+ type TableRowBase = {
8
+ id: string;
9
+ } & Record<string, unknown>;
7
10
  /**
8
11
  * 将 Task[] 或 DataRecord[] 标准化为统一的行格式 T[]。
9
12
  *
10
13
  * - 优先使用 records:展开 fields 并保留 createdAt/updatedAt/__record 元信息
11
14
  * - 否则使用 tasks(原样透传,不做额外转换)
12
15
  */
13
- export declare function useTableData<T extends {
14
- id: string;
15
- } & Record<string, any>>(options: UseTableDataOptions): {
16
+ export declare function useTableData<T extends TableRowBase>(options: UseTableDataOptions): {
16
17
  rows: import('vue').ComputedRef<T[]>;
17
18
  };
19
+ export {};
@@ -25,9 +25,9 @@ export type GroupHeaderItem = {
25
25
  export type GroupedListItem<T> = (T & {
26
26
  __type: "data-row";
27
27
  }) | GroupHeaderItem;
28
- export declare function useTableGroup<T extends Record<string, any>>(options: UseTableGroupOptions<T>): {
28
+ export declare function useTableGroup<T extends Record<string, unknown>>(options: UseTableGroupOptions<T>): {
29
29
  groupedItems: import('vue').ComputedRef<GroupedListItem<T>[]>;
30
30
  collapsedGroups: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
31
31
  toggleGroup: (groupKey: string) => void;
32
- isGroupHeader: (item: any) => item is GroupHeaderItem;
32
+ isGroupHeader: (item: GroupedListItem<T>) => item is GroupHeaderItem;
33
33
  };
@@ -10,12 +10,40 @@ export interface ViewStorageBackend {
10
10
  export declare function createLocalStorageBackend(): ViewStorageBackend;
11
11
  export interface SupabaseViewBackendOptions {
12
12
  /** Supabase client (最小接口:from().select/insert/update/delete) */
13
- client: {
14
- from(table: string): any;
15
- };
13
+ client: SupabaseViewClientLike;
16
14
  /** 存储视图配置的表名,默认 'view_configs' */
17
15
  tableName?: string;
18
16
  }
17
+ interface SupabaseMutationResult {
18
+ error: {
19
+ message: string;
20
+ } | null;
21
+ }
22
+ interface SupabaseViewRow {
23
+ config: ViewConfig;
24
+ }
25
+ interface SupabaseViewDeleteBuilder extends PromiseLike<SupabaseMutationResult> {
26
+ eq(column: string, value: string): SupabaseViewDeleteBuilder;
27
+ }
28
+ interface SupabaseViewQueryBuilder {
29
+ select(columns: string): SupabaseViewQueryBuilder;
30
+ eq(column: string, value: string): SupabaseViewQueryBuilder;
31
+ order(column: string, options?: {
32
+ ascending?: boolean;
33
+ }): Promise<{
34
+ data: SupabaseViewRow[] | null;
35
+ error: {
36
+ message: string;
37
+ } | null;
38
+ }>;
39
+ upsert(value: Record<string, unknown>, options?: {
40
+ onConflict?: string;
41
+ }): Promise<SupabaseMutationResult>;
42
+ delete(): SupabaseViewDeleteBuilder;
43
+ }
44
+ interface SupabaseViewClientLike {
45
+ from(table: string): SupabaseViewQueryBuilder;
46
+ }
19
47
  export declare function createSupabaseBackend(options: SupabaseViewBackendOptions): ViewStorageBackend;
20
48
  export interface UseViewPersistenceOptions {
21
49
  /** 表 ID */
@@ -96,3 +124,4 @@ export declare function useViewPersistence(options: UseViewPersistenceOptions):
96
124
  duplicateView: (sourceViewId: string, newName: string) => Promise<string>;
97
125
  updateActiveView: (patch: Partial<ViewConfig>) => void;
98
126
  };
127
+ export {};
@@ -4,6 +4,7 @@ export interface UseVirtualListOptions<T> {
4
4
  itemHeight: number | ((index: number) => number);
5
5
  overscan?: number;
6
6
  containerRef: Ref<HTMLElement | null>;
7
+ invalidateKey?: Ref<unknown>;
7
8
  /** Optional callback to measure actual row height after render. When provided, measured heights override itemHeight. */
8
9
  measureRow?: boolean;
9
10
  }