@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.
Files changed (151) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +33 -33
  2. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  3. package/dist/Components/CalendarRange/composables/useCalendarRange.js +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 +59 -0
  11. package/dist/Components/ChartBar/chartBar.types.d.ts +56 -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 +25 -0
  19. package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +45 -0
  20. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.d.ts +5 -0
  21. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +20 -0
  22. package/dist/Components/ChartBarSeries/index.d.ts +3 -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 +76 -0
  40. package/dist/Components/ChartLine/chartLine.types.d.ts +72 -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 +42 -0
  48. package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +75 -0
  49. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.d.ts +5 -0
  50. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +25 -0
  51. package/dist/Components/ChartLineSeries/index.d.ts +3 -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 +73 -0
  56. package/dist/Components/ChartPie/chartPie.types.d.ts +73 -0
  57. package/dist/Components/ChartPie/composables/useChartPie.d.ts +30 -0
  58. package/dist/Components/ChartPie/composables/useChartPie.js +71 -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 +103 -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 +21 -0
  72. package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +38 -0
  73. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.d.ts +4 -0
  74. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +18 -0
  75. package/dist/Components/ChartScatterSeries/index.d.ts +3 -0
  76. package/dist/Components/ChartScatterSeries/index.js +3 -0
  77. package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +18 -10
  78. package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +24 -9
  79. package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +3 -1
  80. package/dist/Components/ChartTooltip/composables/useChartTooltip.js +79 -65
  81. package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -1
  82. package/dist/Components/DatePicker/composables/useDatePicker.js +1 -1
  83. package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +1 -1
  84. package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +1 -1
  85. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +1 -1
  86. package/dist/Components/FormField/composables/useFormField.js +3 -1
  87. package/dist/Components/OtpField/composables/useOtpField.js +90 -89
  88. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
  89. package/dist/Components/Spinner/composables/useSpinner.d.ts +1 -1
  90. package/dist/Components/TimePicker/composables/useTimePicker.js +1 -1
  91. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +1 -1
  92. package/dist/Utils/Charts/ChartFrame.js +5 -0
  93. package/dist/Utils/Charts/ChartFrame.vue.d.ts +24 -0
  94. package/dist/Utils/Charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +41 -0
  95. package/dist/{Components/Chart → Utils/Charts}/chart.types.d.ts +16 -18
  96. package/dist/Utils/Charts/chartInjectionKey.d.ts +151 -0
  97. package/dist/{Components/Chart → Utils/Charts}/chartInjectionKey.js +2 -2
  98. package/dist/Utils/Charts/echarts/bar.d.ts +6 -0
  99. package/dist/Utils/Charts/echarts/bar.js +22 -0
  100. package/dist/Utils/Charts/echarts/cartesian.d.ts +15 -0
  101. package/dist/Utils/Charts/echarts/cartesian.js +255 -0
  102. package/dist/Utils/Charts/echarts/funnel.d.ts +15 -0
  103. package/dist/Utils/Charts/echarts/funnel.js +79 -0
  104. package/dist/Utils/Charts/echarts/line.d.ts +5 -0
  105. package/dist/Utils/Charts/echarts/line.js +19 -0
  106. package/dist/Utils/Charts/echarts/part.d.ts +19 -0
  107. package/dist/Utils/Charts/echarts/part.js +45 -0
  108. package/dist/Utils/Charts/echarts/pie.d.ts +14 -0
  109. package/dist/Utils/Charts/echarts/pie.js +75 -0
  110. package/dist/Utils/Charts/echarts/plot.d.ts +44 -0
  111. package/dist/Utils/Charts/echarts/plot.js +52 -0
  112. package/dist/Utils/Charts/echarts/scatter.d.ts +14 -0
  113. package/dist/Utils/Charts/echarts/scatter.js +152 -0
  114. package/dist/Utils/Charts/index.d.ts +6 -0
  115. package/dist/Utils/Charts/index.js +6 -0
  116. package/dist/Utils/Charts/useChartCartesian.d.ts +57 -0
  117. package/dist/Utils/Charts/useChartCartesian.js +155 -0
  118. package/dist/Utils/Charts/useChartPart.d.ts +45 -0
  119. package/dist/Utils/Charts/useChartPart.js +97 -0
  120. package/dist/Utils/Charts/useChartRegistry.d.ts +13 -0
  121. package/dist/Utils/Charts/useChartRegistry.js +40 -0
  122. package/dist/Utils/Charts/useChartRoot.d.ts +156 -0
  123. package/dist/Utils/Charts/useChartRoot.js +342 -0
  124. package/dist/Utils/Charts/useChartSeries.d.ts +10 -0
  125. package/dist/Utils/Charts/useChartSeries.js +22 -0
  126. package/dist/augments.d.ts +23 -7
  127. package/docs/README.md +6 -1
  128. package/docs/components/Chart.md +114 -154
  129. package/docs/components/ChartBar.md +137 -0
  130. package/docs/components/ChartFunnel.md +62 -0
  131. package/docs/components/ChartLine.md +151 -0
  132. package/docs/components/ChartPie.md +115 -0
  133. package/docs/components/ChartScatter.md +84 -0
  134. package/package.json +2 -2
  135. package/dist/Components/Chart/Chart.js +0 -5
  136. package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +0 -52
  137. package/dist/Components/Chart/chartInjectionKey.d.ts +0 -94
  138. package/dist/Components/Chart/composables/useChart.d.ts +0 -40
  139. package/dist/Components/Chart/composables/useChart.js +0 -346
  140. package/dist/Components/Chart/echartsChart.d.ts +0 -14
  141. package/dist/Components/Chart/echartsChart.js +0 -199
  142. package/dist/Components/Chart/index.d.ts +0 -4
  143. package/dist/Components/Chart/index.js +0 -4
  144. package/dist/Components/ChartSeries/ChartSeries.js +0 -5
  145. package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +0 -4
  146. package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +0 -24
  147. package/dist/Components/ChartSeries/chartSeries.types.d.ts +0 -37
  148. package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +0 -10
  149. package/dist/Components/ChartSeries/composables/useChartSeries.js +0 -29
  150. package/dist/Components/ChartSeries/index.d.ts +0 -3
  151. package/dist/Components/ChartSeries/index.js +0 -3
@@ -1,346 +0,0 @@
1
- import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
- import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
3
- import { CHART_INJECTION_KEY as i } from "../chartInjectionKey.js";
4
- import { mountEchartsChart as ee } from "../echartsChart.js";
5
- import { computed as a, onBeforeUnmount as te, onMounted as ne, provide as re, ref as o, shallowRef as s, useAttrs as ie, useId as ae, watch as c } from "vue";
6
- import { get as l, isEqual as u, isNil as d, omit as f } from "es-toolkit/compat";
7
- import { DEFAULT_CHART_HEIGHT as oe, DEFAULT_CHART_PALETTE as se, DEFAULT_CHART_X_AXIS as ce, DEFAULT_CHART_Y_AXIS as le, formatChartAnnouncement as ue, formatChartValue as de, getAdjacentChartIndex as fe, getChartSummaryParams as pe, getChartTableRows as me, getChartTooltipItems as he, isChartEmpty as p, isSameChartAxisOptions as ge, isSameChartSeriesEntry as _e, resolveChartSeriesColor as ve, toChartCssSize as m } from "@bridge-ui/core/Domain";
8
- import { chartColorProps as ye, chartSizeProps as be, chartThemeProps as xe } from "@bridge-ui/core/Tokens";
9
- import { cn as h, mergeBridgeUILayeredClasses as g, splitComponentProps as Se } from "@bridge-ui/core/Utils";
10
- import { observeColorScheme as Ce, prefersReducedMotion as we, readChartTheme as Te, readCssColor as _ } from "@bridge-ui/core/Runtime";
11
- //#region src/Components/Chart/composables/useChart.ts
12
- var Ee = [
13
- "size",
14
- "width",
15
- "height",
16
- "classes",
17
- "loading",
18
- "palette",
19
- "summary",
20
- "animation",
21
- "categories",
22
- "customProps"
23
- ];
24
- function v(v, De, Oe) {
25
- let ke = ae(), Ae = ie(), y = `bridge-chart${ke}`, b = e(), { hostRef: x, plotRef: S, rootRef: C } = Oe, w = s(null), T = null, E = null, D = o(0), O = o([]), k = o([]), A = s({
26
- width: 0,
27
- height: 0
28
- }), j = s({}), M = s(null), N = s({
29
- index: null,
30
- source: "pointer"
31
- }), P = s({}), F = a(() => Se({
32
- bridgeKeys: Ee,
33
- props: {
34
- ...Ae,
35
- ...v
36
- }
37
- })), I = a(() => F.value.componentProps), { bridge: L, merged: R, entry: z } = n({
38
- libDefaults: De,
39
- componentName: "Chart",
40
- props: () => f(I.value, ["palette", "categories"])
41
- }), B = r({
42
- entry: z,
43
- props: () => I.value
44
- }), V = a(() => L?.global.value.locale ?? "en-US"), H = a(() => R.value.customProps), je = a(() => JSON.stringify(I.value.categories ?? [])), U = a(() => JSON.parse(je.value)), Me = a(() => JSON.stringify(I.value.palette ?? R.value.palette ?? se)), Ne = a(() => JSON.parse(Me.value)), Pe = a(() => g(be, z.value?.tokens?.size)), Fe = a(() => g(ye, z.value?.tokens?.color)), W = a(() => g(xe, z.value?.tokens?.theme)), G = a(() => l(Pe.value, R.value.size)), K = a(() => k.value.map((e, t) => {
45
- let n = ve({
46
- index: t,
47
- color: e.color,
48
- palette: Ne.value
49
- });
50
- return {
51
- color: n,
52
- id: e.id,
53
- className: l(Fe.value, [n, "series"])
54
- };
55
- })), q;
56
- ne(() => {
57
- q = Ce(() => {
58
- D.value += 1;
59
- });
60
- }), c([
61
- C,
62
- D,
63
- W,
64
- K,
65
- () => G.value?.root,
66
- () => L?.global.value.theme
67
- ], () => {
68
- let e = C.value;
69
- if (d(e)) return;
70
- let t = {};
71
- K.value.forEach((n) => {
72
- t[n.id] = d(n.className) ? _(e, { color: n.color }) : _(e, { className: n.className });
73
- });
74
- let n = Te(e, {
75
- axis: W.value.axis ?? "",
76
- grid: W.value.grid ?? "",
77
- text: W.value.text ?? ""
78
- });
79
- u(j.value, t) || (j.value = t), u(M.value, n) || (M.value = n);
80
- }, {
81
- flush: "post",
82
- immediate: !0
83
- }), c(S, (e, t, n) => {
84
- if (d(e)) return;
85
- let r = () => {
86
- let t = e.clientWidth, n = e.clientHeight;
87
- (A.value.width !== t || A.value.height !== n) && (A.value = {
88
- width: t,
89
- height: n
90
- });
91
- };
92
- if (r(), typeof ResizeObserver > "u") return;
93
- let i = new ResizeObserver(r);
94
- i.observe(e), n(() => {
95
- i.disconnect();
96
- });
97
- }, {
98
- flush: "post",
99
- immediate: !0
100
- });
101
- function Ie(e) {
102
- let t = k.value.findIndex((t) => t.id === e.id);
103
- if (t === -1) {
104
- k.value = [...k.value, e];
105
- return;
106
- }
107
- if (_e(k.value[t], e)) return;
108
- let n = [...k.value];
109
- n[t] = e, k.value = n;
110
- }
111
- function Le(e) {
112
- k.value = k.value.filter((t) => t.id !== e);
113
- }
114
- function Re(e, t) {
115
- let n = P.value[e];
116
- (d(n) || !ge(n, t)) && (P.value = {
117
- ...P.value,
118
- [e]: t
119
- });
120
- }
121
- function ze(e) {
122
- P.value = f(P.value, [e]);
123
- }
124
- function Be(e) {
125
- O.value = O.value.includes(e) ? O.value.filter((t) => t !== e) : [...O.value, e];
126
- }
127
- function Ve(e) {
128
- w.value?.highlightSeries(e);
129
- }
130
- function He(e) {
131
- N.value.index !== e && (N.value = {
132
- index: e,
133
- source: "pointer"
134
- });
135
- }
136
- let J = a(() => k.value.map((e) => ({
137
- ...e,
138
- resolvedColor: j.value[e.id] ?? "",
139
- hidden: O.value.includes(e.id)
140
- }))), Y = a(() => J.value.filter((e) => !e.hidden)), Ue = a(() => ({
141
- ...ce,
142
- ...P.value.x
143
- })), We = a(() => ({
144
- ...le,
145
- ...P.value.y
146
- })), Ge = a(() => R.value.animation !== !1 && !we()), X = a(() => d(M.value) ? null : {
147
- theme: M.value,
148
- xAxis: Ue.value,
149
- yAxis: We.value,
150
- animation: Ge.value,
151
- width: A.value.width,
152
- categories: U.value,
153
- height: A.value.height,
154
- series: Y.value.map((e) => ({
155
- id: e.id,
156
- name: e.name,
157
- type: e.type,
158
- data: e.data,
159
- curve: e.curve,
160
- color: e.resolvedColor
161
- }))
162
- }), Z = a(() => !d(x.value) && !d(X.value));
163
- function Q() {
164
- w.value?.destroy(), w.value = null, E = null, T?.remove(), T = null;
165
- }
166
- c([x, Z], () => {
167
- Q();
168
- let e = x.value, t = X.value;
169
- if (!Z.value || d(e) || d(t)) return;
170
- let n = document.createElement("div");
171
- n.className = "absolute inset-0", e.appendChild(n), T = n, w.value = ee({
172
- ...t,
173
- element: n,
174
- onActiveIndexChange: He
175
- }), E = t;
176
- }, {
177
- flush: "post",
178
- immediate: !0
179
- }), c(X, (e) => {
180
- let t = w.value;
181
- d(t) || d(e) || E === e || (E = e, t.update(e));
182
- }, { flush: "post" }), c(N, (e) => {
183
- e.source === "keyboard" && w.value?.setActiveIndex(e.index);
184
- }, { flush: "post" }), te(() => {
185
- q?.(), Q();
186
- });
187
- let Ke = a(() => {
188
- let e = N.value.index;
189
- return d(e) ? [] : he({
190
- index: e,
191
- series: Y.value.map((e) => ({
192
- ...e,
193
- color: e.resolvedColor
194
- }))
195
- });
196
- });
197
- function qe(e) {
198
- let t = w.value?.getCategoryAnchor(e), n = S.value;
199
- return d(t) || d(n) ? null : {
200
- y: t.y + n.offsetTop,
201
- x: t.x + n.offsetLeft
202
- };
203
- }
204
- function Je() {
205
- return {
206
- width: C.value?.clientWidth ?? 0,
207
- height: C.value?.clientHeight ?? 0
208
- };
209
- }
210
- let Ye = a(() => ({
211
- setAxis: Re,
212
- getBounds: Je,
213
- removeAxis: ze,
214
- id: y,
215
- removeSeries: Le,
216
- toggleSeries: Be,
217
- upsertSeries: Ie,
218
- highlightSeries: Ve,
219
- getTooltipAnchor: qe,
220
- series: J.value,
221
- locale: V.value,
222
- categories: U.value,
223
- activeIndex: N.value.index,
224
- tooltipItems: Ke.value,
225
- tokenClasses: {
226
- legend: l(G.value, "legend"),
227
- swatch: l(G.value, "swatch"),
228
- tooltip: l(G.value, "tooltip"),
229
- legendItem: l(G.value, "legendItem")
230
- }
231
- }));
232
- re(i, Ye);
233
- let $ = a(() => I.value.loading === !0), Xe = a(() => !$.value && p(k.value)), Ze = a(() => b("No data")), Qe = a(() => d(I.value.summary) ? p(k.value) ? Ze.value : b("Chart with {{count}} series ({{names}}) across {{categories}} categories, from {{first}} to {{last}}.", pe({
234
- series: k.value,
235
- categories: U.value
236
- })) : I.value.summary), $e = a(() => {
237
- let e = N.value.index;
238
- return N.value.source !== "keyboard" || d(e) ? "" : ue({
239
- locale: V.value,
240
- items: Ke.value,
241
- category: U.value[e] ?? ""
242
- });
243
- }), et = a(() => ({
244
- categoryLabel: b("Category"),
245
- series: k.value.map((e) => ({
246
- id: e.id,
247
- name: e.name
248
- })),
249
- rows: me({
250
- series: k.value,
251
- categories: U.value
252
- }).map((e) => ({
253
- category: e.category,
254
- values: e.values.map((e) => d(e) ? "—" : de(e, V.value))
255
- }))
256
- }));
257
- function tt(e) {
258
- if (H.value?.plot?.onKeydown?.(e), e.defaultPrevented) return;
259
- let t = fe({
260
- key: e.key,
261
- current: N.value.index,
262
- count: U.value.length
263
- });
264
- t !== void 0 && (e.preventDefault(), N.value = {
265
- index: t,
266
- source: "keyboard"
267
- });
268
- }
269
- function nt(e) {
270
- H.value?.plot?.onBlur?.(e), N.value.source === "keyboard" && (N.value = {
271
- index: null,
272
- source: "keyboard"
273
- });
274
- }
275
- let rt = a(() => t(f(H.value?.root, ["style"]), f(F.value.inheritedAttrs, ["style"]), {
276
- role: "figure",
277
- "aria-busy": $.value || void 0,
278
- style: [
279
- { width: m(I.value.width, "100%") },
280
- F.value.inheritedAttrs.style,
281
- H.value?.root?.style
282
- ],
283
- class: h({
284
- "relative flex min-w-0 flex-col gap-3": !0,
285
- [l(G.value, "root") ?? ""]: !0,
286
- [l(B.value, "root") ?? ""]: !0
287
- })
288
- })), it = a(() => t(f(H.value?.plot, [
289
- "style",
290
- "onBlur",
291
- "onKeydown"
292
- ]), void 0, {
293
- role: "img",
294
- tabindex: 0,
295
- onBlur: nt,
296
- onKeydown: tt,
297
- "aria-label": Qe.value,
298
- style: [{ height: m(R.value.height, `${oe}px`) }, H.value?.plot?.style],
299
- class: h({
300
- "relative w-full min-w-0 rounded-md outline-none": !0,
301
- "focus-visible:ring-2 focus-visible:ring-primary-500/50": !0,
302
- [l(B.value, "plot") ?? ""]: !0
303
- })
304
- })), at = a(() => ({
305
- "aria-hidden": !0,
306
- class: "absolute inset-0"
307
- })), ot = a(() => ({ class: h({
308
- "absolute inset-0 z-10 flex items-center justify-center": !0,
309
- "bg-white/50 dark:bg-dark-900/50": !0,
310
- [l(B.value, "loading") ?? ""]: !0
311
- }) })), st = a(() => ({ class: h({
312
- "absolute inset-0 z-10 flex items-center justify-center": !0,
313
- "text-dark-500 dark:text-dark-400": !0,
314
- [l(B.value, "empty") ?? ""]: !0
315
- }) })), ct = a(() => ({
316
- id: `${y}-table`,
317
- class: h({
318
- "sr-only block": !0,
319
- [l(B.value, "table") ?? ""]: !0
320
- })
321
- }));
322
- return {
323
- table: et,
324
- merged: R,
325
- isEmpty: Xe,
326
- summary: Qe,
327
- hostBind: at,
328
- plotBind: it,
329
- rootBind: rt,
330
- liveBind: a(() => ({
331
- role: "status",
332
- class: "sr-only",
333
- "aria-atomic": !0,
334
- "aria-live": "polite"
335
- })),
336
- emptyBind: st,
337
- isLoading: $,
338
- tableBind: ct,
339
- loadingBind: ot,
340
- announcement: $e,
341
- contextValue: Ye,
342
- emptyMessage: Ze
343
- };
344
- }
345
- //#endregion
346
- export { v as useChart };
@@ -1,14 +0,0 @@
1
- import { BarSeriesOption, LineSeriesOption } from 'echarts/charts';
2
- import { GridComponentOption, TooltipComponentOption } from 'echarts/components';
3
- import { ComposeOption } from 'echarts/core';
4
- import { ChartHandle, ChartMountOptions, ChartRenderOptions } from '@bridge-ui/core/Domain';
5
- type EChartsOption = ComposeOption<BarSeriesOption | LineSeriesOption | GridComponentOption | TooltipComponentOption>;
6
- /**
7
- * Builds the ECharts option for the current render options.
8
- */
9
- export declare function buildEchartsOption(options: ChartRenderOptions): EChartsOption;
10
- /**
11
- * Mounts an ECharts plot into `options.element`.
12
- */
13
- export declare function mountEchartsChart(options: ChartMountOptions): ChartHandle;
14
- export {};
@@ -1,199 +0,0 @@
1
- import { get as e, isArray as t, isNil as n, isNumber as r } from "es-toolkit/compat";
2
- import { hasChartBarSeries as i } from "@bridge-ui/core/Domain";
3
- import { BarChart as a, LineChart as o } from "echarts/charts";
4
- import { GridComponent as s, TooltipComponent as c } from "echarts/components";
5
- import { init as l, use as u } from "echarts/core";
6
- import { SVGRenderer as d } from "echarts/renderers";
7
- //#region src/Components/Chart/echartsChart.ts
8
- var f = .15, p = 32;
9
- u([
10
- o,
11
- a,
12
- s,
13
- c,
14
- d
15
- ]);
16
- function m(e) {
17
- return {
18
- color: e.textColor,
19
- fontSize: e.fontSize,
20
- fontFamily: e.fontFamily
21
- };
22
- }
23
- function h(e) {
24
- return e.type === "bar" ? {
25
- type: "bar",
26
- id: e.id,
27
- name: e.name,
28
- data: e.data,
29
- barMaxWidth: p,
30
- emphasis: { focus: "series" },
31
- itemStyle: {
32
- color: e.color,
33
- borderRadius: [
34
- 4,
35
- 4,
36
- 0,
37
- 0
38
- ]
39
- }
40
- } : {
41
- type: "line",
42
- symbolSize: 6,
43
- id: e.id,
44
- symbol: "circle",
45
- showSymbol: !1,
46
- name: e.name,
47
- data: e.data,
48
- connectNulls: !1,
49
- emphasis: { focus: "series" },
50
- smooth: e.curve === "smooth",
51
- itemStyle: { color: e.color },
52
- lineStyle: {
53
- width: 2,
54
- color: e.color
55
- },
56
- areaStyle: e.type === "area" ? {
57
- color: e.color,
58
- opacity: f
59
- } : void 0
60
- };
61
- }
62
- function g(e) {
63
- let t = e.formatTick;
64
- if (!n(t)) return (e) => t(e);
65
- }
66
- function _(e) {
67
- let { theme: t, xAxis: r, yAxis: a } = e, o = i(e.series), s = Math.round(t.fontSize * 2.25);
68
- return {
69
- animation: e.animation,
70
- series: e.series.map(h),
71
- textStyle: {
72
- fontSize: t.fontSize,
73
- fontFamily: t.fontFamily
74
- },
75
- grid: {
76
- left: 4,
77
- right: 12,
78
- outerBoundsMode: "same",
79
- outerBoundsContain: "axisLabel",
80
- top: n(a.label) ? 12 : s,
81
- bottom: n(r.label) ? 4 : s
82
- },
83
- tooltip: {
84
- show: !0,
85
- trigger: "axis",
86
- showContent: !1,
87
- axisPointer: {
88
- type: o ? "shadow" : "line",
89
- lineStyle: { color: t.axisColor },
90
- shadowStyle: {
91
- opacity: .5,
92
- color: t.gridColor
93
- }
94
- }
95
- },
96
- yAxis: {
97
- type: "value",
98
- min: a.min,
99
- max: a.max,
100
- name: a.label,
101
- show: !a.hidden,
102
- nameLocation: "end",
103
- axisLine: { show: !1 },
104
- splitNumber: a.tickCount,
105
- nameTextStyle: m(t),
106
- axisLabel: {
107
- ...m(t),
108
- formatter: g(a)
109
- },
110
- splitLine: {
111
- show: a.grid,
112
- lineStyle: { color: t.gridColor }
113
- }
114
- },
115
- xAxis: {
116
- nameGap: s,
117
- type: "category",
118
- name: r.label,
119
- boundaryGap: o,
120
- show: !r.hidden,
121
- nameLocation: "middle",
122
- data: e.categories,
123
- axisTick: { show: !1 },
124
- nameTextStyle: m(t),
125
- axisLine: { lineStyle: { color: t.axisColor } },
126
- axisLabel: {
127
- ...m(t),
128
- formatter: g(r)
129
- },
130
- splitLine: {
131
- show: r.grid,
132
- lineStyle: { color: t.gridColor }
133
- }
134
- }
135
- };
136
- }
137
- function v(n) {
138
- let i = e(n, "axesInfo"), a = t(i) ? e(i, [0, "value"]) : null;
139
- return r(a) ? a : null;
140
- }
141
- function y(e) {
142
- let i = e, a = null, o = null, s = !1, c = (t) => {
143
- s || t === o || (o = t, e.onActiveIndexChange(t));
144
- }, u = () => n(a) ? i.width <= 0 || i.height <= 0 ? null : (a = l(e.element, null, {
145
- renderer: "svg",
146
- width: i.width,
147
- height: i.height
148
- }), a.on("updateAxisPointer", (e) => {
149
- c(v(e));
150
- }), a.getZr().on("globalout", () => {
151
- c(null);
152
- }), a) : a, d = () => {
153
- let e = u();
154
- if (n(e)) return;
155
- let { width: t, height: r } = i;
156
- (e.getWidth() !== t || e.getHeight() !== r) && e.resize({
157
- width: t,
158
- height: r
159
- }), e.setOption(_(i), { replaceMerge: ["series"] });
160
- };
161
- return d(), {
162
- update: (e) => {
163
- i = e, d();
164
- },
165
- destroy: () => {
166
- a?.dispose(), a = null;
167
- },
168
- highlightSeries: (e) => {
169
- a?.dispatchAction({ type: "downplay" }), n(e) || a?.dispatchAction({
170
- seriesId: e,
171
- type: "highlight"
172
- });
173
- },
174
- setActiveIndex: (e) => {
175
- n(a) || i.series.length === 0 || (s = !0, o = e, n(e) ? a.dispatchAction({ type: "hideTip" }) : a.dispatchAction({
176
- seriesIndex: 0,
177
- type: "showTip",
178
- dataIndex: e
179
- }), s = !1);
180
- },
181
- getCategoryAnchor: (e) => {
182
- if (n(a) || e < 0 || e >= i.categories.length) return null;
183
- let o = a.convertToPixel({ xAxisIndex: 0 }, e);
184
- if (!r(o)) return null;
185
- let s = i.series.flatMap((n) => {
186
- let i = n.data[e];
187
- if (!r(i)) return [];
188
- let o = a?.convertToPixel({ gridIndex: 0 }, [e, i]);
189
- return t(o) && r(o[1]) ? [o[1]] : [];
190
- });
191
- return {
192
- x: o,
193
- y: s.length > 0 ? Math.min(...s) : i.height / 2
194
- };
195
- }
196
- };
197
- }
198
- //#endregion
199
- export { _ as buildEchartsOption, y as mountEchartsChart };
@@ -1,4 +0,0 @@
1
- export type { ChartClasses, ChartColorOverrides, ChartCustomProps, ChartOwnProps, ChartProps, ChartSeriesColor, ChartSizeOverrides, ChartSlots, } from './chart.types';
2
- export { default as Chart } from './Chart.vue';
3
- export { CHART_INJECTION_KEY, useChartContext, type ChartContextValue, type ChartResolvedSeries, } from './chartInjectionKey';
4
- export { useChart } from './composables/useChart';
@@ -1,4 +0,0 @@
1
- import { CHART_INJECTION_KEY as e, useChartContext as t } from "./chartInjectionKey.js";
2
- import { useChart as n } from "./composables/useChart.js";
3
- import r from "./Chart.js";
4
- export { e as CHART_INJECTION_KEY, r as Chart, n as useChart, t as useChartContext };
@@ -1,5 +0,0 @@
1
- import e from "./ChartSeries.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/Components/ChartSeries/ChartSeries.vue
3
- var t = e;
4
- //#endregion
5
- export { t as default };
@@ -1,4 +0,0 @@
1
- import { ChartSeriesOwnProps } from './chartSeries.types';
2
- declare const __VLS_export: import('vue').DefineComponent<ChartSeriesOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ChartSeriesOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
3
- declare const _default: typeof __VLS_export;
4
- export default _default;
@@ -1,24 +0,0 @@
1
- import { useChartSeries as e } from "./composables/useChartSeries.js";
2
- import { createElementBlock as t, defineComponent as n, openBlock as r } from "vue";
3
- //#region src/Components/ChartSeries/ChartSeries.vue?vue&type=script&setup=true&lang.ts
4
- var i = {
5
- hidden: "",
6
- "aria-hidden": "true"
7
- }, a = /*@__PURE__*/ n({
8
- __name: "ChartSeries",
9
- props: {
10
- color: {},
11
- curve: {},
12
- data: {},
13
- name: {},
14
- type: {}
15
- },
16
- setup(n) {
17
- return e(n, {
18
- type: "line",
19
- curve: "linear"
20
- }), (e, n) => (r(), t("span", i));
21
- }
22
- });
23
- //#endregion
24
- export { a as default };
@@ -1,37 +0,0 @@
1
- import { ChartCurve, ChartDatum, ChartType } from '@bridge-ui/core/Domain';
2
- import { ChartSeriesColor } from '../Chart/chart.types';
3
- /**
4
- * One data series registered on the nearest `Chart`. Renders nothing.
5
- */
6
- export interface ChartSeriesOwnProps {
7
- /**
8
- * Series color (token key or CSS color). Falls back to the `Chart` palette.
9
- *
10
- * @default undefined
11
- */
12
- color?: ChartSeriesColor;
13
- /**
14
- * Line interpolation for `line` / `area` series.
15
- *
16
- * @default "linear"
17
- */
18
- curve?: ChartCurve;
19
- /**
20
- * One value per `Chart` category. `null` renders a gap.
21
- */
22
- data: ChartDatum[];
23
- /**
24
- * Series name shown in the legend, tooltip, and data table.
25
- */
26
- name: string;
27
- /**
28
- * Series family.
29
- *
30
- * @default "line"
31
- */
32
- type?: ChartType;
33
- }
34
- /**
35
- * `ChartSeries` has no DOM element, so it takes no HTML attributes.
36
- */
37
- export type ChartSeriesProps = ChartSeriesOwnProps;
@@ -1,10 +0,0 @@
1
- import { ChartSeriesEntry } from '@bridge-ui/core/Domain';
2
- import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
3
- import { ChartSeriesOwnProps, ChartSeriesProps } from '../chartSeries.types';
4
- type ChartSeriesLibDefaults = LibDefaultsShape<ChartSeriesOwnProps, "type" | "curve">;
5
- type ChartSeriesMerged = MergeLibDefaults<Pick<ChartSeriesOwnProps, "type" | "curve">, ChartSeriesLibDefaults>;
6
- export declare function useChartSeries(props: ChartSeriesProps, libDefaults: ChartSeriesLibDefaults): {
7
- entry: import('vue').ComputedRef<ChartSeriesEntry>;
8
- merged: import('vue').ComputedRef<ChartSeriesMerged>;
9
- };
10
- export {};
@@ -1,29 +0,0 @@
1
- import { useBridgeUIComponent as e } from "../../../Utils/index.js";
2
- import { useChartContext as t } from "../../Chart/chartInjectionKey.js";
3
- import { computed as n, onBeforeUnmount as r, useId as i, watch as a } from "vue";
4
- import { pick as o } from "es-toolkit/compat";
5
- //#region src/Components/ChartSeries/composables/useChartSeries.ts
6
- function s(s, c) {
7
- let l = t(), u = i(), d = `${l.value.id}-series${u}`, { merged: f } = e({
8
- libDefaults: c,
9
- componentName: "ChartSeries",
10
- props: () => o(s, ["type", "curve"])
11
- }), p = n(() => ({
12
- id: d,
13
- name: s.name,
14
- data: s.data,
15
- color: s.color,
16
- type: f.value.type,
17
- curve: f.value.curve
18
- }));
19
- return a(p, (e) => {
20
- l.value.upsertSeries(e);
21
- }, { immediate: !0 }), r(() => {
22
- l.value.removeSeries(d);
23
- }), {
24
- entry: p,
25
- merged: f
26
- };
27
- }
28
- //#endregion
29
- export { s as useChartSeries };
@@ -1,3 +0,0 @@
1
- export type { ChartSeriesOwnProps, ChartSeriesProps, } from './chartSeries.types';
2
- export { default as ChartSeries } from './ChartSeries.vue';
3
- export { useChartSeries } from './composables/useChartSeries';
@@ -1,3 +0,0 @@
1
- import { useChartSeries as e } from "./composables/useChartSeries.js";
2
- import t from "./ChartSeries.js";
3
- export { t as ChartSeries, e as useChartSeries };