@hw-component/table 1.9.26 → 1.9.27

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.
@@ -80,7 +80,6 @@ var DefaultSubComponent = function DefaultSubComponent(_ref) {
80
80
  onReset();
81
81
  return;
82
82
  }
83
- console.log("resetBtn");
84
83
  form.resetFields();
85
84
  },
86
85
  children: "\u91CD\u7F6E"
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,
@@ -81,7 +81,6 @@ var DefaultSubComponent = function DefaultSubComponent(_ref) {
81
81
  onReset();
82
82
  return;
83
83
  }
84
- console.log("resetBtn");
85
84
  form.resetFields();
86
85
  },
87
86
  children: "\u91CD\u7F6E"
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
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.9.26",
3
+ "version": "1.9.27",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -70,7 +70,6 @@ export const DefaultSubComponent = ({ form ,render}: IProps) => {
70
70
  onReset();
71
71
  return;
72
72
  }
73
- console.log("resetBtn")
74
73
  form.resetFields();
75
74
  }}
76
75
  >
@@ -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,
@@ -46,8 +46,8 @@ export const configData = [
46
46
  {
47
47
  showSearch: true,
48
48
  searchType: "submit",
49
- searchRender:(item,node,form)=>{
50
- console.log(form)
49
+ searchRender:(item,node,form,table)=>{
50
+ console.log(table)
51
51
  return <HTableHeaderSubBtn form={form} render={([sub,reset,more])=>{
52
52
  return <div>
53
53
  {sub}
@@ -192,6 +192,7 @@ export default () => {
192
192
  return index;
193
193
  }}
194
194
  table={hTable}
195
+ loading={true}
195
196
  onReset={() => {
196
197
  hTable.form.setFieldsValue({
197
198
  name1: "ffff",