@bridge-ui/vue 0.17.2 → 0.18.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.
- package/ai/skills/bridge-ui-components/SKILL.md +33 -33
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +1 -1
- package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ChartAxis/chartAxis.types.d.ts +17 -7
- package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +2 -2
- package/dist/Components/ChartAxis/composables/useChartAxis.js +15 -10
- package/dist/Components/ChartBar/ChartBar.js +5 -0
- package/dist/Components/ChartBar/ChartBar.vue.d.ts +16 -0
- package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/Components/ChartBar/chartBar.types.d.ts +56 -0
- package/dist/Components/ChartBar/composables/useChartBar.d.ts +26 -0
- package/dist/Components/ChartBar/composables/useChartBar.js +13 -0
- package/dist/Components/ChartBar/index.d.ts +4 -0
- package/dist/Components/ChartBar/index.js +4 -0
- package/dist/Components/ChartBarSeries/ChartBarSeries.js +5 -0
- package/dist/Components/ChartBarSeries/ChartBarSeries.vue.d.ts +6 -0
- package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +45 -0
- package/dist/Components/ChartBarSeries/composables/useChartBarSeries.d.ts +5 -0
- package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +20 -0
- package/dist/Components/ChartBarSeries/index.d.ts +3 -0
- package/dist/Components/ChartBarSeries/index.js +3 -0
- package/dist/Components/ChartFunnel/ChartFunnel.js +5 -0
- package/dist/Components/ChartFunnel/ChartFunnel.vue.d.ts +16 -0
- package/dist/Components/ChartFunnel/ChartFunnel.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/Components/ChartFunnel/chartFunnel.types.d.ts +54 -0
- package/dist/Components/ChartFunnel/composables/useChartFunnel.d.ts +29 -0
- package/dist/Components/ChartFunnel/composables/useChartFunnel.js +68 -0
- package/dist/Components/ChartFunnel/index.d.ts +4 -0
- package/dist/Components/ChartFunnel/index.js +4 -0
- package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +2 -0
- package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -13
- package/dist/Components/ChartLegend/chartLegend.types.d.ts +41 -5
- package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +9 -5
- package/dist/Components/ChartLegend/composables/useChartLegend.js +88 -54
- package/dist/Components/ChartLine/ChartLine.js +5 -0
- package/dist/Components/ChartLine/ChartLine.vue.d.ts +20 -0
- package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/Components/ChartLine/chartLine.types.d.ts +72 -0
- package/dist/Components/ChartLine/composables/useChartLine.d.ts +26 -0
- package/dist/Components/ChartLine/composables/useChartLine.js +13 -0
- package/dist/Components/ChartLine/index.d.ts +4 -0
- package/dist/Components/ChartLine/index.js +4 -0
- package/dist/Components/ChartLineSeries/ChartLineSeries.js +5 -0
- package/dist/Components/ChartLineSeries/ChartLineSeries.vue.d.ts +10 -0
- package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +75 -0
- package/dist/Components/ChartLineSeries/composables/useChartLineSeries.d.ts +5 -0
- package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +25 -0
- package/dist/Components/ChartLineSeries/index.d.ts +3 -0
- package/dist/Components/ChartLineSeries/index.js +3 -0
- package/dist/Components/ChartPie/ChartPie.js +5 -0
- package/dist/Components/ChartPie/ChartPie.vue.d.ts +15 -0
- package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/ChartPie/chartPie.types.d.ts +73 -0
- package/dist/Components/ChartPie/composables/useChartPie.d.ts +30 -0
- package/dist/Components/ChartPie/composables/useChartPie.js +71 -0
- package/dist/Components/ChartPie/index.d.ts +4 -0
- package/dist/Components/ChartPie/index.js +4 -0
- package/dist/Components/ChartScatter/ChartScatter.js +5 -0
- package/dist/Components/{Chart/Chart.vue.d.ts → ChartScatter/ChartScatter.vue.d.ts} +3 -2
- package/dist/Components/ChartScatter/ChartScatter.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/Components/ChartScatter/chartScatter.types.d.ts +23 -0
- package/dist/Components/ChartScatter/composables/useChartScatter.d.ts +29 -0
- package/dist/Components/ChartScatter/composables/useChartScatter.js +103 -0
- package/dist/Components/ChartScatter/index.d.ts +4 -0
- package/dist/Components/ChartScatter/index.js +4 -0
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.js +5 -0
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue.d.ts +4 -0
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +38 -0
- package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.d.ts +4 -0
- package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +18 -0
- package/dist/Components/ChartScatterSeries/index.d.ts +3 -0
- package/dist/Components/ChartScatterSeries/index.js +3 -0
- package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +18 -10
- package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +24 -9
- package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +3 -1
- package/dist/Components/ChartTooltip/composables/useChartTooltip.js +79 -65
- package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -1
- package/dist/Components/DatePicker/composables/useDatePicker.js +1 -1
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +1 -1
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +1 -1
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +1 -1
- package/dist/Components/FormField/composables/useFormField.js +3 -1
- package/dist/Components/OtpField/composables/useOtpField.js +90 -89
- package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
- package/dist/Components/Spinner/composables/useSpinner.d.ts +1 -1
- package/dist/Components/TimePicker/composables/useTimePicker.js +1 -1
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +1 -1
- package/dist/Utils/Charts/ChartFrame.js +5 -0
- package/dist/Utils/Charts/ChartFrame.vue.d.ts +24 -0
- package/dist/Utils/Charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/{Components/Chart → Utils/Charts}/chart.types.d.ts +16 -18
- package/dist/Utils/Charts/chartInjectionKey.d.ts +151 -0
- package/dist/{Components/Chart → Utils/Charts}/chartInjectionKey.js +2 -2
- package/dist/Utils/Charts/echarts/bar.d.ts +6 -0
- package/dist/Utils/Charts/echarts/bar.js +22 -0
- package/dist/Utils/Charts/echarts/cartesian.d.ts +15 -0
- package/dist/Utils/Charts/echarts/cartesian.js +255 -0
- package/dist/Utils/Charts/echarts/funnel.d.ts +15 -0
- package/dist/Utils/Charts/echarts/funnel.js +79 -0
- package/dist/Utils/Charts/echarts/line.d.ts +5 -0
- package/dist/Utils/Charts/echarts/line.js +19 -0
- package/dist/Utils/Charts/echarts/part.d.ts +19 -0
- package/dist/Utils/Charts/echarts/part.js +45 -0
- package/dist/Utils/Charts/echarts/pie.d.ts +14 -0
- package/dist/Utils/Charts/echarts/pie.js +75 -0
- package/dist/Utils/Charts/echarts/plot.d.ts +44 -0
- package/dist/Utils/Charts/echarts/plot.js +52 -0
- package/dist/Utils/Charts/echarts/scatter.d.ts +14 -0
- package/dist/Utils/Charts/echarts/scatter.js +152 -0
- package/dist/Utils/Charts/index.d.ts +6 -0
- package/dist/Utils/Charts/index.js +6 -0
- package/dist/Utils/Charts/useChartCartesian.d.ts +57 -0
- package/dist/Utils/Charts/useChartCartesian.js +155 -0
- package/dist/Utils/Charts/useChartPart.d.ts +45 -0
- package/dist/Utils/Charts/useChartPart.js +97 -0
- package/dist/Utils/Charts/useChartRegistry.d.ts +13 -0
- package/dist/Utils/Charts/useChartRegistry.js +40 -0
- package/dist/Utils/Charts/useChartRoot.d.ts +156 -0
- package/dist/Utils/Charts/useChartRoot.js +342 -0
- package/dist/Utils/Charts/useChartSeries.d.ts +10 -0
- package/dist/Utils/Charts/useChartSeries.js +22 -0
- package/dist/augments.d.ts +23 -7
- package/docs/README.md +6 -1
- package/docs/components/Chart.md +114 -154
- package/docs/components/ChartBar.md +137 -0
- package/docs/components/ChartFunnel.md +62 -0
- package/docs/components/ChartLine.md +151 -0
- package/docs/components/ChartPie.md +115 -0
- package/docs/components/ChartScatter.md +84 -0
- package/package.json +2 -2
- package/dist/Components/Chart/Chart.js +0 -5
- package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +0 -52
- package/dist/Components/Chart/chartInjectionKey.d.ts +0 -94
- package/dist/Components/Chart/composables/useChart.d.ts +0 -40
- package/dist/Components/Chart/composables/useChart.js +0 -346
- package/dist/Components/Chart/echartsChart.d.ts +0 -14
- package/dist/Components/Chart/echartsChart.js +0 -199
- package/dist/Components/Chart/index.d.ts +0 -4
- package/dist/Components/Chart/index.js +0 -4
- package/dist/Components/ChartSeries/ChartSeries.js +0 -5
- package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +0 -4
- package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +0 -24
- package/dist/Components/ChartSeries/chartSeries.types.d.ts +0 -37
- package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +0 -10
- package/dist/Components/ChartSeries/composables/useChartSeries.js +0 -29
- package/dist/Components/ChartSeries/index.d.ts +0 -3
- package/dist/Components/ChartSeries/index.js +0 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { MergeHtmlProps } from '@bridge-ui/core/Utils';
|
|
3
|
+
import { ChartRootOwnProps } from '../../Utils/Charts';
|
|
4
|
+
/**
|
|
5
|
+
* Scatter / bubble chart root. Compose with `ChartScatterSeries`,
|
|
6
|
+
* `ChartAxis`, `ChartLegend`, and `ChartTooltip`. Both axes are numeric.
|
|
7
|
+
*/
|
|
8
|
+
export interface ChartScatterOwnProps extends ChartRootOwnProps {
|
|
9
|
+
/**
|
|
10
|
+
* Min / max bubble diameter (px) for `[x, y, size]` points. Sizes scale by
|
|
11
|
+
* area across all series.
|
|
12
|
+
*
|
|
13
|
+
* @default [8, 40]
|
|
14
|
+
*/
|
|
15
|
+
bubbleSize?: [number, number];
|
|
16
|
+
/**
|
|
17
|
+
* Point diameter (px) for `[x, y]` points.
|
|
18
|
+
*
|
|
19
|
+
* @default 8
|
|
20
|
+
*/
|
|
21
|
+
symbolSize?: number;
|
|
22
|
+
}
|
|
23
|
+
export type ChartScatterProps = MergeHtmlProps<ChartScatterOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChartScatterRenderOptions } from '@bridge-ui/core/Domain';
|
|
2
|
+
import { ChartScatterOwnProps } from '../chartScatter.types';
|
|
3
|
+
import { ChartRootMerged } from '../../../Utils/Charts';
|
|
4
|
+
type ChartScatterMerged = ChartRootMerged & Pick<ChartScatterOwnProps, "bubbleSize" | "symbolSize">;
|
|
5
|
+
export declare function useChartScatter(props: ChartScatterOwnProps, libDefaults: Partial<ChartScatterMerged>): {
|
|
6
|
+
frame: {
|
|
7
|
+
label: import('vue').ComputedRef<string>;
|
|
8
|
+
table: import('vue').ComputedRef<import('@bridge-ui/core/Domain').ChartTable>;
|
|
9
|
+
isEmpty: import('vue').ComputedRef<boolean>;
|
|
10
|
+
hostBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
11
|
+
plotBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
12
|
+
rootBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
13
|
+
liveBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
14
|
+
emptyBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
15
|
+
isLoading: import('vue').ComputedRef<boolean>;
|
|
16
|
+
tableBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
17
|
+
centerBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
18
|
+
loadingBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
|
|
19
|
+
announcement: import('vue').ComputedRef<string>;
|
|
20
|
+
emptyMessage: import('vue').ComputedRef<string>;
|
|
21
|
+
rootRef: import('vue').ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
|
|
22
|
+
plotRef: import('vue').ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
|
|
23
|
+
hostRef: import('vue').ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
|
|
24
|
+
};
|
|
25
|
+
merged: import('vue').ComputedRef<ChartScatterMerged>;
|
|
26
|
+
context: import('vue').ComputedRef<import('../../../Utils/Charts').ChartContextValue>;
|
|
27
|
+
options: import('vue').ComputedRef<ChartScatterRenderOptions | null>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useChartRegistry as e } from "../../../Utils/Charts/useChartRegistry.js";
|
|
2
|
+
import { chartRootBridgeKeys as t, toChartLegendItems as n, useChartColors as r, useChartContextValue as i, useChartFrame as a, useChartPlot as o, useChartRoot as s } from "../../../Utils/Charts/useChartRoot.js";
|
|
3
|
+
import { mountEchartsScatter as c } from "../../../Utils/Charts/echarts/scatter.js";
|
|
4
|
+
import { computed as l } from "vue";
|
|
5
|
+
import { isNil as u } from "es-toolkit/compat";
|
|
6
|
+
import { DEFAULT_CHART_BUBBLE_SIZE as d, DEFAULT_CHART_SYMBOL_SIZE as f, getChartBubbleSizeDomain as p, getChartScatterPoints as m, getChartScatterTable as h, getChartScatterTooltip as g, isChartScatterEmpty as _ } from "@bridge-ui/core/Domain";
|
|
7
|
+
//#region src/Components/ChartScatter/composables/useChartScatter.ts
|
|
8
|
+
var v = [
|
|
9
|
+
...t,
|
|
10
|
+
"bubbleSize",
|
|
11
|
+
"symbolSize"
|
|
12
|
+
], y = [
|
|
13
|
+
"size",
|
|
14
|
+
"height",
|
|
15
|
+
"classes",
|
|
16
|
+
"animation",
|
|
17
|
+
"symbolSize",
|
|
18
|
+
"customProps"
|
|
19
|
+
];
|
|
20
|
+
function b(t, b) {
|
|
21
|
+
let x = s({
|
|
22
|
+
props: t,
|
|
23
|
+
libDefaults: b,
|
|
24
|
+
componentName: "ChartScatter",
|
|
25
|
+
bridgeKeys: v,
|
|
26
|
+
registryKeys: y
|
|
27
|
+
}), S = e(), { merged: C, hidden: w, locale: T, resolveMessage: E } = x, D = l(() => JSON.stringify(t.bubbleSize ?? C.value.bubbleSize ?? d)), O = l(() => JSON.parse(D.value)), k = r(x, () => S.entries.value), A = l(() => S.entries.value.filter((e) => !w.value.includes(e.id)).map((e) => ({
|
|
28
|
+
...e,
|
|
29
|
+
color: k.value[e.id] ?? ""
|
|
30
|
+
}))), j = l(() => m(A.value)), M = l(() => {
|
|
31
|
+
let e = x.theme.value;
|
|
32
|
+
return u(e) ? null : {
|
|
33
|
+
theme: e,
|
|
34
|
+
points: j.value,
|
|
35
|
+
series: A.value,
|
|
36
|
+
bubbleSize: O.value,
|
|
37
|
+
animation: x.animation.value,
|
|
38
|
+
width: x.plotSize.value.width,
|
|
39
|
+
height: x.plotSize.value.height,
|
|
40
|
+
xAxis: { ...S.axes.value.x },
|
|
41
|
+
yAxis: { ...S.axes.value.y },
|
|
42
|
+
sizeDomain: p(A.value),
|
|
43
|
+
symbolSize: C.value.symbolSize ?? f
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
o(x, {
|
|
47
|
+
options: M,
|
|
48
|
+
mount: c
|
|
49
|
+
});
|
|
50
|
+
let N = l(() => ({
|
|
51
|
+
size: E("Size"),
|
|
52
|
+
x: S.axes.value.x?.label ?? "x",
|
|
53
|
+
y: S.axes.value.y?.label ?? "y"
|
|
54
|
+
})), P = l(() => {
|
|
55
|
+
let e = x.active.value.index, t = u(e) ? void 0 : j.value[e], n = u(t) ? void 0 : A.value[t.seriesIndex];
|
|
56
|
+
return u(t) || u(n) ? null : g({
|
|
57
|
+
point: t,
|
|
58
|
+
series: n,
|
|
59
|
+
labels: {
|
|
60
|
+
...N.value,
|
|
61
|
+
size: n.sizeName ?? N.value.size
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
frame: a(x, l(() => {
|
|
67
|
+
let e = S.entries.value;
|
|
68
|
+
return {
|
|
69
|
+
tooltip: P.value,
|
|
70
|
+
count: j.value.length,
|
|
71
|
+
isEmpty: _(e),
|
|
72
|
+
summary: E("Scatter chart with {{count}} series ({{names}}) and {{points}} points.", {
|
|
73
|
+
count: e.length,
|
|
74
|
+
points: m(e).length,
|
|
75
|
+
names: e.map((e) => e.name).join(", ")
|
|
76
|
+
}),
|
|
77
|
+
table: h({
|
|
78
|
+
series: e,
|
|
79
|
+
locale: T.value,
|
|
80
|
+
headers: {
|
|
81
|
+
x: N.value.x,
|
|
82
|
+
y: N.value.y,
|
|
83
|
+
series: E("Series"),
|
|
84
|
+
size: e.find((e) => !u(e.sizeName))?.sizeName ?? N.value.size
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
};
|
|
88
|
+
})),
|
|
89
|
+
merged: C,
|
|
90
|
+
context: i(x, l(() => ({
|
|
91
|
+
tooltip: P.value,
|
|
92
|
+
setAxis: S.setAxis,
|
|
93
|
+
family: "scatter",
|
|
94
|
+
removeAxis: S.removeAxis,
|
|
95
|
+
upsertSeries: S.upsertSeries,
|
|
96
|
+
removeSeries: S.removeSeries,
|
|
97
|
+
legendItems: n(S.entries.value, k.value, w.value)
|
|
98
|
+
}))),
|
|
99
|
+
options: M
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { b as useChartScatter };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ChartScatterOwnProps, ChartScatterProps, } from './chartScatter.types';
|
|
2
|
+
export { default as ChartScatter } from './ChartScatter.vue';
|
|
3
|
+
export { useChartScatter } from './composables/useChartScatter';
|
|
4
|
+
export { useChartContext, type ChartClasses, type ChartColorOverrides, type ChartColorValue, type ChartContextValue, type ChartCustomProps, type ChartSizeOverrides, type ChartSlots, } from '../../Utils/Charts';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChartScatterSeriesOwnProps } from './chartScatterSeries.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<ChartScatterSeriesOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ChartScatterSeriesOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useChartScatterSeries as e } from "./composables/useChartScatterSeries.js";
|
|
2
|
+
import { createElementBlock as t, defineComponent as n, openBlock as r } from "vue";
|
|
3
|
+
//#region src/Components/ChartScatterSeries/ChartScatterSeries.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var i = {
|
|
5
|
+
hidden: "",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, a = /*@__PURE__*/ n({
|
|
8
|
+
__name: "ChartScatterSeries",
|
|
9
|
+
props: {
|
|
10
|
+
color: {},
|
|
11
|
+
data: {},
|
|
12
|
+
name: {},
|
|
13
|
+
sizeName: {},
|
|
14
|
+
symbolSize: {}
|
|
15
|
+
},
|
|
16
|
+
setup(n) {
|
|
17
|
+
return e(n), (e, n) => (r(), t("span", i));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { a as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChartScatterPoint } from '@bridge-ui/core/Domain';
|
|
2
|
+
import { ChartColorValue } from '../../Utils/Charts';
|
|
3
|
+
/**
|
|
4
|
+
* One group of points registered on the nearest `ChartScatter`.
|
|
5
|
+
* Renders nothing.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChartScatterSeriesOwnProps {
|
|
8
|
+
/**
|
|
9
|
+
* Series color (token key or CSS color). Falls back to the palette.
|
|
10
|
+
*
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
color?: ChartColorValue;
|
|
14
|
+
/**
|
|
15
|
+
* Points: `[x, y]`, or `[x, y, size]` for bubbles.
|
|
16
|
+
*/
|
|
17
|
+
data: ChartScatterPoint[];
|
|
18
|
+
/**
|
|
19
|
+
* Series name shown in the legend, tooltip, and data table.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* Label for the third value (bubble size) in the tooltip and data table.
|
|
24
|
+
*
|
|
25
|
+
* @default "Size"
|
|
26
|
+
*/
|
|
27
|
+
sizeName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Point diameter (px) for `[x, y]` points. Ignored for bubbles.
|
|
30
|
+
*
|
|
31
|
+
* @default ChartScatter `symbolSize`
|
|
32
|
+
*/
|
|
33
|
+
symbolSize?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* `ChartScatterSeries` has no DOM element, so it takes no HTML attributes.
|
|
37
|
+
*/
|
|
38
|
+
export type ChartScatterSeriesProps = ChartScatterSeriesOwnProps;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useChartSeries as e } from "../../../Utils/Charts/useChartSeries.js";
|
|
2
|
+
//#region src/Components/ChartScatterSeries/composables/useChartScatterSeries.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return { entry: e({
|
|
5
|
+
families: ["scatter"],
|
|
6
|
+
componentName: "ChartScatterSeries",
|
|
7
|
+
entry: () => ({
|
|
8
|
+
kind: "scatter",
|
|
9
|
+
name: t.name,
|
|
10
|
+
data: t.data,
|
|
11
|
+
color: t.color,
|
|
12
|
+
sizeName: t.sizeName,
|
|
13
|
+
symbolSize: t.symbolSize
|
|
14
|
+
})
|
|
15
|
+
}) };
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as useChartScatterSeries };
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import { useChartTooltip as e } from "./composables/useChartTooltip.js";
|
|
2
|
-
import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i,
|
|
2
|
+
import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, guardReactiveProps as s, mergeProps as c, normalizeProps as l, openBlock as u, renderList as d, renderSlot as f, toDisplayString as p, unref as m, useTemplateRef as h } from "vue";
|
|
3
3
|
//#region src/Components/ChartTooltip/ChartTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var g = /*@__PURE__*/ o({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ChartTooltip",
|
|
7
7
|
props: {
|
|
8
8
|
classes: {},
|
|
9
9
|
customProps: {},
|
|
10
|
+
formatPercent: { type: Function },
|
|
10
11
|
formatValue: { type: Function }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
let
|
|
14
|
-
return (e,
|
|
13
|
+
setup(o) {
|
|
14
|
+
let g = o, _ = h("tooltip"), { isOpen: v, context: y, itemBind: b, rootBind: x, labelBind: S, titleBind: C, valueBind: w, percentBind: T, formatValue: E, formatPercent: D, getSwatchBind: O } = e(g, _);
|
|
15
|
+
return (e, o) => m(v) && m(y) ? (u(), r("div", c({
|
|
15
16
|
key: 0,
|
|
16
17
|
ref: "tooltip"
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
}, m(x)), [f(e.$slots, "content", l(s(m(y))), () => [m(y).title ? (u(), r("div", l(c({ key: 0 }, m(C))), [m(y).color ? (u(), r("span", l(c({ key: 0 }, m(O)(m(y).color))), null, 16)) : n("", !0), a(" " + p(m(y).title), 1)], 16)) : n("", !0), (u(!0), r(t, null, d(m(y).items, (e) => (u(), r("div", c({ key: e.id }, { ref_for: !0 }, m(b)), [
|
|
19
|
+
e.color ? (u(), r("span", c({
|
|
20
|
+
key: 0,
|
|
21
|
+
ref_for: !0
|
|
22
|
+
}, m(O)(e.color)), null, 16)) : n("", !0),
|
|
23
|
+
i("span", c({ ref_for: !0 }, m(S)), p(e.name), 17),
|
|
24
|
+
i("span", c({ ref_for: !0 }, m(w)), p(m(E)(e)), 17),
|
|
25
|
+
m(D)(e) === null ? n("", !0) : (u(), r("span", c({
|
|
26
|
+
key: 1,
|
|
27
|
+
ref_for: !0
|
|
28
|
+
}, m(T)), p(m(D)(e)), 17))
|
|
21
29
|
], 16))), 128))])], 16)) : n("", !0);
|
|
22
30
|
}
|
|
23
31
|
});
|
|
24
32
|
//#endregion
|
|
25
|
-
export {
|
|
33
|
+
export { g as default };
|
|
@@ -3,13 +3,17 @@ import { ChartTooltipItem } from '@bridge-ui/core/Domain';
|
|
|
3
3
|
import { MergeHtmlProps } from '@bridge-ui/core/Utils';
|
|
4
4
|
export interface ChartTooltipClasses {
|
|
5
5
|
/**
|
|
6
|
-
* Classes merged onto each
|
|
6
|
+
* Classes merged onto each row.
|
|
7
7
|
*/
|
|
8
8
|
item?: string;
|
|
9
9
|
/**
|
|
10
|
-
* Classes merged onto each
|
|
10
|
+
* Classes merged onto each row label.
|
|
11
11
|
*/
|
|
12
12
|
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Classes merged onto each percent (pie, funnel).
|
|
15
|
+
*/
|
|
16
|
+
percent?: string;
|
|
13
17
|
/**
|
|
14
18
|
* Classes merged onto the tooltip box.
|
|
15
19
|
*/
|
|
@@ -19,7 +23,7 @@ export interface ChartTooltipClasses {
|
|
|
19
23
|
*/
|
|
20
24
|
swatch?: string;
|
|
21
25
|
/**
|
|
22
|
-
* Classes merged onto the category
|
|
26
|
+
* Classes merged onto the title (category, series name).
|
|
23
27
|
*/
|
|
24
28
|
title?: string;
|
|
25
29
|
/**
|
|
@@ -29,17 +33,21 @@ export interface ChartTooltipClasses {
|
|
|
29
33
|
}
|
|
30
34
|
export interface ChartTooltipContentContext {
|
|
31
35
|
/**
|
|
32
|
-
*
|
|
36
|
+
* Swatch color next to the title (scatter series).
|
|
33
37
|
*/
|
|
34
|
-
|
|
38
|
+
color?: string;
|
|
35
39
|
/**
|
|
36
|
-
* Active category
|
|
40
|
+
* Active item index (category, point, slice, or stage).
|
|
37
41
|
*/
|
|
38
42
|
index: number;
|
|
39
43
|
/**
|
|
40
|
-
*
|
|
44
|
+
* Rows: series values, point dimensions, or the active slice.
|
|
41
45
|
*/
|
|
42
46
|
items: ChartTooltipItem[];
|
|
47
|
+
/**
|
|
48
|
+
* Title: the category or series name. Empty for slices.
|
|
49
|
+
*/
|
|
50
|
+
title: string;
|
|
43
51
|
}
|
|
44
52
|
export interface ChartTooltipCustomProps {
|
|
45
53
|
/**
|
|
@@ -50,8 +58,8 @@ export interface ChartTooltipCustomProps {
|
|
|
50
58
|
root?: HTMLAttributes;
|
|
51
59
|
}
|
|
52
60
|
/**
|
|
53
|
-
* Tooltip for the active
|
|
54
|
-
*
|
|
61
|
+
* Tooltip for the active item of the nearest chart (pointer hover or arrow
|
|
62
|
+
* keys on the focused plot).
|
|
55
63
|
*/
|
|
56
64
|
export interface ChartTooltipOwnProps {
|
|
57
65
|
/**
|
|
@@ -66,6 +74,13 @@ export interface ChartTooltipOwnProps {
|
|
|
66
74
|
* @default undefined
|
|
67
75
|
*/
|
|
68
76
|
customProps?: ChartTooltipCustomProps;
|
|
77
|
+
/**
|
|
78
|
+
* Formats each percent (pie, funnel). Defaults to `Intl.NumberFormat`
|
|
79
|
+
* with the Bridge locale.
|
|
80
|
+
*
|
|
81
|
+
* @default undefined
|
|
82
|
+
*/
|
|
83
|
+
formatPercent?: (percent: number, item: ChartTooltipItem) => string;
|
|
69
84
|
/**
|
|
70
85
|
* Formats each value. Defaults to `Intl.NumberFormat` with the Bridge locale.
|
|
71
86
|
*
|
|
@@ -10,6 +10,8 @@ export declare function useChartTooltip(props: ChartTooltipOwnProps, tooltipRef:
|
|
|
10
10
|
labelBind: import('vue').ComputedRef<HTMLAttributes>;
|
|
11
11
|
titleBind: import('vue').ComputedRef<HTMLAttributes>;
|
|
12
12
|
valueBind: import('vue').ComputedRef<HTMLAttributes>;
|
|
13
|
+
percentBind: import('vue').ComputedRef<HTMLAttributes>;
|
|
13
14
|
formatValue: (item: ChartTooltipItem) => string;
|
|
14
|
-
|
|
15
|
+
formatPercent: (item: ChartTooltipItem) => string | null;
|
|
16
|
+
getSwatchBind: (color: string) => HTMLAttributes;
|
|
15
17
|
};
|
|
@@ -1,110 +1,124 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
-
import { useChartContext as r } from "
|
|
2
|
+
import { useChartContext as r } from "../../../Utils/Charts/chartInjectionKey.js";
|
|
3
3
|
import { computed as i, shallowRef as a, useAttrs as o, watch as s } from "vue";
|
|
4
4
|
import { get as c, isEqual as l, isNil as u } from "es-toolkit/compat";
|
|
5
|
-
import {
|
|
6
|
-
import { cn as
|
|
5
|
+
import { formatChartPercent as d, formatChartValue as f, resolveChartTooltipPosition as p } from "@bridge-ui/core/Domain";
|
|
6
|
+
import { cn as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
|
|
7
7
|
//#region src/Components/ChartTooltip/composables/useChartTooltip.ts
|
|
8
|
-
var
|
|
8
|
+
var g = [
|
|
9
9
|
"classes",
|
|
10
10
|
"customProps",
|
|
11
|
-
"formatValue"
|
|
11
|
+
"formatValue",
|
|
12
|
+
"formatPercent"
|
|
12
13
|
];
|
|
13
|
-
function
|
|
14
|
-
let
|
|
14
|
+
function _(_, v) {
|
|
15
|
+
let y = o(), b = r(), x = a(null), S = i(() => h({
|
|
15
16
|
props: {
|
|
16
|
-
...
|
|
17
|
-
...
|
|
17
|
+
...y,
|
|
18
|
+
..._
|
|
18
19
|
},
|
|
19
|
-
bridgeKeys:
|
|
20
|
-
})), { merged:
|
|
20
|
+
bridgeKeys: g
|
|
21
|
+
})), { merged: C, entry: w } = t({
|
|
21
22
|
componentName: "ChartTooltip",
|
|
22
|
-
props: () =>
|
|
23
|
-
}),
|
|
24
|
-
entry:
|
|
25
|
-
props: () =>
|
|
26
|
-
}),
|
|
23
|
+
props: () => S.value.componentProps
|
|
24
|
+
}), T = n({
|
|
25
|
+
entry: w,
|
|
26
|
+
props: () => S.value.componentProps
|
|
27
|
+
}), E = i(() => C.value.customProps), D = i(() => {
|
|
28
|
+
let e = b.value.tooltip;
|
|
29
|
+
return !u(b.value.activeIndex) && !u(e) && e.items.length > 0;
|
|
30
|
+
});
|
|
27
31
|
s([
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
() =>
|
|
31
|
-
() =>
|
|
32
|
+
D,
|
|
33
|
+
v,
|
|
34
|
+
() => b.value.activeIndex,
|
|
35
|
+
() => b.value.tooltip
|
|
32
36
|
], () => {
|
|
33
|
-
let e =
|
|
34
|
-
if (!
|
|
35
|
-
let n =
|
|
37
|
+
let e = v.value, t = b.value.activeIndex;
|
|
38
|
+
if (!D.value || u(e) || u(t)) return;
|
|
39
|
+
let n = b.value.getTooltipAnchor(t), r = u(n) ? null : p({
|
|
36
40
|
anchor: n,
|
|
37
|
-
bounds:
|
|
41
|
+
bounds: b.value.getBounds(),
|
|
38
42
|
size: {
|
|
39
43
|
width: e.offsetWidth,
|
|
40
44
|
height: e.offsetHeight
|
|
41
45
|
}
|
|
42
46
|
});
|
|
43
|
-
l(
|
|
47
|
+
l(x.value, r) || (x.value = r);
|
|
44
48
|
}, {
|
|
45
49
|
flush: "post",
|
|
46
50
|
immediate: !0
|
|
47
51
|
});
|
|
48
|
-
let
|
|
49
|
-
let e =
|
|
50
|
-
return u(e) ? null : {
|
|
52
|
+
let O = i(() => {
|
|
53
|
+
let e = b.value.activeIndex, t = b.value.tooltip;
|
|
54
|
+
return u(e) || u(t) ? null : {
|
|
51
55
|
index: e,
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
color: t.color,
|
|
57
|
+
title: t.title,
|
|
58
|
+
items: t.items
|
|
54
59
|
};
|
|
55
60
|
});
|
|
56
|
-
function
|
|
57
|
-
return
|
|
61
|
+
function k(e) {
|
|
62
|
+
return C.value.formatValue?.(e.value, e) ?? f(e.value, b.value.locale);
|
|
63
|
+
}
|
|
64
|
+
function A(e) {
|
|
65
|
+
return u(e.percent) ? null : C.value.formatPercent?.(e.percent, e) ?? d(e.percent, b.value.locale);
|
|
58
66
|
}
|
|
59
|
-
let
|
|
67
|
+
let j = i(() => e(E.value?.root, S.value.inheritedAttrs, {
|
|
60
68
|
"aria-hidden": !0,
|
|
61
69
|
style: {
|
|
62
|
-
top: `${
|
|
63
|
-
left: `${
|
|
64
|
-
visibility: u(
|
|
70
|
+
top: `${x.value?.top ?? 0}px`,
|
|
71
|
+
left: `${x.value?.left ?? 0}px`,
|
|
72
|
+
visibility: u(x.value) ? "hidden" : "visible"
|
|
65
73
|
},
|
|
66
|
-
class:
|
|
74
|
+
class: m({
|
|
67
75
|
"pointer-events-none absolute z-20 flex min-w-32 flex-col": !0,
|
|
68
76
|
"rounded-md border border-dark-200 bg-white text-dark-700 shadow-lg": !0,
|
|
69
|
-
"dark:border-dark-700 dark:bg-dark-
|
|
70
|
-
[
|
|
71
|
-
[c(
|
|
77
|
+
"dark:border-dark-700 dark:bg-dark-800 dark:text-dark-100": !0,
|
|
78
|
+
[b.value.tokenClasses.tooltip ?? ""]: !0,
|
|
79
|
+
[c(T.value, "root") ?? ""]: !0
|
|
72
80
|
})
|
|
73
|
-
})),
|
|
74
|
-
"font-semibold": !0,
|
|
75
|
-
[c(
|
|
76
|
-
}) })),
|
|
81
|
+
})), M = i(() => ({ class: m({
|
|
82
|
+
"flex items-center gap-2 font-semibold": !0,
|
|
83
|
+
[c(T.value, "title") ?? ""]: !0
|
|
84
|
+
}) })), N = i(() => ({ class: m({
|
|
77
85
|
"flex items-center gap-2": !0,
|
|
78
|
-
[c(
|
|
86
|
+
[c(T.value, "item") ?? ""]: !0
|
|
79
87
|
}) }));
|
|
80
|
-
function
|
|
88
|
+
function P(e) {
|
|
81
89
|
return {
|
|
82
|
-
style: { backgroundColor: e
|
|
83
|
-
class:
|
|
90
|
+
style: { backgroundColor: e },
|
|
91
|
+
class: m({
|
|
84
92
|
"shrink-0 rounded-full": !0,
|
|
85
|
-
[
|
|
86
|
-
[c(
|
|
93
|
+
[b.value.tokenClasses.swatch ?? ""]: !0,
|
|
94
|
+
[c(T.value, "swatch") ?? ""]: !0
|
|
87
95
|
})
|
|
88
96
|
};
|
|
89
97
|
}
|
|
98
|
+
let F = i(() => ({ class: m({
|
|
99
|
+
"flex-1 text-dark-500 dark:text-dark-400": !0,
|
|
100
|
+
[c(T.value, "label") ?? ""]: !0
|
|
101
|
+
}) })), I = i(() => ({ class: m({
|
|
102
|
+
"text-dark-500 tabular-nums dark:text-dark-400": !0,
|
|
103
|
+
[c(T.value, "percent") ?? ""]: !0
|
|
104
|
+
}) }));
|
|
90
105
|
return {
|
|
91
|
-
isOpen:
|
|
92
|
-
merged:
|
|
93
|
-
context:
|
|
94
|
-
itemBind:
|
|
95
|
-
rootBind:
|
|
96
|
-
labelBind:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}) })),
|
|
100
|
-
titleBind: A,
|
|
101
|
-
valueBind: i(() => ({ class: p({
|
|
106
|
+
isOpen: D,
|
|
107
|
+
merged: C,
|
|
108
|
+
context: O,
|
|
109
|
+
itemBind: N,
|
|
110
|
+
rootBind: j,
|
|
111
|
+
labelBind: F,
|
|
112
|
+
titleBind: M,
|
|
113
|
+
valueBind: i(() => ({ class: m({
|
|
102
114
|
"font-medium tabular-nums": !0,
|
|
103
|
-
[c(
|
|
115
|
+
[c(T.value, "value") ?? ""]: !0
|
|
104
116
|
}) })),
|
|
105
|
-
|
|
106
|
-
|
|
117
|
+
percentBind: I,
|
|
118
|
+
formatValue: k,
|
|
119
|
+
formatPercent: A,
|
|
120
|
+
getSwatchBind: P
|
|
107
121
|
};
|
|
108
122
|
}
|
|
109
123
|
//#endregion
|
|
110
|
-
export {
|
|
124
|
+
export { _ as useChartTooltip };
|
|
@@ -111,7 +111,7 @@ function E(f, E, D, O) {
|
|
|
111
111
|
let t = e.shiftKey ? .1 : .01;
|
|
112
112
|
e.key === "ArrowLeft" || e.key === "ArrowDown" ? (e.preventDefault(), Z({ a: z.value.a - t })) : (e.key === "ArrowRight" || e.key === "ArrowUp") && (e.preventDefault(), Z({ a: z.value.a + t }));
|
|
113
113
|
}, me = a(() => t(P.value?.root, F.value, x({
|
|
114
|
-
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-
|
|
114
|
+
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-800": !0,
|
|
115
115
|
"w-full": M.value.fill,
|
|
116
116
|
"w-72": !M.value.fill,
|
|
117
117
|
[K.value]: !0,
|
|
@@ -66,7 +66,7 @@ function g(g, _, v, y) {
|
|
|
66
66
|
rootBind: i(() => {
|
|
67
67
|
let t = u(f, C.value.rounded ?? "md");
|
|
68
68
|
return e(T.value?.root, E.value, p({
|
|
69
|
-
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-
|
|
69
|
+
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-800": !0,
|
|
70
70
|
"w-full": C.value.fill,
|
|
71
71
|
"w-fit": !C.value.fill,
|
|
72
72
|
[t]: !0,
|
|
@@ -65,7 +65,7 @@ function g(g, _, v, y) {
|
|
|
65
65
|
rootBind: i(() => {
|
|
66
66
|
let t = u(f, C.value.rounded ?? "md");
|
|
67
67
|
return e(T.value?.root, E.value, p({
|
|
68
|
-
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-
|
|
68
|
+
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-800": !0,
|
|
69
69
|
"w-full": C.value.fill,
|
|
70
70
|
"w-fit": !C.value.fill,
|
|
71
71
|
[t]: !0,
|
|
@@ -63,7 +63,7 @@ function x(x, S, C, w) {
|
|
|
63
63
|
}, U = a(() => {
|
|
64
64
|
let e = d(_, k.value.rounded ?? "md");
|
|
65
65
|
return t(j.value?.root, M.value, v({
|
|
66
|
-
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-
|
|
66
|
+
"flex flex-col overflow-hidden bg-white shadow-lg dark:bg-dark-800": !0,
|
|
67
67
|
"w-full": k.value.fill,
|
|
68
68
|
"w-fit": !k.value.fill,
|
|
69
69
|
[e]: !0,
|