zzz-pc-view 0.0.89 → 0.0.91
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 +1 -1
- package/src/index.es.js +21 -13
- package/src/index.umd.js +1 -1
- package/src/utils/operator/selectCtrl.d.ts +31 -0
package/package.json
CHANGED
package/src/index.es.js
CHANGED
|
@@ -1926,20 +1926,28 @@ const selectCtrlByAll = (param) => {
|
|
|
1926
1926
|
};
|
|
1927
1927
|
const selectCtrlByInvert = (param) => {
|
|
1928
1928
|
const { keyProp, selected, defaultBoolean } = param;
|
|
1929
|
-
return param.toMap ?
|
|
1930
|
-
|
|
1929
|
+
return param.toMap ? (
|
|
1930
|
+
// 如果 toMap 为真,则使用 reduce 方法将列表转换为键值对对象
|
|
1931
|
+
param.list.reduce(
|
|
1932
|
+
(map2, item) => {
|
|
1933
|
+
const key2 = item[keyProp];
|
|
1934
|
+
const isSelect = Object.prototype.hasOwnProperty.call(selected, key2) ? selected[key2] : defaultBoolean;
|
|
1935
|
+
map2[key2] = !isSelect;
|
|
1936
|
+
return map2;
|
|
1937
|
+
},
|
|
1938
|
+
{}
|
|
1939
|
+
)
|
|
1940
|
+
) : (
|
|
1941
|
+
// 如果 toMap 为假,则使用 reduce 方法将列表转换为数组
|
|
1942
|
+
param.list.reduce((list2, item) => {
|
|
1931
1943
|
const key2 = item[keyProp];
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
list2.push(key2);
|
|
1940
|
-
}
|
|
1941
|
-
return list2;
|
|
1942
|
-
}, []);
|
|
1944
|
+
const isSelect = Object.prototype.hasOwnProperty.call(selected, key2) ? selected[key2] : defaultBoolean;
|
|
1945
|
+
if (!isSelect) {
|
|
1946
|
+
list2.push(key2);
|
|
1947
|
+
}
|
|
1948
|
+
return list2;
|
|
1949
|
+
}, [])
|
|
1950
|
+
);
|
|
1943
1951
|
};
|
|
1944
1952
|
const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1945
1953
|
__proto__: null,
|