zzz-pc-view 0.0.91 → 0.0.92

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.92",
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({