@bridge-ui/vue 0.18.0 → 0.20.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 +35 -34
- package/ai/skills/bridge-ui-setup/SKILL.md +1 -1
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +257 -265
- package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -1
- package/dist/Components/Calendar/composables/useCalendar.js +192 -187
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +1 -1
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +243 -238
- package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +5 -0
- package/dist/Components/ChartBar/chartBar.types.d.ts +11 -1
- package/dist/Components/ChartBar/composables/useChartBar.js +4 -4
- package/dist/Components/ChartBar/index.d.ts +1 -1
- package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +24 -2
- package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +3 -0
- package/dist/Components/ChartBarSeries/index.d.ts +1 -0
- package/dist/Components/ChartFunnel/composables/useChartFunnel.js +10 -10
- package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ChartLine/chartLine.types.d.ts +7 -0
- package/dist/Components/ChartLine/composables/useChartLine.js +1 -1
- package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +23 -2
- package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +3 -0
- package/dist/Components/ChartLineSeries/index.d.ts +1 -0
- package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/Components/ChartPie/chartPie.types.d.ts +20 -1
- package/dist/Components/ChartPie/composables/useChartPie.d.ts +1 -1
- package/dist/Components/ChartPie/composables/useChartPie.js +39 -29
- package/dist/Components/ChartScatter/composables/useChartScatter.js +63 -58
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +8 -1
- package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +2 -1
- package/dist/Components/ChartScatterSeries/index.d.ts +1 -0
- package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +4 -0
- package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +1 -0
- package/dist/Components/ChartTooltip/composables/useChartTooltip.js +4 -0
- package/dist/Components/DataTable/DataTableColumnsMenu.vue.d.ts +1 -2
- package/dist/Components/DataTable/composables/useDataTable.d.ts +8 -66
- package/dist/Components/DataTable/composables/useDataTable.js +267 -349
- package/dist/Components/DataTable/composables/useDataTableColumnsMenu.d.ts +1 -2
- package/dist/Components/Heading/Heading.js +5 -0
- package/dist/Components/Heading/Heading.vue.d.ts +11 -0
- package/dist/Components/Heading/Heading.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/Components/Heading/composables/useHeading.d.ts +10 -0
- package/dist/Components/Heading/composables/useHeading.js +56 -0
- package/dist/Components/Heading/heading.types.d.ts +56 -0
- package/dist/Components/Heading/index.d.ts +3 -0
- package/dist/Components/Heading/index.js +3 -0
- package/dist/Components/ListItem/composables/useListItem.js +29 -30
- package/dist/Components/Listbox/composables/useListboxNavigation.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListboxNavigation.js +23 -50
- package/dist/Components/Listbox/index.d.ts +1 -1
- package/dist/Components/Listbox/index.js +5 -5
- package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +31 -31
- package/dist/Components/Select/composables/useSelect.js +201 -211
- package/dist/Components/Slider/composables/useSlider.js +93 -122
- package/dist/Components/Text/Text.js +5 -0
- package/dist/Components/Text/Text.vue.d.ts +11 -0
- package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Text/composables/useText.d.ts +9 -0
- package/dist/Components/Text/composables/useText.js +56 -0
- package/dist/Components/Text/index.d.ts +3 -0
- package/dist/Components/Text/index.js +3 -0
- package/dist/Components/Text/text.types.d.ts +76 -0
- package/dist/Utils/Charts/chart.types.d.ts +17 -0
- package/dist/Utils/Charts/chartInjectionKey.d.ts +2 -2
- package/dist/Utils/Charts/index.d.ts +1 -1
- package/dist/Utils/Charts/useChartCartesian.d.ts +4 -2
- package/dist/Utils/Charts/useChartCartesian.js +90 -76
- package/dist/augments.d.ts +10 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +175 -171
- package/docs/README.md +2 -0
- package/docs/components/BridgeUIProvider.md +1 -1
- package/docs/components/Card.md +15 -0
- package/docs/components/Chart.md +17 -10
- package/docs/components/ChartBar.md +70 -17
- package/docs/components/ChartLine.md +57 -16
- package/docs/components/ChartPie.md +33 -10
- package/docs/components/ChartScatter.md +25 -7
- package/docs/components/Heading.md +85 -0
- package/docs/components/Text.md +118 -0
- package/package.json +2 -2
- package/dist/Components/RichTextEditor/tiptapEditor.d.ts +0 -111
- package/dist/Components/RichTextEditor/tiptapEditor.js +0 -121
- package/dist/Utils/Charts/echarts/bar.d.ts +0 -6
- package/dist/Utils/Charts/echarts/bar.js +0 -22
- package/dist/Utils/Charts/echarts/cartesian.d.ts +0 -15
- package/dist/Utils/Charts/echarts/cartesian.js +0 -255
- package/dist/Utils/Charts/echarts/funnel.d.ts +0 -15
- package/dist/Utils/Charts/echarts/funnel.js +0 -79
- package/dist/Utils/Charts/echarts/line.d.ts +0 -5
- package/dist/Utils/Charts/echarts/line.js +0 -19
- package/dist/Utils/Charts/echarts/part.d.ts +0 -19
- package/dist/Utils/Charts/echarts/part.js +0 -45
- package/dist/Utils/Charts/echarts/pie.d.ts +0 -14
- package/dist/Utils/Charts/echarts/pie.js +0 -75
- package/dist/Utils/Charts/echarts/plot.d.ts +0 -44
- package/dist/Utils/Charts/echarts/plot.js +0 -52
- package/dist/Utils/Charts/echarts/scatter.d.ts +0 -14
- package/dist/Utils/Charts/echarts/scatter.js +0 -152
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChartDatum, ChartReference } from '@bridge-ui/core/Domain';
|
|
2
|
-
import { ChartColorValue } from '../../Utils/Charts';
|
|
1
|
+
import { ChartColorRangeAxis, ChartDatum, ChartReference, ChartTone } from '@bridge-ui/core/Domain';
|
|
2
|
+
import { ChartColorRangeOption, ChartColorValue } from '../../Utils/Charts';
|
|
3
3
|
/**
|
|
4
4
|
* One bar series registered on the nearest `ChartBar`. Renders nothing.
|
|
5
5
|
* Unset options fall back to the `ChartBar` props.
|
|
@@ -11,6 +11,21 @@ export interface ChartBarSeriesOwnProps {
|
|
|
11
11
|
* @default undefined
|
|
12
12
|
*/
|
|
13
13
|
color?: ChartColorValue;
|
|
14
|
+
/**
|
|
15
|
+
* What `colorRanges` match: each bar's value, or its category index.
|
|
16
|
+
*
|
|
17
|
+
* @default "value"
|
|
18
|
+
*/
|
|
19
|
+
colorBy?: ChartColorRangeAxis;
|
|
20
|
+
/**
|
|
21
|
+
* Recolors single bars: values in `[min, max)` take the range color.
|
|
22
|
+
* With `colorBy="category"`, `min` and `max` are category indices (both
|
|
23
|
+
* included). Ranges win over `ChartBar` `categoryColors`. Range labels
|
|
24
|
+
* show in the tooltip and data table.
|
|
25
|
+
*
|
|
26
|
+
* @default undefined
|
|
27
|
+
*/
|
|
28
|
+
colorRanges?: ChartColorRangeOption[];
|
|
14
29
|
/**
|
|
15
30
|
* One value per `ChartBar` category. `null` leaves the slot empty.
|
|
16
31
|
*/
|
|
@@ -38,6 +53,13 @@ export interface ChartBarSeriesOwnProps {
|
|
|
38
53
|
* @default ChartBar `stack`
|
|
39
54
|
*/
|
|
40
55
|
stack?: string;
|
|
56
|
+
/**
|
|
57
|
+
* `muted` mixes every bar color toward the background (a comparison or
|
|
58
|
+
* past period next to a `solid` series).
|
|
59
|
+
*
|
|
60
|
+
* @default "solid"
|
|
61
|
+
*/
|
|
62
|
+
tone?: ChartTone;
|
|
41
63
|
}
|
|
42
64
|
/**
|
|
43
65
|
* `ChartBarSeries` has no DOM element, so it takes no HTML attributes.
|
|
@@ -7,11 +7,14 @@ function r(r) {
|
|
|
7
7
|
componentName: "ChartBarSeries",
|
|
8
8
|
entry: () => ({
|
|
9
9
|
kind: "bar",
|
|
10
|
+
tone: r.tone,
|
|
10
11
|
name: r.name,
|
|
11
12
|
data: r.data,
|
|
12
13
|
color: r.color,
|
|
13
14
|
stack: r.stack,
|
|
14
15
|
labels: r.labels,
|
|
16
|
+
colorBy: r.colorBy,
|
|
17
|
+
colorRanges: r.colorRanges,
|
|
15
18
|
reference: n(r.reference) ? void 0 : t(r.reference)
|
|
16
19
|
})
|
|
17
20
|
}) };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { ChartBarSeriesOwnProps, ChartBarSeriesProps, } from './chartBarSeries.types';
|
|
2
2
|
export { default as ChartBarSeries } from './ChartBarSeries.vue';
|
|
3
3
|
export { useChartBarSeries } from './composables/useChartBarSeries';
|
|
4
|
+
export type { ChartColorRangeOption } from '../../Utils/Charts';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { chartRootBridgeKeys as e, useChartRoot as t } from "../../../Utils/Charts/useChartRoot.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useChartPart as n } from "../../../Utils/Charts/useChartPart.js";
|
|
3
|
+
import { computed as r } from "vue";
|
|
4
|
+
import { getChartFunnelPercents as i, getChartFunnelSummaryParams as a, sortChartStages as o } from "@bridge-ui/core/Domain";
|
|
5
|
+
import { mountEchartsFunnel as s } from "@bridge-ui/core/Integrations/Echarts";
|
|
6
6
|
//#region src/Components/ChartFunnel/composables/useChartFunnel.ts
|
|
7
7
|
var c = [
|
|
8
8
|
...e,
|
|
@@ -30,9 +30,9 @@ function u(e, u) {
|
|
|
30
30
|
componentName: "ChartFunnel",
|
|
31
31
|
bridgeKeys: c,
|
|
32
32
|
registryKeys: l
|
|
33
|
-
}), { merged: f, locale: p, resolveMessage: m } = d, h =
|
|
33
|
+
}), { merged: f, locale: p, resolveMessage: m } = d, h = r(() => f.value.labels ?? !0);
|
|
34
34
|
function g(e) {
|
|
35
|
-
return
|
|
35
|
+
return o(e, f.value.sort ?? "descending");
|
|
36
36
|
}
|
|
37
37
|
function _(e) {
|
|
38
38
|
return {
|
|
@@ -43,22 +43,22 @@ function u(e, u) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function v(e) {
|
|
46
|
-
return m("Funnel chart with {{count}} stages, from {{first}} ({{firstValue}}) to {{last}} ({{lastValue}}).",
|
|
46
|
+
return m("Funnel chart with {{count}} stages, from {{first}} ({{firstValue}}) to {{last}} ({{lastValue}}).", a({
|
|
47
47
|
slices: e,
|
|
48
48
|
locale: p.value
|
|
49
49
|
}));
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
|
-
...
|
|
52
|
+
...n(d, {
|
|
53
53
|
order: g,
|
|
54
54
|
summary: v,
|
|
55
55
|
buildOptions: _,
|
|
56
56
|
family: "funnel",
|
|
57
57
|
positiveOnly: !1,
|
|
58
58
|
data: () => e.data,
|
|
59
|
-
mount:
|
|
59
|
+
mount: s,
|
|
60
60
|
labels: () => h.value,
|
|
61
|
-
percents:
|
|
61
|
+
percents: i,
|
|
62
62
|
labelContent: () => e.labelContent
|
|
63
63
|
}),
|
|
64
64
|
merged: f
|
|
@@ -13,6 +13,13 @@ export interface ChartLineOwnProps extends ChartRootOwnProps {
|
|
|
13
13
|
* @default false
|
|
14
14
|
*/
|
|
15
15
|
area?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Opacity (`0`–`1`) of the area fill for every series (per-series
|
|
18
|
+
* `areaOpacity` wins).
|
|
19
|
+
*
|
|
20
|
+
* @default 0.15
|
|
21
|
+
*/
|
|
22
|
+
areaOpacity?: number;
|
|
16
23
|
/**
|
|
17
24
|
* Category labels, or dates for a time axis (points spaced by time).
|
|
18
25
|
* Each series has one value per category.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useChartCartesian as e } from "../../../Utils/Charts/useChartCartesian.js";
|
|
2
|
-
import { mountEchartsLine as t } from "
|
|
2
|
+
import { mountEchartsLine as t } from "@bridge-ui/core/Integrations/Echarts";
|
|
3
3
|
//#region src/Components/ChartLine/composables/useChartLine.ts
|
|
4
4
|
function n(n, r) {
|
|
5
5
|
return e(n, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChartCurve, ChartDatum, ChartReference, ChartStep } from '@bridge-ui/core/Domain';
|
|
2
|
-
import { ChartColorValue } from '../../Utils/Charts';
|
|
1
|
+
import { ChartColorRangeAxis, ChartCurve, ChartDatum, ChartReference, ChartStep } from '@bridge-ui/core/Domain';
|
|
2
|
+
import { ChartColorRangeOption, ChartColorValue } from '../../Utils/Charts';
|
|
3
3
|
/**
|
|
4
4
|
* One line registered on the nearest `ChartLine`, or drawn over the bars of
|
|
5
5
|
* a `ChartBar`. Renders nothing. Unset options fall back to the root props.
|
|
@@ -11,12 +11,33 @@ export interface ChartLineSeriesOwnProps {
|
|
|
11
11
|
* @default ChartLine `area`
|
|
12
12
|
*/
|
|
13
13
|
area?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Opacity (`0`–`1`) of the area fill.
|
|
16
|
+
*
|
|
17
|
+
* @default ChartLine `areaOpacity` (0.15)
|
|
18
|
+
*/
|
|
19
|
+
areaOpacity?: number;
|
|
14
20
|
/**
|
|
15
21
|
* Series color (token key or CSS color). Falls back to the palette.
|
|
16
22
|
*
|
|
17
23
|
* @default undefined
|
|
18
24
|
*/
|
|
19
25
|
color?: ChartColorValue;
|
|
26
|
+
/**
|
|
27
|
+
* What `colorRanges` match: each point's value, or its category index.
|
|
28
|
+
*
|
|
29
|
+
* @default "value"
|
|
30
|
+
*/
|
|
31
|
+
colorBy?: ChartColorRangeAxis;
|
|
32
|
+
/**
|
|
33
|
+
* Recolors the line (and its area) piece by piece: values in
|
|
34
|
+
* `[min, max)` take the range color. With `colorBy="category"`, `min`
|
|
35
|
+
* and `max` are category indices (both included). Points outside every
|
|
36
|
+
* range keep `color`. Range labels show in the tooltip and data table.
|
|
37
|
+
*
|
|
38
|
+
* @default undefined
|
|
39
|
+
*/
|
|
40
|
+
colorRanges?: ChartColorRangeOption[];
|
|
20
41
|
/**
|
|
21
42
|
* Line interpolation.
|
|
22
43
|
*
|
|
@@ -16,7 +16,10 @@ function r(r) {
|
|
|
16
16
|
stack: r.stack,
|
|
17
17
|
dashed: r.dashed,
|
|
18
18
|
labels: r.labels,
|
|
19
|
+
colorBy: r.colorBy,
|
|
19
20
|
showPoints: r.showPoints,
|
|
21
|
+
areaOpacity: r.areaOpacity,
|
|
22
|
+
colorRanges: r.colorRanges,
|
|
20
23
|
reference: n(r.reference) ? void 0 : t(r.reference)
|
|
21
24
|
})
|
|
22
25
|
}) };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { ChartLineSeriesOwnProps, ChartLineSeriesProps, } from './chartLineSeries.types';
|
|
2
2
|
export { default as ChartLineSeries } from './ChartLineSeries.vue';
|
|
3
3
|
export { useChartLineSeries } from './composables/useChartLineSeries';
|
|
4
|
+
export type { ChartColorRangeOption } from '../../Utils/Charts';
|
|
@@ -6,6 +6,7 @@ var l = /*@__PURE__*/ i({
|
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ChartPie",
|
|
8
8
|
props: {
|
|
9
|
+
cornerRadius: {},
|
|
9
10
|
data: {},
|
|
10
11
|
labelContent: {},
|
|
11
12
|
labelPosition: {},
|
|
@@ -15,6 +16,8 @@ var l = /*@__PURE__*/ i({
|
|
|
15
16
|
},
|
|
16
17
|
maxSlices: {},
|
|
17
18
|
minAngle: {},
|
|
19
|
+
padAngle: {},
|
|
20
|
+
rose: {},
|
|
18
21
|
thickness: {},
|
|
19
22
|
variant: {},
|
|
20
23
|
animation: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
-
import { ChartLabelContent, ChartLabelPosition, ChartPieVariant, ChartSlice } from '@bridge-ui/core/Domain';
|
|
2
|
+
import { ChartLabelContent, ChartLabelPosition, ChartPieRose, ChartPieVariant, ChartSlice } from '@bridge-ui/core/Domain';
|
|
3
3
|
import { MergeHtmlProps } from '@bridge-ui/core/Utils';
|
|
4
4
|
import { ChartColorValue, ChartRootOwnProps, ChartSlots } from '../../Utils/Charts';
|
|
5
5
|
/**
|
|
@@ -7,6 +7,12 @@ import { ChartColorValue, ChartRootOwnProps, ChartSlots } from '../../Utils/Char
|
|
|
7
7
|
* `ChartLegend` and `ChartTooltip`.
|
|
8
8
|
*/
|
|
9
9
|
export interface ChartPieOwnProps extends ChartRootOwnProps {
|
|
10
|
+
/**
|
|
11
|
+
* Slice corner radius (px).
|
|
12
|
+
*
|
|
13
|
+
* @default 0 (2 for `donut`)
|
|
14
|
+
*/
|
|
15
|
+
cornerRadius?: number;
|
|
10
16
|
/**
|
|
11
17
|
* Slices in order. Non-positive values are skipped.
|
|
12
18
|
*/
|
|
@@ -42,6 +48,19 @@ export interface ChartPieOwnProps extends ChartRootOwnProps {
|
|
|
42
48
|
* @default 2
|
|
43
49
|
*/
|
|
44
50
|
minAngle?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Gap angle (deg) between slices.
|
|
53
|
+
*
|
|
54
|
+
* @default 0 (1 for `donut`)
|
|
55
|
+
*/
|
|
56
|
+
padAngle?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Nightingale (rose) pie: each slice radius shows its value. `radius`
|
|
59
|
+
* keeps the angle as the share; `area` gives every slice the same angle.
|
|
60
|
+
*
|
|
61
|
+
* @default undefined
|
|
62
|
+
*/
|
|
63
|
+
rose?: ChartPieRose;
|
|
45
64
|
/**
|
|
46
65
|
* Donut ring thickness as a fraction of the radius (`0`–`1`).
|
|
47
66
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChartPieRenderOptions } from '@bridge-ui/core/Domain';
|
|
2
2
|
import { ChartPieOwnProps } from '../chartPie.types';
|
|
3
3
|
import { ChartRootMerged } from '../../../Utils/Charts';
|
|
4
|
-
type ChartPieMerged = ChartRootMerged & Pick<ChartPieOwnProps, "labels" | "variant" | "minAngle" | "thickness" | "labelPosition">;
|
|
4
|
+
type ChartPieMerged = ChartRootMerged & Pick<ChartPieOwnProps, "rose" | "labels" | "variant" | "minAngle" | "padAngle" | "thickness" | "cornerRadius" | "labelPosition">;
|
|
5
5
|
export declare function useChartPie(props: ChartPieOwnProps, libDefaults: Partial<ChartPieMerged>): {
|
|
6
6
|
merged: import('vue').ComputedRef<ChartPieMerged>;
|
|
7
7
|
variant: import('vue').ComputedRef<import('@bridge-ui/core/Domain').ChartPieVariant>;
|
|
@@ -1,71 +1,81 @@
|
|
|
1
1
|
import { chartRootBridgeKeys as e, useChartRoot as t } from "../../../Utils/Charts/useChartRoot.js";
|
|
2
2
|
import { useChartPart as n } from "../../../Utils/Charts/useChartPart.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { computed as r } from "vue";
|
|
4
|
+
import { DEFAULT_CHART_DONUT_THICKNESS as i, DEFAULT_CHART_MIN_ANGLE as a, getChartPiePercents as o, getChartPieSliceDefaults as s, getChartPieSummaryParams as c } from "@bridge-ui/core/Domain";
|
|
5
|
+
import { mountEchartsPie as l } from "@bridge-ui/core/Integrations/Echarts";
|
|
6
6
|
//#region src/Components/ChartPie/composables/useChartPie.ts
|
|
7
|
-
var
|
|
7
|
+
var u = [
|
|
8
8
|
...e,
|
|
9
9
|
"data",
|
|
10
|
+
"rose",
|
|
10
11
|
"labels",
|
|
11
12
|
"variant",
|
|
12
13
|
"minAngle",
|
|
14
|
+
"padAngle",
|
|
13
15
|
"maxSlices",
|
|
14
16
|
"thickness",
|
|
17
|
+
"cornerRadius",
|
|
15
18
|
"labelContent",
|
|
16
19
|
"labelPosition"
|
|
17
|
-
],
|
|
20
|
+
], d = [
|
|
21
|
+
"rose",
|
|
18
22
|
"size",
|
|
19
23
|
"height",
|
|
20
24
|
"labels",
|
|
21
25
|
"classes",
|
|
22
26
|
"variant",
|
|
23
27
|
"minAngle",
|
|
28
|
+
"padAngle",
|
|
24
29
|
"animation",
|
|
25
30
|
"thickness",
|
|
26
31
|
"customProps",
|
|
32
|
+
"cornerRadius",
|
|
27
33
|
"labelPosition"
|
|
28
34
|
];
|
|
29
|
-
function
|
|
30
|
-
let
|
|
35
|
+
function f(e, f) {
|
|
36
|
+
let p = t({
|
|
31
37
|
props: e,
|
|
32
|
-
libDefaults:
|
|
38
|
+
libDefaults: f,
|
|
33
39
|
componentName: "ChartPie",
|
|
34
|
-
bridgeKeys:
|
|
35
|
-
registryKeys:
|
|
36
|
-
}), { merged:
|
|
37
|
-
function
|
|
40
|
+
bridgeKeys: u,
|
|
41
|
+
registryKeys: d
|
|
42
|
+
}), { merged: m, locale: h, resolveMessage: g } = p, _ = r(() => m.value.variant ?? "pie"), v = r(() => m.value.labels ?? !1);
|
|
43
|
+
function y(e) {
|
|
44
|
+
let t = s(_.value);
|
|
38
45
|
return {
|
|
39
46
|
...e,
|
|
40
|
-
labels:
|
|
41
|
-
variant:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
labels: v.value,
|
|
48
|
+
variant: _.value,
|
|
49
|
+
rose: m.value.rose ?? null,
|
|
50
|
+
labelPosition: m.value.labelPosition ?? "outside",
|
|
51
|
+
padAngle: m.value.padAngle ?? t.padAngle,
|
|
52
|
+
minAngle: m.value.minAngle ?? a,
|
|
53
|
+
thickness: m.value.thickness ?? i,
|
|
54
|
+
cornerRadius: m.value.cornerRadius ?? t.cornerRadius
|
|
45
55
|
};
|
|
46
56
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
57
|
+
function b(e) {
|
|
58
|
+
return g("Pie chart with {{count}} slices: {{items}}.", c({
|
|
49
59
|
slices: e,
|
|
50
|
-
locale:
|
|
60
|
+
locale: h.value
|
|
51
61
|
}));
|
|
52
62
|
}
|
|
53
63
|
return {
|
|
54
|
-
...n(
|
|
55
|
-
summary:
|
|
56
|
-
buildOptions:
|
|
64
|
+
...n(p, {
|
|
65
|
+
summary: b,
|
|
66
|
+
buildOptions: y,
|
|
57
67
|
family: "pie",
|
|
58
68
|
positiveOnly: !0,
|
|
59
|
-
mount:
|
|
69
|
+
mount: l,
|
|
60
70
|
data: () => e.data,
|
|
61
|
-
labels: () =>
|
|
62
|
-
percents:
|
|
71
|
+
labels: () => v.value,
|
|
72
|
+
percents: o,
|
|
63
73
|
maxSlices: () => e.maxSlices,
|
|
64
74
|
labelContent: () => e.labelContent
|
|
65
75
|
}),
|
|
66
|
-
merged:
|
|
67
|
-
variant:
|
|
76
|
+
merged: m,
|
|
77
|
+
variant: _
|
|
68
78
|
};
|
|
69
79
|
}
|
|
70
80
|
//#endregion
|
|
71
|
-
export {
|
|
81
|
+
export { f as useChartPie };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useChartRegistry as e } from "../../../Utils/Charts/useChartRegistry.js";
|
|
2
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { computed as c } from "vue";
|
|
4
|
+
import { isNil as l } from "es-toolkit/compat";
|
|
5
|
+
import { DEFAULT_CHART_BUBBLE_SIZE as u, DEFAULT_CHART_SYMBOL_SIZE as d, getChartBubbleSizeDomain as f, getChartRangeColorItems as p, getChartScatterPoints as m, getChartScatterTable as h, getChartScatterTooltip as g, isChartScatterEmpty as _, resolveChartRangeColors as v } from "@bridge-ui/core/Domain";
|
|
6
|
+
import { mountEchartsScatter as y } from "@bridge-ui/core/Integrations/Echarts";
|
|
7
7
|
//#region src/Components/ChartScatter/composables/useChartScatter.ts
|
|
8
|
-
var
|
|
8
|
+
var b = [
|
|
9
9
|
...t,
|
|
10
10
|
"bubbleSize",
|
|
11
11
|
"symbolSize"
|
|
12
|
-
],
|
|
12
|
+
], x = [
|
|
13
13
|
"size",
|
|
14
14
|
"height",
|
|
15
15
|
"classes",
|
|
@@ -17,87 +17,92 @@ var v = [
|
|
|
17
17
|
"symbolSize",
|
|
18
18
|
"customProps"
|
|
19
19
|
];
|
|
20
|
-
function
|
|
21
|
-
let
|
|
20
|
+
function S(t, S) {
|
|
21
|
+
let C = s({
|
|
22
22
|
props: t,
|
|
23
|
-
libDefaults:
|
|
23
|
+
libDefaults: S,
|
|
24
24
|
componentName: "ChartScatter",
|
|
25
|
-
bridgeKeys:
|
|
26
|
-
registryKeys:
|
|
27
|
-
}),
|
|
25
|
+
bridgeKeys: b,
|
|
26
|
+
registryKeys: x
|
|
27
|
+
}), w = e(), { merged: T, hidden: E, locale: D, resolveMessage: O } = C, k = c(() => JSON.stringify(t.bubbleSize ?? T.value.bubbleSize ?? u)), A = c(() => JSON.parse(k.value)), j = r(C, () => [...w.entries.value, ...p(w.entries.value)]), M = c(() => w.entries.value.filter((e) => !E.value.includes(e.id)).map((e) => ({
|
|
28
28
|
...e,
|
|
29
|
-
color:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
color: j.value[e.id] ?? "",
|
|
30
|
+
colorRanges: v({
|
|
31
|
+
seriesId: e.id,
|
|
32
|
+
colors: j.value,
|
|
33
|
+
ranges: e.colorRanges ?? []
|
|
34
|
+
})
|
|
35
|
+
}))), N = c(() => m(M.value)), P = c(() => {
|
|
36
|
+
let e = C.theme.value;
|
|
37
|
+
return l(e) ? null : {
|
|
33
38
|
theme: e,
|
|
34
|
-
points:
|
|
35
|
-
series:
|
|
36
|
-
bubbleSize:
|
|
37
|
-
animation:
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
40
|
-
xAxis: { ...
|
|
41
|
-
yAxis: { ...
|
|
42
|
-
sizeDomain:
|
|
43
|
-
symbolSize:
|
|
39
|
+
points: N.value,
|
|
40
|
+
series: M.value,
|
|
41
|
+
bubbleSize: A.value,
|
|
42
|
+
animation: C.animation.value,
|
|
43
|
+
width: C.plotSize.value.width,
|
|
44
|
+
height: C.plotSize.value.height,
|
|
45
|
+
xAxis: { ...w.axes.value.x },
|
|
46
|
+
yAxis: { ...w.axes.value.y },
|
|
47
|
+
sizeDomain: f(M.value),
|
|
48
|
+
symbolSize: T.value.symbolSize ?? d
|
|
44
49
|
};
|
|
45
50
|
});
|
|
46
|
-
o(
|
|
47
|
-
options:
|
|
48
|
-
mount:
|
|
51
|
+
o(C, {
|
|
52
|
+
options: P,
|
|
53
|
+
mount: y
|
|
49
54
|
});
|
|
50
|
-
let
|
|
51
|
-
size:
|
|
52
|
-
x:
|
|
53
|
-
y:
|
|
54
|
-
})),
|
|
55
|
-
let e =
|
|
56
|
-
return
|
|
55
|
+
let F = c(() => ({
|
|
56
|
+
size: O("Size"),
|
|
57
|
+
x: w.axes.value.x?.label ?? "x",
|
|
58
|
+
y: w.axes.value.y?.label ?? "y"
|
|
59
|
+
})), I = c(() => {
|
|
60
|
+
let e = C.active.value.index, t = l(e) ? void 0 : N.value[e], n = l(t) ? void 0 : M.value[t.seriesIndex];
|
|
61
|
+
return l(t) || l(n) ? null : g({
|
|
57
62
|
point: t,
|
|
58
63
|
series: n,
|
|
59
64
|
labels: {
|
|
60
|
-
...
|
|
61
|
-
size: n.sizeName ??
|
|
65
|
+
...F.value,
|
|
66
|
+
size: n.sizeName ?? F.value.size
|
|
62
67
|
}
|
|
63
68
|
});
|
|
64
69
|
});
|
|
65
70
|
return {
|
|
66
|
-
frame: a(
|
|
67
|
-
let e =
|
|
71
|
+
frame: a(C, c(() => {
|
|
72
|
+
let e = w.entries.value;
|
|
68
73
|
return {
|
|
69
|
-
tooltip:
|
|
70
|
-
count:
|
|
74
|
+
tooltip: I.value,
|
|
75
|
+
count: N.value.length,
|
|
71
76
|
isEmpty: _(e),
|
|
72
|
-
summary:
|
|
77
|
+
summary: O("Scatter chart with {{count}} series ({{names}}) and {{points}} points.", {
|
|
73
78
|
count: e.length,
|
|
74
79
|
points: m(e).length,
|
|
75
80
|
names: e.map((e) => e.name).join(", ")
|
|
76
81
|
}),
|
|
77
82
|
table: h({
|
|
78
83
|
series: e,
|
|
79
|
-
locale:
|
|
84
|
+
locale: D.value,
|
|
80
85
|
headers: {
|
|
81
|
-
x:
|
|
82
|
-
y:
|
|
83
|
-
series:
|
|
84
|
-
size: e.find((e) => !
|
|
86
|
+
x: F.value.x,
|
|
87
|
+
y: F.value.y,
|
|
88
|
+
series: O("Series"),
|
|
89
|
+
size: e.find((e) => !l(e.sizeName))?.sizeName ?? F.value.size
|
|
85
90
|
}
|
|
86
91
|
})
|
|
87
92
|
};
|
|
88
93
|
})),
|
|
89
|
-
merged:
|
|
90
|
-
context: i(
|
|
91
|
-
tooltip:
|
|
92
|
-
setAxis:
|
|
94
|
+
merged: T,
|
|
95
|
+
context: i(C, c(() => ({
|
|
96
|
+
tooltip: I.value,
|
|
97
|
+
setAxis: w.setAxis,
|
|
93
98
|
family: "scatter",
|
|
94
|
-
removeAxis:
|
|
95
|
-
upsertSeries:
|
|
96
|
-
removeSeries:
|
|
97
|
-
legendItems: n(
|
|
99
|
+
removeAxis: w.removeAxis,
|
|
100
|
+
upsertSeries: w.upsertSeries,
|
|
101
|
+
removeSeries: w.removeSeries,
|
|
102
|
+
legendItems: n(w.entries.value, j.value, E.value)
|
|
98
103
|
}))),
|
|
99
|
-
options:
|
|
104
|
+
options: P
|
|
100
105
|
};
|
|
101
106
|
}
|
|
102
107
|
//#endregion
|
|
103
|
-
export {
|
|
108
|
+
export { S as useChartScatter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartScatterPoint } from '@bridge-ui/core/Domain';
|
|
2
|
-
import { ChartColorValue } from '../../Utils/Charts';
|
|
2
|
+
import { ChartColorRangeOption, ChartColorValue } from '../../Utils/Charts';
|
|
3
3
|
/**
|
|
4
4
|
* One group of points registered on the nearest `ChartScatter`.
|
|
5
5
|
* Renders nothing.
|
|
@@ -11,6 +11,13 @@ export interface ChartScatterSeriesOwnProps {
|
|
|
11
11
|
* @default undefined
|
|
12
12
|
*/
|
|
13
13
|
color?: ChartColorValue;
|
|
14
|
+
/**
|
|
15
|
+
* Recolors single points by their `y`: values in `[min, max)` take the
|
|
16
|
+
* range color. Range labels show in the tooltip and data table.
|
|
17
|
+
*
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
colorRanges?: ChartColorRangeOption[];
|
|
14
21
|
/**
|
|
15
22
|
* Points: `[x, y]`, or `[x, y, size]` for bubbles.
|
|
16
23
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { ChartScatterSeriesOwnProps, ChartScatterSeriesProps, } from './chartScatterSeries.types';
|
|
2
2
|
export { default as ChartScatterSeries } from './ChartScatterSeries.vue';
|
|
3
3
|
export { useChartScatterSeries } from './composables/useChartScatterSeries';
|
|
4
|
+
export type { ChartColorRangeOption } from '../../Utils/Charts';
|
|
@@ -11,21 +11,25 @@ var g = /*@__PURE__*/ o({
|
|
|
11
11
|
formatValue: { type: Function }
|
|
12
12
|
},
|
|
13
13
|
setup(o) {
|
|
14
|
-
let g = o, _ = h("tooltip"), { isOpen: v, context: y, itemBind: b,
|
|
14
|
+
let g = o, _ = h("tooltip"), { isOpen: v, context: y, itemBind: b, noteBind: x, rootBind: S, labelBind: C, titleBind: w, valueBind: T, percentBind: E, formatValue: D, formatPercent: O, getSwatchBind: k } = e(g, _);
|
|
15
15
|
return (e, o) => m(v) && m(y) ? (u(), r("div", c({
|
|
16
16
|
key: 0,
|
|
17
17
|
ref: "tooltip"
|
|
18
|
-
}, m(
|
|
18
|
+
}, m(S)), [f(e.$slots, "content", l(s(m(y))), () => [m(y).title ? (u(), r("div", l(c({ key: 0 }, m(w))), [m(y).color ? (u(), r("span", l(c({ key: 0 }, m(k)(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
19
|
e.color ? (u(), r("span", c({
|
|
20
20
|
key: 0,
|
|
21
21
|
ref_for: !0
|
|
22
|
-
}, m(
|
|
23
|
-
i("span", c({ ref_for: !0 }, m(
|
|
24
|
-
i("span", c({ ref_for: !0 }, m(
|
|
25
|
-
|
|
22
|
+
}, m(k)(e.color)), null, 16)) : n("", !0),
|
|
23
|
+
i("span", c({ ref_for: !0 }, m(C)), p(e.name), 17),
|
|
24
|
+
i("span", c({ ref_for: !0 }, m(T)), p(m(D)(e)), 17),
|
|
25
|
+
e.note ? (u(), r("span", c({
|
|
26
26
|
key: 1,
|
|
27
27
|
ref_for: !0
|
|
28
|
-
}, m(
|
|
28
|
+
}, m(x)), p(e.note), 17)) : n("", !0),
|
|
29
|
+
m(O)(e) === null ? n("", !0) : (u(), r("span", c({
|
|
30
|
+
key: 2,
|
|
31
|
+
ref_for: !0
|
|
32
|
+
}, m(E)), p(m(O)(e)), 17))
|
|
29
33
|
], 16))), 128))])], 16)) : n("", !0);
|
|
30
34
|
}
|
|
31
35
|
});
|