doui-react 2.0.1-dev → 2.0.2

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.
@@ -23,7 +23,7 @@ function showAllToAllConfig() {
23
23
  var baseConfig = {
24
24
  showAll: true,
25
25
  allProps: {
26
- children: 'All'
26
+ children: '全选'
27
27
  }
28
28
  };
29
29
  if (showAll === true) {
@@ -7,7 +7,7 @@ var _excluded = ["rowKey", "loading", "columns", "dataSource", "editorValueKey"]
7
7
  _excluded2 = ["onlyLoading"],
8
8
  _excluded3 = ["onRowClick", "width", "emptyText"],
9
9
  _excluded4 = ["useFormWrapper", "context", "maxHeight"];
10
- import { executeFunction } from "../../api";
10
+ import { executeFunction, includesNonStrictMode } from "../../api";
11
11
  import { Empty } from "../../empty";
12
12
  import { Form, useFormContext } from "../../form";
13
13
  import { useListOperation } from "../../hooks";
@@ -98,12 +98,19 @@ function useInit(_ref2) {
98
98
  selectedRowKeys: selectedRowKeys,
99
99
  setSelectedRowKeys: function setSelectedRowKeys() {
100
100
  var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
101
- return _setSelectedRowKeys(keys);
101
+ updateSelectedStatus(keys);
102
+ _setSelectedRowKeys(keys);
102
103
  },
103
104
  operation: operation,
104
105
  rowKey: rowKey,
105
106
  editorValueKey: editorValueKey
106
107
  });
108
+ function updateSelectedStatus(keys) {
109
+ _.forEach(dataSource, function (item) {
110
+ var checked = includesNonStrictMode(keys, item[rowKey]);
111
+ _.set(item, '__selected__', checked);
112
+ });
113
+ }
107
114
  function refresh() {
108
115
  return _refresh.apply(this, arguments);
109
116
  }
@@ -30,7 +30,7 @@ function showAllToAllConfig() {
30
30
  var baseConfig = {
31
31
  showAll: true,
32
32
  allProps: {
33
- children: 'All'
33
+ children: '全选'
34
34
  }
35
35
  };
36
36
  if (showAll === true) {
@@ -106,12 +106,19 @@ function useInit(_ref2) {
106
106
  selectedRowKeys: selectedRowKeys,
107
107
  setSelectedRowKeys: function setSelectedRowKeys() {
108
108
  var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
109
- return _setSelectedRowKeys(keys);
109
+ updateSelectedStatus(keys);
110
+ _setSelectedRowKeys(keys);
110
111
  },
111
112
  operation: operation,
112
113
  rowKey: rowKey,
113
114
  editorValueKey: editorValueKey
114
115
  });
116
+ function updateSelectedStatus(keys) {
117
+ _lodash.default.forEach(dataSource, function (item) {
118
+ var checked = (0, _api.includesNonStrictMode)(keys, item[rowKey]);
119
+ _lodash.default.set(item, '__selected__', checked);
120
+ });
121
+ }
115
122
  function refresh() {
116
123
  return _refresh.apply(this, arguments);
117
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doui-react",
3
- "version": "2.0.1-dev",
3
+ "version": "2.0.2",
4
4
  "description": "A React UI library based on Ant Design",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -21,6 +21,7 @@
21
21
  "prepare": "if [ -z \"$SKIP_PREPARE\" ]; then yarn setup; fi",
22
22
  "prepublishOnly": "yarn lint && yarn build",
23
23
  "preview:docs": "dumi preview --port 3060",
24
+ "pub": "npm version patch && npm publish",
24
25
  "setup": "husky && dumi setup && patch-package",
25
26
  "test": "jest --coverage"
26
27
  },