@oneflowui/ui 0.4.3 → 0.5.0

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 (158) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +70 -0
  3. package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
  4. package/dist/components/ContextMenu/index.vue.d.ts +2 -1
  5. package/dist/components/ContextMenu/index.vue.js +2 -2
  6. package/dist/components/ContextMenu/index.vue2.js +37 -36
  7. package/dist/components/base/DropdownMenu.vue.js +2 -2
  8. package/dist/components/base/DropdownMenu.vue2.js +38 -39
  9. package/dist/components/base/MonitorItem.vue.d.ts +1 -1
  10. package/dist/components/base/PersonaCard.vue.d.ts +2 -1
  11. package/dist/components/base/PersonaCard.vue.js +3 -3
  12. package/dist/components/base/PersonaCard.vue2.js +51 -39
  13. package/dist/components/base/RefTag.vue.d.ts +2 -2
  14. package/dist/components/base/RefTag.vue.js +3 -3
  15. package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
  16. package/dist/components/base/SearchHighlight.vue.js +7 -0
  17. package/dist/components/base/SearchHighlight.vue2.js +21 -0
  18. package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
  19. package/dist/components/base/ToolbarBtn.vue.js +1 -1
  20. package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
  21. package/dist/components/base/ViewModeGroup.vue.js +3 -3
  22. package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
  23. package/dist/components/base/ViewSwitcher.vue.js +2 -2
  24. package/dist/components/base/index.d.ts +1 -0
  25. package/dist/components/database/DatabaseView.vue.d.ts +171 -0
  26. package/dist/components/database/DatabaseView.vue.js +7 -0
  27. package/dist/components/database/DatabaseView.vue2.js +774 -0
  28. package/dist/components/database/index.d.ts +2 -0
  29. package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
  30. package/dist/components/field/FieldAttachment.vue.js +7 -0
  31. package/dist/components/field/FieldAttachment.vue2.js +69 -0
  32. package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
  33. package/dist/components/field/FieldAutoNumber.vue.js +7 -0
  34. package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
  35. package/dist/components/field/FieldCreator.vue.d.ts +7 -0
  36. package/dist/components/field/FieldCreator.vue.js +7 -0
  37. package/dist/components/field/FieldCreator.vue2.js +24 -0
  38. package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
  39. package/dist/components/field/FieldCurrency.vue.js +7 -0
  40. package/dist/components/field/FieldCurrency.vue2.js +42 -0
  41. package/dist/components/field/FieldDate.vue.js +2 -2
  42. package/dist/components/field/FieldDate.vue2.js +13 -10
  43. package/dist/components/field/FieldDatetime.vue.js +1 -1
  44. package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
  45. package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
  46. package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
  47. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  48. package/dist/components/field/FieldPhone.vue.d.ts +17 -0
  49. package/dist/components/field/FieldPhone.vue.js +7 -0
  50. package/dist/components/field/FieldPhone.vue2.js +34 -0
  51. package/dist/components/field/FieldProgress.vue.d.ts +15 -0
  52. package/dist/components/field/FieldProgress.vue.js +7 -0
  53. package/dist/components/field/FieldProgress.vue2.js +40 -0
  54. package/dist/components/field/FieldRelation.vue.d.ts +17 -0
  55. package/dist/components/field/FieldRelation.vue.js +7 -0
  56. package/dist/components/field/FieldRelation.vue2.js +67 -0
  57. package/dist/components/field/FieldRichText.vue.d.ts +17 -0
  58. package/dist/components/field/FieldRichText.vue.js +7 -0
  59. package/dist/components/field/FieldRichText.vue2.js +65 -0
  60. package/dist/components/field/FieldSelect.vue.js +1 -1
  61. package/dist/components/field/FieldSelect.vue2.js +43 -42
  62. package/dist/components/form/FormDesigner.vue.js +2 -2
  63. package/dist/components/form/FormDesigner.vue2.js +62 -52
  64. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  65. package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
  66. package/dist/components/gallery/GalleryView.vue.js +2 -2
  67. package/dist/components/gallery/GalleryView.vue2.js +30 -20
  68. package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
  69. package/dist/components/kanban/KanbanBoard.vue.js +4 -4
  70. package/dist/components/kanban/KanbanBoard.vue2.js +81 -48
  71. package/dist/components/layout/AppLayout.vue.js +2 -2
  72. package/dist/components/layout/AppLayout.vue2.js +46 -62
  73. package/dist/components/overlay/Drawer.vue.js +1 -1
  74. package/dist/components/overlay/Drawer.vue2.js +52 -68
  75. package/dist/components/overlay/Modal.vue.js +1 -1
  76. package/dist/components/overlay/Modal.vue2.js +52 -68
  77. package/dist/components/overlay/SidePanel.vue.js +2 -2
  78. package/dist/components/overlay/SidePanel.vue2.js +64 -80
  79. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
  80. package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
  81. package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
  82. package/dist/components/table/DataTable.vue.d.ts +116 -25
  83. package/dist/components/table/DataTable.vue.js +4 -4
  84. package/dist/components/table/DataTable.vue2.js +775 -188
  85. package/dist/components/table/DetailSheet.vue.d.ts +43 -0
  86. package/dist/components/table/DetailSheet.vue.js +7 -0
  87. package/dist/components/table/DetailSheet.vue2.js +140 -0
  88. package/dist/components/table/FieldCell.vue.d.ts +1 -1
  89. package/dist/components/table/FieldCell.vue.js +1 -1
  90. package/dist/components/table/FieldCell.vue2.js +59 -44
  91. package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
  92. package/dist/components/table/FieldTypePicker.vue.js +7 -0
  93. package/dist/components/table/FieldTypePicker.vue2.js +92 -0
  94. package/dist/components/table/MobileListView.vue.d.ts +24 -0
  95. package/dist/components/table/MobileListView.vue.js +7 -0
  96. package/dist/components/table/MobileListView.vue2.js +90 -0
  97. package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
  98. package/dist/components/table/TableGroupRow.vue.js +2 -2
  99. package/dist/components/table/TableGroupRow.vue2.js +33 -23
  100. package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
  101. package/dist/components/table/TableHeaderRow.vue.js +2 -2
  102. package/dist/components/table/TableHeaderRow.vue2.js +54 -33
  103. package/dist/components/table/TableToolbar.vue.d.ts +118 -0
  104. package/dist/components/table/TableToolbar.vue.js +7 -0
  105. package/dist/components/table/TableToolbar.vue2.js +273 -0
  106. package/dist/components/table/index.d.ts +5 -0
  107. package/dist/components/timeline/GanttTimeline.vue.js +1 -1
  108. package/dist/components/timeline/GanttTimeline.vue2.js +128 -127
  109. package/dist/components/toast/ToastItem.vue.js +3 -3
  110. package/dist/composables/index.d.ts +21 -0
  111. package/dist/composables/useBreakpoint.d.ts +2 -1
  112. package/dist/composables/useBreakpoint.js +14 -12
  113. package/dist/composables/useColumnResize.d.ts +19 -0
  114. package/dist/composables/useColumnResize.js +58 -0
  115. package/dist/composables/useDatabaseView.d.ts +138 -0
  116. package/dist/composables/useDatabaseView.js +388 -0
  117. package/dist/composables/useDraftRows.d.ts +33 -0
  118. package/dist/composables/useDraftRows.js +103 -0
  119. package/dist/composables/useFixedColumns.d.ts +25 -0
  120. package/dist/composables/useFixedColumns.js +61 -0
  121. package/dist/composables/useFocusTrap.d.ts +10 -0
  122. package/dist/composables/useFocusTrap.js +37 -0
  123. package/dist/composables/useInlineEdit.js +3 -3
  124. package/dist/composables/useKeyboardNavigation.d.ts +45 -0
  125. package/dist/composables/useKeyboardNavigation.js +140 -0
  126. package/dist/composables/useRowDrag.d.ts +32 -0
  127. package/dist/composables/useRowDrag.js +85 -0
  128. package/dist/composables/useSchemaEngine.d.ts +31 -0
  129. package/dist/composables/useSchemaEngine.js +129 -0
  130. package/dist/composables/useSearch.d.ts +30 -0
  131. package/dist/composables/useSearch.js +59 -0
  132. package/dist/composables/useSupabaseProvider.d.ts +70 -0
  133. package/dist/composables/useSupabaseProvider.js +126 -0
  134. package/dist/composables/useTable.d.ts +3 -0
  135. package/dist/composables/useTable.js +103 -83
  136. package/dist/composables/useTableGroup.d.ts +14 -1
  137. package/dist/composables/useTableGroup.js +57 -33
  138. package/dist/composables/useViewPersistence.d.ts +98 -0
  139. package/dist/composables/useViewPersistence.js +141 -0
  140. package/dist/composables/useVirtualList.d.ts +4 -1
  141. package/dist/composables/useVirtualList.js +108 -85
  142. package/dist/composables/useWorkerSort.d.ts +14 -0
  143. package/dist/composables/useWorkerSort.js +61 -0
  144. package/dist/index.d.ts +32 -4
  145. package/dist/index.js +274 -221
  146. package/dist/style.css +1 -1
  147. package/dist/tests/database-view.integration.spec.d.ts +1 -0
  148. package/dist/types/index.d.ts +63 -2
  149. package/dist/types/index.js +23 -6
  150. package/dist/types/table-internal.d.ts +64 -0
  151. package/dist/utils/aggregation.d.ts +5 -0
  152. package/dist/utils/aggregation.js +38 -0
  153. package/dist/utils/supabaseAdapter.d.ts +48 -0
  154. package/dist/utils/supabaseAdapter.js +76 -0
  155. package/dist/utils/supabaseSchema.d.ts +81 -0
  156. package/dist/utils/supabaseSchema.js +202 -0
  157. package/dist/workers/tableWorker.d.ts +31 -0
  158. package/package.json +17 -17
package/README.en.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/@oneflowui/ui.svg)](https://www.npmjs.com/package/@oneflowui/ui)
5
5
  [![license](https://img.shields.io/npm/l/@oneflowui/ui.svg)](https://github.com/qixi54/oneui/blob/main/LICENSE)
6
6
 
7
- A **Vue 3 + TypeScript** component library for building task management and productivity applications. Ships **75+ ready-to-use components** covering views, AI chat, dashboards, editors, and more.
7
+ A **Vue 3 + TypeScript** UI library for building task management and productivity applications. It now includes a page-level `DatabaseView` solution on top of the component layer.
8
8
 
9
9
  > [中文文档](./README.md)
10
10
 
package/README.md CHANGED
@@ -97,6 +97,76 @@ import '@oneflowui/ui/styles'
97
97
 
98
98
  ---
99
99
 
100
+ ## 页面级方案
101
+
102
+ 当前已经支持直接从包里接入页面级入口:
103
+
104
+ ```ts
105
+ import { DatabaseView, useDatabaseView } from '@oneflowui/ui'
106
+ ```
107
+
108
+ `DatabaseView` 负责统一页面容器,`useDatabaseView` 负责页面状态编排。`dev` app 也已经接入这条链路,
109
+ 用于证明 `local/provider` 双模式、视图切换、selected record 与 detail workspace 可以在同一页面层里闭环。
110
+
111
+ ```ts
112
+ const view = useDatabaseView({
113
+ mode: 'provider',
114
+ schemaSource,
115
+ dataSource,
116
+ actions: {
117
+ onFetch,
118
+ onRefresh,
119
+ onUpdateRecord,
120
+ onCreateRecord,
121
+ onDeleteRecord,
122
+ onSaveView,
123
+ onSchemaChange,
124
+ },
125
+ })
126
+ ```
127
+
128
+ ### 模式
129
+
130
+ - `local` 模式:外部直接传 `schema + records + view`,页面只负责筛选、排序、切视图和展示状态,不触发远程请求。
131
+ - `provider` 模式:外部传入数据获取/刷新能力,页面 shell 只消费 provider 返回的 `schema / records / views`,不绑定具体后端实现。
132
+
133
+ ### actions 契约
134
+
135
+ 页面级方案只回传动作,不在组件内部写死业务逻辑。常见契约如下:
136
+
137
+ ```ts
138
+ type DatabaseViewActions = {
139
+ onFetch?: (params: { viewId: string }) => Promise<void> | void
140
+ onRefresh?: () => Promise<void> | void
141
+ onUpdateRecord?: (recordId: string, patch: Record<string, unknown>) => Promise<void> | void
142
+ onCreateRecord?: (record: Record<string, unknown>) => Promise<void> | void
143
+ onDeleteRecord?: (recordId: string) => Promise<void> | void
144
+ onSaveView?: (viewId: string, payload: Record<string, unknown>) => Promise<void> | void
145
+ onSchemaChange?: (payload: Record<string, unknown>) => Promise<void> | void
146
+ }
147
+ ```
148
+
149
+ 如果接入的是 `provider` 模式,建议把 `onFetch` / `onRefresh` 作为必配项;如果接入的是 `local` 模式,则重点只需要保证 `onUpdateRecord`、`onCreateRecord`、`onDeleteRecord` 和 `onSaveView` 这几类页面动作可回传。
150
+
151
+ ### Selected record / detail workspace
152
+
153
+ 当前 dev app 已经把“选中记录 -> detail workspace”这条链路接起来了:点击 table / kanban / gallery / timeline 中的条目,会把当前记录送入详情工作区,再由 `DetailLayout`、`PropPanel`、`CommentItem` 这组组件展示主内容、属性和活动记录。
154
+
155
+ 这证明页面级方案已经具备“列表视图 + 选中态 + 详情工作区”的最小闭环,并且可以作为业务页面底座直接接入。
156
+
157
+ ### 已支持 / 暂未支持
158
+
159
+ | 已支持 | 暂未支持 |
160
+ |---|---|
161
+ | `local/provider` 两种模式的页面壳层接入 | 真实 provider 数据闭环、权限与持久化策略 |
162
+ | `normal / loading / empty / error` 四态透传 | 写操作的最终落库与回滚编排 |
163
+ | `table / kanban / gallery / timeline` 多视图切换 | 可编辑 detail workspace 的最终保存、ACL、schema 管理后台 |
164
+ | `search / filter / sort / group / save-view / load-view` 工具栏契约 | 远程视图保存、跨端同步与更重的页面编排 |
165
+ | `schema + records + viewConfig` 数据驱动 | 业务应用侧自定义的 provider 适配层 |
166
+ | `selected record -> detail workspace` 页面链路 | detail 编辑后的最终提交、乐观更新、冲突处理 |
167
+
168
+ ---
169
+
100
170
  ## 组件一览
101
171
 
102
172
  | 分类 | 组件 |
@@ -0,0 +1 @@
1
+ (function(){"use strict";function i(r,e,t){return[...r].sort((s,u)=>{const n=s[e],a=u[e];if(n==null&&a==null)return 0;if(n==null)return 1;if(a==null)return-1;if(typeof n=="number"&&typeof a=="number")return t==="asc"?n-a:a-n;const l=String(n),o=String(a);return t==="asc"?l.localeCompare(o):o.localeCompare(l)})}function c(r,e){const t=String(r??"").toLowerCase(),s=e.value.toLowerCase();switch(e.operator){case"equals":return t===s;case"not_equals":return t!==s;case"contains":return t.includes(s);case"not_contains":return!t.includes(s);case"starts_with":return t.startsWith(s);case"ends_with":return t.endsWith(s);case"is_empty":return t===""||r==null;case"is_not_empty":return t!==""&&r!=null;case"gt":return Number(r)>Number(e.value);case"gte":return Number(r)>=Number(e.value);case"lt":return Number(r)<Number(e.value);case"lte":return Number(r)<=Number(e.value);default:return!0}}function f(r,e,t){return e.length===0?r:r.filter(s=>{const u=e.map(n=>n.field?c(s[n.field],n):!0);return t==="and"?u.every(Boolean):u.some(Boolean)})}self.onmessage=r=>{try{const e=r.data;if(e.type==="sort"){const t=i(e.data,e.field,e.order);self.postMessage({type:"sort-result",data:t})}else if(e.type==="filter"){const t=f(e.data,e.conditions,e.logic);self.postMessage({type:"filter-result",data:t})}}catch(e){self.postMessage({type:"error",message:e instanceof Error?e.message:String(e)})}}})();
@@ -1,7 +1,8 @@
1
+ import { Component } from 'vue';
1
2
  export interface ContextMenuItem {
2
3
  key: string;
3
4
  label: string;
4
- icon?: string;
5
+ icon?: string | Component;
5
6
  disabled?: boolean;
6
7
  danger?: boolean;
7
8
  separator?: boolean;
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e1a1d45d"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-58bfadd1"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,14 +1,12 @@
1
- import { defineComponent as x, ref as h, computed as w, watch as g, onBeforeUnmount as E, openBlock as t, createBlock as L, Teleport as C, createElementBlock as o, withModifiers as B, normalizeStyle as D, Fragment as p, renderList as M, normalizeClass as S, toDisplayString as y, createCommentVNode as a, createElementVNode as $ } from "vue";
2
- const z = {
1
+ import { defineComponent as x, ref as h, computed as w, watch as g, onBeforeUnmount as C, openBlock as t, createBlock as p, Teleport as E, createElementBlock as o, withModifiers as L, normalizeStyle as B, Fragment as y, renderList as D, normalizeClass as M, resolveDynamicComponent as S, unref as $, createCommentVNode as a, createElementVNode as z, toDisplayString as N } from "vue";
2
+ import { resolveIcon as R } from "../../utils/icon.js";
3
+ const V = {
3
4
  key: 0,
4
5
  class: "of-context-menu__sep"
5
- }, N = ["disabled", "onClick"], R = {
6
- key: 0,
7
- class: "of-context-menu__icon"
8
- }, V = { class: "of-context-menu__label" }, F = {
6
+ }, F = ["disabled", "onClick"], I = { class: "of-context-menu__label" }, K = {
9
7
  key: 1,
10
8
  class: "of-context-menu__submenu-indicator"
11
- }, U = /* @__PURE__ */ x({
9
+ }, q = /* @__PURE__ */ x({
12
10
  name: "ContextMenu",
13
11
  __name: "index",
14
12
  props: {
@@ -19,67 +17,70 @@ const z = {
19
17
  },
20
18
  emits: ["select", "close"],
21
19
  setup(l, { emit: _ }) {
22
- const i = l, c = _, r = h(null), k = w(() => ({
20
+ const c = l, r = _, i = h(null), k = w(() => ({
23
21
  position: "fixed",
24
- left: `${i.x}px`,
25
- top: `${i.y}px`
22
+ left: `${c.x}px`,
23
+ top: `${c.y}px`
26
24
  }));
27
- function b(e) {
28
- e.disabled || e.separator || (c("select", e.key), c("close"));
25
+ function v(e) {
26
+ e.disabled || e.separator || (r("select", e.key), r("close"));
29
27
  }
30
- function d(e) {
28
+ function u(e) {
31
29
  const s = e.target;
32
- r.value && s && !r.value.contains(s) && c("close");
30
+ i.value && s && !i.value.contains(s) && r("close");
33
31
  }
34
- function u(e) {
35
- e.key === "Escape" && c("close");
32
+ function d(e) {
33
+ e.key === "Escape" && r("close");
36
34
  }
37
- function v() {
38
- document.addEventListener("mousedown", d), document.addEventListener("keydown", u);
35
+ function b() {
36
+ document.addEventListener("mousedown", u), document.addEventListener("keydown", d);
39
37
  }
40
38
  function m() {
41
- document.removeEventListener("mousedown", d), document.removeEventListener("keydown", u);
39
+ document.removeEventListener("mousedown", u), document.removeEventListener("keydown", d);
42
40
  }
43
41
  return g(
44
- () => i.visible,
42
+ () => c.visible,
45
43
  (e) => {
46
44
  if (e) {
47
- v();
45
+ b();
48
46
  return;
49
47
  }
50
48
  m();
51
49
  },
52
50
  { immediate: !0 }
53
- ), E(() => {
51
+ ), C(() => {
54
52
  m();
55
- }), (e, s) => (t(), L(C, { to: "body" }, [
53
+ }), (e, s) => (t(), p(E, { to: "body" }, [
56
54
  l.visible ? (t(), o("div", {
57
55
  key: 0,
58
56
  ref_key: "menuRef",
59
- ref: r,
57
+ ref: i,
60
58
  class: "of-context-menu",
61
- style: D(k.value),
59
+ style: B(k.value),
62
60
  role: "menu",
63
- onMousedown: s[0] || (s[0] = B(() => {
61
+ onMousedown: s[0] || (s[0] = L(() => {
64
62
  }, ["stop"]))
65
63
  }, [
66
- (t(!0), o(p, null, M(l.items, (n) => {
64
+ (t(!0), o(y, null, D(l.items, (n) => {
67
65
  var f;
68
- return t(), o(p, {
66
+ return t(), o(y, {
69
67
  key: n.key
70
68
  }, [
71
- n.separator ? (t(), o("hr", z)) : (t(), o("button", {
69
+ n.separator ? (t(), o("hr", V)) : (t(), o("button", {
72
70
  key: 1,
73
71
  type: "button",
74
- class: S(["of-context-menu__item", { "is-disabled": n.disabled, "is-danger": n.danger }]),
72
+ class: M(["of-context-menu__item", { "is-disabled": n.disabled, "is-danger": n.danger }]),
75
73
  disabled: n.disabled,
76
74
  role: "menuitem",
77
- onClick: (K) => b(n)
75
+ onClick: (T) => v(n)
78
76
  }, [
79
- n.icon ? (t(), o("span", R, y(n.icon), 1)) : a("", !0),
80
- $("span", V, y(n.label), 1),
81
- (f = n.children) != null && f.length ? (t(), o("span", F, "›")) : a("", !0)
82
- ], 10, N))
77
+ n.icon ? (t(), p(S($(R)(n.icon)), {
78
+ key: 0,
79
+ class: "of-context-menu__icon"
80
+ })) : a("", !0),
81
+ z("span", I, N(n.label), 1),
82
+ (f = n.children) != null && f.length ? (t(), o("span", K, "›")) : a("", !0)
83
+ ], 10, F))
83
84
  ], 64);
84
85
  }), 128))
85
86
  ], 36)) : a("", !0)
@@ -87,5 +88,5 @@ const z = {
87
88
  }
88
89
  });
89
90
  export {
90
- U as default
91
+ q as default
91
92
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./DropdownMenu.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-876336db"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-2c7dd355"]]);
5
5
  export {
6
- _ as default
6
+ m as default
7
7
  };
@@ -1,86 +1,85 @@
1
- import { defineComponent as C, ref as l, onMounted as h, onBeforeUnmount as b, openBlock as r, createElementBlock as a, mergeProps as x, createElementVNode as f, createVNode as i, unref as m, Transition as p, withCtx as v, createCommentVNode as s, Fragment as E, renderList as M, normalizeClass as B, createBlock as R, resolveDynamicComponent as z, toDisplayString as D, nextTick as L } from "vue";
2
- import { MoreHorizontal as N } from "lucide-vue-next";
3
- import { resolveIcon as V } from "../../utils/icon.js";
4
- const $ = ["aria-expanded"], S = ["onClick"], H = /* @__PURE__ */ C({
1
+ import { defineComponent as C, ref as s, onBeforeUnmount as E, openBlock as r, createElementBlock as l, mergeProps as h, createElementVNode as f, createVNode as d, unref as m, Transition as p, withCtx as v, createCommentVNode as i, Fragment as L, renderList as b, normalizeClass as x, createBlock as B, resolveDynamicComponent as M, toDisplayString as R, nextTick as z } from "vue";
2
+ import { MoreHorizontal as D } from "lucide-vue-next";
3
+ import { resolveIcon as N } from "../../utils/icon.js";
4
+ const V = ["aria-expanded"], $ = ["onClick"], F = /* @__PURE__ */ C({
5
5
  inheritAttrs: !1,
6
6
  __name: "DropdownMenu",
7
7
  props: {
8
8
  items: {}
9
9
  },
10
10
  setup(_) {
11
- const n = l(!1), u = l(null), d = l(null);
12
- function c(e) {
11
+ const n = s(!1), a = s(null), c = s(null);
12
+ function u(e) {
13
13
  var o;
14
- e.key === "Escape" && n.value && (n.value = !1, (o = u.value) == null || o.focus());
14
+ e.key === "Escape" && n.value && (n.value = !1, (o = a.value) == null || o.focus());
15
15
  }
16
- h(() => {
17
- typeof document > "u" || document.addEventListener("keydown", c);
18
- }), b(() => {
19
- typeof document > "u" || document.removeEventListener("keydown", c);
16
+ E(() => {
17
+ typeof document > "u" || document.removeEventListener("keydown", u);
20
18
  });
21
19
  function k(e) {
22
20
  var o;
23
- e.onClick(), n.value = !1, (o = u.value) == null || o.focus();
21
+ e.onClick(), n.value = !1, document.removeEventListener("keydown", u), (o = a.value) == null || o.focus();
24
22
  }
25
- function y() {
23
+ function w() {
26
24
  var e;
27
- n.value = !n.value, n.value ? L(() => {
25
+ n.value = !n.value, n.value ? z(() => {
28
26
  var t;
29
- const o = (t = d.value) == null ? void 0 : t.querySelector('[role="menuitem"]');
27
+ document.addEventListener("keydown", u);
28
+ const o = (t = c.value) == null ? void 0 : t.querySelector('[role="menuitem"]');
30
29
  o == null || o.focus();
31
- }) : (e = u.value) == null || e.focus();
30
+ }) : (document.removeEventListener("keydown", u), (e = a.value) == null || e.focus());
32
31
  }
33
- function w() {
32
+ function y() {
34
33
  var e;
35
- n.value = !1, (e = u.value) == null || e.focus();
34
+ n.value = !1, document.removeEventListener("keydown", u), (e = a.value) == null || e.focus();
36
35
  }
37
- return (e, o) => (r(), a("div", x({ class: "of-dropdown-menu" }, e.$attrs), [
36
+ return (e, o) => (r(), l("div", h({ class: "of-dropdown-menu" }, e.$attrs), [
38
37
  f("button", {
39
38
  ref_key: "triggerRef",
40
- ref: u,
39
+ ref: a,
41
40
  class: "of-dropdown-menu__trigger",
42
41
  "aria-haspopup": "true",
43
42
  "aria-expanded": n.value,
44
43
  "aria-label": "更多操作",
45
- onClick: y
44
+ onClick: w
46
45
  }, [
47
- i(m(N), { size: 18 })
48
- ], 8, $),
49
- i(p, { name: "of-dropdown-fade" }, {
46
+ d(m(D), { size: 18 })
47
+ ], 8, V),
48
+ d(p, { name: "of-dropdown-fade" }, {
50
49
  default: v(() => [
51
- n.value ? (r(), a("div", {
50
+ n.value ? (r(), l("div", {
52
51
  key: 0,
53
52
  class: "of-dropdown-menu__backdrop",
54
- onClick: w
55
- })) : s("", !0)
53
+ onClick: y
54
+ })) : i("", !0)
56
55
  ]),
57
56
  _: 1
58
57
  }),
59
- i(p, { name: "of-dropdown-slide" }, {
58
+ d(p, { name: "of-dropdown-slide" }, {
60
59
  default: v(() => [
61
- n.value ? (r(), a("div", {
60
+ n.value ? (r(), l("div", {
62
61
  key: 0,
63
62
  ref_key: "menuRef",
64
- ref: d,
63
+ ref: c,
65
64
  class: "of-dropdown-menu__content",
66
65
  role: "menu"
67
66
  }, [
68
- (r(!0), a(E, null, M(_.items, (t, g) => (r(), a("button", {
67
+ (r(!0), l(L, null, b(_.items, (t, g) => (r(), l("button", {
69
68
  key: g,
70
- onClick: (T) => k(t),
71
- class: B([
69
+ onClick: (S) => k(t),
70
+ class: x([
72
71
  "of-dropdown-menu__item",
73
72
  `of-dropdown-menu__item--${t.variant || "default"}`
74
73
  ]),
75
74
  role: "menuitem"
76
75
  }, [
77
- t.icon ? (r(), R(z(m(V)(t.icon)), {
76
+ t.icon ? (r(), B(M(m(N)(t.icon)), {
78
77
  key: 0,
79
78
  class: "of-dropdown-menu__item-icon"
80
- })) : s("", !0),
81
- f("span", null, D(t.label), 1)
82
- ], 10, S))), 128))
83
- ], 512)) : s("", !0)
79
+ })) : i("", !0),
80
+ f("span", null, R(t.label), 1)
81
+ ], 10, $))), 128))
82
+ ], 512)) : i("", !0)
84
83
  ]),
85
84
  _: 1
86
85
  })
@@ -88,5 +87,5 @@ const $ = ["aria-expanded"], S = ["onClick"], H = /* @__PURE__ */ C({
88
87
  }
89
88
  });
90
89
  export {
91
- H as default
90
+ F as default
92
91
  };
@@ -11,9 +11,9 @@ declare const _default: import('vue').DefineComponent<MonitorItemProps, {}, {},
11
11
  }, string, import('vue').PublicProps, Readonly<MonitorItemProps> & Readonly<{
12
12
  onClick?: (() => any) | undefined;
13
13
  }>, {
14
+ count: string;
14
15
  color: string;
15
16
  clickable: boolean;
16
17
  subtitle: string;
17
- count: string;
18
18
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
19
  export default _default;
@@ -1,7 +1,8 @@
1
+ import { Component } from 'vue';
1
2
  export interface PersonaCardProps {
2
3
  name: string;
3
4
  title?: string;
4
- icon?: string;
5
+ icon?: string | Component;
5
6
  color?: string;
6
7
  subtitle?: string;
7
8
  tags?: string[];
@@ -1,7 +1,7 @@
1
1
  import o from "./PersonaCard.vue2.js";
2
2
  /* empty css */
3
- import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-88e46628"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-0c8a7d5a"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,17 +1,18 @@
1
- import { defineComponent as C, computed as o, openBlock as t, createElementBlock as n, mergeProps as P, createElementVNode as c, normalizeStyle as f, toDisplayString as l, renderSlot as b, createCommentVNode as i, Fragment as w, renderList as A } from "vue";
2
- const E = { class: "of-persona-card__body" }, F = { class: "of-persona-card__name-row" }, L = {
1
+ import { defineComponent as w, computed as r, openBlock as t, createElementBlock as n, mergeProps as A, createElementVNode as c, normalizeStyle as f, createBlock as E, resolveDynamicComponent as F, Fragment as y, createTextVNode as N, toDisplayString as l, renderSlot as b, createCommentVNode as i, renderList as T } from "vue";
2
+ import { resolveIcon as V } from "../../utils/icon.js";
3
+ const D = { class: "of-persona-card__body" }, I = { class: "of-persona-card__name-row" }, L = {
3
4
  key: 0,
4
5
  class: "of-persona-card__title-badge"
5
- }, N = {
6
+ }, H = {
6
7
  key: 1,
7
8
  class: "of-persona-card__tags"
8
- }, T = { class: "of-persona-card__right" }, V = {
9
+ }, M = { class: "of-persona-card__right" }, j = {
9
10
  key: 0,
10
11
  class: "of-persona-card__done-mark"
11
- }, D = { class: "of-persona-card__chevron" }, H = {
12
+ }, q = { class: "of-persona-card__chevron" }, G = {
12
13
  key: 0,
13
14
  class: "of-persona-card__detail"
14
- }, M = /* @__PURE__ */ C({
15
+ }, O = /* @__PURE__ */ w({
15
16
  name: "PersonaCard",
16
17
  inheritAttrs: !1,
17
18
  __name: "PersonaCard",
@@ -29,8 +30,8 @@ const E = { class: "of-persona-card__body" }, F = { class: "of-persona-card__nam
29
30
  size: { default: "md" }
30
31
  },
31
32
  emits: ["update:expanded", "click"],
32
- setup(r, { emit: m }) {
33
- const e = r, v = m, u = [
33
+ setup(o, { emit: _ }) {
34
+ const e = o, v = _, u = [
34
35
  {
35
36
  accent: "var(--of-color-warning)",
36
37
  bg: "var(--of-color-warning-light)",
@@ -80,13 +81,13 @@ const E = { class: "of-persona-card__body" }, F = { class: "of-persona-card__nam
80
81
  tagBg: "var(--of-badge-green-bg)"
81
82
  }
82
83
  ];
83
- function h(a) {
84
+ function B(a) {
84
85
  let s = 0;
85
86
  for (let d = 0; d < a.length; d++)
86
87
  s = (s << 5) - s + a.charCodeAt(d), s |= 0;
87
88
  return Math.abs(s);
88
89
  }
89
- const g = o(() => {
90
+ const g = r(() => {
90
91
  if (e.color) {
91
92
  const a = e.color.replace("#", "");
92
93
  return {
@@ -96,12 +97,16 @@ const E = { class: "of-persona-card__body" }, F = { class: "of-persona-card__nam
96
97
  tagBg: `#${a}1a`
97
98
  };
98
99
  }
99
- return u[h(e.name) % u.length];
100
- }), p = o(() => e.size === "sm" ? 24 : 32), y = o(() => e.size === "sm" ? 12 : 16), _ = o(() => e.size === "sm" ? 12 : 13), B = o(() => e.size === "sm" ? 11 : 12), x = o(() => {
101
- if (e.icon) return e.icon;
100
+ return u[B(e.name) % u.length];
101
+ }), p = r(() => e.size === "sm" ? 24 : 32), m = r(() => e.size === "sm" ? 12 : 16), k = r(() => e.size === "sm" ? 12 : 13), x = r(() => e.size === "sm" ? 11 : 12), h = r(() => {
102
+ if (e.icon)
103
+ return V(e.icon);
104
+ }), z = r(() => {
105
+ if (e.icon && typeof e.icon == "string") return e.icon;
106
+ if (e.icon) return "";
102
107
  const a = e.name.trim();
103
108
  return a ? a.charAt(0) : "?";
104
- }), z = o(() => [
109
+ }), S = r(() => [
105
110
  "of-persona-card",
106
111
  `of-persona-card--${e.size}`,
107
112
  {
@@ -110,64 +115,71 @@ const E = { class: "of-persona-card__body" }, F = { class: "of-persona-card__nam
110
115
  "of-persona-card--disabled": e.disabled,
111
116
  "of-persona-card--expanded": e.expanded
112
117
  }
113
- ]), k = o(() => ({
118
+ ]), $ = r(() => ({
114
119
  "--pc-accent": g.value.accent,
115
120
  "--pc-accent-bg": g.value.bg,
116
121
  "--pc-accent-border": g.value.border,
117
122
  "--pc-accent-tag-bg": g.value.tagBg
118
- })), S = o(() => ({
123
+ })), C = r(() => ({
119
124
  width: `${p.value}px`,
120
125
  height: `${p.value}px`,
121
- fontSize: `${y.value}px`
126
+ fontSize: `${m.value}px`
122
127
  }));
123
- function $() {
128
+ function P() {
124
129
  e.disabled || (v("update:expanded", !e.expanded), v("click"));
125
130
  }
126
- return (a, s) => (t(), n("div", P({
127
- class: z.value,
128
- style: k.value
131
+ return (a, s) => (t(), n("div", A({
132
+ class: S.value,
133
+ style: $.value
129
134
  }, a.$attrs), [
130
135
  c("div", {
131
136
  class: "of-persona-card__header",
132
- onClick: $
137
+ onClick: P
133
138
  }, [
134
139
  c("span", {
135
140
  class: "of-persona-card__avatar",
136
- style: f(S.value)
137
- }, l(x.value), 5),
138
- c("div", E, [
139
- c("div", F, [
141
+ style: f(C.value)
142
+ }, [
143
+ h.value ? (t(), E(F(h.value), {
144
+ key: 0,
145
+ size: m.value
146
+ }, null, 8, ["size"])) : (t(), n(y, { key: 1 }, [
147
+ N(l(z.value), 1)
148
+ ], 64))
149
+ ], 4),
150
+ c("div", D, [
151
+ c("div", I, [
140
152
  c("span", {
141
153
  class: "of-persona-card__name",
142
- style: f({ fontSize: `${_.value}px` })
143
- }, l(r.name), 5),
154
+ style: f({ fontSize: `${k.value}px` })
155
+ }, l(o.name), 5),
144
156
  b(a.$slots, "badge", {}, void 0, !0),
145
- r.title ? (t(), n("span", L, l(r.title), 1)) : i("", !0)
157
+ o.title ? (t(), n("span", L, l(o.title), 1)) : i("", !0)
146
158
  ]),
147
- r.subtitle ? (t(), n("span", {
159
+ o.subtitle ? (t(), n("span", {
148
160
  key: 0,
149
161
  class: "of-persona-card__subtitle",
150
- style: f({ fontSize: `${B.value}px` })
151
- }, l(r.subtitle), 5)) : i("", !0),
152
- r.tags && r.tags.length > 0 ? (t(), n("div", N, [
153
- (t(!0), n(w, null, A(r.tags, (d) => (t(), n("span", {
162
+ style: f({ fontSize: `${x.value}px` })
163
+ }, l(o.subtitle), 5)) : i("", !0),
164
+ o.tags && o.tags.length > 0 ? (t(), n("div", H, [
165
+ (t(!0), n(y, null, T(o.tags, (d) => (t(), n("span", {
154
166
  key: d,
155
167
  class: "of-persona-card__tag"
156
168
  }, l(d), 1))), 128))
157
169
  ])) : i("", !0)
158
170
  ]),
159
- c("div", T, [
171
+ c("div", M, [
160
172
  b(a.$slots, "actions", {}, void 0, !0),
161
- r.done ? (t(), n("span", V, "✓")) : i("", !0),
162
- c("span", D, l(r.expanded ? "▲" : "▼"), 1)
173
+ o.done ? (t(), n("span", j, "✓")) : i("", !0),
174
+ c("span", q, l(o.expanded ? "▲" : "▼"), 1)
163
175
  ])
164
176
  ]),
165
- r.expanded ? (t(), n("div", H, [
177
+ o.expanded ? (t(), n("div", G, [
166
178
  b(a.$slots, "default", {}, void 0, !0)
167
179
  ])) : i("", !0)
168
180
  ], 16));
169
181
  }
170
182
  });
171
183
  export {
172
- M as default
184
+ O as default
173
185
  };
@@ -1,7 +1,7 @@
1
- import { VNode } from 'vue';
1
+ import { Component, VNode } from 'vue';
2
2
  export interface RefTagProps {
3
3
  type?: "spec" | "wiki" | "task" | string;
4
- icon?: string;
4
+ icon?: string | Component;
5
5
  color?: string;
6
6
  bg?: string;
7
7
  href?: string;
@@ -1,7 +1,7 @@
1
1
  import o from "./RefTag.vue2.js";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4b527ca4"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ a(o, [["__scopeId", "data-v-69a5acde"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -0,0 +1,6 @@
1
+ import { SearchHighlight } from '../../composables/useSearch';
2
+ type __VLS_Props = {
3
+ segments: SearchHighlight[];
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./SearchHighlight.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fb57f288"]]);
5
+ export {
6
+ i as default
7
+ };