@arronqzy/vue-view 0.1.14 → 0.1.16

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arronqzy/vue-view",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Vue 3 visual view editor for Abuilder (Ant Design Vue)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,13 +23,13 @@
23
23
  "selecto": "^1.26.3",
24
24
  "uuid": "^13.0.0",
25
25
  "vue": "^3.5.13",
26
- "@arronqzy/blueprint-dsl": "1.0.13",
27
- "@arronqzy/i18n": "0.1.10",
28
- "@arronqzy/rx-store": "1.0.7",
29
- "@arronqzy/view-table": "0.1.7",
30
- "@arronqzy/view-scene3d": "0.1.4",
31
- "@arronqzy/vue-blueprint": "0.1.11",
32
- "@arronqzy/vue-rx-store": "0.1.5"
26
+ "@arronqzy/blueprint-dsl": "1.0.14",
27
+ "@arronqzy/view-scene3d": "0.1.5",
28
+ "@arronqzy/i18n": "0.1.11",
29
+ "@arronqzy/view-table": "0.1.8",
30
+ "@arronqzy/vue-blueprint": "0.1.12",
31
+ "@arronqzy/vue-rx-store": "0.1.6",
32
+ "@arronqzy/rx-store": "1.0.8"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "vue": "^3.4.0"
@@ -2,6 +2,7 @@ import type { EChartsOption } from "echarts";
2
2
  import type { PanelChartConfig, PanelElement } from "../types";
3
3
 
4
4
  const DEFAULT_CHART_VALUES = [12, 18, 9, 24];
5
+ const DEFAULT_CHART_LABELS = ["A", "B", "C", "D"];
5
6
 
6
7
  export function getChartValuesDisplayText(chart?: PanelChartConfig): string {
7
8
  if (chart?.valuesText !== undefined) return chart.valuesText;
@@ -13,10 +14,26 @@ export function getChartLabelsDisplayText(chart?: PanelChartConfig): string {
13
14
  return (chart?.labels ?? []).join(",");
14
15
  }
15
16
 
17
+ export function parseChartLabelsFromText(
18
+ text: string | undefined,
19
+ fallback: string[] = DEFAULT_CHART_LABELS
20
+ ): string[] {
21
+ if (text === undefined) return fallback;
22
+ const trimmed = text.trim();
23
+ if (!trimmed) return fallback;
24
+ const parts = trimmed.split(",").map((s) => s.trim()).filter(Boolean);
25
+ if (!parts.length) return fallback;
26
+ return parts;
27
+ }
28
+
16
29
  export function resolveChartLabels(element: PanelElement): string[] {
17
30
  const chart = element.chart;
31
+ if (chart?.labelsText !== undefined) {
32
+ const parsed = parseChartLabelsFromText(chart.labelsText, []);
33
+ return parsed.length ? parsed : DEFAULT_CHART_LABELS;
34
+ }
18
35
  if (chart?.labels?.length) return chart.labels;
19
- return ["A", "B", "C", "D"];
36
+ return DEFAULT_CHART_LABELS;
20
37
  }
21
38
 
22
39
  export function parseChartValuesFromText(