@bagelink/vue 1.15.202 → 1.15.205

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 (69) hide show
  1. package/dist/components/AddressSearch.vue.d.ts.map +1 -1
  2. package/dist/components/Swiper.vue.d.ts +2 -2
  3. package/dist/components/calendar/CalendarPopover.vue.d.ts.map +1 -1
  4. package/dist/components/charts/BarChart.vue.d.ts.map +1 -1
  5. package/dist/components/charts/ChartTooltip.vue.d.ts.map +1 -1
  6. package/dist/components/charts/Donut.vue.d.ts.map +1 -1
  7. package/dist/components/charts/Funnel.vue.d.ts.map +1 -1
  8. package/dist/components/charts/Gauge.vue.d.ts.map +1 -1
  9. package/dist/components/charts/LineChart.vue.d.ts.map +1 -1
  10. package/dist/components/charts/MapChart.vue.d.ts +25 -0
  11. package/dist/components/charts/MapChart.vue.d.ts.map +1 -0
  12. package/dist/components/charts/RadialBars.vue.d.ts.map +1 -1
  13. package/dist/components/charts/RankBars.vue.d.ts.map +1 -1
  14. package/dist/components/charts/StatCard.vue.d.ts.map +1 -1
  15. package/dist/components/charts/core/arc.d.ts +6 -0
  16. package/dist/components/charts/core/arc.d.ts.map +1 -0
  17. package/dist/components/charts/core/useChartTip.d.ts +13 -0
  18. package/dist/components/charts/core/useChartTip.d.ts.map +1 -0
  19. package/dist/components/charts/core/world-paths.d.ts +13 -0
  20. package/dist/components/charts/core/world-paths.d.ts.map +1 -0
  21. package/dist/components/charts/index.d.ts +2 -0
  22. package/dist/components/charts/index.d.ts.map +1 -1
  23. package/dist/components/charts/mapTypes.d.ts +7 -0
  24. package/dist/components/charts/mapTypes.d.ts.map +1 -0
  25. package/dist/components/dataTable/DataTable.vue.d.ts.map +1 -1
  26. package/dist/components/form/inputs/DateInput.vue.d.ts +3 -0
  27. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  28. package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
  29. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  30. package/dist/components/form/inputs/index.d.ts +0 -1
  31. package/dist/components/form/inputs/index.d.ts.map +1 -1
  32. package/dist/components/index.d.ts +2 -2
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/form-flow/FormFlowPlayer.vue.d.ts +18 -0
  35. package/dist/form-flow/FormFlowPlayer.vue.d.ts.map +1 -1
  36. package/dist/form-flow/structure.d.ts +12 -0
  37. package/dist/form-flow/structure.d.ts.map +1 -1
  38. package/dist/index.cjs +177 -154
  39. package/dist/index.mjs +37661 -43116
  40. package/dist/style.css +1 -2
  41. package/package.json +1 -1
  42. package/src/components/charts/BarChart.vue +15 -15
  43. package/src/components/charts/ChartTooltip.vue +7 -6
  44. package/src/components/charts/Donut.vue +25 -40
  45. package/src/components/charts/Funnel.vue +10 -12
  46. package/src/components/charts/Gauge.vue +4 -2
  47. package/src/components/charts/LineChart.vue +15 -17
  48. package/src/components/charts/MapChart.vue +198 -0
  49. package/src/components/charts/RadialBars.vue +3 -1
  50. package/src/components/charts/RankBars.vue +2 -0
  51. package/src/components/charts/Sparkline.vue +1 -1
  52. package/src/components/charts/StatCard.vue +2 -0
  53. package/src/components/charts/core/arc.ts +53 -0
  54. package/src/components/charts/core/useChartTip.ts +35 -0
  55. package/src/components/charts/core/world-paths.ts +351 -0
  56. package/src/components/charts/index.ts +3 -0
  57. package/src/components/charts/mapTypes.ts +6 -0
  58. package/src/components/dataTable/useTableVirtualization.ts +5 -5
  59. package/src/components/form/inputs/DateInput.vue +9 -1
  60. package/src/components/form/inputs/NumberInput.vue +17 -6
  61. package/src/components/form/inputs/index.ts +0 -1
  62. package/src/components/index.ts +2 -2
  63. package/src/form-flow/FormFlowPlayer.vue +49 -0
  64. package/src/form-flow/structure.ts +12 -0
  65. package/dist/components/dataTable/useTableVirtualization.d.ts +0 -25
  66. package/dist/components/dataTable/useTableVirtualization.d.ts.map +0 -1
  67. package/dist/components/form/inputs/JSONInput.vue.d.ts +0 -21
  68. package/dist/components/form/inputs/JSONInput.vue.d.ts.map +0 -1
  69. package/src/components/form/inputs/JSONInput.vue +0 -60
@@ -0,0 +1,53 @@
1
+ /**
2
+ * SVG arc helpers for pie / donut slices.
3
+ * Full 360° arcs must be split — a single SVG arc with coincident endpoints collapses.
4
+ */
5
+ const TWO_PI = Math.PI * 2
6
+ const EPS = 1e-6
7
+
8
+ /**
9
+ * Build an SVG path for a pie wedge (`ri === 0`) or donut slice (`ri > 0`)
10
+ * spanning `sweep` radians clockwise from `a0` (0 = east, −π/2 = north).
11
+ */
12
+ export function slicePath(
13
+ cx: number,
14
+ cy: number,
15
+ r: number,
16
+ ri: number,
17
+ a0: number,
18
+ sweep: number,
19
+ ): string {
20
+ if (sweep <= EPS || r <= 0) return ''
21
+
22
+ // Full circle / ring — two semicircle arcs (SVG can't draw 360° in one A).
23
+ if (sweep >= TWO_PI - EPS) {
24
+ if (ri <= 0) {
25
+ return `M ${cx + r} ${cy} A ${r} ${r} 0 1 1 ${cx - r} ${cy} A ${r} ${r} 0 1 1 ${cx + r} ${cy} Z`
26
+ }
27
+ return [
28
+ `M ${cx + r} ${cy}`,
29
+ `A ${r} ${r} 0 1 1 ${cx - r} ${cy}`,
30
+ `A ${r} ${r} 0 1 1 ${cx + r} ${cy}`,
31
+ `L ${cx + ri} ${cy}`,
32
+ `A ${ri} ${ri} 0 1 0 ${cx - ri} ${cy}`,
33
+ `A ${ri} ${ri} 0 1 0 ${cx + ri} ${cy}`,
34
+ 'Z',
35
+ ].join(' ')
36
+ }
37
+
38
+ const a1 = a0 + sweep
39
+ const large = sweep > Math.PI ? 1 : 0
40
+ const x0 = cx + r * Math.cos(a0)
41
+ const y0 = cy + r * Math.sin(a0)
42
+ const x1 = cx + r * Math.cos(a1)
43
+ const y1 = cy + r * Math.sin(a1)
44
+
45
+ if (ri > 0) {
46
+ const xi1 = cx + ri * Math.cos(a1)
47
+ const yi1 = cy + ri * Math.sin(a1)
48
+ const xi0 = cx + ri * Math.cos(a0)
49
+ const yi0 = cy + ri * Math.sin(a0)
50
+ return `M ${x0} ${y0} A ${r} ${r} 0 ${large} 1 ${x1} ${y1} L ${xi1} ${yi1} A ${ri} ${ri} 0 ${large} 0 ${xi0} ${yi0} Z`
51
+ }
52
+ return `M ${cx} ${cy} L ${x0} ${y0} A ${r} ${r} 0 ${large} 1 ${x1} ${y1} Z`
53
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared tooltip anchoring helpers for charts.
3
+ *
4
+ * Two placement modes (match ChartTooltip `prefer`):
5
+ * - **follow** (`prefer="above"`): cursor-anchored — Donut, Map, Funnel
6
+ * - **pinned** (`prefer="top"`): top of chart, x follows mouse — Line, Bar
7
+ */
8
+ import { computed, type Ref } from 'vue'
9
+
10
+ /** Update tip coords from a mouse event relative to `currentTarget`. */
11
+ export function trackLocalPointer(
12
+ e: MouseEvent,
13
+ tipX: Ref<number>,
14
+ tipY?: Ref<number>,
15
+ ) {
16
+ const el = e.currentTarget as HTMLElement | null
17
+ if (!el) return
18
+ const rect = el.getBoundingClientRect()
19
+ tipX.value = e.clientX - rect.left
20
+ if (tipY) tipY.value = e.clientY - rect.top
21
+ }
22
+
23
+ /** Cursor-follow style: `{ left, top }` for `prefer="above"|"below"`. */
24
+ export function tipFollowStyle(tipX: Ref<number>, tipY: Ref<number>) {
25
+ return computed(() => ({ left: `${tipX.value}px`, top: `${tipY.value}px` }))
26
+ }
27
+
28
+ /** Pinned-to-top style: `{ left }` clamped inside the chart for `prefer="top"`. */
29
+ export function tipPinnedStyle(tipX: Ref<number>, width: Ref<number>, half = 70) {
30
+ return computed(() => {
31
+ const w = width.value
32
+ const x = Math.min(Math.max(tipX.value, half), Math.max(half, w - half))
33
+ return { left: `${x}px` }
34
+ })
35
+ }