@bridge-ui/vue 0.17.3 → 0.19.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 (164) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +36 -35
  2. package/ai/skills/bridge-ui-setup/SKILL.md +1 -1
  3. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  4. package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +1 -0
  5. package/dist/Components/ChartAxis/chartAxis.types.d.ts +17 -7
  6. package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +2 -2
  7. package/dist/Components/ChartAxis/composables/useChartAxis.js +15 -10
  8. package/dist/Components/ChartBar/ChartBar.js +5 -0
  9. package/dist/Components/ChartBar/ChartBar.vue.d.ts +16 -0
  10. package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +64 -0
  11. package/dist/Components/ChartBar/chartBar.types.d.ts +66 -0
  12. package/dist/Components/ChartBar/composables/useChartBar.d.ts +26 -0
  13. package/dist/Components/ChartBar/composables/useChartBar.js +13 -0
  14. package/dist/Components/ChartBar/index.d.ts +4 -0
  15. package/dist/Components/ChartBar/index.js +4 -0
  16. package/dist/Components/ChartBarSeries/ChartBarSeries.js +5 -0
  17. package/dist/Components/ChartBarSeries/ChartBarSeries.vue.d.ts +6 -0
  18. package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +28 -0
  19. package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +67 -0
  20. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.d.ts +5 -0
  21. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +23 -0
  22. package/dist/Components/ChartBarSeries/index.d.ts +4 -0
  23. package/dist/Components/ChartBarSeries/index.js +3 -0
  24. package/dist/Components/ChartFunnel/ChartFunnel.js +5 -0
  25. package/dist/Components/ChartFunnel/ChartFunnel.vue.d.ts +16 -0
  26. package/dist/Components/ChartFunnel/ChartFunnel.vue_vue_type_script_setup_true_lang.js +59 -0
  27. package/dist/Components/ChartFunnel/chartFunnel.types.d.ts +54 -0
  28. package/dist/Components/ChartFunnel/composables/useChartFunnel.d.ts +29 -0
  29. package/dist/Components/ChartFunnel/composables/useChartFunnel.js +68 -0
  30. package/dist/Components/ChartFunnel/index.d.ts +4 -0
  31. package/dist/Components/ChartFunnel/index.js +4 -0
  32. package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +2 -0
  33. package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -13
  34. package/dist/Components/ChartLegend/chartLegend.types.d.ts +41 -5
  35. package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +9 -5
  36. package/dist/Components/ChartLegend/composables/useChartLegend.js +88 -54
  37. package/dist/Components/ChartLine/ChartLine.js +5 -0
  38. package/dist/Components/ChartLine/ChartLine.vue.d.ts +20 -0
  39. package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +77 -0
  40. package/dist/Components/ChartLine/chartLine.types.d.ts +79 -0
  41. package/dist/Components/ChartLine/composables/useChartLine.d.ts +26 -0
  42. package/dist/Components/ChartLine/composables/useChartLine.js +13 -0
  43. package/dist/Components/ChartLine/index.d.ts +4 -0
  44. package/dist/Components/ChartLine/index.js +4 -0
  45. package/dist/Components/ChartLineSeries/ChartLineSeries.js +5 -0
  46. package/dist/Components/ChartLineSeries/ChartLineSeries.vue.d.ts +10 -0
  47. package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +45 -0
  48. package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +96 -0
  49. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.d.ts +5 -0
  50. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +28 -0
  51. package/dist/Components/ChartLineSeries/index.d.ts +4 -0
  52. package/dist/Components/ChartLineSeries/index.js +3 -0
  53. package/dist/Components/ChartPie/ChartPie.js +5 -0
  54. package/dist/Components/ChartPie/ChartPie.vue.d.ts +15 -0
  55. package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +76 -0
  56. package/dist/Components/ChartPie/chartPie.types.d.ts +92 -0
  57. package/dist/Components/ChartPie/composables/useChartPie.d.ts +30 -0
  58. package/dist/Components/ChartPie/composables/useChartPie.js +81 -0
  59. package/dist/Components/ChartPie/index.d.ts +4 -0
  60. package/dist/Components/ChartPie/index.js +4 -0
  61. package/dist/Components/ChartScatter/ChartScatter.js +5 -0
  62. package/dist/Components/{Chart/Chart.vue.d.ts → ChartScatter/ChartScatter.vue.d.ts} +3 -2
  63. package/dist/Components/ChartScatter/ChartScatter.vue_vue_type_script_setup_true_lang.js +49 -0
  64. package/dist/Components/ChartScatter/chartScatter.types.d.ts +23 -0
  65. package/dist/Components/ChartScatter/composables/useChartScatter.d.ts +29 -0
  66. package/dist/Components/ChartScatter/composables/useChartScatter.js +108 -0
  67. package/dist/Components/ChartScatter/index.d.ts +4 -0
  68. package/dist/Components/ChartScatter/index.js +4 -0
  69. package/dist/Components/ChartScatterSeries/ChartScatterSeries.js +5 -0
  70. package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue.d.ts +4 -0
  71. package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +22 -0
  72. package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +45 -0
  73. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.d.ts +4 -0
  74. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +19 -0
  75. package/dist/Components/ChartScatterSeries/index.d.ts +4 -0
  76. package/dist/Components/ChartScatterSeries/index.js +3 -0
  77. package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +22 -10
  78. package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +28 -9
  79. package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +4 -1
  80. package/dist/Components/ChartTooltip/composables/useChartTooltip.js +81 -63
  81. package/dist/Components/Heading/Heading.js +5 -0
  82. package/dist/Components/Heading/Heading.vue.d.ts +11 -0
  83. package/dist/Components/Heading/Heading.vue_vue_type_script_setup_true_lang.js +29 -0
  84. package/dist/Components/Heading/composables/useHeading.d.ts +10 -0
  85. package/dist/Components/Heading/composables/useHeading.js +56 -0
  86. package/dist/Components/Heading/heading.types.d.ts +56 -0
  87. package/dist/Components/Heading/index.d.ts +3 -0
  88. package/dist/Components/Heading/index.js +3 -0
  89. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
  90. package/dist/Components/Spinner/composables/useSpinner.d.ts +1 -1
  91. package/dist/Components/Text/Text.js +5 -0
  92. package/dist/Components/Text/Text.vue.d.ts +11 -0
  93. package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +33 -0
  94. package/dist/Components/Text/composables/useText.d.ts +9 -0
  95. package/dist/Components/Text/composables/useText.js +56 -0
  96. package/dist/Components/Text/index.d.ts +3 -0
  97. package/dist/Components/Text/index.js +3 -0
  98. package/dist/Components/Text/text.types.d.ts +76 -0
  99. package/dist/Utils/Charts/ChartFrame.js +5 -0
  100. package/dist/Utils/Charts/ChartFrame.vue.d.ts +24 -0
  101. package/dist/Utils/Charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +41 -0
  102. package/dist/{Components/Chart → Utils/Charts}/chart.types.d.ts +33 -18
  103. package/dist/Utils/Charts/chartInjectionKey.d.ts +151 -0
  104. package/dist/{Components/Chart → Utils/Charts}/chartInjectionKey.js +2 -2
  105. package/dist/Utils/Charts/echarts/bar.d.ts +6 -0
  106. package/dist/Utils/Charts/echarts/bar.js +23 -0
  107. package/dist/Utils/Charts/echarts/cartesian.d.ts +15 -0
  108. package/dist/Utils/Charts/echarts/cartesian.js +290 -0
  109. package/dist/Utils/Charts/echarts/funnel.d.ts +15 -0
  110. package/dist/Utils/Charts/echarts/funnel.js +79 -0
  111. package/dist/Utils/Charts/echarts/line.d.ts +5 -0
  112. package/dist/Utils/Charts/echarts/line.js +20 -0
  113. package/dist/Utils/Charts/echarts/part.d.ts +19 -0
  114. package/dist/Utils/Charts/echarts/part.js +45 -0
  115. package/dist/Utils/Charts/echarts/pie.d.ts +14 -0
  116. package/dist/Utils/Charts/echarts/pie.js +76 -0
  117. package/dist/Utils/Charts/echarts/plot.d.ts +44 -0
  118. package/dist/Utils/Charts/echarts/plot.js +52 -0
  119. package/dist/Utils/Charts/echarts/scatter.d.ts +14 -0
  120. package/dist/Utils/Charts/echarts/scatter.js +161 -0
  121. package/dist/Utils/Charts/index.d.ts +6 -0
  122. package/dist/Utils/Charts/index.js +6 -0
  123. package/dist/Utils/Charts/useChartCartesian.d.ts +59 -0
  124. package/dist/Utils/Charts/useChartCartesian.js +169 -0
  125. package/dist/Utils/Charts/useChartPart.d.ts +45 -0
  126. package/dist/Utils/Charts/useChartPart.js +97 -0
  127. package/dist/Utils/Charts/useChartRegistry.d.ts +13 -0
  128. package/dist/Utils/Charts/useChartRegistry.js +40 -0
  129. package/dist/Utils/Charts/useChartRoot.d.ts +156 -0
  130. package/dist/Utils/Charts/useChartRoot.js +342 -0
  131. package/dist/Utils/Charts/useChartSeries.d.ts +10 -0
  132. package/dist/Utils/Charts/useChartSeries.js +22 -0
  133. package/dist/augments.d.ts +33 -7
  134. package/dist/index.d.ts +4 -0
  135. package/dist/index.js +90 -86
  136. package/docs/README.md +8 -1
  137. package/docs/components/BridgeUIProvider.md +1 -1
  138. package/docs/components/Card.md +15 -0
  139. package/docs/components/Chart.md +118 -151
  140. package/docs/components/ChartBar.md +190 -0
  141. package/docs/components/ChartFunnel.md +62 -0
  142. package/docs/components/ChartLine.md +192 -0
  143. package/docs/components/ChartPie.md +138 -0
  144. package/docs/components/ChartScatter.md +102 -0
  145. package/docs/components/Heading.md +85 -0
  146. package/docs/components/Text.md +118 -0
  147. package/package.json +2 -2
  148. package/dist/Components/Chart/Chart.js +0 -5
  149. package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +0 -52
  150. package/dist/Components/Chart/chartInjectionKey.d.ts +0 -94
  151. package/dist/Components/Chart/composables/useChart.d.ts +0 -40
  152. package/dist/Components/Chart/composables/useChart.js +0 -346
  153. package/dist/Components/Chart/echartsChart.d.ts +0 -14
  154. package/dist/Components/Chart/echartsChart.js +0 -199
  155. package/dist/Components/Chart/index.d.ts +0 -4
  156. package/dist/Components/Chart/index.js +0 -4
  157. package/dist/Components/ChartSeries/ChartSeries.js +0 -5
  158. package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +0 -4
  159. package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +0 -24
  160. package/dist/Components/ChartSeries/chartSeries.types.d.ts +0 -37
  161. package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +0 -10
  162. package/dist/Components/ChartSeries/composables/useChartSeries.js +0 -29
  163. package/dist/Components/ChartSeries/index.d.ts +0 -3
  164. package/dist/Components/ChartSeries/index.js +0 -3
@@ -0,0 +1,81 @@
1
+ import { chartRootBridgeKeys as e, useChartRoot as t } from "../../../Utils/Charts/useChartRoot.js";
2
+ import { useChartPart as n } from "../../../Utils/Charts/useChartPart.js";
3
+ import { mountEchartsPie as r } from "../../../Utils/Charts/echarts/pie.js";
4
+ import { computed as i } from "vue";
5
+ import { DEFAULT_CHART_DONUT_THICKNESS as a, DEFAULT_CHART_MIN_ANGLE as o, getChartPiePercents as s, getChartPieSliceDefaults as c, getChartPieSummaryParams as l } from "@bridge-ui/core/Domain";
6
+ //#region src/Components/ChartPie/composables/useChartPie.ts
7
+ var u = [
8
+ ...e,
9
+ "data",
10
+ "rose",
11
+ "labels",
12
+ "variant",
13
+ "minAngle",
14
+ "padAngle",
15
+ "maxSlices",
16
+ "thickness",
17
+ "cornerRadius",
18
+ "labelContent",
19
+ "labelPosition"
20
+ ], d = [
21
+ "rose",
22
+ "size",
23
+ "height",
24
+ "labels",
25
+ "classes",
26
+ "variant",
27
+ "minAngle",
28
+ "padAngle",
29
+ "animation",
30
+ "thickness",
31
+ "customProps",
32
+ "cornerRadius",
33
+ "labelPosition"
34
+ ];
35
+ function f(e, f) {
36
+ let p = t({
37
+ props: e,
38
+ libDefaults: f,
39
+ componentName: "ChartPie",
40
+ bridgeKeys: u,
41
+ registryKeys: d
42
+ }), { merged: m, locale: h, resolveMessage: g } = p, _ = i(() => m.value.variant ?? "pie"), v = i(() => m.value.labels ?? !1);
43
+ function y(e) {
44
+ let t = c(_.value);
45
+ return {
46
+ ...e,
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 ?? o,
53
+ thickness: m.value.thickness ?? a,
54
+ cornerRadius: m.value.cornerRadius ?? t.cornerRadius
55
+ };
56
+ }
57
+ function b(e) {
58
+ return g("Pie chart with {{count}} slices: {{items}}.", l({
59
+ slices: e,
60
+ locale: h.value
61
+ }));
62
+ }
63
+ return {
64
+ ...n(p, {
65
+ summary: b,
66
+ buildOptions: y,
67
+ family: "pie",
68
+ positiveOnly: !0,
69
+ mount: r,
70
+ data: () => e.data,
71
+ labels: () => v.value,
72
+ percents: s,
73
+ maxSlices: () => e.maxSlices,
74
+ labelContent: () => e.labelContent
75
+ }),
76
+ merged: m,
77
+ variant: _
78
+ };
79
+ }
80
+ //#endregion
81
+ export { f as useChartPie };
@@ -0,0 +1,4 @@
1
+ export type { ChartPieOwnProps, ChartPieProps, ChartPieSlice, ChartPieSlots, } from './chartPie.types';
2
+ export { default as ChartPie } from './ChartPie.vue';
3
+ export { useChartPie } from './composables/useChartPie';
4
+ export { useChartContext, type ChartClasses, type ChartColorOverrides, type ChartColorValue, type ChartContextValue, type ChartCustomProps, type ChartSizeOverrides, } from '../../Utils/Charts';
@@ -0,0 +1,4 @@
1
+ import { useChartContext as e } from "../../Utils/Charts/chartInjectionKey.js";
2
+ import { useChartPie as t } from "./composables/useChartPie.js";
3
+ import n from "./ChartPie.js";
4
+ export { n as ChartPie, e as useChartContext, t as useChartPie };
@@ -0,0 +1,5 @@
1
+ import e from "./ChartScatter.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/ChartScatter/ChartScatter.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,6 +1,7 @@
1
- import { ChartOwnProps, ChartSlots } from './chart.types';
1
+ import { ChartScatterOwnProps } from './chartScatter.types';
2
+ import { ChartSlots } from '../../Utils/Charts';
2
3
  type __VLS_Slots = ChartSlots;
3
- declare const __VLS_base: import('vue').DefineComponent<ChartOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ChartOwnProps> & Readonly<{}>, {
4
+ declare const __VLS_base: import('vue').DefineComponent<ChartScatterOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ChartScatterOwnProps> & Readonly<{}>, {
4
5
  loading: boolean;
5
6
  animation: boolean;
6
7
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,49 @@
1
+ import e from "../../Utils/Charts/ChartFrame.js";
2
+ import { useChartScatter as t } from "./composables/useChartScatter.js";
3
+ import { createBlock as n, createSlots as r, defineComponent as i, openBlock as a, renderSlot as o, unref as s, withCtx as c } from "vue";
4
+ //#region src/Components/ChartScatter/ChartScatter.vue?vue&type=script&setup=true&lang.ts
5
+ var l = /*@__PURE__*/ i({
6
+ inheritAttrs: !1,
7
+ __name: "ChartScatter",
8
+ props: {
9
+ bubbleSize: {},
10
+ symbolSize: {},
11
+ animation: {
12
+ type: Boolean,
13
+ default: void 0
14
+ },
15
+ classes: {},
16
+ customProps: {},
17
+ height: {},
18
+ loading: {
19
+ type: Boolean,
20
+ default: !1
21
+ },
22
+ palette: {},
23
+ size: {},
24
+ summary: {},
25
+ width: {}
26
+ },
27
+ setup(i) {
28
+ let { frame: l } = t(i, {
29
+ size: "md",
30
+ height: 280,
31
+ symbolSize: 8,
32
+ animation: !0
33
+ });
34
+ return (t, i) => (a(), n(s(e), { frame: s(l) }, r({
35
+ default: c(() => [o(t.$slots, "default")]),
36
+ _: 2
37
+ }, [t.$slots.empty ? {
38
+ name: "empty",
39
+ fn: c(() => [o(t.$slots, "empty")]),
40
+ key: "0"
41
+ } : void 0, t.$slots.loading ? {
42
+ name: "loading",
43
+ fn: c(() => [o(t.$slots, "loading")]),
44
+ key: "1"
45
+ } : void 0]), 1032, ["frame"]));
46
+ }
47
+ });
48
+ //#endregion
49
+ export { l as default };
@@ -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,108 @@
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, getChartRangeColorItems as m, getChartScatterPoints as h, getChartScatterTable as g, getChartScatterTooltip as _, isChartScatterEmpty as v, resolveChartRangeColors as y } from "@bridge-ui/core/Domain";
7
+ //#region src/Components/ChartScatter/composables/useChartScatter.ts
8
+ var b = [
9
+ ...t,
10
+ "bubbleSize",
11
+ "symbolSize"
12
+ ], x = [
13
+ "size",
14
+ "height",
15
+ "classes",
16
+ "animation",
17
+ "symbolSize",
18
+ "customProps"
19
+ ];
20
+ function S(t, S) {
21
+ let C = s({
22
+ props: t,
23
+ libDefaults: S,
24
+ componentName: "ChartScatter",
25
+ bridgeKeys: b,
26
+ registryKeys: x
27
+ }), w = e(), { merged: T, hidden: E, locale: D, resolveMessage: O } = C, k = l(() => JSON.stringify(t.bubbleSize ?? T.value.bubbleSize ?? d)), A = l(() => JSON.parse(k.value)), j = r(C, () => [...w.entries.value, ...m(w.entries.value)]), M = l(() => w.entries.value.filter((e) => !E.value.includes(e.id)).map((e) => ({
28
+ ...e,
29
+ color: j.value[e.id] ?? "",
30
+ colorRanges: y({
31
+ seriesId: e.id,
32
+ colors: j.value,
33
+ ranges: e.colorRanges ?? []
34
+ })
35
+ }))), N = l(() => h(M.value)), P = l(() => {
36
+ let e = C.theme.value;
37
+ return u(e) ? null : {
38
+ theme: e,
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: p(M.value),
48
+ symbolSize: T.value.symbolSize ?? f
49
+ };
50
+ });
51
+ o(C, {
52
+ options: P,
53
+ mount: c
54
+ });
55
+ let F = l(() => ({
56
+ size: O("Size"),
57
+ x: w.axes.value.x?.label ?? "x",
58
+ y: w.axes.value.y?.label ?? "y"
59
+ })), I = l(() => {
60
+ let e = C.active.value.index, t = u(e) ? void 0 : N.value[e], n = u(t) ? void 0 : M.value[t.seriesIndex];
61
+ return u(t) || u(n) ? null : _({
62
+ point: t,
63
+ series: n,
64
+ labels: {
65
+ ...F.value,
66
+ size: n.sizeName ?? F.value.size
67
+ }
68
+ });
69
+ });
70
+ return {
71
+ frame: a(C, l(() => {
72
+ let e = w.entries.value;
73
+ return {
74
+ tooltip: I.value,
75
+ count: N.value.length,
76
+ isEmpty: v(e),
77
+ summary: O("Scatter chart with {{count}} series ({{names}}) and {{points}} points.", {
78
+ count: e.length,
79
+ points: h(e).length,
80
+ names: e.map((e) => e.name).join(", ")
81
+ }),
82
+ table: g({
83
+ series: e,
84
+ locale: D.value,
85
+ headers: {
86
+ x: F.value.x,
87
+ y: F.value.y,
88
+ series: O("Series"),
89
+ size: e.find((e) => !u(e.sizeName))?.sizeName ?? F.value.size
90
+ }
91
+ })
92
+ };
93
+ })),
94
+ merged: T,
95
+ context: i(C, l(() => ({
96
+ tooltip: I.value,
97
+ setAxis: w.setAxis,
98
+ family: "scatter",
99
+ removeAxis: w.removeAxis,
100
+ upsertSeries: w.upsertSeries,
101
+ removeSeries: w.removeSeries,
102
+ legendItems: n(w.entries.value, j.value, E.value)
103
+ }))),
104
+ options: P
105
+ };
106
+ }
107
+ //#endregion
108
+ export { S 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 { useChartContext as e } from "../../Utils/Charts/chartInjectionKey.js";
2
+ import { useChartScatter as t } from "./composables/useChartScatter.js";
3
+ import n from "./ChartScatter.js";
4
+ export { n as ChartScatter, e as useChartContext, t as useChartScatter };
@@ -0,0 +1,5 @@
1
+ import e from "./ChartScatterSeries.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/ChartScatterSeries/ChartScatterSeries.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -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;
@@ -0,0 +1,22 @@
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
+ colorRanges: {},
12
+ data: {},
13
+ name: {},
14
+ sizeName: {},
15
+ symbolSize: {}
16
+ },
17
+ setup(n) {
18
+ return e(n), (e, n) => (r(), t("span", i));
19
+ }
20
+ });
21
+ //#endregion
22
+ export { a as default };
@@ -0,0 +1,45 @@
1
+ import { ChartScatterPoint } from '@bridge-ui/core/Domain';
2
+ import { ChartColorRangeOption, 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
+ * 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[];
21
+ /**
22
+ * Points: `[x, y]`, or `[x, y, size]` for bubbles.
23
+ */
24
+ data: ChartScatterPoint[];
25
+ /**
26
+ * Series name shown in the legend, tooltip, and data table.
27
+ */
28
+ name: string;
29
+ /**
30
+ * Label for the third value (bubble size) in the tooltip and data table.
31
+ *
32
+ * @default "Size"
33
+ */
34
+ sizeName?: string;
35
+ /**
36
+ * Point diameter (px) for `[x, y]` points. Ignored for bubbles.
37
+ *
38
+ * @default ChartScatter `symbolSize`
39
+ */
40
+ symbolSize?: number;
41
+ }
42
+ /**
43
+ * `ChartScatterSeries` has no DOM element, so it takes no HTML attributes.
44
+ */
45
+ export type ChartScatterSeriesProps = ChartScatterSeriesOwnProps;
@@ -0,0 +1,4 @@
1
+ import { ChartScatterSeriesOwnProps } from '../chartScatterSeries.types';
2
+ export declare function useChartScatterSeries(props: ChartScatterSeriesOwnProps): {
3
+ entry: import('vue').ComputedRef<import('@bridge-ui/core/Domain').ChartScatterSeriesEntry>;
4
+ };
@@ -0,0 +1,19 @@
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
+ colorRanges: t.colorRanges
15
+ })
16
+ }) };
17
+ }
18
+ //#endregion
19
+ export { t as useChartScatterSeries };
@@ -0,0 +1,4 @@
1
+ export type { ChartScatterSeriesOwnProps, ChartScatterSeriesProps, } from './chartScatterSeries.types';
2
+ export { default as ChartScatterSeries } from './ChartScatterSeries.vue';
3
+ export { useChartScatterSeries } from './composables/useChartScatterSeries';
4
+ export type { ChartColorRangeOption } from '../../Utils/Charts';
@@ -0,0 +1,3 @@
1
+ import { useChartScatterSeries as e } from "./composables/useChartScatterSeries.js";
2
+ import t from "./ChartScatterSeries.js";
3
+ export { t as ChartScatterSeries, e as useChartScatterSeries };
@@ -1,25 +1,37 @@
1
1
  import { useChartTooltip as e } from "./composables/useChartTooltip.js";
2
- import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, guardReactiveProps as o, mergeProps as s, normalizeProps as c, openBlock as l, renderList as u, renderSlot as d, toDisplayString as f, unref as p, useTemplateRef as m } from "vue";
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 h = /*@__PURE__*/ a({
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(a) {
13
- let h = a, g = m("tooltip"), { isOpen: _, context: v, itemBind: y, rootBind: b, labelBind: x, titleBind: S, valueBind: C, formatValue: w, getSwatchBind: T } = e(h, g);
14
- return (e, a) => p(_) && p(v) ? (l(), r("div", s({
13
+ setup(o) {
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
+ return (e, o) => m(v) && m(y) ? (u(), r("div", c({
15
16
  key: 0,
16
17
  ref: "tooltip"
17
- }, p(b)), [d(e.$slots, "content", c(o(p(v))), () => [i("div", c(o(p(S))), f(p(v).category), 17), (l(!0), r(t, null, u(p(v).items, (e) => (l(), r("div", s({ key: e.id }, { ref_for: !0 }, p(y)), [
18
- i("span", s({ ref_for: !0 }, p(T)(e)), null, 16),
19
- i("span", s({ ref_for: !0 }, p(x)), f(e.name), 17),
20
- i("span", s({ ref_for: !0 }, p(C)), f(p(w)(e)), 17)
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
+ e.color ? (u(), r("span", c({
20
+ key: 0,
21
+ ref_for: !0
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
+ key: 1,
27
+ ref_for: !0
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))
21
33
  ], 16))), 128))])], 16)) : n("", !0);
22
34
  }
23
35
  });
24
36
  //#endregion
25
- export { h as default };
37
+ export { g as default };
@@ -3,13 +3,21 @@ 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 series row.
6
+ * Classes merged onto each row.
7
7
  */
8
8
  item?: string;
9
9
  /**
10
- * Classes merged onto each series name.
10
+ * Classes merged onto each row label.
11
11
  */
12
12
  label?: string;
13
+ /**
14
+ * Classes merged onto each color range label (`colorRanges`).
15
+ */
16
+ note?: string;
17
+ /**
18
+ * Classes merged onto each percent (pie, funnel).
19
+ */
20
+ percent?: string;
13
21
  /**
14
22
  * Classes merged onto the tooltip box.
15
23
  */
@@ -19,7 +27,7 @@ export interface ChartTooltipClasses {
19
27
  */
20
28
  swatch?: string;
21
29
  /**
22
- * Classes merged onto the category title.
30
+ * Classes merged onto the title (category, series name).
23
31
  */
24
32
  title?: string;
25
33
  /**
@@ -29,17 +37,21 @@ export interface ChartTooltipClasses {
29
37
  }
30
38
  export interface ChartTooltipContentContext {
31
39
  /**
32
- * Active category label.
40
+ * Swatch color next to the title (scatter series).
33
41
  */
34
- category: string;
42
+ color?: string;
35
43
  /**
36
- * Active category index.
44
+ * Active item index (category, point, slice, or stage).
37
45
  */
38
46
  index: number;
39
47
  /**
40
- * Visible series values at the active category.
48
+ * Rows: series values, point dimensions, or the active slice.
41
49
  */
42
50
  items: ChartTooltipItem[];
51
+ /**
52
+ * Title: the category or series name. Empty for slices.
53
+ */
54
+ title: string;
43
55
  }
44
56
  export interface ChartTooltipCustomProps {
45
57
  /**
@@ -50,8 +62,8 @@ export interface ChartTooltipCustomProps {
50
62
  root?: HTMLAttributes;
51
63
  }
52
64
  /**
53
- * Tooltip for the active category of the nearest `Chart`
54
- * (pointer hover or arrow keys on the focused plot).
65
+ * Tooltip for the active item of the nearest chart (pointer hover or arrow
66
+ * keys on the focused plot).
55
67
  */
56
68
  export interface ChartTooltipOwnProps {
57
69
  /**
@@ -66,6 +78,13 @@ export interface ChartTooltipOwnProps {
66
78
  * @default undefined
67
79
  */
68
80
  customProps?: ChartTooltipCustomProps;
81
+ /**
82
+ * Formats each percent (pie, funnel). Defaults to `Intl.NumberFormat`
83
+ * with the Bridge locale.
84
+ *
85
+ * @default undefined
86
+ */
87
+ formatPercent?: (percent: number, item: ChartTooltipItem) => string;
69
88
  /**
70
89
  * Formats each value. Defaults to `Intl.NumberFormat` with the Bridge locale.
71
90
  *
@@ -6,10 +6,13 @@ export declare function useChartTooltip(props: ChartTooltipOwnProps, tooltipRef:
6
6
  merged: import('vue').ComputedRef<ChartTooltipOwnProps>;
7
7
  context: import('vue').ComputedRef<ChartTooltipContentContext | null>;
8
8
  itemBind: import('vue').ComputedRef<HTMLAttributes>;
9
+ noteBind: import('vue').ComputedRef<HTMLAttributes>;
9
10
  rootBind: import('vue').ComputedRef<HTMLAttributes>;
10
11
  labelBind: import('vue').ComputedRef<HTMLAttributes>;
11
12
  titleBind: import('vue').ComputedRef<HTMLAttributes>;
12
13
  valueBind: import('vue').ComputedRef<HTMLAttributes>;
14
+ percentBind: import('vue').ComputedRef<HTMLAttributes>;
13
15
  formatValue: (item: ChartTooltipItem) => string;
14
- getSwatchBind: (item: ChartTooltipItem) => HTMLAttributes;
16
+ formatPercent: (item: ChartTooltipItem) => string | null;
17
+ getSwatchBind: (color: string) => HTMLAttributes;
15
18
  };