@hw-component/table 0.0.5-beta-v7 → 0.0.5-beta-v9
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/es/HTableBody/RowSelection.js +1 -1
- package/es/HTableBody/index.js +1 -1
- package/es/index.css +0 -1
- package/lib/HTableBody/RowSelection.js +1 -1
- package/lib/HTableBody/index.js +1 -1
- package/lib/index.css +0 -1
- package/package.json +1 -1
- package/src/components/HTableBody/RowSelection.tsx +1 -1
- package/src/components/HTableBody/index.tsx +1 -1
- package/src/components/index.less +0 -1
- package/src/pages/Table/index.tsx +7 -1
- package/src/pages/TableCustomize/index.tsx +11 -9
|
@@ -26,7 +26,7 @@ var RowSelectionTitle = function RowSelectionTitle(_ref) {
|
|
|
26
26
|
_ref2$records = _ref2.records,
|
|
27
27
|
records = _ref2$records === void 0 ? [] : _ref2$records;
|
|
28
28
|
var newData = records === null || records === void 0 ? void 0 : _filterInstanceProperty(records).call(records, function (item) {
|
|
29
|
-
var _ref3 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(
|
|
29
|
+
var _ref3 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(item)) || {},
|
|
30
30
|
_ref3$disabled = _ref3.disabled,
|
|
31
31
|
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
|
|
32
32
|
return !disabled;
|
package/es/HTableBody/index.js
CHANGED
package/es/index.css
CHANGED
|
@@ -27,7 +27,7 @@ var RowSelectionTitle = function RowSelectionTitle(_ref) {
|
|
|
27
27
|
_ref2$records = _ref2.records,
|
|
28
28
|
records = _ref2$records === void 0 ? [] : _ref2$records;
|
|
29
29
|
var newData = records === null || records === void 0 ? void 0 : _filterInstanceProperty(records).call(records, function (item) {
|
|
30
|
-
var _ref3 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(
|
|
30
|
+
var _ref3 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(item)) || {},
|
|
31
31
|
_ref3$disabled = _ref3.disabled,
|
|
32
32
|
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
|
|
33
33
|
return !disabled;
|
package/lib/HTableBody/index.js
CHANGED
package/lib/index.css
CHANGED
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ export const RowSelectionTitle = ({
|
|
|
16
16
|
} = useHTableContext();
|
|
17
17
|
const { records = [] } = data || {};
|
|
18
18
|
const newData = records?.filter((item) => {
|
|
19
|
-
const { disabled = false } = getCheckboxProps?.(
|
|
19
|
+
const { disabled = false } = getCheckboxProps?.(item) || {};
|
|
20
20
|
return !disabled;
|
|
21
21
|
});
|
|
22
22
|
const { keys, selectAll } = selectedRowData;
|
|
@@ -36,7 +36,13 @@ export default () => {
|
|
|
36
36
|
configData={configData}
|
|
37
37
|
rowKey={"id"}
|
|
38
38
|
table={hTable}
|
|
39
|
-
rowSelection={{
|
|
39
|
+
rowSelection={{
|
|
40
|
+
getCheckboxProps:(item)=>{
|
|
41
|
+
return {
|
|
42
|
+
disabled:item.id===2
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}}
|
|
40
46
|
affixProps={{
|
|
41
47
|
target: () => document.querySelector(".body"),
|
|
42
48
|
}}
|
|
@@ -31,7 +31,13 @@ export default () => {
|
|
|
31
31
|
const { run, loading, error, data } = useRequest(
|
|
32
32
|
(params) => {
|
|
33
33
|
const { current = 1 } = params;
|
|
34
|
-
|
|
34
|
+
const arrayData = [];
|
|
35
|
+
for (let i = 0; i < 100; i = i + 1) {
|
|
36
|
+
arrayData.push({
|
|
37
|
+
id: i,
|
|
38
|
+
name: "11",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
35
41
|
return new Promise((resolve, reject) => {
|
|
36
42
|
setTimeout(() => {
|
|
37
43
|
// reject(new Error("错误"));
|
|
@@ -39,12 +45,7 @@ export default () => {
|
|
|
39
45
|
size: "10",
|
|
40
46
|
current: current.toString(10),
|
|
41
47
|
total: "100",
|
|
42
|
-
records:
|
|
43
|
-
{
|
|
44
|
-
id: 1,
|
|
45
|
-
name: "111",
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
+
records:arrayData
|
|
48
49
|
});
|
|
49
50
|
}, 2000);
|
|
50
51
|
});
|
|
@@ -62,9 +63,10 @@ export default () => {
|
|
|
62
63
|
<Space direction={"vertical"} style={{ width: "100%" }}>
|
|
63
64
|
<HTableHeader />
|
|
64
65
|
<HTableBody
|
|
65
|
-
pagination={false}
|
|
66
|
-
scroll={{ x: 1000, y: 100 }}
|
|
67
66
|
headerTitle={<AddBtn />}
|
|
67
|
+
affixProps={{
|
|
68
|
+
target: () => document.querySelector(".body"),
|
|
69
|
+
}}
|
|
68
70
|
rowSelection={{
|
|
69
71
|
onChange: () => {
|
|
70
72
|
console.log("rowSelection");
|