@oneflowui/ui 0.5.9 → 0.7.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 (134) hide show
  1. package/README.en.md +19 -0
  2. package/README.md +23 -0
  3. package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
  4. package/dist/components/Dashboard/charts/BarChart.vue2.js +56 -23
  5. package/dist/components/Dashboard/charts/NumberCard.vue.js +2 -2
  6. package/dist/components/Dashboard/charts/NumberCard.vue2.js +14 -14
  7. package/dist/components/Dashboard/charts/PieChart.vue.js +1 -1
  8. package/dist/components/Dashboard/charts/PieChart.vue2.js +49 -23
  9. package/dist/components/Dashboard/charts/TableChart.vue.js +1 -1
  10. package/dist/components/Dashboard/index.vue.d.ts +3 -1
  11. package/dist/components/Dashboard/index.vue.js +2 -2
  12. package/dist/components/Dashboard/index.vue2.js +59 -30
  13. package/dist/components/ai/AiMessageBubble.vue.js +3 -3
  14. package/dist/components/ai/AiSender.vue.js +2 -2
  15. package/dist/components/ai/AiThinking.vue.js +1 -1
  16. package/dist/components/ai/UserMessageBubble.vue.js +3 -3
  17. package/dist/components/auxiliary/ColorPanel.vue.js +3 -3
  18. package/dist/components/auxiliary/ColorPanel.vue2.js +9 -9
  19. package/dist/components/auxiliary/FileUpload.vue.js +2 -2
  20. package/dist/components/auxiliary/PersonPanel.vue.js +1 -1
  21. package/dist/components/auxiliary/PersonPanel.vue2.js +10 -10
  22. package/dist/components/base/Accordion.vue.js +1 -1
  23. package/dist/components/base/Avatar.vue.js +3 -3
  24. package/dist/components/base/Avatar.vue2.js +43 -43
  25. package/dist/components/base/Badge.vue.js +1 -1
  26. package/dist/components/base/Badge.vue2.js +35 -35
  27. package/dist/components/base/ButtonGroup.vue.js +2 -2
  28. package/dist/components/base/ChainItem.vue.js +2 -2
  29. package/dist/components/base/ChainItem.vue2.js +30 -30
  30. package/dist/components/base/DescBlock.vue.js +3 -3
  31. package/dist/components/base/DropdownMenu.vue.js +2 -2
  32. package/dist/components/base/EmptyState.vue.js +1 -1
  33. package/dist/components/base/InfoCard.vue.js +2 -2
  34. package/dist/components/base/InfoCard.vue2.js +66 -66
  35. package/dist/components/base/MonitorItem.vue.js +1 -1
  36. package/dist/components/base/MonitorItem.vue2.js +16 -16
  37. package/dist/components/base/PersonaCard.vue.js +1 -1
  38. package/dist/components/base/PersonaCard.vue2.js +81 -81
  39. package/dist/components/base/ProgressBar.vue.js +2 -2
  40. package/dist/components/base/ProgressBar.vue2.js +16 -16
  41. package/dist/components/base/RangeSlider.vue.js +1 -1
  42. package/dist/components/base/RefTag.vue.js +2 -2
  43. package/dist/components/base/RefTag.vue2.js +20 -20
  44. package/dist/components/base/SearchHighlight.vue.js +1 -1
  45. package/dist/components/base/SectionBlock.vue.js +1 -1
  46. package/dist/components/base/SectionBlock.vue2.js +44 -44
  47. package/dist/components/base/StatisticCard.vue.js +2 -2
  48. package/dist/components/base/StatisticCard.vue2.js +24 -24
  49. package/dist/components/base/StatusIndicator.vue.js +2 -2
  50. package/dist/components/base/StatusIndicator.vue2.js +30 -30
  51. package/dist/components/base/StatusSummary.vue.js +2 -2
  52. package/dist/components/base/StatusSummary.vue2.js +23 -23
  53. package/dist/components/base/Stepper.vue.js +2 -2
  54. package/dist/components/base/Switch.vue.js +2 -2
  55. package/dist/components/base/ToolbarBtn.vue.js +1 -1
  56. package/dist/components/base/ViewModeGroup.vue.js +3 -3
  57. package/dist/components/base/ViewSwitcher.vue.js +2 -2
  58. package/dist/components/base/ViewTab.vue.js +4 -4
  59. package/dist/components/breadcrumb/Breadcrumb.vue.js +2 -2
  60. package/dist/components/breadcrumb/BreadcrumbItem.vue.js +1 -1
  61. package/dist/components/database/DatabaseView.vue.js +2 -2
  62. package/dist/components/database/DatabaseView.vue2.js +482 -412
  63. package/dist/components/detail/CommentItem.vue.js +2 -2
  64. package/dist/components/detail/CommentItem.vue2.js +8 -8
  65. package/dist/components/detail/DetailLayout.vue.d.ts +12 -1
  66. package/dist/components/detail/DetailLayout.vue.js +2 -2
  67. package/dist/components/detail/DetailLayout.vue2.js +115 -68
  68. package/dist/components/editor/BlockQuote.vue.js +2 -2
  69. package/dist/components/editor/CodeBlock.vue.js +2 -2
  70. package/dist/components/editor/ContentBlock.vue.js +2 -2
  71. package/dist/components/editor/RefLink.vue.js +2 -2
  72. package/dist/components/editor/RichTextEditor.vue.js +1 -1
  73. package/dist/components/field/FieldAttachment.vue.js +1 -1
  74. package/dist/components/field/FieldCreator.vue.js +1 -1
  75. package/dist/components/field/FieldCurrency.vue.js +2 -2
  76. package/dist/components/field/FieldMarkdownPreview.vue.js +2 -2
  77. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  78. package/dist/components/field/FieldProgress.vue.js +2 -2
  79. package/dist/components/field/FieldRating.vue.js +2 -2
  80. package/dist/components/field/FieldRelation.vue.js +1 -1
  81. package/dist/components/field/FieldRichText.vue.js +1 -1
  82. package/dist/components/field/FieldSelect.vue.js +2 -2
  83. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  84. package/dist/components/gallery/GalleryCard.vue2.js +34 -30
  85. package/dist/components/gallery/GalleryView.vue.d.ts +3 -1
  86. package/dist/components/gallery/GalleryView.vue.js +1 -1
  87. package/dist/components/gallery/GalleryView.vue2.js +51 -27
  88. package/dist/components/kanban/KanbanBoard.vue.js +4 -4
  89. package/dist/components/kanban/KanbanCard.vue.js +2 -2
  90. package/dist/components/kanban/KanbanColumn.vue.js +2 -2
  91. package/dist/components/kanban/KanbanColumn.vue2.js +16 -16
  92. package/dist/components/kanban/QuickAddRow.vue.js +1 -1
  93. package/dist/components/layout/AppLayout.vue.js +2 -2
  94. package/dist/components/layout/Navbar.vue.js +3 -3
  95. package/dist/components/layout/Sidebar.vue.js +2 -2
  96. package/dist/components/layout/StatusBar.vue.js +2 -2
  97. package/dist/components/mermaid/MermaidChart.vue.js +2 -2
  98. package/dist/components/overlay/Dialog.vue.js +2 -2
  99. package/dist/components/overlay/Drawer.vue.d.ts +2 -0
  100. package/dist/components/overlay/Drawer.vue.js +2 -2
  101. package/dist/components/overlay/Drawer.vue2.js +25 -24
  102. package/dist/components/overlay/Modal.vue.js +1 -1
  103. package/dist/components/overlay/SidePanel.vue.js +2 -2
  104. package/dist/components/overlay/SidePanel.vue2.js +3 -2
  105. package/dist/components/split/SplitPane.vue.js +2 -2
  106. package/dist/components/table/ColumnHeaderMenu.vue.js +1 -1
  107. package/dist/components/table/DataTable.vue.d.ts +26 -2
  108. package/dist/components/table/DataTable.vue.js +2 -2
  109. package/dist/components/table/DataTable.vue2.js +738 -603
  110. package/dist/components/table/DetailSheet.vue.js +1 -1
  111. package/dist/components/table/FieldCell.vue.js +2 -2
  112. package/dist/components/table/FieldCell.vue2.js +26 -24
  113. package/dist/components/table/FieldTypePicker.vue.js +4 -4
  114. package/dist/components/table/MobileListView.vue.js +2 -2
  115. package/dist/components/table/NewRowBtn.vue.js +2 -2
  116. package/dist/components/table/TableColumnManager.vue.js +2 -2
  117. package/dist/components/table/TableDataRow.vue.d.ts +19 -0
  118. package/dist/components/table/TableDataRow.vue.js +1 -1
  119. package/dist/components/table/TableDataRow.vue2.js +110 -73
  120. package/dist/components/table/TableFilterPanel.vue.js +2 -2
  121. package/dist/components/table/TableGroupRow.vue.js +2 -2
  122. package/dist/components/table/TableHeaderRow.vue.js +2 -2
  123. package/dist/components/table/TableToolbar.vue.js +2 -2
  124. package/dist/components/tabs/Tabs.vue.js +1 -1
  125. package/dist/components/timeline/ActivityTimeline.vue.js +1 -1
  126. package/dist/components/timeline/ActivityTimeline.vue2.js +27 -27
  127. package/dist/components/timeline/GanttRow.vue.js +2 -2
  128. package/dist/components/timeline/GanttRow.vue2.js +21 -18
  129. package/dist/components/timeline/GanttTimeline.vue.js +2 -2
  130. package/dist/components/toast/ToastItem.vue.js +2 -2
  131. package/dist/components/toast/ToastItem.vue2.js +39 -39
  132. package/dist/plugin.js +5 -3
  133. package/dist/style.css +1 -1
  134. package/package.json +1 -1
package/README.en.md CHANGED
@@ -110,6 +110,25 @@ import '@oneflowui/ui/styles'
110
110
 
111
111
  Note: starting from `0.5.4`, the plugin entry is separated from the root entry. Use `@oneflowui/ui/plugin` for `app.use(...)`, and keep named imports on `@oneflowui/ui`.
112
112
 
113
+ ### Theme Layers
114
+
115
+ OneUI now ships with a neutral default theme and an optional product skin without changing component logic.
116
+
117
+ - Default theme: `neutral`
118
+ - Optional skin: `ops-console`
119
+
120
+ Recommended usage is to keep components on shared tokens and switch the theme at the app layer instead of overriding component internals.
121
+
122
+ ```ts
123
+ import '@oneflowui/ui/styles'
124
+
125
+ document.documentElement.dataset.ofTheme = 'neutral'
126
+ // or
127
+ document.documentElement.dataset.ofTheme = 'ops-console'
128
+ ```
129
+
130
+ This structure is meant to keep the component layer reusable while letting product-specific styling live above it.
131
+
113
132
  ---
114
133
 
115
134
  ## Usage Examples
package/README.md CHANGED
@@ -97,6 +97,29 @@ import '@oneflowui/ui/styles'
97
97
 
98
98
  说明:从 `0.5.4` 开始,`plugin` 入口与根入口解耦。全局注册走 `@oneflowui/ui/plugin`,命名导入继续走 `@oneflowui/ui`。
99
99
 
100
+ ### 主题层
101
+
102
+ OneUI 当前默认提供一套中性主题,并允许在不改组件逻辑的前提下切换到上层产品皮肤。
103
+
104
+ - 默认主题:`neutral`
105
+ - 可选皮肤:`ops-console`
106
+
107
+ 推荐做法是让组件继续消费统一 token,然后由应用层切换主题,而不是直接覆盖组件内部样式。
108
+
109
+ ```ts
110
+ import '@oneflowui/ui/styles'
111
+
112
+ document.documentElement.dataset.ofTheme = 'neutral'
113
+ // 或
114
+ document.documentElement.dataset.ofTheme = 'ops-console'
115
+ ```
116
+
117
+ 这套结构的目标是:
118
+
119
+ 1. 组件默认保持中性、可复用
120
+ 2. 业务系统通过主题皮肤注入品牌感或中控台气质
121
+ 3. 后续可继续扩展更多主题,而不需要修改组件 API
122
+
100
123
  ---
101
124
 
102
125
  ## 页面级方案
@@ -1,7 +1,7 @@
1
1
  import o from "./BarChart.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-dfd12dfa"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7cbf158c"]]);
5
5
  export {
6
- d as default
6
+ f as default
7
7
  };
@@ -1,39 +1,72 @@
1
- import { defineComponent as s, ref as l, onMounted as n, onUnmounted as d, watch as c, openBlock as u, createElementBlock as f, createElementVNode as p } from "vue";
2
- import * as m from "echarts/core";
1
+ import { defineComponent as d, ref as c, onMounted as u, onUnmounted as f, watch as p, openBlock as m, createElementBlock as x, createElementVNode as y } from "vue";
2
+ import * as h from "echarts/core";
3
3
  import "echarts/charts";
4
4
  import "echarts/components";
5
5
  import "echarts/renderers";
6
- const x = { class: "of-dashboard-chart" }, A = /* @__PURE__ */ s({
6
+ const v = { class: "of-dashboard-chart" }, w = /* @__PURE__ */ d({
7
7
  __name: "BarChart",
8
8
  props: {
9
9
  title: { default: "" },
10
10
  xAxisData: { default: () => ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] },
11
11
  seriesName: { default: "Value" },
12
12
  data: { default: () => [120, 200, 150, 80, 70, 110, 130] },
13
- colors: { default: () => ["#3b82f6"] }
13
+ colors: { default: () => ["var(--of-chart-series-1)"] }
14
14
  },
15
- setup(i) {
16
- const e = i, a = l(null);
17
- let t = null, o = null;
18
- const r = () => {
19
- a.value && (t || (t = m.init(a.value)), t.setOption({
20
- color: e.colors,
21
- title: e.title ? { text: e.title, left: "center", textStyle: { fontSize: 14, fontWeight: 600 } } : void 0,
15
+ setup(n) {
16
+ const e = n, a = c(null);
17
+ let t = null, i = null;
18
+ function o(r) {
19
+ if (typeof window > "u" || !r.startsWith("var(")) return r;
20
+ const s = r.slice(4, -1).trim();
21
+ return getComputedStyle(document.documentElement).getPropertyValue(s).trim() || r;
22
+ }
23
+ const l = () => {
24
+ if (!a.value) return;
25
+ t || (t = h.init(a.value));
26
+ const r = e.colors.map(o);
27
+ t.setOption({
28
+ color: r,
29
+ title: e.title ? {
30
+ text: e.title,
31
+ left: "center",
32
+ textStyle: {
33
+ fontSize: 14,
34
+ fontWeight: 600,
35
+ color: o("var(--of-text-primary)")
36
+ }
37
+ } : void 0,
22
38
  tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
23
39
  grid: { left: 12, right: 12, top: e.title ? 42 : 16, bottom: 8, containLabel: !0 },
24
- xAxis: { type: "category", data: e.xAxisData },
25
- yAxis: { type: "value" },
26
- series: [{ name: e.seriesName, type: "bar", barMaxWidth: 36, data: e.data }]
27
- }));
40
+ xAxis: {
41
+ type: "category",
42
+ data: e.xAxisData,
43
+ axisLabel: { color: o("var(--of-text-tertiary)") },
44
+ axisLine: { lineStyle: { color: o("var(--of-border-subtle)") } }
45
+ },
46
+ yAxis: {
47
+ type: "value",
48
+ axisLabel: { color: o("var(--of-text-tertiary)") },
49
+ splitLine: { lineStyle: { color: o("var(--of-border-subtle)") } }
50
+ },
51
+ series: [
52
+ {
53
+ name: e.seriesName,
54
+ type: "bar",
55
+ barMaxWidth: 36,
56
+ data: e.data,
57
+ itemStyle: { borderRadius: [8, 8, 0, 0] }
58
+ }
59
+ ]
60
+ });
28
61
  };
29
- return n(() => {
30
- r(), a.value && (o = new ResizeObserver(() => t == null ? void 0 : t.resize()), o.observe(a.value));
31
- }), d(() => {
32
- o == null || o.disconnect(), t == null || t.dispose();
33
- }), c(() => [e.title, e.xAxisData, e.seriesName, e.data, e.colors], r, {
62
+ return u(() => {
63
+ l(), a.value && (i = new ResizeObserver(() => t == null ? void 0 : t.resize()), i.observe(a.value));
64
+ }), f(() => {
65
+ i == null || i.disconnect(), t == null || t.dispose();
66
+ }), p(() => [e.title, e.xAxisData, e.seriesName, e.data, e.colors], l, {
34
67
  deep: !0
35
- }), (h, _) => (u(), f("div", x, [
36
- p("div", {
68
+ }), (r, s) => (m(), x("div", v, [
69
+ y("div", {
37
70
  ref_key: "chartRef",
38
71
  ref: a,
39
72
  class: "of-dashboard-chart__canvas"
@@ -42,5 +75,5 @@ const x = { class: "of-dashboard-chart" }, A = /* @__PURE__ */ s({
42
75
  }
43
76
  });
44
77
  export {
45
- A as default
78
+ w as default
46
79
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./NumberCard.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-2287094b"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-bf4a8d8b"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as s, computed as i, openBlock as o, createElementBlock as a, createElementVNode as r, toDisplayString as n, normalizeStyle as m, createBlock as c, unref as l, createCommentVNode as u } from "vue";
1
+ import { defineComponent as s, computed as i, openBlock as r, createElementBlock as a, createElementVNode as o, toDisplayString as n, normalizeStyle as m, createBlock as c, unref as l, createCommentVNode as d } from "vue";
2
2
  import { TrendingUpIcon as f, TrendingDownIcon as _ } from "lucide-vue-next";
3
3
  const p = { class: "of-number-card" }, v = { class: "of-number-card__title" }, b = { class: "of-number-card__value-row" }, y = {
4
4
  key: 0,
5
5
  class: "of-number-card__compare"
6
- }, g = /* @__PURE__ */ s({
6
+ }, $ = /* @__PURE__ */ s({
7
7
  __name: "NumberCard",
8
8
  props: {
9
9
  title: { default: "Metric" },
@@ -11,31 +11,31 @@ const p = { class: "of-number-card" }, v = { class: "of-number-card__title" }, b
11
11
  unit: { default: "" },
12
12
  compare: { default: "" },
13
13
  trend: { default: void 0 },
14
- color: { default: "var(--of-color-blue-600)" }
14
+ color: { default: "var(--of-accent-strong)" }
15
15
  },
16
16
  setup(e) {
17
- const t = e, d = i(() => t.value >= 1e4 ? `${(t.value / 1e4).toFixed(1)}w${t.unit}` : `${t.value}${t.unit}`);
18
- return (k, h) => (o(), a("div", p, [
19
- r("p", v, n(e.title), 1),
20
- r("div", b, [
21
- r("p", {
17
+ const t = e, u = i(() => t.value >= 1e4 ? `${(t.value / 1e4).toFixed(1)}w${t.unit}` : `${t.value}${t.unit}`);
18
+ return (k, h) => (r(), a("div", p, [
19
+ o("p", v, n(e.title), 1),
20
+ o("div", b, [
21
+ o("p", {
22
22
  class: "of-number-card__value",
23
23
  style: m({ color: e.color })
24
- }, n(d.value), 5),
25
- e.trend === "up" ? (o(), c(l(f), {
24
+ }, n(u.value), 5),
25
+ e.trend === "up" ? (r(), c(l(f), {
26
26
  key: 0,
27
27
  class: "of-number-card__trend up",
28
28
  size: 16
29
- })) : e.trend === "down" ? (o(), c(l(_), {
29
+ })) : e.trend === "down" ? (r(), c(l(_), {
30
30
  key: 1,
31
31
  class: "of-number-card__trend down",
32
32
  size: 16
33
- })) : u("", !0)
33
+ })) : d("", !0)
34
34
  ]),
35
- e.compare ? (o(), a("p", y, "环比 " + n(e.compare), 1)) : u("", !0)
35
+ e.compare ? (r(), a("p", y, "环比 " + n(e.compare), 1)) : d("", !0)
36
36
  ]));
37
37
  }
38
38
  });
39
39
  export {
40
- g as default
40
+ $ as default
41
41
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./PieChart.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-9e918a55"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4e78b0c6"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as r, ref as s, onMounted as d, onUnmounted as i, watch as u, openBlock as f, createElementBlock as c, createElementVNode as p } from "vue";
2
- import * as m from "echarts/core";
1
+ import { defineComponent as d, ref as c, onMounted as f, onUnmounted as u, watch as m, openBlock as p, createElementBlock as h, createElementVNode as v } from "vue";
2
+ import * as g from "echarts/core";
3
3
  import "echarts/charts";
4
4
  import "echarts/components";
5
5
  import "echarts/renderers";
6
- const h = { class: "of-dashboard-chart" }, x = /* @__PURE__ */ r({
6
+ const y = { class: "of-dashboard-chart" }, C = /* @__PURE__ */ d({
7
7
  __name: "PieChart",
8
8
  props: {
9
9
  title: { default: "" },
@@ -12,45 +12,71 @@ const h = { class: "of-dashboard-chart" }, x = /* @__PURE__ */ r({
12
12
  { name: "In Progress", value: 9 },
13
13
  { name: "Done", value: 18 }
14
14
  ] },
15
- colors: { default: () => ["#3b82f6", "#10b981", "#f59e0b", "#8b5cf6", "#ef4444"] },
15
+ colors: { default: () => [
16
+ "var(--of-chart-series-1)",
17
+ "var(--of-chart-series-2)",
18
+ "var(--of-chart-series-3)",
19
+ "var(--of-chart-series-4)",
20
+ "var(--of-chart-series-5)"
21
+ ] },
16
22
  doughnut: { type: Boolean, default: !1 },
17
23
  showLegend: { type: Boolean, default: !0 }
18
24
  },
19
- setup(l) {
20
- const e = l, o = s(null);
21
- let t = null, n = null;
22
- const a = () => {
23
- o.value && (t || (t = m.init(o.value)), t.setOption({
24
- color: e.colors,
25
- title: e.title ? { text: e.title, left: "center", textStyle: { fontSize: 14, fontWeight: 600 } } : void 0,
25
+ setup(i) {
26
+ const e = i, r = c(null);
27
+ let t = null, a = null;
28
+ function n(o) {
29
+ if (typeof window > "u" || !o.startsWith("var(")) return o;
30
+ const l = o.slice(4, -1).trim();
31
+ return getComputedStyle(document.documentElement).getPropertyValue(l).trim() || o;
32
+ }
33
+ const s = () => {
34
+ if (!r.value) return;
35
+ t || (t = g.init(r.value));
36
+ const o = e.colors.map(n);
37
+ t.setOption({
38
+ color: o,
39
+ title: e.title ? {
40
+ text: e.title,
41
+ left: "center",
42
+ textStyle: {
43
+ fontSize: 14,
44
+ fontWeight: 600,
45
+ color: n("var(--of-text-primary)")
46
+ }
47
+ } : void 0,
26
48
  tooltip: { trigger: "item" },
27
- legend: e.showLegend ? { bottom: 0 } : void 0,
49
+ legend: e.showLegend ? { bottom: 0, textStyle: { color: n("var(--of-text-secondary)") } } : void 0,
28
50
  series: [
29
51
  {
30
52
  type: "pie",
31
53
  radius: e.doughnut ? ["45%", "70%"] : "65%",
32
54
  center: ["50%", e.showLegend ? "45%" : "50%"],
33
55
  data: e.data,
34
- label: { formatter: "{b}: {d}%" }
56
+ label: { formatter: "{b}: {d}%" },
57
+ itemStyle: {
58
+ borderColor: n("var(--of-surface-elevated)"),
59
+ borderWidth: 2
60
+ }
35
61
  }
36
62
  ]
37
- }));
63
+ });
38
64
  };
39
- return d(() => {
40
- a(), o.value && (n = new ResizeObserver(() => t == null ? void 0 : t.resize()), n.observe(o.value));
41
- }), i(() => {
42
- n == null || n.disconnect(), t == null || t.dispose();
43
- }), u(() => [e.title, e.data, e.colors, e.doughnut, e.showLegend], a, {
65
+ return f(() => {
66
+ s(), r.value && (a = new ResizeObserver(() => t == null ? void 0 : t.resize()), a.observe(r.value));
67
+ }), u(() => {
68
+ a == null || a.disconnect(), t == null || t.dispose();
69
+ }), m(() => [e.title, e.data, e.colors, e.doughnut, e.showLegend], s, {
44
70
  deep: !0
45
- }), (v, g) => (f(), c("div", h, [
46
- p("div", {
71
+ }), (o, l) => (p(), h("div", y, [
72
+ v("div", {
47
73
  ref_key: "chartRef",
48
- ref: o,
74
+ ref: r,
49
75
  class: "of-dashboard-chart__canvas"
50
76
  }, null, 512)
51
77
  ]));
52
78
  }
53
79
  });
54
80
  export {
55
- x as default
81
+ C as default
56
82
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableChart.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-2b60cfd2"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6b6fb763"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -20,5 +20,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
20
20
  columns: number;
21
21
  gap: number;
22
22
  widgets: DashboardWidget[];
23
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
24
+ dashboardRef: HTMLElement;
25
+ }, HTMLElement>;
24
26
  export default _default;
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d68d4403"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-eff3b1be"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as m, defineAsyncComponent as t, computed as s, openBlock as o, createElementBlock as r, createElementVNode as n, toDisplayString as u, normalizeStyle as i, Fragment as f, renderList as b, createBlock as y, resolveDynamicComponent as _, mergeProps as h } from "vue";
2
- const g = { class: "of-dashboard" }, S = { class: "of-dashboard__header" }, v = { class: "of-dashboard__title" }, C = /* @__PURE__ */ m({
1
+ import { defineComponent as M, defineAsyncComponent as o, ref as h, computed as s, onMounted as k, onBeforeUnmount as w, openBlock as d, createElementBlock as u, createElementVNode as c, toDisplayString as D, normalizeStyle as b, Fragment as R, renderList as x, createBlock as C, resolveDynamicComponent as B, mergeProps as E } from "vue";
2
+ const F = { class: "of-dashboard__header" }, T = { class: "of-dashboard__title" }, I = /* @__PURE__ */ M({
3
3
  __name: "index",
4
4
  props: {
5
5
  title: { default: "Dashboard" },
@@ -7,17 +7,45 @@ const g = { class: "of-dashboard" }, S = { class: "of-dashboard__header" }, v =
7
7
  columns: { default: 4 },
8
8
  gap: { default: 16 }
9
9
  },
10
- setup(l) {
11
- const a = l, d = {
12
- bar: t(() => import("./charts/BarChart.vue.js")),
13
- pie: t(() => import("./charts/PieChart.vue.js")),
14
- doughnut: t(() => import("./charts/DoughnutChart.vue2.js")),
15
- "number-card": t(() => import("./charts/NumberCard.vue.js")),
16
- table: t(() => import("./charts/TableChart.vue.js"))
17
- }, c = s(() => ({
18
- gridTemplateColumns: `repeat(${a.columns}, minmax(0, 1fr))`,
19
- gap: `${a.gap}px`
20
- })), p = s(() => a.widgets.length > 0 ? a.widgets : [
10
+ setup(p) {
11
+ const r = p, v = {
12
+ bar: o(() => import("./charts/BarChart.vue.js")),
13
+ pie: o(() => import("./charts/PieChart.vue.js")),
14
+ doughnut: o(() => import("./charts/DoughnutChart.vue2.js")),
15
+ "number-card": o(() => import("./charts/NumberCard.vue.js")),
16
+ table: o(() => import("./charts/TableChart.vue.js"))
17
+ }, l = h(null), i = h(0);
18
+ let a = null;
19
+ const y = s(() => Math.max(1, Math.floor(r.columns))), m = s(() => {
20
+ const e = i.value, t = y.value;
21
+ return e ? e < 560 ? 1 : e < 840 ? Math.min(t, 2) : e < 1120 ? Math.min(t, 3) : t : t;
22
+ }), g = s(() => ({
23
+ "--dashboard-columns": String(m.value),
24
+ gap: `${r.gap}px`
25
+ }));
26
+ function f(e) {
27
+ var t;
28
+ if (e) {
29
+ i.value = Math.round(e.contentRect.width);
30
+ return;
31
+ }
32
+ i.value = Math.round(((t = l.value) == null ? void 0 : t.getBoundingClientRect().width) ?? 0);
33
+ }
34
+ k(() => {
35
+ f(), !(typeof ResizeObserver > "u" || !l.value) && (a = new ResizeObserver((e) => {
36
+ e[0] && f(e[0]);
37
+ }), a.observe(l.value));
38
+ }), w(() => {
39
+ a == null || a.disconnect(), a = null;
40
+ });
41
+ function _(e) {
42
+ const t = m.value;
43
+ return {
44
+ gridColumn: `span ${Math.min(e.colSpan ?? 1, t)}`,
45
+ gridRow: `span ${e.rowSpan ?? 1}`
46
+ };
47
+ }
48
+ const S = s(() => r.widgets.length > 0 ? r.widgets : [
21
49
  {
22
50
  id: "metric-1",
23
51
  type: "number-card",
@@ -69,31 +97,32 @@ const g = { class: "of-dashboard" }, S = { class: "of-dashboard__header" }, v =
69
97
  colSpan: 4
70
98
  }
71
99
  ]);
72
- return (k, D) => (o(), r("section", g, [
73
- n("header", S, [
74
- n("h3", v, u(l.title), 1)
100
+ return (e, t) => (d(), u("section", {
101
+ ref_key: "dashboardRef",
102
+ ref: l,
103
+ class: "of-dashboard"
104
+ }, [
105
+ c("header", F, [
106
+ c("h3", T, D(p.title), 1)
75
107
  ]),
76
- n("div", {
108
+ c("div", {
77
109
  class: "of-dashboard__grid",
78
- style: i(c.value)
110
+ style: b(g.value)
79
111
  }, [
80
- (o(!0), r(f, null, b(p.value, (e) => (o(), r("article", {
81
- key: e.id,
112
+ (d(!0), u(R, null, x(S.value, (n) => (d(), u("article", {
113
+ key: n.id,
82
114
  class: "of-dashboard__item",
83
- style: i({
84
- gridColumn: `span ${e.colSpan ?? 1}`,
85
- gridRow: `span ${e.rowSpan ?? 1}`
86
- })
115
+ style: b(_(n))
87
116
  }, [
88
- (o(), y(_(d[e.type]), h({
89
- title: e.title,
90
- data: e.data
91
- }, { ref_for: !0 }, e.config ?? {}), null, 16, ["title", "data"]))
117
+ (d(), C(B(v[n.type]), E({
118
+ title: n.title,
119
+ data: n.data
120
+ }, { ref_for: !0 }, n.config ?? {}), null, 16, ["title", "data"]))
92
121
  ], 4))), 128))
93
122
  ], 4)
94
- ]));
123
+ ], 512));
95
124
  }
96
125
  });
97
126
  export {
98
- C as default
127
+ I as default
99
128
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AiMessageBubble.vue2.js";
2
2
  /* empty css */
3
- import e from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-8ed0bf6d"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5ca6c2bf"]]);
5
5
  export {
6
- a as default
6
+ s as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AiSender.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3d40431f"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7260094c"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AiThinking.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-f40004bf"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-94f5b5b9"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import o from "./UserMessageBubble.vue2.js";
1
+ import e from "./UserMessageBubble.vue2.js";
2
2
  /* empty css */
3
- import e from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-0a14f8b1"]]);
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-c82f767e"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ColorPanel.vue2.js";
2
2
  /* empty css */
3
- import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fe537ba5"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-a4b061a3"]]);
5
5
  export {
6
- f as default
6
+ p as default
7
7
  };
@@ -1,22 +1,22 @@
1
- import { defineComponent as p, computed as _, openBlock as s, createElementBlock as d, normalizeClass as h, createElementVNode as o, toDisplayString as r, withDirectives as u, vModelText as b, createCommentVNode as v, Fragment as k, renderList as y, normalizeStyle as V } from "vue";
2
- const C = { class: "of-color-panel__header" }, g = { class: "of-color-panel__label" }, w = { class: "of-color-panel__value" }, x = { class: "of-color-panel__picker-row" }, B = ["aria-label", "disabled"], P = ["aria-label", "disabled"], $ = { class: "of-color-panel__presets" }, z = ["title", "disabled", "onClick"], I = /* @__PURE__ */ p({
1
+ import { defineComponent as f, computed as _, openBlock as s, createElementBlock as d, normalizeClass as h, createElementVNode as o, toDisplayString as r, withDirectives as u, vModelText as b, createCommentVNode as v, Fragment as k, renderList as y, normalizeStyle as V } from "vue";
2
+ const C = { class: "of-color-panel__header" }, g = { class: "of-color-panel__label" }, w = { class: "of-color-panel__value" }, x = { class: "of-color-panel__picker-row" }, B = ["aria-label", "disabled"], P = ["aria-label", "disabled"], $ = { class: "of-color-panel__presets" }, z = ["title", "disabled", "onClick"], I = /* @__PURE__ */ f({
3
3
  __name: "ColorPanel",
4
4
  props: {
5
5
  modelValue: {},
6
- presets: { default: () => ["#3b82f6", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6", "#06b6d4"] },
6
+ presets: { default: () => ["#0f172a", "#334155", "#526071", "#7a8797", "#dbe2ea", "#eceff3"] },
7
7
  showInput: { type: Boolean, default: !0 },
8
8
  disabled: { type: Boolean },
9
9
  label: { default: "颜色" }
10
10
  },
11
11
  emits: ["update:modelValue", "change"],
12
- setup(e, { emit: f }) {
13
- const i = e, c = f, a = _({
14
- get: () => i.modelValue || "#3b82f6",
12
+ setup(e, { emit: m }) {
13
+ const i = e, c = m, a = _({
14
+ get: () => i.modelValue || "#526071",
15
15
  set: (t) => {
16
16
  c("update:modelValue", t), c("change", t);
17
17
  }
18
18
  });
19
- function m(t) {
19
+ function p(t) {
20
20
  i.disabled || (a.value = t);
21
21
  }
22
22
  return (t, n) => (s(), d("div", {
@@ -43,7 +43,7 @@ const C = { class: "of-color-panel__header" }, g = { class: "of-color-panel__lab
43
43
  type: "text",
44
44
  "aria-label": `${e.label}值输入`,
45
45
  disabled: e.disabled,
46
- placeholder: "#3b82f6"
46
+ placeholder: "#526071"
47
47
  }, null, 8, P)), [
48
48
  [b, a.value]
49
49
  ]) : v("", !0)
@@ -56,7 +56,7 @@ const C = { class: "of-color-panel__header" }, g = { class: "of-color-panel__lab
56
56
  title: l,
57
57
  style: V({ backgroundColor: l }),
58
58
  disabled: e.disabled,
59
- onClick: (D) => m(l)
59
+ onClick: (D) => p(l)
60
60
  }, null, 12, z))), 128))
61
61
  ])
62
62
  ], 2));
@@ -1,7 +1,7 @@
1
1
  import o from "./FileUpload.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d1f9fdba"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b69b7dff"]]);
5
5
  export {
6
- r as default
6
+ a as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./PersonPanel.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-00c38dd5"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0034e3b8"]]);
5
5
  export {
6
6
  m as default
7
7
  };