zzz-pc-view 0.0.97 → 0.0.99

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.
@@ -12,12 +12,12 @@ export declare enum LegendChangeType {
12
12
  }
13
13
  /**
14
14
  * 用于管理 ECharts 图例选择状态的组合式函数。
15
- * 该函数提供了一系列方法来处理图例的选择、反选、清空等操作,并在状态改变时触发回调。
15
+ * 该函数提供了一系列方法来处理图例的选择、反选、清空等操作,并在选择状态改变时触发回调。
16
16
  *
17
17
  * @param param - 包含配置选项的对象。
18
- * @param param.dimensions - 趋势图数值维度数组,用于提供图例项的数据。
19
- * @param param.callback - 当图例选择状态改变时触发的回调函数,接收一个 `LegendChangeType` 类型的参数。
20
- * @param param.defaultSelected - 图例的初始选择状态,可选参数。
18
+ * @param param.dimensions - 趋势图数值维度数组,用于提供图例项的数据,每个元素需包含 `id` 属性。
19
+ * @param param.callback - 当图例选择状态改变时触发的回调函数,接收一个 `LegendChangeType` 类型的参数,用于标识改变类型。
20
+ * @param param.defaultSelected - 图例的初始选择状态,可选参数,类型与 ECharts 图例配置中的 `selected` 一致。
21
21
  * @returns 包含图例选择状态和相关操作方法的对象。
22
22
  */
23
23
  export declare const useLegendSelectCtrl: (param: {
@@ -33,11 +33,18 @@ export declare const useLegendSelectCtrl: (param: {
33
33
  /**
34
34
  * 获取当前图例的选择状态。
35
35
  *
36
- * @returns 当前图例的选择状态。
36
+ * @returns 当前图例的选择状态,是一个键值对对象,键为维度 ID,值为布尔类型表示是否选中。
37
37
  */
38
38
  legendSelected: {
39
39
  [key: string]: boolean;
40
40
  };
41
+ /**
42
+ * 设置图例选择状态,考虑旧的选择状态。
43
+ * 根据传入的新选择状态和当前的选择状态重新生成最终的选择状态。
44
+ *
45
+ * @param legendSelected - 要设置的新图例选择状态,可选参数。
46
+ */
47
+ setLegendSelected(legendSelected?: Required<LegendComponentOption>["selected"]): void;
41
48
  onLegendSelectChanged: (event: any) => void;
42
49
  onSelectByAllBtnClick: () => void;
43
50
  onSelectByInvertBtnClick: () => void;