@oneflowui/ui 0.5.5 → 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 +12 -5
  154. package/dist/components/table/DataTable.vue.js +4 -4
  155. package/dist/components/table/DataTable.vue2.js +535 -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 +26 -3
  165. package/dist/components/table/MobileListView.vue.js +2 -2
  166. package/dist/components/table/MobileListView.vue2.js +65 -49
  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,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 {};
@@ -1,48 +1,48 @@
1
- import { ref as w, computed as M, watch as L, onUnmounted as N } from "vue";
2
- function W(I) {
3
- var S;
4
- const { items: n, itemHeight: c, overscan: V = 5, containerRef: B } = I, u = w(0), v = w(0), f = typeof c == "number", m = Math.max(0, V), a = /* @__PURE__ */ new Map(), T = w(0);
1
+ import { ref as w, computed as p, watch as L, getCurrentScope as Q, onScopeDispose as W } from "vue";
2
+ function Z(I) {
3
+ var F;
4
+ const { items: n, itemHeight: c, overscan: V = 5, containerRef: B } = I, s = w(0), f = w(0), v = typeof c == "number", g = Math.max(0, V), a = /* @__PURE__ */ new Map(), T = w(0);
5
5
  let d = null, h = null, r = null;
6
- function U(e) {
7
- return a.has(e) ? a.get(e) : f ? c : c(e);
6
+ function A(e) {
7
+ return a.has(e) ? a.get(e) : v ? c : c(e);
8
8
  }
9
- function A() {
9
+ function D() {
10
10
  !I.measureRow || typeof ResizeObserver > "u" || (h = new ResizeObserver((e) => {
11
11
  let t = !1;
12
12
  for (const l of e) {
13
13
  const i = l.target.dataset.virtualIndex;
14
14
  if (i == null) continue;
15
- const s = parseInt(i, 10), g = l.contentRect.height;
16
- a.get(s) !== g && (a.set(s, g), t = !0);
15
+ const u = parseInt(i, 10), m = l.contentRect.height;
16
+ a.get(u) !== m && (a.set(u, m), t = !0);
17
17
  }
18
18
  t && T.value++;
19
19
  }));
20
20
  }
21
- A();
21
+ D();
22
22
  function P(e, t) {
23
23
  !e || !h || (e.dataset.virtualIndex = String(t), h.observe(e));
24
24
  }
25
- const p = M(() => {
26
- if (T.value, f && a.size === 0) return [];
25
+ const M = p(() => {
26
+ if (T.value, v && a.size === 0) return [];
27
27
  const e = new Array(n.value.length + 1).fill(0);
28
28
  for (let t = 0; t < n.value.length; t += 1)
29
- e[t + 1] = e[t] + Math.max(0, U(t));
29
+ e[t + 1] = e[t] + Math.max(0, A(t));
30
30
  return e;
31
- }), x = M(() => f && a.size === 0 ? n.value.length * c : p.value[n.value.length] ?? 0);
32
- function H(e) {
31
+ }), x = p(() => v && a.size === 0 ? n.value.length * c : M.value[n.value.length] ?? 0);
32
+ function C(e) {
33
33
  const t = Math.max(0, Math.min(e, n.value.length));
34
- return f && a.size === 0 ? t * c : p.value[t] ?? 0;
34
+ return v && a.size === 0 ? t * c : M.value[t] ?? 0;
35
35
  }
36
- function R(e) {
36
+ function H(e) {
37
37
  if (n.value.length === 0) return 0;
38
- if (f && a.size === 0) {
38
+ if (v && a.size === 0) {
39
39
  const i = c;
40
40
  return Math.max(
41
41
  0,
42
42
  Math.min(n.value.length - 1, Math.floor(Math.max(0, e) / i))
43
43
  );
44
44
  }
45
- const t = p.value;
45
+ const t = M.value;
46
46
  let l = 0, o = n.value.length;
47
47
  for (; l < o; ) {
48
48
  const i = Math.floor((l + o) / 2);
@@ -50,23 +50,23 @@ function W(I) {
50
50
  }
51
51
  return Math.max(0, Math.min(l, n.value.length - 1));
52
52
  }
53
- const z = M(() => {
53
+ const R = p(() => {
54
54
  const e = n.value.length;
55
55
  if (e === 0)
56
56
  return { start: 0, end: 0 };
57
- if (v.value <= 0)
58
- return { start: 0, end: Math.min(e, m * 2 + 1) };
59
- if (f && a.size === 0) {
60
- const s = c, g = Math.floor(u.value / s), G = Math.ceil(v.value / s), J = Math.max(0, g - m), K = Math.min(e, g + G + m);
61
- return { start: J, end: K };
57
+ if (f.value <= 0)
58
+ return { start: 0, end: Math.min(e, g * 2 + 1) };
59
+ if (v && a.size === 0) {
60
+ const u = c, m = Math.floor(s.value / u), J = Math.ceil(f.value / u), K = Math.max(0, m - g), N = Math.min(e, m + J + g);
61
+ return { start: K, end: N };
62
62
  }
63
- const t = Math.max(0, u.value), l = t + v.value, o = R(t), i = Math.min(e - 1, R(l));
63
+ const t = Math.max(0, s.value), l = t + f.value, o = H(t), i = Math.min(e - 1, H(l));
64
64
  return {
65
- start: Math.max(0, o - m),
66
- end: Math.min(e, i + m + 1)
65
+ start: Math.max(0, o - g),
66
+ end: Math.min(e, i + g + 1)
67
67
  };
68
- }), Y = M(() => H(z.value.start)), j = M(() => {
69
- const { start: e, end: t } = z.value;
68
+ }), U = p(() => C(R.value.start)), Y = p(() => {
69
+ const { start: e, end: t } = R.value;
70
70
  return n.value.slice(e, t).map((l, o) => ({
71
71
  data: l,
72
72
  index: e + o
@@ -74,67 +74,68 @@ function W(I) {
74
74
  });
75
75
  function b(e) {
76
76
  if (!e) {
77
- u.value = 0, v.value = 0;
77
+ s.value = 0, f.value = 0;
78
78
  return;
79
79
  }
80
- u.value = e.scrollTop, v.value = e.clientHeight;
80
+ s.value = e.scrollTop, f.value = e.clientHeight;
81
81
  }
82
- function C() {
83
- r && (u.value = r.scrollTop);
82
+ function z() {
83
+ r && (s.value = r.scrollTop);
84
84
  }
85
- function y() {
85
+ function S() {
86
86
  d == null || d.disconnect(), d = null;
87
87
  }
88
- function O(e) {
89
- e && e.removeEventListener("scroll", C);
88
+ function y(e) {
89
+ e && e.removeEventListener("scroll", z);
90
90
  }
91
- function k(e) {
91
+ function j(e) {
92
92
  if (!e) {
93
93
  r = null, b(null);
94
94
  return;
95
95
  }
96
- r = e, e.addEventListener("scroll", C, { passive: !0 }), b(e), typeof ResizeObserver < "u" && (d = new ResizeObserver(() => {
96
+ r = e, e.addEventListener("scroll", z, { passive: !0 }), b(e), typeof ResizeObserver < "u" && (d = new ResizeObserver(() => {
97
97
  b(e);
98
98
  }), d.observe(e));
99
99
  }
100
100
  L(
101
101
  B,
102
102
  (e, t) => {
103
- O(t), y(), k(e);
103
+ y(t), S(), j(e);
104
104
  },
105
105
  { immediate: !0 }
106
106
  );
107
- let E = n.value.length, F = n.value.length > 0 ? (S = n.value[0]) == null ? void 0 : S.id : void 0;
107
+ let O = n.value.length, E = n.value.length > 0 ? (F = n.value[0]) == null ? void 0 : F.id : void 0;
108
108
  L(n, (e) => {
109
- var s;
110
- const t = e.length, l = t > 0 ? (s = e[0]) == null ? void 0 : s.id : void 0, o = t === E && l === F;
111
- if (E = t, F = l, o)
109
+ var u;
110
+ const t = e.length, l = t > 0 ? (u = e[0]) == null ? void 0 : u.id : void 0, o = t === O && l === E;
111
+ if (O = t, E = l, o)
112
112
  return;
113
113
  a.clear();
114
- const i = Math.max(0, x.value - v.value);
115
- u.value > i && (u.value = i, r && (r.scrollTop = i));
114
+ const i = Math.max(0, x.value - f.value);
115
+ s.value > i && (s.value = i, r && (r.scrollTop = i));
116
116
  });
117
- function q(e) {
117
+ function k(e) {
118
118
  if (!r || n.value.length === 0) return;
119
- const t = Math.max(0, Math.min(e, n.value.length - 1)), l = H(t);
120
- r.scrollTop = l, u.value = l;
119
+ const t = Math.max(0, Math.min(e, n.value.length - 1)), l = C(t);
120
+ r.scrollTop = l, s.value = l;
121
121
  }
122
- function D() {
122
+ function q() {
123
123
  if (!r) return;
124
124
  const e = Math.max(0, x.value - r.clientHeight);
125
- r.scrollTop = e, u.value = e;
125
+ r.scrollTop = e, s.value = e;
126
126
  }
127
- return N(() => {
128
- O(r), y(), h == null || h.disconnect(), h = null, r = null;
129
- }), {
130
- visibleItems: j,
127
+ const G = () => {
128
+ y(r), S(), h == null || h.disconnect(), h = null, r = null;
129
+ };
130
+ return Q() && W(G), {
131
+ visibleItems: Y,
131
132
  totalHeight: x,
132
- offsetY: Y,
133
- scrollToIndex: q,
134
- scrollToBottom: D,
133
+ offsetY: U,
134
+ scrollToIndex: k,
135
+ scrollToBottom: q,
135
136
  observeRow: P
136
137
  };
137
138
  }
138
139
  export {
139
- W as useVirtualList
140
+ Z as useVirtualList
140
141
  };
package/dist/plugin.js CHANGED
@@ -1,99 +1,98 @@
1
- import m from "./components/field/FieldMarkdownPreview.vue.js";
2
- import t from "./components/ContextMenu/index.vue.js";
1
+ import t from "./components/field/FieldMarkdownPreview.vue.js";
2
+ import i from "./components/ContextMenu/index.vue.js";
3
3
  /* empty css */
4
4
  /* empty css */
5
- import i from "./components/base/ViewTab.vue.js";
6
- import p from "./components/base/ToolbarBtn.vue.js";
7
- import e from "./components/base/AddViewBtn.vue.js";
8
- import a from "./components/base/Badge.vue.js";
9
- import f from "./components/base/RangeSlider.vue.js";
10
- import n from "./components/base/ProgressBar.vue.js";
11
- import l from "./components/base/ButtonGroup.vue.js";
12
- import d from "./components/base/EmptyState.vue.js";
13
- import s from "./components/base/StatisticCard.vue.js";
14
- import b from "./components/base/DropdownMenu.vue.js";
15
- import c from "./components/base/StatusIndicator.vue.js";
16
- import u from "./components/base/Switch.vue.js";
17
- import w from "./components/base/Stepper.vue.js";
18
- import C from "./components/base/Accordion.vue.js";
19
- import T from "./components/base/Avatar.vue.js";
20
- import B from "./components/layout/AppLayout.vue.js";
21
- import S from "./components/layout/Navbar.vue.js";
22
- import g from "./components/layout/Sidebar.vue.js";
23
- import P from "./components/layout/StatusBar.vue.js";
24
- import h from "./components/table/DataTable.vue.js";
25
- import M from "./components/table/TableHeaderRow.vue.js";
26
- import A from "./components/table/TableDataRow.vue.js";
27
- import R from "./components/table/TableGroupRow.vue.js";
28
- import k from "./components/table/NewRowBtn.vue.js";
29
- import D from "./components/table/TableFilterPanel.vue.js";
30
- import y from "./components/table/TableColumnManager.vue.js";
31
- import I from "./components/table/TableToolbar.vue.js";
32
- import G from "./components/table/FieldCell.vue.js";
33
- import F from "./components/table/FieldTypePicker.vue.js";
34
- import V from "./components/table/ColumnHeaderMenu.vue.js";
35
- import _ from "./components/kanban/KanbanBoard.vue.js";
36
- import v from "./components/kanban/KanbanColumn.vue.js";
37
- import L from "./components/kanban/KanbanCard.vue.js";
38
- import x from "./components/kanban/QuickAddRow.vue.js";
39
- import E from "./components/gallery/GalleryView.vue.js";
40
- import H from "./components/gallery/GalleryCard.vue.js";
41
- import K from "./components/timeline/ActivityTimeline.vue.js";
42
- import N from "./components/timeline/GanttTimeline.vue.js";
43
- import U from "./components/timeline/GanttRow.vue.js";
44
- import Q from "./components/editor/ContentBlock.vue.js";
45
- import O from "./components/editor/BlockQuote.vue.js";
46
- import $ from "./components/editor/CodeBlock.vue.js";
47
- import j from "./components/editor/RefLink.vue.js";
48
- import q from "./components/editor/RichTextEditor.vue.js";
49
- import z from "./components/form/FormDesigner.vue.js";
50
- import J from "./components/database/DatabaseView.vue.js";
51
- import W from "./components/auxiliary/ColorPanel.vue.js";
52
- import X from "./components/auxiliary/PersonPanel.vue.js";
53
- import Y from "./components/auxiliary/FileUpload.vue.js";
54
- import Z from "./components/detail/DetailLayout.vue.js";
55
- import rr from "./components/detail/PropPanel.vue.js";
56
- import or from "./components/detail/PropRow.vue.js";
57
- import mr from "./components/detail/CommentItem.vue.js";
58
- import tr from "./components/Dashboard/index.vue.js";
59
- import ir from "./components/Dashboard/charts/BarChart.vue.js";
60
- import pr from "./components/Dashboard/charts/PieChart.vue.js";
61
- import er from "./components/Dashboard/charts/DoughnutChart.vue.js";
62
- import ar from "./components/Dashboard/charts/NumberCard.vue.js";
63
- import fr from "./components/Dashboard/charts/TableChart.vue.js";
64
- import nr from "./components/ai/AiThinking.vue.js";
65
- import lr from "./components/ai/AiStreamingCursor.vue.js";
66
- import dr from "./components/ai/AiMessageBubble.vue.js";
67
- import sr from "./components/ai/UserMessageBubble.vue.js";
68
- import br from "./components/ai/AiMessageList.vue.js";
69
- import cr from "./components/ai/AiSender.vue.js";
70
- import ur from "./components/overlay/Modal.vue.js";
71
- import wr from "./components/overlay/Dialog.vue.js";
72
- import Cr from "./components/overlay/Drawer.vue.js";
73
- import Tr from "./components/overlay/SidePanel.vue.js";
74
- import Br from "./components/toast/ToastContainer.vue.js";
5
+ import p from "./components/base/ViewTab.vue.js";
6
+ import e from "./components/base/ToolbarBtn.vue.js";
7
+ import a from "./components/base/AddViewBtn.vue.js";
8
+ import f from "./components/base/Badge.vue.js";
9
+ import n from "./components/base/RangeSlider.vue.js";
10
+ import l from "./components/base/ProgressBar.vue.js";
11
+ import d from "./components/base/ButtonGroup.vue.js";
12
+ import s from "./components/base/EmptyState.vue.js";
13
+ import b from "./components/base/StatisticCard.vue.js";
14
+ import c from "./components/base/DropdownMenu.vue.js";
15
+ import u from "./components/base/StatusIndicator.vue.js";
16
+ import w from "./components/base/Switch.vue.js";
17
+ import C from "./components/base/Stepper.vue.js";
18
+ import T from "./components/base/Accordion.vue.js";
19
+ import B from "./components/base/Avatar.vue.js";
20
+ import S from "./components/layout/AppLayout.vue.js";
21
+ import g from "./components/layout/Navbar.vue.js";
22
+ import P from "./components/layout/Sidebar.vue.js";
23
+ import h from "./components/layout/StatusBar.vue.js";
24
+ import M from "./components/table/DataTable.vue.js";
25
+ import A from "./components/table/TableHeaderRow.vue.js";
26
+ import R from "./components/table/TableDataRow.vue.js";
27
+ import k from "./components/table/TableGroupRow.vue.js";
28
+ import D from "./components/table/NewRowBtn.vue.js";
29
+ import y from "./components/table/TableFilterPanel.vue.js";
30
+ import I from "./components/table/TableColumnManager.vue.js";
31
+ import G from "./components/table/TableToolbar.vue.js";
32
+ import F from "./components/table/FieldCell.vue.js";
33
+ import V from "./components/table/FieldTypePicker.vue.js";
34
+ import _ from "./components/table/ColumnHeaderMenu.vue.js";
35
+ import v from "./components/kanban/KanbanBoard.vue.js";
36
+ import L from "./components/kanban/KanbanColumn.vue.js";
37
+ import x from "./components/kanban/KanbanCard.vue.js";
38
+ import E from "./components/kanban/QuickAddRow.vue.js";
39
+ import H from "./components/gallery/GalleryView.vue.js";
40
+ import K from "./components/gallery/GalleryCard.vue.js";
41
+ import N from "./components/timeline/ActivityTimeline.vue.js";
42
+ import U from "./components/timeline/GanttTimeline.vue.js";
43
+ import Q from "./components/timeline/GanttRow.vue.js";
44
+ import O from "./components/editor/ContentBlock.vue.js";
45
+ import $ from "./components/editor/BlockQuote.vue.js";
46
+ import j from "./components/editor/CodeBlock.vue.js";
47
+ import q from "./components/editor/RefLink.vue.js";
48
+ import z from "./components/editor/RichTextEditor.vue.js";
49
+ import J from "./components/form/FormDesigner.vue.js";
50
+ import W from "./components/database/DatabaseView.vue.js";
51
+ import X from "./components/auxiliary/ColorPanel.vue.js";
52
+ import Y from "./components/auxiliary/PersonPanel.vue.js";
53
+ import Z from "./components/auxiliary/FileUpload.vue.js";
54
+ import rr from "./components/detail/DetailLayout.vue.js";
55
+ import or from "./components/detail/PropPanel.vue.js";
56
+ import mr from "./components/detail/PropRow.vue.js";
57
+ import tr from "./components/detail/CommentItem.vue.js";
58
+ import ir from "./components/Dashboard/index.vue.js";
59
+ import pr from "./components/Dashboard/charts/BarChart.vue.js";
60
+ import er from "./components/Dashboard/charts/PieChart.vue.js";
61
+ import ar from "./components/Dashboard/charts/DoughnutChart.vue.js";
62
+ import fr from "./components/Dashboard/charts/NumberCard.vue.js";
63
+ import nr from "./components/Dashboard/charts/TableChart.vue.js";
64
+ import lr from "./components/ai/AiThinking.vue.js";
65
+ import dr from "./components/ai/AiStreamingCursor.vue.js";
66
+ import sr from "./components/ai/AiMessageBubble.vue.js";
67
+ import br from "./components/ai/UserMessageBubble.vue.js";
68
+ import cr from "./components/ai/AiMessageList.vue.js";
69
+ import ur from "./components/ai/AiSender.vue.js";
70
+ import wr from "./components/overlay/Modal.vue.js";
71
+ import Cr from "./components/overlay/Dialog.vue.js";
72
+ import Tr from "./components/overlay/Drawer.vue.js";
73
+ import Br from "./components/overlay/SidePanel.vue.js";
74
+ import Sr from "./components/toast/ToastContainer.vue.js";
75
75
  /* empty css */
76
- import Sr from "./components/toast/ToastItem.vue.js";
77
- import gr from "./components/tabs/Tabs.vue.js";
78
- import Pr from "./components/tabs/TabPanel.vue.js";
79
- import hr from "./components/breadcrumb/Breadcrumb.vue.js";
80
- import Mr from "./components/breadcrumb/BreadcrumbItem.vue.js";
81
- import Ar from "./components/mermaid/MermaidChart.vue.js";
82
- import Rr from "./components/split/SplitPane.vue.js";
83
- import kr from "./components/base/RefTag.vue.js";
84
- import Dr from "./components/base/DescBlock.vue.js";
85
- import yr from "./components/base/ViewModeGroup.vue.js";
86
- import Ir from "./components/base/ViewSwitcher.vue.js";
87
- import Gr from "./components/base/SelectBadge.vue.js";
88
- import Fr from "./components/base/ChainItem.vue.js";
89
- import Vr from "./components/base/SectionBlock.vue.js";
90
- import _r from "./components/base/MonitorItem.vue.js";
91
- import vr from "./components/base/StatusSummary.vue.js";
92
- import Lr from "./components/base/InfoCard.vue.js";
93
- import xr from "./components/base/PersonaCard.vue.js";
94
- import Er from "./components/base/SearchHighlight.vue.js";
95
- const Hr = [
96
- i,
76
+ import gr from "./components/toast/ToastItem.vue.js";
77
+ import Pr from "./components/tabs/Tabs.vue.js";
78
+ import hr from "./components/tabs/TabPanel.vue.js";
79
+ import Mr from "./components/breadcrumb/Breadcrumb.vue.js";
80
+ import Ar from "./components/breadcrumb/BreadcrumbItem.vue.js";
81
+ import Rr from "./components/mermaid/MermaidChart.vue.js";
82
+ import kr from "./components/split/SplitPane.vue.js";
83
+ import Dr from "./components/base/RefTag.vue.js";
84
+ import yr from "./components/base/DescBlock.vue.js";
85
+ import Ir from "./components/base/ViewModeGroup.vue.js";
86
+ import Gr from "./components/base/ViewSwitcher.vue.js";
87
+ import Fr from "./components/base/SelectBadge.vue.js";
88
+ import Vr from "./components/base/ChainItem.vue.js";
89
+ import _r from "./components/base/SectionBlock.vue.js";
90
+ import vr from "./components/base/MonitorItem.vue.js";
91
+ import Lr from "./components/base/StatusSummary.vue.js";
92
+ import xr from "./components/base/InfoCard.vue.js";
93
+ import Er from "./components/base/PersonaCard.vue.js";
94
+ import Hr from "./components/base/SearchHighlight.vue.js";
95
+ const Kr = [
97
96
  p,
98
97
  e,
99
98
  a,
@@ -123,8 +122,8 @@ const Hr = [
123
122
  G,
124
123
  F,
125
124
  V,
126
- m,
127
125
  _,
126
+ t,
128
127
  v,
129
128
  L,
130
129
  x,
@@ -175,23 +174,25 @@ const Hr = [
175
174
  Dr,
176
175
  yr,
177
176
  Ir,
178
- t,
179
177
  Gr,
178
+ i,
180
179
  Fr,
181
180
  Vr,
182
181
  _r,
183
182
  vr,
184
183
  Lr,
185
184
  xr,
186
- Er
187
- ], km = {
188
- install(o) {
189
- Hr.forEach((r) => {
190
- o.component(r.name || r.__name || "", r);
185
+ Er,
186
+ Hr
187
+ ], Dm = {
188
+ install(m) {
189
+ Kr.forEach((r) => {
190
+ const o = r;
191
+ m.component(o.name || o.__name || "", r);
191
192
  });
192
193
  }
193
194
  };
194
195
  export {
195
- km as OneflowUI,
196
- km as default
196
+ Dm as OneflowUI,
197
+ Dm as default
197
198
  };