zzz-pc-view 0.0.91 → 0.0.93

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zzz-pc-view",
3
- "version": "0.0.91",
3
+ "version": "0.0.93",
4
4
  "main": "src/index.umd.js",
5
5
  "module": "src/index.es.js",
6
6
  "types": "src/index.d.ts",
package/src/index.es.js CHANGED
@@ -1949,9 +1949,26 @@ const selectCtrlByInvert = (param) => {
1949
1949
  }, [])
1950
1950
  );
1951
1951
  };
1952
+ const selectCtrlByClear = (param) => {
1953
+ const { keyProp } = param;
1954
+ return param.toMap ? (
1955
+ // 如果 toMap 为真,则使用 reduce 方法将列表转换为键值对对象,所有键对应的选择状态都设为 false
1956
+ param.list.reduce(
1957
+ (map2, item) => {
1958
+ map2[item[keyProp]] = false;
1959
+ return map2;
1960
+ },
1961
+ {}
1962
+ )
1963
+ ) : (
1964
+ // 如果 toMap 为假或未提供,则返回一个空数组
1965
+ []
1966
+ );
1967
+ };
1952
1968
  const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1953
1969
  __proto__: null,
1954
1970
  selectCtrlByAll,
1971
+ selectCtrlByClear,
1955
1972
  selectCtrlByInvert
1956
1973
  }, Symbol.toStringTag, { value: "Module" }));
1957
1974
  const ZUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -2904,11 +2921,15 @@ const useChartStyleConfig = (param) => {
2904
2921
  // 坐标轴名称的字体大小,如果未提供则使用默认值 12
2905
2922
  axisNameFontSize: param.axisNameFontSize ?? 12,
2906
2923
  /**
2907
- * 计算并返回坐标轴名称间隙,通过平均坐标轴字体大小和坐标轴名称字体大小得到。
2924
+ * 计算并返回坐标轴名称间隙的计算值。
2925
+ * 该方法会比较坐标轴名称字体大小的一半向上取整的值,
2926
+ * 以及坐标轴字体大小的一半加 3 后向上取整的值,
2927
+ * 最终返回两者中的较大值作为坐标轴名称间隙。
2928
+ *
2908
2929
  * @returns {number} 坐标轴名称间隙的计算值
2909
2930
  */
2910
2931
  get axisNameGap() {
2911
- return Math.ceil(this.axisNameFontSize / 2);
2932
+ return Math.max(Math.ceil(this.axisNameFontSize / 2), Math.ceil(this.axisFontSize / 2 + 3));
2912
2933
  },
2913
2934
  // 坐标轴标签的边距,如果未提供则使用默认值 8
2914
2935
  axisLabelMargin: param.axisLabelMargin ?? 8,