@hw-component/table 1.9.26 → 1.9.28
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 +6 -2
- package/es/HTableHeader/defaultSubComponent.js +1 -2
- package/es/Table.d.ts +1 -1
- package/es/Table.js +5 -3
- package/lib/HTableBody/RowSelection.js +5 -1
- package/lib/HTableHeader/defaultSubComponent.js +1 -2
- package/lib/Table.d.ts +1 -1
- package/lib/Table.js +5 -3
- package/package.json +1 -1
- package/src/components/HTableBody/RowSelection.tsx +9 -2
- package/src/components/HTableHeader/defaultSubComponent.tsx +1 -2
- package/src/components/Table.tsx +4 -2
- package/src/pages/Table/index.tsx +0 -22
|
@@ -8,7 +8,7 @@ import _spliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import { useHTableContext } from '../context.js';
|
|
10
10
|
import { Dropdown, Checkbox, Menu } from 'antd';
|
|
11
|
-
import { useMemo } from 'react';
|
|
11
|
+
import { useMemo, useEffect } from 'react';
|
|
12
12
|
|
|
13
13
|
var RowSelectionTitle = function RowSelectionTitle(_ref) {
|
|
14
14
|
var _ref$allPageCheck = _ref.allPageCheck,
|
|
@@ -152,8 +152,12 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
|
|
|
152
152
|
var _ref6 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(data)) || {},
|
|
153
153
|
_ref6$disabled = _ref6.disabled,
|
|
154
154
|
disabled = _ref6$disabled === void 0 ? false : _ref6$disabled;
|
|
155
|
+
var checked = _indexOfInstanceProperty(keys).call(keys, key) !== -1;
|
|
156
|
+
useEffect(function () {
|
|
157
|
+
console.log("检测一次");
|
|
158
|
+
}, []);
|
|
155
159
|
return jsx(Checkbox, {
|
|
156
|
-
checked:
|
|
160
|
+
checked: checked,
|
|
157
161
|
onChange: check,
|
|
158
162
|
disabled: disabled
|
|
159
163
|
});
|
package/es/Table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HTableProps } from "./modal";
|
|
3
|
-
declare const _default: ({ request, configData, searchSpan, table, hideHeader, headerStyle, tableStyle, action, spaceSize, className, paginationStyle, rowKey, onFinish, manual, formInitValues, hideLabel, labelWidth, onReset, style, dataSource, reload, ...props }: HTableProps) => JSX.Element;
|
|
3
|
+
declare const _default: ({ request, configData, searchSpan, table, hideHeader, headerStyle, tableStyle, action, spaceSize, className, paginationStyle, rowKey, onFinish, manual, formInitValues, hideLabel, labelWidth, onReset, style, dataSource, reload, loading: propsLoading, error: propsError, ...props }: HTableProps) => JSX.Element;
|
|
4
4
|
export default _default;
|
package/es/Table.js
CHANGED
|
@@ -22,7 +22,7 @@ import useDispatch from './hooks/useDispatch.js';
|
|
|
22
22
|
import { useState } from 'react';
|
|
23
23
|
import { useClassName } from './hooks/index.js';
|
|
24
24
|
|
|
25
|
-
var _excluded = ["request", "configData", "searchSpan", "table", "hideHeader", "headerStyle", "tableStyle", "action", "spaceSize", "className", "paginationStyle", "rowKey", "onFinish", "manual", "formInitValues", "hideLabel", "labelWidth", "onReset", "style", "dataSource", "reload"];
|
|
25
|
+
var _excluded = ["request", "configData", "searchSpan", "table", "hideHeader", "headerStyle", "tableStyle", "action", "spaceSize", "className", "paginationStyle", "rowKey", "onFinish", "manual", "formInitValues", "hideLabel", "labelWidth", "onReset", "style", "dataSource", "reload", "loading", "error"];
|
|
26
26
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
28
|
var Table = (function (_ref) {
|
|
@@ -50,6 +50,8 @@ var Table = (function (_ref) {
|
|
|
50
50
|
style = _ref.style,
|
|
51
51
|
dataSource = _ref.dataSource,
|
|
52
52
|
reload = _ref.reload,
|
|
53
|
+
propsLoading = _ref.loading,
|
|
54
|
+
propsError = _ref.error,
|
|
53
55
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
54
56
|
var _useReq = useReq({
|
|
55
57
|
request: request,
|
|
@@ -99,8 +101,8 @@ var Table = (function (_ref) {
|
|
|
99
101
|
selectedRowData: selectedRowData,
|
|
100
102
|
rowOnChange: rowOnChange,
|
|
101
103
|
data: data,
|
|
102
|
-
error: error,
|
|
103
|
-
loading: loading,
|
|
104
|
+
error: propsError || error,
|
|
105
|
+
loading: propsLoading || loading,
|
|
104
106
|
allSelectChange: allSelectChange,
|
|
105
107
|
action: action,
|
|
106
108
|
configData: configData,
|
|
@@ -153,8 +153,12 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
|
|
|
153
153
|
var _ref6 = (getCheckboxProps === null || getCheckboxProps === void 0 ? void 0 : getCheckboxProps(data)) || {},
|
|
154
154
|
_ref6$disabled = _ref6.disabled,
|
|
155
155
|
disabled = _ref6$disabled === void 0 ? false : _ref6$disabled;
|
|
156
|
+
var checked = _indexOfInstanceProperty(keys).call(keys, key) !== -1;
|
|
157
|
+
React.useEffect(function () {
|
|
158
|
+
console.log("检测一次");
|
|
159
|
+
}, []);
|
|
156
160
|
return jsxRuntime.jsx(antd.Checkbox, {
|
|
157
|
-
checked:
|
|
161
|
+
checked: checked,
|
|
158
162
|
onChange: check,
|
|
159
163
|
disabled: disabled
|
|
160
164
|
});
|
package/lib/Table.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HTableProps } from "./modal";
|
|
3
|
-
declare const _default: ({ request, configData, searchSpan, table, hideHeader, headerStyle, tableStyle, action, spaceSize, className, paginationStyle, rowKey, onFinish, manual, formInitValues, hideLabel, labelWidth, onReset, style, dataSource, reload, ...props }: HTableProps) => JSX.Element;
|
|
3
|
+
declare const _default: ({ request, configData, searchSpan, table, hideHeader, headerStyle, tableStyle, action, spaceSize, className, paginationStyle, rowKey, onFinish, manual, formInitValues, hideLabel, labelWidth, onReset, style, dataSource, reload, loading: propsLoading, error: propsError, ...props }: HTableProps) => JSX.Element;
|
|
4
4
|
export default _default;
|
package/lib/Table.js
CHANGED
|
@@ -25,7 +25,7 @@ var useDispatch = require('./hooks/useDispatch.js');
|
|
|
25
25
|
var React = require('react');
|
|
26
26
|
var index = require('./hooks/index.js');
|
|
27
27
|
|
|
28
|
-
var _excluded = ["request", "configData", "searchSpan", "table", "hideHeader", "headerStyle", "tableStyle", "action", "spaceSize", "className", "paginationStyle", "rowKey", "onFinish", "manual", "formInitValues", "hideLabel", "labelWidth", "onReset", "style", "dataSource", "reload"];
|
|
28
|
+
var _excluded = ["request", "configData", "searchSpan", "table", "hideHeader", "headerStyle", "tableStyle", "action", "spaceSize", "className", "paginationStyle", "rowKey", "onFinish", "manual", "formInitValues", "hideLabel", "labelWidth", "onReset", "style", "dataSource", "reload", "loading", "error"];
|
|
29
29
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
31
|
var Table = (function (_ref) {
|
|
@@ -53,6 +53,8 @@ var Table = (function (_ref) {
|
|
|
53
53
|
style = _ref.style,
|
|
54
54
|
dataSource = _ref.dataSource,
|
|
55
55
|
reload = _ref.reload,
|
|
56
|
+
propsLoading = _ref.loading,
|
|
57
|
+
propsError = _ref.error,
|
|
56
58
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
59
|
var _useReq = useReq.default({
|
|
58
60
|
request: request,
|
|
@@ -102,8 +104,8 @@ var Table = (function (_ref) {
|
|
|
102
104
|
selectedRowData: selectedRowData,
|
|
103
105
|
rowOnChange: rowOnChange,
|
|
104
106
|
data: data,
|
|
105
|
-
error: error,
|
|
106
|
-
loading: loading,
|
|
107
|
+
error: propsError || error,
|
|
108
|
+
loading: propsLoading || loading,
|
|
107
109
|
allSelectChange: allSelectChange,
|
|
108
110
|
action: action,
|
|
109
111
|
configData: configData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useHTableContext } from "../context";
|
|
2
2
|
import { Checkbox, Dropdown, Menu } from "antd";
|
|
3
|
-
import { useMemo
|
|
3
|
+
import {useEffect, useMemo} from "react";
|
|
4
4
|
import type { HRowSelection } from "../modal";
|
|
5
5
|
export const RowSelectionTitle = ({
|
|
6
6
|
allPageCheck = true,
|
|
@@ -137,9 +137,16 @@ export const RowSelectionBox = ({
|
|
|
137
137
|
onChange?.(newKeys, newRowData);
|
|
138
138
|
};
|
|
139
139
|
const { disabled = false } = getCheckboxProps?.(data) || {};
|
|
140
|
+
const checked=keys.indexOf(key) !== -1;
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (checked){
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
console.log("检测一次")
|
|
146
|
+
}, []);
|
|
140
147
|
return (
|
|
141
148
|
<Checkbox
|
|
142
|
-
checked={
|
|
149
|
+
checked={checked}
|
|
143
150
|
onChange={check}
|
|
144
151
|
disabled={disabled}
|
|
145
152
|
/>
|
package/src/components/Table.tsx
CHANGED
|
@@ -31,6 +31,8 @@ export default ({
|
|
|
31
31
|
style,
|
|
32
32
|
dataSource,
|
|
33
33
|
reload,
|
|
34
|
+
loading:propsLoading,
|
|
35
|
+
error:propsError,
|
|
34
36
|
...props
|
|
35
37
|
}: HTableProps) => {
|
|
36
38
|
const { run, loading, data, error, saveParams } = useReq({
|
|
@@ -70,8 +72,8 @@ export default ({
|
|
|
70
72
|
selectedRowData,
|
|
71
73
|
rowOnChange,
|
|
72
74
|
data,
|
|
73
|
-
error,
|
|
74
|
-
loading,
|
|
75
|
+
error:propsError||error,
|
|
76
|
+
loading:(propsLoading as boolean)||loading,
|
|
75
77
|
allSelectChange,
|
|
76
78
|
action,
|
|
77
79
|
configData,
|
|
@@ -43,20 +43,6 @@ export const configData = [
|
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
-
{
|
|
47
|
-
showSearch: true,
|
|
48
|
-
searchType: "submit",
|
|
49
|
-
searchRender:(item,node,form)=>{
|
|
50
|
-
console.log(form)
|
|
51
|
-
return <HTableHeaderSubBtn form={form} render={([sub,reset,more])=>{
|
|
52
|
-
return <div>
|
|
53
|
-
{sub}
|
|
54
|
-
{reset}
|
|
55
|
-
{more}
|
|
56
|
-
</div>
|
|
57
|
-
}}/>
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
46
|
{
|
|
61
47
|
title: "短信接收手机号",
|
|
62
48
|
dataIndex: "mobileList",
|
|
@@ -185,18 +171,10 @@ export default () => {
|
|
|
185
171
|
searchSpan={{
|
|
186
172
|
span:24
|
|
187
173
|
}}
|
|
188
|
-
onFinish={() => {
|
|
189
|
-
console.log("fff");
|
|
190
|
-
}}
|
|
191
174
|
rowKey={(rowData, index) => {
|
|
192
175
|
return index;
|
|
193
176
|
}}
|
|
194
177
|
table={hTable}
|
|
195
|
-
onReset={() => {
|
|
196
|
-
hTable.form.setFieldsValue({
|
|
197
|
-
name1: "ffff",
|
|
198
|
-
});
|
|
199
|
-
}}
|
|
200
178
|
labelWidth={88}
|
|
201
179
|
action={{
|
|
202
180
|
test: (params) => {
|