@lionad/cx-comps-tanstack-charts 0.1.0-alpha.7 → 0.1.0-alpha.8

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 (2) hide show
  1. package/dist/index.mjs +17 -10
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -24,6 +24,7 @@ import { treemap } from "@tanstack/charts/hierarchy/treemap";
24
24
  import { forceLayout } from "@tanstack/charts/network/force";
25
25
  import { sankeyDiagram } from "@tanstack/charts/network/sankey";
26
26
  import { geoAlbersUsa, geoEqualEarth, geoIdentity, geoMercator, geoNaturalEarth1, geoOrthographic } from "d3-geo";
27
+ import { tooltip } from "@tanstack/charts/tooltip";
27
28
  import { compileTrigger, createTriggerRegistry } from "@lionad/cx-stream";
28
29
  //#region src/shared/chart-skeleton.vue
29
30
  const _sfc_main$6 = /*@__PURE__*/ defineComponent({
@@ -1145,10 +1146,15 @@ function translateLegend(legend) {
1145
1146
  if (width !== void 0) items.width = width;
1146
1147
  return colorLegend(items);
1147
1148
  }
1148
- /** tooltip 声明:true→缺省开启(undefined),false→关闭,对象→标量子集原样透传 */
1149
- function translateTooltip(tooltip) {
1150
- if (tooltip === true) return void 0;
1151
- if (tooltip === false) return false;
1149
+ /**
1150
+ * tooltip 声明:false→关闭;true→默认 DOM extension;对象→extension + 标量子集。
1151
+ * 库层没有「缺省开启」——resolveTooltipInput undefined 返回 null 即关闭,
1152
+ * 开启必须显式挂 extension(裸 extension { use, ...options } 两形态);
1153
+ * 裸 options 对象会在 mount 时抛 TypeError(input.use 为 undefined)。
1154
+ */
1155
+ function translateTooltip(tooltip$1) {
1156
+ if (tooltip$1 === false) return false;
1157
+ if (tooltip$1 === true) return tooltip;
1152
1158
  const options = {};
1153
1159
  for (const key of [
1154
1160
  "placement",
@@ -1158,8 +1164,11 @@ function translateTooltip(tooltip) {
1158
1164
  "anchor",
1159
1165
  "sort",
1160
1166
  "items"
1161
- ]) if (tooltip[key] !== void 0) options[key] = tooltip[key];
1162
- return options;
1167
+ ]) if (tooltip$1[key] !== void 0) options[key] = tooltip$1[key];
1168
+ return {
1169
+ use: tooltip,
1170
+ ...options
1171
+ };
1163
1172
  }
1164
1173
  /**
1165
1174
  * 时间轴 channel 纠偏:utc/time scale 要求 channel 值为 Date 实例,而 JSON spec 只能
@@ -1276,10 +1285,8 @@ function buildDefinition(spec, datasets, rowsOverride) {
1276
1285
  if (spec.keyboard !== void 0) definition.keyboard = spec.keyboard;
1277
1286
  if (spec.focusRing !== void 0) definition.focusRing = spec.focusRing;
1278
1287
  if (spec.focus !== void 0) definition.focus = spec.focus;
1279
- if (spec.tooltip !== void 0) {
1280
- const tooltip = translateTooltip(spec.tooltip);
1281
- if (tooltip !== void 0) definition.tooltip = tooltip;
1282
- }
1288
+ const tooltip$2 = spec.tooltip === void 0 ? tooltip : translateTooltip(spec.tooltip);
1289
+ if (tooltip$2 !== void 0) definition.tooltip = tooltip$2;
1283
1290
  return definition;
1284
1291
  }
1285
1292
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lionad/cx-comps-tanstack-charts",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.1.0-alpha.8",
4
4
  "description": "cx material components wrapping TanStack Charts (@tanstack/charts/vue)",
5
5
  "keywords": [
6
6
  "charts",