@oneflowui/ui 0.4.2 → 0.4.3

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 (233) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  3. package/dist/components/ContextMenu/index.vue.js +7 -0
  4. package/dist/components/ContextMenu/index.vue2.js +91 -0
  5. package/dist/components/Dashboard/charts/BarChart.vue.js +7 -0
  6. package/dist/components/Dashboard/charts/BarChart.vue2.js +43 -0
  7. package/dist/components/Dashboard/charts/DoughnutChart.vue.js +23 -0
  8. package/dist/components/Dashboard/charts/DoughnutChart.vue2.js +4 -0
  9. package/dist/components/Dashboard/charts/NumberCard.vue.js +7 -0
  10. package/dist/components/Dashboard/charts/NumberCard.vue2.js +41 -0
  11. package/dist/components/Dashboard/charts/PieChart.vue.js +7 -0
  12. package/dist/components/Dashboard/charts/PieChart.vue2.js +53 -0
  13. package/dist/components/Dashboard/charts/TableChart.vue.js +7 -0
  14. package/dist/components/Dashboard/charts/TableChart.vue2.js +50 -0
  15. package/dist/components/Dashboard/index.vue.js +7 -0
  16. package/dist/components/Dashboard/index.vue2.js +104 -0
  17. package/dist/components/ai/AiMessageBubble.vue.js +7 -0
  18. package/dist/components/ai/AiMessageBubble.vue2.js +47 -0
  19. package/dist/components/ai/AiMessageList.vue.js +7 -0
  20. package/dist/components/ai/AiMessageList.vue2.js +78 -0
  21. package/dist/components/ai/AiSender.vue.js +7 -0
  22. package/dist/components/ai/AiSender.vue2.js +86 -0
  23. package/dist/components/ai/AiStreamingCursor.vue.js +7 -0
  24. package/dist/components/ai/AiStreamingCursor.vue2.js +16 -0
  25. package/dist/components/ai/AiThinking.vue.js +7 -0
  26. package/dist/components/ai/AiThinking.vue2.js +19 -0
  27. package/dist/components/ai/UserMessageBubble.vue.js +7 -0
  28. package/dist/components/ai/UserMessageBubble.vue2.js +34 -0
  29. package/dist/components/auxiliary/ColorPanel.vue.js +7 -0
  30. package/dist/components/auxiliary/ColorPanel.vue2.js +65 -0
  31. package/dist/components/auxiliary/FileUpload.vue.js +7 -0
  32. package/dist/components/auxiliary/FileUpload.vue2.js +90 -0
  33. package/dist/components/auxiliary/PersonPanel.vue.js +7 -0
  34. package/dist/components/auxiliary/PersonPanel.vue2.js +66 -0
  35. package/dist/components/base/Accordion.vue.js +7 -0
  36. package/dist/components/base/Accordion.vue2.js +78 -0
  37. package/dist/components/base/AddViewBtn.vue.js +7 -0
  38. package/dist/components/base/AddViewBtn.vue2.js +25 -0
  39. package/dist/components/base/Avatar.vue.js +7 -0
  40. package/dist/components/base/Avatar.vue2.js +72 -0
  41. package/dist/components/base/Badge.vue.js +7 -0
  42. package/dist/components/base/Badge.vue2.js +70 -0
  43. package/dist/components/base/ButtonGroup.vue.js +7 -0
  44. package/dist/components/base/ButtonGroup.vue2.js +40 -0
  45. package/dist/components/base/ChainItem.vue.js +7 -0
  46. package/dist/components/base/ChainItem.vue2.js +68 -0
  47. package/dist/components/base/DescBlock.vue.js +7 -0
  48. package/dist/components/base/DescBlock.vue2.js +13 -0
  49. package/dist/components/base/DropdownMenu.vue.js +7 -0
  50. package/dist/components/base/DropdownMenu.vue2.js +92 -0
  51. package/dist/components/base/EmptyState.vue.js +7 -0
  52. package/dist/components/base/EmptyState.vue2.js +38 -0
  53. package/dist/components/base/InfoCard.vue.js +7 -0
  54. package/dist/components/base/InfoCard.vue2.js +167 -0
  55. package/dist/components/base/MonitorItem.vue.js +7 -0
  56. package/dist/components/base/MonitorItem.vue2.js +56 -0
  57. package/dist/components/base/PersonaCard.vue.js +7 -0
  58. package/dist/components/base/PersonaCard.vue2.js +173 -0
  59. package/dist/components/base/ProgressBar.vue.js +7 -0
  60. package/dist/components/base/ProgressBar.vue2.js +49 -0
  61. package/dist/components/base/RangeSlider.vue.js +7 -0
  62. package/dist/components/base/RangeSlider.vue2.js +35 -0
  63. package/dist/components/base/RefTag.vue.js +7 -0
  64. package/dist/components/base/RefTag.vue2.js +52 -0
  65. package/dist/components/base/SectionBlock.vue.js +7 -0
  66. package/dist/components/base/SectionBlock.vue2.js +115 -0
  67. package/dist/components/base/SelectBadge.vue.js +7 -0
  68. package/dist/components/base/SelectBadge.vue2.js +81 -0
  69. package/dist/components/base/StatisticCard.vue.js +7 -0
  70. package/dist/components/base/StatisticCard.vue2.js +57 -0
  71. package/dist/components/base/StatusIndicator.vue.js +7 -0
  72. package/dist/components/base/StatusIndicator.vue2.js +54 -0
  73. package/dist/components/base/StatusSummary.vue.js +7 -0
  74. package/dist/components/base/StatusSummary.vue2.js +64 -0
  75. package/dist/components/base/Stepper.vue.js +7 -0
  76. package/dist/components/base/Stepper.vue2.js +70 -0
  77. package/dist/components/base/Switch.vue.js +7 -0
  78. package/dist/components/base/Switch.vue2.js +43 -0
  79. package/dist/components/base/ToolbarBtn.vue.js +7 -0
  80. package/dist/components/base/ToolbarBtn.vue2.js +30 -0
  81. package/dist/components/base/ViewModeGroup.vue.js +7 -0
  82. package/dist/components/base/ViewModeGroup.vue2.js +32 -0
  83. package/dist/components/base/ViewSwitcher.vue.js +7 -0
  84. package/dist/components/base/ViewSwitcher.vue2.js +73 -0
  85. package/dist/components/base/ViewTab.vue.js +7 -0
  86. package/dist/components/base/ViewTab.vue2.js +42 -0
  87. package/dist/components/breadcrumb/Breadcrumb.vue.js +7 -0
  88. package/dist/components/breadcrumb/Breadcrumb.vue2.js +52 -0
  89. package/dist/components/breadcrumb/BreadcrumbItem.vue.js +7 -0
  90. package/dist/components/breadcrumb/BreadcrumbItem.vue2.js +35 -0
  91. package/dist/components/detail/CommentItem.vue.js +7 -0
  92. package/dist/components/detail/CommentItem.vue2.js +29 -0
  93. package/dist/components/detail/DetailLayout.vue.js +7 -0
  94. package/dist/components/detail/DetailLayout.vue2.js +118 -0
  95. package/dist/components/detail/PropPanel.vue.js +7 -0
  96. package/dist/components/detail/PropPanel.vue2.js +51 -0
  97. package/dist/components/detail/PropRow.vue.js +7 -0
  98. package/dist/components/detail/PropRow.vue2.js +51 -0
  99. package/dist/components/editor/BlockQuote.vue.js +7 -0
  100. package/dist/components/editor/BlockQuote.vue2.js +45 -0
  101. package/dist/components/editor/CodeBlock.vue.js +7 -0
  102. package/dist/components/editor/CodeBlock.vue2.js +48 -0
  103. package/dist/components/editor/ContentBlock.vue.js +7 -0
  104. package/dist/components/editor/ContentBlock.vue2.js +49 -0
  105. package/dist/components/editor/RefLink.vue.js +7 -0
  106. package/dist/components/editor/RefLink.vue2.js +37 -0
  107. package/dist/components/editor/RichTextEditor.vue.js +7 -0
  108. package/dist/components/editor/RichTextEditor.vue2.js +132 -0
  109. package/dist/components/field/FieldCheckbox.vue.js +7 -0
  110. package/dist/{FieldCheckbox-CV3QtQ4Y.js → components/field/FieldCheckbox.vue2.js} +8 -9
  111. package/dist/components/field/FieldDate.vue.js +7 -0
  112. package/dist/{FieldDate-Bljx4jb7.js → components/field/FieldDate.vue2.js} +9 -10
  113. package/dist/components/field/FieldDatetime.vue.js +7 -0
  114. package/dist/{FieldDatetime-B52GfWrK.js → components/field/FieldDatetime.vue2.js} +11 -12
  115. package/dist/components/field/FieldEmail.vue.js +7 -0
  116. package/dist/{FieldEmail-UREMoue-.js → components/field/FieldEmail.vue2.js} +12 -13
  117. package/dist/components/field/FieldMultiSelect.vue.js +7 -0
  118. package/dist/{FieldMultiSelect-Dlay1Fop.js → components/field/FieldMultiSelect.vue2.js} +32 -33
  119. package/dist/components/field/FieldNumber.vue.js +7 -0
  120. package/dist/{FieldNumber-BjhfFhs6.js → components/field/FieldNumber.vue2.js} +8 -9
  121. package/dist/components/field/FieldRating.vue.js +7 -0
  122. package/dist/components/field/FieldRating.vue2.js +31 -0
  123. package/dist/components/field/FieldSelect.vue.js +7 -0
  124. package/dist/{FieldSelect-B39Ad8VH.js → components/field/FieldSelect.vue2.js} +34 -35
  125. package/dist/components/field/FieldText.vue.js +7 -0
  126. package/dist/{FieldText-Ry7f72Ug.js → components/field/FieldText.vue2.js} +13 -14
  127. package/dist/components/field/FieldUrl.vue.js +7 -0
  128. package/dist/components/field/FieldUrl.vue2.js +33 -0
  129. package/dist/components/form/FormDesigner.vue.js +7 -0
  130. package/dist/components/form/FormDesigner.vue2.js +245 -0
  131. package/dist/components/gallery/GalleryCard.vue.js +7 -0
  132. package/dist/components/gallery/GalleryCard.vue2.js +87 -0
  133. package/dist/components/gallery/GalleryView.vue.js +7 -0
  134. package/dist/components/gallery/GalleryView.vue2.js +48 -0
  135. package/dist/components/kanban/KanbanBoard.vue.js +7 -0
  136. package/dist/components/kanban/KanbanBoard.vue2.js +86 -0
  137. package/dist/components/kanban/KanbanCard.vue.js +7 -0
  138. package/dist/components/kanban/KanbanCard.vue2.js +56 -0
  139. package/dist/components/kanban/KanbanColumn.vue.js +7 -0
  140. package/dist/components/kanban/KanbanColumn.vue2.js +103 -0
  141. package/dist/components/kanban/QuickAddRow.vue.js +7 -0
  142. package/dist/components/kanban/QuickAddRow.vue2.js +58 -0
  143. package/dist/components/layout/AppLayout.vue.js +7 -0
  144. package/dist/components/layout/AppLayout.vue2.js +98 -0
  145. package/dist/components/layout/Navbar.vue.js +7 -0
  146. package/dist/components/layout/Navbar.vue2.js +70 -0
  147. package/dist/components/layout/Sidebar.vue.js +7 -0
  148. package/dist/components/layout/Sidebar.vue2.js +88 -0
  149. package/dist/components/layout/StatusBar.vue.js +7 -0
  150. package/dist/components/layout/StatusBar.vue2.js +37 -0
  151. package/dist/components/mermaid/MermaidChart.vue.js +7 -0
  152. package/dist/components/mermaid/MermaidChart.vue2.js +75 -0
  153. package/dist/components/overlay/Dialog.vue.js +7 -0
  154. package/dist/components/overlay/Dialog.vue2.js +89 -0
  155. package/dist/components/overlay/Drawer.vue.js +7 -0
  156. package/dist/components/overlay/Drawer.vue2.js +112 -0
  157. package/dist/components/overlay/Modal.vue.js +7 -0
  158. package/dist/components/overlay/Modal.vue2.js +115 -0
  159. package/dist/components/overlay/SidePanel.vue.js +7 -0
  160. package/dist/components/overlay/SidePanel.vue2.js +137 -0
  161. package/dist/components/split/SplitPane.vue.js +8 -0
  162. package/dist/components/split/SplitPane.vue2.js +68 -0
  163. package/dist/components/table/DataTable.vue.js +7 -0
  164. package/dist/components/table/DataTable.vue2.js +234 -0
  165. package/dist/components/table/FieldCell.vue.js +7 -0
  166. package/dist/components/table/FieldCell.vue2.js +71 -0
  167. package/dist/components/table/NewRowBtn.vue.js +7 -0
  168. package/dist/components/table/NewRowBtn.vue2.js +22 -0
  169. package/dist/components/table/TableColumnManager.vue.js +7 -0
  170. package/dist/components/table/TableColumnManager.vue2.js +100 -0
  171. package/dist/components/table/TableDataRow.vue.js +7 -0
  172. package/dist/components/table/TableDataRow.vue2.js +115 -0
  173. package/dist/components/table/TableFilterPanel.vue.js +7 -0
  174. package/dist/components/table/TableFilterPanel.vue2.js +142 -0
  175. package/dist/components/table/TableGroupRow.vue.js +7 -0
  176. package/dist/components/table/TableGroupRow.vue2.js +48 -0
  177. package/dist/components/table/TableHeaderRow.vue.js +7 -0
  178. package/dist/components/table/TableHeaderRow.vue2.js +69 -0
  179. package/dist/components/tabs/TabPanel.vue.js +7 -0
  180. package/dist/components/tabs/TabPanel.vue2.js +26 -0
  181. package/dist/components/tabs/Tabs.vue.js +7 -0
  182. package/dist/components/tabs/Tabs.vue2.js +87 -0
  183. package/dist/components/timeline/ActivityTimeline.vue.js +7 -0
  184. package/dist/components/timeline/ActivityTimeline.vue2.js +104 -0
  185. package/dist/components/timeline/GanttRow.vue.js +7 -0
  186. package/dist/components/timeline/GanttRow.vue2.js +110 -0
  187. package/dist/components/timeline/GanttTimeline.vue.js +7 -0
  188. package/dist/components/timeline/GanttTimeline.vue2.js +185 -0
  189. package/dist/components/toast/ToastContainer.vue.js +34 -0
  190. package/dist/components/toast/ToastContainer.vue3.js +5 -0
  191. package/dist/components/toast/ToastItem.vue.js +7 -0
  192. package/dist/components/toast/ToastItem.vue2.js +78 -0
  193. package/dist/composables/useAiChat.js +103 -0
  194. package/dist/composables/useBadge.js +76 -0
  195. package/dist/composables/useBreakpoint.js +16 -0
  196. package/dist/composables/useInlineEdit.js +28 -0
  197. package/dist/composables/useMarkdown.js +69 -0
  198. package/dist/composables/useStream.js +80 -0
  199. package/dist/composables/useTable.js +115 -0
  200. package/dist/composables/useTableColumns.js +24 -0
  201. package/dist/composables/useTableData.js +16 -0
  202. package/dist/composables/useTableFilter.js +97 -0
  203. package/dist/composables/useTableGroup.js +46 -0
  204. package/dist/composables/useToast.js +38 -0
  205. package/dist/composables/useTypewriter.js +56 -0
  206. package/dist/composables/useVirtualList.js +117 -0
  207. package/dist/constants/table.js +11 -0
  208. package/dist/index.js +301 -0
  209. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +5 -0
  210. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +377 -0
  211. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +923 -0
  212. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +151 -0
  213. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +240 -0
  214. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +658 -0
  215. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +38 -0
  216. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +216 -0
  217. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +13 -0
  218. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +399 -0
  219. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +305 -0
  220. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +615 -0
  221. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +753 -0
  222. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +219 -0
  223. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +183 -0
  224. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1063 -0
  225. package/dist/style.css +1 -1
  226. package/dist/types/index.js +77 -0
  227. package/dist/utils/icon.js +15 -0
  228. package/package.json +13 -6
  229. package/dist/FieldRating-BKHUu-A1.js +0 -32
  230. package/dist/FieldUrl-bv0EB9sh.js +0 -34
  231. package/dist/index-DQph5iTq.js +0 -12936
  232. package/dist/oneflow-ui.js +0 -111
  233. package/dist/oneflow-ui.umd.cjs +0 -13
@@ -0,0 +1,33 @@
1
+ import { defineComponent as c, ref as i, onMounted as m, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as k } from "vue";
2
+ const b = /* @__PURE__ */ c({
3
+ __name: "FieldUrl",
4
+ props: {
5
+ value: { type: [String, Number, Boolean, Array, null] },
6
+ field: {}
7
+ },
8
+ emits: ["commit", "cancel", "tabNext"],
9
+ setup(r, { emit: a }) {
10
+ const f = r, t = a, o = i(null), n = i(String(f.value ?? ""));
11
+ m(() => s(() => {
12
+ var e;
13
+ return (e = o.value) == null ? void 0 : e.focus();
14
+ }));
15
+ function p(e) {
16
+ e.key === "Enter" && (e.preventDefault(), t("commit", n.value)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", n.value), t("tabNext"));
17
+ }
18
+ return (e, l) => v((d(), y("input", {
19
+ ref_key: "inputRef",
20
+ ref: o,
21
+ class: "of-field-input",
22
+ type: "url",
23
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => n.value = u),
24
+ onKeydown: p,
25
+ onBlur: l[1] || (l[1] = (u) => t("commit", n.value))
26
+ }, null, 544)), [
27
+ [k, n.value]
28
+ ]);
29
+ }
30
+ });
31
+ export {
32
+ b as default
33
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./FormDesigner.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7937cb8c"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,245 @@
1
+ import { defineComponent as z, ref as T, watch as L, computed as P, openBlock as i, createElementBlock as d, createElementVNode as t, toDisplayString as c, createVNode as m, unref as f, createTextVNode as _, createCommentVNode as b, withCtx as $, Fragment as C, renderList as x, normalizeClass as j } from "vue";
2
+ import { Plus as G, GripVertical as U, Trash2 as Y } from "lucide-vue-next";
3
+ import { VueDraggable as A } from "vue-draggable-plus";
4
+ import { isSelectField as h } from "../../types/index.js";
5
+ const H = { class: "of-form-designer" }, J = { class: "of-form-designer__header" }, K = { class: "of-form-designer__title" }, M = { class: "of-form-designer__meta" }, Q = { class: "of-form-designer__inputs" }, R = ["value", "disabled", "onInput"], W = ["value", "disabled", "onChange"], X = ["value"], Z = { class: "of-form-designer__checkbox-label" }, ee = ["checked", "disabled", "onChange"], ne = { class: "of-form-designer__checkbox-label" }, le = ["checked", "disabled", "onChange"], ae = ["onClick"], te = {
6
+ key: 1,
7
+ class: "of-form-designer__options-wrap"
8
+ }, oe = ["value", "disabled", "onChange"], ue = /* @__PURE__ */ z({
9
+ __name: "FormDesigner",
10
+ props: {
11
+ schema: {},
12
+ title: { default: "Form Designer" },
13
+ readonly: { type: Boolean, default: !1 }
14
+ },
15
+ emits: ["update:schema", "change"],
16
+ setup(r, { emit: y }) {
17
+ const F = [
18
+ { value: "text", label: "文本" },
19
+ { value: "number", label: "数字" },
20
+ { value: "select", label: "单选" },
21
+ { value: "multi_select", label: "多选" },
22
+ { value: "date", label: "日期" },
23
+ { value: "datetime", label: "日期时间" },
24
+ { value: "checkbox", label: "勾选" },
25
+ { value: "url", label: "链接" },
26
+ { value: "email", label: "邮箱" },
27
+ { value: "phone", label: "电话" },
28
+ { value: "rating", label: "评分" },
29
+ { value: "user", label: "用户" },
30
+ { value: "attachment", label: "附件" },
31
+ { value: "relation", label: "关联" },
32
+ { value: "formula", label: "公式" }
33
+ ], u = r, p = y, o = T(v(u.schema));
34
+ L(
35
+ () => u.schema,
36
+ (e) => {
37
+ o.value = v(e);
38
+ },
39
+ { deep: !0 }
40
+ );
41
+ const S = P(() => `${o.value.fields.length} 个字段`);
42
+ function v(e) {
43
+ return {
44
+ ...e,
45
+ fields: e.fields.map(w),
46
+ views: e.views.map((n) => ({ ...n }))
47
+ };
48
+ }
49
+ function w(e) {
50
+ return h(e) ? {
51
+ ...e,
52
+ options: e.options.map((n) => ({ ...n }))
53
+ } : { ...e };
54
+ }
55
+ function s() {
56
+ const e = v(o.value);
57
+ p("update:schema", e), p("change", e);
58
+ }
59
+ function V() {
60
+ return k("text", {
61
+ id: `field_${Date.now()}`,
62
+ name: "新字段",
63
+ required: !1,
64
+ hidden: !1
65
+ });
66
+ }
67
+ function k(e, n) {
68
+ switch (e) {
69
+ case "text":
70
+ return { ...n, type: e };
71
+ case "number":
72
+ return { ...n, type: e };
73
+ case "select":
74
+ case "multi_select":
75
+ return {
76
+ ...n,
77
+ type: e,
78
+ options: D()
79
+ };
80
+ case "date":
81
+ case "datetime":
82
+ return { ...n, type: e };
83
+ case "checkbox":
84
+ return { ...n, type: e };
85
+ case "url":
86
+ case "email":
87
+ case "phone":
88
+ return { ...n, type: e };
89
+ case "rating":
90
+ return { ...n, type: e };
91
+ case "user":
92
+ return { ...n, type: e };
93
+ case "attachment":
94
+ return { ...n, type: e };
95
+ case "relation":
96
+ return { ...n, type: e };
97
+ case "formula":
98
+ return { ...n, type: e, formula: "" };
99
+ }
100
+ }
101
+ function D() {
102
+ return [
103
+ { value: "option_1", label: "选项 1" },
104
+ { value: "option_2", label: "选项 2" }
105
+ ];
106
+ }
107
+ function B() {
108
+ u.readonly || (o.value.fields.push(V()), s());
109
+ }
110
+ function E(e) {
111
+ u.readonly || (o.value.fields = o.value.fields.filter((n) => n.id !== e), s());
112
+ }
113
+ function q(e, n) {
114
+ const a = o.value.fields.findIndex((g) => g.id === e.id);
115
+ if (a === -1) return;
116
+ const l = {
117
+ id: e.id,
118
+ name: e.name,
119
+ required: e.required,
120
+ hidden: e.hidden,
121
+ width: e.width
122
+ };
123
+ o.value.fields[a] = h(e) && (n === "select" || n === "multi_select") ? {
124
+ ...l,
125
+ type: n,
126
+ options: e.options.map(
127
+ (g) => ({ ...g })
128
+ )
129
+ } : k(n, l), s();
130
+ }
131
+ function I(e, n) {
132
+ if (!h(e)) return;
133
+ const a = n.split(",").map((l) => l.trim()).filter(Boolean);
134
+ e.options = a.map((l) => ({ value: l, label: l })), s();
135
+ }
136
+ function N(e) {
137
+ return h(e) ? e.options.map((n) => n.label).join(", ") : "";
138
+ }
139
+ function O() {
140
+ s();
141
+ }
142
+ return (e, n) => (i(), d("div", H, [
143
+ t("div", J, [
144
+ t("div", null, [
145
+ t("h3", K, c(r.title), 1),
146
+ t("p", M, c(o.value.name) + " · " + c(S.value), 1)
147
+ ]),
148
+ r.readonly ? b("", !0) : (i(), d("button", {
149
+ key: 0,
150
+ class: "of-form-designer__add-btn",
151
+ onClick: B
152
+ }, [
153
+ m(f(G), { size: 14 }),
154
+ n[1] || (n[1] = _(" 添加字段 ", -1))
155
+ ]))
156
+ ]),
157
+ m(f(A), {
158
+ modelValue: o.value.fields,
159
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => o.value.fields = a),
160
+ handle: ".of-form-designer__drag",
161
+ disabled: r.readonly,
162
+ animation: 150,
163
+ onEnd: O
164
+ }, {
165
+ default: $(() => [
166
+ (i(!0), d(C, null, x(o.value.fields, (a) => (i(), d("div", {
167
+ key: a.id,
168
+ class: "of-form-designer__row"
169
+ }, [
170
+ t("span", {
171
+ class: j(["of-form-designer__drag", { disabled: r.readonly }])
172
+ }, [
173
+ m(f(U), { size: 14 })
174
+ ], 2),
175
+ t("div", Q, [
176
+ t("input", {
177
+ value: a.name,
178
+ class: "of-form-designer__input",
179
+ placeholder: "字段名称",
180
+ disabled: r.readonly,
181
+ onInput: (l) => {
182
+ a.name = String(l.target.value), s();
183
+ }
184
+ }, null, 40, R),
185
+ t("select", {
186
+ class: "of-form-designer__select",
187
+ value: a.type,
188
+ disabled: r.readonly,
189
+ onChange: (l) => q(a, l.target.value)
190
+ }, [
191
+ (i(), d(C, null, x(F, (l) => t("option", {
192
+ key: l.value,
193
+ value: l.value
194
+ }, c(l.label), 9, X)), 64))
195
+ ], 40, W),
196
+ t("label", Z, [
197
+ t("input", {
198
+ type: "checkbox",
199
+ checked: !!a.required,
200
+ disabled: r.readonly,
201
+ onChange: (l) => {
202
+ a.required = l.target.checked, s();
203
+ }
204
+ }, null, 40, ee),
205
+ n[2] || (n[2] = _(" 必填 ", -1))
206
+ ]),
207
+ t("label", ne, [
208
+ t("input", {
209
+ type: "checkbox",
210
+ checked: !!a.hidden,
211
+ disabled: r.readonly,
212
+ onChange: (l) => {
213
+ a.hidden = l.target.checked, s();
214
+ }
215
+ }, null, 40, le),
216
+ n[3] || (n[3] = _(" 隐藏 ", -1))
217
+ ])
218
+ ]),
219
+ r.readonly ? b("", !0) : (i(), d("button", {
220
+ key: 0,
221
+ class: "of-form-designer__remove-btn",
222
+ onClick: (l) => E(a.id)
223
+ }, [
224
+ m(f(Y), { size: 14 })
225
+ ], 8, ae)),
226
+ a.type === "select" || a.type === "multi_select" ? (i(), d("div", te, [
227
+ n[4] || (n[4] = t("label", { class: "of-form-designer__options-label" }, "选项(逗号分隔)", -1)),
228
+ t("input", {
229
+ value: N(a),
230
+ class: "of-form-designer__input",
231
+ placeholder: "例如:待办, 进行中, 完成",
232
+ disabled: r.readonly,
233
+ onChange: (l) => I(a, String(l.target.value))
234
+ }, null, 40, oe)
235
+ ])) : b("", !0)
236
+ ]))), 128))
237
+ ]),
238
+ _: 1
239
+ }, 8, ["modelValue", "disabled"])
240
+ ]));
241
+ }
242
+ });
243
+ export {
244
+ ue as default
245
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./GalleryCard.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4b208b49"]]);
5
+ export {
6
+ p as default
7
+ };
@@ -0,0 +1,87 @@
1
+ import { defineComponent as D, computed as i, openBlock as r, createElementBlock as l, normalizeStyle as _, createElementVNode as t, toDisplayString as c, createCommentVNode as u, Fragment as I, renderList as S, createBlock as B, resolveDynamicComponent as F, createTextVNode as w } from "vue";
2
+ import { CircleIcon as g, FolderIcon as x, CalendarIcon as $, UserIcon as E, TagIcon as N } from "lucide-vue-next";
3
+ const V = ["src"], z = { class: "gallery-card__body" }, A = { class: "gallery-card__title" }, L = {
4
+ key: 0,
5
+ class: "gallery-card__desc"
6
+ }, M = {
7
+ key: 1,
8
+ class: "gallery-card__props"
9
+ }, P = { class: "gallery-card__prop-key" }, T = { class: "gallery-card__prop-value" }, G = { class: "gallery-card__footer" }, U = { class: "gallery-card__task-id" }, Y = { class: "gallery-card__date" }, H = /* @__PURE__ */ D({
10
+ __name: "GalleryCard",
11
+ props: {
12
+ item: {}
13
+ },
14
+ emits: ["click"],
15
+ setup(o, { emit: y }) {
16
+ const a = o, m = y, v = i(() => a.item.bannerColor ?? "#BFDBFE"), p = i(
17
+ () => typeof a.item.cover == "string" && /^https?:\/\//.test(a.item.cover)
18
+ ), d = i(() => (a.item.extraProps ?? []).slice(0, 2)), f = {
19
+ tag: N,
20
+ user: E,
21
+ calendar: $,
22
+ folder: x
23
+ };
24
+ function k(s) {
25
+ return s ? f[s.toLowerCase()] ?? g : g;
26
+ }
27
+ const C = i(() => {
28
+ const s = a.item.updatedAt ?? a.item.createdAt;
29
+ if (!s) return "";
30
+ const e = new Date(s);
31
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
32
+ }), b = {
33
+ todo: "var(--of-color-gray-400)",
34
+ in_progress: "var(--of-color-info)",
35
+ blocked: "var(--of-color-warning)",
36
+ done: "var(--of-color-success)"
37
+ }, h = i(() => b[a.item.status] ?? "var(--of-color-gray-400)");
38
+ return (s, e) => (r(), l("div", {
39
+ class: "gallery-card",
40
+ onClick: e[0] || (e[0] = (n) => m("click", o.item))
41
+ }, [
42
+ p.value ? (r(), l("img", {
43
+ key: 0,
44
+ class: "gallery-card__cover",
45
+ src: o.item.cover,
46
+ alt: ""
47
+ }, null, 8, V)) : (r(), l("div", {
48
+ key: 1,
49
+ class: "gallery-card__banner",
50
+ style: _({ backgroundColor: v.value })
51
+ }, null, 4)),
52
+ t("div", z, [
53
+ t("div", A, c(o.item.title), 1),
54
+ o.item.description ? (r(), l("div", L, c(o.item.description), 1)) : u("", !0),
55
+ e[3] || (e[3] = t("div", { class: "gallery-card__divider" }, null, -1)),
56
+ d.value.length > 0 ? (r(), l("div", M, [
57
+ (r(!0), l(I, null, S(d.value, (n) => (r(), l("div", {
58
+ key: n.key,
59
+ class: "gallery-card__prop-row"
60
+ }, [
61
+ (r(), B(F(k(n.icon)), {
62
+ class: "gallery-card__prop-icon",
63
+ size: 12
64
+ })),
65
+ t("span", P, c(n.key), 1),
66
+ e[1] || (e[1] = t("span", { class: "gallery-card__prop-spacer" }, null, -1)),
67
+ t("span", T, c(n.value), 1)
68
+ ]))), 128))
69
+ ])) : u("", !0),
70
+ t("div", G, [
71
+ t("span", U, [
72
+ t("span", {
73
+ class: "gallery-card__status-dot",
74
+ style: _({ backgroundColor: h.value })
75
+ }, null, 4),
76
+ w(" " + c(o.item.id), 1)
77
+ ]),
78
+ e[2] || (e[2] = t("span", { class: "gallery-card__footer-spacer" }, null, -1)),
79
+ t("span", Y, c(C.value), 1)
80
+ ])
81
+ ])
82
+ ]));
83
+ }
84
+ });
85
+ export {
86
+ H as default
87
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./GalleryView.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-3e8ae97a"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,48 @@
1
+ import { defineComponent as u, computed as n, openBlock as t, createElementBlock as d, normalizeStyle as m, Fragment as f, renderList as v, createBlock as p, createVNode as y, unref as k, createElementVNode as I, createCommentVNode as g } from "vue";
2
+ import { PlusIcon as F } from "lucide-vue-next";
3
+ import b from "./GalleryCard.vue.js";
4
+ import { buildGalleryItems as C } from "../../types/index.js";
5
+ const x = /* @__PURE__ */ u({
6
+ __name: "GalleryView",
7
+ props: {
8
+ items: { default: () => [] },
9
+ records: { default: () => [] },
10
+ coverFieldId: { default: "" },
11
+ cardFieldIds: { default: () => [] },
12
+ columns: { default: 4 },
13
+ addable: { type: Boolean, default: !0 }
14
+ },
15
+ emits: ["card-click", "add"],
16
+ setup(o, { emit: i }) {
17
+ const e = o, a = i, s = n(() => ({
18
+ "--columns": e.columns
19
+ })), c = n(() => e.items.length > 0 ? e.items : e.records.length > 0 ? C(e.records, {
20
+ coverFieldId: e.coverFieldId || void 0,
21
+ cardFieldIds: e.cardFieldIds
22
+ }) : []);
23
+ return (_, l) => (t(), d("div", {
24
+ class: "gallery-view",
25
+ style: m(s.value)
26
+ }, [
27
+ (t(!0), d(f, null, v(c.value, (r) => (t(), p(b, {
28
+ key: r.id,
29
+ item: r,
30
+ onClick: (w) => a("card-click", r)
31
+ }, null, 8, ["item", "onClick"]))), 128)),
32
+ o.addable ? (t(), d("button", {
33
+ key: 0,
34
+ class: "gallery-view__add-btn",
35
+ onClick: l[0] || (l[0] = (r) => a("add"))
36
+ }, [
37
+ y(k(F), {
38
+ size: 18,
39
+ class: "gallery-view__add-icon"
40
+ }),
41
+ l[1] || (l[1] = I("span", { class: "gallery-view__add-label" }, "添加", -1))
42
+ ])) : g("", !0)
43
+ ], 4));
44
+ }
45
+ });
46
+ export {
47
+ x as default
48
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./KanbanBoard.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ a(o, [["__scopeId", "data-v-210bcfc5"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,86 @@
1
+ import { defineComponent as T, ref as w, watch as A, openBlock as d, createElementBlock as s, createElementVNode as f, Fragment as F, renderList as I, createVNode as u, unref as V, createCommentVNode as x } from "vue";
2
+ import { Plus as y } from "lucide-vue-next";
3
+ import B from "./KanbanColumn.vue.js";
4
+ import K from "./QuickAddRow.vue.js";
5
+ import { buildKanbanColumns as O } from "../../types/index.js";
6
+ const g = { class: "of-kanban-board" }, h = { class: "of-kanban-inner" }, P = /* @__PURE__ */ T({
7
+ __name: "KanbanBoard",
8
+ props: {
9
+ columns: { default: () => [] },
10
+ records: { default: () => [] },
11
+ kanbanFieldId: { default: "status" },
12
+ laneOrder: { default: () => [] },
13
+ laneTitles: { default: () => ({}) },
14
+ addColumnVisible: { type: Boolean, default: !1 }
15
+ },
16
+ emits: ["update:columns", "add-column", "card-click"],
17
+ setup(i, { emit: k }) {
18
+ const n = i, r = k, c = () => n.columns.length > 0 ? structuredClone(n.columns) : n.records.length > 0 ? O(n.records, {
19
+ kanbanFieldId: n.kanbanFieldId,
20
+ laneOrder: n.laneOrder,
21
+ laneTitles: n.laneTitles
22
+ }) : [], a = w(c());
23
+ A(
24
+ () => [n.columns, n.records, n.kanbanFieldId, n.laneOrder, n.laneTitles],
25
+ () => {
26
+ a.value = c();
27
+ }
28
+ );
29
+ function m(o) {
30
+ const l = a.value.findIndex((e) => e.id === o.id);
31
+ if (l !== -1) {
32
+ const e = o.tasks.map((t) => ({
33
+ ...t,
34
+ status: o.id
35
+ }));
36
+ a.value[l] = { ...o, tasks: e }, r("update:columns", structuredClone(a.value));
37
+ }
38
+ }
39
+ function b(o) {
40
+ }
41
+ function p(o, l) {
42
+ const e = a.value.find((v) => v.id === o);
43
+ if (!e) return;
44
+ const t = {
45
+ id: `TASK-${Date.now()}`,
46
+ title: l,
47
+ status: o,
48
+ priority: "P3"
49
+ }, C = {
50
+ ...e,
51
+ tasks: [...e.tasks, t]
52
+ };
53
+ m(C);
54
+ }
55
+ return (o, l) => (d(), s("div", g, [
56
+ f("div", h, [
57
+ (d(!0), s(F, null, I(a.value, (e) => (d(), s("div", {
58
+ key: e.id,
59
+ class: "of-kanban-col-wrapper"
60
+ }, [
61
+ u(B, {
62
+ column: e,
63
+ onAddCard: b,
64
+ onCardClick: l[0] || (l[0] = (t) => r("card-click", t)),
65
+ "onUpdate:column": m
66
+ }, null, 8, ["column"]),
67
+ u(K, {
68
+ class: "of-quick-add-below",
69
+ onSubmit: (t) => p(e.id, t)
70
+ }, null, 8, ["onSubmit"])
71
+ ]))), 128)),
72
+ i.addColumnVisible ? (d(), s("button", {
73
+ key: 0,
74
+ class: "of-add-column-btn",
75
+ onClick: l[1] || (l[1] = (e) => r("add-column"))
76
+ }, [
77
+ u(V(y), { size: 16 }),
78
+ l[2] || (l[2] = f("span", null, "添加列", -1))
79
+ ])) : x("", !0)
80
+ ])
81
+ ]));
82
+ }
83
+ });
84
+ export {
85
+ P as default
86
+ };
@@ -0,0 +1,7 @@
1
+ import a from "./KanbanCard.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ o(a, [["__scopeId", "data-v-28da7aba"]]);
5
+ export {
6
+ p as default
7
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent as A, computed as e, openBlock as r, createElementBlock as i, normalizeClass as T, createElementVNode as s, toDisplayString as l, createCommentVNode as f, normalizeStyle as m } from "vue";
2
+ import { resolveBadge as p, mergeColorMap as g, DEFAULT_PRIORITY_MAP as _, DEFAULT_STATUS_MAP as S } from "../../composables/useBadge.js";
3
+ const h = { class: "of-card-title" }, B = { class: "of-card-meta" }, E = { class: "of-card-id" }, L = {
4
+ key: 0,
5
+ class: "of-card-date"
6
+ }, N = {
7
+ key: 1,
8
+ class: "of-card-role-badge"
9
+ }, P = { class: "of-card-tags" }, z = /* @__PURE__ */ A({
10
+ __name: "KanbanCard",
11
+ props: {
12
+ task: {},
13
+ dragging: { type: Boolean, default: !1 },
14
+ priorityColorMap: {},
15
+ statusColorMap: {}
16
+ },
17
+ emits: ["click"],
18
+ setup(a, { emit: k }) {
19
+ const o = a, v = k, c = e(
20
+ () => p(o.task.priority, g(_, o.priorityColorMap))
21
+ ), d = e(
22
+ () => p(o.task.status, g(S, o.statusColorMap))
23
+ ), y = e(() => c.value.style), b = e(() => d.value.style), C = e(() => d.value.label), D = e(() => c.value.label);
24
+ function M(n) {
25
+ if (!n) return "";
26
+ const t = new Date(n);
27
+ return isNaN(t.getTime()) ? n : `${t.getMonth() + 1}/${t.getDate()}`;
28
+ }
29
+ const u = e(() => M(o.task.updatedAt ?? o.task.endDate));
30
+ return (n, t) => (r(), i("div", {
31
+ class: T(["of-kanban-card", { "of-kanban-card--dragging": a.dragging }]),
32
+ onClick: t[0] || (t[0] = (U) => v("click", a.task))
33
+ }, [
34
+ s("div", h, l(a.task.title), 1),
35
+ s("div", B, [
36
+ s("span", E, l(a.task.id), 1),
37
+ u.value ? (r(), i("span", L, l(u.value), 1)) : f("", !0),
38
+ t[1] || (t[1] = s("span", { class: "of-card-spacer" }, null, -1)),
39
+ a.task.role ? (r(), i("span", N, l(a.task.role), 1)) : f("", !0)
40
+ ]),
41
+ s("div", P, [
42
+ s("span", {
43
+ class: "of-badge",
44
+ style: m(y.value)
45
+ }, l(D.value), 5),
46
+ s("span", {
47
+ class: "of-badge",
48
+ style: m(b.value)
49
+ }, l(C.value), 5)
50
+ ])
51
+ ], 2));
52
+ }
53
+ });
54
+ export {
55
+ z as default
56
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./KanbanColumn.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-b930d0ab"]]);
5
+ export {
6
+ p as default
7
+ };